@nx/web 16.3.0-beta.5 → 16.3.0-beta.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/web",
3
- "version": "16.3.0-beta.5",
3
+ "version": "16.3.0-beta.6",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Web Components contains generators for managing Web Component applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Cypress, and Storybook.\n\n- Scaffolding for creating buildable libraries that can be published to npm.\n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -30,9 +30,9 @@
30
30
  "migrations": "./migrations.json"
31
31
  },
32
32
  "dependencies": {
33
- "@nrwl/web": "16.3.0-beta.5",
34
- "@nx/devkit": "16.3.0-beta.5",
35
- "@nx/js": "16.3.0-beta.5",
33
+ "@nrwl/web": "16.3.0-beta.6",
34
+ "@nx/devkit": "16.3.0-beta.6",
35
+ "@nx/js": "16.3.0-beta.6",
36
36
  "chalk": "^4.1.0",
37
37
  "chokidar": "^3.5.1",
38
38
  "detect-port": "^1.5.1",
@@ -44,5 +44,5 @@
44
44
  "access": "public"
45
45
  },
46
46
  "types": "./index.d.ts",
47
- "gitHead": "11bb99316d977adfc3e0599076a73461ec8c48a1"
47
+ "gitHead": "c8d245189be8176447ad6d4ac57ff6dd4d9d9c1c"
48
48
  }
@@ -0,0 +1,5 @@
1
+ export declare function waitForPortOpen(port: number, options?: {
2
+ host?: string;
3
+ retries?: number;
4
+ retryDelay?: number;
5
+ }): Promise<void>;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.waitForPortOpen = void 0;
4
+ const net = require("net");
5
+ function waitForPortOpen(port, options = {}) {
6
+ const allowedErrorCodes = ['ECONNREFUSED', 'ECONNRESET'];
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; }
11
+ const client = new net.Socket();
12
+ const cleanupClient = () => {
13
+ client.removeAllListeners('connect');
14
+ client.removeAllListeners('error');
15
+ client.end();
16
+ client.destroy();
17
+ client.unref();
18
+ };
19
+ client.once('connect', () => {
20
+ cleanupClient();
21
+ resolve();
22
+ });
23
+ client.once('error', (err) => {
24
+ var _a;
25
+ if (retries === 0 || !allowedErrorCodes.includes(err['code'])) {
26
+ cleanupClient();
27
+ reject(err);
28
+ }
29
+ else {
30
+ setTimeout(() => checkPort(retries - 1), (_a = options.retryDelay) !== null && _a !== void 0 ? _a : 1000);
31
+ }
32
+ });
33
+ client.connect({ port, host: (_b = options.host) !== null && _b !== void 0 ? _b : 'localhost' });
34
+ };
35
+ checkPort();
36
+ });
37
+ }
38
+ exports.waitForPortOpen = waitForPortOpen;
39
+ //# sourceMappingURL=wait-for-port-open.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wait-for-port-open.js","sourceRoot":"","sources":["../../../../../packages/web/src/utils/wait-for-port-open.ts"],"names":[],"mappings":";;;AAAA,2BAA2B;AAE3B,SAAgB,eAAe,CAC7B,IAAY,EACZ,UAAoE,EAAE;IAEtE,MAAM,iBAAiB,GAAG,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;IAEzD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,SAAS,GAAG,CAAC,OAAgC,EAAE,EAAE;;oCAApC,EAAA,gBAAU,OAAO,CAAC,OAAO,mCAAI,GAAG;YACjD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;YAChC,MAAM,aAAa,GAAG,GAAG,EAAE;gBACzB,MAAM,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;gBACrC,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;gBACnC,MAAM,CAAC,GA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