File tree 5 files changed +10
-16
lines changed
5 files changed +10
-16
lines changed Original file line number Diff line number Diff line change 39
39
"@webpack-cli/info" : " ^2.0.2" ,
40
40
"@webpack-cli/serve" : " ^2.0.5" ,
41
41
"colorette" : " ^2.0.14" ,
42
- "commander" : " ^10.0.1 " ,
42
+ "commander" : " ^12.1.0 " ,
43
43
"cross-spawn" : " ^7.0.3" ,
44
44
"envinfo" : " ^7.14.0" ,
45
45
"fastest-levenshtein" : " ^1.0.12" ,
Original file line number Diff line number Diff line change @@ -1669,7 +1669,8 @@ class WebpackCLI implements IWebpackCLI {
1669
1669
process . exit ( 0 ) ;
1670
1670
} ;
1671
1671
this . program . helpOption ( false ) ;
1672
- this . program . addHelpCommand ( false ) ;
1672
+ // Suppress the default help command
1673
+ this . program . helpCommand ( false ) ;
1673
1674
this . program . option ( "-h, --help [verbose]" , "Display help for commands and options." ) ;
1674
1675
1675
1676
let isInternalActionCalled = false ;
Original file line number Diff line number Diff line change @@ -1703,11 +1703,9 @@ describe("CLI API", () => {
1703
1703
consoleSpy = jest . spyOn ( global . console , "log" ) ;
1704
1704
exitSpy = jest . spyOn ( process , "exit" ) . mockImplementation ( ( ) => { } ) ;
1705
1705
1706
- cli . program . option ( "--color [value]" , "any color" , "blue" ) ;
1707
-
1708
1706
await new Promise ( ( resolve , reject ) => {
1709
1707
try {
1710
- cli . run ( [ "help" , "--color " ] , { from : "user" } ) ;
1708
+ cli . run ( [ "help" , "--mode " ] , { from : "user" } ) ;
1711
1709
resolve ( ) ;
1712
1710
} catch ( error ) {
1713
1711
reject ( error ) ;
Original file line number Diff line number Diff line change 3
3
exports[`CLI API custom help output should display help information 1`] = `
4
4
[
5
5
[
6
- "[1mUsage[22m : webpack --color [ value] ",
6
+ "Usage : webpack --mode < value> ",
7
7
],
8
8
[
9
- "[1mDescription:[22m any color ",
9
+ "Description: Enable production optimizations or development hints. ",
10
10
],
11
11
[
12
- "[1mDefault value:[22m "blue "",
12
+ "Possible values: "development | production | none "",
13
13
],
14
14
[
15
15
"",
@@ -19,13 +19,13 @@ exports[`CLI API custom help output should display help information 1`] = `
19
19
",
20
20
],
21
21
[
22
- "[1mWebpack documentation:[22m https://webpack.js.org/.",
22
+ "Webpack documentation: https://webpack.js.org/.",
23
23
],
24
24
[
25
- "[1mCLI documentation:[22m https://webpack.js.org/api/cli/.",
25
+ "CLI documentation: https://webpack.js.org/api/cli/.",
26
26
],
27
27
[
28
- "[1mMade with ♥ by the webpack team[22m .",
28
+ "Made with ♥ by the webpack team.",
29
29
],
30
30
]
31
31
`;
Original file line number Diff line number Diff line change @@ -4142,11 +4142,6 @@ combined-stream@^1.0.8:
4142
4142
dependencies :
4143
4143
delayed-stream "~1.0.0"
4144
4144
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
-
4150
4145
commander@^12.1.0, commander@~12.1.0 :
4151
4146
version "12.1.0"
4152
4147
resolved "https://registry.yarnpkg.com/commander/-/commander-12.1.0.tgz#01423b36f501259fdaac4d0e4d60c96c991585d3"
You can’t perform that action at this time.
0 commit comments