@coinagerie/cli 0.0.3 โ 0.0.5
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 +22 -0
- package/README.md +123 -65
- package/dist/src/coinagerie-cli.main.js +157 -24
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## 0.0.5 (2026-11-06)
|
|
2
|
+
|
|
3
|
+
### ๐ฅ Performance
|
|
4
|
+
|
|
5
|
+
- **coinagerie:** โก๏ธ judge every project's glossary from one batched command-line run ([#2115](https://github.com/organizzolini/codebase/pull/2115))
|
|
6
|
+
|
|
7
|
+
### ๐งฑ Updated Dependencies
|
|
8
|
+
|
|
9
|
+
- Updated coinagerie-configuration to 0.0.5
|
|
10
|
+
- Updated coinagerie-vocabulary to 0.0.5
|
|
11
|
+
- Updated coinagerie-output to 0.0.5
|
|
12
|
+
- Updated coinagerie-core to 0.0.5
|
|
13
|
+
|
|
14
|
+
## 0.0.4 (2026-11-04)
|
|
15
|
+
|
|
16
|
+
### ๐งฑ Updated Dependencies
|
|
17
|
+
|
|
18
|
+
- Updated coinagerie-configuration to 0.0.4
|
|
19
|
+
- Updated coinagerie-vocabulary to 0.0.4
|
|
20
|
+
- Updated coinagerie-output to 0.0.4
|
|
21
|
+
- Updated coinagerie-core to 0.0.4
|
|
22
|
+
|
|
1
23
|
## 0.0.3 (2026-11-04)
|
|
2
24
|
|
|
3
25
|
### ๐งฑ Updated Dependencies
|
package/README.md
CHANGED
|
@@ -64,29 +64,19 @@ This project was generated from the [nestjs-command-project](../../configuration
|
|
|
64
64
|
|
|
65
65
|
The words this project uses that the root glossary does not define, regenerated with `nx run coinagerie-cli:coinagerie-check:write`.
|
|
66
66
|
|
|
67
|
-
- **anchor**:
|
|
68
|
-
- **angle**:
|
|
69
|
-
- **aspect**:
|
|
70
|
-
- **
|
|
71
|
-
- **
|
|
72
|
-
- **
|
|
73
|
-
- **
|
|
74
|
-
- **
|
|
75
|
-
- **
|
|
76
|
-
- **
|
|
77
|
-
- **glossary
|
|
78
|
-
- **
|
|
79
|
-
- **
|
|
80
|
-
- **malformed**:
|
|
81
|
-
- **phase**:
|
|
82
|
-
- **polyglot**:
|
|
83
|
-
- **reconcile**:
|
|
84
|
-
- **rejection**:
|
|
85
|
-
- **rewrite**:
|
|
86
|
-
- **scratch**:
|
|
87
|
-
- **stale**:
|
|
88
|
-
- **vanish**:
|
|
89
|
-
- **vocabulary**:
|
|
67
|
+
- **anchor**: Start and end marker comments bracketing the coinagerie block in a markdown glossary, so a write replaces only that span.
|
|
68
|
+
- **angle**: Sample glossary word the end-to-end tests define as the gap between two bodies, used to exercise a failing check.
|
|
69
|
+
- **aspect**: Sample glossary word in the collect command's JSON and check-failure fixtures, standing for an identifier that must be defined.
|
|
70
|
+
- **batch**: The command that checks or writes the glossaries of many project directories in one process, printing a JSON verdict for each.
|
|
71
|
+
- **breadth**: Second limit in callidescope's gate, the count of distinct callees one callable may reach, here capped at five in this package.
|
|
72
|
+
- **bullet**: Glossary entry line in the form dash, bold word, colon, which carries the definition beneath it and is what the parser reads.
|
|
73
|
+
- **disagree**: Of a glossary whose words differ from the code's, missing some or listing stale ones, so a check fails on it.
|
|
74
|
+
- **glossary**: The markdown or JSON file of word-to-definition entries that a run checks against the code and rewrites when asked.
|
|
75
|
+
- **lunar**: Sample glossary word in the check-failure fixtures, given an empty definition, which a check still passes though it stays undefined.
|
|
76
|
+
- **phase**: Sample glossary word in the check-failure fixtures, given a short definition that the markdown and JSON tests assert on.
|
|
77
|
+
- **reconcile**: Method of the comparison service that merges collected words with existing glossary entries, keeping definitions for words still in use.
|
|
78
|
+
- **rewrite**: Action of the write mode that rewrites every glossary to hold exactly the code's words, keeping definitions for words still present.
|
|
79
|
+
- **vocabulary**: Workspace package that collects the words a codebase uses, depended on by coinagerie-cli to gather its vocabulary.
|
|
90
80
|
|
|
91
81
|
<!-- coinagerie:end -->
|
|
92
82
|
|
|
@@ -98,13 +88,13 @@ Call stacks traced through `projects/ic-suite/coinagerie/coinagerie-cli`, deepes
|
|
|
98
88
|
|
|
99
89
|
| Measure | Value |
|
|
100
90
|
| --- | --- |
|
|
101
|
-
| Callables |
|
|
102
|
-
| Files |
|
|
103
|
-
| Calls traced |
|
|
104
|
-
| Call stacks |
|
|
91
|
+
| Callables | 40 |
|
|
92
|
+
| Files | 25 |
|
|
93
|
+
| Calls traced | 37 |
|
|
94
|
+
| Call stacks | 2 |
|
|
105
95
|
| Deepest stack | 13 |
|
|
106
96
|
| Stacks through recursion | 0 |
|
|
107
|
-
| Unfollowable calls |
|
|
97
|
+
| Unfollowable calls | 2 |
|
|
108
98
|
|
|
109
99
|
### Limits
|
|
110
100
|
|
|
@@ -117,7 +107,35 @@ What this project is judged against, as declared in its own `callidescope.config
|
|
|
117
107
|
|
|
118
108
|
### Call stacks (depth)
|
|
119
109
|
|
|
120
|
-
**1. `
|
|
110
|
+
**1. `BatchCommand.run`** โ depth โฅ 13 ยท decorated-method
|
|
111
|
+
|
|
112
|
+
```text
|
|
113
|
+
๐ BatchCommand.run(directories: string[], options?: BatchCommandOptions): Promise<void> [projects/ic-suite/coinagerie/coinagerie-cli/src/modules/batch/batch.command.ts:61]
|
|
114
|
+
โณ Judges or rewrites each named project, then prints every verdict.
|
|
115
|
+
โโ> CheckService.run(args: RunCheckArguments): Promise<CheckVerdict> [projects/ic-suite/coinagerie/coinagerie-cli/src/modules/check/check.service.ts:70]
|
|
116
|
+
โณ Runs one project's check or write, failing with the reason on any fault.
|
|
117
|
+
โโ> CheckService.deliver(โฆ): CheckVerdict [projects/ic-suite/coinagerie/coinagerie-cli/src/modules/check/check.service.ts:40]
|
|
118
|
+
โณ Checks or writes every destination against the collected words.
|
|
119
|
+
โโ> DeliveryService.write(args: DeliverArguments): DeliveryResult[] [projects/ic-suite/coinagerie/coinagerie-output/src/modules/delivery/delivery.service.ts:113]
|
|
120
|
+
โณ Rewrites every destination to hold exactly the vocabulary, keeping every definition still in use.
|
|
121
|
+
โโ> DeliveryService.readAll(destinations: ResolvedCoinagerieOutput[]): ReadDestination[] [projects/ic-suite/coinagerie/coinagerie-output/src/modules/delivery/delivery.service.ts:83]
|
|
122
|
+
โณ Reads and parses every destination, throwing before anything is written.
|
|
123
|
+
โโ> DeliveryService.map(โฆ)(โฆ): { content: string | undefined; destination: ResolvedCoinagerieOutput; glossary: Glossary; } [projects/ic-suite/coinagerie/coinagerie-output/src/modules/delivery/delivery.service.ts:84]
|
|
124
|
+
โโ> MarkdownService.read(content: string | undefined, filePath: string): Glossary | undefined [projects/ic-suite/coinagerie/coinagerie-output/src/modules/markdown/markdown.service.ts:237]
|
|
125
|
+
โณ Reads a destination's glossary; a missing file holds none.
|
|
126
|
+
โโ> MarkdownService.parse(content: string, filePath: string): Glossary | undefined [projects/ic-suite/coinagerie/coinagerie-output/src/modules/markdown/markdown.service.ts:212]
|
|
127
|
+
โณ The glossary in a file's block, or `undefined` when it has no anchors.
|
|
128
|
+
โโ> MarkdownService.forEach(โฆ)(text: string, index: number): void [projects/ic-suite/coinagerie/coinagerie-output/src/modules/markdown/markdown.service.ts:228]
|
|
129
|
+
โโ> MarkdownService.readLine(state: BlockParserState, text: string, line: number): void [projects/ic-suite/coinagerie/coinagerie-output/src/modules/markdown/markdown.service.ts:173]
|
|
130
|
+
โณ Reads one line of the block, or refuses it.
|
|
131
|
+
โโ> MarkdownService.readBullet(โฆ): void [projects/ic-suite/coinagerie/coinagerie-output/src/modules/markdown/markdown.service.ts:110]
|
|
132
|
+
โณ Reads one bullet, starting a new word.
|
|
133
|
+
โโ> MarkdownService.fail(state: Pick<BlockParserState, "filePath">, line: number, reason: string): never [projects/ic-suite/coinagerie/coinagerie-output/src/modules/markdown/markdown.service.ts:50]
|
|
134
|
+
โณ Fails a parse, naming the file and the one-indexed line.
|
|
135
|
+
โโ> MalformedGlossaryError.constructor(location: MalformedGlossaryLocation): MalformedGlossaryError [projects/ic-suite/coinagerie/coinagerie-core/src/modules/coinagerie-core/coinagerie-core.constants.ts:47]
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**2. `CollectCommand.run`** โ depth โฅ 13 ยท decorated-method
|
|
121
139
|
|
|
122
140
|
```text
|
|
123
141
|
๐ CollectCommand.run(_passedParameters: string[], options?: CollectCommandOptions): Promise<void> [projects/ic-suite/coinagerie/coinagerie-cli/src/modules/collect/collect.command.ts:335]
|
|
@@ -150,16 +168,21 @@ What this project is judged against, as declared in its own `callidescope.config
|
|
|
150
168
|
| Callable | Breadth | Calls directly | Location |
|
|
151
169
|
| --- | --- | --- | --- |
|
|
152
170
|
| `CollectCommand.run` | 5 | `CollectCommand.selectMode`, `CollectCommand.loadConfiguration`, `CollectCommand.collectWords`, `CollectCommand.print`, `CollectCommand.deliver` | `projects/ic-suite/coinagerie/coinagerie-cli/src/modules/collect/collect.command.ts:335` |
|
|
153
|
-
| `
|
|
154
|
-
| `
|
|
171
|
+
| `CheckService.deliver` | 4 | `reportWritten`, `DeliveryService.write`, `judgeDifferences`, `DeliveryService.check` | `projects/ic-suite/coinagerie/coinagerie-cli/src/modules/check/check.service.ts:40` |
|
|
172
|
+
| `CheckService.run` | 3 | `ConfigurationService.loadConfiguration`, `VocabularyService.collect`, `CheckService.deliver` | `projects/ic-suite/coinagerie/coinagerie-cli/src/modules/check/check.service.ts:70` |
|
|
155
173
|
|
|
156
174
|
<details>
|
|
157
|
-
<summary>
|
|
175
|
+
<summary>10 more callables</summary>
|
|
158
176
|
|
|
159
177
|
| Callable | Breadth | Calls directly | Location |
|
|
160
178
|
| --- | --- | --- | --- |
|
|
179
|
+
| `CollectCommand.check` | 3 | `CollectCommand.filter(โฆ)`, `DeliveryService.check`, `CollectCommand.fail` | `projects/ic-suite/coinagerie/coinagerie-cli/src/modules/collect/collect.command.ts:67` |
|
|
180
|
+
| `CollectCommand.deliver` | 3 | `CollectCommand.fail`, `CollectCommand.check`, `CollectCommand.write` | `projects/ic-suite/coinagerie/coinagerie-cli/src/modules/collect/collect.command.ts:113` |
|
|
161
181
|
| `CollectCommand.loadConfiguration` | 3 | `ConfigurationService.loadConfiguration`, `CollectCommand.overridesFrom`, `CollectCommand.fail` | `projects/ic-suite/coinagerie/coinagerie-cli/src/modules/collect/collect.command.ts:149` |
|
|
162
182
|
| `CollectCommand.print` | 3 | `ComparisonService.reconcile`, `JsonService.render`, `MarkdownService.render` | `projects/ic-suite/coinagerie/coinagerie-cli/src/modules/collect/collect.command.ts:181` |
|
|
183
|
+
| `judgeDifferences` | 2 | `filter(โฆ)`, `map(โฆ)` | `projects/ic-suite/coinagerie/coinagerie-cli/src/modules/check/check.utilities.ts:13` |
|
|
184
|
+
| `reportWritten` | 2 | `map(โฆ)`, `filter(โฆ)` | `projects/ic-suite/coinagerie/coinagerie-cli/src/modules/check/check.utilities.ts:33` |
|
|
185
|
+
| `BatchCommand.run` | 2 | `CheckService.run`, `BatchCommand.every(โฆ)` | `projects/ic-suite/coinagerie/coinagerie-cli/src/modules/batch/batch.command.ts:61` |
|
|
163
186
|
| `CollectCommand.collectWords` | 2 | `VocabularyService.collect`, `CollectCommand.fail` | `projects/ic-suite/coinagerie/coinagerie-cli/src/modules/collect/collect.command.ts:97` |
|
|
164
187
|
| `CollectCommand.selectMode` | 2 | `CollectCommand.rejectionOf`, `CollectCommand.fail` | `projects/ic-suite/coinagerie/coinagerie-cli/src/modules/collect/collect.command.ts:208` |
|
|
165
188
|
| `CollectCommand.write` | 2 | `DeliveryService.write`, `CollectCommand.filter(โฆ)` | `projects/ic-suite/coinagerie/coinagerie-cli/src/modules/collect/collect.command.ts:224` |
|
|
@@ -201,6 +224,8 @@ _Dashed edges are dependencies Nx inferred from configuration rather than from c
|
|
|
201
224
|
<!-- codependix:start name="codependix-nestjs-modules" -->
|
|
202
225
|
```mermaid
|
|
203
226
|
flowchart LR
|
|
227
|
+
BatchModule
|
|
228
|
+
CheckModule
|
|
204
229
|
CollectModule
|
|
205
230
|
ComparisonModule
|
|
206
231
|
ConfigModule([ConfigModule])
|
|
@@ -224,6 +249,10 @@ flowchart LR
|
|
|
224
249
|
VocabularyModule
|
|
225
250
|
WordsModule
|
|
226
251
|
YamlModule
|
|
252
|
+
BatchModule --> CheckModule
|
|
253
|
+
CheckModule --> ConfigurationModule
|
|
254
|
+
CheckModule --> DeliveryModule
|
|
255
|
+
CheckModule --> VocabularyModule
|
|
227
256
|
CollectModule --> ComparisonModule
|
|
228
257
|
CollectModule --> ConfigurationModule
|
|
229
258
|
CollectModule --> DeliveryModule
|
|
@@ -245,6 +274,7 @@ flowchart LR
|
|
|
245
274
|
LanguagesModule --> TomlModule
|
|
246
275
|
LanguagesModule --> TypescriptModule
|
|
247
276
|
LanguagesModule --> YamlModule
|
|
277
|
+
MainModule --> BatchModule
|
|
248
278
|
MainModule --> CollectModule
|
|
249
279
|
MainModule --> DiscoveryModule
|
|
250
280
|
PythonModule --> ScannerModule
|
|
@@ -278,6 +308,17 @@ graph LR
|
|
|
278
308
|
file_src_coinagerie_cli_repl_ts["src/coinagerie-cli.repl.ts"]
|
|
279
309
|
file_src_coinagerie_cli_repl_unit_test_ts["src/coinagerie-cli.repl.unit.test.ts"]
|
|
280
310
|
file_src_index_ts["src/index.ts"]
|
|
311
|
+
file_src_modules_batch_batch_command_ts["src/modules/batch/batch.command.ts"]
|
|
312
|
+
file_src_modules_batch_batch_command_unit_test_ts["src/modules/batch/batch.command.unit.test.ts"]
|
|
313
|
+
file_src_modules_batch_batch_constants_ts["src/modules/batch/batch.constants.ts"]
|
|
314
|
+
file_src_modules_batch_batch_module_ts["src/modules/batch/batch.module.ts"]
|
|
315
|
+
file_src_modules_batch_batch_types_ts["src/modules/batch/batch.types.ts"]
|
|
316
|
+
file_src_modules_check_check_constants_ts["src/modules/check/check.constants.ts"]
|
|
317
|
+
file_src_modules_check_check_module_ts["src/modules/check/check.module.ts"]
|
|
318
|
+
file_src_modules_check_check_service_ts["src/modules/check/check.service.ts"]
|
|
319
|
+
file_src_modules_check_check_service_unit_test_ts["src/modules/check/check.service.unit.test.ts"]
|
|
320
|
+
file_src_modules_check_check_types_ts["src/modules/check/check.types.ts"]
|
|
321
|
+
file_src_modules_check_check_utilities_ts["src/modules/check/check.utilities.ts"]
|
|
281
322
|
file_src_modules_collect_collect_command_end_to_end_test_ts["src/modules/collect/collect.command.end-to-end.test.ts"]
|
|
282
323
|
file_src_modules_collect_collect_command_ts["src/modules/collect/collect.command.ts"]
|
|
283
324
|
file_src_modules_collect_collect_command_unit_test_ts["src/modules/collect/collect.command.unit.test.ts"]
|
|
@@ -297,9 +338,26 @@ graph LR
|
|
|
297
338
|
file_src_coinagerie_cli_main_end_to_end_test_ts --> file_testing_run_command_ts
|
|
298
339
|
file_src_coinagerie_cli_main_ts --> file_src_coinagerie_cli_module_ts
|
|
299
340
|
file_src_coinagerie_cli_module_ts --> file_src_coinagerie_cli_constants_ts
|
|
341
|
+
file_src_coinagerie_cli_module_ts --> file_src_modules_batch_batch_module_ts
|
|
300
342
|
file_src_coinagerie_cli_module_ts --> file_src_modules_collect_collect_module_ts
|
|
301
343
|
file_src_coinagerie_cli_module_unit_test_ts --> file_src_coinagerie_cli_module_ts
|
|
302
344
|
file_src_coinagerie_cli_repl_ts --> file_src_coinagerie_cli_module_ts
|
|
345
|
+
file_src_modules_batch_batch_command_ts --> file_src_modules_batch_batch_constants_ts
|
|
346
|
+
file_src_modules_batch_batch_command_ts --> file_src_modules_batch_batch_types_ts
|
|
347
|
+
file_src_modules_batch_batch_command_ts --> file_src_modules_check_check_service_ts
|
|
348
|
+
file_src_modules_batch_batch_command_unit_test_ts --> file_src_modules_batch_batch_command_ts
|
|
349
|
+
file_src_modules_batch_batch_command_unit_test_ts --> file_src_modules_check_check_service_ts
|
|
350
|
+
file_src_modules_batch_batch_command_unit_test_ts --> file_src_modules_check_check_types_ts
|
|
351
|
+
file_src_modules_batch_batch_module_ts --> file_src_modules_batch_batch_command_ts
|
|
352
|
+
file_src_modules_batch_batch_module_ts --> file_src_modules_check_check_module_ts
|
|
353
|
+
file_src_modules_batch_batch_types_ts --> file_src_modules_check_check_types_ts
|
|
354
|
+
file_src_modules_check_check_module_ts --> file_src_modules_check_check_service_ts
|
|
355
|
+
file_src_modules_check_check_service_ts --> file_src_modules_check_check_constants_ts
|
|
356
|
+
file_src_modules_check_check_service_ts --> file_src_modules_check_check_types_ts
|
|
357
|
+
file_src_modules_check_check_service_ts --> file_src_modules_check_check_utilities_ts
|
|
358
|
+
file_src_modules_check_check_service_unit_test_ts --> file_src_modules_check_check_service_ts
|
|
359
|
+
file_src_modules_check_check_utilities_ts --> file_src_modules_check_check_constants_ts
|
|
360
|
+
file_src_modules_check_check_utilities_ts --> file_src_modules_check_check_types_ts
|
|
303
361
|
file_src_modules_collect_collect_command_end_to_end_test_ts --> file_testing_examples_ts
|
|
304
362
|
file_src_modules_collect_collect_command_end_to_end_test_ts --> file_testing_fixture_tree_ts
|
|
305
363
|
file_src_modules_collect_collect_command_end_to_end_test_ts --> file_testing_run_command_ts
|
|
@@ -318,36 +376,36 @@ graph LR
|
|
|
318
376
|
|
|
319
377
|
### Project
|
|
320
378
|
|
|
321
|
-

|
|
380
|
+

|
|
381
|
+

|
|
382
|
+

|
|
325
383
|
|
|
326
384
|
### TypeScript
|
|
327
385
|
|
|
328
|
-

|
|
387
|
+

|
|
330
388
|

|
|
331
389
|

|
|
332
|
-

|
|
391
|
+

|
|
334
392
|

|
|
335
393
|
|
|
336
394
|
### JavaScript
|
|
337
395
|
|
|
338
396
|

|
|
339
|
-

|
|
340
398
|

|
|
341
|
-

|
|
400
|
+

|
|
401
|
+

|
|
402
|
+

|
|
403
|
+

|
|
404
|
+

|
|
405
|
+

|
|
406
|
+

|
|
407
|
+

|
|
408
|
+

|
|
351
409
|

|
|
352
410
|
|
|
353
411
|
### Python
|
|
@@ -458,14 +516,14 @@ graph LR
|
|
|
458
516
|
|
|
459
517
|
### Conventions
|
|
460
518
|
|
|
461
|
-

|
|
520
|
+

|
|
521
|
+

|
|
522
|
+

|
|
523
|
+

|
|
524
|
+

|
|
467
525
|

|
|
468
|
-

|
|
469
527
|

|
|
470
528
|

|
|
471
529
|

|
|
@@ -503,20 +561,20 @@ graph LR
|
|
|
503
561
|
### Markdown
|
|
504
562
|
|
|
505
563
|

|
|
506
|
-

|
|
507
565
|

|
|
508
|
-

|
|
567
|
+

|
|
510
568
|

|
|
511
569
|

|
|
512
570
|

|
|
513
|
-

|
|
572
|
+

|
|
573
|
+

|
|
516
574
|

|
|
517
575
|

|
|
518
576
|

|
|
519
|
-

|
|
520
578
|

|
|
521
579
|

|
|
522
580
|

|
|
@@ -196,7 +196,139 @@ I = __decorate([a(), s({
|
|
|
196
196
|
providers: [F]
|
|
197
197
|
})], I);
|
|
198
198
|
// src/coinagerie-cli.constants.ts
|
|
199
|
-
var L = h.object({}), R =
|
|
199
|
+
var L = h.object({}), R = "๐ช";
|
|
200
|
+
// src/modules/check/check.utilities.ts
|
|
201
|
+
function judgeDifferences(e) {
|
|
202
|
+
let t = e.differences.filter(({ missing: e, stale: t }) => e.length > 0 || t.length > 0);
|
|
203
|
+
return {
|
|
204
|
+
ok: t.length === 0,
|
|
205
|
+
report: t.map(({ missing: t, path: n, stale: r }) => `${R} Found a glossary out of step with the code: ${d.relative(e.workspaceRoot, n)}\n missing: ${t.join(", ")}\n stale: ${r.join(", ")}`).join("\n")
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
function reportWritten(e) {
|
|
209
|
+
return {
|
|
210
|
+
ok: !0,
|
|
211
|
+
report: e.results.filter(({ written: e }) => e).map(({ path: t }) => `${R} Wrote the glossary: ${d.relative(e.workspaceRoot, t)}`).join("\n")
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
// src/modules/check/check.service.ts
|
|
215
|
+
var z = class CheckService {
|
|
216
|
+
configurationService;
|
|
217
|
+
vocabularyService;
|
|
218
|
+
deliveryService;
|
|
219
|
+
constructor(e, t, n) {
|
|
220
|
+
this.configurationService = e, this.vocabularyService = t, this.deliveryService = n;
|
|
221
|
+
}
|
|
222
|
+
deliver(e) {
|
|
223
|
+
let { configuration: t, mode: n, words: r, workspaceRoot: i } = e, a = t.outputs;
|
|
224
|
+
return a.length === 0 ? {
|
|
225
|
+
ok: !1,
|
|
226
|
+
report: `${R} Found no glossary destination to ${n}: ${d.relative(i, t.configurationPath ?? "")}`
|
|
227
|
+
} : n === "write" ? reportWritten({
|
|
228
|
+
results: this.deliveryService.write({
|
|
229
|
+
destinations: a,
|
|
230
|
+
words: r
|
|
231
|
+
}),
|
|
232
|
+
workspaceRoot: i
|
|
233
|
+
}) : judgeDifferences({
|
|
234
|
+
differences: this.deliveryService.check({
|
|
235
|
+
destinations: a,
|
|
236
|
+
words: r
|
|
237
|
+
}),
|
|
238
|
+
workspaceRoot: i
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
async run(e) {
|
|
242
|
+
try {
|
|
243
|
+
let t = await this.configurationService.loadConfiguration({
|
|
244
|
+
configurationPath: void 0,
|
|
245
|
+
overrides: {},
|
|
246
|
+
workingDirectory: e.directory
|
|
247
|
+
}), n = await this.vocabularyService.collect(t);
|
|
248
|
+
return this.deliver({
|
|
249
|
+
configuration: t,
|
|
250
|
+
mode: e.mode,
|
|
251
|
+
words: n,
|
|
252
|
+
workspaceRoot: e.workspaceRoot
|
|
253
|
+
});
|
|
254
|
+
} catch (t) {
|
|
255
|
+
return {
|
|
256
|
+
ok: !1,
|
|
257
|
+
report: `${R} Could not ${e.mode} ${d.relative(e.workspaceRoot, e.directory)}: ${t instanceof Error ? t.message : String(t)}`
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
z = __decorate([o(), __decorateMetadata("design:paramtypes", [
|
|
263
|
+
_ === void 0 ? Object : _,
|
|
264
|
+
D === void 0 ? Object : D,
|
|
265
|
+
x === void 0 ? Object : x
|
|
266
|
+
])], z);
|
|
267
|
+
// src/modules/check/check.module.ts
|
|
268
|
+
var B = class CheckModule {};
|
|
269
|
+
B = __decorate([s({
|
|
270
|
+
controllers: [],
|
|
271
|
+
exports: [z],
|
|
272
|
+
imports: [
|
|
273
|
+
g,
|
|
274
|
+
b,
|
|
275
|
+
E
|
|
276
|
+
],
|
|
277
|
+
providers: [z]
|
|
278
|
+
})], B);
|
|
279
|
+
// src/modules/batch/batch.constants.ts
|
|
280
|
+
var V = "<directories...>", H, U = H = class BatchCommand extends n {
|
|
281
|
+
checkService;
|
|
282
|
+
logger;
|
|
283
|
+
constructor(e, t) {
|
|
284
|
+
super(), this.checkService = e, this.logger = t, this.logger.setContext(H.name);
|
|
285
|
+
}
|
|
286
|
+
parseWrite() {
|
|
287
|
+
return !0;
|
|
288
|
+
}
|
|
289
|
+
async run(e, t = {}) {
|
|
290
|
+
let n = [];
|
|
291
|
+
for (let r of e) {
|
|
292
|
+
let e = await this.checkService.run({
|
|
293
|
+
directory: d.resolve(r),
|
|
294
|
+
mode: t.write === !0 ? "write" : "check",
|
|
295
|
+
workspaceRoot: process.cwd()
|
|
296
|
+
});
|
|
297
|
+
n.push({
|
|
298
|
+
directory: r,
|
|
299
|
+
...e
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
process.stdout.write(`${JSON.stringify(n)}\n`), process.exitCode = +!n.every(({ ok: e }) => e);
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
__decorate([
|
|
306
|
+
r({
|
|
307
|
+
description: "Rewrite every glossary to hold exactly the code's words, keeping definitions",
|
|
308
|
+
flags: "--write"
|
|
309
|
+
}),
|
|
310
|
+
__decorateMetadata("design:type", Function),
|
|
311
|
+
__decorateMetadata("design:paramtypes", []),
|
|
312
|
+
__decorateMetadata("design:returntype", Boolean)
|
|
313
|
+
], U.prototype, "parseWrite", null), U = H = __decorate([
|
|
314
|
+
e({
|
|
315
|
+
arguments: V,
|
|
316
|
+
description: "Check or write the glossaries of every named project directory, printing a JSON verdict for each",
|
|
317
|
+
name: "batch"
|
|
318
|
+
}),
|
|
319
|
+
o(),
|
|
320
|
+
__decorateMetadata("design:paramtypes", [z === void 0 ? Object : z, F === void 0 ? Object : F])
|
|
321
|
+
], U);
|
|
322
|
+
// src/modules/batch/batch.module.ts
|
|
323
|
+
var W = class BatchModule {};
|
|
324
|
+
W = __decorate([s({
|
|
325
|
+
controllers: [],
|
|
326
|
+
exports: [U],
|
|
327
|
+
imports: [B, I],
|
|
328
|
+
providers: [U]
|
|
329
|
+
})], W);
|
|
330
|
+
// src/modules/collect/collect.constants.ts
|
|
331
|
+
var G = ["markdown", "json"], K, q = K = class CollectCommand extends n {
|
|
200
332
|
configurationService;
|
|
201
333
|
vocabularyService;
|
|
202
334
|
comparisonService;
|
|
@@ -205,7 +337,7 @@ var L = h.object({}), R = ["markdown", "json"], z, B = z = class CollectCommand
|
|
|
205
337
|
markdownService;
|
|
206
338
|
logger;
|
|
207
339
|
constructor(e, t, n, r, i, a, o) {
|
|
208
|
-
super(), this.configurationService = e, this.vocabularyService = t, this.comparisonService = n, this.deliveryService = r, this.jsonService = i, this.markdownService = a, this.logger = o, this.logger.setContext(
|
|
340
|
+
super(), this.configurationService = e, this.vocabularyService = t, this.comparisonService = n, this.deliveryService = r, this.jsonService = i, this.markdownService = a, this.logger = o, this.logger.setContext(K.name);
|
|
209
341
|
}
|
|
210
342
|
check(e, t) {
|
|
211
343
|
let n = this.deliveryService.check({
|
|
@@ -267,7 +399,7 @@ var L = h.object({}), R = ["markdown", "json"], z, B = z = class CollectCommand
|
|
|
267
399
|
}
|
|
268
400
|
rejectionOf(e) {
|
|
269
401
|
if (e.check === !0 && e.write === !0) return "--check and --write cannot be combined";
|
|
270
|
-
if (e.format !== void 0 && !
|
|
402
|
+
if (e.format !== void 0 && !G.includes(e.format)) return `--format must be one of ${G.join(", ")}, not "${e.format}"`;
|
|
271
403
|
}
|
|
272
404
|
selectMode(e) {
|
|
273
405
|
let t = this.rejectionOf(e);
|
|
@@ -333,7 +465,7 @@ __decorate([
|
|
|
333
465
|
__decorateMetadata("design:type", Function),
|
|
334
466
|
__decorateMetadata("design:paramtypes", []),
|
|
335
467
|
__decorateMetadata("design:returntype", Boolean)
|
|
336
|
-
],
|
|
468
|
+
], q.prototype, "parseCheck", null), __decorate([
|
|
337
469
|
r({
|
|
338
470
|
description: "Path to a coinagerie configuration file; coinagerie.config.ts in the working directory is used when omitted",
|
|
339
471
|
flags: "--config <config>"
|
|
@@ -341,7 +473,7 @@ __decorate([
|
|
|
341
473
|
__decorateMetadata("design:type", Function),
|
|
342
474
|
__decorateMetadata("design:paramtypes", [String]),
|
|
343
475
|
__decorateMetadata("design:returntype", String)
|
|
344
|
-
],
|
|
476
|
+
], q.prototype, "parseConfig", null), __decorate([
|
|
345
477
|
r({
|
|
346
478
|
description: "Text rendered under the heading of every markdown destination, replacing the configured description",
|
|
347
479
|
flags: "--description <description>"
|
|
@@ -349,7 +481,7 @@ __decorate([
|
|
|
349
481
|
__decorateMetadata("design:type", Function),
|
|
350
482
|
__decorateMetadata("design:paramtypes", [String]),
|
|
351
483
|
__decorateMetadata("design:returntype", String)
|
|
352
|
-
],
|
|
484
|
+
], q.prototype, "parseDescription", null), __decorate([
|
|
353
485
|
r({
|
|
354
486
|
description: "Glob of files to leave out of the scan, replacing the configured exclude.paths; repeat for several",
|
|
355
487
|
flags: "--exclude-paths <glob>"
|
|
@@ -357,15 +489,15 @@ __decorate([
|
|
|
357
489
|
__decorateMetadata("design:type", Function),
|
|
358
490
|
__decorateMetadata("design:paramtypes", [String, Array]),
|
|
359
491
|
__decorateMetadata("design:returntype", Array)
|
|
360
|
-
],
|
|
492
|
+
], q.prototype, "parseExcludePaths", null), __decorate([
|
|
361
493
|
r({
|
|
362
|
-
description: `Format printed to standard output when neither --check nor --write is given: ${
|
|
494
|
+
description: `Format printed to standard output when neither --check nor --write is given: ${G.join(" or ")}`,
|
|
363
495
|
flags: "--format <format>"
|
|
364
496
|
}),
|
|
365
497
|
__decorateMetadata("design:type", Function),
|
|
366
498
|
__decorateMetadata("design:paramtypes", [String]),
|
|
367
499
|
__decorateMetadata("design:returntype", String)
|
|
368
|
-
],
|
|
500
|
+
], q.prototype, "parseFormat", null), __decorate([
|
|
369
501
|
r({
|
|
370
502
|
description: "Glob of files to scan, replacing the configured include; repeat for several",
|
|
371
503
|
flags: "--include <glob>"
|
|
@@ -373,7 +505,7 @@ __decorate([
|
|
|
373
505
|
__decorateMetadata("design:type", Function),
|
|
374
506
|
__decorateMetadata("design:paramtypes", [String, Array]),
|
|
375
507
|
__decorateMetadata("design:returntype", Array)
|
|
376
|
-
],
|
|
508
|
+
], q.prototype, "parseInclude", null), __decorate([
|
|
377
509
|
r({
|
|
378
510
|
description: "JSON glossary to check or write, replacing the configured outputs",
|
|
379
511
|
flags: "--output-json <path>"
|
|
@@ -381,7 +513,7 @@ __decorate([
|
|
|
381
513
|
__decorateMetadata("design:type", Function),
|
|
382
514
|
__decorateMetadata("design:paramtypes", [String]),
|
|
383
515
|
__decorateMetadata("design:returntype", String)
|
|
384
|
-
],
|
|
516
|
+
], q.prototype, "parseOutputJson", null), __decorate([
|
|
385
517
|
r({
|
|
386
518
|
description: "Markdown file holding a glossary block to check or write, replacing the configured outputs",
|
|
387
519
|
flags: "--output-markdown <path>"
|
|
@@ -389,7 +521,7 @@ __decorate([
|
|
|
389
521
|
__decorateMetadata("design:type", Function),
|
|
390
522
|
__decorateMetadata("design:paramtypes", [String]),
|
|
391
523
|
__decorateMetadata("design:returntype", String)
|
|
392
|
-
],
|
|
524
|
+
], q.prototype, "parseOutputMarkdown", null), __decorate([
|
|
393
525
|
r({
|
|
394
526
|
description: "Rewrite every glossary to hold exactly the code's words, keeping definitions",
|
|
395
527
|
flags: "--write"
|
|
@@ -397,7 +529,7 @@ __decorate([
|
|
|
397
529
|
__decorateMetadata("design:type", Function),
|
|
398
530
|
__decorateMetadata("design:paramtypes", []),
|
|
399
531
|
__decorateMetadata("design:returntype", Boolean)
|
|
400
|
-
],
|
|
532
|
+
], q.prototype, "parseWrite", null), q = K = __decorate([
|
|
401
533
|
e({
|
|
402
534
|
description: "List the words the code uses, and check or write a glossary of them",
|
|
403
535
|
name: "collect",
|
|
@@ -413,12 +545,12 @@ __decorate([
|
|
|
413
545
|
T === void 0 ? Object : T,
|
|
414
546
|
F === void 0 ? Object : F
|
|
415
547
|
])
|
|
416
|
-
],
|
|
548
|
+
], q);
|
|
417
549
|
// src/modules/collect/collect.module.ts
|
|
418
|
-
var
|
|
419
|
-
|
|
550
|
+
var J = class CollectModule {};
|
|
551
|
+
J = __decorate([s({
|
|
420
552
|
controllers: [],
|
|
421
|
-
exports: [
|
|
553
|
+
exports: [q],
|
|
422
554
|
imports: [
|
|
423
555
|
v,
|
|
424
556
|
g,
|
|
@@ -428,11 +560,11 @@ V = __decorate([s({
|
|
|
428
560
|
w,
|
|
429
561
|
E
|
|
430
562
|
],
|
|
431
|
-
providers: [
|
|
432
|
-
})],
|
|
563
|
+
providers: [q]
|
|
564
|
+
})], J);
|
|
433
565
|
// src/coinagerie-cli.module.ts
|
|
434
|
-
var
|
|
435
|
-
|
|
566
|
+
var Y = class MainModule {};
|
|
567
|
+
Y = __decorate([s({ imports: [
|
|
436
568
|
p.forRoot({
|
|
437
569
|
envFilePath: ".env",
|
|
438
570
|
isGlobal: !0,
|
|
@@ -440,13 +572,14 @@ H = __decorate([s({ imports: [
|
|
|
440
572
|
}),
|
|
441
573
|
m,
|
|
442
574
|
I,
|
|
443
|
-
|
|
444
|
-
|
|
575
|
+
W,
|
|
576
|
+
J
|
|
577
|
+
] })], Y);
|
|
445
578
|
// src/coinagerie-cli.main.ts
|
|
446
579
|
async function main() {
|
|
447
580
|
F.logToStandardError();
|
|
448
581
|
let e = new F();
|
|
449
|
-
e.setContext("CommandFactory"), await t.run(
|
|
582
|
+
e.setContext("CommandFactory"), await t.run(Y, {
|
|
450
583
|
bufferLogs: !0,
|
|
451
584
|
logger: e,
|
|
452
585
|
serviceErrorHandler: (t) => {
|
package/package.json
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
"url": "https://github.com/organizzolini/codebase/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@coinagerie/configuration": "0.0.
|
|
11
|
-
"@coinagerie/core": "0.0.
|
|
12
|
-
"@coinagerie/output": "0.0.
|
|
13
|
-
"@coinagerie/vocabulary": "0.0.
|
|
10
|
+
"@coinagerie/configuration": "0.0.5",
|
|
11
|
+
"@coinagerie/core": "0.0.5",
|
|
12
|
+
"@coinagerie/output": "0.0.5",
|
|
13
|
+
"@coinagerie/vocabulary": "0.0.5",
|
|
14
14
|
"@nestjs/common": "^11.1.21 || ^12.0.1",
|
|
15
15
|
"@nestjs/config": "^12.0.0",
|
|
16
16
|
"@nestjs/core": "^11.1.21 || ^12.0.1",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"strict": true
|
|
73
73
|
},
|
|
74
74
|
"types": "./dist/src/index.d.ts",
|
|
75
|
-
"version": "0.0.
|
|
75
|
+
"version": "0.0.5"
|
|
76
76
|
}
|