@nx/module-federation 23.0.0-rc.3 → 23.0.0-rc.4
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.
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Check if a port is
|
|
3
|
-
*
|
|
2
|
+
* Check if a port is in use by attempting to bind to it. Binding is local and
|
|
3
|
+
* resolves immediately, so unlike a connection-based check it never stalls on
|
|
4
|
+
* the OS TCP connect timeout when `localhost` resolves to an unreachable address
|
|
5
|
+
* (e.g. IPv6 `::1`) -- the cause of the `nx serve` hang in #33909.
|
|
4
6
|
*/
|
|
5
7
|
export declare function isPortInUse(port: number, host?: string): Promise<boolean>;
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isPortInUse = isPortInUse;
|
|
4
|
-
const
|
|
4
|
+
const net_1 = require("net");
|
|
5
5
|
/**
|
|
6
|
-
* Check if a port is
|
|
7
|
-
*
|
|
6
|
+
* Check if a port is in use by attempting to bind to it. Binding is local and
|
|
7
|
+
* resolves immediately, so unlike a connection-based check it never stalls on
|
|
8
|
+
* the OS TCP connect timeout when `localhost` resolves to an unreachable address
|
|
9
|
+
* (e.g. IPv6 `::1`) -- the cause of the `nx serve` hang in #33909.
|
|
8
10
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
function isPortInUse(port, host = 'localhost') {
|
|
12
|
+
return new Promise((resolve) => {
|
|
13
|
+
const server = (0, net_1.createServer)();
|
|
14
|
+
server.once('error', (err) => {
|
|
15
|
+
resolve(err.code === 'EADDRINUSE');
|
|
16
|
+
});
|
|
17
|
+
server.once('listening', () => {
|
|
18
|
+
server.close(() => resolve(false));
|
|
19
|
+
});
|
|
20
|
+
server.listen(port, host);
|
|
21
|
+
});
|
|
17
22
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/module-federation",
|
|
3
3
|
"description": "The Nx Plugin for Module Federation contains executors and utilities that support building applications using Module Federation.",
|
|
4
|
-
"version": "23.0.0-rc.
|
|
4
|
+
"version": "23.0.0-rc.4",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -130,9 +130,9 @@
|
|
|
130
130
|
"picocolors": "^1.1.0",
|
|
131
131
|
"tslib": "^2.3.0",
|
|
132
132
|
"webpack": "5.105.2",
|
|
133
|
-
"@nx/devkit": "23.0.0-rc.
|
|
134
|
-
"@nx/js": "23.0.0-rc.
|
|
135
|
-
"@nx/web": "23.0.0-rc.
|
|
133
|
+
"@nx/devkit": "23.0.0-rc.4",
|
|
134
|
+
"@nx/js": "23.0.0-rc.4",
|
|
135
|
+
"@nx/web": "23.0.0-rc.4"
|
|
136
136
|
},
|
|
137
137
|
"peerDependencies": {
|
|
138
138
|
"@module-federation/enhanced": "^2.0.0",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
}
|
|
148
148
|
},
|
|
149
149
|
"devDependencies": {
|
|
150
|
-
"nx": "23.0.0-rc.
|
|
150
|
+
"nx": "23.0.0-rc.4"
|
|
151
151
|
},
|
|
152
152
|
"nx-migrations": {
|
|
153
153
|
"migrations": "./migrations.json",
|