nx-lifecycle 1.1.1 → 1.1.3

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/README.md CHANGED
@@ -14,8 +14,6 @@ Declare your workflow once — `build` runs hooks `pre` → `run` → `post`, `t
14
14
  - **Per-project implementations** — each project opts into the bound targets it declares, so TypeScript, Go and Java projects can all answer to the same `build` and `test`.
15
15
  - **Nothing to commit** — the plugin infers targets when Nx builds the project graph, and fails with the fix if a project's `dependsOn` breaks the wiring. An executor that writes the config to files is also available.
16
16
 
17
- **Compared to** hand-written `dependsOn` in `targetDefaults` and each `project.json`: there, adding a step between two existing ones means editing every target that depended on the first, in every project that has it.
18
-
19
17
  For the problem this solves and design rationale, see [WHY-NX-LIFECYCLE.md](https://github.com/JacobLey/leyman/blob/main/apps/nx-lifecycle/WHY-NX-LIFECYCLE.md).
20
18
 
21
19
  ## Contents
@@ -33,6 +31,7 @@ For the problem this solves and design rationale, see [WHY-NX-LIFECYCLE.md](http
33
31
  - [dryRun](#dryrun)
34
32
  - [CLI](#cli)
35
33
  - [explain](#explain)
34
+ - [Compared to alternatives](#compared-to-alternatives)
36
35
 
37
36
  ## Install
38
37
 
@@ -368,3 +367,7 @@ my-lib
368
367
  ```
369
368
 
370
369
  Stages and bindings come from the [plugin](#plugin) options in `nx.json`, or else from `--config-file` (default `lifecycle.json`). Bound targets and their other dependencies come from the project as Nx resolves it, after `targetDefaults` and `project.json`.
370
+
371
+ ## Compared to alternatives
372
+
373
+ Without nx-lifecycle, `dependsOn` is written by hand in `targetDefaults` and each `project.json`. Adding a step between two existing ones then means editing every target that depended on the first, in every project that has it.
@@ -1,6 +1,7 @@
1
1
  import Path from 'node:path';
2
2
  import { createProjectGraphAsync, readJsonFile, workspaceRoot } from '@nx/devkit';
3
3
  import { bind } from 'haywire';
4
+ import { getErrorMessage } from 'unknown-error';
4
5
  import { explainLifecycle, formatExplanation } from '../lifecycle/explain.js';
5
6
  import { loadOptions } from '../lifecycle/normalizer.js';
6
7
  import { planLifecycle } from '../lifecycle/processor.js';
@@ -48,7 +49,7 @@ export const explainCommand = {
48
49
  }
49
50
  });
50
51
  } catch (err) {
51
- console.error(err.message);
52
+ console.error(getErrorMessage(err));
52
53
  process.exitCode = 1;
53
54
  return;
54
55
  }
@@ -30,8 +30,8 @@ export declare const stagesSchema: import("juniper").ObjectSchema<{}, never, imp
30
30
  params?: string;
31
31
  dependencies?: never;
32
32
  projects: (string | string[] | undefined) & (string | string[]);
33
- } & string), [], never, unknown, false>;
34
- hooks: import("juniper").ArraySchema<string, [], never, unknown, false>;
33
+ } & string), [], never, unknown, false, 0>;
34
+ hooks: import("juniper").ArraySchema<string, [], never, unknown, false, 0>;
35
35
  }, never, boolean, import("juniper").EmptyIndex, unknown, false>, import("juniper").EmptyIndex, unknown, false>;
36
36
  export declare const bindingsSchema: import("juniper").ObjectSchema<{}, never, import("juniper").StringSchema<string, false>, import("juniper").EmptyIndex, unknown, false>;
37
37
  declare const lifecycleOptionsSchema: import("juniper").ObjectSchema<{
@@ -70,8 +70,8 @@ declare const lifecycleOptionsSchema: import("juniper").ObjectSchema<{
70
70
  params?: string;
71
71
  dependencies?: never;
72
72
  projects: (string | string[] | undefined) & (string | string[]);
73
- } & string), [], never, unknown, false>;
74
- hooks: import("juniper").ArraySchema<string, [], never, unknown, false>;
73
+ } & string), [], never, unknown, false, 0>;
74
+ hooks: import("juniper").ArraySchema<string, [], never, unknown, false, 0>;
75
75
  }, never, boolean, import("juniper").EmptyIndex, unknown, false>, import("juniper").EmptyIndex, unknown, false>;
76
76
  bindings: import("juniper").ObjectSchema<{}, never, import("juniper").StringSchema<string, false>, import("juniper").EmptyIndex, unknown, false>;
77
77
  }, "bindings" | "stages", false, import("juniper").EmptyIndex, unknown, false>;
@@ -32,8 +32,8 @@ declare const lifecyclePluginOptionsSchema: import("juniper").ObjectSchema<{
32
32
  params?: string;
33
33
  dependencies?: never;
34
34
  projects: (string | string[] | undefined) & (string | string[]);
35
- } & string), [], never, unknown, false>;
36
- hooks: import("juniper").ArraySchema<string, [], never, unknown, false>;
35
+ } & string), [], never, unknown, false, 0>;
36
+ hooks: import("juniper").ArraySchema<string, [], never, unknown, false, 0>;
37
37
  }, never, boolean, import("juniper").EmptyIndex, unknown, false>, import("juniper").EmptyIndex, unknown, false>;
38
38
  bindings: import("juniper").ObjectSchema<{}, never, import("juniper").StringSchema<string, false>, import("juniper").EmptyIndex, unknown, false>;
39
39
  }, "bindings" | "stages", false, import("juniper").EmptyIndex, unknown, false>;
@@ -40,7 +40,7 @@ export declare const dependsOnSchema: import("juniper").ArraySchema<string | {
40
40
  params?: string;
41
41
  dependencies?: never;
42
42
  projects: (string | string[] | undefined) & (string | string[]);
43
- } & string), [], never, unknown, false>;
43
+ } & string), [], never, unknown, false, 0>;
44
44
  export type DependsOn = SchemaType<typeof dependsOnSchema>;
45
45
  export {};
46
46
  //# sourceMappingURL=depend-on.d.ts.map
@@ -33,7 +33,7 @@ declare const nxJsonSchema: import("juniper").ObjectSchema<{
33
33
  params?: string;
34
34
  dependencies?: never;
35
35
  projects: (string | string[] | undefined) & (string | string[]);
36
- } & string), [], never, unknown, false>;
36
+ } & string), [], never, unknown, false, 0>;
37
37
  configurations: import("juniper").ObjectSchema<{}, never, boolean, import("juniper").EmptyIndex, {
38
38
  [x: string]: unknown;
39
39
  __lifecycle?: never;
@@ -33,7 +33,7 @@ declare const projectJsonSchema: import("juniper").ObjectSchema<{
33
33
  params?: string;
34
34
  dependencies?: never;
35
35
  projects: (string | string[] | undefined) & (string | string[]);
36
- } & string), [], never, unknown, false>;
36
+ } & string), [], never, unknown, false, 0>;
37
37
  configurations: import("juniper").ObjectSchema<{}, never, boolean, import("juniper").EmptyIndex, {
38
38
  [x: string]: unknown;
39
39
  __lifecycle?: never;
@@ -31,7 +31,7 @@ declare const targetSchema: import("juniper").ObjectSchema<{
31
31
  params?: string;
32
32
  dependencies?: never;
33
33
  projects: (string | string[] | undefined) & (string | string[]);
34
- } & string), [], never, unknown, false>;
34
+ } & string), [], never, unknown, false, 0>;
35
35
  configurations: import("juniper").ObjectSchema<{}, never, boolean, import("juniper").EmptyIndex, {
36
36
  [x: string]: unknown;
37
37
  __lifecycle?: never;
@@ -72,7 +72,7 @@ export declare const allTargetsSchema: import("juniper").ObjectSchema<{}, never,
72
72
  params?: string;
73
73
  dependencies?: never;
74
74
  projects: (string | string[] | undefined) & (string | string[]);
75
- } & string), [], never, unknown, false>;
75
+ } & string), [], never, unknown, false, 0>;
76
76
  configurations: import("juniper").ObjectSchema<{}, never, boolean, import("juniper").EmptyIndex, {
77
77
  [x: string]: unknown;
78
78
  __lifecycle?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx-lifecycle",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "Nx plugin that derives every dependsOn from declared lifecycle stages (build, test, …) and the targets bound to them.",
5
5
  "engines": {
6
6
  "node": ">=24"
@@ -45,6 +45,7 @@
45
45
  "bin.mjs",
46
46
  "executors.json",
47
47
  "out",
48
+ "!out/.generated.json",
48
49
  "WHY-NX-LIFECYCLE.md"
49
50
  ],
50
51
  "imports": {
@@ -58,17 +59,18 @@
58
59
  "lifecycle": "./bin.mjs"
59
60
  },
60
61
  "dependencies": {
61
- "@nx/devkit": "^23.2.1",
62
+ "@nx/devkit": "^23.3.0",
62
63
  "ci-info": "^4.4.0",
63
64
  "entry-script": "^4.1.0",
64
65
  "fast-equals": "^6.0.4",
65
- "format-file": "^1.0.1",
66
- "haywire": "^1.1.1",
67
- "haywire-launcher": "^1.0.1",
68
- "juniper": "^2.2.0",
69
- "juniper-validator": "^0.2.1",
70
- "nx": "^23.2.1",
66
+ "format-file": "^1.0.2",
67
+ "haywire": "^2.0.1",
68
+ "haywire-launcher": "^1.0.3",
69
+ "juniper": "^2.4.0",
70
+ "juniper-validator": "^0.4.0",
71
+ "nx": "^23.3.0",
71
72
  "parse-cwd": "^2.0.2",
73
+ "unknown-error": "^0.1.0",
72
74
  "yargs": "^18.2.0"
73
75
  },
74
76
  "devDependencies": {
@@ -85,7 +87,7 @@
85
87
  "c8": "^12.0.0",
86
88
  "eslint": "^10.12.0",
87
89
  "expect-type": "^1.4.0",
88
- "load-populate-files": "^1.0.2",
90
+ "load-populate-files": "^1.1.1",
89
91
  "mocha": "^12.0.2",
90
92
  "mocha-chain": "^1.0.1",
91
93
  "sinon": "^22.1.0",