nx-lifecycle 0.2.1 → 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 +30 -21
  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 -9
@@ -0,0 +1,353 @@
1
+ import type { SchemaType } from 'juniper';
2
+ declare const lifecyclePluginOptionsSchema: import("juniper").ObjectSchema<{
3
+ stages: import("juniper").ObjectSchema<{}, never, import("juniper").ObjectSchema<{
4
+ dependsOn: import("juniper").ArraySchema<string | (Partial<{
5
+ dependencies: boolean;
6
+ projects: never;
7
+ }> & Partial<{
8
+ target: string;
9
+ params: string;
10
+ }> & Required<Pick<{
11
+ target: string;
12
+ params: string;
13
+ }, "target">>) | (string & Partial<{
14
+ dependencies: boolean;
15
+ projects: never;
16
+ }> & Partial<{
17
+ target: string;
18
+ params: string;
19
+ }> & Required<Pick<{
20
+ target: string;
21
+ params: string;
22
+ }, "target">>) | (Partial<{
23
+ dependencies: boolean;
24
+ projects: never;
25
+ }> & Partial<{
26
+ target: string;
27
+ params: string;
28
+ }> & Required<Pick<{
29
+ target: string;
30
+ params: string;
31
+ }, "target">> & string) | (Partial<{
32
+ dependencies: never;
33
+ projects: string | string[];
34
+ }> & Required<Pick<{
35
+ dependencies: never;
36
+ projects: string | string[];
37
+ }, "projects">> & Partial<{
38
+ target: string;
39
+ params: string;
40
+ }> & Required<Pick<{
41
+ target: string;
42
+ params: string;
43
+ }, "target">>) | (string & Partial<{
44
+ dependencies: never;
45
+ projects: string | string[];
46
+ }> & Required<Pick<{
47
+ dependencies: never;
48
+ projects: string | string[];
49
+ }, "projects">> & Partial<{
50
+ target: string;
51
+ params: string;
52
+ }> & Required<Pick<{
53
+ target: string;
54
+ params: string;
55
+ }, "target">>) | (Partial<{
56
+ dependencies: never;
57
+ projects: string | string[];
58
+ }> & Required<Pick<{
59
+ dependencies: never;
60
+ projects: string | string[];
61
+ }, "projects">> & Partial<{
62
+ target: string;
63
+ params: string;
64
+ }> & Required<Pick<{
65
+ target: string;
66
+ params: string;
67
+ }, "target">> & string), [], never, unknown, false>;
68
+ hooks: import("juniper").ArraySchema<string, [], never, unknown, false>;
69
+ }, never, boolean, import("juniper").EmptyIndex, unknown, false>, import("juniper").EmptyIndex, unknown, false>;
70
+ bindings: import("juniper").ObjectSchema<{}, never, import("juniper").StringSchema<string, false>, import("juniper").EmptyIndex, unknown, false>;
71
+ }, "bindings" | "stages", false, import("juniper").EmptyIndex, unknown, false>;
72
+ export type LifecyclePluginOptions = SchemaType<typeof lifecyclePluginOptionsSchema>;
73
+ export declare const assertLifecyclePluginOptions: (x: unknown) => asserts x is Partial<{
74
+ stages: Record<string, Partial<{
75
+ dependsOn: (string | (Partial<{
76
+ dependencies: boolean;
77
+ projects: never;
78
+ }> & Partial<{
79
+ target: string;
80
+ params: string;
81
+ }> & Required<Pick<{
82
+ target: string;
83
+ params: string;
84
+ }, "target">>) | (string & Partial<{
85
+ dependencies: boolean;
86
+ projects: never;
87
+ }> & Partial<{
88
+ target: string;
89
+ params: string;
90
+ }> & Required<Pick<{
91
+ target: string;
92
+ params: string;
93
+ }, "target">>) | (Partial<{
94
+ dependencies: boolean;
95
+ projects: never;
96
+ }> & Partial<{
97
+ target: string;
98
+ params: string;
99
+ }> & Required<Pick<{
100
+ target: string;
101
+ params: string;
102
+ }, "target">> & string) | (Partial<{
103
+ dependencies: never;
104
+ projects: string | string[];
105
+ }> & Required<Pick<{
106
+ dependencies: never;
107
+ projects: string | string[];
108
+ }, "projects">> & Partial<{
109
+ target: string;
110
+ params: string;
111
+ }> & Required<Pick<{
112
+ target: string;
113
+ params: string;
114
+ }, "target">>) | (string & Partial<{
115
+ dependencies: never;
116
+ projects: string | string[];
117
+ }> & Required<Pick<{
118
+ dependencies: never;
119
+ projects: string | string[];
120
+ }, "projects">> & Partial<{
121
+ target: string;
122
+ params: string;
123
+ }> & Required<Pick<{
124
+ target: string;
125
+ params: string;
126
+ }, "target">>) | (Partial<{
127
+ dependencies: never;
128
+ projects: string | string[];
129
+ }> & Required<Pick<{
130
+ dependencies: never;
131
+ projects: string | string[];
132
+ }, "projects">> & Partial<{
133
+ target: string;
134
+ params: string;
135
+ }> & Required<Pick<{
136
+ target: string;
137
+ params: string;
138
+ }, "target">> & string))[];
139
+ hooks: string[];
140
+ }>>;
141
+ bindings: Record<string, string>;
142
+ }> & Required<Pick<{
143
+ stages: Record<string, Partial<{
144
+ dependsOn: (string | (Partial<{
145
+ dependencies: boolean;
146
+ projects: never;
147
+ }> & Partial<{
148
+ target: string;
149
+ params: string;
150
+ }> & Required<Pick<{
151
+ target: string;
152
+ params: string;
153
+ }, "target">>) | (string & Partial<{
154
+ dependencies: boolean;
155
+ projects: never;
156
+ }> & Partial<{
157
+ target: string;
158
+ params: string;
159
+ }> & Required<Pick<{
160
+ target: string;
161
+ params: string;
162
+ }, "target">>) | (Partial<{
163
+ dependencies: boolean;
164
+ projects: never;
165
+ }> & Partial<{
166
+ target: string;
167
+ params: string;
168
+ }> & Required<Pick<{
169
+ target: string;
170
+ params: string;
171
+ }, "target">> & string) | (Partial<{
172
+ dependencies: never;
173
+ projects: string | string[];
174
+ }> & Required<Pick<{
175
+ dependencies: never;
176
+ projects: string | string[];
177
+ }, "projects">> & Partial<{
178
+ target: string;
179
+ params: string;
180
+ }> & Required<Pick<{
181
+ target: string;
182
+ params: string;
183
+ }, "target">>) | (string & Partial<{
184
+ dependencies: never;
185
+ projects: string | string[];
186
+ }> & Required<Pick<{
187
+ dependencies: never;
188
+ projects: string | string[];
189
+ }, "projects">> & Partial<{
190
+ target: string;
191
+ params: string;
192
+ }> & Required<Pick<{
193
+ target: string;
194
+ params: string;
195
+ }, "target">>) | (Partial<{
196
+ dependencies: never;
197
+ projects: string | string[];
198
+ }> & Required<Pick<{
199
+ dependencies: never;
200
+ projects: string | string[];
201
+ }, "projects">> & Partial<{
202
+ target: string;
203
+ params: string;
204
+ }> & Required<Pick<{
205
+ target: string;
206
+ params: string;
207
+ }, "target">> & string))[];
208
+ hooks: string[];
209
+ }>>;
210
+ bindings: Record<string, string>;
211
+ }, "bindings" | "stages">>;
212
+ export type AssertLifecyclePluginOptions = typeof assertLifecyclePluginOptions;
213
+ export declare const assertLifecyclePluginOptionsId: import("haywire").HaywireId<(x: unknown) => asserts x is Partial<{
214
+ stages: Record<string, Partial<{
215
+ dependsOn: (string | (Partial<{
216
+ dependencies: boolean;
217
+ projects: never;
218
+ }> & Partial<{
219
+ target: string;
220
+ params: string;
221
+ }> & Required<Pick<{
222
+ target: string;
223
+ params: string;
224
+ }, "target">>) | (string & Partial<{
225
+ dependencies: boolean;
226
+ projects: never;
227
+ }> & Partial<{
228
+ target: string;
229
+ params: string;
230
+ }> & Required<Pick<{
231
+ target: string;
232
+ params: string;
233
+ }, "target">>) | (Partial<{
234
+ dependencies: boolean;
235
+ projects: never;
236
+ }> & Partial<{
237
+ target: string;
238
+ params: string;
239
+ }> & Required<Pick<{
240
+ target: string;
241
+ params: string;
242
+ }, "target">> & string) | (Partial<{
243
+ dependencies: never;
244
+ projects: string | string[];
245
+ }> & Required<Pick<{
246
+ dependencies: never;
247
+ projects: string | string[];
248
+ }, "projects">> & Partial<{
249
+ target: string;
250
+ params: string;
251
+ }> & Required<Pick<{
252
+ target: string;
253
+ params: string;
254
+ }, "target">>) | (string & Partial<{
255
+ dependencies: never;
256
+ projects: string | string[];
257
+ }> & Required<Pick<{
258
+ dependencies: never;
259
+ projects: string | string[];
260
+ }, "projects">> & Partial<{
261
+ target: string;
262
+ params: string;
263
+ }> & Required<Pick<{
264
+ target: string;
265
+ params: string;
266
+ }, "target">>) | (Partial<{
267
+ dependencies: never;
268
+ projects: string | string[];
269
+ }> & Required<Pick<{
270
+ dependencies: never;
271
+ projects: string | string[];
272
+ }, "projects">> & Partial<{
273
+ target: string;
274
+ params: string;
275
+ }> & Required<Pick<{
276
+ target: string;
277
+ params: string;
278
+ }, "target">> & string))[];
279
+ hooks: string[];
280
+ }>>;
281
+ bindings: Record<string, string>;
282
+ }> & Required<Pick<{
283
+ stages: Record<string, Partial<{
284
+ dependsOn: (string | (Partial<{
285
+ dependencies: boolean;
286
+ projects: never;
287
+ }> & Partial<{
288
+ target: string;
289
+ params: string;
290
+ }> & Required<Pick<{
291
+ target: string;
292
+ params: string;
293
+ }, "target">>) | (string & Partial<{
294
+ dependencies: boolean;
295
+ projects: never;
296
+ }> & Partial<{
297
+ target: string;
298
+ params: string;
299
+ }> & Required<Pick<{
300
+ target: string;
301
+ params: string;
302
+ }, "target">>) | (Partial<{
303
+ dependencies: boolean;
304
+ projects: never;
305
+ }> & Partial<{
306
+ target: string;
307
+ params: string;
308
+ }> & Required<Pick<{
309
+ target: string;
310
+ params: string;
311
+ }, "target">> & string) | (Partial<{
312
+ dependencies: never;
313
+ projects: string | string[];
314
+ }> & Required<Pick<{
315
+ dependencies: never;
316
+ projects: string | string[];
317
+ }, "projects">> & Partial<{
318
+ target: string;
319
+ params: string;
320
+ }> & Required<Pick<{
321
+ target: string;
322
+ params: string;
323
+ }, "target">>) | (string & Partial<{
324
+ dependencies: never;
325
+ projects: string | string[];
326
+ }> & Required<Pick<{
327
+ dependencies: never;
328
+ projects: string | string[];
329
+ }, "projects">> & Partial<{
330
+ target: string;
331
+ params: string;
332
+ }> & Required<Pick<{
333
+ target: string;
334
+ params: string;
335
+ }, "target">>) | (Partial<{
336
+ dependencies: never;
337
+ projects: string | string[];
338
+ }> & Required<Pick<{
339
+ dependencies: never;
340
+ projects: string | string[];
341
+ }, "projects">> & Partial<{
342
+ target: string;
343
+ params: string;
344
+ }> & Required<Pick<{
345
+ target: string;
346
+ params: string;
347
+ }, "target">> & string))[];
348
+ hooks: string[];
349
+ }>>;
350
+ bindings: Record<string, string>;
351
+ }, "bindings" | "stages">>, null, null, false, false, false, false, false>;
352
+ export {};
353
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1,21 @@
1
+ import { identifier } from 'haywire';
2
+ import { objectSchema } from 'juniper';
3
+ import { makeValidator } from 'juniper-validator';
4
+ import { bindingsSchema, stagesSchema } from '../lifecycle/schema.js';
5
+ const lifecyclePluginOptionsSchema = objectSchema({
6
+ title: 'nx-lifecycle plugin',
7
+ description: 'Infer Nx targets as high level workflows',
8
+ properties: {
9
+ stages: stagesSchema,
10
+ bindings: bindingsSchema
11
+ },
12
+ required: [
13
+ 'stages',
14
+ 'bindings'
15
+ ],
16
+ additionalProperties: false
17
+ });
18
+ export const assertLifecyclePluginOptions = makeValidator(lifecyclePluginOptionsSchema).assert;
19
+ export const assertLifecyclePluginOptionsId = identifier();
20
+
21
+ //# sourceMappingURL=schema.js.map
@@ -1,10 +1,10 @@
1
- import { type SchemaType } from 'juniper';
2
- export declare const configurationsSchema: import("juniper").ObjectSchema<{}, never, boolean, import("juniper").EmptyIndex, (Record<string, unknown> & Partial<{
3
- __lifecycle: never;
4
- }>) | (Partial<{
1
+ import type { SchemaType } from 'juniper';
2
+ export declare const configurationsSchema: import("juniper").ObjectSchema<{}, never, boolean, import("juniper").EmptyIndex, (Partial<{
5
3
  __lifecycle: import("juniper").EmptyObject;
6
4
  }> & Required<Pick<{
7
5
  __lifecycle: import("juniper").EmptyObject;
8
- }, "__lifecycle">>), boolean>;
6
+ }, "__lifecycle">>) | (Record<string, unknown> & Partial<{
7
+ __lifecycle: never;
8
+ }>), boolean>;
9
9
  export type Configurations = SchemaType<typeof configurationsSchema>;
10
10
  //# sourceMappingURL=configurations.d.ts.map
@@ -1,20 +1,31 @@
1
- import { type SchemaType } from 'juniper';
1
+ import type { SchemaType } from 'juniper';
2
2
  declare const dependencyObject: import("juniper").ObjectSchema<{
3
3
  target: import("juniper").StringSchema<string, false>;
4
4
  params: import("juniper").EnumSchema<string>;
5
5
  }, "target", boolean, import("juniper").EmptyIndex, Partial<{
6
6
  dependencies: boolean;
7
+ projects: never;
7
8
  }> | (Partial<{
9
+ dependencies: never;
8
10
  projects: string | string[];
9
11
  }> & Required<Pick<{
12
+ dependencies: never;
10
13
  projects: string | string[];
11
14
  }, "projects">>), boolean>;
12
15
  export type DependencyObject = SchemaType<typeof dependencyObject>;
13
- export declare const dependsOnSchema: import("juniper").ArraySchema<(string | (Partial<{
14
- projects: string | string[];
16
+ export declare const dependsOnSchema: import("juniper").ArraySchema<string | (Partial<{
17
+ dependencies: boolean;
18
+ projects: never;
19
+ }> & Partial<{
20
+ target: string;
21
+ params: string;
15
22
  }> & Required<Pick<{
16
- projects: string | string[];
17
- }, "projects">> & Partial<{
23
+ target: string;
24
+ params: string;
25
+ }, "target">>) | (string & Partial<{
26
+ dependencies: boolean;
27
+ projects: never;
28
+ }> & Partial<{
18
29
  target: string;
19
30
  params: string;
20
31
  }> & Required<Pick<{
@@ -22,15 +33,30 @@ export declare const dependsOnSchema: import("juniper").ArraySchema<(string | (P
22
33
  params: string;
23
34
  }, "target">>) | (Partial<{
24
35
  dependencies: boolean;
36
+ projects: never;
25
37
  }> & Partial<{
26
38
  target: string;
27
39
  params: string;
28
40
  }> & Required<Pick<{
29
41
  target: string;
30
42
  params: string;
31
- }, "target">>)) & (string | (Partial<{
43
+ }, "target">> & string) | (Partial<{
44
+ dependencies: never;
45
+ projects: string | string[];
46
+ }> & Required<Pick<{
47
+ dependencies: never;
48
+ projects: string | string[];
49
+ }, "projects">> & Partial<{
50
+ target: string;
51
+ params: string;
52
+ }> & Required<Pick<{
53
+ target: string;
54
+ params: string;
55
+ }, "target">>) | (string & Partial<{
56
+ dependencies: never;
32
57
  projects: string | string[];
33
58
  }> & Required<Pick<{
59
+ dependencies: never;
34
60
  projects: string | string[];
35
61
  }, "projects">> & Partial<{
36
62
  target: string;
@@ -39,14 +65,18 @@ export declare const dependsOnSchema: import("juniper").ArraySchema<(string | (P
39
65
  target: string;
40
66
  params: string;
41
67
  }, "target">>) | (Partial<{
42
- dependencies: boolean;
43
- }> & Partial<{
68
+ dependencies: never;
69
+ projects: string | string[];
70
+ }> & Required<Pick<{
71
+ dependencies: never;
72
+ projects: string | string[];
73
+ }, "projects">> & Partial<{
44
74
  target: string;
45
75
  params: string;
46
76
  }> & Required<Pick<{
47
77
  target: string;
48
78
  params: string;
49
- }, "target">>) | undefined), [], never, unknown, false>;
79
+ }, "target">> & string), [], never, unknown, false>;
50
80
  export type DependsOn = SchemaType<typeof dependsOnSchema>;
51
81
  export {};
52
82
  //# sourceMappingURL=depend-on.d.ts.map
@@ -1,4 +1,4 @@
1
- import { arraySchema, booleanSchema, enumSchema, mergeSchema, objectSchema, stringSchema } from 'juniper';
1
+ import { arraySchema, booleanSchema, enumSchema, mergeSchema, neverSchema, objectSchema, stringSchema } from 'juniper';
2
2
  const dependencyObject = objectSchema({
3
3
  properties: {
4
4
  target: stringSchema(),
@@ -15,11 +15,13 @@ const dependencyObject = objectSchema({
15
15
  }).oneOf([
16
16
  objectSchema({
17
17
  properties: {
18
- dependencies: booleanSchema()
18
+ dependencies: booleanSchema(),
19
+ projects: neverSchema()
19
20
  }
20
21
  }),
21
22
  objectSchema({
22
23
  properties: {
24
+ dependencies: neverSchema(),
23
25
  projects: mergeSchema().oneOf([
24
26
  arraySchema(stringSchema()),
25
27
  stringSchema()
@@ -1,6 +1,6 @@
1
- import { type SchemaType } from 'juniper';
1
+ import type { SchemaType } from 'juniper';
2
2
  declare const emptySchema: import("juniper").ObjectSchema<{}, never, false, import("juniper").EmptyIndex, unknown, false>;
3
3
  export type Empty = SchemaType<typeof emptySchema>;
4
- export declare const isEmpty: import("ajv").ValidateFunction<import("juniper").EmptyObject>;
4
+ export declare const isEmpty: (x: unknown) => x is import("juniper").EmptyObject;
5
5
  export {};
6
6
  //# sourceMappingURL=empty.d.ts.map
@@ -1,8 +1,8 @@
1
1
  import { objectSchema } from 'juniper';
2
- import { ajv } from './lib/ajv.js';
2
+ import { makeValidator } from 'juniper-validator';
3
3
  const emptySchema = objectSchema({
4
4
  additionalProperties: false
5
5
  });
6
- export const isEmpty = ajv.compile(emptySchema.toJSON());
6
+ export const isEmpty = makeValidator(emptySchema).is;
7
7
 
8
8
  //# sourceMappingURL=empty.js.map