@dotcom-tool-kit/node 4.2.8 → 4.3.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 +21 -1
- package/lib/tasks/node.d.ts.map +1 -1
- package/lib/tasks/node.js +21 -0
- package/package.json +6 -8
package/lib/tasks/node.d.ts
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
import { Task, TaskRunContext } from '@dotcom-tool-kit/base';
|
|
2
|
-
import
|
|
2
|
+
import * as z from 'zod';
|
|
3
|
+
declare const NodeSchema: z.ZodObject<{
|
|
4
|
+
entry: z.ZodDefault<z.ZodString>;
|
|
5
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
6
|
+
useDoppler: z.ZodDefault<z.ZodBoolean>;
|
|
7
|
+
ports: z.ZodDefault<z.ZodUnion<[z.ZodArray<z.ZodNumber, "many">, z.ZodLiteral<false>]>>;
|
|
8
|
+
watch: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
entry: string;
|
|
11
|
+
useDoppler: boolean;
|
|
12
|
+
ports: false | number[];
|
|
13
|
+
args?: string[] | undefined;
|
|
14
|
+
watch?: boolean | undefined;
|
|
15
|
+
}, {
|
|
16
|
+
entry?: string | undefined;
|
|
17
|
+
args?: string[] | undefined;
|
|
18
|
+
useDoppler?: boolean | undefined;
|
|
19
|
+
ports?: false | number[] | undefined;
|
|
20
|
+
watch?: boolean | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
export { NodeSchema as schema };
|
|
3
23
|
export default class Node extends Task<{
|
|
4
24
|
task: typeof NodeSchema;
|
|
5
25
|
}> {
|
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":"AAEA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/tasks/node.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAM5D,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,QAAA,MAAM,UAAU;;;;;;;;;;;;;;;;;;EAqB+C,CAAA;AAC/D,OAAO,EAAE,UAAU,IAAI,MAAM,EAAE,CAAA;AAE/B,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,IAAI,CAAC;IAAE,IAAI,EAAE,OAAO,UAAU,CAAA;CAAE,CAAC;IAC3D,GAAG,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;CAuD1D"}
|
package/lib/tasks/node.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.schema = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const logger_1 = require("@dotcom-tool-kit/logger");
|
|
5
6
|
const state_1 = require("@dotcom-tool-kit/state");
|
|
@@ -9,6 +10,26 @@ const child_process_1 = require("child_process");
|
|
|
9
10
|
const get_port_1 = tslib_1.__importDefault(require("get-port"));
|
|
10
11
|
const wait_port_1 = tslib_1.__importDefault(require("wait-port"));
|
|
11
12
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
13
|
+
const z = tslib_1.__importStar(require("zod"));
|
|
14
|
+
const NodeSchema = z
|
|
15
|
+
.object({
|
|
16
|
+
entry: z.string().default('./server/app.js').describe('path to the node application'),
|
|
17
|
+
args: z.string().array().optional().describe('additional arguments to pass to your application'),
|
|
18
|
+
useDoppler: z
|
|
19
|
+
.boolean()
|
|
20
|
+
.default(true)
|
|
21
|
+
.describe('whether to run the application with environment variables from Doppler'),
|
|
22
|
+
ports: z
|
|
23
|
+
.union([z.number().array(), z.literal(false)])
|
|
24
|
+
.default([3001, 3002, 3003])
|
|
25
|
+
.describe("ports to try to bind to for this application. set to `false` for an entry point that wouldn't bind to a port, such as a worker process or one-off script."),
|
|
26
|
+
watch: z
|
|
27
|
+
.boolean()
|
|
28
|
+
.optional()
|
|
29
|
+
.describe('run Node in watch mode, which restarts your application when the entrypoint or any imported files are changed. **nb** this option is experimental in versions of Node before v20.13.')
|
|
30
|
+
})
|
|
31
|
+
.describe('Run a Node.js application for local development.');
|
|
32
|
+
exports.schema = NodeSchema;
|
|
12
33
|
class Node extends base_1.Task {
|
|
13
34
|
async run({ cwd, config }) {
|
|
14
35
|
const { entry, args, useDoppler, ports } = this.options;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotcom-tool-kit/node",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib",
|
|
6
6
|
"scripts": {
|
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
"author": "FT.com Platforms Team <platforms-team.customer-products@ft.com>",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dotcom-tool-kit/base": "^1.1.
|
|
13
|
+
"@dotcom-tool-kit/base": "^1.1.10",
|
|
14
|
+
"@dotcom-tool-kit/doppler": "^2.2.0",
|
|
14
15
|
"@dotcom-tool-kit/error": "^4.1.0",
|
|
15
|
-
"@dotcom-tool-kit/state": "^4.3.
|
|
16
|
-
"@dotcom-tool-kit/doppler": "^2.1.7",
|
|
16
|
+
"@dotcom-tool-kit/state": "^4.3.1",
|
|
17
17
|
"get-port": "^5.1.1",
|
|
18
18
|
"tslib": "^2.3.1",
|
|
19
|
-
"wait-port": "^0.2.9"
|
|
19
|
+
"wait-port": "^0.2.9",
|
|
20
|
+
"zod": "^3.24.1"
|
|
20
21
|
},
|
|
21
22
|
"repository": {
|
|
22
23
|
"type": "git",
|
|
@@ -34,8 +35,5 @@
|
|
|
34
35
|
},
|
|
35
36
|
"engines": {
|
|
36
37
|
"node": "18.x || 20.x || 22.x"
|
|
37
|
-
},
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"@dotcom-tool-kit/schemas": "^1.9.0"
|
|
40
38
|
}
|
|
41
39
|
}
|