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.
- package/.npmignore +20 -0
- package/README.md +203 -119
- package/WHY-NX-LIFECYCLE.md +64 -0
- package/dist/bin.d.ts +603 -0
- package/dist/bin.js +3 -2
- package/dist/cli.d.ts +1 -1
- package/dist/commands/index.d.ts +752 -2
- package/dist/commands/lib/dependencies.d.ts +7 -7
- package/dist/commands/lib/dependencies.js +1 -1
- package/dist/commands/lifecycle-command.d.ts +1 -1
- package/dist/executors/lifecycle/container.d.ts +603 -0
- package/dist/executors/lifecycle/container.js +8 -0
- package/dist/executors/lifecycle/index.js +2 -6
- package/dist/lifecycle/dependencies.d.ts +16 -0
- package/dist/lifecycle/{depedencies.js → dependencies.js} +1 -1
- package/dist/lifecycle/index.d.ts +754 -3
- package/dist/lifecycle/index.js +5 -5
- package/dist/lifecycle/lifecycle-internal.d.ts +3 -3
- package/dist/lifecycle/lifecycle-internal.js +26 -9
- package/dist/lifecycle/normalizer.d.ts +1 -1
- package/dist/lifecycle/processor.d.ts +41 -3
- package/dist/lifecycle/processor.js +36 -33
- package/dist/lifecycle/schema.d.ts +468 -66
- package/dist/lifecycle/schema.js +30 -21
- package/dist/plugin/container.d.ts +855 -0
- package/dist/plugin/container.js +13 -0
- package/dist/plugin/dependencies.d.ts +860 -0
- package/dist/plugin/dependencies.js +9 -0
- package/dist/plugin/index.d.ts +283 -0
- package/dist/plugin/index.js +6 -0
- package/dist/plugin/lifecycle-plugin.d.ts +21 -0
- package/dist/plugin/lifecycle-plugin.js +158 -0
- package/dist/plugin/schema.d.ts +353 -0
- package/dist/plugin/schema.js +21 -0
- package/dist/schemas/configurations.d.ts +5 -5
- package/dist/schemas/depend-on.d.ts +39 -9
- package/dist/schemas/depend-on.js +4 -2
- package/dist/schemas/empty.d.ts +2 -2
- package/dist/schemas/empty.js +2 -2
- package/dist/schemas/nx-json.d.ts +191 -18
- package/dist/schemas/nx-json.js +3 -3
- package/dist/schemas/project-json.d.ts +191 -18
- package/dist/schemas/project-json.js +3 -3
- package/dist/schemas/target.d.ts +79 -25
- package/executors.json +2 -2
- package/out/nx-executor/schema.json +148 -0
- package/out/schema.json +114 -0
- package/package.json +39 -40
- package/dist/executors/lifecycle/index.cjs +0 -15
- package/dist/executors/lifecycle/index.d.cts +0 -99
- package/dist/lifecycle/depedencies.d.ts +0 -15
- package/dist/schemas/lib/ajv.d.ts +0 -3
- package/dist/schemas/lib/ajv.js +0 -9
package/dist/lifecycle/schema.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { arraySchema, booleanSchema, mergeSchema, objectSchema, stringSchema } from 'juniper';
|
|
2
|
+
import { makeValidator } from 'juniper-validator';
|
|
2
3
|
import { dependsOnSchema } from '#schemas';
|
|
3
|
-
import { ajv } from '../schemas/lib/ajv.js';
|
|
4
4
|
const checkAndDryRunSchema = objectSchema({
|
|
5
5
|
properties: {
|
|
6
6
|
$schema: stringSchema({
|
|
7
|
-
description: '',
|
|
7
|
+
description: 'Path or URL to the JSON schema for this file',
|
|
8
8
|
format: 'uri-reference'
|
|
9
9
|
}).example('https://raw.githubusercontent.com/JacobLey/leyman/refs/heads/main/apps/nx-lifecycle/src/lifecycle/schema.json'),
|
|
10
10
|
check: booleanSchema({
|
|
@@ -15,29 +15,38 @@ const checkAndDryRunSchema = objectSchema({
|
|
|
15
15
|
})
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
description: 'Name of hook in `stage:hook` format'
|
|
34
|
-
})
|
|
18
|
+
export const stagesSchema = objectSchema({
|
|
19
|
+
description: 'Lifecycle stages by name',
|
|
20
|
+
properties: {},
|
|
21
|
+
additionalProperties: objectSchema({
|
|
22
|
+
properties: {
|
|
23
|
+
dependsOn: dependsOnSchema,
|
|
24
|
+
hooks: arraySchema(stringSchema())
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
export const bindingsSchema = objectSchema({
|
|
29
|
+
description: 'Bind targets to hooks',
|
|
30
|
+
properties: {},
|
|
31
|
+
additionalProperties: stringSchema({
|
|
32
|
+
description: 'Name of hook in `stage:hook` format'
|
|
35
33
|
})
|
|
34
|
+
});
|
|
35
|
+
const lifecycleOptionsSchema = checkAndDryRunSchema.title('lifecycle').description('Inject Nx targets as high level workflows').properties({
|
|
36
|
+
stages: stagesSchema,
|
|
37
|
+
bindings: bindingsSchema
|
|
36
38
|
}).required([
|
|
37
39
|
'stages',
|
|
38
40
|
'bindings'
|
|
39
41
|
]).additionalProperties(false);
|
|
40
|
-
export const
|
|
42
|
+
export const lifecycleOptions = lifecycleOptionsSchema.toJSON({
|
|
43
|
+
schema: true
|
|
44
|
+
});
|
|
45
|
+
export const isLifecycleOptions = makeValidator(lifecycleOptions, {
|
|
46
|
+
formats: {
|
|
47
|
+
'uri-reference': true
|
|
48
|
+
}
|
|
49
|
+
}).is;
|
|
41
50
|
const lifecycleOptionsOrConfigSchema = mergeSchema().oneOf([
|
|
42
51
|
lifecycleOptionsSchema,
|
|
43
52
|
checkAndDryRunSchema.properties({
|
|
@@ -45,7 +54,7 @@ const lifecycleOptionsOrConfigSchema = mergeSchema().oneOf([
|
|
|
45
54
|
cwd: stringSchema()
|
|
46
55
|
}).additionalProperties(false)
|
|
47
56
|
]);
|
|
48
|
-
export
|
|
57
|
+
export const lifecycleOptionsOrConfig = lifecycleOptionsOrConfigSchema.metadata({
|
|
49
58
|
version: 1,
|
|
50
59
|
outputCapture: 'direct-nodejs',
|
|
51
60
|
cli: 'nx'
|