@zukhruf/nx 0.4.0 → 0.4.1

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
@@ -10,7 +10,7 @@ The words in these documents have one meaning each. See the glossary in [CONTEXT
10
10
  | ---------------- | ---------------------- | --------------------------------------------------------------------------------------------- |
11
11
  | format | `@zukhruf/nx/format` | This README |
12
12
  | test | `@zukhruf/nx/test` | This README |
13
- | lint | `@zukhruf/nx/lint` | Design for review (#3335) |
13
+ | lint | `@zukhruf/nx/lint` | This README |
14
14
  | portless | `@zukhruf/nx/portless` | Candidate (#3336): 14 projects in 3 repos |
15
15
  | opentofu, prisma | — | Candidates (#3339): 5 places each |
16
16
  | generators | — | Candidates: the workspace generator of `@factory/foundation` (#3337); app kinds later (#3338) |
@@ -348,8 +348,6 @@ The umbrella item is #3328.
348
348
 
349
349
  ## lint
350
350
 
351
- > Status: design for review (#3335). The code does not exist yet.
352
-
353
351
  Nx caches the `lint` target. A cached result is correct only when each file and each package that ESLint loads is an input. Seven workspaces write the packages by hand in `targetDefaults.lint.inputs`, and the lists drift: 5 to 15 packages. When a package is not in the list, an update of that package does not change the hash. Nx then replays a cached pass, and the new rules do not run.
354
352
 
355
353
  The `lint` area is an Nx inference plugin. It adds inputs to the `lint` target that `@nx/eslint/plugin` gives. It does not make a `lint` target, and it does not change the command. It reads the packages from `@zukhruf/eslint`, so no workspace writes a list.
@@ -367,9 +365,11 @@ You need Nx 23.2.1 or later, `@nx/eslint` and `@zukhruf/eslint`. Add the plugin
367
365
  }
368
366
  ```
369
367
 
370
- The order is necessary. Nx merges the plugins in the order of the list, and a later plugin wins. The plugin writes `"..."` first in its `inputs`, so the inputs of `@nx/eslint/plugin` stay. If the plugin comes first, `@nx/eslint/plugin` replaces its inputs, and no run reports it. Thus the plugin stops with an error when `@nx/eslint/plugin` is not before it in `plugins`.
368
+ The order is necessary. Nx merges the plugins in the order of the list, and a later plugin wins. The plugin writes `"..."` first in its `inputs`, so the inputs of `@nx/eslint/plugin` stay. If the plugin comes first, `@nx/eslint/plugin` replaces its inputs, and no run reports it. Thus the plugin stops with an error when an `@nx/eslint/plugin` entry is not before it in `plugins`. A workspace can have more than one `@nx/eslint/plugin` entry, for example with `include` and `exclude`. Then the plugin must come after each of them.
369
+
370
+ The plugin finds its own entry in `plugins` as Nx finds a plugin: it resolves each entry from the workspace root with `require.resolve` (`nx/dist/src/project-graph/plugins/in-process-loader.js:42,51`). An entry that resolves to the file of the plugin is its own entry.
371
371
 
372
- zukhruf builds this package, so it lists the plugin by path, as it does for `format` and `test`: `"./packages/nx/src/lint/plugin.ts"`.
372
+ zukhruf builds this package, so it lists the plugin by path, as it does for `format` and `test`: `"./packages/nx/src/lint/plugin.ts"`. A workspace that builds this package must list it by path. Nx resolves a package of the workspace by name with the `customConditions` of the root tsconfig (`nx/dist/src/project-graph/plugins/resolve-plugin.js:37-41,87-95`), and `require.resolve` does not. Then the two paths are different, and the plugin stops with the order error.
373
373
 
374
374
  ### Signature of the lint area
375
375
 
@@ -380,6 +380,8 @@ export const createNodes: CreateNodes;
380
380
 
381
381
  The plugin takes no options. A workspace adds its own lint packages in `targetDefaults` (see [Add a lint package of the workspace](#add-a-lint-package-of-the-workspace)).
382
382
 
383
+ The name of the target is the `targetName` of each `@nx/eslint/plugin` entry. An entry with no `targetName` gives `lint`, as `@nx/eslint/plugin` does (`@nx/eslint/dist/src/plugins/plugin.js:325`).
384
+
383
385
  ### What the lint area adds
384
386
 
385
387
  `@nx/eslint/plugin` already gives these inputs to `lint` (`@nx/eslint/dist/src/plugins/plugin.js:284-297`):
@@ -402,7 +404,11 @@ One entry is sufficient for an installed package. Nx makes a node for each packa
402
404
 
403
405
  A package of the workspace has no node in the lockfile. An `externalDependencies` entry with no node stops the run with an error: `The externalDependency '<name>' for '<project>:lint' could not be found`. Thus, for zukhruf, the plugin reads the names from the `package.json` of `@zukhruf/eslint`.
404
406
 
405
- When the plugin cannot find `@zukhruf/eslint`, it stops with an error. It does not give `lint` without the inputs.
407
+ The plugin stops with an error in these cases. It does not give `lint` without the inputs:
408
+
409
+ - An `@nx/eslint/plugin` entry is not before the plugin in `plugins`, or `plugins` has no `@nx/eslint/plugin` entry.
410
+ - `@zukhruf/eslint` does not resolve from the workspace root.
411
+ - `@zukhruf/eslint` resolves to a folder outside the workspace and outside `node_modules`, for example after `npm link`. Nx has no node in the lockfile for such a package, so no input can hash it.
406
412
 
407
413
  The plugin gives inputs to each project root (see [ADR 0003](./docs/adr/0003-which-roots-get-targets.md)). A project with no `lint` from `@nx/eslint/plugin` gets no `lint`: Nx deletes a target with no executor, no command and no `dependsOn` (`nx/dist/src/project-graph/utils/project-configuration/target-normalization.js:202-214`).
408
414
 
@@ -427,12 +433,7 @@ Some configs load a package that is not in the edges of `@zukhruf/eslint`. Add i
427
433
  "inputs": [
428
434
  "...",
429
435
  {
430
- "externalDependencies": [
431
- "eslint-plugin-import",
432
- "eslint-plugin-jsx-a11y",
433
- "eslint-plugin-react",
434
- "eslint-plugin-react-hooks"
435
- ]
436
+ "externalDependencies": ["eslint-plugin-no-barrel-files"]
436
437
  }
437
438
  ]
438
439
  }
@@ -442,7 +443,9 @@ Some configs load a package that is not in the edges of `@zukhruf/eslint`. Add i
442
443
 
443
444
  `targetDefaults` comes after the plugins. Without `"..."`, its `inputs` replace the inputs of both plugins. A probe on Nx 23.2.1 (2026-10-30) showed both results.
444
445
 
445
- The four packages above are an example from the audit. `nx.configs['flat/react']` of `@nx/eslint-plugin` loads them (`@nx/eslint-plugin/dist/src/flat-configs/react-base.js:4` and `react-jsx.js`), but `@nx/eslint-plugin` does not declare them. factory, whatisgoingon, deepagents and text2sql use `flat/react`.
446
+ The package above is an example from the audit: 3 project configs of text2sql load `eslint-plugin-no-barrel-files`.
447
+
448
+ `nx.configs['flat/react']` of `@nx/eslint-plugin` loads 4 packages, but `@nx/eslint-plugin` does not declare them (`@nx/eslint-plugin/dist/src/flat-configs/react-base.js:4` and `react-jsx.js:4-6`): `eslint-plugin-import`, `eslint-plugin-jsx-a11y`, `eslint-plugin-react` and `eslint-plugin-react-hooks`. Do not add them in `targetDefaults`. Import `@zukhruf/eslint/react` in each React project config. It gives `nx.configs['flat/react']`, and `@zukhruf/eslint` declares the 4 packages as optional peers. Thus they are lockfile edges of `@zukhruf/eslint`, and the plugin hashes them.
446
449
 
447
450
  A local file that the root ESLint config imports is also an input of the workspace, for example `{workspaceRoot}/island.eslint.config.mjs`. Add it in the same way.
448
451
 
@@ -451,27 +454,41 @@ A local file that the root ESLint config imports is also an input of the workspa
451
454
  - Nx 23.2.1 or later. The peer range of the package is `>=23.2.1 <25`.
452
455
  - `@zukhruf/eslint` in the workspace. elt and context-compiler do not use it today: they have their own `personal.eslint.config.mjs`. They move to `@zukhruf/eslint` first.
453
456
  - Delete the hand list in `targetDefaults.lint.inputs`. `targetDefaults` comes after the plugins, so a list without `"..."` replaces the inputs of the plugin.
454
- - Keep the other keys of `targetDefaults.lint`, for example the `command`, `env` and `parallelism` of deepagents.
457
+ - Keep the other keys of `targetDefaults.lint`, for example the `options.command`, `env` and `parallelism` of deepagents.
458
+ - `targetDefaults.lint` must not have `dependsOn` or a top-level `command`. Nx deletes the `lint` of the plugin on a project with no ESLint only when the target has no `executor`, no `command` and no `dependsOn` (`nx/dist/src/project-graph/utils/project-configuration/target-normalization.js:202-214`). With `dependsOn`, each project with no ESLint gets an `nx:noop` `lint` that runs the dependencies. With a top-level `command`, each such project gets a `lint` that runs the command. `options.command` is safe: Nx does not read it as a top-level `command` (`target-merging.js:15-33`). elt and context-compiler have `dependsOn: ["format"]` today, so they delete it first.
459
+ - A `lint` target in a `project.json` with its own `executor` or `command` replaces the inputs of both plugins (`target-merging.js:443-457`). Delete such a target, or write its `inputs` with `"..."`.
455
460
 
456
461
  ### Migrate a workspace to the lint area
457
462
 
458
- 1. Add `@zukhruf/nx/lint` to `plugins`, after `@nx/eslint/plugin`.
459
- 2. Delete `targetDefaults.lint.inputs`.
460
- 3. If the configs load a package that is not in the edges of `@zukhruf/eslint`, add `["...", { "externalDependencies": [...] }]` (see [Add a lint package of the workspace](#add-a-lint-package-of-the-workspace)).
461
- 4. Compare `nx show target inputs <project>:lint --json` before and after, for one project of each kind. Each package of the old list must be in `external`.
462
-
463
- | Workspace | Packages in the hand list today | After the migration |
464
- | ---------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
465
- | zukhruf | 13, and `packages/eslint/src` | no list; `@zukhruf/eslint` is a package of the workspace |
466
- | factory | 14 | 4 packages of `flat/react` in `targetDefaults`; `tools/eslint-rules` goes from the list, because `@nx/eslint/plugin` gives it |
467
- | whatisgoingon | 15 | the same as factory |
468
- | deepagents | 9 | the 4 packages of `flat/react`, which the list does not have today; `tsconfig.base.json` goes when the tsconfig chain gives it; `command`, `env` and `parallelism` stay |
469
- | text2sql | 7 | the 4 packages of `flat/react` and `eslint-plugin-no-barrel-files` (3 project configs load it), which the list does not have today; Nx updates from 23.1.0 first; `command` stays |
470
- | elt | 7 | waits: moves to `@zukhruf/eslint` first |
471
- | context-compiler | 5 | waits: moves to `@zukhruf/eslint` first |
472
-
473
- The lockfile measured the edges on 2026-10-30. For factory, whatisgoingon, deepagents and text2sql, each package of the hand list is in the edges of `@zukhruf/eslint`, except the 4 packages of `flat/react`.
463
+ 1. Update `@zukhruf/nx` and `@zukhruf/eslint` to the latest release. An older `@zukhruf/eslint` does not declare the 4 packages of `flat/react`, so its lockfile node has no edge to them. A probe on factory (Nx 24.0.1, 2026-10-30) showed this: with `@zukhruf/eslint` 0.3.44, the 4 packages were not in `external`.
464
+ 2. Add `@zukhruf/nx/lint` to `plugins`, after `@nx/eslint/plugin`.
465
+ 3. Delete `targetDefaults.lint.inputs`, and delete `targetDefaults.lint.dependsOn` and a top-level `targetDefaults.lint.command` (see [Prerequisites of the lint area](#prerequisites-of-the-lint-area)).
466
+ 4. In each React project config, import `@zukhruf/eslint/react` instead of `nx.configs['flat/react']`.
467
+ 5. If the configs load a package that is not in the edges of `@zukhruf/eslint`, add `["...", { "externalDependencies": [...] }]` (see [Add a lint package of the workspace](#add-a-lint-package-of-the-workspace)).
468
+ 6. Compare `nx show target inputs <project>:lint --json` before and after, for one project of each kind. Each package of the old list must be in `external`.
469
+
470
+ | Workspace | Packages in the hand list today | After the migration |
471
+ | ---------------- | ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
472
+ | zukhruf | 13, and `packages/eslint/src` | no list; `@zukhruf/eslint` is a package of the workspace |
473
+ | factory | 14 | the 5 React project configs import `@zukhruf/eslint/react`, not `nx.configs['flat/react']`; `tools/eslint-rules` goes from the list, because `@nx/eslint/plugin` gives it |
474
+ | whatisgoingon | 15 | the same as factory, with 2 React project configs |
475
+ | deepagents | 9 | the 4 React project configs import `@zukhruf/eslint/react`; `tsconfig.base.json` goes when the tsconfig chain gives it; `options.command`, `env` and `parallelism` stay |
476
+ | text2sql | 7 | the 21 React project configs import `@zukhruf/eslint/react`; `eslint-plugin-no-barrel-files` (3 project configs load it) goes in `targetDefaults` with `"..."`; Nx updates from 23.1.0 first; `options.command` stays |
477
+ | elt | 7 | waits: moves to `@zukhruf/eslint` first |
478
+ | context-compiler | 5 | waits: moves to `@zukhruf/eslint` first |
479
+
480
+ The lockfile measured the edges on 2026-10-30. For factory, whatisgoingon, deepagents and text2sql, each package of the hand list is in the edges of `@zukhruf/eslint`, except the 4 packages of `flat/react`. `@zukhruf/eslint/react` adds them as optional peers. An optional peer is an edge only when the workspace installs it, so the root `devDependencies` of the 4 packages stay in these 4 workspaces.
474
481
 
475
482
  ### Who uses the lint area
476
483
 
477
- No workspace uses it yet. The umbrella item is #3335.
484
+ | Workspace | Backlog item |
485
+ | ---------------- | -------------------------------------------------- |
486
+ | zukhruf | uses it: `nx.json` lists the plugin by path |
487
+ | factory | #3386 |
488
+ | whatisgoingon | #3387 |
489
+ | deepagents | #3388 |
490
+ | text2sql | #3389 |
491
+ | elt | #3390, after the move to `@zukhruf/eslint` (#2964) |
492
+ | context-compiler | #3391, after the move to `@zukhruf/eslint` (#2881) |
493
+
494
+ The umbrella item is #3335.
@@ -1,12 +1,7 @@
1
1
  import { type CreateNodes } from '@nx/devkit';
2
2
  /**
3
3
  * Gives each Nx project `format` (writes) and `format:check` (only reads,
4
- * cached). Any root that a plugin returns becomes a project, and no plugin
5
- * hook receives the projects that Nx found. So the plugin selects roots with
6
- * the rule and the matcher of Nx's own package.json plugin: each folder with a
7
- * `project.json`, and a `package.json` folder only when the package-manager
8
- * workspace globs match it. It returns targets only; the default plugins name
9
- * the project.
4
+ * cached). It returns targets only; the default plugins name the project.
10
5
  */
11
6
  export declare const createNodes: CreateNodes;
12
7
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/format/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,WAAW,EAIjB,MAAM,YAAY,CAAC;AAOpB;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,EAAE,WA4CzB,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/format/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,WAAW,EAGjB,MAAM,YAAY,CAAC;AAKpB;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,WA8BzB,CAAC"}
@@ -1,26 +1,15 @@
1
- import { basename, dirname, isAbsolute, join, relative } from 'node:path';
2
- import { createNodesFromFiles, readJsonFile, } from '@nx/devkit';
3
- import { buildPackageJsonPatterns, buildPackageJsonWorkspacesMatcher, } from '@nx/devkit/internal';
1
+ import { dirname, isAbsolute, join, relative } from 'node:path';
2
+ import { createNodesFromFiles, } from '@nx/devkit';
4
3
  import { resolveConfig, resolveConfigFile } from 'prettier';
4
+ import { projectRootFiles } from "../project-roots.js";
5
5
  /**
6
6
  * Gives each Nx project `format` (writes) and `format:check` (only reads,
7
- * cached). Any root that a plugin returns becomes a project, and no plugin
8
- * hook receives the projects that Nx found. So the plugin selects roots with
9
- * the rule and the matcher of Nx's own package.json plugin: each folder with a
10
- * `project.json`, and a `package.json` folder only when the package-manager
11
- * workspace globs match it. It returns targets only; the default plugins name
12
- * the project.
7
+ * cached). It returns targets only; the default plugins name the project.
13
8
  */
14
9
  export const createNodes = [
15
10
  '{package.json,**/package.json,project.json,**/project.json}',
16
11
  async (configFiles, options, context) => {
17
- const projectJsonRoots = new Set(configFiles
18
- .filter((file) => basename(file) === 'project.json')
19
- .map((file) => dirname(file)));
20
- const isInWorkspaces = buildPackageJsonWorkspacesMatcher(buildPackageJsonPatterns(context.workspaceRoot, (file) => readJsonFile(join(context.workspaceRoot, file))));
21
- const rootFiles = configFiles.filter((file) => basename(file) === 'project.json'
22
- ? true
23
- : !projectJsonRoots.has(dirname(file)) && isInWorkspaces(file));
12
+ const rootFiles = projectRootFiles(configFiles, context.workspaceRoot);
24
13
  const formatCheck = {
25
14
  command: 'prettier --check {projectRoot}',
26
15
  cache: true,
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/format/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE1E,OAAO,EAGL,oBAAoB,EACpB,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,wBAAwB,EACxB,iCAAiC,GAClC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,6DAA6D;IAC7D,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;QACtC,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAC9B,WAAW;aACR,MAAM,CAAC,CAAC,IAAI,EAAE,E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,OAAO;QACL,mBAAmB,QAAQ,CAAC,aAAa,EAAE,IAAI,CAAC,EAAE;QAClD;YACE,oBAAoB,EAAE;gBACpB,UAAU;gBACV,GAAG,OAAO;qBACP,MAAM,CACL,CAAC,MAAM,EAAoB,EAAE,CAC3B,OAAO,MAAM,KAAK,QAAQ;oBAC1B,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC;oBACvB,CAAC,UAAU,CAAC,MAAM,CAAC,CACtB;qBACA,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CACd,MAAM;qBACH,KAAK,CAAC,GAAG,CAAC;qBACV,KAAK,CAAC,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;qBACxC,IAAI,CAAC,GAAG,CAAC,CACb;aACJ;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { type CreateNodes } from '@nx/devkit';
2
+ /**
3
+ * Adds the packages of `@zukhruf/eslint` to the inputs of the `lint` target
4
+ * that `@nx/eslint/plugin` gives (ADR 0006). It gives no executor and no
5
+ * command, so Nx merges it into that target, and deletes it from a root
6
+ * that has no such target.
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/lint/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,WAAW,EAKjB,MAAM,YAAY,CAAC;AAMpB;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,WAoBzB,CAAC"}
@@ -0,0 +1,117 @@
1
+ import { realpathSync } from 'node:fs';
2
+ import { createRequire } from 'node:module';
3
+ import { dirname, isAbsolute, join, relative, sep } from 'node:path';
4
+ import { fileURLToPath } from 'node:url';
5
+ import { createNodesFromFiles, readJsonFile, } from '@nx/devkit';
6
+ import { projectRootFiles } from "../project-roots.js";
7
+ const eslintPlugin = '@nx/eslint/plugin';
8
+ /**
9
+ * Adds the packages of `@zukhruf/eslint` to the inputs of the `lint` target
10
+ * that `@nx/eslint/plugin` gives (ADR 0006). It gives no executor and no
11
+ * command, so Nx merges it into that target, and deletes it from a root
12
+ * that has no such target.
13
+ */
14
+ export const createNodes = [
15
+ '{package.json,**/package.json,project.json,**/project.json}',
16
+ (configFiles, options, context) => {
17
+ const names = lintTargetNames(context);
18
+ const lint = {
19
+ inputs: ['...', ...eslintPackageInputs(context.workspaceRoot)],
20
+ };
21
+ return createNodesFromFiles((file) => ({
22
+ projects: {
23
+ [dirname(file)]: {
24
+ targets: Object.fromEntries(names.map((name) => [name, lint])),
25
+ },
26
+ },
27
+ }), projectRootFiles(configFiles, context.workspaceRoot), options, context);
28
+ },
29
+ ];
30
+ // A plugin sees neither the targets of another plugin nor its own entry
31
+ // (`public-api.d.ts:6-9`), and a later plugin wins the merge. So this plugin
32
+ // finds its own entries the way Nx resolves a plugin
33
+ // (`in-process-loader.js:42,51`) and checks that each `@nx/eslint/plugin`
34
+ // entry comes first. A wrong order loses the inputs with no message.
35
+ function lintTargetNames({ nxJsonConfiguration, workspaceRoot, }) {
36
+ // `plugins` is optional in `nx-json.d.ts`; with no list, this plugin is
37
+ // not listed, and the check below stops.
38
+ const entries = (nxJsonConfiguration.plugins ?? []).map((entry) => typeof entry === 'string' ? { plugin: entry } : entry);
39
+ const self = fileURLToPath(import.meta.url);
40
+ const paths = [join(workspaceRoot, '.nx', 'installation'), workspaceRoot];
41
+ const eslintEntries = entries.filter((entry) => entry.plugin === eslintPlugin);
42
+ const eslintIndexes = entries.flatMap((entry, index) => entry.plugin === eslintPlugin ? [index] : []);
43
+ const selfIndexes = entries.flatMap((entry, index) => entry.plugin !== eslintPlugin && resolvesTo(entry.plugin, paths, self)
44
+ ? [index]
45
+ : []);
46
+ if (selfIndexes.length === 0 ||
47
+ eslintEntries.length === 0 ||
48
+ Math.max(...eslintIndexes) > Math.min(...selfIndexes)) {
49
+ throw new Error(`@zukhruf/nx/lint must come after each ${eslintPlugin} entry in the plugins of nx.json, or the lint inputs are lost. List @zukhruf/nx/lint after each ${eslintPlugin} entry. A workspace that builds @zukhruf/nx lists this plugin by path, for example "./packages/nx/src/lint/plugin.ts": Nx resolves a package of the workspace by name with the customConditions of the root tsconfig, and this check does not.`);
50
+ }
51
+ // A string entry has no options, and the fallback is the one of
52
+ // `@nx/eslint/plugin` itself (`plugin.js:325`).
53
+ return [...new Set(eslintEntries.map((entry) => targetName(entry.options)))];
54
+ }
55
+ function targetName(options) {
56
+ return typeof options === 'object' &&
57
+ options !== null &&
58
+ 'targetName' in options &&
59
+ typeof options.targetName === 'string'
60
+ ? options.targetName
61
+ : 'lint';
62
+ }
63
+ function notFound(error) {
64
+ return (error instanceof Error &&
65
+ 'code' in error &&
66
+ error.code === 'MODULE_NOT_FOUND');
67
+ }
68
+ function resolvesTo(spec, paths, self) {
69
+ try {
70
+ return createRequire(self).resolve(spec, { paths }) === self;
71
+ }
72
+ catch (error) {
73
+ // Another entry that Node cannot resolve is not this plugin; Nx reports
74
+ // it on its own.
75
+ if (notFound(error)) {
76
+ return false;
77
+ }
78
+ throw error;
79
+ }
80
+ }
81
+ // An installed package has a node in the lockfile, and its edges reach each
82
+ // peer and dependency (`npm-parser.js:155-170`). A package of the workspace
83
+ // has no node (`"link": true`), so its source and its names are the inputs.
84
+ function eslintPackageInputs(workspaceRoot) {
85
+ const manifest = eslintManifest(workspaceRoot);
86
+ if (manifest.split(sep).includes('node_modules')) {
87
+ return [{ externalDependencies: ['@zukhruf/eslint'] }];
88
+ }
89
+ const folder = relative(realpathSync(workspaceRoot), dirname(manifest));
90
+ if (folder.startsWith('..') || isAbsolute(folder)) {
91
+ throw new Error(`@zukhruf/eslint resolves to ${dirname(manifest)}, outside the workspace and outside node_modules, for example through npm link. Nx has no lockfile node for such a package, so @zukhruf/nx/lint cannot hash it. Install @zukhruf/eslint from the registry.`);
92
+ }
93
+ const { dependencies, peerDependencies } = readJsonFile(manifest);
94
+ return [
95
+ `{workspaceRoot}/${folder}/src/**/*`,
96
+ {
97
+ externalDependencies: [
98
+ ...Object.keys(dependencies),
99
+ ...Object.keys(peerDependencies),
100
+ ],
101
+ },
102
+ ];
103
+ }
104
+ // The workspace's ESLint config loads `@zukhruf/eslint`, so it resolves from
105
+ // the workspace root.
106
+ function eslintManifest(workspaceRoot) {
107
+ try {
108
+ return createRequire(join(workspaceRoot, 'package.json')).resolve('@zukhruf/eslint/package.json');
109
+ }
110
+ catch (error) {
111
+ if (notFound(error)) {
112
+ throw new Error(`@zukhruf/nx/lint cannot resolve @zukhruf/eslint from ${workspaceRoot}. Install @zukhruf/eslint: without it, lint has no inputs for its lint packages.`, { cause: error });
113
+ }
114
+ throw error;
115
+ }
116
+ }
117
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/lint/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAIL,oBAAoB,EACpB,YAAY,GACb,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAgB;IACtC,6DAA6D;IAC7D,CAAC,WAAW,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;QAChC,MAAM,KAAK,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,IAAI,GAAwB;YAChC,MAAM,E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AAC,gBAAgB,CAAC;aACjC;SACF;KACF,CAAC;AACJ,CAAC;AAED,6EAA6E;AAC7E,sBAAsB;AACtB,SAAS,cAAc,CAAC,aAAqB;IAC3C,IAAI,CAAC;QACH,OAAO,aAAa,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CAC/D,8BAA8B,CAC/B,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CACb,wDAAwD,aAAa,kFAAkF,EACvJ,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;QACJ,CAAC;QACD,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Any root that a plugin returns becomes a project, and no plugin hook
3
+ * receives the projects that Nx found. So each area selects roots with the
4
+ * rule and the matcher of Nx's own package.json plugin: each folder with a
5
+ * `project.json`, and a `package.json` folder only when the package-manager
6
+ * workspace globs match it (ADR 0003). Gives the `project.json` or
7
+ * `package.json` file of each root.
8
+ */
9
+ export declare function projectRootFiles(configFiles: readonly string[], workspaceRoot: string): string[];
10
+ //# sourceMappingURL=project-roots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-roots.d.ts","sourceRoot":"","sources":["../src/project-roots.ts"],"names":[],"mappings":"AAQA;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,SAAS,MAAM,EAAE,EAC9B,aAAa,EAAE,MAAM,GACpB,MAAM,EAAE,CAgBV"}
@@ -0,0 +1,21 @@
1
+ import { basename, dirname, join } from 'node:path';
2
+ import { readJsonFile } from '@nx/devkit';
3
+ import { buildPackageJsonPatterns, buildPackageJsonWorkspacesMatcher, } from '@nx/devkit/internal';
4
+ /**
5
+ * Any root that a plugin returns becomes a project, and no plugin hook
6
+ * receives the projects that Nx found. So each area selects roots with the
7
+ * rule and the matcher of Nx's own package.json plugin: each folder with a
8
+ * `project.json`, and a `package.json` folder only when the package-manager
9
+ * workspace globs match it (ADR 0003). Gives the `project.json` or
10
+ * `package.json` file of each root.
11
+ */
12
+ export function projectRootFiles(configFiles, workspaceRoot) {
13
+ const projectJsonRoots = new Set(configFiles
14
+ .filter((file) => basename(file) === 'project.json')
15
+ .map((file) => dirname(file)));
16
+ const isInWorkspaces = buildPackageJsonWorkspacesMatcher(buildPackageJsonPatterns(workspaceRoot, (file) => readJsonFile(join(workspaceRoot, file))));
17
+ return configFiles.filter((file) => basename(file) === 'project.json'
18
+ ? true
19
+ : !projectJsonRoots.has(dirname(file)) && isInWorkspaces(file));
20
+ }
21
+ //# sourceMappingURL=project-roots.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-roots.js","sourceRoot":"","sources":["../src/project-roots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EACL,wBAAwB,EACxB,iCAAiC,GAClC,MAAM,qBAAqB,CAAC;AAE7B;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAC9B,WAA8B,EAC9B,aAAqB;IAErB,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAC9B,WAAW;SACR,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,cAAc,CAAC;SACnD,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAChC,CAAC;IACF,MAAM,cAAc,GAAG,iCAAiC,CACtD,wBAAwB,CAAC,aAAa,EAAE,CAAC,IAAY,EAAE,EAAE,CACvD,YAAY,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CACxC,CACF,CAAC;IACF,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CACjC,QAAQ,CAAC,IAAI,CAAC,KAAK,cAAc;QAC/B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,CACjE,CAAC;AACJ,CAAC"}
@@ -7,8 +7,7 @@ export interface TestOptions {
7
7
  * Gives the `test` target, a `node --test` run, to each project root that
8
8
  * owns test files and is not a Vitest project (ADR 0004). A project with the
9
9
  * tag `test:docker` also gets the global setup of `@zukhruf/testing` (ADR
10
- * 0005). The project roots are the roots of `./format`: a copy of its rule,
11
- * on the record in docs/copied-code.md.
10
+ * 0005).
12
11
  */
13
12
  export declare const createNodes: CreateNodes<TestOptions>;
14
13
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/test/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,WAAW,EAIjB,MAAM,YAAY,CAAC;AAMpB,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAOD;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,WAAW,CAwFhD,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;AAIpB,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,CA0EhD,CAAC"}
@@ -11,7 +11,7 @@ import { createRequire } from 'node:module';
11
11
  import { basename, dirname, extname, join, relative } from 'node:path';
12
12
  import { pathToFileURL } from 'node:url';
13
13
  import { createNodesFromFiles, readJsonFile, } from '@nx/devkit';
14
- import { buildPackageJsonPatterns, buildPackageJsonWorkspacesMatcher, } from '@nx/devkit/internal';
14
+ import { projectRootFiles } from "../project-roots.js";
15
15
  const testFile = /\.test\.(?:ts|mts|cts|js|mjs)$/;
16
16
  const viteConfig = /^vite\.config\.(?:js|ts|mjs|mts|cjs|cts)$/;
17
17
  const vitestConfig = /^vitest\.config\.(?:js|ts|mjs|mts|cjs|cts)$/;
@@ -20,8 +20,7 @@ const ownGlobalSetup = 'src/testing/docker-global-setup.ts';
20
20
  * Gives the `test` target, a `node --test` run, to each project root that
21
21
  * owns test files and is not a Vitest project (ADR 0004). A project with the
22
22
  * tag `test:docker` also gets the global setup of `@zukhruf/testing` (ADR
23
- * 0005). The project roots are the roots of `./format`: a copy of its rule,
24
- * on the record in docs/copied-code.md.
23
+ * 0005).
25
24
  */
26
25
  export const createNodes = [
27
26
  '{package.json,**/package.json,project.json,**/project.json,**/*.test.{ts,mts,cts,js,mjs},**/{vite,vitest}.config.{js,ts,mjs,mts,cjs,cts}}',
@@ -30,13 +29,7 @@ export const createNodes = [
30
29
  // deepagents, and no repo adds a flag for each project.
31
30
  const { timeout = 60_000, flags = [] } = options ?? {};
32
31
  const configFiles = files.filter((file) => ['package.json', 'project.json'].includes(basename(file)));
33
- const projectJsonRoots = new Set(configFiles
34
- .filter((file) => basename(file) === 'project.json')
35
- .map((file) => dirname(file)));
36
- const isInWorkspaces = buildPackageJsonWorkspacesMatcher(buildPackageJsonPatterns(context.workspaceRoot, (file) => readJsonFile(join(context.workspaceRoot, file))));
37
- const rootFiles = configFiles.filter((file) => basename(file) === 'project.json'
38
- ? true
39
- : !projectJsonRoots.has(dirname(file)) && isInWorkspaces(file));
32
+ const rootFiles = projectRootFiles(configFiles, context.workspaceRoot);
40
33
  const roots = new Set(rootFiles.map((file) => dirname(file)));
41
34
  const owned = new Map();
42
35
  for (const file of files.filter((file) => testFile.test(file))) {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../src/test/plugin.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAGL,oBAAoB,EACpB,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,wBAAwB,EACxB,iCAAiC,GAClC,MAAM,qBAAqB,CAAC;AAO7B,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AAClD,MAAM,UAAU,GAAG,2CAA2C,CAAC;AAC/D,MAAM,YAAY,GAAG,6CAA6C,CAAC;AACnE,MAAM,cAAc,GAAG,oCAAoC,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAA6B;IACnD,2IAA2I;IAC3I,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;QAChC,kEAAkE;QAClE,wDAAwD;QACxD,MAAM,EAAE,OAAO,GAAG,MAAM,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;QACvD,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CACxC,CAAC,cAAc,EAAE,cAAc,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAC1D,CAAC;QACF,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAC9B,WAAW;aACR,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,c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C/C,OAAO;QACL,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC;YAC9B,CAAC,CAAC,CAAC,YAAY,CAAsB,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;iBACjE,IAAI,IAAI,EAAE,CAAC;YAChB,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,WAAW,CAAC;YAC9B,CAAC,CAAC,CAAC,YAAY,CACX,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CACjC,CAAC,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC;YACnB,CAAC,CAAC,EAAE,CAAC;KACR,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,yEAAyE;AACzE,4EAA4E;AAC5E,yCAAyC;AACzC,SAAS,WAAW,CAAC,aAAqB,EAAE,IAAY;IACtD,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IAC9C,IAAI,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;QAClD,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,OAAO,QAAQ,CACb,WAAW,EACX,aAAa,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC,OAAO,CACtD,sCAAsC,CACvC,CACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zukhruf/nx",
3
- "version": "0.4.0",
4
- "description": "The Nx part of the monorepo standard, one area per subpath. @zukhruf/nx/format gives each project format and a cached format:check, both with Prettier. @zukhruf/nx/test gives each project that has node:test files a test target, a node --test run.",
3
+ "version": "0.4.1",
4
+ "description": "The Nx part of the monorepo standard, one area per subpath: format gives each project format and a cached format:check with Prettier, test gives node --test targets, and lint adds the packages of @zukhruf/eslint to the inputs of lint.",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -22,7 +22,9 @@
22
22
  "format",
23
23
  "check",
24
24
  "node-test",
25
- "test"
25
+ "test",
26
+ "eslint",
27
+ "lint"
26
28
  ],
27
29
  "type": "module",
28
30
  "exports": {
@@ -38,6 +40,12 @@
38
40
  "types": "./dist/test/plugin.d.ts",
39
41
  "import": "./dist/test/plugin.js",
40
42
  "default": "./dist/test/plugin.js"
43
+ },
44
+ "./lint": {
45
+ "@zukhruf/source": "./src/lint/plugin.ts",
46
+ "types": "./dist/lint/plugin.d.ts",
47
+ "import": "./dist/lint/plugin.js",
48
+ "default": "./dist/lint/plugin.js"
41
49
  }
42
50
  },
43
51
  "files": [
@@ -55,6 +63,6 @@
55
63
  "prettier": "^3.0.0"
56
64
  },
57
65
  "devDependencies": {
58
- "@zukhruf/testing": "^0.4.0"
66
+ "@zukhruf/testing": "^0.4.1"
59
67
  }
60
68
  }