@zukhruf/nx 0.8.30 → 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 +378 -19
- 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.js +3 -3
- package/dist/generators/init/files.js.map +1 -1
- package/dist/generators/init/generator.d.ts.map +1 -1
- package/dist/generators/init/generator.js +1 -16
- package/dist/generators/init/generator.js.map +1 -1
- package/dist/generators/init/nx-json.d.ts +16 -3
- package/dist/generators/init/nx-json.d.ts.map +1 -1
- package/dist/generators/init/nx-json.js +20 -5
- package/dist/generators/init/nx-json.js.map +1 -1
- package/dist/generators/init/root-package-json.d.ts +6 -0
- package/dist/generators/init/root-package-json.d.ts.map +1 -1
- package/dist/generators/init/root-package-json.js +15 -12
- package/dist/generators/init/root-package-json.js.map +1 -1
- 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/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 +49 -1
- package/dist/generators/versions.d.ts.map +1 -1
- package/dist/generators/versions.js +61 -1
- package/dist/generators/versions.js.map +1 -1
- package/generators.json +30 -0
- package/package.json +24 -5
- package/src/generators/dokploy/schema.json +48 -0
- package/src/generators/node-app/schema.json +22 -0
- package/src/generators/pair/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,37 @@
|
|
|
1
|
+
export declare function viteConfig(projectRoot: string, rootOffset: string, importPath: string): string;
|
|
2
|
+
export declare function rootTsconfig(rootOffset: string): {
|
|
3
|
+
extends: string;
|
|
4
|
+
files: never[];
|
|
5
|
+
include: never[];
|
|
6
|
+
references: {
|
|
7
|
+
path: string;
|
|
8
|
+
}[];
|
|
9
|
+
};
|
|
10
|
+
export declare function libraryTsconfig(rootOffset: string): {
|
|
11
|
+
extends: string;
|
|
12
|
+
compilerOptions: {
|
|
13
|
+
lib: string[];
|
|
14
|
+
outDir: string;
|
|
15
|
+
types: string[];
|
|
16
|
+
rootDir: string;
|
|
17
|
+
jsx: string;
|
|
18
|
+
tsBuildInfoFile: string;
|
|
19
|
+
};
|
|
20
|
+
exclude: string[];
|
|
21
|
+
include: string[];
|
|
22
|
+
};
|
|
23
|
+
export declare function specTsconfig(rootOffset: string): {
|
|
24
|
+
extends: string;
|
|
25
|
+
compilerOptions: {
|
|
26
|
+
rootDir: string;
|
|
27
|
+
outDir: string;
|
|
28
|
+
tsBuildInfoFile: string;
|
|
29
|
+
types: string[];
|
|
30
|
+
};
|
|
31
|
+
include: string[];
|
|
32
|
+
references: {
|
|
33
|
+
path: string;
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
36
|
+
export declare function publicApiTest(importPath: string): string;
|
|
37
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../src/generators/ui-package/files.ts"],"names":[],"mappings":"AAGA,wBAAgB,UAAU,CACxB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,MAAM,CAgDR;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM;;;;;;;EAU9C;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM;;;;;;;;;;;;EA6BjD;AAED,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM;;;;;;;;;;;;EAY9C;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAWxD"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// The content of each file that ui-package writes. Each is a string in a .ts
|
|
2
|
+
// module, so tsc puts it in dist with no copy step (ADR 0009).
|
|
3
|
+
export function viteConfig(projectRoot, rootOffset, importPath) {
|
|
4
|
+
return `import path from 'node:path';
|
|
5
|
+
|
|
6
|
+
import babel from '@rolldown/plugin-babel';
|
|
7
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
8
|
+
import react, { reactCompilerPreset } from '@vitejs/plugin-react';
|
|
9
|
+
import { defineConfig } from 'vite';
|
|
10
|
+
import dts from 'vite-plugin-dts';
|
|
11
|
+
|
|
12
|
+
export default defineConfig(() => ({
|
|
13
|
+
root: import.meta.dirname,
|
|
14
|
+
cacheDir: '${rootOffset}node_modules/.vite/${projectRoot}',
|
|
15
|
+
plugins: [
|
|
16
|
+
react(),
|
|
17
|
+
babel({ presets: [reactCompilerPreset()] }),
|
|
18
|
+
tailwindcss(),
|
|
19
|
+
dts({
|
|
20
|
+
entryRoot: 'src',
|
|
21
|
+
tsconfigPath: path.join(import.meta.dirname, 'tsconfig.lib.json'),
|
|
22
|
+
}),
|
|
23
|
+
],
|
|
24
|
+
assetsInclude: ['**/*.css'],
|
|
25
|
+
build: {
|
|
26
|
+
outDir: './dist',
|
|
27
|
+
emptyOutDir: true,
|
|
28
|
+
reportCompressedSize: true,
|
|
29
|
+
sourcemap: true,
|
|
30
|
+
commonjsOptions: { transformMixedEsModules: true },
|
|
31
|
+
lib: {
|
|
32
|
+
entry: 'src/index.ts',
|
|
33
|
+
name: '${importPath}',
|
|
34
|
+
fileName: 'index',
|
|
35
|
+
formats: ['es' as const],
|
|
36
|
+
},
|
|
37
|
+
rolldownOptions: {
|
|
38
|
+
external: (id) =>
|
|
39
|
+
id.startsWith('node:') ||
|
|
40
|
+
!(
|
|
41
|
+
id.startsWith('.') ||
|
|
42
|
+
path.isAbsolute(id) ||
|
|
43
|
+
id.startsWith('\\0') ||
|
|
44
|
+
id.includes(':')
|
|
45
|
+
),
|
|
46
|
+
output: { assetFileNames: 'assets/[name][extname]' },
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
}));
|
|
50
|
+
`;
|
|
51
|
+
}
|
|
52
|
+
export function rootTsconfig(rootOffset) {
|
|
53
|
+
return {
|
|
54
|
+
extends: `${rootOffset}tsconfig.base.json`,
|
|
55
|
+
files: [],
|
|
56
|
+
include: [],
|
|
57
|
+
references: [
|
|
58
|
+
{ path: './tsconfig.lib.json' },
|
|
59
|
+
{ path: './tsconfig.spec.json' },
|
|
60
|
+
],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export function libraryTsconfig(rootOffset) {
|
|
64
|
+
return {
|
|
65
|
+
extends: `${rootOffset}tsconfig.base.json`,
|
|
66
|
+
compilerOptions: {
|
|
67
|
+
lib: ['DOM', 'DOM.Iterable', 'DOM.AsyncIterable'],
|
|
68
|
+
outDir: 'dist',
|
|
69
|
+
types: [
|
|
70
|
+
'node',
|
|
71
|
+
'@nx/react/typings/cssmodule.d.ts',
|
|
72
|
+
'@nx/react/typings/image.d.ts',
|
|
73
|
+
'vite/client',
|
|
74
|
+
],
|
|
75
|
+
rootDir: 'src',
|
|
76
|
+
jsx: 'react-jsx',
|
|
77
|
+
tsBuildInfoFile: 'dist/tsconfig.lib.tsbuildinfo',
|
|
78
|
+
},
|
|
79
|
+
exclude: [
|
|
80
|
+
'out-tsc',
|
|
81
|
+
'dist',
|
|
82
|
+
'**/*.spec.ts',
|
|
83
|
+
'**/*.test.ts',
|
|
84
|
+
'**/*.spec.tsx',
|
|
85
|
+
'**/*.test.tsx',
|
|
86
|
+
'eslint.config.js',
|
|
87
|
+
'eslint.config.cjs',
|
|
88
|
+
'eslint.config.mjs',
|
|
89
|
+
],
|
|
90
|
+
include: ['src/**/*.js', 'src/**/*.jsx', 'src/**/*.ts', 'src/**/*.tsx'],
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export function specTsconfig(rootOffset) {
|
|
94
|
+
return {
|
|
95
|
+
extends: `${rootOffset}tsconfig.base.json`,
|
|
96
|
+
compilerOptions: {
|
|
97
|
+
rootDir: '.',
|
|
98
|
+
outDir: 'out-tsc/spec',
|
|
99
|
+
tsBuildInfoFile: 'out-tsc/spec/tsconfig.spec.tsbuildinfo',
|
|
100
|
+
types: ['node', 'vite/client'],
|
|
101
|
+
},
|
|
102
|
+
include: ['vite.config.ts'],
|
|
103
|
+
references: [{ path: './tsconfig.lib.json' }],
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
export function publicApiTest(importPath) {
|
|
107
|
+
const packageName = importPath.split('/').at(-1);
|
|
108
|
+
return `import assert from 'node:assert/strict';
|
|
109
|
+
import { test } from 'node:test';
|
|
110
|
+
|
|
111
|
+
import { packageName } from '${importPath}';
|
|
112
|
+
|
|
113
|
+
test('${packageName} is importable through its public package export', () => {
|
|
114
|
+
assert.equal(packageName, '${importPath}');
|
|
115
|
+
});
|
|
116
|
+
`;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=files.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.js","sourceRoot":"","sources":["../../../src/generators/ui-package/files.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,+DAA+D;AAE/D,MAAM,UAAU,UAAU,CACxB,WAAmB,EACnB,UAAkB,EAClB,UAAkB;IAElB,OAAO;;;;;;;;;;eAUM,UAAU,sBAAsB,WAAW;;;;;;;;;;;;;;;;;;;eAmB3C,UAAU;;;;;;;;;;;;;;;;;CAiBxB,CAAC;AACF,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,UAAkB;IAC7C,OAAO;QACL,OAAO,EAAE,GAAG,UAAU,oBAAoB;QAC1C,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,EAAE;QACX,UAAU,EAAE;YACV,EAAE,IAAI,EAAE,qBAAqB,EAAE;YAC/B,EAAE,IAAI,EAAE,sBAAsB,EAAE;SACjC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,UAAkB;IAChD,OAAO;QACL,OAAO,EAAE,GAAG,UAAU,oBAAoB;QAC1C,eAAe,EAAE;YACf,GAAG,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,mBAAmB,CAAC;YACjD,MAAM,EAAE,MAAM;YACd,KAAK,EAAE;gBACL,MAAM;gBACN,kCAAkC;gBAClC,8BAA8B;gBAC9B,aAAa;aACd;YACD,OAAO,EAAE,KAAK;YACd,GAAG,EAAE,WAAW;YAChB,eAAe,EAAE,+BAA+B;SACjD;QACD,OAAO,EAAE;YACP,SAAS;YACT,MAAM;YACN,cAAc;YACd,cAAc;YACd,eAAe;YACf,eAAe;YACf,kBAAkB;YAClB,mBAAmB;YACnB,mBAAmB;SACpB;QACD,OAAO,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,CAAC;KACxE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,UAAkB;IAC7C,OAAO;QACL,OAAO,EAAE,GAAG,UAAU,oBAAoB;QAC1C,eAAe,EAAE;YACf,OAAO,EAAE,GAAG;YACZ,MAAM,EAAE,cAAc;YACtB,eAAe,EAAE,wCAAwC;YACzD,KAAK,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC;SAC/B;QACD,OAAO,EAAE,CAAC,gBAAgB,CAAC;QAC3B,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC;KAC9C,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,UAAkB;IAC9C,MAAM,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACjD,OAAO;;;+BAGsB,UAAU;;QAEjC,WAAW;+BACY,UAAU;;CAExC,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type GeneratorCallback, type Tree } from '@nx/devkit';
|
|
2
|
+
export interface UiPackageOptions {
|
|
3
|
+
/** The package folder under packages/, for example `packages/ui`. */
|
|
4
|
+
directory: string;
|
|
5
|
+
/** The package name, for example `@acme/ui`. */
|
|
6
|
+
importPath: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A buildable React package: a Vite library build with types, a `development`
|
|
10
|
+
* export condition that points at the source, and a node test of the public
|
|
11
|
+
* export. It runs `init` first. A second run keeps the package as it is.
|
|
12
|
+
*/
|
|
13
|
+
export default function uiPackageGenerator(tree: Tree, options: UiPackageOptions): Promise<GeneratorCallback>;
|
|
14
|
+
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../src/generators/ui-package/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,IAAI,EAMV,MAAM,YAAY,CAAC;AAuBpB,MAAM,WAAW,gBAAgB;IAC/B,qEAAqE;IACrE,SAAS,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,UAAU,EAAE,MAAM,CAAC;CACpB;AAiBD;;;;GAIG;AACH,wBAA8B,kBAAkB,CAC9C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAkI5B"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { formatFiles, readJson, runTasksInSerial, updateJson, writeJson, } from '@nx/devkit';
|
|
2
|
+
import { appDirectory } from "../app-directory.js";
|
|
3
|
+
import initGenerator from "../init/generator.js";
|
|
4
|
+
import { nxPlugin } from "../nx-plugin.js";
|
|
5
|
+
import { reactEslintConfig, reactResidue, reactRootPackages, } from "../react.js";
|
|
6
|
+
import { rootDependencyNames, settleRootDependencies, } from "../root-dependencies.js";
|
|
7
|
+
import { appPackageVersions as versions } from "../versions.js";
|
|
8
|
+
import { libraryTsconfig, publicApiTest, rootTsconfig, specTsconfig, viteConfig, } from "./files.js";
|
|
9
|
+
/**
|
|
10
|
+
* A buildable React package: a Vite library build with types, a `development`
|
|
11
|
+
* export condition that points at the source, and a node test of the public
|
|
12
|
+
* export. It runs `init` first. A second run keeps the package as it is.
|
|
13
|
+
*/
|
|
14
|
+
export default async function uiPackageGenerator(tree, options) {
|
|
15
|
+
const initTask = await initGenerator(tree);
|
|
16
|
+
const { projectRoot, rootOffset } = appDirectory(options.directory);
|
|
17
|
+
if (!projectRoot.startsWith('packages/')) {
|
|
18
|
+
throw new Error(`A UI package goes under packages/, not ${JSON.stringify(options.directory)}.`);
|
|
19
|
+
}
|
|
20
|
+
if (!/^@[a-z0-9][a-z0-9._-]*\/[a-z0-9][a-z0-9._-]*$/.test(options.importPath)) {
|
|
21
|
+
throw new Error(`The import path ${JSON.stringify(options.importPath)} is not a scoped package name, for example "@acme/ui".`);
|
|
22
|
+
}
|
|
23
|
+
const packageJsonPath = `${projectRoot}/package.json`;
|
|
24
|
+
if (tree.exists(packageJsonPath)) {
|
|
25
|
+
const existing = readJson(tree, packageJsonPath);
|
|
26
|
+
if (existing.name !== options.importPath) {
|
|
27
|
+
throw new Error(existing.name === undefined
|
|
28
|
+
? `${packageJsonPath} already exists and has no name.`
|
|
29
|
+
: `${projectRoot} already belongs to ${existing.name}.`);
|
|
30
|
+
}
|
|
31
|
+
return initTask;
|
|
32
|
+
}
|
|
33
|
+
const before = rootDependencyNames(tree);
|
|
34
|
+
const { libraryGenerator } = nxPlugin('@nx/react');
|
|
35
|
+
const libraryTask = await libraryGenerator(tree, {
|
|
36
|
+
directory: projectRoot,
|
|
37
|
+
importPath: options.importPath,
|
|
38
|
+
bundler: 'vite',
|
|
39
|
+
compiler: 'babel',
|
|
40
|
+
component: false,
|
|
41
|
+
linter: 'eslint',
|
|
42
|
+
strict: true,
|
|
43
|
+
style: 'none',
|
|
44
|
+
unitTestRunner: 'none',
|
|
45
|
+
useProjectJson: false,
|
|
46
|
+
addPlugin: true,
|
|
47
|
+
skipFormat: true,
|
|
48
|
+
});
|
|
49
|
+
tree.delete(`${projectRoot}/.babelrc`);
|
|
50
|
+
tree.delete(`${projectRoot}/README.md`);
|
|
51
|
+
tree.delete(`${projectRoot}/vite.config.mts`);
|
|
52
|
+
tree.write(`${projectRoot}/vite.config.ts`, viteConfig(projectRoot, rootOffset, options.importPath));
|
|
53
|
+
tree.write(`${projectRoot}/eslint.config.mjs`, reactEslintConfig(rootOffset, ['tailwind']));
|
|
54
|
+
writeJson(tree, `${projectRoot}/tsconfig.json`, rootTsconfig(rootOffset));
|
|
55
|
+
writeJson(tree, `${projectRoot}/tsconfig.lib.json`, libraryTsconfig(rootOffset));
|
|
56
|
+
writeJson(tree, `${projectRoot}/tsconfig.spec.json`, specTsconfig(rootOffset));
|
|
57
|
+
tree.write(`${projectRoot}/src/index.ts`, `export const packageName = '${options.importPath}';\n`);
|
|
58
|
+
tree.write(`${projectRoot}/tests/public-api.test.mjs`, publicApiTest(options.importPath));
|
|
59
|
+
updateJson(tree, packageJsonPath, (packageJson) => {
|
|
60
|
+
packageJson.name = options.importPath;
|
|
61
|
+
packageJson.version = '0.1.0';
|
|
62
|
+
packageJson.private = true;
|
|
63
|
+
packageJson.type = 'module';
|
|
64
|
+
packageJson.main = './dist/index.js';
|
|
65
|
+
packageJson.module = './dist/index.js';
|
|
66
|
+
packageJson.types = './dist/index.d.ts';
|
|
67
|
+
packageJson.exports = {
|
|
68
|
+
'./package.json': './package.json',
|
|
69
|
+
'.': {
|
|
70
|
+
development: './src/index.ts',
|
|
71
|
+
types: './dist/index.d.ts',
|
|
72
|
+
import: './dist/index.js',
|
|
73
|
+
default: './dist/index.js',
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
packageJson.dependencies = { react: versions.react };
|
|
77
|
+
packageJson.devDependencies = {
|
|
78
|
+
'@rolldown/plugin-babel': versions['@rolldown/plugin-babel'],
|
|
79
|
+
'@tailwindcss/vite': versions['@tailwindcss/vite'],
|
|
80
|
+
'@vitejs/plugin-react': versions['@vitejs/plugin-react'],
|
|
81
|
+
'babel-plugin-react-compiler': versions['babel-plugin-react-compiler'],
|
|
82
|
+
vite: versions.vite,
|
|
83
|
+
'vite-plugin-dts': versions['vite-plugin-dts'],
|
|
84
|
+
};
|
|
85
|
+
packageJson.scripts = {};
|
|
86
|
+
packageJson.nx = {
|
|
87
|
+
...packageJson.nx,
|
|
88
|
+
targets: {
|
|
89
|
+
...packageJson.nx?.targets,
|
|
90
|
+
// The test imports the package through its export, which is dist.
|
|
91
|
+
test: { dependsOn: ['...', 'build'] },
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
return packageJson;
|
|
95
|
+
});
|
|
96
|
+
settleRootDependencies(tree, before, {
|
|
97
|
+
devDependencies: reactRootPackages,
|
|
98
|
+
// The babel compiler and vite-plugin-dts of @nx/react go to the root;
|
|
99
|
+
// the package declares what its own vite.config.ts loads.
|
|
100
|
+
residue: [
|
|
101
|
+
...reactResidue,
|
|
102
|
+
'@babel/core',
|
|
103
|
+
'@babel/preset-react',
|
|
104
|
+
'ajv',
|
|
105
|
+
'vite-plugin-dts',
|
|
106
|
+
],
|
|
107
|
+
});
|
|
108
|
+
await formatFiles(tree);
|
|
109
|
+
return runTasksInSerial(initTask, libraryTask);
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../src/generators/ui-package/generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,WAAW,EACX,QAAQ,EACR,gBAAgB,EAChB,UAAU,EACV,SAAS,GACV,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,aAAa,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAO,EACL,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,UAAU,GACX,MAAM,YAAY,CAAC;AAwBpB;;;;GAIG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,kBAAkB,CAC9C,IAAU,EACV,OAAyB;IAEzB,MAAM,QAAQ,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACpE,IAAI,CAAC,WAAW,CA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AAqB;YACrB,KAAK;YACL,iBAAiB;SAClB;KACF,CAAC,CAAC;IAEH,MAAM,WAAW,CAAC,IAAI,CAAC,CAAC;IACxB,OAAO,gBAAgB,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -9,11 +9,59 @@ export declare const nxFamily: string[];
|
|
|
9
9
|
/**
|
|
10
10
|
* The other root tools, at exact versions. A generator adds a missing one and
|
|
11
11
|
* keeps a version that is there. TypeScript 7 compiles and TypeScript 6 gives
|
|
12
|
-
* its API to typescript-eslint and `@nx/js` (monorepo standard
|
|
12
|
+
* its API to typescript-eslint and `@nx/js` (README, monorepo standard). The ESLint
|
|
13
13
|
* packages are the peers of @zukhruf/eslint that the root config loads, with
|
|
14
14
|
* the 2 of `@zukhruf/eslint/modern-node`.
|
|
15
15
|
*/
|
|
16
16
|
export declare const rootToolVersions: Record<string, string>;
|
|
17
|
+
/**
|
|
18
|
+
* The packages of the app generators, at exact versions, each the latest on
|
|
19
|
+
* 2026-11-18 (#3338). A generator adds a missing package, and keeps a version
|
|
20
|
+
* that was there before it ran. Each `@nx/*` plugin gets `nxVersion`.
|
|
21
|
+
*/
|
|
22
|
+
export declare const appPackageVersions: {
|
|
23
|
+
readonly '@godaddy/terminus': "4.12.1";
|
|
24
|
+
readonly '@hono/node-server': "2.1.9";
|
|
25
|
+
readonly '@sdk-it/cli': "0.46.11";
|
|
26
|
+
readonly '@sdk-it/hono': "0.46.11";
|
|
27
|
+
readonly esbuild: "0.28.2";
|
|
28
|
+
readonly '@types/node': "26.6.6";
|
|
29
|
+
readonly tslib: "2.9.1";
|
|
30
|
+
readonly evlog: "2.35.1";
|
|
31
|
+
readonly hono: "4.13.19";
|
|
32
|
+
readonly zod: "4.6.7";
|
|
33
|
+
readonly 'fast-content-type-parse': "3.0.0";
|
|
34
|
+
readonly '@eslint-react/eslint-plugin': "5.30.4";
|
|
35
|
+
readonly '@juristr/nx-tailwind-sync': "0.0.9";
|
|
36
|
+
readonly '@rolldown/plugin-babel': "0.3.1";
|
|
37
|
+
readonly '@tailwindcss/vite': "4.3.5";
|
|
38
|
+
readonly '@types/react': "19.3.0";
|
|
39
|
+
readonly '@types/react-dom': "19.3.0";
|
|
40
|
+
readonly '@vitejs/plugin-react': "6.3.0";
|
|
41
|
+
readonly 'babel-plugin-react-compiler': "1.0.0";
|
|
42
|
+
readonly 'eslint-plugin-jsx-a11y-x': "0.2.0";
|
|
43
|
+
readonly 'eslint-plugin-react-hooks': "7.1.1";
|
|
44
|
+
readonly 'eslint-plugin-react-you-might-not-need-an-effect': "1.2.0";
|
|
45
|
+
readonly 'prettier-plugin-tailwindcss': "0.8.1";
|
|
46
|
+
readonly react: "19.3.1";
|
|
47
|
+
readonly 'react-dom': "19.3.1";
|
|
48
|
+
readonly 'react-router': "8.5.1";
|
|
49
|
+
readonly tailwindcss: "4.3.5";
|
|
50
|
+
readonly vite: "8.3.8";
|
|
51
|
+
readonly 'vite-plugin-compression2': "2.5.4";
|
|
52
|
+
readonly 'vite-plugin-dts': "5.1.2";
|
|
53
|
+
readonly '@testing-library/dom': "10.4.2";
|
|
54
|
+
readonly '@testing-library/jest-dom': "7.0.1";
|
|
55
|
+
readonly '@testing-library/react': "16.3.3";
|
|
56
|
+
readonly '@vitest/coverage-v8': "5.1.1";
|
|
57
|
+
readonly 'happy-dom': "21.0.4";
|
|
58
|
+
readonly vitest: "5.1.1";
|
|
59
|
+
readonly prisma: "7.10.1";
|
|
60
|
+
readonly '@prisma/client': "7.10.1";
|
|
61
|
+
readonly '@prisma/adapter-pg': "7.10.1";
|
|
62
|
+
readonly pg: "8.23.1";
|
|
63
|
+
readonly '@types/pg': "8.23.1";
|
|
64
|
+
};
|
|
17
65
|
/** The zukhruf packages that the root files load. */
|
|
18
66
|
export declare const zukhrufPackages: string[];
|
|
19
67
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../src/generators/versions.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,SAAS,WAAW,CAAC;AAElC,gJAAgJ;AAChJ,eAAO,MAAM,QAAQ,UAMpB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAcnD,CAAC;AAEF,qDAAqD;AACrD,eAAO,MAAM,eAAe,UAI3B,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../src/generators/versions.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,SAAS,WAAW,CAAC;AAElC,gJAAgJ;AAChJ,eAAO,MAAM,QAAQ,UAMpB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAcnD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDY,CAAC;AAE5C,qDAAqD;AACrD,eAAO,MAAM,eAAe,UAI3B,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAyB,CAAC"}
|
|
@@ -16,7 +16,7 @@ export const nxFamily = [
|
|
|
16
16
|
/**
|
|
17
17
|
* The other root tools, at exact versions. A generator adds a missing one and
|
|
18
18
|
* keeps a version that is there. TypeScript 7 compiles and TypeScript 6 gives
|
|
19
|
-
* its API to typescript-eslint and `@nx/js` (monorepo standard
|
|
19
|
+
* its API to typescript-eslint and `@nx/js` (README, monorepo standard). The ESLint
|
|
20
20
|
* packages are the peers of @zukhruf/eslint that the root config loads, with
|
|
21
21
|
* the 2 of `@zukhruf/eslint/modern-node`.
|
|
22
22
|
*/
|
|
@@ -35,6 +35,66 @@ export const rootToolVersions = {
|
|
|
35
35
|
typescript: 'npm:@typescript/typescript6@6.0.2',
|
|
36
36
|
'typescript-eslint': '8.73.0',
|
|
37
37
|
};
|
|
38
|
+
/**
|
|
39
|
+
* The packages of the app generators, at exact versions, each the latest on
|
|
40
|
+
* 2026-11-18 (#3338). A generator adds a missing package, and keeps a version
|
|
41
|
+
* that was there before it ran. Each `@nx/*` plugin gets `nxVersion`.
|
|
42
|
+
*/
|
|
43
|
+
export const appPackageVersions = {
|
|
44
|
+
// node-app: the runtime of the backend, and its build tools.
|
|
45
|
+
'@godaddy/terminus': '4.12.1',
|
|
46
|
+
'@hono/node-server': '2.1.9',
|
|
47
|
+
'@sdk-it/cli': '0.46.11',
|
|
48
|
+
'@sdk-it/hono': '0.46.11',
|
|
49
|
+
esbuild: '0.28.2',
|
|
50
|
+
// The Nx generators add these two with a range.
|
|
51
|
+
'@types/node': '26.6.6',
|
|
52
|
+
tslib: '2.9.1',
|
|
53
|
+
evlog: '2.35.1',
|
|
54
|
+
hono: '4.13.19',
|
|
55
|
+
zod: '4.6.7',
|
|
56
|
+
// pair: the generated client imports it. sdk-it writes ^3.0.0 in the client
|
|
57
|
+
// manifest, so the web app takes the latest 3.x, not 4.
|
|
58
|
+
'fast-content-type-parse': '3.0.0',
|
|
59
|
+
// react-app and ui-package: React, Vite, Tailwind and the React lint plugins
|
|
60
|
+
// that @zukhruf/eslint/react loads.
|
|
61
|
+
'@eslint-react/eslint-plugin': '5.30.4',
|
|
62
|
+
'@juristr/nx-tailwind-sync': '0.0.9',
|
|
63
|
+
'@rolldown/plugin-babel': '0.3.1',
|
|
64
|
+
'@tailwindcss/vite': '4.3.5',
|
|
65
|
+
'@types/react': '19.3.0',
|
|
66
|
+
'@types/react-dom': '19.3.0',
|
|
67
|
+
'@vitejs/plugin-react': '6.3.0',
|
|
68
|
+
'babel-plugin-react-compiler': '1.0.0',
|
|
69
|
+
'eslint-plugin-jsx-a11y-x': '0.2.0',
|
|
70
|
+
'eslint-plugin-react-hooks': '7.1.1',
|
|
71
|
+
'eslint-plugin-react-you-might-not-need-an-effect': '1.2.0',
|
|
72
|
+
'prettier-plugin-tailwindcss': '0.8.1',
|
|
73
|
+
react: '19.3.1',
|
|
74
|
+
'react-dom': '19.3.1',
|
|
75
|
+
'react-router': '8.5.1',
|
|
76
|
+
tailwindcss: '4.3.5',
|
|
77
|
+
vite: '8.3.8',
|
|
78
|
+
'vite-plugin-compression2': '2.5.4',
|
|
79
|
+
'vite-plugin-dts': '5.1.2',
|
|
80
|
+
// react-app: component tests.
|
|
81
|
+
'@testing-library/dom': '10.4.2',
|
|
82
|
+
'@testing-library/jest-dom': '7.0.1',
|
|
83
|
+
'@testing-library/react': '16.3.3',
|
|
84
|
+
'@vitest/coverage-v8': '5.1.1',
|
|
85
|
+
'happy-dom': '21.0.4',
|
|
86
|
+
vitest: '5.1.1',
|
|
87
|
+
// prisma: the CLI, the client and its Postgres adapter release together and
|
|
88
|
+
// must have one version. The `latest` tag of `prisma` is a release candidate
|
|
89
|
+
// of 8 (8.0.0-rc.34 on 2026-11-18), so the three are pinned to the last
|
|
90
|
+
// stable version, and a test checks that they are equal (#4604).
|
|
91
|
+
prisma: '7.10.1',
|
|
92
|
+
'@prisma/client': '7.10.1',
|
|
93
|
+
'@prisma/adapter-pg': '7.10.1',
|
|
94
|
+
// The test helper of a db package replays the migrations with pg.
|
|
95
|
+
pg: '8.23.1',
|
|
96
|
+
'@types/pg': '8.23.1',
|
|
97
|
+
};
|
|
38
98
|
/** The zukhruf packages that the root files load. */
|
|
39
99
|
export const zukhrufPackages = [
|
|
40
100
|
'@zukhruf/eslint',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versions.js","sourceRoot":"","sources":["../../src/generators/versions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAAC;AAElC,gJAAgJ;AAChJ,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI;IACJ,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;IAC9B,sBAAsB,EAAE,QAAQ;IAChC,2BAA2B,EAAE,OAAO;IACpC,wBAAwB,EAAE,QAAQ;IAClC,qBAAqB,EAAE,OAAO;IAC9B,WAAW,EAAE,QAAQ;IACrB,MAAM,EAAE,OAAO;IACf,4EAA4E;IAC5E,6EAA6E;IAC7E,wEAAwE;IACxE,iEAAiE;IACjE,MAAM,EAAE,QAAQ;IAChB,gBAAgB,EAAE,QAAQ;IAC1B,oBAAoB,EAAE,QAAQ;IAC9B,kEAAkE;IAClE,EAAE,EAAE,QAAQ;IACZ,WAAW,EAAE,QAAQ;CACoB,CAAC;AAE5C,qDAAqD;AACrD,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,iBAAiB;IACjB,oBAAoB;IACpB,aAAa;CACd,CAAC;AAEF,MAAM,cAAc,GAAwB,IAAI,CAAC,KAAK,CACpD,YAAY,CAAC,IAAI,GAAG,CAAC,oBAAoB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CACtE,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC"}
|
package/generators.json
CHANGED
|
@@ -9,6 +9,36 @@
|
|
|
9
9
|
"implementation": "./dist/generators/init/generator.js",
|
|
10
10
|
"schema": "./src/generators/init/schema.json",
|
|
11
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."
|
|
12
42
|
}
|
|
13
43
|
}
|
|
14
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",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"terraform",
|
|
30
30
|
"prisma",
|
|
31
31
|
"generator",
|
|
32
|
-
"preset"
|
|
32
|
+
"preset",
|
|
33
|
+
"dokploy"
|
|
33
34
|
],
|
|
34
35
|
"type": "module",
|
|
35
36
|
"exports": {
|
|
@@ -79,11 +80,29 @@
|
|
|
79
80
|
},
|
|
80
81
|
"peerDependencies": {
|
|
81
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",
|
|
82
87
|
"nx": ">=23.2.1 <25.0.0",
|
|
83
88
|
"prettier": "^3.0.0"
|
|
84
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
|
+
},
|
|
85
104
|
"devDependencies": {
|
|
86
|
-
"@zukhruf/fs": "^0.8.
|
|
87
|
-
"@zukhruf/testing": "^0.8.
|
|
105
|
+
"@zukhruf/fs": "^0.8.31",
|
|
106
|
+
"@zukhruf/testing": "^0.8.31"
|
|
88
107
|
}
|
|
89
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
|
+
}
|