Skip to content

Commit fd854c0

Browse files
authored
fix: negative descriptions (#4216)
1 parent 9864793 commit fd854c0

File tree

7 files changed

+455
-794
lines changed

7 files changed

+455
-794
lines changed

bin/cli-flags.js

+26-22
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ module.exports = {
4646
multiple: false,
4747
description:
4848
"Allows to broadcasts dev server via ZeroConf networking on start.",
49+
negatedDescription:
50+
"Disallows to broadcasts dev server via ZeroConf networking on start.",
4951
path: "bonjour",
5052
},
5153
],
5254
description:
5355
"Allows to broadcasts dev server via ZeroConf networking on start.",
54-
negatedDescription:
55-
"Disallows to broadcasts dev server via ZeroConf networking on start.",
5656
simpleType: "boolean",
5757
multiple: false,
5858
},
@@ -93,13 +93,13 @@ module.exports = {
9393
multiple: false,
9494
description:
9595
"Enables a full-screen overlay in the browser when there are compiler errors or warnings.",
96+
negatedDescription:
97+
"Disables a full-screen overlay in the browser when there are compiler errors or warnings.",
9698
path: "client.overlay",
9799
},
98100
],
99101
description:
100102
"Enables a full-screen overlay in the browser when there are compiler errors or warnings.",
101-
negatedDescription:
102-
"Disables a full-screen overlay in the browser when there are compiler errors or warnings.",
103103
simpleType: "boolean",
104104
multiple: false,
105105
},
@@ -140,12 +140,12 @@ module.exports = {
140140
multiple: false,
141141
description:
142142
"Prints compilation progress in percentage in the browser.",
143+
negatedDescription:
144+
"Does not print compilation progress in percentage in the browser.",
143145
path: "client.progress",
144146
},
145147
],
146148
description: "Prints compilation progress in percentage in the browser.",
147-
negatedDescription:
148-
"Does not print compilation progress in percentage in the browser.",
149149
simpleType: "boolean",
150150
multiple: false,
151151
},
@@ -156,19 +156,22 @@ module.exports = {
156156
multiple: false,
157157
description:
158158
"Tells dev-server the number of times it should try to reconnect the client.",
159+
negatedDescription:
160+
"Tells dev-server to not to try to connect the client.",
159161
path: "client.reconnect",
160162
},
161163
{
162164
type: "number",
163165
multiple: false,
164166
description:
165167
"Tells dev-server the number of times it should try to reconnect the client.",
168+
negatedDescription:
169+
"Tells dev-server to not to try to connect the client.",
166170
path: "client.reconnect",
167171
},
168172
],
169173
description:
170174
"Tells dev-server the number of times it should try to reconnect the client.",
171-
negatedDescription: "Tells dev-server to not to try to connect the client.",
172175
simpleType: "string",
173176
multiple: false,
174177
},
@@ -321,11 +324,11 @@ module.exports = {
321324
type: "boolean",
322325
multiple: false,
323326
description: "Enables gzip compression for everything served.",
327+
negatedDescription: "Disables gzip compression for everything served.",
324328
path: "compress",
325329
},
326330
],
327331
description: "Enables gzip compression for everything served.",
328-
negatedDescription: "Disables gzip compression for everything served.",
329332
simpleType: "boolean",
330333
multiple: false,
331334
},
@@ -370,18 +373,19 @@ module.exports = {
370373
type: "boolean",
371374
multiple: false,
372375
description: "Enables Hot Module Replacement.",
376+
negatedDescription: "Disables Hot Module Replacement.",
373377
path: "hot",
374378
},
375379
{
376380
type: "enum",
377381
values: ["only"],
378382
multiple: false,
379383
description: "Enables Hot Module Replacement.",
384+
negatedDescription: "Disables Hot Module Replacement.",
380385
path: "hot",
381386
},
382387
],
383388
description: "Enables Hot Module Replacement.",
384-
negatedDescription: "Disables Hot Module Replacement.",
385389
simpleType: "string",
386390
multiple: false,
387391
},
@@ -392,12 +396,12 @@ module.exports = {
392396
multiple: false,
393397
description:
394398
"Allows to serve over HTTP/2 using SPDY. Deprecated, use the `server` option.",
399+
negatedDescription: "Does not serve over HTTP/2 using SPDY.",
395400
path: "http2",
396401
},
397402
],
398403
description:
399404
"Allows to serve over HTTP/2 using SPDY. Deprecated, use the `server` option.",
400-
negatedDescription: "Does not serve over HTTP/2 using SPDY.",
401405
simpleType: "boolean",
402406
multiple: false,
403407
},
@@ -408,13 +412,13 @@ module.exports = {
408412
multiple: false,
409413
description:
410414
"Allows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP). Deprecated, use the `server` option.",
415+
negatedDescription:
416+
"Disallows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP).",
411417
path: "https",
412418
},
413419
],
414420
description:
415421
"Allows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP). Deprecated, use the `server` option.",
416-
negatedDescription:
417-
"Disallows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP).",
418422
simpleType: "boolean",
419423
multiple: false,
420424
},
@@ -620,12 +624,12 @@ module.exports = {
620624
multiple: false,
621625
description:
622626
"Request for an SSL certificate. Deprecated, use the `server.options.requestCert` option.",
627+
negatedDescription: "Does not request for an SSL certificate.",
623628
path: "https.requestCert",
624629
},
625630
],
626631
description:
627632
"Request for an SSL certificate. Deprecated, use the `server.options.requestCert` option.",
628-
negatedDescription: "Does not request for an SSL certificate.",
629633
simpleType: "boolean",
630634
multiple: false,
631635
},
@@ -656,13 +660,13 @@ module.exports = {
656660
multiple: false,
657661
description:
658662
"Enables reload/refresh the page(s) when file changes are detected (enabled by default).",
663+
negatedDescription:
664+
"Disables reload/refresh the page(s) when file changes are detected (enabled by default).",
659665
path: "liveReload",
660666
},
661667
],
662668
description:
663669
"Enables reload/refresh the page(s) when file changes are detected (enabled by default).",
664-
negatedDescription:
665-
"Disables reload/refresh the page(s) when file changes are detected (enabled by default)",
666670
simpleType: "boolean",
667671
multiple: false,
668672
},
@@ -673,13 +677,13 @@ module.exports = {
673677
multiple: false,
674678
description:
675679
"Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').",
680+
negatedDescription:
681+
"Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').",
676682
path: "magicHtml",
677683
},
678684
],
679685
description:
680686
"Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').",
681-
negatedDescription:
682-
"Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').",
683687
simpleType: "boolean",
684688
multiple: false,
685689
},
@@ -697,12 +701,12 @@ module.exports = {
697701
multiple: false,
698702
description:
699703
"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).",
704+
negatedDescription: "Does not open the default browser.",
700705
path: "open",
701706
},
702707
],
703708
description:
704709
"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).",
705-
negatedDescription: "Does not open the default browser.",
706710
simpleType: "string",
707711
multiple: true,
708712
},
@@ -786,7 +790,6 @@ module.exports = {
786790
},
787791
],
788792
description: "Opens specified page in browser.",
789-
negatedDescription: "Does not open specified page in browser.",
790793
simpleType: "string",
791794
multiple: true,
792795
},
@@ -1140,12 +1143,12 @@ module.exports = {
11401143
multiple: true,
11411144
description:
11421145
"Tells dev server to use serveIndex middleware when enabled.",
1146+
negatedDescription:
1147+
"Does not tell dev server to use serveIndex middleware.",
11431148
path: "static[].serveIndex",
11441149
},
11451150
],
11461151
description: "Tells dev server to use serveIndex middleware when enabled.",
1147-
negatedDescription:
1148-
"Does not tell dev server to use serveIndex middleware.",
11491152
simpleType: "boolean",
11501153
multiple: true,
11511154
},
@@ -1155,11 +1158,12 @@ module.exports = {
11551158
type: "boolean",
11561159
multiple: true,
11571160
description: "Watches for files in static content directory.",
1161+
negatedDescription:
1162+
"Does not watch for files in static content directory.",
11581163
path: "static[].watch",
11591164
},
11601165
],
11611166
description: "Watches for files in static content directory.",
1162-
negatedDescription: "Does not watch for files in static content directory.",
11631167
simpleType: "boolean",
11641168
multiple: true,
11651169
},

lib/options.json

+52-10
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
}
3838
],
3939
"description": "Allows to broadcasts dev server via ZeroConf networking on start.",
40-
"link": " https://webpack.js.org/configuration/dev-server/#devserverbonjour"
40+
"link": " https://webpack.js.org/configuration/dev-server/#devserverbonjour",
41+
"cli": {
42+
"negatedDescription": "Disallows to broadcasts dev server via ZeroConf networking on start."
43+
}
4144
},
4245
"Client": {
4346
"description": "Allows to specify options for client script in the browser or disable client script.",
@@ -82,7 +85,10 @@
8285
{
8386
"description": "Enables a full-screen overlay in the browser when there are compiler errors or warnings.",
8487
"link": "https://webpack.js.org/configuration/dev-server/#overlay",
85-
"type": "boolean"
88+
"type": "boolean",
89+
"cli": {
90+
"negatedDescription": "Disables a full-screen overlay in the browser when there are compiler errors or warnings."
91+
}
8692
},
8793
{
8894
"type": "object",
@@ -103,7 +109,10 @@
103109
"ClientProgress": {
104110
"description": "Prints compilation progress in percentage in the browser.",
105111
"link": "https://webpack.js.org/configuration/dev-server/#progress",
106-
"type": "boolean"
112+
"type": "boolean",
113+
"cli": {
114+
"negatedDescription": "Does not print compilation progress in percentage in the browser."
115+
}
107116
},
108117
"ClientReconnect": {
109118
"description": "Tells dev-server the number of times it should try to reconnect the client.",
@@ -116,7 +125,10 @@
116125
"type": "number",
117126
"minimum": 0
118127
}
119-
]
128+
],
129+
"cli": {
130+
"negatedDescription": "Tells dev-server to not to try to connect the client."
131+
}
120132
},
121133
"ClientWebSocketTransport": {
122134
"anyOf": [
@@ -197,7 +209,10 @@
197209
"Compress": {
198210
"type": "boolean",
199211
"description": "Enables gzip compression for everything served.",
200-
"link": "https://webpack.js.org/configuration/dev-server/#devservercompress"
212+
"link": "https://webpack.js.org/configuration/dev-server/#devservercompress",
213+
"cli": {
214+
"negatedDescription": "Disables gzip compression for everything served."
215+
}
201216
},
202217
"DevMiddleware": {
203218
"description": "Provide options to 'webpack-dev-middleware' which handles webpack assets.",
@@ -208,12 +223,18 @@
208223
"HTTP2": {
209224
"type": "boolean",
210225
"description": "Allows to serve over HTTP/2 using SPDY. Deprecated, use the `server` option.",
211-
"link": "https://webpack.js.org/configuration/dev-server/#devserverhttp2"
226+
"link": "https://webpack.js.org/configuration/dev-server/#devserverhttp2",
227+
"cli": {
228+
"negatedDescription": "Does not serve over HTTP/2 using SPDY."
229+
}
212230
},
213231
"HTTPS": {
214232
"anyOf": [
215233
{
216-
"type": "boolean"
234+
"type": "boolean",
235+
"cli": {
236+
"negatedDescription": "Disallows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP)."
237+
}
217238
},
218239
{
219240
"type": "object",
@@ -225,7 +246,10 @@
225246
},
226247
"requestCert": {
227248
"type": "boolean",
228-
"description": "Request for an SSL certificate. Deprecated, use the `server.options.requestCert` option."
249+
"description": "Request for an SSL certificate. Deprecated, use the `server.options.requestCert` option.",
250+
"cli": {
251+
"negatedDescription": "Does not request for an SSL certificate."
252+
}
229253
},
230254
"ca": {
231255
"anyOf": [
@@ -458,7 +482,10 @@
458482
}
459483
],
460484
"description": "Enables Hot Module Replacement.",
461-
"link": "https://webpack.js.org/configuration/dev-server/#devserverhot"
485+
"link": "https://webpack.js.org/configuration/dev-server/#devserverhot",
486+
"cli": {
487+
"negatedDescription": "Disables Hot Module Replacement."
488+
}
462489
},
463490
"IPC": {
464491
"anyOf": [
@@ -477,11 +504,17 @@
477504
"LiveReload": {
478505
"type": "boolean",
479506
"description": "Enables reload/refresh the page(s) when file changes are detected (enabled by default).",
507+
"cli": {
508+
"negatedDescription": "Disables reload/refresh the page(s) when file changes are detected (enabled by default)."
509+
},
480510
"link": "https://webpack.js.org/configuration/dev-server/#devserverlivereload"
481511
},
482512
"MagicHTML": {
483513
"type": "boolean",
484514
"description": "Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').",
515+
"cli": {
516+
"negatedDescription": "Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js')."
517+
},
485518
"link": "https://webpack.js.org/configuration/dev-server/#devservermagichtml"
486519
},
487520
"OnAfterSetupMiddleware": {
@@ -528,7 +561,10 @@
528561
"link": "https://webpack.js.org/configuration/dev-server/#devserveropen"
529562
},
530563
"OpenBoolean": {
531-
"type": "boolean"
564+
"type": "boolean",
565+
"cli": {
566+
"negatedDescription": "Does not open the default browser."
567+
}
532568
},
533569
"OpenObject": {
534570
"type": "object",
@@ -934,6 +970,9 @@
934970
}
935971
],
936972
"description": "Tells dev server to use serveIndex middleware when enabled.",
973+
"cli": {
974+
"negatedDescription": "Does not tell dev server to use serveIndex middleware."
975+
},
937976
"link": "https://webpack.js.org/configuration/dev-server/#serveindex"
938977
},
939978
"watch": {
@@ -948,6 +987,9 @@
948987
}
949988
],
950989
"description": "Watches for files in static content directory.",
990+
"cli": {
991+
"negatedDescription": "Does not watch for files in static content directory."
992+
},
951993
"link": "https://webpack.js.org/configuration/dev-server/#watch"
952994
}
953995
}

test/cli/__snapshots__/basic.test.js.snap.webpack4

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Options:
106106
--no-https-request-cert Does not request for an SSL certificate.
107107
--ipc [value] Listen to a unix socket.
108108
--live-reload Enables reload/refresh the page(s) when file changes are detected (enabled by default).
109-
--no-live-reload Disables reload/refresh the page(s) when file changes are detected (enabled by default)
109+
--no-live-reload Disables reload/refresh the page(s) when file changes are detected (enabled by default).
110110
--magic-html Tells dev-server whether to enable magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').
111111
--no-magic-html Disables magic HTML routes (routes corresponding to your webpack output, for example '/main' for 'main.js').
112112
--open [value...] 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).

0 commit comments

Comments
 (0)