File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 "@webpack-cli/info" : " ^2.0.2" ,
4040 "@webpack-cli/serve" : " ^2.0.5" ,
4141 "colorette" : " ^2.0.14" ,
42- "commander" : " ^10.0.1 " ,
42+ "commander" : " ^12.1.0 " ,
4343 "cross-spawn" : " ^7.0.3" ,
4444 "envinfo" : " ^7.14.0" ,
4545 "fastest-levenshtein" : " ^1.0.12" ,
Original file line number Diff line number Diff line change @@ -1669,7 +1669,8 @@ class WebpackCLI implements IWebpackCLI {
16691669 process . exit ( 0 ) ;
16701670 } ;
16711671 this . program . helpOption ( false ) ;
1672- this . program . addHelpCommand ( false ) ;
1672+ // Suppress the default help command
1673+ this . program . helpCommand ( false ) ;
16731674 this . program . option ( "-h, --help [verbose]" , "Display help for commands and options." ) ;
16741675
16751676 let isInternalActionCalled = false ;
Original file line number Diff line number Diff line change @@ -1703,11 +1703,9 @@ describe("CLI API", () => {
17031703 consoleSpy = jest . spyOn ( global . console , "log" ) ;
17041704 exitSpy = jest . spyOn ( process , "exit" ) . mockImplementation ( ( ) => { } ) ;
17051705
1706- cli . program . option ( "--color [value]" , "any color" , "blue" ) ;
1707-
17081706 await new Promise ( ( resolve , reject ) => {
17091707 try {
1710- cli . run ( [ "help" , "--color " ] , { from : "user" } ) ;
1708+ cli . run ( [ "help" , "--mode " ] , { from : "user" } ) ;
17111709 resolve ( ) ;
17121710 } catch ( error ) {
17131711 reject ( error ) ;
Original file line number Diff line number Diff line change 33exports[`CLI API custom help output should display help information 1`] = `
44[
55 [
6- "[1mUsage[22m : webpack --color [ value] ",
6+ "Usage : webpack --mode < value> ",
77 ],
88 [
9- "[1mDescription:[22m any color ",
9+ "Description: Enable production optimizations or development hints. ",
1010 ],
1111 [
12- "[1mDefault value:[22m "blue "",
12+ "Possible values: "development | production | none "",
1313 ],
1414 [
1515 "",
@@ -19,13 +19,13 @@ exports[`CLI API custom help output should display help information 1`] = `
1919",
2020 ],
2121 [
22- "[1mWebpack documentation:[22m https://webpack.js.org/.",
22+ "Webpack documentation: https://webpack.js.org/.",
2323 ],
2424 [
25- "[1mCLI documentation:[22m https://webpack.js.org/api/cli/.",
25+ "CLI documentation: https://webpack.js.org/api/cli/.",
2626 ],
2727 [
28- "[1mMade with ♥ by the webpack team[22m .",
28+ "Made with ♥ by the webpack team.",
2929 ],
3030]
3131`;
Original file line number Diff line number Diff line change @@ -4142,11 +4142,6 @@ combined-stream@^1.0.8:
41424142 dependencies :
41434143 delayed-stream "~1.0.0"
41444144
4145- commander@^10.0.1 :
4146- version "10.0.1"
4147- resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06"
4148- integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==
4149-
41504145commander@^12.1.0, commander@~12.1.0 :
41514146 version "12.1.0"
41524147 resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3"
You can’t perform that action at this time.
0 commit comments