Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: mark --open-app deprecated in favor of --open-app-name #4091

Merged
merged 3 commits into from Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -160,7 +160,7 @@ Options:
--no-open Does not open the default browser.
--open-target <value...> Opens specified page in browser.
--open-app-name <value...> Open specified browser.
--open-app <value...> Open specified browser.
--open-app <value...> Open specified browser. Deprecated: please use '--open-app-name'.
--open-reset Clear all items provided in 'open' configuration. Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).
--open-target-reset Clear all items provided in 'open.target' configuration. Opens specified page in browser.
--open-app-name-reset Clear all items provided in 'open.app.name' configuration. Open specified browser.
Expand Down
6 changes: 4 additions & 2 deletions bin/cli-flags.js
Expand Up @@ -806,11 +806,13 @@ module.exports = {
{
type: "string",
multiple: true,
description: "Open specified browser.",
description:
"Open specified browser. Deprecated: please use '--open-app-name'.",
path: "open[].app",
},
],
description: "Open specified browser.",
description:
"Open specified browser. Deprecated: please use '--open-app-name'.",
simpleType: "string",
multiple: true,
},
Expand Down
1 change: 1 addition & 0 deletions lib/Server.js
Expand Up @@ -910,6 +910,7 @@ class Server {

// https://github.com/webpack/webpack-dev-server/issues/1990
const defaultOpenOptions = { wait: false };
// TODO: remove --open-app in favor of --open-app-name
const getOpenItemsFromObject = ({ target, ...rest }) => {
const normalizedOptions = { ...defaultOpenOptions, ...rest };

Expand Down
3 changes: 2 additions & 1 deletion lib/options.json
Expand Up @@ -580,7 +580,8 @@
},
{
"type": "string",
"minLength": 1
"minLength": 1,
"description": "Open specified browser. Deprecated: please use '--open-app-name'."
}
],
"description": "Open specified browser."
Expand Down
3 changes: 2 additions & 1 deletion test/__snapshots__/validate-options.test.js.snap.webpack4
Expand Up @@ -520,7 +520,8 @@ exports[`options validate should throw an error on the "open" option with '{"app
Details:
* options.open.app should be an object:
object { name?, arguments? }
* options.open.app should be a non-empty string."
* options.open.app should be a non-empty string.
-> Open specified browser. Deprecated: please use '--open-app-name'."
`;

exports[`options validate should throw an error on the "open" option with '{"foo":"bar"}' value 1`] = `
Expand Down
3 changes: 2 additions & 1 deletion test/__snapshots__/validate-options.test.js.snap.webpack5
Expand Up @@ -520,7 +520,8 @@ exports[`options validate should throw an error on the "open" option with '{"app
Details:
* options.open.app should be an object:
object { name?, arguments? }
* options.open.app should be a non-empty string."
* options.open.app should be a non-empty string.
-> Open specified browser. Deprecated: please use '--open-app-name'."
`;

exports[`options validate should throw an error on the "open" option with '{"foo":"bar"}' value 1`] = `
Expand Down
2 changes: 1 addition & 1 deletion test/cli/__snapshots__/basic.test.js.snap.webpack4
Expand Up @@ -116,7 +116,7 @@ Options:
--no-open Does not open the default browser.
--open-target <value...> Opens specified page in browser.
--open-app-name <value...> Open specified browser.
--open-app <value...> Open specified browser.
--open-app <value...> Open specified browser. Deprecated: please use '--open-app-name'.
--open-reset Clear all items provided in 'open' configuration. Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).
--open-target-reset Clear all items provided in 'open.target' configuration. Opens specified page in browser.
--open-app-name-reset Clear all items provided in 'open.app.name' configuration. Open specified browser.
Expand Down
2 changes: 1 addition & 1 deletion test/cli/__snapshots__/basic.test.js.snap.webpack5
Expand Up @@ -114,7 +114,7 @@ Options:
--no-open Negative 'open' option.
--open-target <value...> Opens specified page in browser.
--open-app-name <value...> Open specified browser.
--open-app <value...> Open specified browser.
--open-app <value...> Open specified browser. Deprecated: please use '--open-app-name'.
--open-reset Clear all items provided in 'open' configuration. Allows to configure dev server to open the browser(s) and page(s) after server had been started (set it to true to open your default browser).
--open-target-reset Clear all items provided in 'open.target' configuration. Opens specified page in browser.
--open-app-name-reset Clear all items provided in 'open.app.name' configuration. Open specified browser.
Expand Down