@zukhruf/nx 0.8.63 → 0.8.64

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 CHANGED
@@ -292,14 +292,13 @@ The 2026-10-29 audit of the 7 repos measured the effect. The rule matches each `
292
292
 
293
293
  ### What the test target runs
294
294
 
295
- | Part | Value |
296
- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
297
- | Command | `node --test --no-warnings --test-timeout=<timeout> <flags> --test-reporter=spec --test-reporter-destination=stdout --test-reporter=junit --test-reporter-destination=test-results.xml {args}` |
298
- | `cwd` | `{projectRoot}` |
299
- | `args` | the test selection (see below) |
300
- | `outputs` | `["{projectRoot}/test-results.xml"]` |
301
- | `cache` | `false` |
302
- | `dependsOn` | `["^build"]` |
295
+ | Part | Value |
296
+ | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
297
+ | Command | `node "<run.js>" --test --no-warnings --test-timeout=<timeout> <flags> --test-reporter=spec --test-reporter-destination=stdout --test-reporter=junit --test-reporter-destination=test-results.xml --selection="<glob>"… {args}` |
298
+ | `cwd` | `{projectRoot}` |
299
+ | `outputs` | `["{projectRoot}/test-results.xml"]` |
300
+ | `cache` | `false` |
301
+ | `dependsOn` | `["^build"]` |
303
302
 
304
303
  - `--no-warnings`: 5 of the 7 repos use it.
305
304
  - `--test-timeout`: the default is 300 s. `@zukhruf/testing` starts a shared database server the first time that a test calls `database()`, and it sets a time limit for each cold start: Postgres 60 s, MySQL and MariaDB 90 s, SQL Server 180 s. In a run, the first call of a test process also holds the reaper of the run, with a readiness bound of 60 s. One test can pay both in a row, so its own time limit must be longer than their sum. 300 s is the hold, 60 s, plus the slowest server, SQL Server 180 s, plus 60 s for the work of the test. The old default, 60 s, stopped a test before the readiness bound: on 2026-10-30 a MySQL test of text2sql and the SQL Server tests of deepagents stopped at 60 s. When `@zukhruf/testing` changes a readiness bound, change this default with it. A repo that wants a shorter limit sets the `timeout` option. One project sets `--test-timeout` in its `args`. No time limit is drift. See [ADR 0004](./docs/adr/0004-node-test-target-from-test-files.md).
@@ -318,34 +317,28 @@ Thus a file outside these globs does not run, for example a build output or a `t
318
317
 
319
318
  ### Run one file or one test
320
319
 
321
- `--args` replaces the test selection. Use it to run one file:
320
+ `<run.js>` is `dist/test/run.js` of this package, written relative to the project root. It starts `node` with the words of the command in their order. Each `--selection="<glob>"` is a glob of the test selection (see above).
321
+
322
+ Put the test files after `--` to run only them, as with `@nx/jest` and `@nx/vite`. A word that does not start with `-` and ends with `.test.{ts,mts,cts,js,mjs}` names test files, and a glob does too. Then the selection goes:
322
323
 
323
324
  ```sh
324
- nx run mutex:test --args="src/lock-stores/memory/memory-store.contract.test.ts"
325
+ nx run mutex:test -- src/lock-stores/memory/memory-store.contract.test.ts
326
+ nx run mutex:test -- "src/lock-stores/**/*.test.ts"
325
327
  ```
326
328
 
327
- A Node flag on the CLI keeps the test selection. Use it to run the tests with a name:
329
+ `--args` does the same: `nx run mutex:test --args="src/lock-stores/memory/memory-store.contract.test.ts"`.
330
+
331
+ A Node flag keeps the selection. Use it to run the tests with a name:
328
332
 
329
333
  ```sh
330
334
  nx run mutex:test --test-name-pattern=login
331
335
  ```
332
336
 
333
- The command ends with `{args}`. For a command with `{args}`, Nx puts the CLI flags and the positional words first, then `args` (`nx/dist/src/executors/run-commands/run-commands.impl.js:136-142`). Thus `--test-name-pattern=login` comes before the globs, and Node reads it as a flag.
334
-
335
- Without `{args}`, the order is different. Nx puts a CLI flag after `args` (`run-commands.impl.js:117-119` and `145-162`): only an unknown option that is not on the CLI comes before `args`. Then `nx run mutex:test --test-name-pattern=login` puts the flag after the globs, and Node reads it as a file name.
336
-
337
- A positional file does not replace the selection. In `nx run mutex:test src/lock-stores/memory/memory-store.contract.test.ts`, Nx adds the file before the selection, and all the tests run. Use `--args`.
338
-
339
- A probe on Nx 23.2.1 (2026-10-29) showed this, with `args` `DEFAULT` and a command that prints its arguments:
337
+ Put a flag before the files, because Node reads a flag after a file as a file name. `node --test "x.test.ts" --test-timeout=1` stops with exit code 1: `Could not find 'x.test.ts, --test-timeout=1'`. Thus `nx run mutex:test -- --test-name-pattern=login src/login.test.ts` runs the tests named `login` in `src/login.test.ts`. When the run names no files, `run.js` puts the selection after all the words, so a flag on the CLI, after `--` or in `--args` always comes before the globs.
340
338
 
341
- | CLI | With `{args}` | Without `{args}` |
342
- | ------------------------------------ | ----------------------------------- | ----------------------------------- |
343
- | `--args=X` | `X` | `X` |
344
- | `--test-name-pattern=login` | `--test-name-pattern=login DEFAULT` | `DEFAULT --test-name-pattern=login` |
345
- | `pos.test.ts` | `pos.test.ts DEFAULT` | `DEFAULT pos.test.ts` |
346
- | `--args=X --test-name-pattern=login` | `--test-name-pattern=login X` | — |
339
+ The selection is in the command, not in `args`, because `--args` replaces `args`. Then `--args=--test-name-pattern=login` would leave Node with no file, and Node's own default pattern would run `test/helpers/*` too.
347
340
 
348
- The selection is in `args` and not in the command, because a flag after a glob does not work. `node --test "x.test.ts" --test-timeout=1` reads the flag as a file name. It stops with exit code 1: `Could not find 'x.test.ts, --test-timeout=1'`. zukhruf has `"src/**/*.test.ts"` at the end of its command today, so a zukhruf run cannot narrow. Also, a glob that matches no file gives exit code 0. Thus a wrong narrowing passes with no test.
341
+ A glob that matches no file gives exit code 0. Thus a wrong narrowing passes with no test.
349
342
 
350
343
  ### Docker tests
351
344
 
@@ -1116,6 +1109,17 @@ NX_E2E_PRESET_VERSION=file:<scratch>/zukhruf-nx-<version>.tgz \
1116
1109
 
1117
1110
  Then check that `npm install` passes, that `npx nx run-many -t typecheck` and `npx nx run-many -t lint` pass, and that the first `git commit` passes the hooks. Delete the folder at the end. On 2026-11-18 both paths passed: a new folder (`acme`), and a folder with only `git init` (`.`). In the new folder, a demo package also passed `typecheck` (TypeScript 7.0.2) and `lint`, and its commit passed each hook. A second run of `npx nx g @zukhruf/nx:init` in the generated repo changed no file.
1118
1111
 
1112
+ After a release, two targets check the published version. `.github/workflows/nightly.yml` runs them each day and on `workflow_dispatch`, and no release waits for them ([ADR 0020](./docs/adr/0020-two-nightly-checks-run-the-generated-workspace-and-compare-an-upgraded-one-with-a-fresh-one.md)):
1113
+
1114
+ ```sh
1115
+ npx nx run nx:e2e:smoke # latest
1116
+ npx nx run nx:e2e:smoke --args="--version=0.8.57"
1117
+ npx nx run nx:e2e:upgrade
1118
+ ```
1119
+
1120
+ - `e2e:smoke` makes a workspace with the preset, `node-app`, `react-app`, `pair`, `prisma`, `auth` and `ui-package`, commits it through its hooks, removes what Git ignores except `node_modules`, and runs `nx run-many -t lint typecheck build test --skip-nx-cache`. The tests of the db package need Docker. Give the version in `--args`: Nx reads a `--version` of its own command line.
1121
+ - `e2e:upgrade` makes the same workspace with the newest release older than a day, moves it to `latest` with `nx migrate` and its migrations, and compares it with a workspace made with `latest`: `targetDefaults`, `namedInputs` and `plugins` of `nx.json`, the `nx` key and `project.json` of each project, and the edges of the task graph. It prints each difference with its two values.
1122
+
1119
1123
  ### Who uses the generators
1120
1124
 
1121
1125
  | Consumer | How | Record |
@@ -1551,6 +1555,7 @@ The decisions are in [ADR 0011](./docs/adr/0011-the-dokploy-generator-writes-the
1551
1555
  - [ADR 0017](./docs/adr/0017-nx-migrations-bring-a-change-of-generated-output-to-the-repos-that-ran-the-generator-before.md): Nx migrations bring a change of generated output to the repos that ran the generator before.
1552
1556
  - [ADR 0018](./docs/adr/0018-migrate-check-diffs-the-migrations-on-a-shadow-database-that-it-makes.md): migrate:check diffs the migrations on a shadow database that it makes.
1553
1557
  - [ADR 0019](./docs/adr/0019-a-task-that-reads-generated-code-runs-its-generator-first-and-hashes-its-output.md): a task that reads generated code runs its generator first and hashes its output.
1558
+ - [ADR 0020](./docs/adr/0020-two-nightly-checks-run-the-generated-workspace-and-compare-an-upgraded-one-with-a-fresh-one.md): two nightly checks run the generated workspace and compare an upgraded one with a fresh one.
1554
1559
  - [ADR 0021](./docs/adr/0021-the-sdk-it-client-depends-on-its-backend-and-runs-after-the-builds-of-the-backends-dependencies.md): the sdk-it client depends on its backend and runs after the builds of the backend's dependencies.
1555
1560
 
1556
1561
  **Copied code**
@@ -40,7 +40,7 @@ function updateBuildDeps(tree, path, backend) {
40
40
  }
41
41
  function updateClient(tree, path, backend) {
42
42
  if (!tree.exists(path)) {
43
- logger.warn(`add-sdk-build-edges: ${path} is not there, so the sdk-it client of ${backend} gets no edge to it. Run nx g @zukhruf/nx:node-app again to write the stub (#5102).`);
43
+ logger.warn(`add-sdk-build-edges: ${backend} has no sdk-it client package at ${path}, so no sdk edge is written. A web that reads the API another way (such as @sdk-it/vite) needs its readers to run after the generators that the backend's types read (#5102).`);
44
44
  return;
45
45
  }
46
46
  updateJsonIfChanged(tree, path, (manifest) => {
@@ -1 +1 @@
1
- {"version":3,"file":"add-sdk-build-edges.js","sourceRoot":"","sources":["../../../src/migrations/update-0-8-60/add-sdk-build-edges.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAGL,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,MAAM,GACP,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,eAAe,EACf,cAAc,GACf,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAEL,gBAAgB,EAChB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC;AAqBzB,0EAA0E;AAC1E,MAAM,YAAY,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC;IACxC,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,YAAY,EAAE;IAC5C,mCAAmC;IACnC,4BAA4B;CAC7B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,CAAC,KAAK,UAAU,gBAAgB,CAAC,IAAU;IACvD,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAAC;IAClE,KAAK,MA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IpB,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAOD;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,WAAW,CA4EhD,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/test/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,WAAW,EAIjB,MAAM,YAAY,CAAC;AAKpB,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AASD;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,WAAW,CA6EhD,CAAC"}
@@ -12,10 +12,13 @@ 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
14
  import { nearestRoot, projectRootFiles } from '../project-roots.js';
15
- const testFile = /\.test\.(?:ts|mts|cts|js|mjs)$/;
15
+ import { testFile } from './test-file.js';
16
16
  const viteConfig = /^vite\.config\.(?:js|ts|mjs|mts|cjs|cts)$/;
17
17
  const vitestConfig = /^vitest\.config\.(?:js|ts|mjs|mts|cjs|cts)$/;
18
18
  const ownGlobalSetup = 'src/testing/docker-global-setup.ts';
19
+ // The script of the test target ships beside this file: `.ts` in the source
20
+ // that zukhruf runs, `.js` in the build that npm installs.
21
+ const run = join(import.meta.dirname, `run${extname(import.meta.filename)}`);
19
22
  /**
20
23
  * Gives the `test` target, a `node --test` run, to each project root that
21
24
  * owns test files and is not a Vitest project (ADR 0004). A project with the
@@ -56,7 +59,7 @@ export const createNodes = [
56
59
  }
57
60
  const docker = tags(context.workspaceRoot, root, new Set(configFiles)).includes('test:docker');
58
61
  const command = [
59
- 'node --test --no-warnings',
62
+ `node "${relative(join(context.workspaceRoot, root), run)}" --test --no-warnings`,
60
63
  `--test-timeout=${timeout}`,
61
64
  ...new Set([
62
65
  ...flags,
@@ -69,11 +72,12 @@ export const createNodes = [
69
72
  ]),
70
73
  '--test-reporter=spec --test-reporter-destination=stdout',
71
74
  '--test-reporter=junit --test-reporter-destination=test-results.xml',
75
+ ...selection(tests),
72
76
  '{args}',
73
77
  ].join(' ');
74
78
  const test = {
75
79
  executor: 'nx:run-commands',
76
- options: { command, cwd: '{projectRoot}', args: selection(tests) },
80
+ options: { command, cwd: '{projectRoot}' },
77
81
  outputs: ['{projectRoot}/test-results.xml'],
78
82
  cache: false,
79
83
  dependsOn: ['^build'],
@@ -83,7 +87,8 @@ export const createNodes = [
83
87
  },
84
88
  ];
85
89
  // One glob for each top-level folder with test files, and one glob with no
86
- // `**` for the test files directly in the root (ADR 0004).
90
+ // `**` for the test files directly in the root (ADR 0004), each marked for
91
+ // `run.ts`, which drops them when the run names its own test files.
87
92
  function selection(tests) {
88
93
  const extensions = new Map();
89
94
  for (const test of tests) {
@@ -97,9 +102,8 @@ function selection(tests) {
97
102
  const extension = found.size === 1
98
103
  ? [...found].join('')
99
104
  : `{${[...found].toSorted().join(',')}}`;
100
- return `"${folder === '' ? '' : `${folder}/**/`}*.test.${extension}"`;
101
- })
102
- .join(' ');
105
+ return `--selection="${folder === '' ? '' : `${folder}/**/`}*.test.${extension}"`;
106
+ });
103
107
  }
104
108
  // The rule of `@nx/vitest`: a `vite.config.*` whose resolved config has
105
109
  // `test` makes a Vitest project (`@nx/vitest/dist/src/plugins/plugin.js:
@@ -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,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
2
+ //# sourceMappingURL=run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/test/run.ts"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
1
+ // The test target of `@zukhruf/nx/test` runs this in the project root:
2
+ // `node run.js --test <flags> --selection=<glob>… <forwarded words>`. A
3
+ // forwarded word that names test files narrows the run, as
4
+ // `nx test <project> -- <file>` does with `@nx/jest` and `@nx/vite`, and then
5
+ // the selection goes. Else the selection comes last, after the forwarded
6
+ // flags, because Node reads a flag after a file as a file (ADR 0004).
7
+ import { spawn } from 'node:child_process';
8
+ import { once } from 'node:events';
9
+ import { testFile } from './test-file.js';
10
+ const marker = '--selection=';
11
+ const words = process.argv.slice(2);
12
+ const forwarded = words.filter((word) => !word.startsWith(marker));
13
+ const selection = words
14
+ .filter((word) => word.startsWith(marker))
15
+ .map((word) => word.slice(marker.length));
16
+ const narrowed = forwarded.some((word) => !word.startsWith('-') && testFile.test(word));
17
+ const node = spawn(process.execPath, narrowed ? forwarded : [...forwarded, ...selection], { stdio: 'inherit' });
18
+ const signals = ['SIGINT', 'SIGTERM', 'SIGHUP'];
19
+ const forward = (signal) => node.kill(signal);
20
+ for (const signal of signals)
21
+ process.on(signal, forward);
22
+ const [code, exitSignal] = await once(node, 'exit');
23
+ for (const signal of signals)
24
+ process.off(signal, forward);
25
+ // Node gives the code null when a signal ended the child: this process then
26
+ // ends by the same signal.
27
+ if (exitSignal === null) {
28
+ process.exitCode = code;
29
+ }
30
+ else {
31
+ process.kill(process.pid, exitSignal);
32
+ }
33
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/test/run.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,wEAAwE;AACxE,2DAA2D;AAC3D,8EAA8E;AAC9E,yEAAyE;AACzE,sEAAsE;AACtE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AA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,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACpD,KAAK,MAAM,MAAM,IAAI,OAAO;IAAE,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC3D,4EAA4E;AAC5E,2BAA2B;AAC3B,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;IACxB,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;AAC1B,CAAC;KAAM,CAAC;IACN,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;AACxC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const testFile: RegExp;
2
+ //# sourceMappingURL=test-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-file.d.ts","sourceRoot":"","sources":["../../src/test/test-file.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,QAAQ,QAAmC,CAAC"}
@@ -0,0 +1,4 @@
1
+ // A test file of `node:test`: the plugin finds the project roots by it, and
2
+ // `run.ts` narrows the run by it.
3
+ export const testFile = /\.test\.(?:ts|mts|cts|js|mjs)$/;
4
+ //# sourceMappingURL=test-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-file.js","sourceRoot":"","sources":["../../src/test/test-file.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,kCAAkC;AAClC,MAAM,CAAC,MAAM,QAAQ,GAAG,gCAAgC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zukhruf/nx",
3
- "version": "0.8.63",
3
+ "version": "0.8.64",
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": {
@@ -131,7 +131,7 @@
131
131
  "@nx/react": ">=24.0.6 <25.0.0",
132
132
  "@nx/vite": ">=24.0.6 <25.0.0",
133
133
  "@nx/vitest": ">=24.0.6 <25.0.0",
134
- "@zukhruf/testing": "^0.8.63",
134
+ "@zukhruf/testing": "^0.8.64",
135
135
  "nx": ">=24.0.6 <25.0.0",
136
136
  "prettier": "^3.0.0"
137
137
  },
@@ -153,9 +153,9 @@
153
153
  }
154
154
  },
155
155
  "devDependencies": {
156
- "@zukhruf/eslint": "^0.8.63",
157
- "@zukhruf/fs": "^0.8.63",
158
- "@zukhruf/testing": "^0.8.63",
156
+ "@zukhruf/eslint": "^0.8.64",
157
+ "@zukhruf/fs": "^0.8.64",
158
+ "@zukhruf/testing": "^0.8.64",
159
159
  "semver": "^7.8.5"
160
160
  }
161
161
  }