@coinagerie/nx 0.0.4 โ 0.0.6
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 +104 -50
- package/dist/executor.utilities-CUgE7Mg2.js +104 -0
- package/dist/rolldown-runtime-CNE2giL2.js +6 -0
- package/dist/src/executors/check/batch-executor.d.ts +68 -0
- package/dist/src/executors/check/batch-executor.js +11 -0
- package/dist/src/executors/check/executor.d.ts +33 -0
- package/dist/src/executors/check/executor.js +22 -0
- package/dist/src/index.js +4 -6
- package/executors.json +12 -0
- package/package.json +12 -4
- package/src/executors/check/schema.json +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 0.0.6 (2026-11-06)
|
|
2
|
+
|
|
3
|
+
### ๐งฑ Updated Dependencies
|
|
4
|
+
|
|
5
|
+
- Updated coinagerie-configuration to 0.0.6
|
|
6
|
+
|
|
7
|
+
## 0.0.5 (2026-11-06)
|
|
8
|
+
|
|
9
|
+
### ๐ฅ Performance
|
|
10
|
+
|
|
11
|
+
- **coinagerie:** โก๏ธ judge every project's glossary from one batched command-line run ([#2115](https://github.com/organizzolini/codebase/pull/2115))
|
|
12
|
+
|
|
13
|
+
### ๐งฑ Updated Dependencies
|
|
14
|
+
|
|
15
|
+
- Updated coinagerie-configuration to 0.0.5
|
|
16
|
+
|
|
1
17
|
## 0.0.4 (2026-11-04)
|
|
2
18
|
|
|
3
19
|
### ๐งฑ Updated Dependencies
|
package/README.md
CHANGED
|
@@ -68,13 +68,9 @@ This project was generated from the [nestjs-service-project](../../configuration
|
|
|
68
68
|
|
|
69
69
|
The words this package uses that the root glossary does not define, regenerated with `nx run coinagerie-nx:coinagerie-check:write`.
|
|
70
70
|
|
|
71
|
-
- **
|
|
72
|
-
- **beta**: A fixture package name in the plugin's unit tests, standing for a project that holds a coinagerie configuration.
|
|
71
|
+
- **batch**: Group of coinagerie-check tasks Nx hands to one executor call, which starts the command line once and names every project to it.
|
|
73
72
|
- **breadth**: The maximumBreadth limit in this package's callidescope.config.ts, set to four callees per callable.
|
|
74
73
|
- **gamma**: A fixture package name in the plugin's unit tests, standing for a project with a project.json but no configuration.
|
|
75
|
-
- **mj**: The module-extension fragment of .mjs configuration file names that the plugin matches as coinagerie config variants.
|
|
76
|
-
- **posix**: Node's path module, the forward-slash variant used to derive a project root from a configuration file path.
|
|
77
|
-
- **sample**: A fixture folder name in the plugin's unit tests, holding a coinagerie.config.ts that the inference reads.
|
|
78
74
|
|
|
79
75
|
<!-- coinagerie:end -->
|
|
80
76
|
|
|
@@ -86,10 +82,10 @@ Call stacks traced through `projects/ic-suite/coinagerie/coinagerie-nx`, deepest
|
|
|
86
82
|
|
|
87
83
|
| Measure | Value |
|
|
88
84
|
| --- | --- |
|
|
89
|
-
| Callables |
|
|
90
|
-
| Files |
|
|
91
|
-
| Calls traced |
|
|
92
|
-
| Call stacks |
|
|
85
|
+
| Callables | 35 |
|
|
86
|
+
| Files | 22 |
|
|
87
|
+
| Calls traced | 32 |
|
|
88
|
+
| Call stacks | 3 |
|
|
93
89
|
| Deepest stack | 6 |
|
|
94
90
|
| Stacks through recursion | 0 |
|
|
95
91
|
| Unfollowable calls | 0 |
|
|
@@ -109,7 +105,7 @@ What this project is judged against, as declared in its own `callidescope.config
|
|
|
109
105
|
|
|
110
106
|
```text
|
|
111
107
|
๐ anonymous(โฆ): Promise<CreateNodesResultArray> [projects/ic-suite/coinagerie/coinagerie-nx/src/index.ts:40]
|
|
112
|
-
โโ> PluginService.inferTargets(args: InferTargetsArguments): Map<string, InferredTargets> [projects/ic-suite/coinagerie/coinagerie-nx/src/modules/plugin/plugin.service.ts:
|
|
108
|
+
โโ> PluginService.inferTargets(args: InferTargetsArguments): Map<string, InferredTargets> [projects/ic-suite/coinagerie/coinagerie-nx/src/modules/plugin/plugin.service.ts:112]
|
|
113
109
|
โณ Infers a check target onto every project that holds a configuration.
|
|
114
110
|
โโ> OptionsService.resolvePluginOptions(options: unknown): CoinageriePluginOptions [projects/ic-suite/coinagerie/coinagerie-nx/src/modules/options/options.service.ts:82]
|
|
115
111
|
โณ Resolves the effective plugin options from an untrusted value.
|
|
@@ -120,24 +116,64 @@ What this project is judged against, as declared in its own `callidescope.config
|
|
|
120
116
|
โณ Narrows an untrusted value to an Nx input object, such as `{ env }`.
|
|
121
117
|
```
|
|
122
118
|
|
|
119
|
+
**2. `checkBatchExecutor`** โ depth 6 ยท orphan-root
|
|
120
|
+
|
|
121
|
+
```text
|
|
122
|
+
๐ checkBatchExecutor(โฆ): Promise<Record<string, CheckBatchTaskResult>> [projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/batch-executor.ts:19]
|
|
123
|
+
โณ Judges every task Nx batched for this executor from one command-line process.
|
|
124
|
+
โโ> runBatch(โฆ): Promise<Record<string, CheckBatchTaskResult>> [projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/executor.utilities.ts:58]
|
|
125
|
+
โณ Judges every task of a batch, one process per group, each task by its own verdict.
|
|
126
|
+
โโ> runGroup(โฆ): Promise<Record<string, CheckBatchTaskResult>> [projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/executor.utilities.ts:78]
|
|
127
|
+
โณ Judges every task of a group from one process, giving each its own verdict.
|
|
128
|
+
โโ> parseVerdicts(output: ProcessOutput): CheckVerdictRecord[] [projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/executor.utilities.ts:154]
|
|
129
|
+
โณ Reads the verdicts a process printed.
|
|
130
|
+
โโ> isVerdictList(value: unknown): value is CheckVerdictRecord[] [projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/executor.utilities.ts:120]
|
|
131
|
+
โณ Whether a parsed value is a list of verdicts, as the `batch` command prints them.
|
|
132
|
+
โโ> isVerdictRecord(value: unknown): value is CheckVerdictRecord [projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/executor.utilities.ts:135]
|
|
133
|
+
โณ Whether a parsed value is one verdict as the `batch` command prints it.
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**3. `checkExecutor`** โ depth 5 ยท orphan-root
|
|
137
|
+
|
|
138
|
+
```text
|
|
139
|
+
๐ checkExecutor(โฆ): Promise<{ success: boolean; }> [projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/executor.ts:18]
|
|
140
|
+
โณ Judges one project's glossaries against the words its code uses.
|
|
141
|
+
โโ> runGroup(โฆ): Promise<Record<string, CheckBatchTaskResult>> [projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/executor.utilities.ts:78]
|
|
142
|
+
โณ Judges every task of a group from one process, giving each its own verdict.
|
|
143
|
+
โโ> parseVerdicts(output: ProcessOutput): CheckVerdictRecord[] [projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/executor.utilities.ts:154]
|
|
144
|
+
โณ Reads the verdicts a process printed.
|
|
145
|
+
โโ> isVerdictList(value: unknown): value is CheckVerdictRecord[] [projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/executor.utilities.ts:120]
|
|
146
|
+
โณ Whether a parsed value is a list of verdicts, as the `batch` command prints them.
|
|
147
|
+
โโ> isVerdictRecord(value: unknown): value is CheckVerdictRecord [projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/executor.utilities.ts:135]
|
|
148
|
+
โณ Whether a parsed value is one verdict as the `batch` command prints it.
|
|
149
|
+
```
|
|
150
|
+
|
|
123
151
|
### Breadth
|
|
124
152
|
|
|
125
153
|
| Callable | Breadth | Calls directly | Location |
|
|
126
154
|
| --- | --- | --- | --- |
|
|
127
|
-
| `
|
|
155
|
+
| `runProcess` | 4 | `buildCommand`, `on(โฆ)`, `on(โฆ)`, `anonymous` | `projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/executor.utilities.ts:182` |
|
|
156
|
+
| `PluginService.inferTargets` | 3 | `OptionsService.resolvePluginOptions`, `PluginService.isProject`, `PluginService.buildCheckTarget` | `projects/ic-suite/coinagerie/coinagerie-nx/src/modules/plugin/plugin.service.ts:112` |
|
|
128
157
|
| `anonymous` | 3 | `resolvePluginService`, `PluginService.inferTargets`, `flatMap(โฆ)` | `projects/ic-suite/coinagerie/coinagerie-nx/src/index.ts:40` |
|
|
129
|
-
| `OptionsService.readInputs` | 2 | `OptionsService.isUnknownArray`, `OptionsService.flatMap(โฆ)` | `projects/ic-suite/coinagerie/coinagerie-nx/src/modules/options/options.service.ts:49` |
|
|
130
158
|
|
|
131
159
|
<details>
|
|
132
|
-
<summary>
|
|
160
|
+
<summary>13 more callables</summary>
|
|
133
161
|
|
|
134
162
|
| Callable | Breadth | Calls directly | Location |
|
|
135
163
|
| --- | --- | --- | --- |
|
|
164
|
+
| `runGroup` | 3 | `parseVerdicts`, `runProcess`, `find(โฆ)` | `projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/executor.utilities.ts:78` |
|
|
165
|
+
| `checkExecutor` | 3 | `runGroup`, `map(โฆ)`, `every(โฆ)` | `projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/executor.ts:18` |
|
|
166
|
+
| `OptionsService.readInputs` | 2 | `OptionsService.isUnknownArray`, `OptionsService.flatMap(โฆ)` | `projects/ic-suite/coinagerie/coinagerie-nx/src/modules/options/options.service.ts:49` |
|
|
136
167
|
| `OptionsService.resolvePluginOptions` | 2 | `OptionsService.readString`, `OptionsService.readInputs` | `projects/ic-suite/coinagerie/coinagerie-nx/src/modules/options/options.service.ts:82` |
|
|
168
|
+
| `runBatch` | 2 | `groupTasks`, `runGroup` | `projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/executor.utilities.ts:58` |
|
|
169
|
+
| `checkBatchExecutor` | 2 | `runBatch`, `printFailures` | `projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/batch-executor.ts:19` |
|
|
137
170
|
| `OptionsService.flatMap(โฆ)` | 1 | `OptionsService.isInputObject` | `projects/ic-suite/coinagerie/coinagerie-nx/src/modules/options/options.service.ts:56` |
|
|
138
171
|
| `PluginService.buildCheckTarget` | 1 | `PluginService.map(โฆ)` | `projects/ic-suite/coinagerie/coinagerie-nx/src/modules/plugin/plugin.service.ts:49` |
|
|
139
|
-
| `PluginService.isProject` | 1 | `PluginService.isNamedPackage` | `projects/ic-suite/coinagerie/coinagerie-nx/src/modules/plugin/plugin.service.ts:
|
|
172
|
+
| `PluginService.isProject` | 1 | `PluginService.isNamedPackage` | `projects/ic-suite/coinagerie/coinagerie-nx/src/modules/plugin/plugin.service.ts:90` |
|
|
140
173
|
| `resolvePluginService` | 1 | `resolvePluginContext` | `projects/ic-suite/coinagerie/coinagerie-nx/src/modules/plugin/plugin-context.utilities.ts:15` |
|
|
174
|
+
| `buildCommand` | 1 | `quote` | `projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/executor.utilities.ts:108` |
|
|
175
|
+
| `isVerdictList` | 1 | `isVerdictRecord` | `projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/executor.utilities.ts:120` |
|
|
176
|
+
| `parseVerdicts` | 1 | `isVerdictList` | `projects/ic-suite/coinagerie/coinagerie-nx/src/executors/check/executor.utilities.ts:154` |
|
|
141
177
|
|
|
142
178
|
</details>
|
|
143
179
|
<!-- callidescope:end -->
|
|
@@ -184,6 +220,12 @@ graph LR
|
|
|
184
220
|
file_eslint_config_ts["eslint.config.ts"]
|
|
185
221
|
file_src_coinagerie_nx_module_ts["src/coinagerie-nx.module.ts"]
|
|
186
222
|
file_src_coinagerie_nx_module_unit_test_ts["src/coinagerie-nx.module.unit.test.ts"]
|
|
223
|
+
file_src_executors_check_batch_executor_ts["src/executors/check/batch-executor.ts"]
|
|
224
|
+
file_src_executors_check_batch_executor_unit_test_ts["src/executors/check/batch-executor.unit.test.ts"]
|
|
225
|
+
file_src_executors_check_executor_ts["src/executors/check/executor.ts"]
|
|
226
|
+
file_src_executors_check_executor_types_ts["src/executors/check/executor.types.ts"]
|
|
227
|
+
file_src_executors_check_executor_unit_test_ts["src/executors/check/executor.unit.test.ts"]
|
|
228
|
+
file_src_executors_check_executor_utilities_ts["src/executors/check/executor.utilities.ts"]
|
|
187
229
|
file_src_index_ts["src/index.ts"]
|
|
188
230
|
file_src_index_unit_test_ts["src/index.unit.test.ts"]
|
|
189
231
|
file_src_modules_options_options_constants_ts["src/modules/options/options.constants.ts"]
|
|
@@ -198,6 +240,7 @@ graph LR
|
|
|
198
240
|
file_src_modules_plugin_plugin_service_ts["src/modules/plugin/plugin.service.ts"]
|
|
199
241
|
file_src_modules_plugin_plugin_service_unit_test_ts["src/modules/plugin/plugin.service.unit.test.ts"]
|
|
200
242
|
file_src_modules_plugin_plugin_types_ts["src/modules/plugin/plugin.types.ts"]
|
|
243
|
+
file_testing_fake_command_line_ts["testing/fake-command-line.ts"]
|
|
201
244
|
file_testing_fake_workspace_ts["testing/fake-workspace.ts"]
|
|
202
245
|
file_testing_mocks_ts["testing/mocks.ts"]
|
|
203
246
|
file_testing_setup_ts["testing/setup.ts"]
|
|
@@ -205,6 +248,17 @@ graph LR
|
|
|
205
248
|
file_vitest_config_ts["vitest.config.ts"]
|
|
206
249
|
file_src_coinagerie_nx_module_ts --> file_src_modules_plugin_plugin_module_ts
|
|
207
250
|
file_src_coinagerie_nx_module_unit_test_ts --> file_src_coinagerie_nx_module_ts
|
|
251
|
+
file_src_executors_check_batch_executor_ts --> file_src_executors_check_executor_types_ts
|
|
252
|
+
file_src_executors_check_batch_executor_ts --> file_src_executors_check_executor_utilities_ts
|
|
253
|
+
file_src_executors_check_batch_executor_unit_test_ts --> file_src_executors_check_batch_executor_ts
|
|
254
|
+
file_src_executors_check_batch_executor_unit_test_ts --> file_src_executors_check_executor_types_ts
|
|
255
|
+
file_src_executors_check_batch_executor_unit_test_ts --> file_testing_fake_command_line_ts
|
|
256
|
+
file_src_executors_check_executor_ts --> file_src_executors_check_executor_types_ts
|
|
257
|
+
file_src_executors_check_executor_ts --> file_src_executors_check_executor_utilities_ts
|
|
258
|
+
file_src_executors_check_executor_unit_test_ts --> file_src_executors_check_executor_ts
|
|
259
|
+
file_src_executors_check_executor_unit_test_ts --> file_src_executors_check_executor_types_ts
|
|
260
|
+
file_src_executors_check_executor_unit_test_ts --> file_testing_fake_command_line_ts
|
|
261
|
+
file_src_executors_check_executor_utilities_ts --> file_src_executors_check_executor_types_ts
|
|
208
262
|
file_src_index_ts --> file_src_modules_options_options_constants_ts
|
|
209
263
|
file_src_index_ts --> file_src_modules_plugin_plugin_context_utilities_ts
|
|
210
264
|
file_src_index_ts --> file_src_modules_plugin_plugin_constants_ts
|
|
@@ -240,36 +294,36 @@ graph LR
|
|
|
240
294
|
|
|
241
295
|
### Project
|
|
242
296
|
|
|
243
|
-

|
|
298
|
+

|
|
299
|
+

|
|
300
|
+

|
|
247
301
|
|
|
248
302
|
### TypeScript
|
|
249
303
|
|
|
250
|
-

|
|
305
|
+

|
|
252
306
|

|
|
253
307
|

|
|
254
308
|

|
|
255
|
-

|
|
256
310
|

|
|
257
311
|
|
|
258
312
|
### JavaScript
|
|
259
313
|
|
|
260
314
|

|
|
261
|
-

|
|
316
|
+

|
|
263
317
|

|
|
264
|
-

|
|
265
319
|

|
|
266
|
-

|
|
321
|
+

|
|
322
|
+

|
|
323
|
+

|
|
324
|
+

|
|
325
|
+

|
|
326
|
+

|
|
273
327
|

|
|
274
328
|
|
|
275
329
|
### Python
|
|
@@ -289,17 +343,17 @@ graph LR
|
|
|
289
343
|
|
|
290
344
|
### JSON
|
|
291
345
|
|
|
292
|
-

|
|
347
|
+

|
|
348
|
+

|
|
349
|
+

|
|
350
|
+

|
|
351
|
+

|
|
298
352
|

|
|
299
|
-

|
|
300
354
|

|
|
301
|
-

|
|
356
|
+

|
|
303
357
|

|
|
304
358
|
|
|
305
359
|
### YAML
|
|
@@ -384,10 +438,10 @@ graph LR
|
|
|
384
438
|

|
|
385
439
|

|
|
386
440
|

|
|
387
|
-

|
|
442
|
+

|
|
389
443
|

|
|
390
|
-

|
|
391
445
|

|
|
392
446
|

|
|
393
447
|

|
|
@@ -425,20 +479,20 @@ graph LR
|
|
|
425
479
|
### Markdown
|
|
426
480
|
|
|
427
481
|

|
|
428
|
-

|
|
429
483
|

|
|
430
|
-

|
|
485
|
+

|
|
432
486
|

|
|
433
487
|

|
|
434
488
|

|
|
435
|
-

|
|
490
|
+

|
|
491
|
+

|
|
438
492
|

|
|
439
493
|

|
|
440
494
|

|
|
441
|
-

|
|
442
496
|

|
|
443
497
|

|
|
444
498
|

|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import "./rolldown-runtime-CNE2giL2.js";
|
|
2
|
+
import { spawn as e } from "node:child_process";
|
|
3
|
+
// src/executors/check/executor.utilities.ts
|
|
4
|
+
function groupTasks(...[e, t, n, r]) {
|
|
5
|
+
let i = {}, a = /* @__PURE__ */ new Map();
|
|
6
|
+
for (let [o, s] of Object.entries(e.tasks)) {
|
|
7
|
+
let e = r.projectGraph.nodes[s.target.project]?.data.root, { command: c, write: l } = t[o] ?? n;
|
|
8
|
+
if (e === void 0) {
|
|
9
|
+
i[o] = {
|
|
10
|
+
success: !1,
|
|
11
|
+
terminalOutput: `Unknown project: ${s.target.project}.`
|
|
12
|
+
};
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
let u = l === !0 ? "write" : "check", d = `${u}\0${c}`, f = a.get(d) ?? {
|
|
16
|
+
command: c,
|
|
17
|
+
mode: u,
|
|
18
|
+
tasks: []
|
|
19
|
+
};
|
|
20
|
+
f.tasks.push({
|
|
21
|
+
directory: e,
|
|
22
|
+
id: o
|
|
23
|
+
}), a.set(d, f);
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
failures: i,
|
|
27
|
+
groups: [...a.values()]
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
async function runBatch(...e) {
|
|
31
|
+
let { failures: t, groups: n } = groupTasks(...e), r = { ...t };
|
|
32
|
+
for (let t of n) Object.assign(r, await runGroup({
|
|
33
|
+
group: t,
|
|
34
|
+
root: e[3].root
|
|
35
|
+
}));
|
|
36
|
+
return r;
|
|
37
|
+
}
|
|
38
|
+
async function runGroup(e) {
|
|
39
|
+
let t = {};
|
|
40
|
+
try {
|
|
41
|
+
let n = parseVerdicts(await runProcess(e));
|
|
42
|
+
for (let { directory: r, id: i } of e.group.tasks) {
|
|
43
|
+
let e = n.find((e) => e.directory === r);
|
|
44
|
+
t[i] = e === void 0 ? {
|
|
45
|
+
success: !1,
|
|
46
|
+
terminalOutput: `No verdict for ${r}.`
|
|
47
|
+
} : {
|
|
48
|
+
success: e.ok,
|
|
49
|
+
terminalOutput: e.report
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
} catch (n) {
|
|
53
|
+
for (let { id: r } of e.group.tasks) t[r] = {
|
|
54
|
+
success: !1,
|
|
55
|
+
terminalOutput: n instanceof Error ? n.message : String(n)
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return t;
|
|
59
|
+
}
|
|
60
|
+
function buildCommand(e) {
|
|
61
|
+
let t = e.mode === "write" ? " --write" : "", n = "";
|
|
62
|
+
for (let { directory: t } of e.tasks) n += ` ${quote(t)}`;
|
|
63
|
+
return `${e.command} batch${t}${n}`;
|
|
64
|
+
}
|
|
65
|
+
function isVerdictList(e) {
|
|
66
|
+
if (!Array.isArray(e)) return !1;
|
|
67
|
+
for (let t of e) if (!isVerdictRecord(t)) return !1;
|
|
68
|
+
return !0;
|
|
69
|
+
}
|
|
70
|
+
function isVerdictRecord(e) {
|
|
71
|
+
return typeof e == "object" && !!e && "directory" in e && typeof e.directory == "string" && "ok" in e && typeof e.ok == "boolean" && "report" in e && typeof e.report == "string";
|
|
72
|
+
}
|
|
73
|
+
function parseVerdicts(e) {
|
|
74
|
+
try {
|
|
75
|
+
let t = JSON.parse(e.stdout);
|
|
76
|
+
if (isVerdictList(t)) return t;
|
|
77
|
+
} catch {}
|
|
78
|
+
throw Error(`The coinagerie command line exited ${String(e.status)} without a verdict.\n${e.stderr}${e.stdout}`);
|
|
79
|
+
}
|
|
80
|
+
function quote(e) {
|
|
81
|
+
return `'${e.replaceAll("'", String.raw`'\''`)}'`;
|
|
82
|
+
}
|
|
83
|
+
async function runProcess(t) {
|
|
84
|
+
let n = e(buildCommand(t.group), {
|
|
85
|
+
cwd: t.root,
|
|
86
|
+
env: {
|
|
87
|
+
...process.env,
|
|
88
|
+
NX_WORKSPACE_ROOT: t.root
|
|
89
|
+
},
|
|
90
|
+
shell: !0
|
|
91
|
+
}), r = "", i = "";
|
|
92
|
+
return n.stdout.on("data", (e) => {
|
|
93
|
+
r += e.toString();
|
|
94
|
+
}), n.stderr.on("data", (e) => {
|
|
95
|
+
i += e.toString();
|
|
96
|
+
}), {
|
|
97
|
+
status: await new Promise((e, t) => {
|
|
98
|
+
n.on("error", t), n.on("close", e);
|
|
99
|
+
}),
|
|
100
|
+
stderr: i,
|
|
101
|
+
stdout: r
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
export { runGroup as n, runBatch as t };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Judges every task Nx batched for this executor from one command-line process.
|
|
3
|
+
*
|
|
4
|
+
* One `coinagerie-check` task per project used to start its own `node`, load
|
|
5
|
+
* a transpiler, and boot a NestJS container โ about eight seconds to read one
|
|
6
|
+
* project's words in about half of one. A batch starts the command line once
|
|
7
|
+
* and names every project to it, so each still passes or fails alone and is
|
|
8
|
+
* still cached alone: Nx hashes and replays batched tasks one by one.
|
|
9
|
+
*/
|
|
10
|
+
declare function checkBatchExecutor(...args: CheckBatchExecutorArguments): Promise<Record<string, CheckBatchTaskResult>>;
|
|
11
|
+
export default checkBatchExecutor;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The four arguments Nx calls a batch executor with, in the order it passes them.
|
|
15
|
+
*
|
|
16
|
+
* A tuple rather than four parameters because Nx fixes that signature and the
|
|
17
|
+
* workspace holds a function to three: the task graph, each task's resolved
|
|
18
|
+
* options by task id, the overrides of the whole run, and the context.
|
|
19
|
+
*/
|
|
20
|
+
declare type CheckBatchExecutorArguments = [
|
|
21
|
+
taskGraph: CheckBatchTaskGraph,
|
|
22
|
+
options: Record<string, CheckExecutorOptions>,
|
|
23
|
+
overrides: CheckExecutorOptions,
|
|
24
|
+
context: CheckBatchExecutorContext
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
/** What a batch reads of Nx's context: the project graph's roots and the workspace root. */
|
|
28
|
+
declare interface CheckBatchExecutorContext {
|
|
29
|
+
readonly projectGraph: {
|
|
30
|
+
readonly nodes: Record<string, {
|
|
31
|
+
readonly data: {
|
|
32
|
+
readonly root: string;
|
|
33
|
+
};
|
|
34
|
+
}>;
|
|
35
|
+
};
|
|
36
|
+
readonly root: string;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** What a batch reads of Nx's task graph: each task's id and its project. */
|
|
40
|
+
declare interface CheckBatchTaskGraph {
|
|
41
|
+
readonly tasks: Record<string, {
|
|
42
|
+
readonly target: {
|
|
43
|
+
readonly project: string;
|
|
44
|
+
};
|
|
45
|
+
}>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* What one task of a check batch settled on.
|
|
50
|
+
*
|
|
51
|
+
* Nx's own type for a batch executor's result is not exported through
|
|
52
|
+
* `@nx/devkit`, so this states the shape Nx reads back: whether the task
|
|
53
|
+
* passed, and the output to show and to store with it in the cache.
|
|
54
|
+
*/
|
|
55
|
+
declare interface CheckBatchTaskResult {
|
|
56
|
+
readonly success: boolean;
|
|
57
|
+
readonly terminalOutput: string;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Options the check executor accepts. */
|
|
61
|
+
declare interface CheckExecutorOptions {
|
|
62
|
+
/** The shell command that starts the `coinagerie` command line. */
|
|
63
|
+
readonly command: string;
|
|
64
|
+
/** Rewrite each glossary to hold the code's words instead of judging it. */
|
|
65
|
+
readonly write?: boolean | undefined;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "../../../rolldown-runtime-CNE2giL2.js";
|
|
2
|
+
import { t as e } from "../../../executor.utilities-CUgE7Mg2.js";
|
|
3
|
+
// src/executors/check/batch-executor.ts
|
|
4
|
+
async function checkBatchExecutor(...t) {
|
|
5
|
+
let n = await e(...t);
|
|
6
|
+
return printFailures(n), n;
|
|
7
|
+
}
|
|
8
|
+
function printFailures(e) {
|
|
9
|
+
for (let [t, n] of Object.entries(e)) n.success || process.stdout.write(`\n> ${t}\n${n.terminalOutput}\n`);
|
|
10
|
+
}
|
|
11
|
+
export { checkBatchExecutor as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Judges one project's glossaries against the words its code uses.
|
|
3
|
+
*
|
|
4
|
+
* Inferred onto every project holding a coinagerie configuration, so
|
|
5
|
+
* `nx affected -t coinagerie-check` judges only the projects a branch touched.
|
|
6
|
+
* With `write` it rewrites the glossaries instead of failing on one. It is the
|
|
7
|
+
* batch of one: the same command line, asked about a single project.
|
|
8
|
+
*/
|
|
9
|
+
declare function checkExecutor(options: CheckExecutorOptions, context: CheckExecutorContext): Promise<{
|
|
10
|
+
success: boolean;
|
|
11
|
+
}>;
|
|
12
|
+
export default checkExecutor;
|
|
13
|
+
|
|
14
|
+
/** What a single run reads of Nx's context: its project, that project's root, and the workspace root. */
|
|
15
|
+
declare interface CheckExecutorContext {
|
|
16
|
+
readonly projectName?: string | undefined;
|
|
17
|
+
readonly projectsConfigurations: {
|
|
18
|
+
readonly projects: Record<string, undefined | {
|
|
19
|
+
readonly root: string;
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
22
|
+
readonly root: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Options the check executor accepts. */
|
|
26
|
+
declare interface CheckExecutorOptions {
|
|
27
|
+
/** The shell command that starts the `coinagerie` command line. */
|
|
28
|
+
readonly command: string;
|
|
29
|
+
/** Rewrite each glossary to hold the code's words instead of judging it. */
|
|
30
|
+
readonly write?: boolean | undefined;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { }
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "../../../rolldown-runtime-CNE2giL2.js";
|
|
2
|
+
import { n as e } from "../../../executor.utilities-CUgE7Mg2.js";
|
|
3
|
+
// src/executors/check/executor.ts
|
|
4
|
+
async function checkExecutor(t, n) {
|
|
5
|
+
let r = n.projectName;
|
|
6
|
+
if (r === void 0) throw Error("The coinagerie check executor must be run against a project.");
|
|
7
|
+
let i = n.projectsConfigurations.projects[r];
|
|
8
|
+
if (i === void 0) throw Error(`Unknown project: ${r}.`);
|
|
9
|
+
let a = Object.values(await e({
|
|
10
|
+
group: {
|
|
11
|
+
command: t.command,
|
|
12
|
+
mode: t.write === !0 ? "write" : "check",
|
|
13
|
+
tasks: [{
|
|
14
|
+
directory: i.root,
|
|
15
|
+
id: r
|
|
16
|
+
}]
|
|
17
|
+
},
|
|
18
|
+
root: n.root
|
|
19
|
+
}));
|
|
20
|
+
return process.stdout.write(`${a.map(({ terminalOutput: e }) => e).join("\n")}\n`), { success: a.every(({ success: e }) => e) };
|
|
21
|
+
}
|
|
22
|
+
export { checkExecutor as default };
|
package/dist/src/index.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import "../rolldown-runtime-CNE2giL2.js";
|
|
1
2
|
import e from "node:path";
|
|
2
3
|
import "reflect-metadata";
|
|
3
4
|
import { NestFactory as t } from "@nestjs/core";
|
|
4
5
|
import { Injectable as n, Module as r } from "@nestjs/common";
|
|
5
6
|
import { existsSync as i, readFileSync as a } from "node:fs";
|
|
6
7
|
import { CONFIGURATION_FILE_NAMES as o } from "@coinagerie/configuration";
|
|
7
|
-
//
|
|
8
|
+
// src/modules/options/options.constants.ts
|
|
8
9
|
var s = "@coinagerie/nx", c = "coinagerie-check", l = "coinagerie";
|
|
9
10
|
// \0@oxc-project+runtime@0.155.0/helpers/esm/decorateMetadata.js
|
|
10
11
|
function __decorateMetadata(e, t) {
|
|
@@ -71,16 +72,13 @@ var f = `**/{${o.join(",")}}`, p = "{projectRoot}/**/*", m = "__coinageriePlugin
|
|
|
71
72
|
buildCheckTarget(e) {
|
|
72
73
|
return { [e.checkTargetName]: {
|
|
73
74
|
cache: !0,
|
|
74
|
-
executor: "nx:
|
|
75
|
+
executor: "@coinagerie/nx:check",
|
|
75
76
|
inputs: [
|
|
76
77
|
...o.map((e) => `{projectRoot}/${e}`),
|
|
77
78
|
p,
|
|
78
79
|
...e.inputs
|
|
79
80
|
],
|
|
80
|
-
options: {
|
|
81
|
-
command: `${e.command} --check`,
|
|
82
|
-
cwd: "{projectRoot}"
|
|
83
|
-
}
|
|
81
|
+
options: { command: e.command }
|
|
84
82
|
} };
|
|
85
83
|
}
|
|
86
84
|
isNamedPackage(e) {
|
package/executors.json
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "../../../../node_modules/nx/schemas/executors.json",
|
|
3
|
+
"executors": {
|
|
4
|
+
"check": {
|
|
5
|
+
"batchImplementation": "@coinagerie/nx/src/executors/check/batch-executor",
|
|
6
|
+
"description": "Judge a project's glossaries against the words its code uses, or rewrite them.",
|
|
7
|
+
"implementation": "@coinagerie/nx/src/executors/check/executor",
|
|
8
|
+
"preferBatch": true,
|
|
9
|
+
"schema": "./src/executors/check/schema.json"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"url": "https://github.com/organizzolini/codebase/issues"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@coinagerie/configuration": "0.0.
|
|
7
|
+
"@coinagerie/configuration": "0.0.6",
|
|
8
8
|
"@nestjs/common": "^11.1.21 || ^12.0.1",
|
|
9
9
|
"@nestjs/core": "^11.1.21 || ^12.0.1",
|
|
10
10
|
"@nx/devkit": "^24.0.0",
|
|
@@ -20,18 +20,23 @@
|
|
|
20
20
|
"@vitest/coverage-v8": "^5.0.0",
|
|
21
21
|
"vitest": "^5.0.0"
|
|
22
22
|
},
|
|
23
|
+
"executors": "./executors.json",
|
|
23
24
|
"exports": {
|
|
24
25
|
".": {
|
|
25
26
|
"types": "./dist/src/index.d.ts",
|
|
26
27
|
"default": "./dist/src/index.js"
|
|
27
28
|
},
|
|
28
|
-
"./
|
|
29
|
+
"./executors.json": "./executors.json",
|
|
30
|
+
"./package.json": "./package.json",
|
|
31
|
+
"./src/executors/*": "./dist/src/executors/*.js"
|
|
29
32
|
},
|
|
30
33
|
"files": [
|
|
31
34
|
"CHANGELOG.md",
|
|
32
35
|
"dist",
|
|
36
|
+
"executors.json",
|
|
33
37
|
"LICENSE",
|
|
34
|
-
"README.md"
|
|
38
|
+
"README.md",
|
|
39
|
+
"src/executors/*/schema.json"
|
|
35
40
|
],
|
|
36
41
|
"homepage": "https://github.com/organizzolini/codebase/tree/main/projects/ic-suite/coinagerie/coinagerie-nx#readme",
|
|
37
42
|
"keywords": [
|
|
@@ -44,6 +49,9 @@
|
|
|
44
49
|
"license": "MIT",
|
|
45
50
|
"main": "./dist/src/index.js",
|
|
46
51
|
"name": "@coinagerie/nx",
|
|
52
|
+
"nx": {
|
|
53
|
+
"executors": "./executors.json"
|
|
54
|
+
},
|
|
47
55
|
"publishConfig": {
|
|
48
56
|
"access": "public",
|
|
49
57
|
"registry": "https://registry.npmjs.org"
|
|
@@ -59,5 +67,5 @@
|
|
|
59
67
|
"strict": true
|
|
60
68
|
},
|
|
61
69
|
"types": "./dist/src/index.d.ts",
|
|
62
|
-
"version": "0.0.
|
|
70
|
+
"version": "0.0.6"
|
|
63
71
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"description": "Judge a project's glossaries against the words its code uses, or rewrite them.",
|
|
4
|
+
"properties": {
|
|
5
|
+
"command": {
|
|
6
|
+
"description": "Required. The shell command that starts the coinagerie command line, to which the batch command and its project folders are appended.",
|
|
7
|
+
"type": "string"
|
|
8
|
+
},
|
|
9
|
+
"write": {
|
|
10
|
+
"default": false,
|
|
11
|
+
"description": "Rewrite each glossary to hold exactly the code's words, keeping definitions, instead of failing when one disagrees.",
|
|
12
|
+
"type": "boolean"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"required": ["command"],
|
|
16
|
+
"title": "Coinagerie check",
|
|
17
|
+
"type": "object"
|
|
18
|
+
}
|