@dotcom-tool-kit/node 3.1.1 → 3.2.1
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/lib/tasks/node.d.ts.map +1 -1
- package/lib/tasks/node.js +5 -11
- package/package.json +3 -3
- package/readme.md +0 -1
package/lib/tasks/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/tasks/node.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/tasks/node.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAA;AAMnE,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,IAAI,CAAC,OAAO,UAAU,CAAC;IACvD,MAAM,CAAC,WAAW,SAAK;IAEjB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAkD3B"}
|
package/lib/tasks/node.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const types_1 = require("@dotcom-tool-kit/types");
|
|
5
4
|
const error_1 = require("@dotcom-tool-kit/error");
|
|
6
|
-
const child_process_1 = require("child_process");
|
|
7
|
-
const vault_1 = require("@dotcom-tool-kit/vault");
|
|
8
|
-
const state_1 = require("@dotcom-tool-kit/state");
|
|
9
5
|
const logger_1 = require("@dotcom-tool-kit/logger");
|
|
6
|
+
const state_1 = require("@dotcom-tool-kit/state");
|
|
7
|
+
const types_1 = require("@dotcom-tool-kit/types");
|
|
8
|
+
const vault_1 = require("@dotcom-tool-kit/vault");
|
|
9
|
+
const child_process_1 = require("child_process");
|
|
10
10
|
const get_port_1 = tslib_1.__importDefault(require("get-port"));
|
|
11
11
|
const wait_port_1 = tslib_1.__importDefault(require("wait-port"));
|
|
12
12
|
class Node extends types_1.Task {
|
|
13
13
|
async run() {
|
|
14
|
-
const { entry, args, useVault, ports
|
|
14
|
+
const { entry, args, useVault, ports } = this.options;
|
|
15
15
|
let vaultEnv = {};
|
|
16
16
|
if (useVault) {
|
|
17
17
|
const vault = new vault_1.VaultEnvVars(this.logger, {
|
|
@@ -28,11 +28,6 @@ class Node extends types_1.Task {
|
|
|
28
28
|
error.details = `this is the entrypoint for your app, e.g. ${logger_1.styles.filepath('server/app.js')}`;
|
|
29
29
|
throw error;
|
|
30
30
|
}
|
|
31
|
-
let { execArgv } = process;
|
|
32
|
-
// disable native fetch if supported by runtime
|
|
33
|
-
if (!allowNativeFetch && process.allowedNodeEnvironmentFlags.has('--no-experimental-fetch')) {
|
|
34
|
-
execArgv = [...execArgv, '--no-experimental-fetch'];
|
|
35
|
-
}
|
|
36
31
|
this.logger.verbose('starting the child node process...');
|
|
37
32
|
const child = (0, child_process_1.fork)(entry, args, {
|
|
38
33
|
env: {
|
|
@@ -40,7 +35,6 @@ class Node extends types_1.Task {
|
|
|
40
35
|
PORT: port.toString(),
|
|
41
36
|
...process.env
|
|
42
37
|
},
|
|
43
|
-
execArgv,
|
|
44
38
|
silent: true
|
|
45
39
|
});
|
|
46
40
|
(0, logger_1.hookFork)(this.logger, entry, child);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotcom-tool-kit/node",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib",
|
|
6
6
|
"scripts": {
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@dotcom-tool-kit/error": "^3.1.0",
|
|
14
14
|
"@dotcom-tool-kit/state": "^3.1.0",
|
|
15
|
-
"@dotcom-tool-kit/types": "^3.
|
|
16
|
-
"@dotcom-tool-kit/vault": "^3.1.
|
|
15
|
+
"@dotcom-tool-kit/types": "^3.3.1",
|
|
16
|
+
"@dotcom-tool-kit/vault": "^3.1.3",
|
|
17
17
|
"get-port": "^5.1.1",
|
|
18
18
|
"tslib": "^2.3.1",
|
|
19
19
|
"wait-port": "^0.2.9"
|
package/readme.md
CHANGED
|
@@ -27,7 +27,6 @@ plugins:
|
|
|
27
27
|
| `args` | additional arguments to pass to your application | `[]` |
|
|
28
28
|
| `useVault` | option to run the application with environment variables from Vault | `true` |
|
|
29
29
|
| `ports` | ports to try to bind to for this application | `[3001, 3002, 3003]` |
|
|
30
|
-
| `allowNativeFetch` | use Node's native fetch if supported | `false` |
|
|
31
30
|
|
|
32
31
|
## Tasks
|
|
33
32
|
|