@nx/web 16.8.0-beta.3 → 16.8.0-beta.5
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/package.json +5 -7
- package/src/executors/file-server/file-server.impl.js +90 -99
- package/src/generators/application/application.js +247 -228
- package/src/generators/init/init.js +35 -38
- package/src/generators/static-serve/static-serve-configuration.js +11 -8
- package/src/migrations/update-13-0-0/remove-deprecated-options-13-0-0.js +21 -25
- package/src/migrations/update-13-0-0/remove-node-sass-13-0-0.js +12 -15
- package/src/migrations/update-13-0-0/remove-webpack-5-packages-13-0-0.js +10 -14
- package/src/migrations/update-13-3-0/rename-build-to-webpack.js +9 -13
- package/src/migrations/update-13-3-0/rename-package-to-rollup.js +9 -13
- package/src/migrations/update-13-8-0/add-postcss-config-option.js +11 -15
- package/src/migrations/update-14-1-7/rollup-format-backwards-compatibility.js +13 -14
- package/src/migrations/update-14-7-6/update-webpack-executor.js +16 -20
- package/src/migrations/update-15-0-0/add-babel-inputs.js +3 -6
- package/src/migrations/update-15-0-0/update-rollup-executor.js +26 -30
- package/src/migrations/update-15-5-4/update-babel-preset.js +24 -28
- package/src/migrations/update-15-9-1/add-dropped-dependencies.js +24 -28
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +3 -6
- package/src/migrations/update-16-0-0-update-executors/update-16-0-0-update-executors.js +27 -31
- package/src/utils/wait-for-port-open.js +3 -6
|
@@ -5,9 +5,7 @@ const net = require("net");
|
|
|
5
5
|
function waitForPortOpen(port, options = {}) {
|
|
6
6
|
const allowedErrorCodes = ['ECONNREFUSED', 'ECONNRESET'];
|
|
7
7
|
return new Promise((resolve, reject) => {
|
|
8
|
-
const checkPort = (retries) => {
|
|
9
|
-
var _a, _b;
|
|
10
|
-
if (retries === void 0) { retries = (_a = options.retries) !== null && _a !== void 0 ? _a : 120; }
|
|
8
|
+
const checkPort = (retries = options.retries ?? 120) => {
|
|
11
9
|
const client = new net.Socket();
|
|
12
10
|
const cleanupClient = () => {
|
|
13
11
|
client.removeAllListeners('connect');
|
|
@@ -21,18 +19,17 @@ function waitForPortOpen(port, options = {}) {
|
|
|
21
19
|
resolve();
|
|
22
20
|
});
|
|
23
21
|
client.once('error', (err) => {
|
|
24
|
-
var _a;
|
|
25
22
|
if (retries === 0 || !allowedErrorCodes.includes(err['code'])) {
|
|
26
23
|
cleanupClient();
|
|
27
24
|
reject(err);
|
|
28
25
|
}
|
|
29
26
|
else {
|
|
30
|
-
setTimeout(() => checkPort(retries - 1),
|
|
27
|
+
setTimeout(() => checkPort(retries - 1), options.retryDelay ?? 1000);
|
|
31
28
|
}
|
|
32
29
|
});
|
|
33
30
|
// Node will use IPv6 if it is available, but this can cause issues if the server is only listening on IPv4.
|
|
34
31
|
// Hard-coding to look on 127.0.0.1 to avoid using the IPv6 loopback address "::1".
|
|
35
|
-
client.connect({ port, host:
|
|
32
|
+
client.connect({ port, host: options.host ?? '127.0.0.1' });
|
|
36
33
|
};
|
|
37
34
|
checkPort();
|
|
38
35
|
});
|