@zukhruf/nx 0.8.39 → 0.8.41
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 +54 -32
- package/dist/generators/auth/files.d.ts +2 -2
- package/dist/generators/auth/files.d.ts.map +1 -1
- package/dist/generators/auth/files.js +21 -20
- package/dist/generators/auth/files.js.map +1 -1
- package/dist/generators/auth/generator.d.ts.map +1 -1
- package/dist/generators/auth/generator.js +13 -17
- package/dist/generators/auth/generator.js.map +1 -1
- package/dist/generators/dokploy/files.d.ts.map +1 -1
- package/dist/generators/dokploy/files.js +16 -1
- package/dist/generators/dokploy/files.js.map +1 -1
- package/dist/generators/env-file.d.ts +8 -0
- package/dist/generators/env-file.d.ts.map +1 -0
- package/dist/generators/env-file.js +13 -0
- package/dist/generators/env-file.js.map +1 -0
- package/dist/generators/init/files.js +2 -2
- package/dist/generators/init/nx-json.d.ts +7 -0
- package/dist/generators/init/nx-json.d.ts.map +1 -1
- package/dist/generators/init/nx-json.js +19 -1
- package/dist/generators/init/nx-json.js.map +1 -1
- package/dist/generators/node-app/files.d.ts +3 -3
- package/dist/generators/node-app/files.d.ts.map +1 -1
- package/dist/generators/node-app/files.js +48 -35
- package/dist/generators/node-app/files.js.map +1 -1
- package/dist/generators/node-app/generator.d.ts.map +1 -1
- package/dist/generators/node-app/generator.js +32 -36
- package/dist/generators/node-app/generator.js.map +1 -1
- package/dist/generators/pair/files.d.ts +11 -2
- package/dist/generators/pair/files.d.ts.map +1 -1
- package/dist/generators/pair/files.js +51 -34
- package/dist/generators/pair/files.js.map +1 -1
- package/dist/generators/pair/generator.d.ts.map +1 -1
- package/dist/generators/pair/generator.js +22 -8
- package/dist/generators/pair/generator.js.map +1 -1
- package/dist/generators/portless-env.d.ts +14 -0
- package/dist/generators/portless-env.d.ts.map +1 -0
- package/dist/generators/portless-env.js +26 -0
- package/dist/generators/portless-env.js.map +1 -0
- package/dist/generators/prisma/files.d.ts.map +1 -1
- package/dist/generators/prisma/files.js +2 -0
- package/dist/generators/prisma/files.js.map +1 -1
- package/dist/generators/prisma/generator.d.ts +35 -1
- package/dist/generators/prisma/generator.d.ts.map +1 -1
- package/dist/generators/prisma/generator.js +57 -36
- package/dist/generators/prisma/generator.js.map +1 -1
- package/dist/generators/react-app/generator.js +10 -20
- package/dist/generators/react-app/generator.js.map +1 -1
- package/dist/generators/ui-package/files.d.ts.map +1 -1
- package/dist/generators/ui-package/files.js +7 -8
- package/dist/generators/ui-package/files.js.map +1 -1
- package/dist/generators/ui-package/generator.d.ts.map +1 -1
- package/dist/generators/ui-package/generator.js +3 -1
- package/dist/generators/ui-package/generator.js.map +1 -1
- package/dist/migrations/update-0-8-40/add-local-postgres.d.ts +14 -0
- package/dist/migrations/update-0-8-40/add-local-postgres.d.ts.map +1 -0
- package/dist/migrations/update-0-8-40/add-local-postgres.js +125 -0
- package/dist/migrations/update-0-8-40/add-local-postgres.js.map +1 -0
- package/dist/migrations/update-0-8-40/add-portless-proxy-env.d.ts +9 -0
- package/dist/migrations/update-0-8-40/add-portless-proxy-env.d.ts.map +1 -0
- package/dist/migrations/update-0-8-40/add-portless-proxy-env.js +21 -0
- package/dist/migrations/update-0-8-40/add-portless-proxy-env.js.map +1 -0
- package/dist/migrations/update-0-8-40/add-prisma-client-inputs.d.ts +11 -0
- package/dist/migrations/update-0-8-40/add-prisma-client-inputs.d.ts.map +1 -0
- package/dist/migrations/update-0-8-40/add-prisma-client-inputs.js +20 -0
- package/dist/migrations/update-0-8-40/add-prisma-client-inputs.js.map +1 -0
- package/dist/migrations/update-0-8-40/node-env-production.d.ts +13 -0
- package/dist/migrations/update-0-8-40/node-env-production.d.ts.map +1 -0
- package/dist/migrations/update-0-8-40/node-env-production.js +189 -0
- package/dist/migrations/update-0-8-40/node-env-production.js.map +1 -0
- package/dist/migrations/workspace.d.ts +31 -0
- package/dist/migrations/workspace.d.ts.map +1 -0
- package/dist/migrations/workspace.js +53 -0
- package/dist/migrations/workspace.js.map +1 -0
- package/migrations.json +24 -0
- package/package.json +51 -3
- package/release.json +30 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { isDeepStrictEqual } from 'node:util';
|
|
2
|
+
import { getProjects, joinPathFragments, readJson, visitNotIgnoredFiles, writeJson, } from '@nx/devkit';
|
|
3
|
+
import { pluginName } from "../generators/init/nx-json.js";
|
|
4
|
+
/**
|
|
5
|
+
* Changes a JSON file of the Tree only when `update` changes its value, so a
|
|
6
|
+
* second run writes nothing, and a file whose keys are in another order keeps
|
|
7
|
+
* its text. `update` changes the value it gets.
|
|
8
|
+
*/
|
|
9
|
+
export function updateJsonIfChanged(tree, path, update) {
|
|
10
|
+
const before = readJson(tree, path);
|
|
11
|
+
const after = structuredClone(before);
|
|
12
|
+
update(after);
|
|
13
|
+
if (!isDeepStrictEqual(before, after))
|
|
14
|
+
writeJson(tree, path, after);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The root of each project that holds `marker`, the file a generator leaves
|
|
18
|
+
* in the projects of its kind: `sdk-it.config.ts` for a node-app and
|
|
19
|
+
* `prisma.config.ts` for a db package. Only a project root with a package.json
|
|
20
|
+
* counts, because the generators write their targets there.
|
|
21
|
+
*/
|
|
22
|
+
export function projectRootsWith(tree, marker) {
|
|
23
|
+
return [...getProjects(tree).values()]
|
|
24
|
+
.map((project) => project.root)
|
|
25
|
+
.filter((root) => tree.exists(joinPathFragments(root, marker)) &&
|
|
26
|
+
tree.exists(joinPathFragments(root, 'package.json')))
|
|
27
|
+
.toSorted();
|
|
28
|
+
}
|
|
29
|
+
/** Whether nx.json registers the plugin, for example `@nx/vite/plugin`. */
|
|
30
|
+
export function hasPlugin(tree, plugin) {
|
|
31
|
+
if (!tree.exists('nx.json'))
|
|
32
|
+
return false;
|
|
33
|
+
const { plugins = [] } = readJson(tree, 'nx.json');
|
|
34
|
+
return plugins.some((entry) => pluginName(entry) === plugin);
|
|
35
|
+
}
|
|
36
|
+
const SOURCE = /\.[cm]?[jt]sx?$/;
|
|
37
|
+
/** Each source file under `directory` that Git does not ignore, `.ts`, `.tsx`, `.js`, `.mjs` and the like. */
|
|
38
|
+
export function sourceFiles(tree, directory = '') {
|
|
39
|
+
const files = [];
|
|
40
|
+
visitNotIgnoredFiles(tree, directory, (path) => {
|
|
41
|
+
if (SOURCE.test(path))
|
|
42
|
+
files.push(path);
|
|
43
|
+
});
|
|
44
|
+
return files.toSorted();
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The value of `KEY` in an env file: undefined when the file has no line for
|
|
48
|
+
* the key, and `''` for `KEY=`.
|
|
49
|
+
*/
|
|
50
|
+
export function envValue(content, key) {
|
|
51
|
+
return new RegExp(`^${key}=(.*)$`, 'm').exec(content)?.[1];
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=workspace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../src/migrations/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAIL,WAAW,EACX,iBAAiB,EACjB,QAAQ,EACR,oBAAoB,EACpB,SAAS,GACV,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAQ3D;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,IAAU,EACV,IAAY,EACZ,MAA0B;IAE1B,MAAM,MAAM,GAAG,QAAQ,CAAI,IAAI,EAAE,IAAI,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IACtC,MAAM,CAAC,KAAK,CAAC,CAAC;IACd,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,KAAK,CAAC;QAAE,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AACtE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC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AAI,MAAM,CAAC,IAAI,GAAG,QAAQ,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC"}
|
package/migrations.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"generators": {
|
|
3
|
+
"add-portless-proxy-env": {
|
|
4
|
+
"version": "0.8.40",
|
|
5
|
+
"description": "The portless proxy starts unprivileged on HTTPS: targetDefaults.portless gets PORTLESS_UNPRIVILEGED=1 and PORTLESS_HTTPS=1 (#4768).",
|
|
6
|
+
"implementation": "./dist/migrations/update-0-8-40/add-portless-proxy-env.js"
|
|
7
|
+
},
|
|
8
|
+
"add-local-postgres": {
|
|
9
|
+
"version": "0.8.40",
|
|
10
|
+
"description": "A db package gets the local Postgres of a root compose.dev.yml, its up and down targets, the local CONNECTION_STRING, and ^up in its backend's serve (ADR 0012 decisions 16 and 17).",
|
|
11
|
+
"implementation": "./dist/migrations/update-0-8-40/add-local-postgres.js"
|
|
12
|
+
},
|
|
13
|
+
"node-env-production": {
|
|
14
|
+
"version": "0.8.40",
|
|
15
|
+
"description": "NODE_ENV is production in every setup and code never reads it: the configuration of ADR 0016, and a log of each NODE_ENV read in source.",
|
|
16
|
+
"implementation": "./dist/migrations/update-0-8-40/node-env-production.js"
|
|
17
|
+
},
|
|
18
|
+
"add-prisma-client-inputs": {
|
|
19
|
+
"version": "0.8.40",
|
|
20
|
+
"description": "A repo with @zukhruf/nx/prisma hashes the generated Prisma client: targetDefaults.typecheck and .build get the inputs \"...\" and { \"dependentTasksOutputFiles\": \"**/*.ts\" } (#4826, ADR 0012 decision 6).",
|
|
21
|
+
"implementation": "./dist/migrations/update-0-8-40/add-prisma-client-inputs.js"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zukhruf/nx",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.41",
|
|
4
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": {
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"type": "module",
|
|
36
36
|
"exports": {
|
|
37
37
|
"./package.json": "./package.json",
|
|
38
|
+
"./release.json": "./release.json",
|
|
38
39
|
"./format": {
|
|
39
40
|
"@zukhruf/source": "./src/format/plugin.ts",
|
|
40
41
|
"types": "./dist/format/plugin.d.ts",
|
|
@@ -67,9 +68,55 @@
|
|
|
67
68
|
}
|
|
68
69
|
},
|
|
69
70
|
"generators": "./generators.json",
|
|
71
|
+
"nx-migrations": {
|
|
72
|
+
"migrations": "./migrations.json",
|
|
73
|
+
"packageGroup": [
|
|
74
|
+
"@zukhruf/async",
|
|
75
|
+
"@zukhruf/authentication",
|
|
76
|
+
"@zukhruf/coprocess",
|
|
77
|
+
"@zukhruf/diagram",
|
|
78
|
+
"@zukhruf/docker",
|
|
79
|
+
"@zukhruf/election",
|
|
80
|
+
"@zukhruf/embedding-cache",
|
|
81
|
+
"@zukhruf/embeddings",
|
|
82
|
+
"@zukhruf/eslint",
|
|
83
|
+
"@zukhruf/evals",
|
|
84
|
+
"@zukhruf/event-detection",
|
|
85
|
+
"@zukhruf/fencing",
|
|
86
|
+
"@zukhruf/fs",
|
|
87
|
+
"@zukhruf/git-hooks",
|
|
88
|
+
"@zukhruf/launchd",
|
|
89
|
+
"@zukhruf/lease",
|
|
90
|
+
"@zukhruf/mutex",
|
|
91
|
+
"@zukhruf/pipes",
|
|
92
|
+
"@zukhruf/pool",
|
|
93
|
+
"@zukhruf/python",
|
|
94
|
+
"@zukhruf/relevance-filtering",
|
|
95
|
+
"@zukhruf/shadcn",
|
|
96
|
+
"@zukhruf/shutdown",
|
|
97
|
+
"@zukhruf/single-flight",
|
|
98
|
+
"@zukhruf/snapshot-differential",
|
|
99
|
+
"@zukhruf/sqlite-changefeed",
|
|
100
|
+
"@zukhruf/sqlite-data-version",
|
|
101
|
+
"@zukhruf/sqlite-drift",
|
|
102
|
+
"@zukhruf/sqlite-federation",
|
|
103
|
+
"@zukhruf/sqlite-notify",
|
|
104
|
+
"@zukhruf/sqlite-open",
|
|
105
|
+
"@zukhruf/sqlite-queue",
|
|
106
|
+
"@zukhruf/sqlite-snapshot",
|
|
107
|
+
"@zukhruf/sqlite-transaction",
|
|
108
|
+
"@zukhruf/ssh",
|
|
109
|
+
"@zukhruf/statistics",
|
|
110
|
+
"@zukhruf/testing",
|
|
111
|
+
"@zukhruf/ui",
|
|
112
|
+
"@zukhruf/vectors"
|
|
113
|
+
]
|
|
114
|
+
},
|
|
70
115
|
"files": [
|
|
71
116
|
"dist",
|
|
72
117
|
"generators.json",
|
|
118
|
+
"migrations.json",
|
|
119
|
+
"release.json",
|
|
73
120
|
"src/generators/*/schema.json",
|
|
74
121
|
"!dist/spec/**",
|
|
75
122
|
"!**/*.tsbuildinfo",
|
|
@@ -102,7 +149,8 @@
|
|
|
102
149
|
}
|
|
103
150
|
},
|
|
104
151
|
"devDependencies": {
|
|
105
|
-
"@zukhruf/
|
|
106
|
-
"@zukhruf/
|
|
152
|
+
"@zukhruf/eslint": "^0.8.41",
|
|
153
|
+
"@zukhruf/fs": "^0.8.41",
|
|
154
|
+
"@zukhruf/testing": "^0.8.41"
|
|
107
155
|
}
|
|
108
156
|
}
|
package/release.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"release": {
|
|
3
|
+
"projects": ["tag:npm:public"],
|
|
4
|
+
"conventionalCommits": {
|
|
5
|
+
"types": {
|
|
6
|
+
"refactor": {
|
|
7
|
+
"semverBump": "patch"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"changelog": {
|
|
12
|
+
"workspaceChangelog": {
|
|
13
|
+
"file": false
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"version": {
|
|
17
|
+
"preVersionCommand": "nx run-many -t build --projects=tag:npm:public",
|
|
18
|
+
"conventionalCommits": true,
|
|
19
|
+
"preserveMatchingDependencyRanges": false,
|
|
20
|
+
"git": {
|
|
21
|
+
"commit": true,
|
|
22
|
+
"tag": true,
|
|
23
|
+
"push": true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"releaseTag": {
|
|
27
|
+
"pattern": "release/{version}"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|