@coinagerie/configuration 0.0.1 โ†’ 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## 0.0.3 (2026-11-04)
2
+
3
+ ### ๐Ÿงฑ Updated Dependencies
4
+
5
+ - Updated coinagerie-core to 0.0.3
6
+
7
+ ## 0.0.2 (2026-11-04)
8
+
9
+ ### ๐Ÿš€ Features
10
+
11
+ - **coinagerie:** โœจ accept regular expressions in exclude.words ([#2109](https://github.com/organizzolini/codebase/pull/2109))
12
+
13
+ ### ๐Ÿงฑ Updated Dependencies
14
+
15
+ - Updated coinagerie-core to 0.0.2
16
+
1
17
  ## 0.0.1 (2026-11-04)
2
18
 
3
19
  ### ๐Ÿš€ Features
package/README.md CHANGED
@@ -24,68 +24,12 @@ 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-configuration:coinagerie-check:write`.
26
26
 
27
- - **absolute**:
28
- - **after**:
29
- - **array**:
30
27
  - **breadth**:
31
- - **bug**:
32
- - **clear**:
33
- - **compile**:
34
- - **compiler**:
35
- - **console**:
36
- - **constant**:
37
- - **controller**:
38
- - **custom**:
39
- - **decorator**:
40
- - **define**:
41
- - **describe**:
42
28
  - **discriminate**:
43
- - **each**:
44
- - **equal**:
45
- - **experimental**:
46
- - **fake**:
47
- - **field**:
48
- - **flag**:
29
+ - **exact**:
49
30
  - **forbid**:
50
- - **force**:
51
- - **gitkeep**:
52
- - **homepage**:
53
- - **implementation**:
54
- - **injectable**:
55
- - **invalid**:
56
- - **least**:
57
- - **length**:
58
- - **literal**:
59
- - **load**:
60
- - **locate**:
61
- - **location**:
62
- - **maximum**:
63
- - **meta**:
64
- - **min**:
65
- - **mkdtemp**:
66
- - **mock**:
67
- - **optional**:
68
31
  - **prettify**:
69
- - **promise**:
70
- - **publish**:
71
- - **real**:
72
- - **reason**:
73
- - **recursive**:
74
32
  - **refine**:
75
- - **regex**:
76
- - **reject**:
77
- - **relative**:
78
- - **resolution**:
79
- - **safe**:
80
- - **sort**:
81
- - **spy**:
82
- - **strict**:
83
- - **stringify**:
84
- - **success**:
85
- - **synthetic**:
86
- - **temporary**:
87
- - **timer**:
88
- - **vi**:
89
33
 
90
34
  <!-- coinagerie:end -->
91
35
 
@@ -119,7 +63,7 @@ What this project is judged against, as declared in its own `callidescope.config
119
63
  **1. `ConfigurationService.anonymous`** โ€” depth โ‰ฅ 2 ยท orphan-root
120
64
 
121
65
  ```text
122
- ๐Ÿš€ ConfigurationService.anonymous(word: string): string [projects/ic-suite/coinagerie/coinagerie-configuration/src/modules/configuration/configuration.service.ts:66]
66
+ ๐Ÿš€ ConfigurationService.anonymous(word: string): string [projects/ic-suite/coinagerie/coinagerie-configuration/src/modules/configuration/configuration.service.ts:67]
123
67
  โ””โ”€> InvalidConfigurationError.constructor(filePath: string, reason: string): InvalidConfigurationError [projects/ic-suite/coinagerie/coinagerie-core/src/modules/coinagerie-core/coinagerie-core.constants.ts:32]
124
68
  ```
125
69
 
@@ -127,17 +71,17 @@ What this project is judged against, as declared in its own `callidescope.config
127
71
 
128
72
  | Callable | Breadth | Calls directly | Location |
129
73
  | --- | --- | --- | --- |
130
- | `ConfigurationService.locate` | 3 | `ConfigurationFileNotFoundError.constructor`, `ConfigurationService.find(โ€ฆ)`, `ConfigurationService.map(โ€ฆ)` | `projects/ic-suite/coinagerie/coinagerie-configuration/src/modules/configuration/configuration.service.ts:98` |
131
- | `ConfigurationService.read` | 3 | `InvalidConfigurationError.constructor`, `ConfigurationService.describe`, `ConfigurationService.resolveWords` | `projects/ic-suite/coinagerie/coinagerie-configuration/src/modules/configuration/configuration.service.ts:168` |
132
- | `ConfigurationService.resolve` | 3 | `InvalidConfigurationError.constructor`, `ConfigurationService.override`, `ConfigurationService.guardFold` | `projects/ic-suite/coinagerie/coinagerie-configuration/src/modules/configuration/configuration.service.ts:204` |
74
+ | `ConfigurationService.locate` | 3 | `ConfigurationFileNotFoundError.constructor`, `ConfigurationService.find(โ€ฆ)`, `ConfigurationService.map(โ€ฆ)` | `projects/ic-suite/coinagerie/coinagerie-configuration/src/modules/configuration/configuration.service.ts:99` |
75
+ | `ConfigurationService.read` | 3 | `InvalidConfigurationError.constructor`, `ConfigurationService.describe`, `ConfigurationService.resolveWords` | `projects/ic-suite/coinagerie/coinagerie-configuration/src/modules/configuration/configuration.service.ts:169` |
76
+ | `ConfigurationService.resolve` | 3 | `InvalidConfigurationError.constructor`, `ConfigurationService.override`, `ConfigurationService.guardFold` | `projects/ic-suite/coinagerie/coinagerie-configuration/src/modules/configuration/configuration.service.ts:205` |
133
77
 
134
78
  <details>
135
79
  <summary>2 more callables</summary>
136
80
 
137
81
  | Callable | Breadth | Calls directly | Location |
138
82
  | --- | --- | --- | --- |
139
- | `ConfigurationService.loadConfiguration` | 3 | `ConfigurationService.locate`, `ConfigurationService.resolve`, `ConfigurationService.read` | `projects/ic-suite/coinagerie/coinagerie-configuration/src/modules/configuration/configuration.service.ts:299` |
140
- | `ConfigurationService.anonymous` | 2 | `InvalidConfigurationError.constructor`, `ConfigurationService.describe` | `projects/ic-suite/coinagerie/coinagerie-configuration/src/modules/configuration/configuration.service.ts:66` |
83
+ | `ConfigurationService.loadConfiguration` | 3 | `ConfigurationService.locate`, `ConfigurationService.resolve`, `ConfigurationService.read` | `projects/ic-suite/coinagerie/coinagerie-configuration/src/modules/configuration/configuration.service.ts:320` |
84
+ | `ConfigurationService.anonymous` | 2 | `InvalidConfigurationError.constructor`, `ConfigurationService.describe` | `projects/ic-suite/coinagerie/coinagerie-configuration/src/modules/configuration/configuration.service.ts:67` |
141
85
 
142
86
  </details>
143
87
  <!-- callidescope:end -->
@@ -213,19 +157,19 @@ graph LR
213
157
 
214
158
  ### Project
215
159
 
216
- ![Lines of Code](https://img.shields.io/badge/Lines_of_Code-1292-22c55e?style=flat-square)
217
- ![Repository Size](https://img.shields.io/badge/Repository_Size-53.32_kB-6b7280?style=flat-square)
160
+ ![Lines of Code](https://img.shields.io/badge/Lines_of_Code-1435-22c55e?style=flat-square)
161
+ ![Repository Size](https://img.shields.io/badge/Repository_Size-58.45_kB-6b7280?style=flat-square)
218
162
  ![Folders](https://img.shields.io/badge/Folders-4-4a4a4a?style=flat-square)
219
163
  ![Source Files](https://img.shields.io/badge/Source_Files-16-3178c6?style=flat-square)
220
164
 
221
165
  ### TypeScript
222
166
 
223
167
  ![TypeScript Files](https://img.shields.io/badge/TypeScript_Files-16-3178c6?style=flat-square)
224
- ![Interfaces](https://img.shields.io/badge/Interfaces-10-0ea5e9?style=flat-square)
168
+ ![Interfaces](https://img.shields.io/badge/Interfaces-11-0ea5e9?style=flat-square)
225
169
  ![Generic Declarations](https://img.shields.io/badge/Generic_Declarations-0-0369a1?style=flat-square)
226
170
  ![Enums](https://img.shields.io/badge/Enums-0-f97316?style=flat-square)
227
171
  ![Decorators](https://img.shields.io/badge/Decorators-2-db2777?style=flat-square)
228
- ![Doc Comments](https://img.shields.io/badge/Doc_Comments-52-6366f1?style=flat-square)
172
+ ![Doc Comments](https://img.shields.io/badge/Doc_Comments-56-6366f1?style=flat-square)
229
173
  ![Static Methods](https://img.shields.io/badge/Static_Methods-0-166534?style=flat-square)
230
174
 
231
175
  ### JavaScript
@@ -234,15 +178,15 @@ graph LR
234
178
  ![Test Files](https://img.shields.io/badge/Test_Files-2-10b981?style=flat-square)
235
179
  ![External Packages](https://img.shields.io/badge/External_Packages-10-8b5cf6?style=flat-square)
236
180
  ![Classes](https://img.shields.io/badge/Classes-2-7c3aed?style=flat-square)
237
- ![Functions](https://img.shields.io/badge/Functions-41-16a34a?style=flat-square)
181
+ ![Functions](https://img.shields.io/badge/Functions-47-16a34a?style=flat-square)
238
182
  ![Methods](https://img.shields.io/badge/Methods-11-15803d?style=flat-square)
239
- ![Sync Functions](https://img.shields.io/badge/Sync_Functions-29-4ade80?style=flat-square)
240
- ![Async Functions](https://img.shields.io/badge/Async_Functions-23-059669?style=flat-square)
241
- ![Constants](https://img.shields.io/badge/Constants-56-dc2626?style=flat-square)
183
+ ![Sync Functions](https://img.shields.io/badge/Sync_Functions-30-4ade80?style=flat-square)
184
+ ![Async Functions](https://img.shields.io/badge/Async_Functions-28-059669?style=flat-square)
185
+ ![Constants](https://img.shields.io/badge/Constants-65-dc2626?style=flat-square)
242
186
  ![Imports](https://img.shields.io/badge/Imports-36-0284c7?style=flat-square)
243
- ![Exported Symbols](https://img.shields.io/badge/Exported_Symbols-24-ea580c?style=flat-square)
244
- ![Comments](https://img.shields.io/badge/Comments-65-64748b?style=flat-square)
245
- ![Comment Lines](https://img.shields.io/badge/Comment_Lines-171-475569?style=flat-square)
187
+ ![Exported Symbols](https://img.shields.io/badge/Exported_Symbols-26-ea580c?style=flat-square)
188
+ ![Comments](https://img.shields.io/badge/Comments-69-64748b?style=flat-square)
189
+ ![Comment Lines](https://img.shields.io/badge/Comment_Lines-182-475569?style=flat-square)
246
190
  ![TODO Comments](https://img.shields.io/badge/TODO_Comments-0-ca8a04?style=flat-square)
247
191
 
248
192
  ### Python
@@ -398,20 +342,20 @@ graph LR
398
342
  ### Markdown
399
343
 
400
344
  ![Markdown Files](https://img.shields.io/badge/Markdown_Files-2-083fa1?style=flat-square)
401
- ![Markdown Lines](https://img.shields.io/badge/Markdown_Lines-235-1f6feb?style=flat-square)
345
+ ![Markdown Lines](https://img.shields.io/badge/Markdown_Lines-251-1f6feb?style=flat-square)
402
346
  ![H1](https://img.shields.io/badge/H1-1-7c3aed?style=flat-square)
403
- ![H2](https://img.shields.io/badge/H2-8-8b5cf6?style=flat-square)
404
- ![H3](https://img.shields.io/badge/H3-14-a78bfa?style=flat-square)
347
+ ![H2](https://img.shields.io/badge/H2-10-8b5cf6?style=flat-square)
348
+ ![H3](https://img.shields.io/badge/H3-17-a78bfa?style=flat-square)
405
349
  ![H4](https://img.shields.io/badge/H4-0-c4b5fd?style=flat-square)
406
350
  ![H5](https://img.shields.io/badge/H5-0-ddd6fe?style=flat-square)
407
351
  ![H6](https://img.shields.io/badge/H6-0-ede9fe?style=flat-square)
408
- ![Paragraphs](https://img.shields.io/badge/Paragraphs-51-64748b?style=flat-square)
409
- ![Lists](https://img.shields.io/badge/Lists-8-16a34a?style=flat-square)
410
- ![List Items](https://img.shields.io/badge/List_Items-31-22c55e?style=flat-square)
352
+ ![Paragraphs](https://img.shields.io/badge/Paragraphs-54-64748b?style=flat-square)
353
+ ![Lists](https://img.shields.io/badge/Lists-11-16a34a?style=flat-square)
354
+ ![List Items](https://img.shields.io/badge/List_Items-34-22c55e?style=flat-square)
411
355
  ![Task List Items](https://img.shields.io/badge/Task_List_Items-0-4ade80?style=flat-square)
412
356
  ![Tables](https://img.shields.io/badge/Tables-2-0284c7?style=flat-square)
413
357
  ![Table Rows](https://img.shields.io/badge/Table_Rows-10-0ea5e9?style=flat-square)
414
- ![Links](https://img.shields.io/badge/Links-19-059669?style=flat-square)
358
+ ![Links](https://img.shields.io/badge/Links-20-059669?style=flat-square)
415
359
  ![Images](https://img.shields.io/badge/Images-0-10b981?style=flat-square)
416
360
  ![Code Blocks](https://img.shields.io/badge/Code_Blocks-11-dc2626?style=flat-square)
417
361
  ![Inline Code](https://img.shields.io/badge/Inline_Code-72-ef4444?style=flat-square)
@@ -29,8 +29,10 @@ export declare interface CoinagerieExclusions {
29
29
  /**
30
30
  * Words left out of the glossary, as a list or as a function returning one,
31
31
  * synchronously or not โ€” the function is where a configuration reads
32
- * whatever else it wants to exclude. Exclusion applies after folding, so
33
- * excluding `service` also covers `services`. Defaults to none.
32
+ * whatever else it wants to exclude. A string leaves out that exact word.
33
+ * A regular expression leaves out every word it matches, tested against the
34
+ * lowercase word and against its folded headword. Exclusion applies after
35
+ * folding, so excluding `service` also covers `services`. Defaults to none.
34
36
  */
35
37
  words?: ExcludedWords | undefined;
36
38
  }
@@ -142,7 +144,8 @@ export declare class ConfigurationService {
142
144
  /** Fills in every default and makes every path absolute. */
143
145
  private resolve;
144
146
  /**
145
- * The words a configuration excludes, calling its function when it has one.
147
+ * The entries a configuration excludes, calling its function when it has
148
+ * one, split into exact words and patterns.
146
149
  *
147
150
  * Throws a plain error for the caller to name the file in, so that no frame
148
151
  * is spent on building the report here.
@@ -166,8 +169,11 @@ export declare class ConfigurationService {
166
169
  */
167
170
  export declare const DEFAULT_INCLUDE: readonly ["**", "**/.*", "**/.*/**"];
168
171
 
169
- /** A list of words, or a function that returns one. */
170
- export declare type ExcludedWords = (() => Promise<string[]> | string[]) | string[];
172
+ /** One entry of `exclude.words`: an exact word, or a pattern matching many. */
173
+ declare type ExcludedWord = RegExp | string;
174
+
175
+ /** A list of excluded words or patterns, or a function that returns one. */
176
+ export declare type ExcludedWords = (() => ExcludedWord[] | Promise<ExcludedWord[]>) | ExcludedWord[];
171
177
 
172
178
  /** A function from a word to the headword it is folded into. */
173
179
  export declare type FoldWord = (word: string) => string;
@@ -198,9 +204,13 @@ export declare interface ResolvedCoinagerieConfiguration {
198
204
  /** The root the run scans: the configuration file's folder, or the
199
205
  * working directory when there is no file. */
200
206
  directory: string;
201
- /** `words` is the resolved list: a function in the file has been called. */
207
+ /**
208
+ * `words` and `patterns` are resolved: a function in the file has been
209
+ * called, and every entry is either an exact word or a pattern.
210
+ */
202
211
  exclude: {
203
212
  paths: string[];
213
+ patterns: RegExp[];
204
214
  words: string[];
205
215
  };
206
216
  /**
package/dist/src/index.js CHANGED
@@ -20,24 +20,24 @@ var l = [
20
20
  ], d = /^\s*(?:[-*+]\s|<!--)/mu, f = e.strictObject({
21
21
  path: e.string().min(1),
22
22
  type: e.literal("json")
23
- }), p = e.string().refine((e) => !d.test(e), { message: "A description may not hold a list item or an HTML comment, which would read back as part of the glossary" }), isFunction = (e) => typeof e == "function", m = e.array(e.string()), h = e.string().regex(/^[^\s*]+$/u), g = e.strictObject({
23
+ }), p = e.string().refine((e) => !d.test(e), { message: "A description may not hold a list item or an HTML comment, which would read back as part of the glossary" }), isFunction = (e) => typeof e == "function", m = e.union([e.string(), e.instanceof(RegExp)]), h = e.array(m), g = e.string().regex(/^[^\s*]+$/u), _ = e.strictObject({
24
24
  description: p.optional(),
25
25
  path: e.string().min(1),
26
26
  type: e.literal("markdown")
27
- }), _ = e.strictObject({
27
+ }), v = e.strictObject({
28
28
  description: p.optional(),
29
29
  excludePaths: e.array(e.string()).optional(),
30
30
  include: e.array(e.string()).optional(),
31
31
  outputJson: e.string().min(1).optional(),
32
32
  outputMarkdown: e.string().min(1).optional()
33
- }), v = e.strictObject({
33
+ }), y = e.strictObject({
34
34
  exclude: e.strictObject({
35
35
  paths: e.array(e.string()).optional(),
36
- words: e.union([e.array(e.string()), e.custom(isFunction, { message: "Expected a list of words or a function returning one" })]).optional()
36
+ words: e.union([e.array(m), e.custom(isFunction, { message: "Expected a list of words or regular expressions, or a function returning one" })]).optional()
37
37
  }).optional(),
38
38
  fold: e.custom(isFunction, { message: "Expected a function" }).optional(),
39
39
  include: e.array(e.string()).optional(),
40
- outputs: e.array(e.discriminatedUnion("type", [f, g])).optional()
40
+ outputs: e.array(e.discriminatedUnion("type", [f, _])).optional()
41
41
  });
42
42
  // \0@oxc-project+runtime@0.155.0/helpers/esm/decorateMetadata.js
43
43
  function __decorateMetadata(e, t) {
@@ -51,7 +51,7 @@ function __decorate(e, t, n, r) {
51
51
  return i > 3 && a && Object.defineProperty(t, n, a), a;
52
52
  }
53
53
  // src/modules/configuration/configuration.service.ts
54
- var y = class ConfigurationService {
54
+ var b = class ConfigurationService {
55
55
  constructor() {}
56
56
  describe(e) {
57
57
  return e instanceof Error ? e.message : String(e);
@@ -64,7 +64,7 @@ var y = class ConfigurationService {
64
64
  } catch (e) {
65
65
  throw new s(t, `fold threw on "${n}": ${this.describe(e)}`);
66
66
  }
67
- let i = h.safeParse(r);
67
+ let i = g.safeParse(r);
68
68
  if (!i.success) throw new s(t, `fold must return a non-empty string without whitespace or "*", but returned ${typeof r == "string" ? JSON.stringify(r) : `a value of type ${typeof r}`} for "${n}"; it must be synchronous`);
69
69
  return i.data;
70
70
  };
@@ -102,19 +102,19 @@ var y = class ConfigurationService {
102
102
  } catch (e) {
103
103
  throw new s(t, this.describe(e));
104
104
  }
105
- let r = v.safeParse(n);
105
+ let r = y.safeParse(n);
106
106
  if (!r.success) throw new s(t, e.prettifyError(r.error));
107
107
  try {
108
108
  return {
109
109
  configuration: r.data,
110
- words: await this.resolveWords(r.data.exclude?.words)
110
+ excluded: await this.resolveWords(r.data.exclude?.words)
111
111
  };
112
112
  } catch (e) {
113
113
  throw new s(t, `exclude.words ${this.describe(e)}`);
114
114
  }
115
115
  }
116
116
  resolve(t) {
117
- let { directory: n, location: r } = t, a = _.safeParse(t.overrides ?? {});
117
+ let { directory: n, location: r } = t, a = v.safeParse(t.overrides ?? {});
118
118
  if (!a.success) throw new s("the command line", e.prettifyError(a.error));
119
119
  let o = this.override({
120
120
  configuration: t.loaded.configuration,
@@ -138,7 +138,8 @@ var y = class ConfigurationService {
138
138
  directory: n,
139
139
  exclude: {
140
140
  paths: o.exclude?.paths ?? [],
141
- words: t.loaded.words
141
+ patterns: t.loaded.excluded.patterns,
142
+ words: t.loaded.excluded.words
142
143
  },
143
144
  fold: o.fold === void 0 ? void 0 : this.guardFold(o.fold, r),
144
145
  include: o.include ?? [...u],
@@ -146,9 +147,14 @@ var y = class ConfigurationService {
146
147
  };
147
148
  }
148
149
  async resolveWords(e) {
149
- let t = typeof e == "function" ? await e() : e ?? [], n = m.safeParse(t);
150
- if (!n.success) throw Error("must be a list of strings, or a function returning one");
151
- return n.data;
150
+ let t = typeof e == "function" ? await e() : e ?? [], n = h.safeParse(t);
151
+ if (!n.success) throw Error("must be a list of strings or RegExp objects, or a function returning one");
152
+ let r = [], i = [];
153
+ for (let e of n.data) e instanceof RegExp ? r.push(new RegExp(e.source, e.flags.replaceAll(/[gy]/gu, ""))) : i.push(e);
154
+ return {
155
+ patterns: r,
156
+ words: i
157
+ };
152
158
  }
153
159
  async loadConfiguration(e) {
154
160
  let t = this.locate(e);
@@ -157,7 +163,10 @@ var y = class ConfigurationService {
157
163
  directory: e.workingDirectory,
158
164
  loaded: {
159
165
  configuration: {},
160
- words: []
166
+ excluded: {
167
+ patterns: [],
168
+ words: []
169
+ }
161
170
  },
162
171
  location: e.workingDirectory,
163
172
  overrides: e.overrides,
@@ -172,13 +181,13 @@ var y = class ConfigurationService {
172
181
  });
173
182
  }
174
183
  };
175
- y = __decorate([t(), __decorateMetadata("design:paramtypes", [])], y);
184
+ b = __decorate([t(), __decorateMetadata("design:paramtypes", [])], b);
176
185
  // src/modules/configuration/configuration.module.ts
177
- var b = class ConfigurationModule {};
178
- b = __decorate([n({
186
+ var x = class ConfigurationModule {};
187
+ x = __decorate([n({
179
188
  controllers: [],
180
- exports: [y],
189
+ exports: [b],
181
190
  imports: [],
182
- providers: [y]
183
- })], b);
184
- export { l as CONFIGURATION_FILE_NAMES, b as ConfigurationModule, y as ConfigurationService, u as DEFAULT_INCLUDE };
191
+ providers: [b]
192
+ })], x);
193
+ export { l as CONFIGURATION_FILE_NAMES, x as ConfigurationModule, b as ConfigurationService, u as DEFAULT_INCLUDE };
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "url": "https://github.com/organizzolini/codebase/issues"
5
5
  },
6
6
  "dependencies": {
7
- "@coinagerie/core": "0.0.1",
7
+ "@coinagerie/core": "0.0.3",
8
8
  "@nestjs/common": "^11.1.21 || ^12.0.1",
9
9
  "jiti": "^2.7.0",
10
10
  "reflect-metadata": "^0.2.2",
@@ -59,5 +59,5 @@
59
59
  "strict": true
60
60
  },
61
61
  "types": "./dist/src/index.d.ts",
62
- "version": "0.0.1"
62
+ "version": "0.0.3"
63
63
  }