webpack-dev-server 4.5.0 → 4.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -67
- package/bin/cli-flags.js +265 -267
- package/bin/process-arguments.js +87 -7
- package/bin/webpack-dev-server.js +3 -0
- package/client/clients/SockJSClient.js +26 -3
- package/client/clients/WebSocketClient.js +16 -1
- package/client/index.js +78 -3
- package/client/modules/logger/index.js +3 -0
- package/client/modules/sockjs-client/index.js +15 -4
- package/client/overlay.js +38 -3
- package/client/socket.js +19 -8
- package/client/utils/createSocketURL.js +71 -4
- package/client/utils/getCurrentScriptSource.js +3 -0
- package/client/utils/log.js +6 -1
- package/client/utils/parseURL.js +17 -19
- package/client/utils/reloadApp.js +15 -2
- package/client/utils/sendMessage.js +5 -0
- package/lib/Server.js +1856 -828
- package/lib/options.json +37 -18
- package/lib/servers/BaseServer.js +8 -0
- package/lib/servers/SockJSServer.js +42 -9
- package/lib/servers/WebsocketServer.js +66 -35
- package/package.json +26 -18
- package/types/bin/cli-flags.d.ts +934 -0
- package/types/bin/process-arguments.d.ts +50 -0
- package/types/bin/webpack-dev-server.d.ts +27 -0
- package/types/lib/Server.d.ts +3388 -0
- package/types/lib/servers/BaseServer.d.ts +15 -0
- package/types/lib/servers/SockJSServer.d.ts +12 -0
- package/types/lib/servers/WebsocketServer.d.ts +13 -0
package/lib/options.json
CHANGED
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
},
|
|
75
75
|
"ClientLogging": {
|
|
76
76
|
"enum": ["none", "error", "warn", "info", "log", "verbose"],
|
|
77
|
-
"
|
|
77
|
+
"description": "Allows to set log level in the browser.",
|
|
78
78
|
"link": "https://webpack.js.org/configuration/dev-server/#logging"
|
|
79
79
|
},
|
|
80
80
|
"ClientOverlay": {
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
},
|
|
208
208
|
"HTTP2": {
|
|
209
209
|
"type": "boolean",
|
|
210
|
-
"description": "Allows to serve over HTTP/2 using SPDY. Deprecated,
|
|
210
|
+
"description": "Allows to serve over HTTP/2 using SPDY. Deprecated, use the `server` option.",
|
|
211
211
|
"link": "https://webpack.js.org/configuration/dev-server/#devserverhttp2"
|
|
212
212
|
},
|
|
213
213
|
"HTTPS": {
|
|
@@ -221,11 +221,11 @@
|
|
|
221
221
|
"properties": {
|
|
222
222
|
"passphrase": {
|
|
223
223
|
"type": "string",
|
|
224
|
-
"description": "Passphrase for a pfx file. Deprecated,
|
|
224
|
+
"description": "Passphrase for a pfx file. Deprecated, use the `server.options.passphrase` option."
|
|
225
225
|
},
|
|
226
226
|
"requestCert": {
|
|
227
227
|
"type": "boolean",
|
|
228
|
-
"description": "Request for an SSL certificate. Deprecated,
|
|
228
|
+
"description": "Request for an SSL certificate. Deprecated, use the `server.options.requestCert` option."
|
|
229
229
|
},
|
|
230
230
|
"ca": {
|
|
231
231
|
"anyOf": [
|
|
@@ -249,7 +249,7 @@
|
|
|
249
249
|
"instanceof": "Buffer"
|
|
250
250
|
}
|
|
251
251
|
],
|
|
252
|
-
"description": "Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated,
|
|
252
|
+
"description": "Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option."
|
|
253
253
|
},
|
|
254
254
|
"cacert": {
|
|
255
255
|
"anyOf": [
|
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
"instanceof": "Buffer"
|
|
274
274
|
}
|
|
275
275
|
],
|
|
276
|
-
"description": "Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated,
|
|
276
|
+
"description": "Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option."
|
|
277
277
|
},
|
|
278
278
|
"cert": {
|
|
279
279
|
"anyOf": [
|
|
@@ -297,7 +297,7 @@
|
|
|
297
297
|
"instanceof": "Buffer"
|
|
298
298
|
}
|
|
299
299
|
],
|
|
300
|
-
"description": "Path to an SSL certificate or content of an SSL certificate. Deprecated,
|
|
300
|
+
"description": "Path to an SSL certificate or content of an SSL certificate. Deprecated, use the `server.options.cert` option."
|
|
301
301
|
},
|
|
302
302
|
"crl": {
|
|
303
303
|
"anyOf": [
|
|
@@ -321,7 +321,7 @@
|
|
|
321
321
|
"instanceof": "Buffer"
|
|
322
322
|
}
|
|
323
323
|
],
|
|
324
|
-
"description": "Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). Deprecated,
|
|
324
|
+
"description": "Path to PEM formatted CRLs (Certificate Revocation Lists) or content of PEM formatted CRLs (Certificate Revocation Lists). Deprecated, use the `server.options.crl` option."
|
|
325
325
|
},
|
|
326
326
|
"key": {
|
|
327
327
|
"anyOf": [
|
|
@@ -349,7 +349,7 @@
|
|
|
349
349
|
"instanceof": "Buffer"
|
|
350
350
|
}
|
|
351
351
|
],
|
|
352
|
-
"description": "Path to an SSL key or content of an SSL key. Deprecated,
|
|
352
|
+
"description": "Path to an SSL key or content of an SSL key. Deprecated, use the `server.options.key` option."
|
|
353
353
|
},
|
|
354
354
|
"pfx": {
|
|
355
355
|
"anyOf": [
|
|
@@ -377,12 +377,12 @@
|
|
|
377
377
|
"instanceof": "Buffer"
|
|
378
378
|
}
|
|
379
379
|
],
|
|
380
|
-
"description": "Path to an SSL pfx file or content of an SSL pfx file. Deprecated,
|
|
380
|
+
"description": "Path to an SSL pfx file or content of an SSL pfx file. Deprecated, use the `server.options.pfx` option."
|
|
381
381
|
}
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
],
|
|
385
|
-
"description": "Allows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP). Deprecated,
|
|
385
|
+
"description": "Allows to configure the server's listening socket for TLS (by default, dev server will be served over HTTP). Deprecated, use the `server` option.",
|
|
386
386
|
"link": "https://webpack.js.org/configuration/dev-server/#devserverhttps"
|
|
387
387
|
},
|
|
388
388
|
"HeaderObject": {
|
|
@@ -486,12 +486,12 @@
|
|
|
486
486
|
},
|
|
487
487
|
"OnAfterSetupMiddleware": {
|
|
488
488
|
"instanceof": "Function",
|
|
489
|
-
"description": "Provides the ability to execute a custom function and apply custom middleware(s) after all other middlewares.",
|
|
489
|
+
"description": "Provides the ability to execute a custom function and apply custom middleware(s) after all other middlewares. Deprecated: please use the 'setupMiddlewares' option.",
|
|
490
490
|
"link": "https://webpack.js.org/configuration/dev-server/#devserveronaftersetupmiddleware"
|
|
491
491
|
},
|
|
492
492
|
"OnBeforeSetupMiddleware": {
|
|
493
493
|
"instanceof": "Function",
|
|
494
|
-
"description": "Provides the ability to execute a custom function and apply custom middleware(s) prior to all other middlewares.",
|
|
494
|
+
"description": "Provides the ability to execute a custom function and apply custom middleware(s) prior to all other middlewares. Deprecated: please use the 'setupMiddlewares' option.",
|
|
495
495
|
"link": "https://webpack.js.org/configuration/dev-server/#devserveronbeforesetupmiddleware"
|
|
496
496
|
},
|
|
497
497
|
"OnListening": {
|
|
@@ -580,7 +580,8 @@
|
|
|
580
580
|
},
|
|
581
581
|
{
|
|
582
582
|
"type": "string",
|
|
583
|
-
"minLength": 1
|
|
583
|
+
"minLength": 1,
|
|
584
|
+
"description": "Open specified browser. Deprecated: please use '--open-app-name'."
|
|
584
585
|
}
|
|
585
586
|
],
|
|
586
587
|
"description": "Open specified browser."
|
|
@@ -666,7 +667,14 @@
|
|
|
666
667
|
"type": "object",
|
|
667
668
|
"properties": {
|
|
668
669
|
"type": {
|
|
669
|
-
"
|
|
670
|
+
"anyOf": [
|
|
671
|
+
{
|
|
672
|
+
"$ref": "#/definitions/ServerType"
|
|
673
|
+
},
|
|
674
|
+
{
|
|
675
|
+
"$ref": "#/definitions/ServerString"
|
|
676
|
+
}
|
|
677
|
+
]
|
|
670
678
|
},
|
|
671
679
|
"options": {
|
|
672
680
|
"$ref": "#/definitions/ServerOptions"
|
|
@@ -732,7 +740,7 @@
|
|
|
732
740
|
"instanceof": "Buffer"
|
|
733
741
|
}
|
|
734
742
|
],
|
|
735
|
-
"description": "Path to an SSL CA certificate or content of an SSL CA certificate."
|
|
743
|
+
"description": "Path to an SSL CA certificate or content of an SSL CA certificate. Deprecated, use the `server.options.ca` option."
|
|
736
744
|
},
|
|
737
745
|
"cert": {
|
|
738
746
|
"anyOf": [
|
|
@@ -848,6 +856,11 @@
|
|
|
848
856
|
"exclude": true
|
|
849
857
|
}
|
|
850
858
|
},
|
|
859
|
+
"SetupMiddlewares": {
|
|
860
|
+
"instanceof": "Function",
|
|
861
|
+
"description": "Provides the ability to execute a custom function and apply custom middleware(s).",
|
|
862
|
+
"link": "https://webpack.js.org/configuration/dev-server/#devserversetupmiddlewares"
|
|
863
|
+
},
|
|
851
864
|
"Static": {
|
|
852
865
|
"anyOf": [
|
|
853
866
|
{
|
|
@@ -984,10 +997,13 @@
|
|
|
984
997
|
"type": "string",
|
|
985
998
|
"minLength": 1
|
|
986
999
|
}
|
|
987
|
-
]
|
|
1000
|
+
],
|
|
1001
|
+
"description": "Path(s) of globs/directories/files to watch for file changes."
|
|
988
1002
|
},
|
|
989
1003
|
"options": {
|
|
990
1004
|
"type": "object",
|
|
1005
|
+
"description": "Configure advanced options for watching. See the chokidar documentation for the possible options.",
|
|
1006
|
+
"link": "https://github.com/paulmillr/chokidar#api",
|
|
991
1007
|
"additionalProperties": true
|
|
992
1008
|
}
|
|
993
1009
|
},
|
|
@@ -1027,7 +1043,7 @@
|
|
|
1027
1043
|
"$ref": "#/definitions/WebSocketServerType"
|
|
1028
1044
|
}
|
|
1029
1045
|
],
|
|
1030
|
-
"description": "Deprecated: please use '
|
|
1046
|
+
"description": "Deprecated: please use '--web-socket-server-type' option."
|
|
1031
1047
|
},
|
|
1032
1048
|
"WebSocketServerFunction": {
|
|
1033
1049
|
"instanceof": "Function"
|
|
@@ -1131,6 +1147,9 @@
|
|
|
1131
1147
|
"setupExitSignals": {
|
|
1132
1148
|
"$ref": "#/definitions/SetupExitSignals"
|
|
1133
1149
|
},
|
|
1150
|
+
"setupMiddlewares": {
|
|
1151
|
+
"$ref": "#/definitions/SetupMiddlewares"
|
|
1152
|
+
},
|
|
1134
1153
|
"static": {
|
|
1135
1154
|
"$ref": "#/definitions/Static"
|
|
1136
1155
|
},
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
/** @typedef {import("../Server").ClientConnection} ClientConnection */
|
|
4
|
+
|
|
3
5
|
// base class that users should extend if they are making their own
|
|
4
6
|
// server implementation
|
|
5
7
|
module.exports = class BaseServer {
|
|
8
|
+
/**
|
|
9
|
+
* @param {import("../Server")} server
|
|
10
|
+
*/
|
|
6
11
|
constructor(server) {
|
|
12
|
+
/** @type {import("../Server")} */
|
|
7
13
|
this.server = server;
|
|
14
|
+
|
|
15
|
+
/** @type {ClientConnection[]} */
|
|
8
16
|
this.clients = [];
|
|
9
17
|
}
|
|
10
18
|
};
|
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
/* eslint-disable
|
|
4
|
-
class-methods-use-this
|
|
5
|
-
*/
|
|
6
3
|
const sockjs = require("sockjs");
|
|
7
4
|
const BaseServer = require("./BaseServer");
|
|
8
5
|
|
|
6
|
+
/** @typedef {import("../Server").WebSocketServerConfiguration} WebSocketServerConfiguration */
|
|
7
|
+
/** @typedef {import("../Server").ClientConnection} ClientConnection */
|
|
8
|
+
|
|
9
9
|
// Workaround for sockjs@~0.3.19
|
|
10
10
|
// sockjs will remove Origin header, however Origin header is required for checking host.
|
|
11
11
|
// See https://github.com/webpack/webpack-dev-server/issues/1604 for more information
|
|
12
12
|
{
|
|
13
|
+
// @ts-ignore
|
|
13
14
|
const SockjsSession = require("sockjs/lib/transport").Session;
|
|
14
15
|
const decorateConnection = SockjsSession.prototype.decorateConnection;
|
|
15
16
|
|
|
17
|
+
/**
|
|
18
|
+
* @param {import("http").IncomingMessage} req
|
|
19
|
+
*/
|
|
16
20
|
// eslint-disable-next-line func-names
|
|
17
21
|
SockjsSession.prototype.decorateConnection = function (req) {
|
|
18
22
|
decorateConnection.call(this, req);
|
|
@@ -31,6 +35,9 @@ const BaseServer = require("./BaseServer");
|
|
|
31
35
|
|
|
32
36
|
module.exports = class SockJSServer extends BaseServer {
|
|
33
37
|
// options has: error (function), debug (function), server (http/s server), path (string)
|
|
38
|
+
/**
|
|
39
|
+
* @param {import("../Server")} server
|
|
40
|
+
*/
|
|
34
41
|
constructor(server) {
|
|
35
42
|
super(server);
|
|
36
43
|
|
|
@@ -38,6 +45,10 @@ module.exports = class SockJSServer extends BaseServer {
|
|
|
38
45
|
// Use provided up-to-date sockjs-client
|
|
39
46
|
sockjs_url: "/__webpack_dev_server__/sockjs.bundle.js",
|
|
40
47
|
// Default logger is very annoy. Limit useless logs.
|
|
48
|
+
/**
|
|
49
|
+
* @param {string} severity
|
|
50
|
+
* @param {string} line
|
|
51
|
+
*/
|
|
41
52
|
log: (severity, line) => {
|
|
42
53
|
if (severity === "error") {
|
|
43
54
|
this.server.logger.error(line);
|
|
@@ -49,6 +60,10 @@ module.exports = class SockJSServer extends BaseServer {
|
|
|
49
60
|
},
|
|
50
61
|
});
|
|
51
62
|
|
|
63
|
+
/**
|
|
64
|
+
* @param {import("sockjs").ServerOptions & { path?: string }} options
|
|
65
|
+
* @returns {string | undefined}
|
|
66
|
+
*/
|
|
52
67
|
const getPrefix = (options) => {
|
|
53
68
|
if (typeof options.prefix !== "undefined") {
|
|
54
69
|
return options.prefix;
|
|
@@ -57,23 +72,41 @@ module.exports = class SockJSServer extends BaseServer {
|
|
|
57
72
|
return options.path;
|
|
58
73
|
};
|
|
59
74
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
75
|
+
const options = {
|
|
76
|
+
.../** @type {WebSocketServerConfiguration} */
|
|
77
|
+
(this.server.options.webSocketServer).options,
|
|
78
|
+
prefix: getPrefix(
|
|
79
|
+
/** @type {NonNullable<WebSocketServerConfiguration["options"]>} */
|
|
80
|
+
(
|
|
81
|
+
/** @type {WebSocketServerConfiguration} */
|
|
82
|
+
(this.server.options.webSocketServer).options
|
|
83
|
+
)
|
|
84
|
+
),
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
this.implementation.installHandlers(
|
|
88
|
+
/** @type {import("http").Server} */ (this.server.server),
|
|
89
|
+
options
|
|
90
|
+
);
|
|
64
91
|
|
|
65
92
|
this.implementation.on("connection", (client) => {
|
|
93
|
+
// @ts-ignore
|
|
66
94
|
// Implement the the same API as for `ws`
|
|
67
95
|
client.send = client.write;
|
|
96
|
+
// @ts-ignore
|
|
68
97
|
client.terminate = client.close;
|
|
69
98
|
|
|
70
|
-
this.clients.push(client);
|
|
99
|
+
this.clients.push(/** @type {ClientConnection} */ (client));
|
|
71
100
|
|
|
72
101
|
client.on("close", () => {
|
|
73
|
-
this.clients.splice(
|
|
102
|
+
this.clients.splice(
|
|
103
|
+
this.clients.indexOf(/** @type {ClientConnection} */ (client)),
|
|
104
|
+
1
|
|
105
|
+
);
|
|
74
106
|
});
|
|
75
107
|
});
|
|
76
108
|
|
|
109
|
+
// @ts-ignore
|
|
77
110
|
this.implementation.close = (callback) => {
|
|
78
111
|
callback();
|
|
79
112
|
};
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
/* eslint-disable
|
|
4
|
-
class-methods-use-this
|
|
5
|
-
*/
|
|
6
3
|
const WebSocket = require("ws");
|
|
7
4
|
const BaseServer = require("./BaseServer");
|
|
8
5
|
|
|
6
|
+
/** @typedef {import("../Server").WebSocketServerConfiguration} WebSocketServerConfiguration */
|
|
7
|
+
/** @typedef {import("../Server").ClientConnection} ClientConnection */
|
|
8
|
+
|
|
9
9
|
module.exports = class WebsocketServer extends BaseServer {
|
|
10
10
|
static heartbeatInterval = 1000;
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* @param {import("../Server")} server
|
|
14
|
+
*/
|
|
12
15
|
constructor(server) {
|
|
13
16
|
super(server);
|
|
14
17
|
|
|
18
|
+
/** @type {import("ws").ServerOptions} */
|
|
15
19
|
const options = {
|
|
16
|
-
|
|
20
|
+
.../** @type {WebSocketServerConfiguration} */
|
|
21
|
+
(this.server.options.webSocketServer).options,
|
|
17
22
|
clientTracking: false,
|
|
18
23
|
};
|
|
19
24
|
const isNoServerMode =
|
|
@@ -26,46 +31,72 @@ module.exports = class WebsocketServer extends BaseServer {
|
|
|
26
31
|
|
|
27
32
|
this.implementation = new WebSocket.Server(options);
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
/** @type {import("http").Server} */
|
|
35
|
+
(this.server.server).on(
|
|
36
|
+
"upgrade",
|
|
37
|
+
/**
|
|
38
|
+
* @param {import("http").IncomingMessage} req
|
|
39
|
+
* @param {import("stream").Duplex} sock
|
|
40
|
+
* @param {Buffer} head
|
|
41
|
+
*/
|
|
42
|
+
(req, sock, head) => {
|
|
43
|
+
if (!this.implementation.shouldHandle(req)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
38
46
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
this.implementation.handleUpgrade(req, sock, head, (connection) => {
|
|
48
|
+
this.implementation.emit("connection", connection, req);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
this.implementation.on(
|
|
54
|
+
"error",
|
|
55
|
+
/**
|
|
56
|
+
* @param {Error} err
|
|
57
|
+
*/
|
|
58
|
+
(err) => {
|
|
59
|
+
this.server.logger.error(err.message);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
42
62
|
|
|
43
63
|
const interval = setInterval(() => {
|
|
44
|
-
this.clients.forEach(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
64
|
+
this.clients.forEach(
|
|
65
|
+
/**
|
|
66
|
+
* @param {ClientConnection} client
|
|
67
|
+
*/
|
|
68
|
+
(client) => {
|
|
69
|
+
if (client.isAlive === false) {
|
|
70
|
+
client.terminate();
|
|
71
|
+
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
client.isAlive = false;
|
|
76
|
+
client.ping(() => {});
|
|
49
77
|
}
|
|
50
|
-
|
|
51
|
-
client.isAlive = false;
|
|
52
|
-
client.ping(() => {});
|
|
53
|
-
});
|
|
78
|
+
);
|
|
54
79
|
}, WebsocketServer.heartbeatInterval);
|
|
55
80
|
|
|
56
|
-
this.implementation.on(
|
|
57
|
-
|
|
81
|
+
this.implementation.on(
|
|
82
|
+
"connection",
|
|
83
|
+
/**
|
|
84
|
+
* @param {ClientConnection} client
|
|
85
|
+
*/
|
|
86
|
+
(client) => {
|
|
87
|
+
this.clients.push(client);
|
|
58
88
|
|
|
59
|
-
client.isAlive = true;
|
|
60
|
-
|
|
61
|
-
client.on("pong", () => {
|
|
62
89
|
client.isAlive = true;
|
|
63
|
-
});
|
|
64
90
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
91
|
+
client.on("pong", () => {
|
|
92
|
+
client.isAlive = true;
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
client.on("close", () => {
|
|
96
|
+
this.clients.splice(this.clients.indexOf(client), 1);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
);
|
|
69
100
|
|
|
70
101
|
this.implementation.on("close", () => {
|
|
71
102
|
clearInterval(interval);
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webpack-dev-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.2",
|
|
4
4
|
"description": "Serves a webpack app. Updates the browser on changes.",
|
|
5
5
|
"bin": "bin/webpack-dev-server.js",
|
|
6
6
|
"main": "lib/Server.js",
|
|
7
|
+
"types": "types/lib/Server.d.ts",
|
|
7
8
|
"files": [
|
|
8
9
|
"bin",
|
|
9
10
|
"lib",
|
|
10
|
-
"client"
|
|
11
|
+
"client",
|
|
12
|
+
"types"
|
|
11
13
|
],
|
|
12
14
|
"engines": {
|
|
13
15
|
"node": ">= 12.13.0"
|
|
@@ -15,14 +17,15 @@
|
|
|
15
17
|
"scripts": {
|
|
16
18
|
"fmt:check": "prettier \"{**/*,*}.{js,json,md,yml,css,ts}\" --list-different",
|
|
17
19
|
"lint:js": "eslint . --cache",
|
|
18
|
-
"lint:
|
|
19
|
-
"lint": "npm-run-all
|
|
20
|
+
"lint:types": "tsc --pretty --noEmit",
|
|
21
|
+
"lint": "npm-run-all -p \"fmt:**\" \"lint:**\"",
|
|
20
22
|
"fmt": "npm run fmt:check -- --write",
|
|
21
23
|
"fix:js": "npm run lint:js -- --fix",
|
|
22
24
|
"fix": "npm-run-all fix:js fmt",
|
|
23
25
|
"commitlint": "commitlint --from=master",
|
|
24
|
-
"build": "npm-run-all build:client",
|
|
25
26
|
"build:client": "rimraf ./client/* && babel client-src/ --out-dir client/ --ignore \"client-src/webpack.config.js\" --ignore \"client-src/modules\" && webpack --config client-src/webpack.config.js",
|
|
27
|
+
"build:types": "rimraf ./types/* && tsc --declaration --emitDeclarationOnly --outDir types && node ./scripts/extend-webpack-types.js && prettier \"types/**/*.ts\" --write && prettier \"types/**/*.ts\" --write",
|
|
28
|
+
"build": "npm-run-all -p \"build:**\"",
|
|
26
29
|
"test:only": "jest",
|
|
27
30
|
"test:coverage": "npm run test:only -- --coverage",
|
|
28
31
|
"test:watch": "npm run test:coverage --watch",
|
|
@@ -32,30 +35,34 @@
|
|
|
32
35
|
"release": "standard-version"
|
|
33
36
|
},
|
|
34
37
|
"dependencies": {
|
|
38
|
+
"@types/bonjour": "^3.5.9",
|
|
39
|
+
"@types/connect-history-api-fallback": "^1.3.5",
|
|
40
|
+
"@types/serve-index": "^1.9.1",
|
|
41
|
+
"@types/sockjs": "^0.3.33",
|
|
42
|
+
"@types/ws": "^8.2.2",
|
|
35
43
|
"ansi-html-community": "^0.0.8",
|
|
36
44
|
"bonjour": "^3.5.0",
|
|
37
45
|
"chokidar": "^3.5.2",
|
|
38
46
|
"colorette": "^2.0.10",
|
|
39
47
|
"compression": "^1.7.4",
|
|
40
48
|
"connect-history-api-fallback": "^1.6.0",
|
|
49
|
+
"default-gateway": "^6.0.3",
|
|
41
50
|
"del": "^6.0.0",
|
|
42
51
|
"express": "^4.17.1",
|
|
43
52
|
"graceful-fs": "^4.2.6",
|
|
44
53
|
"html-entities": "^2.3.2",
|
|
45
54
|
"http-proxy-middleware": "^2.0.0",
|
|
46
|
-
"internal-ip": "^6.2.0",
|
|
47
55
|
"ipaddr.js": "^2.0.1",
|
|
48
56
|
"open": "^8.0.9",
|
|
49
57
|
"p-retry": "^4.5.0",
|
|
50
58
|
"portfinder": "^1.0.28",
|
|
51
|
-
"schema-utils": "^
|
|
59
|
+
"schema-utils": "^4.0.0",
|
|
52
60
|
"selfsigned": "^1.10.11",
|
|
53
61
|
"serve-index": "^1.9.1",
|
|
54
62
|
"sockjs": "^0.3.21",
|
|
55
63
|
"spdy": "^4.0.2",
|
|
56
64
|
"strip-ansi": "^7.0.0",
|
|
57
|
-
"
|
|
58
|
-
"webpack-dev-middleware": "^5.2.1",
|
|
65
|
+
"webpack-dev-middleware": "^5.3.0",
|
|
59
66
|
"ws": "^8.1.0"
|
|
60
67
|
},
|
|
61
68
|
"devDependencies": {
|
|
@@ -66,16 +73,17 @@
|
|
|
66
73
|
"@babel/plugin-transform-runtime": "^7.14.5",
|
|
67
74
|
"@babel/preset-env": "^7.14.5",
|
|
68
75
|
"@babel/runtime": "^7.14.5",
|
|
69
|
-
"@commitlint/cli": "^
|
|
70
|
-
"@commitlint/config-conventional": "^
|
|
76
|
+
"@commitlint/cli": "^16.0.1",
|
|
77
|
+
"@commitlint/config-conventional": "^16.0.0",
|
|
78
|
+
"@types/compression": "^1.7.2",
|
|
79
|
+
"@types/default-gateway": "^3.0.1",
|
|
80
|
+
"@types/sockjs-client": "^1.5.1",
|
|
71
81
|
"acorn": "^8.2.4",
|
|
72
|
-
"babel-jest": "^27.
|
|
82
|
+
"babel-jest": "^27.4.4",
|
|
73
83
|
"babel-loader": "^8.2.2",
|
|
74
|
-
"body-parser": "^1.19.
|
|
84
|
+
"body-parser": "^1.19.1",
|
|
75
85
|
"core-js": "^3.12.1",
|
|
76
86
|
"css-loader": "^5.2.4",
|
|
77
|
-
"css-tree": "^1.1.3",
|
|
78
|
-
"csstree": "^0.0.3",
|
|
79
87
|
"eslint": "^8.0.1",
|
|
80
88
|
"eslint-config-prettier": "^8.3.0",
|
|
81
89
|
"eslint-config-webpack": "^1.2.5",
|
|
@@ -85,16 +93,16 @@
|
|
|
85
93
|
"html-webpack-plugin": "^4.5.2",
|
|
86
94
|
"http-proxy": "^1.18.1",
|
|
87
95
|
"husky": "^7.0.0",
|
|
88
|
-
"jest": "^27.
|
|
96
|
+
"jest": "^27.4.4",
|
|
89
97
|
"klona": "^2.0.4",
|
|
90
98
|
"less": "^4.1.1",
|
|
91
99
|
"less-loader": "^7.3.0",
|
|
92
|
-
"lint-staged": "^
|
|
100
|
+
"lint-staged": "^12.0.2",
|
|
93
101
|
"marked": "^3.0.0",
|
|
94
102
|
"memfs": "^3.2.2",
|
|
95
103
|
"npm-run-all": "^4.1.5",
|
|
96
104
|
"prettier": "^2.3.1",
|
|
97
|
-
"puppeteer": "^
|
|
105
|
+
"puppeteer": "^13.0.0",
|
|
98
106
|
"require-from-string": "^2.0.2",
|
|
99
107
|
"rimraf": "^3.0.2",
|
|
100
108
|
"sockjs-client": "^1.5.1",
|