Skip to content

Commit 329679a

Browse files
authored
fix: use CLI specific description for --open-app-name and --web-socket-server (#4215)
1 parent 617f2d0 commit 329679a

File tree

6 files changed

+52
-45
lines changed

6 files changed

+52
-45
lines changed

lib/options.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,10 @@
581581
{
582582
"type": "string",
583583
"minLength": 1,
584-
"description": "Open specified browser. Deprecated: please use '--open-app-name'."
584+
"description": "Open specified browser.",
585+
"cli": {
586+
"description": "Open specified browser. Deprecated: please use '--open-app-name'."
587+
}
585588
}
586589
],
587590
"description": "Open specified browser."
@@ -1043,7 +1046,9 @@
10431046
"$ref": "#/definitions/WebSocketServerType"
10441047
}
10451048
],
1046-
"description": "Deprecated: please use '--web-socket-server-type' option."
1049+
"cli": {
1050+
"description": "Deprecated: please use '--web-socket-server-type' option."
1051+
}
10471052
},
10481053
"WebSocketServerFunction": {
10491054
"instanceof": "Function"

package-lock.json

+15-15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
"tcp-port-used": "^1.0.2",
114114
"typescript": "^4.2.4",
115115
"url-loader": "^4.1.1",
116-
"webpack": "^5.64.0",
116+
"webpack": "^5.67.0",
117117
"webpack-cli": "^4.7.2",
118118
"webpack-merge": "^5.8.0"
119119
},

test/__snapshots__/validate-options.test.js.snap.webpack4

+1-3
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ exports[`options validate should throw an error on the "open" option with '{"app
521521
* options.open.app should be an object:
522522
object { name?, arguments? }
523523
* options.open.app should be a non-empty string.
524-
-> Open specified browser. Deprecated: please use '--open-app-name'."
524+
-> Open specified browser."
525525
`;
526526

527527
exports[`options validate should throw an error on the "open" option with '{"foo":"bar"}' value 1`] = `
@@ -929,7 +929,6 @@ exports[`options validate should throw an error on the "webSocketServer" option
929929
Details:
930930
* options.webSocketServer should be one of these:
931931
false | \\"sockjs\\" | \\"ws\\"
932-
-> Deprecated: please use '--web-socket-server-type' option.
933932
Details:
934933
* options.webSocketServer should be false.
935934
* options.webSocketServer should be one of these:
@@ -949,7 +948,6 @@ exports[`options validate should throw an error on the "webSocketServer" option
949948
Details:
950949
* options.webSocketServer should be one of these:
951950
false | \\"sockjs\\" | \\"ws\\"
952-
-> Deprecated: please use '--web-socket-server-type' option.
953951
Details:
954952
* options.webSocketServer should be false.
955953
* options.webSocketServer should be one of these:

test/__snapshots__/validate-options.test.js.snap.webpack5

+1-3
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ exports[`options validate should throw an error on the "open" option with '{"app
521521
* options.open.app should be an object:
522522
object { name?, arguments? }
523523
* options.open.app should be a non-empty string.
524-
-> Open specified browser. Deprecated: please use '--open-app-name'."
524+
-> Open specified browser."
525525
`;
526526

527527
exports[`options validate should throw an error on the "open" option with '{"foo":"bar"}' value 1`] = `
@@ -929,7 +929,6 @@ exports[`options validate should throw an error on the "webSocketServer" option
929929
Details:
930930
* options.webSocketServer should be one of these:
931931
false | \\"sockjs\\" | \\"ws\\"
932-
-> Deprecated: please use '--web-socket-server-type' option.
933932
Details:
934933
* options.webSocketServer should be false.
935934
* options.webSocketServer should be one of these:
@@ -949,7 +948,6 @@ exports[`options validate should throw an error on the "webSocketServer" option
949948
Details:
950949
* options.webSocketServer should be one of these:
951950
false | \\"sockjs\\" | \\"ws\\"
952-
-> Deprecated: please use '--web-socket-server-type' option.
953951
Details:
954952
* options.webSocketServer should be false.
955953
* options.webSocketServer should be one of these:

types/lib/Server.d.ts

+27-21
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,9 @@ declare class Server {
978978
description: string;
979979
multiple: boolean;
980980
path: string;
981+
/**
982+
* @type {string | undefined}
983+
*/
981984
type: string;
982985
}[];
983986
description: string;
@@ -1011,7 +1014,7 @@ declare class Server {
10111014
type: string;
10121015
multiple: boolean;
10131016
description: string;
1014-
path: string;
1017+
path: string /** @type {ClientConfiguration} */;
10151018
}[];
10161019
description: string;
10171020
simpleType: string;
@@ -1032,7 +1035,7 @@ declare class Server {
10321035
configs: {
10331036
description: string;
10341037
multiple: boolean;
1035-
/** @type {string} */ path: string;
1038+
path: string;
10361039
type: string;
10371040
}[];
10381041
description: string;
@@ -1053,7 +1056,7 @@ declare class Server {
10531056
"https-key": {
10541057
configs: {
10551058
type: string;
1056-
multiple: boolean;
1059+
/** @type {number | string} */ multiple: boolean;
10571060
description: string;
10581061
path: string;
10591062
}[];
@@ -1142,8 +1145,9 @@ declare class Server {
11421145
type: string;
11431146
multiple: boolean;
11441147
description: string;
1145-
path: string /** @type {Object<string,string>} */;
1148+
path: string;
11461149
}[];
1150+
/** @type {Object<string,string>} */
11471151
description: string;
11481152
negatedDescription: string;
11491153
simpleType: string;
@@ -1152,24 +1156,19 @@ declare class Server {
11521156
"magic-html": {
11531157
configs: {
11541158
type: string;
1155-
/** @type {any} */
11561159
multiple: boolean;
11571160
description: string;
11581161
path: string;
11591162
}[];
11601163
description: string;
11611164
negatedDescription: string;
11621165
simpleType: string;
1163-
/** @type {string} */ multiple: boolean;
1166+
multiple: boolean /** @type {string} */;
11641167
};
11651168
open: {
11661169
configs: {
11671170
type: string;
11681171
multiple: boolean;
1169-
/**
1170-
* @private
1171-
* @returns {Compiler["options"]}
1172-
*/
11731172
description: string;
11741173
path: string;
11751174
}[];
@@ -1197,7 +1196,7 @@ declare class Server {
11971196
path: string;
11981197
}[];
11991198
description: string;
1200-
/** @type {Compiler} */ simpleType: string;
1199+
simpleType: string;
12011200
multiple: boolean;
12021201
};
12031202
"open-app-name-reset": {
@@ -1412,7 +1411,7 @@ declare class Server {
14121411
configs: {
14131412
description: string;
14141413
multiple: boolean;
1415-
path: string;
1414+
/** @type {ServerConfiguration} */ path: string;
14161415
type: string;
14171416
}[];
14181417
description: string;
@@ -2681,7 +2680,6 @@ declare class Server {
26812680
OpenBoolean: {
26822681
type: string;
26832682
};
2684-
/** @type {number | string} */
26852683
OpenObject: {
26862684
type: string;
26872685
additionalProperties: boolean;
@@ -2726,7 +2724,6 @@ declare class Server {
27262724
}
27272725
)[];
27282726
};
2729-
/** @type {string} */
27302727
arguments: {
27312728
items: {
27322729
type: string;
@@ -2736,11 +2733,15 @@ declare class Server {
27362733
};
27372734
minLength?: undefined;
27382735
description?: undefined;
2736+
cli?: undefined;
27392737
}
27402738
| {
27412739
type: string;
27422740
minLength: number;
27432741
description: string;
2742+
cli: {
2743+
description: string;
2744+
};
27442745
additionalProperties?: undefined;
27452746
properties?: undefined;
27462747
}
@@ -2846,9 +2847,11 @@ declare class Server {
28462847
type: string;
28472848
additionalProperties: boolean;
28482849
properties: {
2850+
/** @type {any} */
28492851
passphrase: {
28502852
type: string;
2851-
description: string;
2853+
/** @type {any} */
2854+
description: string /** @type {any} */;
28522855
};
28532856
requestCert: {
28542857
type: string;
@@ -2870,7 +2873,7 @@ declare class Server {
28702873
}
28712874
)[];
28722875
};
2873-
instanceof?: undefined;
2876+
/** @type {string} */ instanceof?: undefined;
28742877
}
28752878
| {
28762879
type: string;
@@ -2901,7 +2904,7 @@ declare class Server {
29012904
}
29022905
)[];
29032906
};
2904-
instanceof?: undefined;
2907+
/** @type {MultiCompiler} */ instanceof?: undefined;
29052908
}
29062909
| {
29072910
type: string;
@@ -2919,7 +2922,6 @@ declare class Server {
29192922
cert: {
29202923
anyOf: (
29212924
| {
2922-
/** @type {MultiCompiler} */
29232925
type: string;
29242926
items: {
29252927
anyOf: (
@@ -3242,7 +3244,9 @@ declare class Server {
32423244
enum?: undefined;
32433245
}
32443246
)[];
3245-
description: string;
3247+
cli: {
3248+
description: string;
3249+
};
32463250
};
32473251
WebSocketServerFunction: {
32483252
instanceof: string;
@@ -3321,14 +3325,16 @@ declare class Server {
33213325
$ref: string;
33223326
};
33233327
onListening: {
3324-
$ref: string;
3328+
$ref: string /** @type {ServerOptions} */;
33253329
};
3330+
/** @type {ServerOptions} */
33263331
open: {
33273332
$ref: string;
33283333
};
33293334
port: {
3330-
$ref: string;
3335+
$ref: string /** @type {ServerOptions} */;
33313336
};
3337+
/** @type {ServerOptions} */
33323338
proxy: {
33333339
$ref: string;
33343340
};

0 commit comments

Comments
 (0)