@coinagerie/vocabulary 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## 0.0.3 (2026-11-04)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated coinagerie-configuration to 0.0.3
6
+ - Updated coinagerie-languages to 0.0.3
7
+
8
+ ## 0.0.2 (2026-11-04)
9
+
10
+ ### 🚀 Features
11
+
12
+ - **coinagerie:** ✨ accept regular expressions in exclude.words ([#2109](https://github.com/organizzolini/codebase/pull/2109))
13
+
14
+ ### 🧱 Updated Dependencies
15
+
16
+ - Updated coinagerie-configuration to 0.0.2
17
+ - Updated coinagerie-languages to 0.0.2
18
+
1
19
  ## 0.0.1 (2026-11-04)
2
20
 
3
21
  ### 🚀 Features
package/README.md CHANGED
@@ -24,104 +24,37 @@ This project was generated from the [nestjs-service-project](../../configuration
24
24
 
25
25
  The words this package uses that the root glossary does not define, regenerated with `nx run coinagerie-vocabulary:coinagerie-check:write`.
26
26
 
27
- - **absolute**:
28
- - **after**:
29
27
  - **ancestor**:
30
28
  - **aspect**:
31
29
  - **breadth**:
32
- - **bug**:
33
30
  - **bundle**:
34
- - **chunk**:
35
- - **clear**:
36
- - **compile**:
37
- - **compiler**:
38
- - **configure**:
39
- - **console**:
40
- - **constant**:
41
- - **controller**:
42
- - **debug**:
43
- - **decorator**:
44
- - **deep**:
45
- - **define**:
46
- - **describe**:
47
- - **discover**:
48
31
  - **discovery**:
49
32
  - **dist**:
50
33
  - **doc**:
51
- - **each**:
52
- - **entry**:
53
- - **equal**:
54
- - **experimental**:
55
- - **extname**:
56
- - **fake**:
57
- - **flat**:
58
- - **force**:
59
- - **gitkeep**:
60
34
  - **glossary**:
61
35
  - **guide**:
62
36
  - **headword**:
63
- - **homepage**:
64
- - **identifier**:
65
37
  - **ignorecase**:
66
- - **implementation**:
67
- - **injectable**:
68
- - **keep**:
69
- - **least**:
70
- - **length**:
71
- - **link**:
72
38
  - **logo**:
73
- - **lower**:
74
39
  - **lowercase**:
75
40
  - **mark**:
76
- - **maximum**:
77
- - **md**:
78
- - **meta**:
79
- - **mkdtemp**:
80
- - **mock**:
81
- - **one**:
82
- - **other**:
83
- - **own**:
84
- - **part**:
85
- - **partial**:
86
41
  - **phase**:
87
42
  - **png**:
88
43
  - **posix**:
89
- - **promise**:
90
- - **publish**:
91
- - **readdir**:
92
- - **real**:
93
- - **recursive**:
94
- - **relative**:
95
44
  - **reload**:
96
- - **resolution**:
97
45
  - **scoped**:
98
- - **segment**:
99
- - **sep**:
100
- - **separator**:
101
46
  - **singular**:
102
- - **slice**:
103
- - **some**:
104
- - **sort**:
105
- - **split**:
106
- - **spy**:
107
- - **strict**:
108
47
  - **symbolic**:
109
48
  - **symlink**:
110
- - **synthetic**:
111
- - **temporary**:
112
49
  - **term**:
113
50
  - **thing**:
114
- - **timer**:
115
- - **tmpdir**:
116
51
  - **tokenizer**:
117
52
  - **unignored**:
118
53
  - **unmock**:
119
54
  - **vendor**:
120
55
  - **verb**:
121
56
  - **verdict**:
122
- - **vi**:
123
57
  - **vocabulary**:
124
- - **walk**:
125
58
 
126
59
  <!-- coinagerie:end -->
127
60
 
@@ -133,9 +66,9 @@ Call stacks traced through `projects/ic-suite/coinagerie/coinagerie-vocabulary`,
133
66
 
134
67
  | Measure | Value |
135
68
  | --- | --- |
136
- | Callables | 39 |
69
+ | Callables | 42 |
137
70
  | Files | 25 |
138
- | Calls traced | 41 |
71
+ | Calls traced | 44 |
139
72
  | Call stacks | 0 |
140
73
  | Deepest stack | 0 |
141
74
  | Stacks through recursion | 0 |
@@ -159,11 +92,11 @@ None.
159
92
  | Callable | Breadth | Calls directly | Location |
160
93
  | --- | --- | --- | --- |
161
94
  | `DiscoveryService.discover` | 7 | `DiscoveryService.findRepositoryRoot`, `DiscoveryService.map(…)`, `DiscoveryService.filter(…)`, `DiscoveryService.map(…)`, `DiscoveryService.filter(…)`, `DiscoveryService.walk`, `DiscoveryService.readAncestorScopes` | `projects/ic-suite/coinagerie/coinagerie-vocabulary/src/modules/discovery/discovery.service.ts:152` |
162
- | `VocabularyService.collect` | 5 | `DiscoveryService.discover`, `VocabularyService.map(…)`, `VocabularyService.excludedHeadwords`, `VocabularyService.collectFile`, `FoldingService.headword` | `projects/ic-suite/coinagerie/coinagerie-vocabulary/src/modules/vocabulary/vocabulary.service.ts:95` |
95
+ | `VocabularyService.collect` | 7 | `DiscoveryService.discover`, `VocabularyService.map(…)`, `VocabularyService.excludedHeadwords`, `VocabularyService.collectFile`, `FoldingService.headword`, `VocabularyService.matchesPattern`, `VocabularyService.filter(…)` | `projects/ic-suite/coinagerie/coinagerie-vocabulary/src/modules/vocabulary/vocabulary.service.ts:108` |
163
96
  | `DiscoveryService.walk` | 4 | `DiscoveryService.toPosix`, `IgnoreRulesService.readScope`, `DiscoveryService.flatMap(…)`, `DiscoveryService.filter(…)` | `projects/ic-suite/coinagerie/coinagerie-vocabulary/src/modules/discovery/discovery.service.ts:107` |
164
97
 
165
98
  <details>
166
- <summary>15 more callables</summary>
99
+ <summary>16 more callables</summary>
167
100
 
168
101
  | Callable | Breadth | Calls directly | Location |
169
102
  | --- | --- | --- | --- |
@@ -182,6 +115,7 @@ None.
182
115
  | `WordsService.splitPath` | 1 | `WordsService.splitIdentifier` | `projects/ic-suite/coinagerie/coinagerie-vocabulary/src/modules/words/words.service.ts:56` |
183
116
  | `VocabularyService.flatMap(…)` | 1 | `WordsService.splitIdentifier` | `projects/ic-suite/coinagerie/coinagerie-vocabulary/src/modules/vocabulary/vocabulary.service.ts:57` |
184
117
  | `VocabularyService.excludedHeadwords` | 1 | `FoldingService.headword` | `projects/ic-suite/coinagerie/coinagerie-vocabulary/src/modules/vocabulary/vocabulary.service.ts:70` |
118
+ | `VocabularyService.matchesPattern` | 1 | `VocabularyService.some(…)` | `projects/ic-suite/coinagerie/coinagerie-vocabulary/src/modules/vocabulary/vocabulary.service.ts:88` |
185
119
 
186
120
  </details>
187
121
  <!-- callidescope:end -->
@@ -325,8 +259,8 @@ graph LR
325
259
 
326
260
  ### Project
327
261
 
328
- ![Lines of Code](https://img.shields.io/badge/Lines_of_Code-1576-22c55e?style=flat-square)
329
- ![Repository Size](https://img.shields.io/badge/Repository_Size-58.91_kB-6b7280?style=flat-square)
262
+ ![Lines of Code](https://img.shields.io/badge/Lines_of_Code-1700-22c55e?style=flat-square)
263
+ ![Repository Size](https://img.shields.io/badge/Repository_Size-63.17_kB-6b7280?style=flat-square)
330
264
  ![Folders](https://img.shields.io/badge/Folders-7-4a4a4a?style=flat-square)
331
265
  ![Source Files](https://img.shields.io/badge/Source_Files-33-3178c6?style=flat-square)
332
266
 
@@ -337,7 +271,7 @@ graph LR
337
271
  ![Generic Declarations](https://img.shields.io/badge/Generic_Declarations-0-0369a1?style=flat-square)
338
272
  ![Enums](https://img.shields.io/badge/Enums-0-f97316?style=flat-square)
339
273
  ![Decorators](https://img.shields.io/badge/Decorators-9-db2777?style=flat-square)
340
- ![Doc Comments](https://img.shields.io/badge/Doc_Comments-45-6366f1?style=flat-square)
274
+ ![Doc Comments](https://img.shields.io/badge/Doc_Comments-46-6366f1?style=flat-square)
341
275
  ![Static Methods](https://img.shields.io/badge/Static_Methods-0-166534?style=flat-square)
342
276
 
343
277
  ### JavaScript
@@ -346,15 +280,15 @@ graph LR
346
280
  ![Test Files](https://img.shields.io/badge/Test_Files-6-10b981?style=flat-square)
347
281
  ![External Packages](https://img.shields.io/badge/External_Packages-13-8b5cf6?style=flat-square)
348
282
  ![Classes](https://img.shields.io/badge/Classes-9-7c3aed?style=flat-square)
349
- ![Functions](https://img.shields.io/badge/Functions-78-16a34a?style=flat-square)
350
- ![Methods](https://img.shields.io/badge/Methods-34-15803d?style=flat-square)
351
- ![Sync Functions](https://img.shields.io/badge/Sync_Functions-94-4ade80?style=flat-square)
352
- ![Async Functions](https://img.shields.io/badge/Async_Functions-18-059669?style=flat-square)
353
- ![Constants](https://img.shields.io/badge/Constants-53-dc2626?style=flat-square)
283
+ ![Functions](https://img.shields.io/badge/Functions-85-16a34a?style=flat-square)
284
+ ![Methods](https://img.shields.io/badge/Methods-37-15803d?style=flat-square)
285
+ ![Sync Functions](https://img.shields.io/badge/Sync_Functions-98-4ade80?style=flat-square)
286
+ ![Async Functions](https://img.shields.io/badge/Async_Functions-24-059669?style=flat-square)
287
+ ![Constants](https://img.shields.io/badge/Constants-55-dc2626?style=flat-square)
354
288
  ![Imports](https://img.shields.io/badge/Imports-89-0284c7?style=flat-square)
355
289
  ![Exported Symbols](https://img.shields.io/badge/Exported_Symbols-21-ea580c?style=flat-square)
356
- ![Comments](https://img.shields.io/badge/Comments-93-64748b?style=flat-square)
357
- ![Comment Lines](https://img.shields.io/badge/Comment_Lines-205-475569?style=flat-square)
290
+ ![Comments](https://img.shields.io/badge/Comments-94-64748b?style=flat-square)
291
+ ![Comment Lines](https://img.shields.io/badge/Comment_Lines-208-475569?style=flat-square)
358
292
  ![TODO Comments](https://img.shields.io/badge/TODO_Comments-0-ca8a04?style=flat-square)
359
293
 
360
294
  ### Python
@@ -510,20 +444,20 @@ graph LR
510
444
  ### Markdown
511
445
 
512
446
  ![Markdown Files](https://img.shields.io/badge/Markdown_Files-2-083fa1?style=flat-square)
513
- ![Markdown Lines](https://img.shields.io/badge/Markdown_Lines-235-1f6feb?style=flat-square)
447
+ ![Markdown Lines](https://img.shields.io/badge/Markdown_Lines-253-1f6feb?style=flat-square)
514
448
  ![H1](https://img.shields.io/badge/H1-1-7c3aed?style=flat-square)
515
- ![H2](https://img.shields.io/badge/H2-8-8b5cf6?style=flat-square)
516
- ![H3](https://img.shields.io/badge/H3-14-a78bfa?style=flat-square)
449
+ ![H2](https://img.shields.io/badge/H2-10-8b5cf6?style=flat-square)
450
+ ![H3](https://img.shields.io/badge/H3-17-a78bfa?style=flat-square)
517
451
  ![H4](https://img.shields.io/badge/H4-0-c4b5fd?style=flat-square)
518
452
  ![H5](https://img.shields.io/badge/H5-0-ddd6fe?style=flat-square)
519
453
  ![H6](https://img.shields.io/badge/H6-0-ede9fe?style=flat-square)
520
- ![Paragraphs](https://img.shields.io/badge/Paragraphs-51-64748b?style=flat-square)
521
- ![Lists](https://img.shields.io/badge/Lists-8-16a34a?style=flat-square)
522
- ![List Items](https://img.shields.io/badge/List_Items-31-22c55e?style=flat-square)
454
+ ![Paragraphs](https://img.shields.io/badge/Paragraphs-56-64748b?style=flat-square)
455
+ ![Lists](https://img.shields.io/badge/Lists-11-16a34a?style=flat-square)
456
+ ![List Items](https://img.shields.io/badge/List_Items-36-22c55e?style=flat-square)
523
457
  ![Task List Items](https://img.shields.io/badge/Task_List_Items-0-4ade80?style=flat-square)
524
458
  ![Tables](https://img.shields.io/badge/Tables-2-0284c7?style=flat-square)
525
459
  ![Table Rows](https://img.shields.io/badge/Table_Rows-10-0ea5e9?style=flat-square)
526
- ![Links](https://img.shields.io/badge/Links-17-059669?style=flat-square)
460
+ ![Links](https://img.shields.io/badge/Links-18-059669?style=flat-square)
527
461
  ![Images](https://img.shields.io/badge/Images-0-10b981?style=flat-square)
528
462
  ![Code Blocks](https://img.shields.io/badge/Code_Blocks-11-dc2626?style=flat-square)
529
463
  ![Inline Code](https://img.shields.io/badge/Inline_Code-72-ef4444?style=flat-square)
@@ -164,18 +164,22 @@ export declare class VocabularyService {
164
164
  /** The words of one file: its path's, then its identifiers'. */
165
165
  private collectFile;
166
166
  /**
167
- * The headwords the configuration leaves out.
167
+ * The headwords the configuration leaves out by exact word.
168
168
  *
169
169
  * Its words are folded the way the code's are, so exclusion compares
170
170
  * headwords: excluding `service` covers `services`, and excluding
171
171
  * `implements` covers the `implement` it folds into.
172
172
  */
173
173
  private excludedHeadwords;
174
+ /** Whether a pattern leaves out a word: it matches the word or its headword. */
175
+ private matchesPattern;
174
176
  /**
175
177
  * Every word the configured files use, sorted and de-duplicated.
176
178
  *
177
179
  * The files a configuration writes a glossary to are left out, so a run
178
- * never reads its own output back as vocabulary.
180
+ * never reads its own output back as vocabulary. A headword a pattern
181
+ * matches is left out wholly, as a string leaves out a headword: the pattern
182
+ * is tested against each occurrence's lowercase word and its headword.
179
183
  */
180
184
  collect(configuration: ResolvedCoinagerieConfiguration): Promise<string[]>;
181
185
  }
package/dist/src/index.js CHANGED
@@ -176,18 +176,21 @@ var w = class VocabularyService {
176
176
  }
177
177
  return t;
178
178
  }
179
+ matchesPattern(e, t, n) {
180
+ return n.some((n) => n.test(e) || n.test(t));
181
+ }
179
182
  async collect(e) {
180
183
  let t = this.discoveryService.discover({
181
184
  directory: e.directory,
182
185
  exclude: e.exclude.paths,
183
186
  include: e.include,
184
187
  skip: e.outputs.map((e) => e.path)
185
- }), n = this.excludedHeadwords(e), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Map();
186
- for (let a of t) for (let t of await this.collectFile(e.directory, a)) {
187
- let a = i.get(t) ?? this.foldingService.headword(t, e);
188
- i.set(t, a), n.has(a) || r.add(a);
188
+ }), n = this.excludedHeadwords(e), r = e.exclude.patterns, i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set();
189
+ for (let s of t) for (let t of await this.collectFile(e.directory, s)) {
190
+ let s = a.get(t) ?? this.foldingService.headword(t, e);
191
+ a.set(t, s), this.matchesPattern(t, s, r) && o.add(s), n.has(s) || i.add(s);
189
192
  }
190
- return [...r].toSorted();
193
+ return [...i].filter((e) => !o.has(e)).toSorted();
191
194
  }
192
195
  };
193
196
  w = __decorate([e(), __decorateMetadata("design:paramtypes", [
package/package.json CHANGED
@@ -4,8 +4,8 @@
4
4
  "url": "https://github.com/organizzolini/codebase/issues"
5
5
  },
6
6
  "dependencies": {
7
- "@coinagerie/configuration": "0.0.1",
8
- "@coinagerie/languages": "0.0.1",
7
+ "@coinagerie/configuration": "0.0.3",
8
+ "@coinagerie/languages": "0.0.3",
9
9
  "@nestjs/common": "^11.1.21 || ^12.0.1",
10
10
  "ignore": "7.0.14",
11
11
  "pluralize": "^8.0.0",
@@ -61,5 +61,5 @@
61
61
  "strict": true
62
62
  },
63
63
  "types": "./dist/src/index.d.ts",
64
- "version": "0.0.1"
64
+ "version": "0.0.3"
65
65
  }