@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.
Files changed (133) hide show
  1. package/README.md +825 -9
  2. package/dist/generators/add-keys.d.ts +7 -0
  3. package/dist/generators/add-keys.d.ts.map +1 -0
  4. package/dist/generators/add-keys.js +14 -0
  5. package/dist/generators/add-keys.js.map +1 -0
  6. package/dist/generators/add-lines.d.ts +8 -0
  7. package/dist/generators/add-lines.d.ts.map +1 -0
  8. package/dist/generators/add-lines.js +21 -0
  9. package/dist/generators/add-lines.js.map +1 -0
  10. package/dist/generators/app-directory.d.ts +17 -0
  11. package/dist/generators/app-directory.d.ts.map +1 -0
  12. package/dist/generators/app-directory.js +34 -0
  13. package/dist/generators/app-directory.js.map +1 -0
  14. package/dist/generators/dokploy/files.d.ts +21 -0
  15. package/dist/generators/dokploy/files.d.ts.map +1 -0
  16. package/dist/generators/dokploy/files.js +755 -0
  17. package/dist/generators/dokploy/files.js.map +1 -0
  18. package/dist/generators/dokploy/generator.d.ts +75 -0
  19. package/dist/generators/dokploy/generator.d.ts.map +1 -0
  20. package/dist/generators/dokploy/generator.js +139 -0
  21. package/dist/generators/dokploy/generator.js.map +1 -0
  22. package/dist/generators/dokploy/providers.d.ts +15 -0
  23. package/dist/generators/dokploy/providers.d.ts.map +1 -0
  24. package/dist/generators/dokploy/providers.js +114 -0
  25. package/dist/generators/dokploy/providers.js.map +1 -0
  26. package/dist/generators/init/files.d.ts +81 -0
  27. package/dist/generators/init/files.d.ts.map +1 -0
  28. package/dist/generators/init/files.js +278 -0
  29. package/dist/generators/init/files.js.map +1 -0
  30. package/dist/generators/init/generator.d.ts +8 -0
  31. package/dist/generators/init/generator.d.ts.map +1 -0
  32. package/dist/generators/init/generator.js +72 -0
  33. package/dist/generators/init/generator.js.map +1 -0
  34. package/dist/generators/init/nx-json.d.ts +20 -0
  35. package/dist/generators/init/nx-json.d.ts.map +1 -0
  36. package/dist/generators/init/nx-json.js +126 -0
  37. package/dist/generators/init/nx-json.js.map +1 -0
  38. package/dist/generators/init/root-package-json.d.ts +25 -0
  39. package/dist/generators/init/root-package-json.d.ts.map +1 -0
  40. package/dist/generators/init/root-package-json.js +49 -0
  41. package/dist/generators/init/root-package-json.js.map +1 -0
  42. package/dist/generators/node-app/files.d.ts +43 -0
  43. package/dist/generators/node-app/files.d.ts.map +1 -0
  44. package/dist/generators/node-app/files.js +522 -0
  45. package/dist/generators/node-app/files.js.map +1 -0
  46. package/dist/generators/node-app/generator.d.ts +17 -0
  47. package/dist/generators/node-app/generator.d.ts.map +1 -0
  48. package/dist/generators/node-app/generator.js +319 -0
  49. package/dist/generators/node-app/generator.js.map +1 -0
  50. package/dist/generators/nx-plugin.d.ts +16 -0
  51. package/dist/generators/nx-plugin.d.ts.map +1 -0
  52. package/dist/generators/nx-plugin.js +27 -0
  53. package/dist/generators/nx-plugin.js.map +1 -0
  54. package/dist/generators/pair/files.d.ts +4 -0
  55. package/dist/generators/pair/files.d.ts.map +1 -0
  56. package/dist/generators/pair/files.js +73 -0
  57. package/dist/generators/pair/files.js.map +1 -0
  58. package/dist/generators/pair/generator.d.ts +19 -0
  59. package/dist/generators/pair/generator.d.ts.map +1 -0
  60. package/dist/generators/pair/generator.js +70 -0
  61. package/dist/generators/pair/generator.js.map +1 -0
  62. package/dist/generators/preset/generator.d.ts +14 -0
  63. package/dist/generators/preset/generator.d.ts.map +1 -0
  64. package/dist/generators/preset/generator.js +43 -0
  65. package/dist/generators/preset/generator.js.map +1 -0
  66. package/dist/generators/prisma/files.d.ts +20 -0
  67. package/dist/generators/prisma/files.d.ts.map +1 -0
  68. package/dist/generators/prisma/files.js +183 -0
  69. package/dist/generators/prisma/files.js.map +1 -0
  70. package/dist/generators/prisma/generator.d.ts +17 -0
  71. package/dist/generators/prisma/generator.d.ts.map +1 -0
  72. package/dist/generators/prisma/generator.js +258 -0
  73. package/dist/generators/prisma/generator.js.map +1 -0
  74. package/dist/generators/react-app/files.d.ts +7 -0
  75. package/dist/generators/react-app/files.d.ts.map +1 -0
  76. package/dist/generators/react-app/files.js +188 -0
  77. package/dist/generators/react-app/files.js.map +1 -0
  78. package/dist/generators/react-app/generator.d.ts +12 -0
  79. package/dist/generators/react-app/generator.d.ts.map +1 -0
  80. package/dist/generators/react-app/generator.js +242 -0
  81. package/dist/generators/react-app/generator.js.map +1 -0
  82. package/dist/generators/react.d.ts +29 -0
  83. package/dist/generators/react.d.ts.map +1 -0
  84. package/dist/generators/react.js +64 -0
  85. package/dist/generators/react.js.map +1 -0
  86. package/dist/generators/root-dependencies.d.ts +21 -0
  87. package/dist/generators/root-dependencies.d.ts.map +1 -0
  88. package/dist/generators/root-dependencies.js +56 -0
  89. package/dist/generators/root-dependencies.js.map +1 -0
  90. package/dist/generators/ui-package/files.d.ts +37 -0
  91. package/dist/generators/ui-package/files.d.ts.map +1 -0
  92. package/dist/generators/ui-package/files.js +118 -0
  93. package/dist/generators/ui-package/files.js.map +1 -0
  94. package/dist/generators/ui-package/generator.d.ts +14 -0
  95. package/dist/generators/ui-package/generator.d.ts.map +1 -0
  96. package/dist/generators/ui-package/generator.js +111 -0
  97. package/dist/generators/ui-package/generator.js.map +1 -0
  98. package/dist/generators/versions.d.ts +72 -0
  99. package/dist/generators/versions.d.ts.map +1 -0
  100. package/dist/generators/versions.js +110 -0
  101. package/dist/generators/versions.js.map +1 -0
  102. package/dist/generators/workspace-scope.d.ts +8 -0
  103. package/dist/generators/workspace-scope.d.ts.map +1 -0
  104. package/dist/generators/workspace-scope.js +15 -0
  105. package/dist/generators/workspace-scope.js.map +1 -0
  106. package/dist/opentofu/check-plan-fresh.d.ts +2 -0
  107. package/dist/opentofu/check-plan-fresh.d.ts.map +1 -0
  108. package/dist/opentofu/check-plan-fresh.js +47 -0
  109. package/dist/opentofu/check-plan-fresh.js.map +1 -0
  110. package/dist/opentofu/plugin.d.ts +9 -0
  111. package/dist/opentofu/plugin.d.ts.map +1 -0
  112. package/dist/opentofu/plugin.js +108 -0
  113. package/dist/opentofu/plugin.js.map +1 -0
  114. package/dist/prisma/plugin.d.ts +9 -0
  115. package/dist/prisma/plugin.d.ts.map +1 -0
  116. package/dist/prisma/plugin.js +83 -0
  117. package/dist/prisma/plugin.js.map +1 -0
  118. package/dist/project-roots.d.ts +5 -0
  119. package/dist/project-roots.d.ts.map +1 -1
  120. package/dist/project-roots.js +10 -0
  121. package/dist/project-roots.js.map +1 -1
  122. package/dist/test/plugin.js +1 -7
  123. package/dist/test/plugin.js.map +1 -1
  124. package/generators.json +44 -0
  125. package/package.json +44 -5
  126. package/src/generators/dokploy/schema.json +48 -0
  127. package/src/generators/init/schema.json +8 -0
  128. package/src/generators/node-app/schema.json +22 -0
  129. package/src/generators/pair/schema.json +18 -0
  130. package/src/generators/preset/schema.json +18 -0
  131. package/src/generators/prisma/schema.json +21 -0
  132. package/src/generators/react-app/schema.json +17 -0
  133. 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,gBA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,EAAE;YACjB,OAAO,EAAE;gBACP,GAAG,WAAW,CAAC,EAAE,EAAE,OAAO;gBAC1B,kEAAkE;gBAClE,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE;aACtC;SACF,CAAC;QACF,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC,CAAC;IAEH,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE;QACnC,eAAe,EAAE,iBAAiB;QAClC,sEAAsE;QACtE,0DAA0D;QAC1D,OAAO,EAAE;YACP,GAAG,YAAY;YACf,aAAa;YACb,qBAAqB;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"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * The one exact version of `nx` and each `@nx/*` that a generator writes. A
3
+ * generator sets it also over another version, so npm installs one `nx`
4
+ * (#4532). An update is a release of @zukhruf/nx.
5
+ */
6
+ export declare const nxVersion = "24.0.6";
7
+ /** The Nx packages that the root files load: `@nx/js/typescript`, `@nx/eslint/plugin`, the root ESLint config, and the peers of @zukhruf/nx. */
8
+ export declare const nxFamily: string[];
9
+ /**
10
+ * The other root tools, at exact versions. A generator adds a missing one and
11
+ * keeps a version that is there. TypeScript 7 compiles and TypeScript 6 gives
12
+ * its API to typescript-eslint and `@nx/js` (README, monorepo standard). The ESLint
13
+ * packages are the peers of @zukhruf/eslint that the root config loads, with
14
+ * the 2 of `@zukhruf/eslint/modern-node`.
15
+ */
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
+ };
65
+ /** The zukhruf packages that the root files load. */
66
+ export declare const zukhrufPackages: string[];
67
+ /**
68
+ * The version of this package. nx release gives each public package of zukhruf
69
+ * the same version, so it is also the version of each zukhruf package.
70
+ */
71
+ export declare const zukhrufVersion: string;
72
+ //# sourceMappingURL=versions.d.ts.map
@@ -0,0 +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;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsDY,CAAC;AAE5C,qDAAqD;AACrD,eAAO,MAAM,eAAe,UAI3B,CAAC;AAMF;;;GAGG;AACH,eAAO,MAAM,cAAc,QAAyB,CAAC"}
@@ -0,0 +1,110 @@
1
+ import { readFileSync } from 'node:fs';
2
+ /**
3
+ * The one exact version of `nx` and each `@nx/*` that a generator writes. A
4
+ * generator sets it also over another version, so npm installs one `nx`
5
+ * (#4532). An update is a release of @zukhruf/nx.
6
+ */
7
+ export const nxVersion = '24.0.6';
8
+ /** The Nx packages that the root files load: `@nx/js/typescript`, `@nx/eslint/plugin`, the root ESLint config, and the peers of @zukhruf/nx. */
9
+ export const nxFamily = [
10
+ 'nx',
11
+ '@nx/devkit',
12
+ '@nx/eslint',
13
+ '@nx/eslint-plugin',
14
+ '@nx/js',
15
+ ];
16
+ /**
17
+ * The other root tools, at exact versions. A generator adds a missing one and
18
+ * keeps a version that is there. TypeScript 7 compiles and TypeScript 6 gives
19
+ * its API to typescript-eslint and `@nx/js` (README, monorepo standard). The ESLint
20
+ * packages are the peers of @zukhruf/eslint that the root config loads, with
21
+ * the 2 of `@zukhruf/eslint/modern-node`.
22
+ */
23
+ export const rootToolVersions = {
24
+ '@e18e/eslint-plugin': '0.8.1',
25
+ '@eslint/js': '10.0.1',
26
+ '@trivago/prettier-plugin-sort-imports': '6.0.2',
27
+ '@typescript/native': 'npm:typescript@7.0.2',
28
+ eslint: '10.15.0',
29
+ 'eslint-plugin-functional': '10.0.1',
30
+ 'eslint-plugin-import-x': '4.18.1',
31
+ // @zukhruf/eslint peers on ^79.0.0.
32
+ 'eslint-plugin-unicorn': '79.0.0',
33
+ 'jsonc-eslint-parser': '3.3.0',
34
+ prettier: '3.10.1',
35
+ typescript: 'npm:@typescript/typescript6@6.0.2',
36
+ 'typescript-eslint': '8.73.0',
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
+ };
98
+ /** The zukhruf packages that the root files load. */
99
+ export const zukhrufPackages = [
100
+ '@zukhruf/eslint',
101
+ '@zukhruf/git-hooks',
102
+ '@zukhruf/nx',
103
+ ];
104
+ const ownPackageJson = JSON.parse(readFileSync(new URL('../../package.json', import.meta.url), 'utf-8'));
105
+ /**
106
+ * The version of this package. nx release gives each public package of zukhruf
107
+ * the same version, so it is also the version of each zukhruf package.
108
+ */
109
+ export const zukhrufVersion = ownPackageJson.version;
110
+ //# sourceMappingURL=versions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../src/generators/versions.ts"],"names":[],"mappings":"AAAA,OAAO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AsB,EAAE,OAAO;IAC/B,6BAA6B,EAAE,OAAO;IACtC,0BAA0B,EAAE,OAAO;IACnC,2BAA2B,EAAE,OAAO;IACpC,kDAAkD,EAAE,OAAO;IAC3D,6BAA6B,EAAE,OAAO;IACtC,KAAK,EAAE,QAAQ;IACf,WAAW,EAAE,QAAQ;IACrB,cAAc,EAAE,OAAO;IACvB,WAAW,EAAE,OAAO;IACpB,IAAI,EAAE,OAAO;IACb,0BAA0B,EAAE,OAAO;IACnC,iBAAiB,EAAE,OAAO;IAC1B,8BAA8B;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"}
@@ -0,0 +1,8 @@
1
+ import { type Tree } from '@nx/devkit';
2
+ /**
3
+ * The workspace scope: `acme` for the root package name `@acme/source`. It
4
+ * stops with an error for a name with no scope, so no generator writes the
5
+ * scope of another repo (#4080).
6
+ */
7
+ export declare function workspaceScope(tree: Tree): string;
8
+ //# sourceMappingURL=workspace-scope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-scope.d.ts","sourceRoot":"","sources":["../../src/generators/workspace-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,EAAY,MAAM,YAAY,CAAC;AAEjD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CASjD"}
@@ -0,0 +1,15 @@
1
+ import { readJson } from '@nx/devkit';
2
+ /**
3
+ * The workspace scope: `acme` for the root package name `@acme/source`. It
4
+ * stops with an error for a name with no scope, so no generator writes the
5
+ * scope of another repo (#4080).
6
+ */
7
+ export function workspaceScope(tree) {
8
+ const { name } = readJson(tree, 'package.json');
9
+ const scope = /^@([^/]+)\//.exec(name ?? '')?.[1];
10
+ if (scope === undefined) {
11
+ throw new Error(`The root package name ${JSON.stringify(name ?? null)} has no scope. Name it "@<scope>/source" in package.json, for example "@acme/source", and run the generator again.`);
12
+ }
13
+ return scope;
14
+ }
15
+ //# sourceMappingURL=workspace-scope.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-scope.js","sourceRoot":"","sources":["../../src/generators/workspace-scope.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEjD;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,IAAU;IACvC,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAoB,IAAI,EAAE,cAAc,CAAC,CAAC;IACnE,MAAM,KAAK,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,yBAAyB,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,IAAI,CAAC,oHAAoH,CAC1K,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=check-plan-fresh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-plan-fresh.d.ts","sourceRoot":"","sources":["../../src/opentofu/check-plan-fresh.ts"],"names":[],"mappings":""}
@@ -0,0 +1,47 @@
1
+ // The freshness check that the `show` target of `@zukhruf/nx/opentofu` runs
2
+ // in an environment folder: `node check-plan-fresh.js <project root>`. It
3
+ // stops when the environment has no `tfplan`, or when a file of the project
4
+ // changed after `preview` wrote the plan. A file of the project is one that
5
+ // Git tracks or does not ignore, so `.terraform`, `.env` and the other plans
6
+ // do not count.
7
+ import { execFileSync } from 'node:child_process';
8
+ import { stat } from 'node:fs/promises';
9
+ import { basename } from 'node:path';
10
+ const [projectRoot = '.'] = process.argv.slice(2);
11
+ async function modified(path) {
12
+ try {
13
+ return (await stat(path)).mtimeMs;
14
+ }
15
+ catch (error) {
16
+ if (Error.isError(error) && 'code' in error && error.code === 'ENOENT') {
17
+ return undefined;
18
+ }
19
+ throw error;
20
+ }
21
+ }
22
+ const planned = await modified('tfplan');
23
+ if (planned === undefined) {
24
+ console.error(`${process.cwd()} has no tfplan. Run the preview target of this project first.`);
25
+ process.exit(1);
26
+ }
27
+ // Paths come back relative to the working folder, so each one can be read
28
+ // from here.
29
+ const files = execFileSync('git', [
30
+ 'ls-files',
31
+ '-z',
32
+ '--cached',
33
+ '--others',
34
+ '--exclude-standard',
35
+ '--',
36
+ projectRoot,
37
+ ], { encoding: 'utf8' })
38
+ .split('\0')
39
+ .filter((file) => file !== '' && basename(file) !== 'tfplan');
40
+ for (const file of new Set(files)) {
41
+ const changed = await modified(file);
42
+ if (changed === undefined || changed > planned) {
43
+ console.error(`tfplan is stale: ${file} ${changed === undefined ? 'was deleted' : 'changed'} after preview wrote the plan. Run preview again, then show.`);
44
+ process.exit(1);
45
+ }
46
+ }
47
+ //# sourceMappingURL=check-plan-fresh.js.map
@@ -0,0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AE,MAAM,EAAE,CACrB;KACE,KAAK,CAAC,IAAI,CAAC;KACX,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,QAAQ,CAAC,CAAC;AAEhE,KAAK,MAAM,IAAI,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;IAClC,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,GAAG,OAAO,EAAE,CAAC;QAC/C,OAAO,CAAC,KAAK,CACX,oBAAoB,IAAI,IAAI,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,8DAA8D,CAC5I,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { type CreateNodes } from '@nx/devkit';
2
+ /**
3
+ * Gives the OpenTofu targets to each project root with environments: folders
4
+ * `src/environments/<name>` with `*.tf` files. The checks need no secret; the
5
+ * targets that read the encrypted state guard the passphrase. No `apply`: CI
6
+ * applies.
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/opentofu/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,YAAY,CAAC;AAmBpB;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,WA4CzB,CAAC"}