@zukhruf/nx 0.8.29 → 0.8.31
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 +825 -9
- package/dist/generators/add-keys.d.ts +7 -0
- package/dist/generators/add-keys.d.ts.map +1 -0
- package/dist/generators/add-keys.js +14 -0
- package/dist/generators/add-keys.js.map +1 -0
- package/dist/generators/add-lines.d.ts +8 -0
- package/dist/generators/add-lines.d.ts.map +1 -0
- package/dist/generators/add-lines.js +21 -0
- package/dist/generators/add-lines.js.map +1 -0
- package/dist/generators/app-directory.d.ts +17 -0
- package/dist/generators/app-directory.d.ts.map +1 -0
- package/dist/generators/app-directory.js +34 -0
- package/dist/generators/app-directory.js.map +1 -0
- package/dist/generators/dokploy/files.d.ts +21 -0
- package/dist/generators/dokploy/files.d.ts.map +1 -0
- package/dist/generators/dokploy/files.js +755 -0
- package/dist/generators/dokploy/files.js.map +1 -0
- package/dist/generators/dokploy/generator.d.ts +75 -0
- package/dist/generators/dokploy/generator.d.ts.map +1 -0
- package/dist/generators/dokploy/generator.js +139 -0
- package/dist/generators/dokploy/generator.js.map +1 -0
- package/dist/generators/dokploy/providers.d.ts +15 -0
- package/dist/generators/dokploy/providers.d.ts.map +1 -0
- package/dist/generators/dokploy/providers.js +114 -0
- package/dist/generators/dokploy/providers.js.map +1 -0
- package/dist/generators/init/files.d.ts +81 -0
- package/dist/generators/init/files.d.ts.map +1 -0
- package/dist/generators/init/files.js +278 -0
- package/dist/generators/init/files.js.map +1 -0
- package/dist/generators/init/generator.d.ts +8 -0
- package/dist/generators/init/generator.d.ts.map +1 -0
- package/dist/generators/init/generator.js +72 -0
- package/dist/generators/init/generator.js.map +1 -0
- package/dist/generators/init/nx-json.d.ts +20 -0
- package/dist/generators/init/nx-json.d.ts.map +1 -0
- package/dist/generators/init/nx-json.js +126 -0
- package/dist/generators/init/nx-json.js.map +1 -0
- package/dist/generators/init/root-package-json.d.ts +25 -0
- package/dist/generators/init/root-package-json.d.ts.map +1 -0
- package/dist/generators/init/root-package-json.js +49 -0
- package/dist/generators/init/root-package-json.js.map +1 -0
- package/dist/generators/node-app/files.d.ts +43 -0
- package/dist/generators/node-app/files.d.ts.map +1 -0
- package/dist/generators/node-app/files.js +522 -0
- package/dist/generators/node-app/files.js.map +1 -0
- package/dist/generators/node-app/generator.d.ts +17 -0
- package/dist/generators/node-app/generator.d.ts.map +1 -0
- package/dist/generators/node-app/generator.js +319 -0
- package/dist/generators/node-app/generator.js.map +1 -0
- package/dist/generators/nx-plugin.d.ts +16 -0
- package/dist/generators/nx-plugin.d.ts.map +1 -0
- package/dist/generators/nx-plugin.js +27 -0
- package/dist/generators/nx-plugin.js.map +1 -0
- package/dist/generators/pair/files.d.ts +4 -0
- package/dist/generators/pair/files.d.ts.map +1 -0
- package/dist/generators/pair/files.js +73 -0
- package/dist/generators/pair/files.js.map +1 -0
- package/dist/generators/pair/generator.d.ts +19 -0
- package/dist/generators/pair/generator.d.ts.map +1 -0
- package/dist/generators/pair/generator.js +70 -0
- package/dist/generators/pair/generator.js.map +1 -0
- package/dist/generators/preset/generator.d.ts +14 -0
- package/dist/generators/preset/generator.d.ts.map +1 -0
- package/dist/generators/preset/generator.js +43 -0
- package/dist/generators/preset/generator.js.map +1 -0
- package/dist/generators/prisma/files.d.ts +20 -0
- package/dist/generators/prisma/files.d.ts.map +1 -0
- package/dist/generators/prisma/files.js +183 -0
- package/dist/generators/prisma/files.js.map +1 -0
- package/dist/generators/prisma/generator.d.ts +17 -0
- package/dist/generators/prisma/generator.d.ts.map +1 -0
- package/dist/generators/prisma/generator.js +258 -0
- package/dist/generators/prisma/generator.js.map +1 -0
- package/dist/generators/react-app/files.d.ts +7 -0
- package/dist/generators/react-app/files.d.ts.map +1 -0
- package/dist/generators/react-app/files.js +188 -0
- package/dist/generators/react-app/files.js.map +1 -0
- package/dist/generators/react-app/generator.d.ts +12 -0
- package/dist/generators/react-app/generator.d.ts.map +1 -0
- package/dist/generators/react-app/generator.js +242 -0
- package/dist/generators/react-app/generator.js.map +1 -0
- package/dist/generators/react.d.ts +29 -0
- package/dist/generators/react.d.ts.map +1 -0
- package/dist/generators/react.js +64 -0
- package/dist/generators/react.js.map +1 -0
- package/dist/generators/root-dependencies.d.ts +21 -0
- package/dist/generators/root-dependencies.d.ts.map +1 -0
- package/dist/generators/root-dependencies.js +56 -0
- package/dist/generators/root-dependencies.js.map +1 -0
- package/dist/generators/ui-package/files.d.ts +37 -0
- package/dist/generators/ui-package/files.d.ts.map +1 -0
- package/dist/generators/ui-package/files.js +118 -0
- package/dist/generators/ui-package/files.js.map +1 -0
- package/dist/generators/ui-package/generator.d.ts +14 -0
- package/dist/generators/ui-package/generator.d.ts.map +1 -0
- package/dist/generators/ui-package/generator.js +111 -0
- package/dist/generators/ui-package/generator.js.map +1 -0
- package/dist/generators/versions.d.ts +72 -0
- package/dist/generators/versions.d.ts.map +1 -0
- package/dist/generators/versions.js +110 -0
- package/dist/generators/versions.js.map +1 -0
- package/dist/generators/workspace-scope.d.ts +8 -0
- package/dist/generators/workspace-scope.d.ts.map +1 -0
- package/dist/generators/workspace-scope.js +15 -0
- package/dist/generators/workspace-scope.js.map +1 -0
- package/dist/opentofu/check-plan-fresh.d.ts +2 -0
- package/dist/opentofu/check-plan-fresh.d.ts.map +1 -0
- package/dist/opentofu/check-plan-fresh.js +47 -0
- package/dist/opentofu/check-plan-fresh.js.map +1 -0
- package/dist/opentofu/plugin.d.ts +9 -0
- package/dist/opentofu/plugin.d.ts.map +1 -0
- package/dist/opentofu/plugin.js +108 -0
- package/dist/opentofu/plugin.js.map +1 -0
- package/dist/prisma/plugin.d.ts +9 -0
- package/dist/prisma/plugin.d.ts.map +1 -0
- package/dist/prisma/plugin.js +83 -0
- package/dist/prisma/plugin.js.map +1 -0
- package/dist/project-roots.d.ts +5 -0
- package/dist/project-roots.d.ts.map +1 -1
- package/dist/project-roots.js +10 -0
- package/dist/project-roots.js.map +1 -1
- package/dist/test/plugin.js +1 -7
- package/dist/test/plugin.js.map +1 -1
- package/generators.json +44 -0
- package/package.json +44 -5
- package/src/generators/dokploy/schema.json +48 -0
- package/src/generators/init/schema.json +8 -0
- package/src/generators/node-app/schema.json +22 -0
- package/src/generators/pair/schema.json +18 -0
- package/src/generators/preset/schema.json +18 -0
- package/src/generators/prisma/schema.json +21 -0
- package/src/generators/react-app/schema.json +17 -0
- package/src/generators/ui-package/schema.json +22 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { basename, dirname, extname, join, relative } from 'node:path';
|
|
2
|
+
import { createNodesFromFiles, } from '@nx/devkit';
|
|
3
|
+
import { nearestRoot, projectRootFiles } from "../project-roots.js";
|
|
4
|
+
const environmentFile = /^src\/environments\/([^/]+)\/[^/]+\.tf$/;
|
|
5
|
+
// The freshness check ships beside this file: `.ts` in the source that
|
|
6
|
+
// zukhruf runs, `.js` in the build that npm installs.
|
|
7
|
+
const checkPlanFresh = join(import.meta.dirname, `check-plan-fresh${extname(import.meta.filename)}`);
|
|
8
|
+
// The state and the saved plans are encrypted with `tf_encryption_passphrase`
|
|
9
|
+
// in each of the 5 copies; the other secrets differ by project, and OpenTofu
|
|
10
|
+
// reports a missing variable itself.
|
|
11
|
+
const passphrase = ': "${TF_ENCRYPTION_PASSPHRASE:?TF_ENCRYPTION_PASSPHRASE missing: set it in the environment or in the .env file of the project}" && TF_VAR_tf_encryption_passphrase="$TF_ENCRYPTION_PASSPHRASE"';
|
|
12
|
+
/**
|
|
13
|
+
* Gives the OpenTofu targets to each project root with environments: folders
|
|
14
|
+
* `src/environments/<name>` with `*.tf` files. The checks need no secret; the
|
|
15
|
+
* targets that read the encrypted state guard the passphrase. No `apply`: CI
|
|
16
|
+
* applies.
|
|
17
|
+
*/
|
|
18
|
+
export const createNodes = [
|
|
19
|
+
'{package.json,**/package.json,project.json,**/project.json,**/src/environments/*/*.tf}',
|
|
20
|
+
(files, options, context) => {
|
|
21
|
+
const rootFiles = projectRootFiles(files.filter((file) => ['package.json', 'project.json'].includes(basename(file))), context.workspaceRoot);
|
|
22
|
+
const roots = new Set(rootFiles.map((file) => dirname(file)));
|
|
23
|
+
const environments = new Map();
|
|
24
|
+
for (const file of files.filter((file) => file.endsWith('.tf'))) {
|
|
25
|
+
const root = nearestRoot(roots, dirname(file));
|
|
26
|
+
const name = root === undefined
|
|
27
|
+
? undefined
|
|
28
|
+
: environmentFile.exec(relative(root, file))?.[1];
|
|
29
|
+
if (root !== undefined && name !== undefined) {
|
|
30
|
+
environments.set(root, (environments.get(root) ?? new Set()).add(name));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return createNodesFromFiles((file) => {
|
|
34
|
+
const root = dirname(file);
|
|
35
|
+
const [first, ...rest] = [...(environments.get(root) ?? [])].toSorted();
|
|
36
|
+
return first === undefined
|
|
37
|
+
? {}
|
|
38
|
+
: {
|
|
39
|
+
projects: {
|
|
40
|
+
[root]: {
|
|
41
|
+
targets: targets(root, [first, ...rest], context.workspaceRoot),
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
}, rootFiles, options, context);
|
|
46
|
+
},
|
|
47
|
+
];
|
|
48
|
+
function targets(root, environments, workspaceRoot) {
|
|
49
|
+
const inputs = [
|
|
50
|
+
'{projectRoot}/src/**/*.tf',
|
|
51
|
+
'{projectRoot}/src/**/*.hcl',
|
|
52
|
+
{ runtime: 'tofu version' },
|
|
53
|
+
];
|
|
54
|
+
// `-c <name>` selects an environment; with none, the options select
|
|
55
|
+
// production, else the first environment by name.
|
|
56
|
+
const fallback = environments.includes('production')
|
|
57
|
+
? 'production'
|
|
58
|
+
: environments[0];
|
|
59
|
+
const inEnvironment = (command, dependsOn = []) => ({
|
|
60
|
+
executor: 'nx:run-commands',
|
|
61
|
+
options: { command, cwd: `{projectRoot}/src/environments/${fallback}` },
|
|
62
|
+
configurations: Object.fromEntries(environments.map((name) => [
|
|
63
|
+
name,
|
|
64
|
+
{ cwd: `{projectRoot}/src/environments/${name}` },
|
|
65
|
+
])),
|
|
66
|
+
...(dependsOn.length > 0 ? { dependsOn } : {}),
|
|
67
|
+
});
|
|
68
|
+
// Every environment sits at the same depth, so one relative path serves
|
|
69
|
+
// each configuration.
|
|
70
|
+
const environmentFolder = join(workspaceRoot, root, 'src/environments', environments[0]);
|
|
71
|
+
const check = relative(environmentFolder, checkPlanFresh);
|
|
72
|
+
const projectRoot = relative(environmentFolder, join(workspaceRoot, root));
|
|
73
|
+
return {
|
|
74
|
+
format: {
|
|
75
|
+
executor: 'nx:run-commands',
|
|
76
|
+
options: { command: 'tofu fmt -recursive', cwd: '{projectRoot}/src' },
|
|
77
|
+
},
|
|
78
|
+
'format:check': {
|
|
79
|
+
executor: 'nx:run-commands',
|
|
80
|
+
options: {
|
|
81
|
+
command: 'tofu fmt -check -recursive',
|
|
82
|
+
cwd: '{projectRoot}/src',
|
|
83
|
+
},
|
|
84
|
+
cache: true,
|
|
85
|
+
inputs,
|
|
86
|
+
},
|
|
87
|
+
// `-lockfile=readonly`: a check never writes (ADR 0002), and `init` is
|
|
88
|
+
// the target that records a provider change. `TF_DATA_DIR` keeps this
|
|
89
|
+
// backend-less init out of the working directory of the real `init`.
|
|
90
|
+
typecheck: {
|
|
91
|
+
executor: 'nx:run-commands',
|
|
92
|
+
options: {
|
|
93
|
+
command: environments
|
|
94
|
+
.map((name) => `tofu -chdir=environments/${name} init -backend=false -input=false -lockfile=readonly && tofu -chdir=environments/${name} validate`)
|
|
95
|
+
.join(' && '),
|
|
96
|
+
cwd: '{projectRoot}/src',
|
|
97
|
+
env: { TF_DATA_DIR: '.terraform/validate' },
|
|
98
|
+
},
|
|
99
|
+
cache: true,
|
|
100
|
+
inputs,
|
|
101
|
+
},
|
|
102
|
+
init: inEnvironment(`${passphrase} tofu init -input=false`),
|
|
103
|
+
preview: inEnvironment(`rm -f tfplan && ${passphrase} tofu plan -out tfplan`, ['init']),
|
|
104
|
+
show: inEnvironment(`node "${check}" "${projectRoot}" && ${passphrase} tofu show tfplan`),
|
|
105
|
+
output: inEnvironment(`${passphrase} tofu output`),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/opentofu/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEvE,OAAO,EAGL,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEpE,MAAM,eAAe,GAAG,yCAAyC,CAAC;AAElE,uEAAuE;AACvE,sDAAsD;AACtD,MAAM,cAAc,GAAG,IAAI,CACzB,MAAM,CAAC,IAAI,CAAC,OAAO,EACnB,mBAAmB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CACnD,CAAC;AAEF,8EAA8E;AAC9E,6EAA6E;AAC7E,qCAAqC;AACrC,MAAM,UAAU,GACd,gMAAgM,CAAC;AAEnM;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,wFAAwF;IACxF,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;QAC1B,MAAM,SAAS,GAAG,gBAAgB,CAChC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CACpB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAC1D,EACD,OAAO,CAAC,aAAa,CACtB,CAAC;QACF,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC9D,MAAM,YAAY,GAAG,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EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,GAAG,EAAE,mBAAmB,EAAE;SACtE;QACD,cAAc,EAAE;YACd,QAAQ,EAAE,iBAAiB;YAC3B,OAAO,EAAE;gBACP,OAAO,EAAE,4BAA4B;gBACrC,GAAG,EAAE,mBAAmB;aACzB;YACD,KAAK,EAAE,IAAI;YACX,MAAM;SACP;QACD,uEAAuE;QACvE,sEAAsE;QACtE,qEAAqE;QACrE,SAAS,EAAE;YACT,QAAQ,EAAE,iBAAiB;YAC3B,OAAO,EAAE;gBACP,OAAO,EAAE,YAAY;qBAClB,GAAG,CACF,CAAC,IAAI,EAAE,EAAE,CACP,4BAA4B,IAAI,oFAAoF,IAAI,WAAW,CACtI;qBACA,IAAI,CAAC,MAAM,CAAC;gBACf,GAAG,EAAE,mBAAmB;gBACxB,GAAG,EAAE,EAAE,WAAW,EAAE,qBAAqB,EAAE;aAC5C;YACD,KAAK,EAAE,IAAI;YACX,MAAM;SACP;QACD,IAAI,EAAE,aAAa,CAAC,GAAG,UAAU,yBAAyB,CAAC;QAC3D,OAAO,EAAE,aAAa,CACpB,mBAAmB,UAAU,wBAAwB,EACrD,CAAC,MAAM,CAAC,CACT;QACD,IAAI,EAAE,aAAa,CACjB,SAAS,KAAK,MAAM,WAAW,QAAQ,UAAU,mBAAmB,CACrE;QACD,MAAM,EAAE,aAAa,CAAC,GAAG,UAAU,cAAc,CAAC;KACnD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CreateNodes } from '@nx/devkit';
|
|
2
|
+
/**
|
|
3
|
+
* Gives the Prisma targets to each project root with a `prisma.config.ts`.
|
|
4
|
+
* `generate` is cached: its inputs are the schema files, the config and the
|
|
5
|
+
* Prisma packages, and its outputs are the `output` folders of the generator
|
|
6
|
+
* blocks. It does not change `typecheck` or `build` (ADR 0001).
|
|
7
|
+
*/
|
|
8
|
+
export declare const createNodes: CreateNodes;
|
|
9
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/prisma/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,YAAY,CAAC;AAOpB;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,WA8CzB,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { basename, dirname, join, relative } from 'node:path';
|
|
3
|
+
import { createNodesFromFiles, } from '@nx/devkit';
|
|
4
|
+
import { nearestRoot, projectRootFiles } from "../project-roots.js";
|
|
5
|
+
const generatorBlock = /^\s*generator\s+\w+\s*\{([^}]*)\}/gm;
|
|
6
|
+
const outputLine = /^\s*output\s*=\s*"([^"]+)"/m;
|
|
7
|
+
/**
|
|
8
|
+
* Gives the Prisma targets to each project root with a `prisma.config.ts`.
|
|
9
|
+
* `generate` is cached: its inputs are the schema files, the config and the
|
|
10
|
+
* Prisma packages, and its outputs are the `output` folders of the generator
|
|
11
|
+
* blocks. It does not change `typecheck` or `build` (ADR 0001).
|
|
12
|
+
*/
|
|
13
|
+
export const createNodes = [
|
|
14
|
+
'{package.json,**/package.json,project.json,**/project.json,prisma.config.ts,**/prisma.config.ts,**/*.prisma}',
|
|
15
|
+
(files, options, context) => {
|
|
16
|
+
const rootFiles = projectRootFiles(files.filter((file) => ['package.json', 'project.json'].includes(basename(file))), context.workspaceRoot);
|
|
17
|
+
const roots = new Set(rootFiles.map((file) => dirname(file)));
|
|
18
|
+
const configured = new Set(files
|
|
19
|
+
.filter((file) => basename(file) === 'prisma.config.ts')
|
|
20
|
+
.map((file) => dirname(file)));
|
|
21
|
+
const schemas = new Map();
|
|
22
|
+
for (const file of files.filter((file) => file.endsWith('.prisma'))) {
|
|
23
|
+
const root = nearestRoot(roots, dirname(file));
|
|
24
|
+
if (root !== undefined) {
|
|
25
|
+
schemas.set(root, [...(schemas.get(root) ?? []), file]);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return createNodesFromFiles((file) => {
|
|
29
|
+
const root = dirname(file);
|
|
30
|
+
return configured.has(root)
|
|
31
|
+
? {
|
|
32
|
+
projects: {
|
|
33
|
+
[root]: {
|
|
34
|
+
targets: targets(root, generatorOutputs(context.workspaceRoot, schemas.get(root) ?? [])),
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
}
|
|
38
|
+
: {};
|
|
39
|
+
}, rootFiles, options, context);
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
// Each `output` is relative to the file of its generator block, as Prisma
|
|
43
|
+
// reads it. `undefined` marks a block with no `output`: Prisma then writes
|
|
44
|
+
// into node_modules, which Nx cannot restore from its cache.
|
|
45
|
+
function generatorOutputs(workspaceRoot, schemas) {
|
|
46
|
+
return schemas.flatMap((schema) => [
|
|
47
|
+
...readFileSync(join(workspaceRoot, schema), 'utf8').matchAll(generatorBlock),
|
|
48
|
+
].map(([, body = '']) => {
|
|
49
|
+
const output = outputLine.exec(body)?.[1];
|
|
50
|
+
return output === undefined ? undefined : join(dirname(schema), output);
|
|
51
|
+
}));
|
|
52
|
+
}
|
|
53
|
+
function targets(root, outputs) {
|
|
54
|
+
const command = (line, dependsOn = []) => ({
|
|
55
|
+
executor: 'nx:run-commands',
|
|
56
|
+
options: { command: line, cwd: '{projectRoot}' },
|
|
57
|
+
...(dependsOn.length > 0 ? { dependsOn } : {}),
|
|
58
|
+
});
|
|
59
|
+
const folders = outputs.filter((output) => output !== undefined);
|
|
60
|
+
return {
|
|
61
|
+
generate: {
|
|
62
|
+
...command('prisma generate'),
|
|
63
|
+
inputs: [
|
|
64
|
+
'{projectRoot}/**/*.prisma',
|
|
65
|
+
'{projectRoot}/prisma.config.ts',
|
|
66
|
+
{ externalDependencies: ['prisma', '@prisma/client'] },
|
|
67
|
+
],
|
|
68
|
+
...(folders.length > 0 && folders.length === outputs.length
|
|
69
|
+
? {
|
|
70
|
+
cache: true,
|
|
71
|
+
outputs: [...new Set(folders)].map((folder) => relative(root, folder).startsWith('..')
|
|
72
|
+
? `{workspaceRoot}/${folder}`
|
|
73
|
+
: `{projectRoot}/${relative(root, folder)}`),
|
|
74
|
+
}
|
|
75
|
+
: { cache: false }),
|
|
76
|
+
},
|
|
77
|
+
migrate: command('prisma migrate dev', ['generate']),
|
|
78
|
+
deploy: command('prisma migrate deploy'),
|
|
79
|
+
reset: command('prisma migrate reset'),
|
|
80
|
+
pull: command('prisma db pull'),
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/prisma/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE9D,OAAO,EAGL,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEpE,MAAM,cAAc,GAAG,qCAAqC,CAAC;AAC7D,MAAM,UAAU,GAAG,6BAA6B,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,8GAA8G;IAC9G,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;QAC1B,MAAM,SAAS,GAAG,gBAAgB,CAChC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CACpB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAC1D,EACD,OAAO,CAAC,aAAa,CACtB,CAAC;QACF,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,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gCAAgC;gBAChC,EAAE,oBAAoB,EAAE,CAAC,QAAQ,EAAE,gBAAgB,CAAC,EAAE;aACvD;YACD,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM;gBACzD,CAAC,CAAC;oBACE,KAAK,EAAE,IAAI;oBACX,OAAO,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAC5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;wBACrC,CAAC,CAAC,mBAAmB,MAAM,EAAE;wBAC7B,CAAC,CAAC,iBAAiB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAC9C;iBACF;gBACH,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;SACtB;QACD,OAAO,EAAE,OAAO,CAAC,oBAAoB,EAAE,CAAC,UAAU,CAAC,CAAC;QACpD,MAAM,EAAE,OAAO,CAAC,uBAAuB,CAAC;QACxC,KAAK,EAAE,OAAO,CAAC,sBAAsB,CAAC;QACtC,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC;KAChC,CAAC;AACJ,CAAC"}
|
package/dist/project-roots.d.ts
CHANGED
|
@@ -7,4 +7,9 @@
|
|
|
7
7
|
* `package.json` file of each root.
|
|
8
8
|
*/
|
|
9
9
|
export declare function projectRootFiles(configFiles: readonly string[], workspaceRoot: string): string[];
|
|
10
|
+
/**
|
|
11
|
+
* The project root that owns a folder: the folder itself or its nearest
|
|
12
|
+
* parent in `roots`. A file belongs to the nearest project root above it.
|
|
13
|
+
*/
|
|
14
|
+
export declare function nearestRoot(roots: ReadonlySet<string>, folder: string): string | undefined;
|
|
10
15
|
//# sourceMappingURL=project-roots.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-roots.d.ts","sourceRoot":"","sources":["../src/project-roots.ts"],"names":[],"mappings":"AAQA;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,aAAa,EAAE,MAAM,GACpB,MAAM,EAAE,CAgBV"}
|
|
1
|
+
{"version":3,"file":"project-roots.d.ts","sourceRoot":"","sources":["../src/project-roots.ts"],"names":[],"mappings":"AAQA;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,aAAa,EAAE,MAAM,GACpB,MAAM,EAAE,CAgBV;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,EAC1B,MAAM,EAAE,MAAM,GACb,MAAM,GAAG,SAAS,CAKpB"}
|
package/dist/project-roots.js
CHANGED
|
@@ -18,4 +18,14 @@ export function projectRootFiles(configFiles, workspaceRoot) {
|
|
|
18
18
|
? true
|
|
19
19
|
: !projectJsonRoots.has(dirname(file)) && isInWorkspaces(file));
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* The project root that owns a folder: the folder itself or its nearest
|
|
23
|
+
* parent in `roots`. A file belongs to the nearest project root above it.
|
|
24
|
+
*/
|
|
25
|
+
export function nearestRoot(roots, folder) {
|
|
26
|
+
if (roots.has(folder)) {
|
|
27
|
+
return folder;
|
|
28
|
+
}
|
|
29
|
+
return folder === '.' ? undefined : nearestRoot(roots, dirname(folder));
|
|
30
|
+
}
|
|
21
31
|
//# sourceMappingURL=project-roots.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-roots.js","sourceRoot":"","sources":["../src/project-roots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EACL,wBAAwB,EACxB,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C,KAAK,cAAc,CAAC;SACnD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAChC,CAAC;IACF,MAAM,cAAc,GAAG,iCAAiC,CACtD,wBAAwB,CAAC,aAAa,EAAE,CAAC,IAAY,EAAE,EAAE,CACvD,YAAY,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CACxC,CACF,CAAC;IACF,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CACjC,QAAQ,CAAC,IAAI,CAAC,KAAK,cAAc;QAC/B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,CACjE,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CACzB,KAA0B,EAC1B,MAAc;IAEd,IAAI,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QACtB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AAC1E,CAAC"}
|
package/dist/test/plugin.js
CHANGED
|
@@ -11,7 +11,7 @@ import { createRequire, findPackageJSON } from 'node:module';
|
|
|
11
11
|
import { basename, dirname, extname, join, relative } from 'node:path';
|
|
12
12
|
import { pathToFileURL } from 'node:url';
|
|
13
13
|
import { createNodesFromFiles, readJsonFile, } from '@nx/devkit';
|
|
14
|
-
import { projectRootFiles } from "../project-roots.js";
|
|
14
|
+
import { nearestRoot, projectRootFiles } from "../project-roots.js";
|
|
15
15
|
const testFile = /\.test\.(?:ts|mts|cts|js|mjs)$/;
|
|
16
16
|
const viteConfig = /^vite\.config\.(?:js|ts|mjs|mts|cjs|cts)$/;
|
|
17
17
|
const vitestConfig = /^vitest\.config\.(?:js|ts|mjs|mts|cjs|cts)$/;
|
|
@@ -82,12 +82,6 @@ export const createNodes = [
|
|
|
82
82
|
}, rootFiles, options, context);
|
|
83
83
|
},
|
|
84
84
|
];
|
|
85
|
-
function nearestRoot(roots, folder) {
|
|
86
|
-
if (roots.has(folder)) {
|
|
87
|
-
return folder;
|
|
88
|
-
}
|
|
89
|
-
return folder === '.' ? undefined : nearestRoot(roots, dirname(folder));
|
|
90
|
-
}
|
|
91
85
|
// One glob for each top-level folder with test files, and one glob with no
|
|
92
86
|
// `**` for the test files directly in the root (ADR 0004).
|
|
93
87
|
function selection(tests) {
|
package/dist/test/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/test/plugin.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAGL,oBAAoB,EACpB,YAAY,GACb,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/test/plugin.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAA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AAC;IAC9C,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;QAClD,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,MAAM,OAAO,GAAG,GAAG,IAAI,0JAA0J,CAAC;IAClL,IAAI,QAA4B,CAAC;IACjC,IAAI,CAAC;QACH,QAAQ,GAAG,eAAe,CACxB,kBAAkB,EAClB,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAClC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IACE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YACpB,MAAM,IAAI,KAAK;YACf,KAAK,CAAC,IAAI,KAAK,sBAAsB,EACrC,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC7C,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;IACD,IAAI,QAAQ,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;IACrD,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/D,OAAO,QAAQ,CACb,WAAW,EACX,IAAI,CACF,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,EAC/B,OAAO,CAAC,uBAAuB,CAAC,CAAC,OAAO,CACzC,CACF,CAAC;AACJ,CAAC"}
|
package/generators.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"generators": {
|
|
3
|
+
"preset": {
|
|
4
|
+
"implementation": "./dist/generators/preset/generator.js",
|
|
5
|
+
"schema": "./src/generators/preset/schema.json",
|
|
6
|
+
"description": "Start a repo of the monorepo standard. create-nx-workspace runs it."
|
|
7
|
+
},
|
|
8
|
+
"init": {
|
|
9
|
+
"implementation": "./dist/generators/init/generator.js",
|
|
10
|
+
"schema": "./src/generators/init/schema.json",
|
|
11
|
+
"description": "Add the root files of the monorepo standard. Safe to run again."
|
|
12
|
+
},
|
|
13
|
+
"node-app": {
|
|
14
|
+
"implementation": "./dist/generators/node-app/generator.js",
|
|
15
|
+
"schema": "./src/generators/node-app/schema.json",
|
|
16
|
+
"description": "Add a Hono backend: one ESM esbuild bundle, evlog, a zod env, an sdk-it client and a Dockerfile whose image reports its commit."
|
|
17
|
+
},
|
|
18
|
+
"react-app": {
|
|
19
|
+
"implementation": "./dist/generators/react-app/generator.js",
|
|
20
|
+
"schema": "./src/generators/react-app/schema.json",
|
|
21
|
+
"description": "Add a React Router SPA on Vite, with Tailwind, the React Compiler and Vitest component tests."
|
|
22
|
+
},
|
|
23
|
+
"pair": {
|
|
24
|
+
"implementation": "./dist/generators/pair/generator.js",
|
|
25
|
+
"schema": "./src/generators/pair/schema.json",
|
|
26
|
+
"description": "Pair a react-app with a node-app: the web gets the generated client, and the api serves the web build and puts it in its image."
|
|
27
|
+
},
|
|
28
|
+
"ui-package": {
|
|
29
|
+
"implementation": "./dist/generators/ui-package/generator.js",
|
|
30
|
+
"schema": "./src/generators/ui-package/schema.json",
|
|
31
|
+
"description": "Add a buildable React package with a Vite library build, types and a development export condition."
|
|
32
|
+
},
|
|
33
|
+
"prisma": {
|
|
34
|
+
"implementation": "./dist/generators/prisma/generator.js",
|
|
35
|
+
"schema": "./src/generators/prisma/schema.json",
|
|
36
|
+
"description": "Add a Postgres db package on Prisma 7 and @prisma/adapter-pg, with a migration image and a test helper, and connect a node-app to it."
|
|
37
|
+
},
|
|
38
|
+
"dokploy": {
|
|
39
|
+
"implementation": "./dist/generators/dokploy/generator.js",
|
|
40
|
+
"schema": "./src/generators/dokploy/schema.json",
|
|
41
|
+
"description": "Deliver a node-app to Dokploy by GitOps: an OpenTofu project in infra/ with the compose, optional Postgres and a private registry, and the CI and deploy workflows that call zukhruf's tofu-apply, dokploy-deploy and wait-for-health."
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zukhruf/nx",
|
|
3
|
-
"version": "0.8.
|
|
4
|
-
"description": "The Nx part of the monorepo standard
|
|
3
|
+
"version": "0.8.31",
|
|
4
|
+
"description": "The Nx part of the monorepo standard: inference plugins for format, test, lint, opentofu and prisma targets, and generators for the root files (preset, init), apps (node-app, react-app, pair, ui-package), a db package (prisma) and delivery (dokploy).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -24,7 +24,13 @@
|
|
|
24
24
|
"node-test",
|
|
25
25
|
"test",
|
|
26
26
|
"eslint",
|
|
27
|
-
"lint"
|
|
27
|
+
"lint",
|
|
28
|
+
"opentofu",
|
|
29
|
+
"terraform",
|
|
30
|
+
"prisma",
|
|
31
|
+
"generator",
|
|
32
|
+
"preset",
|
|
33
|
+
"dokploy"
|
|
28
34
|
],
|
|
29
35
|
"type": "module",
|
|
30
36
|
"exports": {
|
|
@@ -46,10 +52,25 @@
|
|
|
46
52
|
"types": "./dist/lint/plugin.d.ts",
|
|
47
53
|
"import": "./dist/lint/plugin.js",
|
|
48
54
|
"default": "./dist/lint/plugin.js"
|
|
55
|
+
},
|
|
56
|
+
"./opentofu": {
|
|
57
|
+
"@zukhruf/source": "./src/opentofu/plugin.ts",
|
|
58
|
+
"types": "./dist/opentofu/plugin.d.ts",
|
|
59
|
+
"import": "./dist/opentofu/plugin.js",
|
|
60
|
+
"default": "./dist/opentofu/plugin.js"
|
|
61
|
+
},
|
|
62
|
+
"./prisma": {
|
|
63
|
+
"@zukhruf/source": "./src/prisma/plugin.ts",
|
|
64
|
+
"types": "./dist/prisma/plugin.d.ts",
|
|
65
|
+
"import": "./dist/prisma/plugin.js",
|
|
66
|
+
"default": "./dist/prisma/plugin.js"
|
|
49
67
|
}
|
|
50
68
|
},
|
|
69
|
+
"generators": "./generators.json",
|
|
51
70
|
"files": [
|
|
52
71
|
"dist",
|
|
72
|
+
"generators.json",
|
|
73
|
+
"src/generators/*/schema.json",
|
|
53
74
|
"!dist/spec/**",
|
|
54
75
|
"!**/*.tsbuildinfo",
|
|
55
76
|
"!**/*.test.*"
|
|
@@ -59,11 +80,29 @@
|
|
|
59
80
|
},
|
|
60
81
|
"peerDependencies": {
|
|
61
82
|
"@nx/devkit": ">=23.2.1 <25.0.0",
|
|
83
|
+
"@nx/node": ">=23.2.1 <25.0.0",
|
|
84
|
+
"@nx/react": ">=23.2.1 <25.0.0",
|
|
85
|
+
"@nx/vite": ">=23.2.1 <25.0.0",
|
|
86
|
+
"@nx/vitest": ">=23.2.1 <25.0.0",
|
|
62
87
|
"nx": ">=23.2.1 <25.0.0",
|
|
63
88
|
"prettier": "^3.0.0"
|
|
64
89
|
},
|
|
90
|
+
"peerDependenciesMeta": {
|
|
91
|
+
"@nx/node": {
|
|
92
|
+
"optional": true
|
|
93
|
+
},
|
|
94
|
+
"@nx/react": {
|
|
95
|
+
"optional": true
|
|
96
|
+
},
|
|
97
|
+
"@nx/vite": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
100
|
+
"@nx/vitest": {
|
|
101
|
+
"optional": true
|
|
102
|
+
}
|
|
103
|
+
},
|
|
65
104
|
"devDependencies": {
|
|
66
|
-
"@zukhruf/fs": "^0.8.
|
|
67
|
-
"@zukhruf/testing": "^0.8.
|
|
105
|
+
"@zukhruf/fs": "^0.8.31",
|
|
106
|
+
"@zukhruf/testing": "^0.8.31"
|
|
68
107
|
}
|
|
69
108
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "ZukhrufNxDokploy",
|
|
4
|
+
"title": "Deliver a node-app to Dokploy",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"api": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The project root of the node-app, for example apps/backend."
|
|
10
|
+
},
|
|
11
|
+
"owner": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "The GitHub owner of the repo. The images are ghcr.io/<owner>/<name>-<app>, in lowercase."
|
|
14
|
+
},
|
|
15
|
+
"name": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "The Dokploy project, and the prefix of the images and the Traefik routers. The workspace scope by default."
|
|
18
|
+
},
|
|
19
|
+
"dokployHost": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "The Dokploy API base URL.",
|
|
22
|
+
"default": "https://dokploy.limerence.sh/api"
|
|
23
|
+
},
|
|
24
|
+
"server": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"description": "The Hetzner Cloud server that runs Dokploy.",
|
|
27
|
+
"default": "limerence-dokploy"
|
|
28
|
+
},
|
|
29
|
+
"host": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "A DNS name in a Hetzner zone, for example app.example.com. Without it, the host is <name>.<server ipv4>.sslip.io."
|
|
32
|
+
},
|
|
33
|
+
"zone": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "The Hetzner zone of host. The host without its first label by default."
|
|
36
|
+
},
|
|
37
|
+
"database": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "The project root of a Prisma package with a Dockerfile.migration, for example packages/db. It adds Postgres and the one-shot migrate service."
|
|
40
|
+
},
|
|
41
|
+
"registryUser": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "The GitHub user whose classic token with read:packages is the GHCR_PULL_TOKEN secret. It adds a Dokploy registry, so the server pulls private images."
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"required": ["api", "owner"],
|
|
47
|
+
"additionalProperties": false
|
|
48
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "ZukhrufNxNodeApp",
|
|
4
|
+
"title": "Add a Hono backend",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"directory": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The project root, relative to the workspace root, for example apps/backend.",
|
|
10
|
+
"alias": "dir",
|
|
11
|
+
"$default": { "$source": "argv", "index": 0 },
|
|
12
|
+
"x-prompt": "Which directory gets the application?"
|
|
13
|
+
},
|
|
14
|
+
"port": {
|
|
15
|
+
"type": "number",
|
|
16
|
+
"description": "The port of the server in development: PORT in .env.example, portless --app-port and EXPOSE.",
|
|
17
|
+
"default": 3000
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"required": ["directory"],
|
|
21
|
+
"additionalProperties": false
|
|
22
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "ZukhrufNxPair",
|
|
4
|
+
"title": "Pair a react-app with a node-app",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"api": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The project root of the node-app, for example apps/backend."
|
|
10
|
+
},
|
|
11
|
+
"web": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "The project root of the react-app, for example apps/web."
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"required": ["api", "web"],
|
|
17
|
+
"additionalProperties": false
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "ZukhrufNxPreset",
|
|
4
|
+
"title": "Start a repo of the monorepo standard",
|
|
5
|
+
"description": "create-nx-workspace passes each option of its command line, so the schema allows options that it does not list.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"name": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The folder name, from create-nx-workspace."
|
|
11
|
+
},
|
|
12
|
+
"packageManager": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "The package manager. Only npm is allowed."
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"required": ["name"]
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "ZukhrufNxPrisma",
|
|
4
|
+
"title": "Add a Postgres db package on Prisma",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"directory": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The project root of the db package, for example packages/db.",
|
|
10
|
+
"alias": "dir",
|
|
11
|
+
"$default": { "$source": "argv", "index": 0 },
|
|
12
|
+
"x-prompt": "Which directory gets the db package?"
|
|
13
|
+
},
|
|
14
|
+
"backend": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "The project root of a node-app that connects to the database before it serves, for example apps/backend."
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"required": ["directory"],
|
|
20
|
+
"additionalProperties": false
|
|
21
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "ZukhrufNxReactApp",
|
|
4
|
+
"title": "Add a React Router SPA on Vite",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"directory": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The project root, relative to the workspace root, for example apps/web.",
|
|
10
|
+
"alias": "dir",
|
|
11
|
+
"$default": { "$source": "argv", "index": 0 },
|
|
12
|
+
"x-prompt": "Which directory gets the application?"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"required": ["directory"],
|
|
16
|
+
"additionalProperties": false
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "ZukhrufNxUiPackage",
|
|
4
|
+
"title": "Add a buildable React package",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"directory": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "The package folder under packages/, for example packages/ui.",
|
|
10
|
+
"alias": "dir",
|
|
11
|
+
"$default": { "$source": "argv", "index": 0 },
|
|
12
|
+
"x-prompt": "Which directory gets the package?"
|
|
13
|
+
},
|
|
14
|
+
"importPath": {
|
|
15
|
+
"type": "string",
|
|
16
|
+
"description": "The package name, for example @acme/ui.",
|
|
17
|
+
"x-prompt": "What package name do consumers import?"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"required": ["directory", "importPath"],
|
|
21
|
+
"additionalProperties": false
|
|
22
|
+
}
|