@dotcom-tool-kit/node 3.0.0 → 3.1.0
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 +7 -1
- package/package.json +9 -5
- package/readme.md +2 -0
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":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAA;AASnE,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,IAAI,CAAC,OAAO,UAAU,CAAC;IACvD,MAAM,CAAC,WAAW,SAAK;IAEjB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/tasks/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAA;AASnE,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,IAAI,CAAC,OAAO,UAAU,CAAC;IACvD,MAAM,CAAC,WAAW,SAAK;IAEjB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAyD3B"}
|
package/lib/tasks/node.js
CHANGED
|
@@ -11,7 +11,7 @@ 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 } = this.options;
|
|
14
|
+
const { entry, args, useVault, ports, allowNativeFetch } = this.options;
|
|
15
15
|
let vaultEnv = {};
|
|
16
16
|
if (useVault) {
|
|
17
17
|
const vault = new vault_1.VaultEnvVars(this.logger, {
|
|
@@ -28,6 +28,11 @@ 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
|
+
}
|
|
31
36
|
this.logger.verbose('starting the child node process...');
|
|
32
37
|
const child = (0, child_process_1.fork)(entry, args, {
|
|
33
38
|
env: {
|
|
@@ -35,6 +40,7 @@ class Node extends types_1.Task {
|
|
|
35
40
|
PORT: port.toString(),
|
|
36
41
|
...process.env
|
|
37
42
|
},
|
|
43
|
+
execArgv,
|
|
38
44
|
silent: true
|
|
39
45
|
});
|
|
40
46
|
(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.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib",
|
|
6
6
|
"scripts": {
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
"author": "FT.com Platforms Team <platforms-team.customer-products@ft.com>",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dotcom-tool-kit/error": "^3.
|
|
14
|
-
"@dotcom-tool-kit/state": "^3.
|
|
15
|
-
"@dotcom-tool-kit/types": "^3.
|
|
16
|
-
"@dotcom-tool-kit/vault": "^3.
|
|
13
|
+
"@dotcom-tool-kit/error": "^3.1.0",
|
|
14
|
+
"@dotcom-tool-kit/state": "^3.1.0",
|
|
15
|
+
"@dotcom-tool-kit/types": "^3.1.0",
|
|
16
|
+
"@dotcom-tool-kit/vault": "^3.1.0",
|
|
17
17
|
"get-port": "^5.1.1",
|
|
18
18
|
"tslib": "^2.3.1",
|
|
19
19
|
"wait-port": "^0.2.9"
|
|
@@ -31,5 +31,9 @@
|
|
|
31
31
|
],
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"dotcom-tool-kit": "3.x"
|
|
34
|
+
},
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": "16.x || 18.x",
|
|
37
|
+
"npm": "7.x || 8.x || 9.x"
|
|
34
38
|
}
|
|
35
39
|
}
|
package/readme.md
CHANGED
|
@@ -24,8 +24,10 @@ plugins:
|
|
|
24
24
|
| Key | Description | Default value |
|
|
25
25
|
|-|-|-|
|
|
26
26
|
| `entry` | path to the node application | `'./server/app.js'` |
|
|
27
|
+
| `args` | additional arguments to pass to your application | `[]` |
|
|
27
28
|
| `useVault` | option to run the application with environment variables from Vault | `true` |
|
|
28
29
|
| `ports` | ports to try to bind to for this application | `[3001, 3002, 3003]` |
|
|
30
|
+
| `allowNativeFetch` | use Node's native fetch if supported | `false` |
|
|
29
31
|
|
|
30
32
|
## Tasks
|
|
31
33
|
|