@dotcom-tool-kit/node 2.2.4 → 2.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/index.js CHANGED
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.tasks = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const node_1 = (0, tslib_1.__importDefault)(require("./tasks/node"));
5
+ const node_1 = tslib_1.__importDefault(require("./tasks/node"));
6
6
  exports.tasks = [node_1.default];
@@ -1,8 +1,7 @@
1
1
  import { Task } from '@dotcom-tool-kit/types';
2
- import { NodeOptions, NodeSchema } from '@dotcom-tool-kit/types/lib/schema/node';
2
+ import { NodeSchema } from '@dotcom-tool-kit/types/lib/schema/node';
3
3
  export default class Node extends Task<typeof NodeSchema> {
4
4
  static description: string;
5
- static defaultOptions: NodeOptions;
6
5
  run(): Promise<void>;
7
6
  }
8
7
  //# sourceMappingURL=node.d.ts.map
@@ -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,WAAW,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAA;AAShF,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,IAAI,CAAC,OAAO,UAAU,CAAC;IACvD,MAAM,CAAC,WAAW,SAAK;IAEvB,MAAM,CAAC,cAAc,EAAE,WAAW,CAIjC;IAEK,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAkD3B"}
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;CAkD3B"}
package/lib/tasks/node.js CHANGED
@@ -7,8 +7,8 @@ const child_process_1 = require("child_process");
7
7
  const vault_1 = require("@dotcom-tool-kit/vault");
8
8
  const state_1 = require("@dotcom-tool-kit/state");
9
9
  const logger_1 = require("@dotcom-tool-kit/logger");
10
- const get_port_1 = (0, tslib_1.__importDefault)(require("get-port"));
11
- const wait_port_1 = (0, tslib_1.__importDefault)(require("wait-port"));
10
+ const get_port_1 = tslib_1.__importDefault(require("get-port"));
11
+ const wait_port_1 = tslib_1.__importDefault(require("wait-port"));
12
12
  class Node extends types_1.Task {
13
13
  async run() {
14
14
  const { entry, args, useVault, ports } = this.options;
@@ -53,8 +53,3 @@ class Node extends types_1.Task {
53
53
  }
54
54
  exports.default = Node;
55
55
  Node.description = '';
56
- Node.defaultOptions = {
57
- entry: './server/app.js',
58
- useVault: true,
59
- ports: [3001, 3002, 3003]
60
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotcom-tool-kit/node",
3
- "version": "2.2.4",
3
+ "version": "2.3.0",
4
4
  "description": "",
5
5
  "main": "lib",
6
6
  "scripts": {
@@ -12,8 +12,8 @@
12
12
  "dependencies": {
13
13
  "@dotcom-tool-kit/error": "^2.0.1",
14
14
  "@dotcom-tool-kit/state": "^2.0.1",
15
- "@dotcom-tool-kit/types": "^2.7.1",
16
- "@dotcom-tool-kit/vault": "^2.0.11",
15
+ "@dotcom-tool-kit/types": "^2.9.0",
16
+ "@dotcom-tool-kit/vault": "^2.0.13",
17
17
  "get-port": "^5.1.1",
18
18
  "tslib": "^2.3.1",
19
19
  "wait-port": "^0.2.9"
@@ -30,6 +30,6 @@
30
30
  ".toolkitrc.yml"
31
31
  ],
32
32
  "peerDependencies": {
33
- "dotcom-tool-kit": "2.x"
33
+ "dotcom-tool-kit": "^2.6.0"
34
34
  }
35
35
  }
package/readme.md ADDED
@@ -0,0 +1,34 @@
1
+ # @dotcom-tool-kit/node
2
+
3
+ Run your Node application.
4
+
5
+ This plugin will be installed as a dependency of the [frontend-app](https://github.com/Financial-Times/dotcom-tool-kit/tree/main/plugins/frontend-app), [backend-heroku-app](https://github.com/Financial-Times/dotcom-tool-kit/tree/main/plugins/backend-heroku-app) plugins so you do not need to install it separately if you are using either of those plugins.
6
+
7
+ ## Installation
8
+
9
+ Install `@dotcom-tool-kit/node` as a `devDependency` in your app:
10
+
11
+ ```sh
12
+ npm install --save-dev @dotcom-tool-kit/node
13
+ ```
14
+
15
+ Add the plugin to your [Tool Kit configuration](https://github.com/financial-times/dotcom-tool-kit/blob/main/readme.md#configuration):
16
+
17
+ ```yaml
18
+ plugins:
19
+ - '@dotcom-tool-kit/node'
20
+ ```
21
+
22
+ ## Options
23
+
24
+ | Key | Description | Default value |
25
+ |-|-|-|
26
+ | `entry` | path to the node application | `'./server/app.js'` |
27
+ | `useVault` | option to run the application with environment variables from Vault | `true` |
28
+ | `ports` | ports to try to bind to for this application | `[3001, 3002, 3003]` |
29
+
30
+ ## Tasks
31
+
32
+ | Task | Description | Default hooks |
33
+ |-|-|-|
34
+ | `Node` | Run node application | `run:local` |