@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 +16 -0
- package/README.md +266 -61
- package/dist/{plugin-context.utilities-Bre57JBa.js β plugin-context.utilities-BR1ONpzC.js} +79 -36
- package/dist/src/executors/gate/executor.js +1 -1
- package/dist/src/executors/gate/hasher.d.ts +25 -0
- package/dist/src/executors/gate/hasher.js +10 -0
- package/dist/src/index.d.ts +57 -5
- package/dist/src/index.js +186 -50
- package/executors.json +2 -1
- package/package.json +9 -3
- package/src/executors/gate/loader.mjs +20 -0
- package/src/executors/gate/schema.json +28 -0
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 `
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
metadata
|
|
51
|
-
|
|
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
|
|
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 @
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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,
|
|
92
|
-
`{workspaceRoot}
|
|
93
|
-
|
|
94
|
-
`
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
`
|
|
105
|
-
|
|
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
|
-

|
|
473
|
+

|
|
269
474
|

|
|
270
|
-

|
|
271
476
|
|
|
272
477
|
### TypeScript
|
|
273
478
|
|
|
274
|
-

|
|
480
|
+

|
|
276
481
|

|
|
277
482
|

|
|
278
483
|

|
|
279
|
-

|
|
280
485
|

|
|
281
486
|
|
|
282
487
|
### JavaScript
|
|
283
488
|
|
|
284
|
-

|
|
490
|
+

|
|
491
|
+

|
|
287
492
|

|
|
288
|
-

|
|
494
|
+

|
|
495
|
+

|
|
496
|
+

|
|
497
|
+

|
|
498
|
+

|
|
499
|
+

|
|
500
|
+

|
|
501
|
+

|
|
297
502
|

|
|
298
503
|
|
|
299
504
|
### Python
|
|
@@ -314,16 +519,16 @@ graph LR
|
|
|
314
519
|
### JSON
|
|
315
520
|
|
|
316
521
|

|
|
317
|
-

|
|
523
|
+

|
|
319
524
|

|
|
320
|
-

|
|
526
|
+

|
|
322
527
|

|
|
323
528
|

|
|
324
529
|

|
|
325
|
-

|
|
531
|
+

|
|
327
532
|

|
|
328
533
|
|
|
329
534
|
### YAML
|
|
@@ -409,9 +614,9 @@ graph LR
|
|
|
409
614
|

|
|
410
615
|

|
|
411
616
|

|
|
412
|
-

|
|
413
618
|

|
|
414
|
-

|
|
415
620
|

|
|
416
621
|

|
|
417
622
|

|
|
@@ -449,23 +654,23 @@ graph LR
|
|
|
449
654
|
### Markdown
|
|
450
655
|
|
|
451
656
|

|
|
452
|
-

|
|
453
658
|

|
|
454
|
-

|
|
660
|
+

|
|
456
661
|

|
|
457
662
|

|
|
458
663
|

|
|
459
|
-

|
|
460
665
|

|
|
461
|
-

|
|
462
667
|

|
|
463
|
-

|
|
669
|
+

|
|
670
|
+

|
|
466
671
|

|
|
467
|
-

|
|
673
|
+

|
|
469
674
|

|
|
470
675
|

|
|
471
676
|
<!-- codometer:end -->
|
package/dist/{plugin-context.utilities-Bre57JBa.js β plugin-context.utilities-BR1ONpzC.js}
RENAMED
|
@@ -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 {
|
|
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
|
|
11
|
+
var u = Object.defineProperty, __name = (e, t) => u(e, "name", {
|
|
10
12
|
value: t,
|
|
11
13
|
configurable: !0
|
|
12
|
-
}),
|
|
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
|
|
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) ===
|
|
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: `${
|
|
59
|
+
executor: `${h}:gate`,
|
|
50
60
|
inputs: [
|
|
51
61
|
"default",
|
|
52
62
|
"^default",
|
|
53
63
|
`{workspaceRoot}/${t.configurationPath}`,
|
|
54
|
-
|
|
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
|
-
}) ??
|
|
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
|
-
|
|
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
|
|
85
|
-
|
|
94
|
+
var E = class PluginModule {};
|
|
95
|
+
E = __decorate([n({
|
|
86
96
|
controllers: [],
|
|
87
|
-
exports: [
|
|
97
|
+
exports: [T],
|
|
88
98
|
imports: [],
|
|
89
|
-
providers: [
|
|
90
|
-
})],
|
|
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
|
|
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,
|
|
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.
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
180
|
-
|
|
222
|
+
var j = class GateModule {};
|
|
223
|
+
j = __decorate([n({
|
|
181
224
|
controllers: [],
|
|
182
|
-
exports: [
|
|
183
|
-
imports: [
|
|
184
|
-
providers: [
|
|
185
|
-
})],
|
|
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
|
|
189
|
-
|
|
231
|
+
var M = class MainModule {};
|
|
232
|
+
M = __decorate([n({
|
|
190
233
|
controllers: [],
|
|
191
|
-
exports: [
|
|
192
|
-
imports: [
|
|
234
|
+
exports: [j, E],
|
|
235
|
+
imports: [j, E],
|
|
193
236
|
providers: []
|
|
194
|
-
})],
|
|
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(
|
|
241
|
+
return (await resolvePluginContext()).get(A);
|
|
199
242
|
}
|
|
200
243
|
async function resolvePluginService() {
|
|
201
|
-
return (await resolvePluginContext()).get(
|
|
244
|
+
return (await resolvePluginContext()).get(T);
|
|
202
245
|
}
|
|
203
246
|
async function resolvePluginContext() {
|
|
204
247
|
let t = globalThis;
|
|
205
|
-
return t[
|
|
248
|
+
return t[m] ??= e.createApplicationContext(M, {
|
|
206
249
|
abortOnError: !1,
|
|
207
250
|
logger: !1
|
|
208
|
-
}), await t[
|
|
251
|
+
}), await t[m];
|
|
209
252
|
}
|
|
210
253
|
//#endregion
|
|
211
|
-
export {
|
|
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-
|
|
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 };
|
package/dist/src/index.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
10
|
-
readonly
|
|
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
|
-
/**
|
|
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
|
|
216
|
-
* with `resolveToolInputs
|
|
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 {
|
|
2
|
-
import { readFileSync as
|
|
3
|
-
import
|
|
4
|
-
import { createRequire as
|
|
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 =
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
17
|
-
|
|
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
|
|
22
|
-
let
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
36
|
-
|
|
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
|
|
39
|
-
let t =
|
|
40
|
-
|
|
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
|
|
44
|
-
return [{ externalDependencies: [
|
|
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 =
|
|
48
|
-
return
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
})].flatMap((e) =>
|
|
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
|
|
57
|
-
|
|
58
|
-
|
|
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: [
|
|
64
|
-
let r = (await
|
|
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(
|
|
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.
|
|
71
|
-
let t =
|
|
72
|
-
return
|
|
73
|
-
})
|
|
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 {
|
|
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
|
-
"
|
|
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.
|
|
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.
|
|
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
|
+
}
|