Skip to content

Commit ed5254e

Browse files
committed
refactor!: remove the --web-socket-server cli option (#4680)
1 parent 50928f4 commit ed5254e

File tree

5 files changed

+24
-33
lines changed

5 files changed

+24
-33
lines changed

lib/Server.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2399,7 +2399,6 @@ class Server {
23992399
* @private
24002400
* @returns {void}
24012401
*/
2402-
// TODO: remove `--web-socket-server` in favor of `--web-socket-server-type`
24032402
createWebSocketServer() {
24042403
/** @type {WebSocketServerImplementation | undefined | null} */
24052404
this.webSocketServer = new /** @type {any} */ (this.getServerTransport())(

lib/options.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -918,12 +918,12 @@
918918
}
919919
},
920920
{
921-
"$ref": "#/definitions/WebSocketServerType"
921+
"enum": ["sockjs", "ws"],
922+
"cli": {
923+
"exclude": true
924+
}
922925
}
923-
],
924-
"cli": {
925-
"description": "Deprecated: please use '--web-socket-server-type' option."
926-
}
926+
]
927927
},
928928
"WebSocketServerFunction": {
929929
"instanceof": "Function"
@@ -956,7 +956,10 @@
956956
},
957957
"WebSocketServerString": {
958958
"type": "string",
959-
"minLength": 1
959+
"minLength": 1,
960+
"cli": {
961+
"exclude": true
962+
}
960963
}
961964
},
962965
"additionalProperties": false,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ Options:
129129
--static-public-path-reset Clear all items provided in 'static.publicPath' configuration. The static files will be available in the browser under this public path.
130130
--watch-files <value...> Allows to configure list of globs/directories/files to watch for file changes.
131131
--watch-files-reset Clear all items provided in 'watchFiles' configuration. Allows to configure list of globs/directories/files to watch for file changes.
132-
--web-socket-server <value> Deprecated: please use '--web-socket-server-type' option. Allows to set web socket server and options (by default 'ws').
133132
--no-web-socket-server Disallows to set web socket server and options.
134133
--web-socket-server-type <value> Allows to set web socket server and options (by default 'ws').
135134

test/cli/webSocketServer-option.test.js

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,33 @@ const { testBin } = require("../helpers/test-bin");
44
const port = require("../ports-map")["cli-web-socket-server"];
55

66
describe('"webSocketServer" CLI option', () => {
7-
it('should work using "--web-socket-server sockjs"', async () => {
8-
const { exitCode } = await testBin([
9-
"--port",
10-
port,
11-
"--web-socket-server",
12-
"sockjs",
13-
]);
14-
15-
expect(exitCode).toEqual(0);
16-
});
17-
18-
it('should work using "--web-socket-server ws"', async () => {
7+
it('should work using "--web-socket-server-type ws"', async () => {
198
const { exitCode } = await testBin([
209
"--port",
2110
port,
22-
"--web-socket-server",
11+
"--web-socket-server-type",
2312
"ws",
2413
]);
2514

2615
expect(exitCode).toEqual(0);
2716
});
2817

29-
it('should work using "--web-socket-server-type ws"', async () => {
18+
it('should work using "--web-socket-server-type sockjs"', async () => {
3019
const { exitCode } = await testBin([
3120
"--port",
3221
port,
3322
"--web-socket-server-type",
34-
"ws",
23+
"sockjs",
3524
]);
3625

3726
expect(exitCode).toEqual(0);
3827
});
3928

40-
it('should work using "--web-socket-server-type sockjs"', async () => {
29+
it('should work using "--no-web-socket-server"', async () => {
4130
const { exitCode } = await testBin([
4231
"--port",
4332
port,
44-
"--web-socket-server-type",
45-
"sockjs",
33+
"--no-web-socket-server",
4634
]);
4735

4836
expect(exitCode).toEqual(0);

types/lib/Server.d.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2752,18 +2752,17 @@ declare class Server {
27522752
enum: boolean[];
27532753
cli: {
27542754
negatedDescription: string;
2755+
exclude?: undefined;
27552756
};
2756-
$ref?: undefined;
27572757
}
27582758
| {
2759-
$ref: string;
2760-
enum?: undefined;
2761-
cli?: undefined;
2759+
enum: string[];
2760+
cli: {
2761+
exclude: boolean;
2762+
negatedDescription?: undefined;
2763+
};
27622764
}
27632765
)[];
2764-
cli: {
2765-
description: string;
2766-
};
27672766
};
27682767
WebSocketServerFunction: {
27692768
instanceof: string;
@@ -2789,6 +2788,9 @@ declare class Server {
27892788
WebSocketServerString: {
27902789
type: string;
27912790
minLength: number;
2791+
cli: {
2792+
exclude: boolean;
2793+
};
27922794
};
27932795
};
27942796
additionalProperties: boolean;

0 commit comments

Comments
 (0)