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: correct schema for ClientLogging #4084

Merged
merged 2 commits into from
Dec 8, 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
6 changes: 2 additions & 4 deletions bin/cli-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,11 @@ module.exports = {
type: "enum",
values: ["none", "error", "warn", "info", "log", "verbose"],
multiple: false,
description:
"Allows to specify options for client script in the browser or disable client script.",
description: "Allows to set log level in the browser.",
path: "client.logging",
},
],
description:
"Allows to specify options for client script in the browser or disable client script.",
description: "Allows to set log level in the browser.",
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 @@ -74,7 +74,7 @@
},
"ClientLogging": {
"enum": ["none", "error", "warn", "info", "log", "verbose"],
"decription": "Allows to set log level in the browser.",
"description": "Allows to set log level in the browser.",
"link": "https://webpack.js.org/configuration/dev-server/#logging"
},
"ClientOverlay": {
Expand Down
2 changes: 2 additions & 0 deletions test/__snapshots__/validate-options.test.js.snap.webpack4
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ exports[`options validate should throw an error on the "client" option with '{"l
"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options.client.logging should be one of these:
\\"none\\" | \\"error\\" | \\"warn\\" | \\"info\\" | \\"log\\" | \\"verbose\\"
-> Allows to set log level in the browser.
-> Read more at https://webpack.js.org/configuration/dev-server/#logging"
`;

exports[`options validate should throw an error on the "client" option with '{"logging":"whoops!"}' value 1`] = `
"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options.client.logging should be one of these:
\\"none\\" | \\"error\\" | \\"warn\\" | \\"info\\" | \\"log\\" | \\"verbose\\"
-> Allows to set log level in the browser.
-> Read more at https://webpack.js.org/configuration/dev-server/#logging"
`;

Expand Down
2 changes: 2 additions & 0 deletions test/__snapshots__/validate-options.test.js.snap.webpack5
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ exports[`options validate should throw an error on the "client" option with '{"l
"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options.client.logging should be one of these:
\\"none\\" | \\"error\\" | \\"warn\\" | \\"info\\" | \\"log\\" | \\"verbose\\"
-> Allows to set log level in the browser.
-> Read more at https://webpack.js.org/configuration/dev-server/#logging"
`;

exports[`options validate should throw an error on the "client" option with '{"logging":"whoops!"}' value 1`] = `
"ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options.client.logging should be one of these:
\\"none\\" | \\"error\\" | \\"warn\\" | \\"info\\" | \\"log\\" | \\"verbose\\"
-> Allows to set log level in the browser.
-> Read more at https://webpack.js.org/configuration/dev-server/#logging"
`;

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 @@ -60,7 +60,7 @@ Options:
--no-bonjour Disallows to broadcasts dev server via ZeroConf networking on start.
--client-web-socket-transport <value> Allows to set custom web socket transport to communicate with dev server.
--no-client Negative 'client' option.
--client-logging <value> Allows to specify options for client script in the browser or disable client script.
--client-logging <value> Allows to set log level in the browser.
--client-progress Prints compilation progress in percentage in the browser.
--no-client-progress Does not print compilation progress in percentage in the browser.
--client-overlay Enables a full-screen overlay in the browser when there are compiler errors or warnings.
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 @@ -60,7 +60,7 @@ Options:
--bonjour Allows to broadcasts dev server via ZeroConf networking on start.
--no-bonjour Negative 'bonjour' option.
--no-client Negative 'client' option.
--client-logging <value> Allows to specify options for client script in the browser or disable client script.
--client-logging <value> Allows to set log level in the browser.
--client-overlay Enables a full-screen overlay in the browser when there are compiler errors or warnings.
--no-client-overlay Negative 'client-overlay' option.
--client-overlay-errors Enables a full-screen overlay in the browser when there are compiler errors.
Expand Down