@codependix/nx 0.0.1 β†’ 0.0.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## 0.0.3 (2026-10-13)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **callidescope,codependix,configuration:** πŸ› harden the codependix nx plugin for consumers outside this workspace ([#1444](https://github.com/organizzolini/codebase/pull/1444), [#1433](https://github.com/organizzolini/codebase/issues/1433))
6
+
7
+ ### 🧱 Updated Dependencies
8
+
9
+ - Updated codependix-cli to 0.0.18
10
+
11
+ ## 0.0.2 (2026-10-13)
12
+
13
+ ### 🧱 Updated Dependencies
14
+
15
+ - Updated codependix-cli to 0.0.17
16
+
1
17
  ## 0.0.1 (2026-10-13)
2
18
 
3
19
  ### πŸš€ Features
package/README.md CHANGED
@@ -44,16 +44,19 @@ Register it in `nx.json`:
44
44
  | `configurationPath` | Where the codependix configuration lives. `codependix.config.ts`, then `configuration/codependix.config.ts`, are searched when omitted |
45
45
  | `gateTargetName` | Name of the inferred gate target. `codependix-gate` when omitted |
46
46
 
47
- The gate runs the command line under `node --import
48
- @swc-node/register/esm-register` from the workspace root, so the root must
49
- resolve `@swc-node/register` and carry a `tsconfig.json` that emits decorator
50
- metadata β€” the boundary check boots NestJS containers from their TypeScript
51
- sources, and constructor injection reads that metadata.
47
+ The gate runs the command line under the `@swc-node/register` hooks, which
48
+ this plugin depends on and registers itself β€” the workspace does not need to
49
+ install them. The workspace root does need a `tsconfig.json` that emits
50
+ decorator metadata: the hooks read it from the working directory, the
51
+ boundary check boots NestJS containers from their TypeScript sources, and
52
+ constructor injection reads that metadata.
52
53
 
53
54
  ## Usage
54
55
 
55
- The gate is inferred onto every project except the workspace root, whose
56
- dependency closure is the whole workspace:
56
+ The gate is inferred onto every project described by a `project.json`,
57
+ except the workspace root, whose dependency closure is the whole workspace. A
58
+ project Nx infers from a `package.json` alone gets no gate until it is given
59
+ a `project.json` as well.
57
60
 
58
61
  ```bash
59
62
  nx run lexico-entities:codependix-gate # one project
@@ -66,15 +69,20 @@ nx affected -t codependix-gate # only what changed
66
69
  Each gate runs, from the workspace root:
67
70
 
68
71
  ```bash
69
- node --import @swc-node/register/esm-register <@codependix/cli/main> \
72
+ node --import <file URL of @codependix/nx/loader> <@codependix/cli/main> \
70
73
  map --directory <workspaceRoot> --config <configurationPath> \
71
74
  --check boundaries --projects <project>
72
75
  ```
73
76
 
74
- The command line's entry is resolved through `@codependix/cli`'s package
75
- exports, so the same gate runs the TypeScript source inside this workspace and
76
- the built `dist/src/main.js` from an installed copy. Its output is streamed to
77
- the task as it arrives, and the task passes only when it exits zero.
77
+ `@codependix/nx/loader` registers the `@swc-node/register` hooks resolved from
78
+ this plugin's own location. The hook's own `@swc-node/register/esm-register`
79
+ would resolve them from the working directory instead β€” the consumer's root,
80
+ where a package manager such as pnpm does not expose this plugin's
81
+ dependencies. The loader and the command line's entry are both resolved
82
+ through package exports, so the same gate runs the TypeScript sources inside
83
+ this workspace and the built `dist/` files from an installed copy. Its output
84
+ is streamed to the task as it arrives, and the task passes only when it exits
85
+ zero.
78
86
 
79
87
  **A dependency's broken boundary is that dependency's gate's business.** The
80
88
  graphs are built over the project and everything it depends on, so a cycle
@@ -88,21 +96,76 @@ live in, the project's own `codependix.config.*`, and the codependix command
88
96
  line itself β€” because no judged project depends on the code that decides its
89
97
  verdict, a change to that code would otherwise replay every cached pass:
90
98
 
91
- - When `@codependix/cli` is a package of the same workspace, a
92
- `{workspaceRoot}/<package>/src/**/*` and `{workspaceRoot}/<package>/package.json`
93
- input for it and for every workspace package it reaches through
94
- `workspace:` dependencies. File globs rather than `{ "input", "projects" }`
95
- inputs, because Nx's affected computation follows `{workspaceRoot}` globs
96
- and ignores the latter β€” so a branch that changes the command line selects
97
- every gate.
99
+ - When `@codependix/cli` is a package of the same workspace, two
100
+ `{workspaceRoot}` inputs for it and for every workspace package it reaches
101
+ through `workspace:` dependencies: `<package>/package.json` and
102
+ `<package>/src/**/!(*.test.*|*.spec.*)` β€” the sources without their tests,
103
+ so a test-only edit to the command line invalidates no gate beyond that
104
+ package's own and its dependents'. File globs
105
+ rather than `{ "input", "projects" }` inputs, because Nx's affected
106
+ computation follows `{workspaceRoot}` globs and ignores the latter β€” so a
107
+ branch that changes the command line's sources selects every gate, and one
108
+ that changes only its tests does not. The tests are excluded inside the
109
+ glob rather than by a `!`-prefixed input, which the affected computation
110
+ ignores.
98
111
  - When it is installed from a registry, an `externalDependencies` input naming
99
112
  it and the `@codependix/*` packages it depends on, so a version bump
100
- invalidates the cache.
101
-
102
- If the command line cannot be resolved while the graph is built, those inputs
103
- are left out rather than failing the graph. The target declares no
104
- `configurations`, so an aggregator run with `--configuration=check` falls
105
- through to the defaults.
113
+ invalidates the cache. Nx hashes an external dependency together with
114
+ everything it depends on, so the `@codependix/*` packages beneath those are
115
+ covered too.
116
+ - In either case, `{workspaceRoot}/tsconfig.json` and every tsconfig it
117
+ `extends`. The loader (`@swc-node/register`) takes its compiler options β€”
118
+ `emitDecoratorMetadata` among them, which decides how NestJS sources
119
+ compile β€” from `SWC_NODE_PROJECT` or `TS_NODE_PROJECT`, else from the
120
+ `tsconfig.json` in the gate's working directory, the workspace root, and
121
+ never from a package's own. That file reaches its bases through `extends`,
122
+ so inference follows the chain much as TypeScript resolves it β€” a string
123
+ or an array, through every level, comments and trailing commas allowed,
124
+ `.json` appended to a path naming no file, and a bare package name taken
125
+ to its `tsconfig.json` or its `exports` (not to a `tsconfig` field in its
126
+ manifest, which is rare):
127
+ - A base in the workspace, by relative path or through a package of the
128
+ same workspace, is another `{workspaceRoot}` input. So is one that is
129
+ missing or cannot be parsed β€” the edit that fixes it invalidates the
130
+ gate β€” though what it would extend cannot be followed, and Nx's logger
131
+ warns naming it.
132
+ - A base an installed package provides, such as `@tsconfig/node24` β€”
133
+ named by package or by a path into `node_modules` β€” is named in an
134
+ `externalDependencies` input, so a version bump invalidates the cache,
135
+ but only when the root `package.json` declares the package from a
136
+ registry. Nx fails every task whose `externalDependencies` names a
137
+ package missing from its graph, so one declared only by another package,
138
+ or through `workspace:`, `file:`, `link:`, or `portal:`, is skipped with
139
+ a warning instead: declare it in the root `package.json` to have it
140
+ hashed.
141
+ - A base outside the workspace, or a package base that resolves to no file,
142
+ cannot be named by any input, and is skipped with a warning.
143
+
144
+ A `SWC_NODE_PROJECT` or `TS_NODE_PROJECT` pointing elsewhere is not
145
+ followed: add that file to the target's inputs yourself. Nor does a
146
+ gitignored base, such as a generated framework tsconfig, invalidate
147
+ anything: it is named, but Nx's file map leaves ignored files out.
148
+
149
+ Each workspace package is resolved on its own, through its entry rather than
150
+ its manifest, so one that cannot be resolved costs only its own inputs: Nx's
151
+ logger warns naming it, and every other package keeps its inputs. If the
152
+ command line itself cannot be resolved while the graph is built, the tool
153
+ inputs are left out and the warning names it β€” never failing the graph. The
154
+ tsconfig chain is resolved apart from the command line, so either failing
155
+ keeps the other's inputs. The
156
+ target declares no `configurations`, so an aggregator run with
157
+ `--configuration=check` falls through to the defaults.
158
+
159
+ **A gate whose `projects` or `tags` select anything other than its own project
160
+ is never replayed from the cache.** Its inputs cover its own project and that project's dependencies,
161
+ not the projects such a run judges, so a hash built from them could replay a
162
+ pass after an edit to the very project that now fails. The executor's hasher
163
+ gives such a run a hash no other run shares, whether the selection came from
164
+ the command line, the target's options, or a configuration; a gate judging
165
+ only its own project β€” including one whose `projects` names exactly that
166
+ project β€” is hashed from its inputs exactly as Nx would hash it. Because
167
+ the target has a hasher, `nx show target inputs` prints a custom-hasher
168
+ warning instead of a file list β€” the inputs above still decide the hash.
106
169
 
107
170
  ### Executor options
108
171
 
@@ -196,6 +259,9 @@ graph LR
196
259
  file_src_executors_gate_executor_ts["src/executors/gate/executor.ts"]
197
260
  file_src_executors_gate_executor_types_ts["src/executors/gate/executor.types.ts"]
198
261
  file_src_executors_gate_executor_unit_test_ts["src/executors/gate/executor.unit.test.ts"]
262
+ file_src_executors_gate_hasher_ts["src/executors/gate/hasher.ts"]
263
+ file_src_executors_gate_hasher_unit_test_ts["src/executors/gate/hasher.unit.test.ts"]
264
+ file_src_executors_gate_loader_unit_test_ts["src/executors/gate/loader.unit.test.ts"]
199
265
  file_src_index_ts["src/index.ts"]
200
266
  file_src_index_unit_test_ts["src/index.unit.test.ts"]
201
267
  file_src_main_module_ts["src/main.module.ts"]
@@ -208,6 +274,8 @@ graph LR
208
274
  file_src_modules_plugin_plugin_context_utilities_unit_test_ts["src/modules/plugin/plugin-context.utilities.unit.test.ts"]
209
275
  file_src_modules_plugin_plugin_inputs_utilities_ts["src/modules/plugin/plugin-inputs.utilities.ts"]
210
276
  file_src_modules_plugin_plugin_inputs_utilities_unit_test_ts["src/modules/plugin/plugin-inputs.utilities.unit.test.ts"]
277
+ file_src_modules_plugin_plugin_tsconfig_utilities_ts["src/modules/plugin/plugin-tsconfig.utilities.ts"]
278
+ file_src_modules_plugin_plugin_tsconfig_utilities_unit_test_ts["src/modules/plugin/plugin-tsconfig.utilities.unit.test.ts"]
211
279
  file_src_modules_plugin_plugin_constants_ts["src/modules/plugin/plugin.constants.ts"]
212
280
  file_src_modules_plugin_plugin_module_ts["src/modules/plugin/plugin.module.ts"]
213
281
  file_src_modules_plugin_plugin_service_ts["src/modules/plugin/plugin.service.ts"]
@@ -224,8 +292,14 @@ graph LR
224
292
  file_src_executors_gate_executor_types_ts --> file_src_modules_gate_gate_types_ts
225
293
  file_src_executors_gate_executor_unit_test_ts --> file_src_executors_gate_executor_ts
226
294
  file_src_executors_gate_executor_unit_test_ts --> file_src_modules_gate_gate_service_ts
295
+ file_src_executors_gate_hasher_ts --> file_src_modules_gate_gate_types_ts
296
+ file_src_executors_gate_hasher_ts --> file_src_modules_plugin_plugin_context_utilities_ts
297
+ file_src_executors_gate_hasher_unit_test_ts --> file_src_executors_gate_hasher_ts
298
+ file_src_executors_gate_hasher_unit_test_ts --> file_src_modules_gate_gate_service_ts
299
+ file_src_executors_gate_hasher_unit_test_ts --> file_src_modules_gate_gate_types_ts
227
300
  file_src_index_ts --> file_src_modules_plugin_plugin_context_utilities_ts
228
301
  file_src_index_ts --> file_src_modules_plugin_plugin_inputs_utilities_ts
302
+ file_src_index_ts --> file_src_modules_plugin_plugin_tsconfig_utilities_ts
229
303
  file_src_index_ts --> file_src_modules_plugin_plugin_constants_ts
230
304
  file_src_index_unit_test_ts --> file_src_index_ts
231
305
  file_src_index_unit_test_ts --> file_src_modules_plugin_plugin_service_ts
@@ -238,6 +312,7 @@ graph LR
238
312
  file_src_modules_gate_gate_service_ts --> file_src_modules_gate_gate_types_ts
239
313
  file_src_modules_gate_gate_service_ts --> file_src_modules_plugin_plugin_service_ts
240
314
  file_src_modules_gate_gate_service_unit_test_ts --> file_src_modules_gate_gate_service_ts
315
+ file_src_modules_gate_gate_service_unit_test_ts --> file_src_modules_gate_gate_types_ts
241
316
  file_src_modules_gate_gate_service_unit_test_ts --> file_src_modules_plugin_plugin_service_ts
242
317
  file_src_modules_plugin_plugin_context_utilities_ts --> file_src_main_module_ts
243
318
  file_src_modules_plugin_plugin_context_utilities_ts --> file_src_modules_gate_gate_service_ts
@@ -250,6 +325,12 @@ graph LR
250
325
  file_src_modules_plugin_plugin_inputs_utilities_ts --> file_src_modules_plugin_plugin_constants_ts
251
326
  file_src_modules_plugin_plugin_inputs_utilities_ts --> file_src_modules_plugin_plugin_types_ts
252
327
  file_src_modules_plugin_plugin_inputs_utilities_unit_test_ts --> file_src_modules_plugin_plugin_inputs_utilities_ts
328
+ file_src_modules_plugin_plugin_inputs_utilities_unit_test_ts --> file_src_modules_plugin_plugin_types_ts
329
+ file_src_modules_plugin_plugin_tsconfig_utilities_ts --> file_src_modules_plugin_plugin_inputs_utilities_ts
330
+ file_src_modules_plugin_plugin_tsconfig_utilities_ts --> file_src_modules_plugin_plugin_constants_ts
331
+ file_src_modules_plugin_plugin_tsconfig_utilities_ts --> file_src_modules_plugin_plugin_types_ts
332
+ file_src_modules_plugin_plugin_tsconfig_utilities_unit_test_ts --> file_src_modules_plugin_plugin_tsconfig_utilities_ts
333
+ file_src_modules_plugin_plugin_tsconfig_utilities_unit_test_ts --> file_src_modules_plugin_plugin_types_ts
253
334
  file_src_modules_plugin_plugin_module_ts --> file_src_modules_plugin_plugin_service_ts
254
335
  file_src_modules_plugin_plugin_service_ts --> file_src_modules_plugin_plugin_constants_ts
255
336
  file_src_modules_plugin_plugin_service_ts --> file_src_modules_plugin_plugin_types_ts
@@ -258,42 +339,166 @@ graph LR
258
339
  ```
259
340
  <!-- codependix:end name="codependix-file-imports" -->
260
341
 
342
+ <!-- callidescope:start -->
343
+
344
+ ## πŸ”­ Callidescope
345
+
346
+ Call stacks traced through `packages/ic-suite/codependix/codependix-nx`, deepest first. Each frame shows what it takes, what it returns, and what its documentation says.
347
+
348
+ | Measure | Value |
349
+ | --- | --- |
350
+ | Callables | 77 |
351
+ | Files | 22 |
352
+ | Calls traced | 89 |
353
+ | Call stacks | 3 |
354
+ | Deepest stack | 6 |
355
+ | Stacks through recursion | 0 |
356
+ | Unfollowable calls | 7 |
357
+
358
+ ### Limits
359
+
360
+ What this project is judged against, as declared in its own `callidescope.config.ts`.
361
+
362
+ | Limit | Value |
363
+ | --- | --- |
364
+ | `maximumDepth` | 6 |
365
+ | `maximumBreadth` | 5 |
366
+
367
+ ### Call stacks (depth)
368
+
369
+ **1. `anonymous`** β€” depth β‰₯ 6 Β· orphan-root
370
+
371
+ ```text
372
+ πŸš€ anonymous(…): Promise<CreateNodesResultArray> [packages/ic-suite/codependix/codependix-nx/src/index.ts:45]
373
+ └─> resolveToolInputs(args: ResolveToolInputsArguments): InferredInput[] [packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-inputs.utilities.ts:65]
374
+ ↳ The cache inputs that tie a gate to the codependix command line it runs.
375
+ └─> resolveWorkspaceInputs(…): InferredInput[] [packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-inputs.utilities.ts:209]
376
+ ↳ Globs over the sources and manifest of the command line and of every workspace package it reaches, sorted so the cache…
377
+ └─> collectWorkspacePackages(cliDirectory: string): WorkspacePackages [packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-inputs.utilities.ts:103]
378
+ ↳ Collects a workspace package and every workspace package it reaches, development dependencies included: a package this…
379
+ └─> readDependencies(directory: string): [string, unknown][] [packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-inputs.utilities.ts:41]
380
+ ↳ Every dependency a package's manifest declares, in either map.
381
+ └─> readManifest(directory: string): Record<string, unknown> [packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-inputs.utilities.ts:173]
382
+ ↳ Reads a package directory's manifest, or an empty one when there is none or it cannot be parsed β€” which leaves that…
383
+ ```
384
+
385
+ **2. `gateExecutor`** β€” depth β‰₯ 6 Β· orphan-root
386
+
387
+ ```text
388
+ πŸš€ gateExecutor(…): Promise<{ success: boolean; }> [packages/ic-suite/codependix/codependix-nx/src/executors/gate/executor.ts:21]
389
+ ↳ Fails one project's task when a codependix boundary finding is charged to it.
390
+ └─> GateService.run(args: RunGateArguments): Promise<boolean> [packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.service.ts:287]
391
+ ↳ Runs one gate, and settles on whether it passed.
392
+ └─> GateService.resolveConfigurationPath(…): string [packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.service.ts:241]
393
+ ↳ Resolves the configuration path one gate runs with.
394
+ └─> PluginService.readRegisteredOptions(nxConfiguration: unknown): unknown [packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin.service.ts:136]
395
+ ↳ Finds this plugin's own entry in an `nx.json` and returns its options.
396
+ └─> PluginService.map(…)(entry: unknown): Record<string, unknown> [packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin.service.ts:144]
397
+ └─> PluginService.toRecord(value: unknown): Record<string, unknown> [packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin.service.ts:79]
398
+ ↳ Copies an untrusted value into a record, or an empty one.
399
+ ```
400
+
401
+ **3. `gateHasher`** β€” depth 6 Β· orphan-root
402
+
403
+ ```text
404
+ πŸš€ gateHasher(task: Task, context: GateHasherContext): Promise<Hash> [packages/ic-suite/codependix/codependix-nx/src/executors/gate/hasher.ts:17]
405
+ ↳ Hashes one gate task for Nx's cache.
406
+ └─> GateService.hashTask(args: HashGateTaskArguments): Promise<Hash> [packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.service.ts:215]
407
+ ↳ Hashes one gate task for Nx's cache β€” or, when it judges any project but its own, gives it a hash no run shares, so its…
408
+ └─> GateService.judgesOwnProject(args: HashGateTaskArguments): boolean [packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.service.ts:55]
409
+ ↳ Whether a gate task judges exactly the project it belongs to.
410
+ └─> GateService.resolveSelection(…): GateSelection [packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.service.ts:266]
411
+ ↳ Resolves which projects one gate judges.
412
+ └─> GateService.readNameList(value: readonly string[] | undefined): string[] [packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.service.ts:81]
413
+ ↳ Reads a list of names out of an executor's options.
414
+ └─> GateService.filter(…)(entry: string): boolean [packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.service.ts:85]
415
+ ```
416
+
417
+ ### Breadth
418
+
419
+ | Callable | Breadth | Calls directly | Location |
420
+ | --- | --- | --- | --- |
421
+ | `resolveToolInputs` | 5 | `locatePackage`, `warnUnresolved`, `isInsideWorkspace`, `resolveWorkspaceInputs`, `resolveExternalInputs` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-inputs.utilities.ts:65` |
422
+ | `anonymous` | 5 | `resolvePluginService`, `PluginService.inferTargets`, `resolveToolInputs`, `resolveTsconfigInputs`, `flatMap(…)` | `packages/ic-suite/codependix/codependix-nx/src/index.ts:45` |
423
+ | `PluginService.readRegisteredOptions` | 4 | `PluginService.toRecord`, `PluginService.isUnknownArray`, `PluginService.find(…)`, `PluginService.map(…)` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin.service.ts:136` |
424
+
425
+ <details>
426
+ <summary>32 more callables</summary>
427
+
428
+ | Callable | Breadth | Calls directly | Location |
429
+ | --- | --- | --- | --- |
430
+ | `GateService.run` | 4 | `GateService.buildCommandArguments`, `GateService.resolveSelection`, `GateService.resolveConfigurationPath`, `GateService.spawnCommandLine` | `packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.service.ts:287` |
431
+ | `collectWorkspacePackages` | 4 | `map(…)`, `filter(…)`, `readDependencies`, `locatePackage` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-inputs.utilities.ts:103` |
432
+ | `followExtendsChain` | 4 | `readRegistryDependencies`, `readExtends`, `resolveExtendedBase`, `warnSkipped` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-tsconfig.utilities.ts:89` |
433
+ | `resolveExtendedBase` | 4 | `resolvePathBase`, `resolvePackageBase`, `isInsideWorkspace`, `readInstalledPackageName` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-tsconfig.utilities.ts:204` |
434
+ | `PluginService.selectProjectRoots` | 3 | `PluginService.filter(…)`, `PluginService.map(…)`, `PluginService.filter(…)` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin.service.ts:65` |
435
+ | `PluginService.inferTargets` | 3 | `PluginService.resolvePluginOptions`, `PluginService.map(…)`, `PluginService.selectProjectRoots` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin.service.ts:99` |
436
+ | `PluginService.resolvePluginOptions` | 3 | `PluginService.toRecord`, `PluginService.readString`, `PluginService.find(…)` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin.service.ts:158` |
437
+ | `GateService.judgesOwnProject` | 3 | `GateService.readTaskOptions`, `GateService.resolveSelection`, `GateService.toNameList` | `packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.service.ts:55` |
438
+ | `GateService.readNameList` | 3 | `GateService.filter(…)`, `GateService.map(…)`, `GateService.flatMap(…)` | `packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.service.ts:81` |
439
+ | `GateService.anonymous` | 3 | `GateService.on(…)`, `GateService.on(…)`, `GateService.on(…)` | `packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.service.ts:143` |
440
+ | `GateService.resolveConfigurationPath` | 3 | `PluginService.resolvePluginOptions`, `PluginService.readRegisteredOptions`, `GateService.readNxConfiguration` | `packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.service.ts:241` |
441
+ | `resolveExternalInputs` | 3 | `filter(…)`, `map(…)`, `readDependencies` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-inputs.utilities.ts:197` |
442
+ | `resolveWorkspaceInputs` | 3 | `collectWorkspacePackages`, `warnUnresolved`, `flatMap(…)` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-inputs.utilities.ts:209` |
443
+ | `readRegistryDependencies` | 3 | `map(…)`, `filter(…)`, `readDependencies` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-tsconfig.utilities.ts:180` |
444
+ | `readDependencies` | 2 | `readManifest`, `toRecord` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-inputs.utilities.ts:41` |
445
+ | `resolveTsconfigInputs` | 2 | `followExtendsChain`, `map(…)` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-tsconfig.utilities.ts:42` |
446
+ | `gateExecutor` | 2 | `resolveGateService`, `GateService.run` | `packages/ic-suite/codependix/codependix-nx/src/executors/gate/executor.ts:21` |
447
+ | `gateHasher` | 2 | `resolveGateService`, `GateService.hashTask` | `packages/ic-suite/codependix/codependix-nx/src/executors/gate/hasher.ts:17` |
448
+ | `PluginService.map(…)` | 1 | `PluginService.toRecord` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin.service.ts:144` |
449
+ | `GateService.readTaskOptions` | 1 | `GateService.toRecord` | `packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.service.ts:111` |
450
+ | `GateService.spawnCommandLine` | 1 | `GateService.anonymous` | `packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.service.ts:139` |
451
+ | `GateService.toNameList` | 1 | `GateService.filter(…)` | `packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.service.ts:162` |
452
+ | `GateService.hashTask` | 1 | `GateService.judgesOwnProject` | `packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.service.ts:215` |
453
+ | `GateService.resolveSelection` | 1 | `GateService.readNameList` | `packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.service.ts:266` |
454
+ | `resolveGateService` | 1 | `resolvePluginContext` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-context.utilities.ts:16` |
455
+ | `resolvePluginService` | 1 | `resolvePluginContext` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-context.utilities.ts:23` |
456
+ | `locatePackage` | 1 | `readManifest` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-inputs.utilities.ts:145` |
457
+ | `flatMap(…)` | 1 | `map(…)` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-inputs.utilities.ts:224` |
458
+ | `readExtends` | 1 | `filter(…)` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-tsconfig.utilities.ts:133` |
459
+ | `filter(…)` | 1 | `some(…)` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-tsconfig.utilities.ts:184` |
460
+ | `resolvePackageBase` | 1 | `flatMap(…)` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-tsconfig.utilities.ts:247` |
461
+ | `warnSkipped` | 1 | `describeSkippedBase` | `packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-tsconfig.utilities.ts:291` |
462
+
463
+ </details>
464
+ <!-- callidescope:end -->
465
+
261
466
  <!-- codometer:start -->
262
467
 
263
468
  ## ⏲️ Codometer
264
469
 
265
470
  ### Project
266
471
 
267
- ![Lines of Code](https://img.shields.io/badge/Lines_of_Code-2323-22c55e?style=flat-square)
268
- ![Repository Size](https://img.shields.io/badge/Repository_Size-87.65_kB-6b7280?style=flat-square)
472
+ ![Lines of Code](https://img.shields.io/badge/Lines_of_Code-3917-22c55e?style=flat-square)
473
+ ![Repository Size](https://img.shields.io/badge/Repository_Size-140.31_kB-6b7280?style=flat-square)
269
474
  ![Folders](https://img.shields.io/badge/Folders-7-4a4a4a?style=flat-square)
270
- ![Source Files](https://img.shields.io/badge/Source_Files-29-3178c6?style=flat-square)
475
+ ![Source Files](https://img.shields.io/badge/Source_Files-35-3178c6?style=flat-square)
271
476
 
272
477
  ### TypeScript
273
478
 
274
- ![TypeScript Files](https://img.shields.io/badge/TypeScript_Files-29-3178c6?style=flat-square)
275
- ![Interfaces](https://img.shields.io/badge/Interfaces-8-0ea5e9?style=flat-square)
479
+ ![TypeScript Files](https://img.shields.io/badge/TypeScript_Files-34-3178c6?style=flat-square)
480
+ ![Interfaces](https://img.shields.io/badge/Interfaces-14-0ea5e9?style=flat-square)
276
481
  ![Generic Declarations](https://img.shields.io/badge/Generic_Declarations-0-0369a1?style=flat-square)
277
482
  ![Enums](https://img.shields.io/badge/Enums-0-f97316?style=flat-square)
278
483
  ![Decorators](https://img.shields.io/badge/Decorators-5-db2777?style=flat-square)
279
- ![Doc Comments](https://img.shields.io/badge/Doc_Comments-80-6366f1?style=flat-square)
484
+ ![Doc Comments](https://img.shields.io/badge/Doc_Comments-119-6366f1?style=flat-square)
280
485
  ![Static Methods](https://img.shields.io/badge/Static_Methods-0-166534?style=flat-square)
281
486
 
282
487
  ### JavaScript
283
488
 
284
- ![JavaScript Files](https://img.shields.io/badge/JavaScript_Files-0-f7df1e?style=flat-square)
285
- ![Test Files](https://img.shields.io/badge/Test_Files-7-10b981?style=flat-square)
286
- ![External Packages](https://img.shields.io/badge/External_Packages-13-8b5cf6?style=flat-square)
489
+ ![JavaScript Files](https://img.shields.io/badge/JavaScript_Files-1-f7df1e?style=flat-square)
490
+ ![Test Files](https://img.shields.io/badge/Test_Files-10-10b981?style=flat-square)
491
+ ![External Packages](https://img.shields.io/badge/External_Packages-14-8b5cf6?style=flat-square)
287
492
  ![Classes](https://img.shields.io/badge/Classes-5-7c3aed?style=flat-square)
288
- ![Functions](https://img.shields.io/badge/Functions-138-16a34a?style=flat-square)
289
- ![Methods](https://img.shields.io/badge/Methods-30-15803d?style=flat-square)
290
- ![Sync Functions](https://img.shields.io/badge/Sync_Functions-132-4ade80?style=flat-square)
291
- ![Async Functions](https://img.shields.io/badge/Async_Functions-36-059669?style=flat-square)
292
- ![Constants](https://img.shields.io/badge/Constants-75-dc2626?style=flat-square)
293
- ![Imports](https://img.shields.io/badge/Imports-96-0284c7?style=flat-square)
294
- ![Exported Symbols](https://img.shields.io/badge/Exported_Symbols-37-ea580c?style=flat-square)
295
- ![Comments](https://img.shields.io/badge/Comments-125-64748b?style=flat-square)
296
- ![Comment Lines](https://img.shields.io/badge/Comment_Lines-342-475569?style=flat-square)
493
+ ![Functions](https://img.shields.io/badge/Functions-208-16a34a?style=flat-square)
494
+ ![Methods](https://img.shields.io/badge/Methods-36-15803d?style=flat-square)
495
+ ![Sync Functions](https://img.shields.io/badge/Sync_Functions-199-4ade80?style=flat-square)
496
+ ![Async Functions](https://img.shields.io/badge/Async_Functions-45-059669?style=flat-square)
497
+ ![Constants](https://img.shields.io/badge/Constants-163-dc2626?style=flat-square)
498
+ ![Imports](https://img.shields.io/badge/Imports-132-0284c7?style=flat-square)
499
+ ![Exported Symbols](https://img.shields.io/badge/Exported_Symbols-53-ea580c?style=flat-square)
500
+ ![Comments](https://img.shields.io/badge/Comments-211-64748b?style=flat-square)
501
+ ![Comment Lines](https://img.shields.io/badge/Comment_Lines-511-475569?style=flat-square)
297
502
  ![TODO Comments](https://img.shields.io/badge/TODO_Comments-0-ca8a04?style=flat-square)
298
503
 
299
504
  ### Python
@@ -314,16 +519,16 @@ graph LR
314
519
  ### JSON
315
520
 
316
521
  ![JSON Files](https://img.shields.io/badge/JSON_Files-6-a16207?style=flat-square)
317
- ![JSON Lines](https://img.shields.io/badge/JSON_Lines-219-ca8a04?style=flat-square)
318
- ![JSON Objects](https://img.shields.io/badge/JSON_Objects-51-7c3aed?style=flat-square)
522
+ ![JSON Lines](https://img.shields.io/badge/JSON_Lines-227-ca8a04?style=flat-square)
523
+ ![JSON Objects](https://img.shields.io/badge/JSON_Objects-52-7c3aed?style=flat-square)
319
524
  ![JSON Arrays](https://img.shields.io/badge/JSON_Arrays-15-8b5cf6?style=flat-square)
320
- ![JSON Properties](https://img.shields.io/badge/JSON_Properties-143-0284c7?style=flat-square)
321
- ![JSON Strings](https://img.shields.io/badge/JSON_Strings-120-16a34a?style=flat-square)
525
+ ![JSON Properties](https://img.shields.io/badge/JSON_Properties-148-0284c7?style=flat-square)
526
+ ![JSON Strings](https://img.shields.io/badge/JSON_Strings-126-16a34a?style=flat-square)
322
527
  ![JSON Numbers](https://img.shields.io/badge/JSON_Numbers-1-059669?style=flat-square)
323
528
  ![JSON Booleans](https://img.shields.io/badge/JSON_Booleans-8-0ea5e9?style=flat-square)
324
529
  ![JSON Nulls](https://img.shields.io/badge/JSON_Nulls-0-64748b?style=flat-square)
325
- ![JSON Items](https://img.shields.io/badge/JSON_Items-46-475569?style=flat-square)
326
- ![JSON Nodes](https://img.shields.io/badge/JSON_Nodes-195-dc2626?style=flat-square)
530
+ ![JSON Items](https://img.shields.io/badge/JSON_Items-48-475569?style=flat-square)
531
+ ![JSON Nodes](https://img.shields.io/badge/JSON_Nodes-202-dc2626?style=flat-square)
327
532
  ![JSON Max Depth](https://img.shields.io/badge/JSON_Max_Depth-5-ea580c?style=flat-square)
328
533
 
329
534
  ### YAML
@@ -409,9 +614,9 @@ graph LR
409
614
  ![Command Files](https://img.shields.io/badge/Command_Files-0-16a34a?style=flat-square)
410
615
  ![Constants Files](https://img.shields.io/badge/Constants_Files-2-ea580c?style=flat-square)
411
616
  ![Types Files](https://img.shields.io/badge/Types_Files-3-db2777?style=flat-square)
412
- ![Utilities Files](https://img.shields.io/badge/Utilities_Files-2-0ea5e9?style=flat-square)
617
+ ![Utilities Files](https://img.shields.io/badge/Utilities_Files-3-0ea5e9?style=flat-square)
413
618
  ![TypeORM Entities](https://img.shields.io/badge/TypeORM_Entities-0-059669?style=flat-square)
414
- ![Unit Tests](https://img.shields.io/badge/Unit_Tests-6-ca8a04?style=flat-square)
619
+ ![Unit Tests](https://img.shields.io/badge/Unit_Tests-9-ca8a04?style=flat-square)
415
620
  ![Integration Tests](https://img.shields.io/badge/Integration_Tests-1-7c3aed?style=flat-square)
416
621
  ![End To End Tests](https://img.shields.io/badge/End_To_End_Tests-0-0284c7?style=flat-square)
417
622
  ![CSS Comment Budget](https://img.shields.io/badge/CSS_Comment_Budget-0-16a34a?style=flat-square)
@@ -449,23 +654,23 @@ graph LR
449
654
  ### Markdown
450
655
 
451
656
  ![Markdown Files](https://img.shields.io/badge/Markdown_Files-2-083fa1?style=flat-square)
452
- ![Markdown Lines](https://img.shields.io/badge/Markdown_Lines-254-1f6feb?style=flat-square)
657
+ ![Markdown Lines](https://img.shields.io/badge/Markdown_Lines-178-1f6feb?style=flat-square)
453
658
  ![H1](https://img.shields.io/badge/H1-1-7c3aed?style=flat-square)
454
- ![H2](https://img.shields.io/badge/H2-8-8b5cf6?style=flat-square)
455
- ![H3](https://img.shields.io/badge/H3-14-a78bfa?style=flat-square)
659
+ ![H2](https://img.shields.io/badge/H2-7-8b5cf6?style=flat-square)
660
+ ![H3](https://img.shields.io/badge/H3-11-a78bfa?style=flat-square)
456
661
  ![H4](https://img.shields.io/badge/H4-0-c4b5fd?style=flat-square)
457
662
  ![H5](https://img.shields.io/badge/H5-0-ddd6fe?style=flat-square)
458
663
  ![H6](https://img.shields.io/badge/H6-0-ede9fe?style=flat-square)
459
- ![Paragraphs](https://img.shields.io/badge/Paragraphs-50-64748b?style=flat-square)
664
+ ![Paragraphs](https://img.shields.io/badge/Paragraphs-31-64748b?style=flat-square)
460
665
  ![Lists](https://img.shields.io/badge/Lists-8-16a34a?style=flat-square)
461
- ![List Items](https://img.shields.io/badge/List_Items-27-22c55e?style=flat-square)
666
+ ![List Items](https://img.shields.io/badge/List_Items-20-22c55e?style=flat-square)
462
667
  ![Task List Items](https://img.shields.io/badge/Task_List_Items-0-4ade80?style=flat-square)
463
- ![Tables](https://img.shields.io/badge/Tables-2-0284c7?style=flat-square)
464
- ![Table Rows](https://img.shields.io/badge/Table_Rows-10-0ea5e9?style=flat-square)
465
- ![Links](https://img.shields.io/badge/Links-11-059669?style=flat-square)
668
+ ![Tables](https://img.shields.io/badge/Tables-0-0284c7?style=flat-square)
669
+ ![Table Rows](https://img.shields.io/badge/Table_Rows-0-0ea5e9?style=flat-square)
670
+ ![Links](https://img.shields.io/badge/Links-14-059669?style=flat-square)
466
671
  ![Images](https://img.shields.io/badge/Images-0-10b981?style=flat-square)
467
- ![Code Blocks](https://img.shields.io/badge/Code_Blocks-11-dc2626?style=flat-square)
468
- ![Inline Code](https://img.shields.io/badge/Inline_Code-89-ef4444?style=flat-square)
672
+ ![Code Blocks](https://img.shields.io/badge/Code_Blocks-4-dc2626?style=flat-square)
673
+ ![Inline Code](https://img.shields.io/badge/Inline_Code-51-ef4444?style=flat-square)
469
674
  ![Block Quotes](https://img.shields.io/badge/Block_Quotes-0-ca8a04?style=flat-square)
470
675
  ![Thematic Breaks](https://img.shields.io/badge/Thematic_Breaks-0-a16207?style=flat-square)
471
676
  <!-- codometer:end -->
@@ -4,12 +4,22 @@ import { Injectable as t, Module as n } from "@nestjs/common";
4
4
  import { existsSync as r, readFileSync as i } from "node:fs";
5
5
  import a from "node:path";
6
6
  import { spawn as o } from "node:child_process";
7
- import { createRequire as s } from "node:module";
7
+ import { randomUUID as s } from "node:crypto";
8
+ import { createRequire as c } from "node:module";
9
+ import { pathToFileURL as l } from "node:url";
8
10
  //#region \0rolldown/runtime.js
9
- var c = Object.defineProperty, __name = (e, t) => c(e, "name", {
11
+ var u = Object.defineProperty, __name = (e, t) => u(e, "name", {
10
12
  value: t,
11
13
  configurable: !0
12
- }), l = "**/{project.json,codependix.config.*}", u = "project.json", d = "{projectRoot}/codependix.config.*", f = "__codependixPluginContext", p = "@codependix/nx", m = "codependix-gate", h = ["codependix.config.ts", "configuration/codependix.config.ts"], g = "@codependix/cli", _ = "workspace:", v = ["package.json", "src/**/*"];
14
+ }), d = "**/{project.json,codependix.config.*}", f = "project.json", p = "{projectRoot}/codependix.config.*", m = "__codependixPluginContext", h = "@codependix/nx", g = "codependix-gate", _ = ["codependix.config.ts", "configuration/codependix.config.ts"], v = "@codependix/cli", y = "workspace:", b = [
15
+ "file:",
16
+ "link:",
17
+ "portal:",
18
+ y
19
+ ], x = ["package.json", "src/**/!(*.test.*|*.spec.*)"], S = "{workspaceRoot}/tsconfig.json", C = "tsconfig.json", w = {
20
+ outside: "it lies outside the workspace",
21
+ unresolved: "it resolves to no file"
22
+ };
13
23
  //#endregion
14
24
  //#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateMetadata.js
15
25
  function __decorateMetadata(e, t) {
@@ -25,7 +35,7 @@ function __decorate(e, t, n, r) {
25
35
  }
26
36
  //#endregion
27
37
  //#region packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin.service.ts
28
- var y = class PluginService {
38
+ var T = class PluginService {
29
39
  constructor() {}
30
40
  isUnknownArray(e) {
31
41
  return Array.isArray(e);
@@ -35,7 +45,7 @@ var y = class PluginService {
35
45
  return typeof t == "string" && t !== "" ? t : void 0;
36
46
  }
37
47
  selectProjectRoots(e) {
38
- return e.filter((e) => a.basename(e) === u).map((e) => a.dirname(e)).filter((e) => e !== ".");
48
+ return e.filter((e) => a.basename(e) === f).map((e) => a.dirname(e)).filter((e) => e !== ".");
39
49
  }
40
50
  toRecord(e) {
41
51
  return typeof e == "object" && e ? { ...e } : {};
@@ -46,12 +56,12 @@ var y = class PluginService {
46
56
  options: e.options
47
57
  }), n = { [t.gateTargetName]: {
48
58
  cache: !0,
49
- executor: `${p}:gate`,
59
+ executor: `${h}:gate`,
50
60
  inputs: [
51
61
  "default",
52
62
  "^default",
53
63
  `{workspaceRoot}/${t.configurationPath}`,
54
- d,
64
+ p,
55
65
  ...e.toolInputs
56
66
  ],
57
67
  options: {}
@@ -70,7 +80,7 @@ var y = class PluginService {
70
80
  configurationPath: this.readString({
71
81
  key: "configurationPath",
72
82
  record: t
73
- }) ?? h.find((t) => e.exists(t)) ?? h[0],
83
+ }) ?? _.find((t) => e.exists(t)) ?? _[0],
74
84
  gateTargetName: this.readString({
75
85
  key: "gateTargetName",
76
86
  record: t
@@ -78,33 +88,51 @@ var y = class PluginService {
78
88
  };
79
89
  }
80
90
  };
81
- y = __decorate([t(), __decorateMetadata("design:paramtypes", [])], y);
91
+ T = __decorate([t(), __decorateMetadata("design:paramtypes", [])], T);
82
92
  //#endregion
83
93
  //#region packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin.module.ts
84
- var b = class PluginModule {};
85
- b = __decorate([n({
94
+ var E = class PluginModule {};
95
+ E = __decorate([n({
86
96
  controllers: [],
87
- exports: [y],
97
+ exports: [T],
88
98
  imports: [],
89
- providers: [y]
90
- })], b);
99
+ providers: [T]
100
+ })], E);
91
101
  //#endregion
92
102
  //#region packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.constants.ts
93
- var x = "@swc-node/register/esm-register", S = "@codependix/cli/main", C = "nx.json", w = class GateService {
103
+ var D = "@codependix/nx/loader", O = "@codependix/cli/main", k = "nx.json", A = class GateService {
94
104
  pluginService;
95
105
  constructor(e) {
96
106
  this.pluginService = e;
97
107
  }
108
+ judgesOwnProject(e) {
109
+ let { project: t } = e.task.target, n = this.readTaskOptions(e), r = this.resolveSelection({
110
+ options: {
111
+ projects: this.toNameList(n.projects),
112
+ tags: this.toNameList(n.tags)
113
+ },
114
+ projectName: t
115
+ });
116
+ return r.tags.length === 0 && r.projects.length === 1 && r.projects[0] === t;
117
+ }
98
118
  readNameList(e) {
99
119
  return (e ?? []).flatMap((e) => e.split(",")).map((e) => e.trim()).filter((e) => e !== "");
100
120
  }
101
121
  readNxConfiguration(e) {
102
122
  try {
103
- return JSON.parse(i(a.join(e, C), "utf8"));
123
+ return JSON.parse(i(a.join(e, k), "utf8"));
104
124
  } catch {
105
125
  return;
106
126
  }
107
127
  }
128
+ readTaskOptions(e) {
129
+ let { configuration: t, project: n, target: r } = e.task.target, i = this.toRecord(e.context.projectsConfigurations.projects[n]?.targets?.[r]), a = this.toRecord(i.configurations);
130
+ return {
131
+ ...this.toRecord(i.options),
132
+ ...this.toRecord(t === void 0 ? void 0 : a[t]),
133
+ ...e.task.overrides
134
+ };
135
+ }
108
136
  async spawnCommandLine(e) {
109
137
  return await new Promise((t, n) => {
110
138
  let r = o(process.execPath, e.argv, {
@@ -120,10 +148,16 @@ var x = "@swc-node/register/esm-register", S = "@codependix/cli/main", C = "nx.j
120
148
  });
121
149
  });
122
150
  }
151
+ toNameList(e) {
152
+ return (Array.isArray(e) ? e : [e]).filter((e) => typeof e == "string" || typeof e == "number").map(String);
153
+ }
154
+ toRecord(e) {
155
+ return typeof e == "object" && e ? { ...e } : {};
156
+ }
123
157
  buildCommandArguments(e) {
124
158
  return [
125
159
  "--import",
126
- e.loaderSpecifier,
160
+ e.loaderUrl,
127
161
  e.cliEntryPath,
128
162
  "map",
129
163
  "--directory",
@@ -137,6 +171,15 @@ var x = "@swc-node/register/esm-register", S = "@codependix/cli/main", C = "nx.j
137
171
  ...e.dependencies ? [] : ["--no-dependencies"]
138
172
  ];
139
173
  }
174
+ async hashTask(e) {
175
+ return this.judgesOwnProject(e) ? await e.context.hasher.hashTask(e.task, e.context.taskGraph, e.context.env ?? process.env) : {
176
+ details: {
177
+ command: `${e.task.id} judges projects its inputs do not cover`,
178
+ nodes: {}
179
+ },
180
+ value: s()
181
+ };
182
+ }
140
183
  resolveConfigurationPath(e) {
141
184
  return e.configurationPath !== void 0 && e.configurationPath !== "" ? e.configurationPath : this.pluginService.resolvePluginOptions({
142
185
  exists: (t) => r(a.join(e.workspaceRoot, t)),
@@ -158,13 +201,13 @@ var x = "@swc-node/register/esm-register", S = "@codependix/cli/main", C = "nx.j
158
201
  async run(e) {
159
202
  let t = this.buildCommandArguments({
160
203
  ...this.resolveSelection(e),
161
- cliEntryPath: s(import.meta.url).resolve(S),
204
+ cliEntryPath: c(import.meta.url).resolve(O),
162
205
  configurationPath: this.resolveConfigurationPath({
163
206
  configurationPath: e.options.configurationPath,
164
207
  workspaceRoot: e.workspaceRoot
165
208
  }),
166
209
  dependencies: e.options.dependencies !== !1,
167
- loaderSpecifier: x,
210
+ loaderUrl: l(c(import.meta.url).resolve(D)).href,
168
211
  workspaceRoot: e.workspaceRoot
169
212
  });
170
213
  return await this.spawnCommandLine({
@@ -173,39 +216,39 @@ var x = "@swc-node/register/esm-register", S = "@codependix/cli/main", C = "nx.j
173
216
  });
174
217
  }
175
218
  };
176
- w = __decorate([t(), __decorateMetadata("design:paramtypes", [y === void 0 ? Object : y])], w);
219
+ A = __decorate([t(), __decorateMetadata("design:paramtypes", [T === void 0 ? Object : T])], A);
177
220
  //#endregion
178
221
  //#region packages/ic-suite/codependix/codependix-nx/src/modules/gate/gate.module.ts
179
- var T = class GateModule {};
180
- T = __decorate([n({
222
+ var j = class GateModule {};
223
+ j = __decorate([n({
181
224
  controllers: [],
182
- exports: [w],
183
- imports: [b],
184
- providers: [w]
185
- })], T);
225
+ exports: [A],
226
+ imports: [E],
227
+ providers: [A]
228
+ })], j);
186
229
  //#endregion
187
230
  //#region packages/ic-suite/codependix/codependix-nx/src/main.module.ts
188
- var E = class MainModule {};
189
- E = __decorate([n({
231
+ var M = class MainModule {};
232
+ M = __decorate([n({
190
233
  controllers: [],
191
- exports: [T, b],
192
- imports: [T, b],
234
+ exports: [j, E],
235
+ imports: [j, E],
193
236
  providers: []
194
- })], E);
237
+ })], M);
195
238
  //#endregion
196
239
  //#region packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-context.utilities.ts
197
240
  async function resolveGateService() {
198
- return (await resolvePluginContext()).get(w);
241
+ return (await resolvePluginContext()).get(A);
199
242
  }
200
243
  async function resolvePluginService() {
201
- return (await resolvePluginContext()).get(y);
244
+ return (await resolvePluginContext()).get(T);
202
245
  }
203
246
  async function resolvePluginContext() {
204
247
  let t = globalThis;
205
- return t[f] ??= e.createApplicationContext(E, {
248
+ return t[m] ??= e.createApplicationContext(M, {
206
249
  abortOnError: !1,
207
250
  logger: !1
208
- }), await t[f];
251
+ }), await t[m];
209
252
  }
210
253
  //#endregion
211
- export { w as a, g as c, l as d, v as f, T as i, p as l, __name as m, resolvePluginService as n, b as o, _ as p, E as r, y as s, resolveGateService as t, m as u };
254
+ export { S as _, A as a, v as c, b as d, C as f, y as g, x as h, j as i, h as l, w as m, resolvePluginService as n, E as o, d as p, M as r, T as s, resolveGateService as t, g as u, __name as v };
@@ -1,4 +1,4 @@
1
- import { t as e } from "../../../plugin-context.utilities-Bre57JBa.js";
1
+ import { t as e } from "../../../plugin-context.utilities-BR1ONpzC.js";
2
2
  //#region packages/ic-suite/codependix/codependix-nx/src/executors/gate/executor.ts
3
3
  async function gateExecutor(t, n) {
4
4
  return { success: await (await e()).run({
@@ -0,0 +1,25 @@
1
+ import { Hash } from '@nx/devkit';
2
+ import { HasherContext } from '@nx/devkit';
3
+ import { Task } from '@nx/devkit';
4
+
5
+ /**
6
+ * Hashes one gate task for Nx's cache.
7
+ *
8
+ * Nx consults an executor's hasher instead of hashing the target's inputs
9
+ * itself, which is the one place a run's own options can change whether it
10
+ * is cacheable at all: `cache` is fixed per target, before any option is
11
+ * read. A gate judging its own project is hashed exactly as Nx would; one
12
+ * whose `projects` or `tags` select any other project is never replayed.
13
+ */
14
+ declare function gateHasher(task: Task, context: GateHasherContext): Promise<Hash>;
15
+ export default gateHasher;
16
+
17
+ /**
18
+ * What Nx hands an executor's hasher: its declared context, plus the task's
19
+ * own environment, which it passes without declaring.
20
+ */
21
+ declare type GateHasherContext = HasherContext & {
22
+ readonly env?: NodeJS.ProcessEnv | undefined;
23
+ };
24
+
25
+ export { }
@@ -0,0 +1,10 @@
1
+ import { t as e } from "../../../plugin-context.utilities-BR1ONpzC.js";
2
+ //#region packages/ic-suite/codependix/codependix-nx/src/executors/gate/hasher.ts
3
+ async function gateHasher(t, n) {
4
+ return await (await e()).hashTask({
5
+ context: n,
6
+ task: t
7
+ });
8
+ }
9
+ //#endregion
10
+ export { gateHasher as default };
@@ -1,4 +1,7 @@
1
1
  import { CreateNodes } from '@nx/devkit';
2
+ import { Hash } from '@nx/devkit';
3
+ import { HasherContext } from '@nx/devkit';
4
+ import { Task } from '@nx/devkit';
2
5
 
3
6
  /** Arguments for building the command line one gate runs. */
4
7
  declare interface BuildCommandArguments extends GateSelection {
@@ -6,8 +9,8 @@ declare interface BuildCommandArguments extends GateSelection {
6
9
  readonly cliEntryPath: string;
7
10
  readonly configurationPath: string;
8
11
  readonly dependencies: boolean;
9
- /** What `node --import` registers the TypeScript loader from. */
10
- readonly loaderSpecifier: string;
12
+ /** File URL of the module `node --import` registers the loader from. */
13
+ readonly loaderUrl: string;
11
14
  readonly workspaceRoot: string;
12
15
  }
13
16
 
@@ -38,6 +41,14 @@ export declare interface CodependixPluginOptions {
38
41
  */
39
42
  export declare const DEFAULT_GATE_TARGET_NAME = "codependix-gate";
40
43
 
44
+ /**
45
+ * What Nx hands an executor's hasher: its declared context, plus the task's
46
+ * own environment, which it passes without declaring.
47
+ */
48
+ declare type GateHasherContext = HasherContext & {
49
+ readonly env?: NodeJS.ProcessEnv | undefined;
50
+ };
51
+
41
52
  /** Provides the run behind the gate executor. */
42
53
  export declare class GateModule {
43
54
  }
@@ -72,6 +83,14 @@ export declare interface GateSelection {
72
83
  export declare class GateService {
73
84
  private readonly pluginService;
74
85
  constructor(pluginService: PluginService);
86
+ /**
87
+ * Whether a gate task judges exactly the project it belongs to.
88
+ *
89
+ * Read from the options the executor will actually run with β€” the target's
90
+ * own, then the configuration's, then the command line's β€” through the
91
+ * same selection the run makes, so the two can never disagree.
92
+ */
93
+ private judgesOwnProject;
75
94
  /**
76
95
  * Reads a list of names out of an executor's options.
77
96
  *
@@ -88,6 +107,11 @@ export declare class GateService {
88
107
  * conventional paths, which a workspace with no registration gets anyway.
89
108
  */
90
109
  private readNxConfiguration;
110
+ /**
111
+ * The options one gate task runs with, merged as Nx merges them: the
112
+ * target's, then the named configuration's, then the command line's.
113
+ */
114
+ private readTaskOptions;
91
115
  /**
92
116
  * Starts the command line and settles on whether it exited zero.
93
117
  *
@@ -97,6 +121,13 @@ export declare class GateService {
97
121
  * verdict was reached, so none may be recorded as a pass.
98
122
  */
99
123
  private spawnCommandLine;
124
+ /**
125
+ * Reads a name list from an untrusted option: a list from configuration,
126
+ * or the single string, or number, a command line parses it into.
127
+ */
128
+ private toNameList;
129
+ /** Copies an untrusted value into a record, or an empty one. */
130
+ private toRecord;
100
131
  /**
101
132
  * Builds the `node` arguments one gate runs.
102
133
  *
@@ -106,6 +137,17 @@ export declare class GateService {
106
137
  * dependency's own gate rather than every gate downstream of it.
107
138
  */
108
139
  buildCommandArguments(args: BuildCommandArguments): string[];
140
+ /**
141
+ * Hashes one gate task for Nx's cache β€” or, when it judges any project but
142
+ * its own, gives it a hash no run shares, so its verdict is never replayed.
143
+ *
144
+ * A gate's inputs cover its own project and that project's dependencies.
145
+ * One handed `projects` or `tags` judges projects those inputs need not
146
+ * reach, so a hash built from them could replay a pass after an edit to
147
+ * the very project that now fails. A gate judging its own project is
148
+ * hashed exactly as Nx would hash it without this hasher.
149
+ */
150
+ hashTask(args: HashGateTaskArguments): Promise<Hash>;
109
151
  /**
110
152
  * Resolves the configuration path one gate runs with.
111
153
  *
@@ -134,6 +176,12 @@ export declare class GateService {
134
176
  run(args: RunGateArguments): Promise<boolean>;
135
177
  }
136
178
 
179
+ /** Arguments for hashing one gate task. */
180
+ declare interface HashGateTaskArguments {
181
+ readonly context: GateHasherContext;
182
+ readonly task: Task;
183
+ }
184
+
137
185
  /**
138
186
  * One cache input of an inferred target: a file glob, or the npm packages an
139
187
  * installed command line is versioned by.
@@ -160,7 +208,10 @@ declare interface InferTargetsArguments {
160
208
  readonly options: unknown;
161
209
  /** Every file Nx matched, workspace-root relative. */
162
210
  readonly projectConfigurationFiles: readonly string[];
163
- /** The command line's own inputs, from `resolveToolInputs`. */
211
+ /**
212
+ * The command line's own inputs and its loader's tsconfig chain, from
213
+ * `resolveToolInputs` and `resolveTsconfigInputs`.
214
+ */
164
215
  readonly toolInputs: readonly InferredInput[];
165
216
  readonly workspaceRoot: string;
166
217
  }
@@ -212,8 +263,9 @@ export declare class PluginService {
212
263
  * sources through `^default`; the workspace configuration holds the rules,
213
264
  * so editing it invalidates every gate; the project's own configuration is
214
265
  * the one file only this project's gate reads; and the command line's own
215
- * code decides every verdict, through the `toolInputs` the caller resolved
216
- * with `resolveToolInputs`. No `configurations` are
266
+ * code and its loader's tsconfig chain decide every verdict, through the
267
+ * `toolInputs` the caller resolved with `resolveToolInputs` and
268
+ * `resolveTsconfigInputs`. No `configurations` are
217
269
  * declared, so an aggregator run with `--configuration=check` falls through
218
270
  * to the defaults rather than failing for a configuration this target lacks.
219
271
  */
package/dist/src/index.js CHANGED
@@ -1,78 +1,214 @@
1
- import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, p as c, r as l, s as u, t as d, u as f } from "../plugin-context.utilities-Bre57JBa.js";
2
- import { readFileSync as p, realpathSync as m } from "node:fs";
3
- import h from "node:path";
4
- import { createRequire as g } from "node:module";
1
+ import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as m, t as h, u as g } from "../plugin-context.utilities-BR1ONpzC.js";
2
+ import { existsSync as _, readFileSync as v, realpathSync as y, statSync as b } from "node:fs";
3
+ import x from "node:path";
4
+ import { createRequire as S } from "node:module";
5
+ import { logger as C, readJsonFile as w } from "@nx/devkit";
5
6
  //#region packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-inputs.utilities.ts
7
+ function isInsideWorkspace(e) {
8
+ let t = x.relative(y(e.workspaceRoot), e.directory);
9
+ return !(t.startsWith("..") || x.isAbsolute(t) || t.split(x.sep).includes("node_modules"));
10
+ }
11
+ function readDependencies(e) {
12
+ let t = readManifest(e);
13
+ return Object.entries({
14
+ ...toRecord(t.dependencies),
15
+ ...toRecord(t.devDependencies)
16
+ });
17
+ }
6
18
  function resolveToolInputs(e) {
7
19
  try {
8
- let t = locateCommandLine();
9
- return toWorkspacePath({
10
- directory: t,
11
- workspaceRoot: e
12
- }) === void 0 ? resolveExternalInputs(t) : resolveWorkspaceInputs({
13
- cliDirectory: t,
14
- workspaceRoot: e
20
+ let t = locatePackage({
21
+ fromFile: e.resolveFrom ?? import.meta.url,
22
+ name: n
15
23
  });
16
- } catch {
17
- return [];
24
+ return t === void 0 ? (warnUnresolved({
25
+ logger: e.logger,
26
+ names: [n]
27
+ }), []) : isInsideWorkspace({
28
+ directory: t,
29
+ workspaceRoot: e.workspaceRoot
30
+ }) ? resolveWorkspaceInputs({
31
+ ...e,
32
+ cliDirectory: t
33
+ }) : resolveExternalInputs(t);
34
+ } catch (t) {
35
+ return e.logger.warn(`πŸ•ΈοΈ Skipped the cache inputs of ${n}, so a change to it will not invalidate a cached codependix gate: ${String(t)}`), [];
18
36
  }
19
37
  }
20
38
  function collectWorkspacePackages(e) {
21
- e.visited.add(e.packageDirectory);
22
- let t = readDependencies(e.packageDirectory).filter(([, e]) => String(e).startsWith(c)).map(([t]) => locateDependency({
23
- fromDirectory: e.packageDirectory,
24
- name: t
25
- })).filter((t) => !e.visited.has(t));
26
- for (let n of t) collectWorkspacePackages({
27
- packageDirectory: n,
28
- visited: e.visited
29
- });
30
- return e.visited;
31
- }
32
- function locateCommandLine() {
33
- return h.dirname(m(g(import.meta.url).resolve(`${t}/package.json`)));
39
+ let t = /* @__PURE__ */ new Set([e]), n = /* @__PURE__ */ new Set(), r = [e];
40
+ for (let e = r.pop(); e !== void 0; e = r.pop()) {
41
+ let i = readDependencies(e).filter(([, e]) => String(e).startsWith(a)).map(([e]) => e);
42
+ for (let a of i) {
43
+ let i = locatePackage({
44
+ fromFile: x.join(e, "package.json"),
45
+ name: a
46
+ });
47
+ i === void 0 ? n.add(a) : t.has(i) || (t.add(i), r.push(i));
48
+ }
49
+ }
50
+ return {
51
+ directories: t,
52
+ unresolved: [...n].toSorted()
53
+ };
34
54
  }
35
- function locateDependency(e) {
36
- return h.dirname(m(g(h.join(e.fromDirectory, "package.json")).resolve(`${e.name}/package.json`)));
55
+ function locatePackage(e) {
56
+ let t;
57
+ try {
58
+ t = x.dirname(y(S(e.fromFile).resolve(e.name)));
59
+ } catch {
60
+ return;
61
+ }
62
+ for (;; t = x.dirname(t)) {
63
+ if (readManifest(t).name === e.name) return t;
64
+ if (x.dirname(t) === t) return;
65
+ }
37
66
  }
38
- function readDependencies(e) {
39
- let t = toRecord(JSON.parse(p(h.join(e, "package.json"), "utf8")));
40
- return [...Object.entries(toRecord(t.dependencies)), ...Object.entries(toRecord(t.devDependencies))];
67
+ function readManifest(e) {
68
+ let t = x.join(e, "package.json");
69
+ try {
70
+ let e = _(t) ? JSON.parse(v(t, "utf8")) : void 0;
71
+ return typeof e == "object" && e ? { ...e } : {};
72
+ } catch {
73
+ return {};
74
+ }
41
75
  }
42
76
  function resolveExternalInputs(e) {
43
- let n = readDependencies(e).map(([e]) => e).filter((e) => e.startsWith("@codependix/"));
44
- return [{ externalDependencies: [t, ...n].toSorted() }];
77
+ let t = readDependencies(e).map(([e]) => e).filter((e) => e.startsWith("@codependix/"));
78
+ return [{ externalDependencies: [n, ...t].toSorted() }];
45
79
  }
46
80
  function resolveWorkspaceInputs(e) {
47
- let t = m(e.workspaceRoot);
48
- return [...collectWorkspacePackages({
49
- packageDirectory: e.cliDirectory,
50
- visited: /* @__PURE__ */ new Set()
51
- })].flatMap((e) => r.map((n) => `{workspaceRoot}/${h.relative(t, e)}/${n}`)).toSorted();
81
+ let t = y(e.workspaceRoot), { directories: n, unresolved: r } = collectWorkspacePackages(e.cliDirectory);
82
+ return r.length > 0 && warnUnresolved({
83
+ logger: e.logger,
84
+ names: r
85
+ }), [...n].flatMap((e) => o.map((n) => `{workspaceRoot}/${x.relative(t, e)}/${n}`)).toSorted();
52
86
  }
53
87
  function toRecord(e) {
54
88
  return typeof e == "object" && e ? { ...e } : {};
55
89
  }
56
- function toWorkspacePath(e) {
57
- let t = h.relative(m(e.workspaceRoot), e.directory);
58
- return t.startsWith("..") || h.isAbsolute(t) || t.split(h.sep).includes("node_modules") ? void 0 : t;
90
+ function warnUnresolved(e) {
91
+ e.logger.warn(`πŸ•ΈοΈ Skipped the cache inputs of ${e.names.join(", ")}, which could not be resolved, so a change to ${e.names.length === 1 ? "it" : "them"} will not invalidate a cached codependix gate.`);
92
+ }
93
+ //#endregion
94
+ //#region packages/ic-suite/codependix/codependix-nx/src/modules/plugin/plugin-tsconfig.utilities.ts
95
+ function resolveTsconfigInputs(t) {
96
+ try {
97
+ let e = y(t.workspaceRoot), { files: n, packages: r } = followExtendsChain({
98
+ logger: t.logger,
99
+ workspaceRoot: e
100
+ }), i = [...n].map((t) => `{workspaceRoot}/${x.relative(e, t).split(x.sep).join("/")}`).toSorted();
101
+ return r.size === 0 ? i : [...i, { externalDependencies: [...r].toSorted() }];
102
+ } catch (n) {
103
+ return t.logger.warn(`πŸ•ΈοΈ Skipped following the bases the root tsconfig.json extends, so a change to one will not invalidate a cached codependix gate: ${String(n)}`), [e];
104
+ }
105
+ }
106
+ function describeSkippedBase(e) {
107
+ return e.kind === "undeclared" ? `the root package.json does not declare ${e.name} from a registry` : l[e.kind];
108
+ }
109
+ function followExtendsChain(e) {
110
+ let t = x.join(e.workspaceRoot, "tsconfig.json"), n = readRegistryDependencies(e.workspaceRoot), r = /* @__PURE__ */ new Set([t]), i = /* @__PURE__ */ new Set(), a = _(t) ? [t] : [];
111
+ for (let t = a.pop(); t !== void 0; t = a.pop()) for (let o of readExtends({
112
+ ...e,
113
+ file: t
114
+ })) {
115
+ let s = resolveExtendedBase({
116
+ ...e,
117
+ declared: n,
118
+ file: t,
119
+ specifier: o
120
+ });
121
+ s.kind === "file" ? r.has(s.file) || (r.add(s.file), a.push(s.file)) : s.kind === "package" ? i.add(s.name) : warnSkipped({
122
+ ...e,
123
+ base: s,
124
+ file: t,
125
+ specifier: o
126
+ });
127
+ }
128
+ return {
129
+ files: r,
130
+ packages: i
131
+ };
132
+ }
133
+ function readExtends(e) {
134
+ try {
135
+ return [w(e.file, { expectComments: !0 }).extends].flat().filter((e) => typeof e == "string");
136
+ } catch (t) {
137
+ return e.logger.warn(`πŸ•ΈοΈ Skipped the bases ${x.relative(e.workspaceRoot, e.file)} extends, which could not be read, so a change to one will not invalidate a cached codependix gate: ${String(t)}`), [];
138
+ }
139
+ }
140
+ function readInstalledPackageName(e) {
141
+ let t = e.split(x.sep), n = t.lastIndexOf("node_modules") + 1, r = t[n];
142
+ if (n !== 0 && r !== void 0) return t.slice(n, r.startsWith("@") ? n + 2 : n + 1).join("/");
143
+ }
144
+ function readRegistryDependencies(e) {
145
+ return new Set(readDependencies(e).filter(([, e]) => !r.some((t) => String(e).startsWith(t))).map(([e]) => e));
146
+ }
147
+ function resolveExtendedBase(e) {
148
+ let t = e.specifier.replaceAll("\\", "/"), n = x.isAbsolute(t) || t.startsWith("./") || t.startsWith("../") ? resolvePathBase({
149
+ file: e.file,
150
+ specifier: t
151
+ }) : resolvePackageBase({
152
+ file: e.file,
153
+ specifier: t
154
+ });
155
+ if (n === void 0) return { kind: "unresolved" };
156
+ if (isInsideWorkspace({
157
+ directory: n,
158
+ workspaceRoot: e.workspaceRoot
159
+ })) return {
160
+ file: n,
161
+ kind: "file"
162
+ };
163
+ let r = readInstalledPackageName(n);
164
+ return r === void 0 ? { kind: "outside" } : e.declared.has(r) ? {
165
+ kind: "package",
166
+ name: r
167
+ } : {
168
+ kind: "undeclared",
169
+ name: r
170
+ };
171
+ }
172
+ function resolvePackageBase(e) {
173
+ let { specifier: t } = e, n = t.split("/").length > (t.startsWith("@") ? 2 : 1) ? [t, `${t}.json`] : [`${t}/${i}`, t], r = S(e.file), [a] = n.flatMap((e) => {
174
+ try {
175
+ let t = y(r.resolve(e));
176
+ return t.endsWith(".json") ? [t] : [];
177
+ } catch {
178
+ return [];
179
+ }
180
+ });
181
+ return a;
182
+ }
183
+ function resolvePathBase(e) {
184
+ let t = x.resolve(x.dirname(e.file), e.specifier), n = b(t, { throwIfNoEntry: !1 })?.isFile() === !0 || t.endsWith(".json") ? t : `${t}.json`;
185
+ return _(n) ? y(n) : n;
186
+ }
187
+ function warnSkipped(e) {
188
+ e.logger.warn(`πŸ•ΈοΈ Skipped the cache input of ${e.specifier}, which ${x.relative(e.workspaceRoot, e.file)} extends, because ${describeSkippedBase(e.base)}, so a change to it will not invalidate a cached codependix gate.`);
59
189
  }
60
190
  //#endregion
61
191
  //#region packages/ic-suite/codependix/codependix-nx/src/index.ts
62
- var _ = {
63
- createNodes: [n, async (e, t, n) => {
64
- let r = (await o()).inferTargets({
192
+ var T = {
193
+ createNodes: [f, async (e, t, n) => {
194
+ let r = (await u()).inferTargets({
65
195
  options: t,
66
196
  projectConfigurationFiles: e,
67
- toolInputs: resolveToolInputs(n.workspaceRoot),
197
+ toolInputs: [...resolveToolInputs({
198
+ logger: C,
199
+ workspaceRoot: n.workspaceRoot
200
+ }), ...resolveTsconfigInputs({
201
+ logger: C,
202
+ workspaceRoot: n.workspaceRoot
203
+ })],
68
204
  workspaceRoot: n.workspaceRoot
69
205
  });
70
- return e.map((e) => {
71
- let t = h.dirname(e), n = r.get(t);
72
- return [e, n === void 0 ? {} : { projects: { [t]: { targets: n } } }];
73
- }).filter(([, e]) => Object.keys(e).length > 0);
206
+ return e.flatMap((e) => {
207
+ let t = x.dirname(e), n = r.get(t);
208
+ return n === void 0 ? [] : [[e, { projects: { [t]: { targets: n } } }]];
209
+ });
74
210
  }],
75
211
  name: "@codependix/nx"
76
212
  };
77
213
  //#endregion
78
- export { a as CODEPENDIX_NX_PLUGIN_NAME, f as DEFAULT_GATE_TARGET_NAME, i as GateModule, e as GateService, l as MainModule, s as PluginModule, u as PluginService, _ as default, d as resolveGateService, o as resolvePluginService };
214
+ export { c as CODEPENDIX_NX_PLUGIN_NAME, g as DEFAULT_GATE_TARGET_NAME, s as GateModule, t as GateService, p as MainModule, d as PluginModule, m as PluginService, T as default, h as resolveGateService, u as resolvePluginService };
package/executors.json CHANGED
@@ -3,7 +3,8 @@
3
3
  "executors": {
4
4
  "gate": {
5
5
  "description": "Fail a project whose dependency graphs break a codependix boundary rule charged to it, built over the project and its Nx dependencies.",
6
- "implementation": "./src/executors/gate/executor",
6
+ "hasher": "@codependix/nx/src/executors/gate/hasher",
7
+ "implementation": "@codependix/nx/src/executors/gate/executor",
7
8
  "schema": "./src/executors/gate/schema.json"
8
9
  }
9
10
  }
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "url": "https://github.com/organizzolini/codebase/issues"
5
5
  },
6
6
  "dependencies": {
7
- "@codependix/cli": "0.0.16",
7
+ "@codependix/cli": "0.0.18",
8
8
  "@nestjs/common": "^11.1.21 || ^12.0.1",
9
9
  "@nestjs/core": "^11.1.21 || ^12.0.1",
10
10
  "@nx/devkit": "^23.0.0",
@@ -30,6 +30,7 @@
30
30
  "default": "./dist/src/index.js"
31
31
  },
32
32
  "./executors.json": "./executors.json",
33
+ "./loader": "./src/executors/gate/loader.mjs",
33
34
  "./package.json": "./package.json",
34
35
  "./src/executors/*": "./dist/src/executors/*.js"
35
36
  },
@@ -38,7 +39,9 @@
38
39
  "dist",
39
40
  "executors.json",
40
41
  "LICENSE",
41
- "README.md"
42
+ "README.md",
43
+ "src/executors/*/schema.json",
44
+ "src/executors/gate/loader.mjs"
42
45
  ],
43
46
  "homepage": "https://github.com/organizzolini/codebase/tree/main/packages/ic-suite/codependix/codependix-nx#readme",
44
47
  "keywords": [
@@ -55,6 +58,9 @@
55
58
  "nx": {
56
59
  "executors": "./executors.json"
57
60
  },
61
+ "peerDependencies": {
62
+ "typescript": "^6.0.3"
63
+ },
58
64
  "publishConfig": {
59
65
  "access": "public",
60
66
  "registry": "https://registry.npmjs.org"
@@ -70,5 +76,5 @@
70
76
  "strict": true
71
77
  },
72
78
  "types": "./dist/src/index.d.ts",
73
- "version": "0.0.1"
79
+ "version": "0.0.3"
74
80
  }
@@ -0,0 +1,20 @@
1
+ // Registers the `@swc-node/register` hooks the codependix command line runs
2
+ // under, resolved from this plugin's own dependencies. The gate hands
3
+ // `node --import` this module's file URL.
4
+
5
+ // The hook's own `@swc-node/register/esm-register` cannot stand in for it:
6
+ // that registers `@swc-node/register/esm` relative to the working directory β€”
7
+ // the consumer's workspace root, which need not have the hook installed, and
8
+ // under pnpm cannot see this plugin's copy of it. Resolving from this module's
9
+ // URL reaches the copy this plugin depends on wherever it is installed. The
10
+ // hooks still read `tsconfig.json` from the working directory.
11
+
12
+ // `module.register` is deprecated (DEP0205) in favor of `module.registerHooks`,
13
+ // which runs synchronous hooks in-thread and so cannot run swc's asynchronous
14
+ // ones: there is no replacement to move to. This file is JavaScript, shipped
15
+ // as written, so the type-aware `no-deprecated` lint never reads the call. If
16
+ // a Node release removes `register`, every gate fails loudly rather than
17
+ // passing. Node 26 prints DEP0205 on each gate's child process.
18
+ import { register } from "node:module";
19
+
20
+ register("@swc-node/register/esm", import.meta.url);
@@ -0,0 +1,28 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "description": "Fail a project whose dependency graphs break a codependix boundary rule charged to it, built over the project and its Nx dependencies.",
4
+ "properties": {
5
+ "configurationPath": {
6
+ "description": "Path to the codependix configuration file, relative to the workspace root. The path this plugin is registered with in nx.json when omitted.",
7
+ "type": "string"
8
+ },
9
+ "dependencies": {
10
+ "default": true,
11
+ "description": "Build the graphs over the judged projects' Nx dependency closure. False builds over the judged projects alone.",
12
+ "type": "boolean"
13
+ },
14
+ "projects": {
15
+ "description": "Nx project names to judge, replacing the project this target belongs to.",
16
+ "items": { "type": "string" },
17
+ "type": "array"
18
+ },
19
+ "tags": {
20
+ "description": "Nx project tags to judge, selecting every project carrying ANY of them.",
21
+ "items": { "type": "string" },
22
+ "type": "array"
23
+ }
24
+ },
25
+ "required": [],
26
+ "title": "Codependix gate",
27
+ "type": "object"
28
+ }