nx-lifecycle 0.2.0 → 1.0.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.
Files changed (53) hide show
  1. package/.npmignore +20 -0
  2. package/README.md +203 -119
  3. package/WHY-NX-LIFECYCLE.md +64 -0
  4. package/dist/bin.d.ts +603 -0
  5. package/dist/bin.js +3 -2
  6. package/dist/cli.d.ts +1 -1
  7. package/dist/commands/index.d.ts +752 -2
  8. package/dist/commands/lib/dependencies.d.ts +7 -7
  9. package/dist/commands/lib/dependencies.js +1 -1
  10. package/dist/commands/lifecycle-command.d.ts +1 -1
  11. package/dist/executors/lifecycle/container.d.ts +603 -0
  12. package/dist/executors/lifecycle/container.js +8 -0
  13. package/dist/executors/lifecycle/index.js +2 -6
  14. package/dist/lifecycle/dependencies.d.ts +16 -0
  15. package/dist/lifecycle/{depedencies.js → dependencies.js} +1 -1
  16. package/dist/lifecycle/index.d.ts +754 -3
  17. package/dist/lifecycle/index.js +5 -5
  18. package/dist/lifecycle/lifecycle-internal.d.ts +3 -3
  19. package/dist/lifecycle/lifecycle-internal.js +26 -9
  20. package/dist/lifecycle/normalizer.d.ts +1 -1
  21. package/dist/lifecycle/processor.d.ts +41 -3
  22. package/dist/lifecycle/processor.js +36 -33
  23. package/dist/lifecycle/schema.d.ts +468 -66
  24. package/dist/lifecycle/schema.js +31 -22
  25. package/dist/plugin/container.d.ts +855 -0
  26. package/dist/plugin/container.js +13 -0
  27. package/dist/plugin/dependencies.d.ts +860 -0
  28. package/dist/plugin/dependencies.js +9 -0
  29. package/dist/plugin/index.d.ts +283 -0
  30. package/dist/plugin/index.js +6 -0
  31. package/dist/plugin/lifecycle-plugin.d.ts +21 -0
  32. package/dist/plugin/lifecycle-plugin.js +158 -0
  33. package/dist/plugin/schema.d.ts +353 -0
  34. package/dist/plugin/schema.js +21 -0
  35. package/dist/schemas/configurations.d.ts +5 -5
  36. package/dist/schemas/depend-on.d.ts +39 -9
  37. package/dist/schemas/depend-on.js +4 -2
  38. package/dist/schemas/empty.d.ts +2 -2
  39. package/dist/schemas/empty.js +2 -2
  40. package/dist/schemas/nx-json.d.ts +191 -18
  41. package/dist/schemas/nx-json.js +3 -3
  42. package/dist/schemas/project-json.d.ts +191 -18
  43. package/dist/schemas/project-json.js +3 -3
  44. package/dist/schemas/target.d.ts +79 -25
  45. package/executors.json +2 -2
  46. package/out/nx-executor/schema.json +148 -0
  47. package/out/schema.json +114 -0
  48. package/package.json +39 -40
  49. package/dist/executors/lifecycle/index.cjs +0 -15
  50. package/dist/executors/lifecycle/index.d.cts +0 -99
  51. package/dist/lifecycle/depedencies.d.ts +0 -15
  52. package/dist/schemas/lib/ajv.d.ts +0 -3
  53. package/dist/schemas/lib/ajv.js +0 -11
@@ -1,11 +1,63 @@
1
- import type { ErrorObject } from 'ajv';
2
- import { type SchemaType } from 'juniper';
1
+ import type { SchemaType } from 'juniper';
3
2
  declare const nxJsonSchema: import("juniper").ObjectSchema<{
4
3
  targetDefaults: import("juniper").ObjectSchema<{}, never, import("juniper").ObjectSchema<{
5
4
  executor: import("juniper").StringSchema<string, false>;
6
- dependsOn: import("juniper").ArraySchema<(string | (Partial<{
5
+ dependsOn: import("juniper").ArraySchema<string | (Partial<{
6
+ dependencies: boolean;
7
+ projects: never;
8
+ }> & Partial<{
9
+ target: string;
10
+ params: string;
11
+ }> & Required<Pick<{
12
+ target: string;
13
+ params: string;
14
+ }, "target">>) | (string & Partial<{
15
+ dependencies: boolean;
16
+ projects: never;
17
+ }> & Partial<{
18
+ target: string;
19
+ params: string;
20
+ }> & Required<Pick<{
21
+ target: string;
22
+ params: string;
23
+ }, "target">>) | (Partial<{
24
+ dependencies: boolean;
25
+ projects: never;
26
+ }> & Partial<{
27
+ target: string;
28
+ params: string;
29
+ }> & Required<Pick<{
30
+ target: string;
31
+ params: string;
32
+ }, "target">> & string) | (Partial<{
33
+ dependencies: never;
34
+ projects: string | string[];
35
+ }> & Required<Pick<{
36
+ dependencies: never;
37
+ projects: string | string[];
38
+ }, "projects">> & Partial<{
39
+ target: string;
40
+ params: string;
41
+ }> & Required<Pick<{
42
+ target: string;
43
+ params: string;
44
+ }, "target">>) | (string & Partial<{
45
+ dependencies: never;
46
+ projects: string | string[];
47
+ }> & Required<Pick<{
48
+ dependencies: never;
7
49
  projects: string | string[];
50
+ }, "projects">> & Partial<{
51
+ target: string;
52
+ params: string;
8
53
  }> & Required<Pick<{
54
+ target: string;
55
+ params: string;
56
+ }, "target">>) | (Partial<{
57
+ dependencies: never;
58
+ projects: string | string[];
59
+ }> & Required<Pick<{
60
+ dependencies: never;
9
61
  projects: string | string[];
10
62
  }, "projects">> & Partial<{
11
63
  target: string;
@@ -13,17 +65,64 @@ declare const nxJsonSchema: import("juniper").ObjectSchema<{
13
65
  }> & Required<Pick<{
14
66
  target: string;
15
67
  params: string;
68
+ }, "target">> & string), [], never, unknown, false>;
69
+ configurations: import("juniper").ObjectSchema<{}, never, boolean, import("juniper").EmptyIndex, (Partial<{
70
+ __lifecycle: import("juniper").EmptyObject;
71
+ }> & Required<Pick<{
72
+ __lifecycle: import("juniper").EmptyObject;
73
+ }, "__lifecycle">>) | (Record<string, unknown> & Partial<{
74
+ __lifecycle: never;
75
+ }>), boolean>;
76
+ }, never, boolean, import("juniper").EmptyIndex, unknown, false>, import("juniper").EmptyIndex, unknown, false>;
77
+ }, never, true, import("juniper").EmptyIndex, unknown, false>;
78
+ export type NxJson = SchemaType<typeof nxJsonSchema>;
79
+ export declare const assertNxJson: (x: unknown) => asserts x is Record<string, unknown> & Partial<{
80
+ targetDefaults: Record<string, Partial<{
81
+ executor: string;
82
+ dependsOn: (string | (Partial<{
83
+ dependencies: boolean;
84
+ projects: never;
85
+ }> & Partial<{
86
+ target: string;
87
+ params: string;
88
+ }> & Required<Pick<{
89
+ target: string;
90
+ params: string;
91
+ }, "target">>) | (string & Partial<{
92
+ dependencies: boolean;
93
+ projects: never;
94
+ }> & Partial<{
95
+ target: string;
96
+ params: string;
97
+ }> & Required<Pick<{
98
+ target: string;
99
+ params: string;
16
100
  }, "target">>) | (Partial<{
17
101
  dependencies: boolean;
102
+ projects: never;
18
103
  }> & Partial<{
19
104
  target: string;
20
105
  params: string;
21
106
  }> & Required<Pick<{
22
107
  target: string;
23
108
  params: string;
24
- }, "target">>)) & (string | (Partial<{
109
+ }, "target">> & string) | (Partial<{
110
+ dependencies: never;
111
+ projects: string | string[];
112
+ }> & Required<Pick<{
113
+ dependencies: never;
114
+ projects: string | string[];
115
+ }, "projects">> & Partial<{
116
+ target: string;
117
+ params: string;
118
+ }> & Required<Pick<{
119
+ target: string;
120
+ params: string;
121
+ }, "target">>) | (string & Partial<{
122
+ dependencies: never;
25
123
  projects: string | string[];
26
124
  }> & Required<Pick<{
125
+ dependencies: never;
27
126
  projects: string | string[];
28
127
  }, "projects">> & Partial<{
29
128
  target: string;
@@ -32,29 +131,103 @@ declare const nxJsonSchema: import("juniper").ObjectSchema<{
32
131
  target: string;
33
132
  params: string;
34
133
  }, "target">>) | (Partial<{
134
+ dependencies: never;
135
+ projects: string | string[];
136
+ }> & Required<Pick<{
137
+ dependencies: never;
138
+ projects: string | string[];
139
+ }, "projects">> & Partial<{
140
+ target: string;
141
+ params: string;
142
+ }> & Required<Pick<{
143
+ target: string;
144
+ params: string;
145
+ }, "target">> & string))[];
146
+ configurations: (Partial<{
147
+ __lifecycle: import("juniper").EmptyObject;
148
+ }> & Required<Pick<{
149
+ __lifecycle: import("juniper").EmptyObject;
150
+ }, "__lifecycle">>) | (Record<string, unknown> & Partial<{
151
+ __lifecycle: never;
152
+ }>);
153
+ }>>;
154
+ }>;
155
+ export type AssertNxJson = typeof assertNxJson;
156
+ export declare const assertNxJsonIdentifier: import("haywire").HaywireId<(x: unknown) => asserts x is Record<string, unknown> & Partial<{
157
+ targetDefaults: Record<string, Partial<{
158
+ executor: string;
159
+ dependsOn: (string | (Partial<{
35
160
  dependencies: boolean;
161
+ projects: never;
36
162
  }> & Partial<{
37
163
  target: string;
38
164
  params: string;
39
165
  }> & Required<Pick<{
40
166
  target: string;
41
167
  params: string;
42
- }, "target">>) | undefined), [], never, unknown, false>;
43
- configurations: import("juniper").ObjectSchema<{}, never, boolean, import("juniper").EmptyIndex, (Record<string, unknown> & Partial<{
44
- __lifecycle: never;
45
- }>) | (Partial<{
168
+ }, "target">>) | (string & Partial<{
169
+ dependencies: boolean;
170
+ projects: never;
171
+ }> & Partial<{
172
+ target: string;
173
+ params: string;
174
+ }> & Required<Pick<{
175
+ target: string;
176
+ params: string;
177
+ }, "target">>) | (Partial<{
178
+ dependencies: boolean;
179
+ projects: never;
180
+ }> & Partial<{
181
+ target: string;
182
+ params: string;
183
+ }> & Required<Pick<{
184
+ target: string;
185
+ params: string;
186
+ }, "target">> & string) | (Partial<{
187
+ dependencies: never;
188
+ projects: string | string[];
189
+ }> & Required<Pick<{
190
+ dependencies: never;
191
+ projects: string | string[];
192
+ }, "projects">> & Partial<{
193
+ target: string;
194
+ params: string;
195
+ }> & Required<Pick<{
196
+ target: string;
197
+ params: string;
198
+ }, "target">>) | (string & Partial<{
199
+ dependencies: never;
200
+ projects: string | string[];
201
+ }> & Required<Pick<{
202
+ dependencies: never;
203
+ projects: string | string[];
204
+ }, "projects">> & Partial<{
205
+ target: string;
206
+ params: string;
207
+ }> & Required<Pick<{
208
+ target: string;
209
+ params: string;
210
+ }, "target">>) | (Partial<{
211
+ dependencies: never;
212
+ projects: string | string[];
213
+ }> & Required<Pick<{
214
+ dependencies: never;
215
+ projects: string | string[];
216
+ }, "projects">> & Partial<{
217
+ target: string;
218
+ params: string;
219
+ }> & Required<Pick<{
220
+ target: string;
221
+ params: string;
222
+ }, "target">> & string))[];
223
+ configurations: (Partial<{
46
224
  __lifecycle: import("juniper").EmptyObject;
47
225
  }> & Required<Pick<{
48
226
  __lifecycle: import("juniper").EmptyObject;
49
- }, "__lifecycle">>), boolean>;
50
- }, never, boolean, import("juniper").EmptyIndex, unknown, false>, import("juniper").EmptyIndex, unknown, false>;
51
- }, never, true, import("juniper").EmptyIndex, unknown, false>;
52
- export type NxJson = SchemaType<typeof nxJsonSchema>;
53
- export interface IsNxJson {
54
- (val: unknown): val is NxJson;
55
- errors?: ErrorObject[] | null;
56
- }
57
- export declare const isNxJson: IsNxJson;
58
- export declare const isNxJsonIdentifier: import("haywire").HaywireId<IsNxJson, null, "nxJson", false, false, false, false>;
227
+ }, "__lifecycle">>) | (Record<string, unknown> & Partial<{
228
+ __lifecycle: never;
229
+ }>);
230
+ }>>;
231
+ }>, null, "nxJson", false, false, false, false, false>;
59
232
  export {};
60
233
  //# sourceMappingURL=nx-json.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { identifier } from 'haywire';
2
2
  import { objectSchema } from 'juniper';
3
- import { ajv } from './lib/ajv.js';
3
+ import { makeValidator } from 'juniper-validator';
4
4
  import { allTargetsSchema } from './target.js';
5
5
  const nxJsonSchema = objectSchema({
6
6
  properties: {
@@ -8,7 +8,7 @@ const nxJsonSchema = objectSchema({
8
8
  },
9
9
  additionalProperties: true
10
10
  });
11
- export const isNxJson = ajv.compile(nxJsonSchema.toJSON());
12
- export const isNxJsonIdentifier = identifier().named('nxJson');
11
+ export const assertNxJson = makeValidator(nxJsonSchema).assert;
12
+ export const assertNxJsonIdentifier = identifier().named('nxJson');
13
13
 
14
14
  //# sourceMappingURL=nx-json.js.map
@@ -1,11 +1,63 @@
1
- import type { ErrorObject } from 'ajv';
2
- import { type SchemaType } from 'juniper';
1
+ import type { SchemaType } from 'juniper';
3
2
  declare const projectJsonSchema: import("juniper").ObjectSchema<{
4
3
  targets: import("juniper").ObjectSchema<{}, never, import("juniper").ObjectSchema<{
5
4
  executor: import("juniper").StringSchema<string, false>;
6
- dependsOn: import("juniper").ArraySchema<(string | (Partial<{
5
+ dependsOn: import("juniper").ArraySchema<string | (Partial<{
6
+ dependencies: boolean;
7
+ projects: never;
8
+ }> & Partial<{
9
+ target: string;
10
+ params: string;
11
+ }> & Required<Pick<{
12
+ target: string;
13
+ params: string;
14
+ }, "target">>) | (string & Partial<{
15
+ dependencies: boolean;
16
+ projects: never;
17
+ }> & Partial<{
18
+ target: string;
19
+ params: string;
20
+ }> & Required<Pick<{
21
+ target: string;
22
+ params: string;
23
+ }, "target">>) | (Partial<{
24
+ dependencies: boolean;
25
+ projects: never;
26
+ }> & Partial<{
27
+ target: string;
28
+ params: string;
29
+ }> & Required<Pick<{
30
+ target: string;
31
+ params: string;
32
+ }, "target">> & string) | (Partial<{
33
+ dependencies: never;
34
+ projects: string | string[];
35
+ }> & Required<Pick<{
36
+ dependencies: never;
37
+ projects: string | string[];
38
+ }, "projects">> & Partial<{
39
+ target: string;
40
+ params: string;
41
+ }> & Required<Pick<{
42
+ target: string;
43
+ params: string;
44
+ }, "target">>) | (string & Partial<{
45
+ dependencies: never;
46
+ projects: string | string[];
47
+ }> & Required<Pick<{
48
+ dependencies: never;
7
49
  projects: string | string[];
50
+ }, "projects">> & Partial<{
51
+ target: string;
52
+ params: string;
8
53
  }> & Required<Pick<{
54
+ target: string;
55
+ params: string;
56
+ }, "target">>) | (Partial<{
57
+ dependencies: never;
58
+ projects: string | string[];
59
+ }> & Required<Pick<{
60
+ dependencies: never;
9
61
  projects: string | string[];
10
62
  }, "projects">> & Partial<{
11
63
  target: string;
@@ -13,17 +65,64 @@ declare const projectJsonSchema: import("juniper").ObjectSchema<{
13
65
  }> & Required<Pick<{
14
66
  target: string;
15
67
  params: string;
68
+ }, "target">> & string), [], never, unknown, false>;
69
+ configurations: import("juniper").ObjectSchema<{}, never, boolean, import("juniper").EmptyIndex, (Partial<{
70
+ __lifecycle: import("juniper").EmptyObject;
71
+ }> & Required<Pick<{
72
+ __lifecycle: import("juniper").EmptyObject;
73
+ }, "__lifecycle">>) | (Record<string, unknown> & Partial<{
74
+ __lifecycle: never;
75
+ }>), boolean>;
76
+ }, never, boolean, import("juniper").EmptyIndex, unknown, false>, import("juniper").EmptyIndex, unknown, false>;
77
+ }, never, true, import("juniper").EmptyIndex, unknown, false>;
78
+ export type ProjectJson = SchemaType<typeof projectJsonSchema>;
79
+ export declare const assertProjectJson: (x: unknown) => asserts x is Record<string, unknown> & Partial<{
80
+ targets: Record<string, Partial<{
81
+ executor: string;
82
+ dependsOn: (string | (Partial<{
83
+ dependencies: boolean;
84
+ projects: never;
85
+ }> & Partial<{
86
+ target: string;
87
+ params: string;
88
+ }> & Required<Pick<{
89
+ target: string;
90
+ params: string;
91
+ }, "target">>) | (string & Partial<{
92
+ dependencies: boolean;
93
+ projects: never;
94
+ }> & Partial<{
95
+ target: string;
96
+ params: string;
97
+ }> & Required<Pick<{
98
+ target: string;
99
+ params: string;
16
100
  }, "target">>) | (Partial<{
17
101
  dependencies: boolean;
102
+ projects: never;
18
103
  }> & Partial<{
19
104
  target: string;
20
105
  params: string;
21
106
  }> & Required<Pick<{
22
107
  target: string;
23
108
  params: string;
24
- }, "target">>)) & (string | (Partial<{
109
+ }, "target">> & string) | (Partial<{
110
+ dependencies: never;
111
+ projects: string | string[];
112
+ }> & Required<Pick<{
113
+ dependencies: never;
114
+ projects: string | string[];
115
+ }, "projects">> & Partial<{
116
+ target: string;
117
+ params: string;
118
+ }> & Required<Pick<{
119
+ target: string;
120
+ params: string;
121
+ }, "target">>) | (string & Partial<{
122
+ dependencies: never;
25
123
  projects: string | string[];
26
124
  }> & Required<Pick<{
125
+ dependencies: never;
27
126
  projects: string | string[];
28
127
  }, "projects">> & Partial<{
29
128
  target: string;
@@ -32,29 +131,103 @@ declare const projectJsonSchema: import("juniper").ObjectSchema<{
32
131
  target: string;
33
132
  params: string;
34
133
  }, "target">>) | (Partial<{
134
+ dependencies: never;
135
+ projects: string | string[];
136
+ }> & Required<Pick<{
137
+ dependencies: never;
138
+ projects: string | string[];
139
+ }, "projects">> & Partial<{
140
+ target: string;
141
+ params: string;
142
+ }> & Required<Pick<{
143
+ target: string;
144
+ params: string;
145
+ }, "target">> & string))[];
146
+ configurations: (Partial<{
147
+ __lifecycle: import("juniper").EmptyObject;
148
+ }> & Required<Pick<{
149
+ __lifecycle: import("juniper").EmptyObject;
150
+ }, "__lifecycle">>) | (Record<string, unknown> & Partial<{
151
+ __lifecycle: never;
152
+ }>);
153
+ }>>;
154
+ }>;
155
+ export type AssertProjectJson = typeof assertProjectJson;
156
+ export declare const assertProjectJsonIdentifier: import("haywire").HaywireId<(x: unknown) => asserts x is Record<string, unknown> & Partial<{
157
+ targets: Record<string, Partial<{
158
+ executor: string;
159
+ dependsOn: (string | (Partial<{
35
160
  dependencies: boolean;
161
+ projects: never;
36
162
  }> & Partial<{
37
163
  target: string;
38
164
  params: string;
39
165
  }> & Required<Pick<{
40
166
  target: string;
41
167
  params: string;
42
- }, "target">>) | undefined), [], never, unknown, false>;
43
- configurations: import("juniper").ObjectSchema<{}, never, boolean, import("juniper").EmptyIndex, (Record<string, unknown> & Partial<{
44
- __lifecycle: never;
45
- }>) | (Partial<{
168
+ }, "target">>) | (string & Partial<{
169
+ dependencies: boolean;
170
+ projects: never;
171
+ }> & Partial<{
172
+ target: string;
173
+ params: string;
174
+ }> & Required<Pick<{
175
+ target: string;
176
+ params: string;
177
+ }, "target">>) | (Partial<{
178
+ dependencies: boolean;
179
+ projects: never;
180
+ }> & Partial<{
181
+ target: string;
182
+ params: string;
183
+ }> & Required<Pick<{
184
+ target: string;
185
+ params: string;
186
+ }, "target">> & string) | (Partial<{
187
+ dependencies: never;
188
+ projects: string | string[];
189
+ }> & Required<Pick<{
190
+ dependencies: never;
191
+ projects: string | string[];
192
+ }, "projects">> & Partial<{
193
+ target: string;
194
+ params: string;
195
+ }> & Required<Pick<{
196
+ target: string;
197
+ params: string;
198
+ }, "target">>) | (string & Partial<{
199
+ dependencies: never;
200
+ projects: string | string[];
201
+ }> & Required<Pick<{
202
+ dependencies: never;
203
+ projects: string | string[];
204
+ }, "projects">> & Partial<{
205
+ target: string;
206
+ params: string;
207
+ }> & Required<Pick<{
208
+ target: string;
209
+ params: string;
210
+ }, "target">>) | (Partial<{
211
+ dependencies: never;
212
+ projects: string | string[];
213
+ }> & Required<Pick<{
214
+ dependencies: never;
215
+ projects: string | string[];
216
+ }, "projects">> & Partial<{
217
+ target: string;
218
+ params: string;
219
+ }> & Required<Pick<{
220
+ target: string;
221
+ params: string;
222
+ }, "target">> & string))[];
223
+ configurations: (Partial<{
46
224
  __lifecycle: import("juniper").EmptyObject;
47
225
  }> & Required<Pick<{
48
226
  __lifecycle: import("juniper").EmptyObject;
49
- }, "__lifecycle">>), boolean>;
50
- }, never, boolean, import("juniper").EmptyIndex, unknown, false>, import("juniper").EmptyIndex, unknown, false>;
51
- }, never, true, import("juniper").EmptyIndex, unknown, false>;
52
- export type ProjectJson = SchemaType<typeof projectJsonSchema>;
53
- export interface IsProjectJson {
54
- (val: unknown): val is ProjectJson;
55
- errors?: ErrorObject[] | null;
56
- }
57
- export declare const isProjectJson: IsProjectJson;
58
- export declare const isProjectJsonIdentifier: import("haywire").HaywireId<IsProjectJson, null, "projectJson", false, false, false, false>;
227
+ }, "__lifecycle">>) | (Record<string, unknown> & Partial<{
228
+ __lifecycle: never;
229
+ }>);
230
+ }>>;
231
+ }>, null, "projectJson", false, false, false, false, false>;
59
232
  export {};
60
233
  //# sourceMappingURL=project-json.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { identifier } from 'haywire';
2
2
  import { objectSchema } from 'juniper';
3
- import { ajv } from './lib/ajv.js';
3
+ import { makeValidator } from 'juniper-validator';
4
4
  import { allTargetsSchema } from './target.js';
5
5
  const projectJsonSchema = objectSchema({
6
6
  properties: {
@@ -8,7 +8,7 @@ const projectJsonSchema = objectSchema({
8
8
  },
9
9
  additionalProperties: true
10
10
  });
11
- export const isProjectJson = ajv.compile(projectJsonSchema.toJSON());
12
- export const isProjectJsonIdentifier = identifier().named('projectJson');
11
+ export const assertProjectJson = makeValidator(projectJsonSchema).assert;
12
+ export const assertProjectJsonIdentifier = identifier().named('projectJson');
13
13
 
14
14
  //# sourceMappingURL=project-json.js.map