Skip to content

fix: update --web-socket-server description #4098

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

Merged
merged 1 commit into from
Dec 11, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Options:
--client-web-socket-url-protocol <value> Tells clients connected to devServer to use the provided protocol.
--client-web-socket-url-username <value> Tells clients connected to devServer to use the provided username to authenticate.
--client-web-socket-url-password <value> Tells clients connected to devServer to use the provided password to authenticate.
--web-socket-server <value> Deprecated: please use 'webSocketServer.type'/'--web-socket-server-type' option. Allows to set web socket server and options (by default 'ws').
--web-socket-server <value> Deprecated: please use '--web-socket-server-type' option. Allows to set web socket server and options (by default 'ws').
--no-web-socket-server Negative 'web-socket-server' option.
--web-socket-server-type <value> Allows to set web socket server and options (by default 'ws').
--compress Enables gzip compression for everything served.
Expand Down
6 changes: 3 additions & 3 deletions bin/cli-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,15 +319,15 @@ module.exports = {
configs: [
{
description:
"Deprecated: please use 'webSocketServer.type'/'--web-socket-server-type' option.",
"Deprecated: please use '--web-socket-server-type' option.",
multiple: false,
path: "webSocketServer",
type: "enum",
values: [false],
},
{
description:
"Deprecated: please use 'webSocketServer.type'/'--web-socket-server-type' option.",
"Deprecated: please use '--web-socket-server-type' option.",
multiple: false,
path: "webSocketServer",
type: "enum",
Expand All @@ -343,7 +343,7 @@ module.exports = {
],

description:
"Deprecated: please use 'webSocketServer.type'/'--web-socket-server-type' option. Allows to set web socket server and options (by default 'ws').",
"Deprecated: please use '--web-socket-server-type' option. Allows to set web socket server and options (by default 'ws').",
simpleType: "string",
multiple: false,
},
Expand Down
2 changes: 1 addition & 1 deletion lib/options.json
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@
"$ref": "#/definitions/WebSocketServerType"
}
],
"description": "Deprecated: please use 'webSocketServer.type'/'--web-socket-server-type' option."
"description": "Deprecated: please use '--web-socket-server-type' option."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if displaying the flag makes sense when the user is using the feature from config

Copy link
Member Author

@snitin315 snitin315 Dec 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, we should have a cliDescription property which webpack should respect if available. https://github.com/webpack/webpack/blob/c854e30df7f879d9989a7ab7aa83d1f0d1fa6862/lib/cli.js#L97

},
"WebSocketServerFunction": {
"instanceof": "Function"
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/validate-options.test.js.snap.webpack4
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ exports[`options validate should throw an error on the "webSocketServer" option
Details:
* options.webSocketServer should be one of these:
false | \\"sockjs\\" | \\"ws\\"
-> Deprecated: please use 'webSocketServer.type'/'--web-socket-server-type' option.
-> Deprecated: please use '--web-socket-server-type' option.
Details:
* options.webSocketServer should be false.
* options.webSocketServer should be one of these:
Expand All @@ -928,7 +928,7 @@ exports[`options validate should throw an error on the "webSocketServer" option
Details:
* options.webSocketServer should be one of these:
false | \\"sockjs\\" | \\"ws\\"
-> Deprecated: please use 'webSocketServer.type'/'--web-socket-server-type' option.
-> Deprecated: please use '--web-socket-server-type' option.
Details:
* options.webSocketServer should be false.
* options.webSocketServer should be one of these:
Expand Down
4 changes: 2 additions & 2 deletions test/__snapshots__/validate-options.test.js.snap.webpack5
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ exports[`options validate should throw an error on the "webSocketServer" option
Details:
* options.webSocketServer should be one of these:
false | \\"sockjs\\" | \\"ws\\"
-> Deprecated: please use 'webSocketServer.type'/'--web-socket-server-type' option.
-> Deprecated: please use '--web-socket-server-type' option.
Details:
* options.webSocketServer should be false.
* options.webSocketServer should be one of these:
Expand All @@ -928,7 +928,7 @@ exports[`options validate should throw an error on the "webSocketServer" option
Details:
* options.webSocketServer should be one of these:
false | \\"sockjs\\" | \\"ws\\"
-> Deprecated: please use 'webSocketServer.type'/'--web-socket-server-type' option.
-> Deprecated: please use '--web-socket-server-type' option.
Details:
* options.webSocketServer should be false.
* options.webSocketServer should be one of these:
Expand Down
2 changes: 1 addition & 1 deletion test/cli/__snapshots__/basic.test.js.snap.webpack4
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Options:
--client-web-socket-url-protocol <value> Tells clients connected to devServer to use the provided protocol.
--client-web-socket-url-username <value> Tells clients connected to devServer to use the provided username to authenticate.
--client-web-socket-url-password <value> Tells clients connected to devServer to use the provided password to authenticate.
--web-socket-server <value> Deprecated: please use 'webSocketServer.type'/'--web-socket-server-type' option. Allows to set web socket server and options (by default 'ws').
--web-socket-server <value> Deprecated: please use '--web-socket-server-type' option. Allows to set web socket server and options (by default 'ws').
--no-web-socket-server Negative 'web-socket-server' option.
--web-socket-server-type <value> Allows to set web socket server and options (by default 'ws').
--compress Enables gzip compression for everything served.
Expand Down
2 changes: 1 addition & 1 deletion test/cli/__snapshots__/basic.test.js.snap.webpack5
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Options:
--static-public-path-reset Clear all items provided in 'static.publicPath' configuration. The static files will be available in the browser under this public path.
--watch-files <value...> Allows to configure list of globs/directories/files to watch for file changes.
--watch-files-reset Clear all items provided in 'watchFiles' configuration. Allows to configure list of globs/directories/files to watch for file changes.
--web-socket-server <value> Deprecated: please use 'webSocketServer.type'/'--web-socket-server-type' option. Allows to set web socket server and options (by default 'ws').
--web-socket-server <value> Deprecated: please use '--web-socket-server-type' option. Allows to set web socket server and options (by default 'ws').
--no-web-socket-server Negative 'web-socket-server' option.
--web-socket-server-type <value> Allows to set web socket server and options (by default 'ws').

Expand Down