@conformetry/configuration 0.0.15 → 0.0.17
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 +32 -29
- package/dist/src/index.d.ts +15 -10
- package/dist/src/index.js +109 -129
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## 0.0.17 (2026-10-13)
|
|
2
|
+
|
|
3
|
+
### 🧱 Updated Dependencies
|
|
4
|
+
|
|
5
|
+
- Updated conformetry-core to 0.0.16
|
|
6
|
+
|
|
7
|
+
## 0.0.16 (2026-10-13)
|
|
8
|
+
|
|
9
|
+
### 🩹 Fixes
|
|
10
|
+
|
|
11
|
+
- **caelundas,conformetry:** 🐛 require an explicit directory instead of defaulting the destination ([#1395](https://github.com/organizzolini/codebase/pull/1395))
|
|
12
|
+
|
|
13
|
+
### 🧱 Updated Dependencies
|
|
14
|
+
|
|
15
|
+
- Updated conformetry-core to 0.0.15
|
|
16
|
+
|
|
1
17
|
## 0.0.15 (2026-10-12)
|
|
2
18
|
|
|
3
19
|
### 🧱 Updated Dependencies
|
package/README.md
CHANGED
|
@@ -285,11 +285,11 @@ Call stacks traced through `packages/ic-suite/conformetry/conformetry-configurat
|
|
|
285
285
|
| --- | --- |
|
|
286
286
|
| Callables | 181 |
|
|
287
287
|
| Files | 38 |
|
|
288
|
-
| Calls traced |
|
|
288
|
+
| Calls traced | 166 |
|
|
289
289
|
| Call stacks | 5 |
|
|
290
290
|
| Deepest stack | 10 |
|
|
291
291
|
| Stacks through recursion | 0 |
|
|
292
|
-
| Unfollowable calls |
|
|
292
|
+
| Unfollowable calls | 6 |
|
|
293
293
|
|
|
294
294
|
### Limits
|
|
295
295
|
|
|
@@ -394,7 +394,7 @@ What this project is judged against, as declared in its own `callidescope.config
|
|
|
394
394
|
| `InputPromptingService.promptForInput` | 4 | `InputPromptingService.assertCanPrompt`, `InputSchemaService.readEnumValues`, `InputPromptingService.map(…)`, `InputSchemaService.readPromptMessage` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input-prompting.service.ts:90` |
|
|
395
395
|
|
|
396
396
|
<details>
|
|
397
|
-
<summary>
|
|
397
|
+
<summary>101 more callables</summary>
|
|
398
398
|
|
|
399
399
|
| Callable | Breadth | Calls directly | Location |
|
|
400
400
|
| --- | --- | --- | --- |
|
|
@@ -407,7 +407,7 @@ What this project is judged against, as declared in its own `callidescope.config
|
|
|
407
407
|
| `assertNoCollisions` | 3 | `findDuplicates`, `findUnusableNames`, `findReservedNames` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/configuration/configuration.utilities.ts:28` |
|
|
408
408
|
| `findReservedNames` | 3 | `map(…)`, `filter(…)`, `map(…)` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/configuration/configuration.utilities.ts:97` |
|
|
409
409
|
| `findUnusableNames` | 3 | `map(…)`, `filter(…)`, `map(…)` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/configuration/configuration.utilities.ts:112` |
|
|
410
|
-
| `InputOptionsService.collectOneInput` | 3 | `InputOptionsService.readOptionName`, `InputOptionsService.resolvePropertyName`, `InputOptionsService.readOptionValue` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input-options.service.ts:
|
|
410
|
+
| `InputOptionsService.collectOneInput` | 3 | `InputOptionsService.readOptionName`, `InputOptionsService.resolvePropertyName`, `InputOptionsService.readOptionValue` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input-options.service.ts:34` |
|
|
411
411
|
| `InputSchemaService.validateValue` | 3 | `InputSchemaService.validateEnum`, `InputSchemaService.validateLength`, `InputSchemaService.validatePattern` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input-schema.service.ts:158` |
|
|
412
412
|
| `RenderingService.assertEverySubstitutionSupplied` | 3 | `RenderingService.filter(…)`, `RenderingService.collectInterpolatedNames`, `MissingSubstitutionError.constructor` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/rendering/rendering.service.ts:35` |
|
|
413
413
|
| `InstanceDiscoveryMatchingService.matchTemplates` | 3 | `InstanceDiscoveryMatchingService.toSorted(…)`, `InstanceDiscoveryMatchingService.filter(…)`, `InstanceDiscoveryMatchingService.map(…)` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/instance-discovery/instance-discovery-matching.service.ts:180` |
|
|
@@ -424,9 +424,10 @@ What this project is judged against, as declared in its own `callidescope.config
|
|
|
424
424
|
| `TemplateDiscoveryService.prepareDocument` | 2 | `TemplateDiscoveryService.resolveInstanceFilePath`, `RenderingService.renderContent` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/template-discovery/template-discovery.service.ts:178` |
|
|
425
425
|
| `InstanceDiscoveryMatchingService.fillPlaceholders` | 2 | `InstanceDiscoveryMatchingService.map(…)`, `InstanceDiscoveryMatchingService.filter(…)` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/instance-discovery/instance-discovery-matching.service.ts:73` |
|
|
426
426
|
| `InstanceDiscoveryMatchingService.map(…)` | 2 | `InstanceDiscoveryMatchingService.fillPlaceholders`, `TemplateDiscoveryService.countMatchingFiles` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/instance-discovery/instance-discovery-matching.service.ts:186` |
|
|
427
|
-
| `missingInputError` | 1 | `InputError.constructor` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input.constants.ts:
|
|
428
|
-
| `
|
|
429
|
-
| `InputOptionsService.
|
|
427
|
+
| `missingInputError` | 1 | `InputError.constructor` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input.constants.ts:55` |
|
|
428
|
+
| `missingDirectoryError` | 1 | `InputError.constructor` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input.constants.ts:70` |
|
|
429
|
+
| `InputOptionsService.resolvePropertyName` | 1 | `InputOptionsService.find(…)` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input-options.service.ts:100` |
|
|
430
|
+
| `InputOptionsService.collectGeneratorInputs` | 1 | `InputOptionsService.collectOneInput` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input-options.service.ts:120` |
|
|
430
431
|
| `InputSchemaService.readSchemaProperty` | 1 | `InputSchemaService.find(…)` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input-schema.service.ts:26` |
|
|
431
432
|
| `InputSchemaService.validateEnum` | 1 | `InputSchemaService.readEnumValues` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input-schema.service.ts:39` |
|
|
432
433
|
| `InputSchemaService.validateLength` | 1 | `InputSchemaService.readSchemaProperty` | `packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input-schema.service.ts:53` |
|
|
@@ -581,6 +582,7 @@ graph LR
|
|
|
581
582
|
file_src_modules_input_input_schema_service_ts["src/modules/input/input-schema.service.ts"]
|
|
582
583
|
file_src_modules_input_input_schema_service_unit_test_ts["src/modules/input/input-schema.service.unit.test.ts"]
|
|
583
584
|
file_src_modules_input_input_constants_ts["src/modules/input/input.constants.ts"]
|
|
585
|
+
file_src_modules_input_input_constants_unit_test_ts["src/modules/input/input.constants.unit.test.ts"]
|
|
584
586
|
file_src_modules_input_input_module_ts["src/modules/input/input.module.ts"]
|
|
585
587
|
file_src_modules_input_input_service_ts["src/modules/input/input.service.ts"]
|
|
586
588
|
file_src_modules_input_input_service_unit_test_ts["src/modules/input/input.service.unit.test.ts"]
|
|
@@ -660,6 +662,7 @@ graph LR
|
|
|
660
662
|
file_src_modules_input_input_schema_service_ts --> file_src_modules_configuration_configuration_types_ts
|
|
661
663
|
file_src_modules_input_input_schema_service_ts --> file_src_modules_input_input_types_ts
|
|
662
664
|
file_src_modules_input_input_schema_service_unit_test_ts --> file_src_modules_input_input_schema_service_ts
|
|
665
|
+
file_src_modules_input_input_constants_unit_test_ts --> file_src_modules_input_input_constants_ts
|
|
663
666
|
file_src_modules_input_input_module_ts --> file_src_modules_input_input_options_service_ts
|
|
664
667
|
file_src_modules_input_input_module_ts --> file_src_modules_input_input_prompting_service_ts
|
|
665
668
|
file_src_modules_input_input_module_ts --> file_src_modules_input_input_schema_service_ts
|
|
@@ -736,40 +739,40 @@ graph LR
|
|
|
736
739
|
|
|
737
740
|
### Project
|
|
738
741
|
|
|
739
|
-

|
|
743
|
+

|
|
741
744
|

|
|
742
|
-

|
|
743
746
|
|
|
744
747
|
### Measured Targets
|
|
745
748
|
|
|
746
|
-

|
|
747
750
|
|
|
748
751
|
### TypeScript
|
|
749
752
|
|
|
750
|
-

|
|
751
754
|

|
|
752
755
|

|
|
753
756
|

|
|
754
757
|

|
|
755
|
-

|
|
756
759
|

|
|
757
760
|
|
|
758
761
|
### JavaScript
|
|
759
762
|
|
|
760
763
|

|
|
761
|
-

|
|
762
765
|

|
|
763
766
|

|
|
764
|
-

|
|
768
|
+

|
|
769
|
+

|
|
767
770
|

|
|
768
|
-

|
|
769
772
|

|
|
770
|
-

|
|
774
|
+

|
|
775
|
+

|
|
773
776
|

|
|
774
777
|
|
|
775
778
|
### Python
|
|
@@ -887,7 +890,7 @@ graph LR
|
|
|
887
890
|

|
|
888
891
|

|
|
889
892
|

|
|
890
|
-

|
|
891
894
|

|
|
892
895
|

|
|
893
896
|

|
|
@@ -925,20 +928,20 @@ graph LR
|
|
|
925
928
|
### Markdown
|
|
926
929
|
|
|
927
930
|

|
|
928
|
-

|
|
929
932
|

|
|
930
|
-

|
|
934
|
+

|
|
932
935
|

|
|
933
936
|

|
|
934
937
|

|
|
935
|
-

|
|
939
|
+

|
|
940
|
+

|
|
938
941
|

|
|
939
942
|

|
|
940
943
|

|
|
941
|
-

|
|
942
945
|

|
|
943
946
|

|
|
944
947
|

|
package/dist/src/index.d.ts
CHANGED
|
@@ -315,16 +315,6 @@ declare class InputOptionsService {
|
|
|
315
315
|
}): Record<string, string>;
|
|
316
316
|
/** Coerces mixed-typed runtime options into string inputs. */
|
|
317
317
|
normalizeRuntimeOptions(options: Record<string, unknown>): Record<string, string | undefined>;
|
|
318
|
-
/**
|
|
319
|
-
* Resolves where generated files should land: an explicit output option, a
|
|
320
|
-
* resolved project root, or a directory named after the generator.
|
|
321
|
-
*/
|
|
322
|
-
resolveTargetDirectoryPath(args: {
|
|
323
|
-
defaultGeneratedOutputDirectory?: string;
|
|
324
|
-
generatorName: string;
|
|
325
|
-
options: Record<string, unknown>;
|
|
326
|
-
resolveProjectRootPath?: (projectName: string) => string | undefined;
|
|
327
|
-
}): string;
|
|
328
318
|
}
|
|
329
319
|
|
|
330
320
|
/**
|
|
@@ -807,6 +797,21 @@ export declare interface MatchedInstance {
|
|
|
807
797
|
readonly template: TemplateDefinition;
|
|
808
798
|
}
|
|
809
799
|
|
|
800
|
+
/**
|
|
801
|
+
* A run that names no directory, and has nothing else to place its output by.
|
|
802
|
+
*
|
|
803
|
+
* Both hosts refuse this with the same words, which is why it lives here: the
|
|
804
|
+
* command-line host always needs `--directory`, and the Nx plugin needs it
|
|
805
|
+
* only when no `project` or `type` locates the output, so each decides when to
|
|
806
|
+
* raise it and neither words it. A silent fallback is what this replaces —
|
|
807
|
+
* output written somewhere the caller never chose, reported as success. The
|
|
808
|
+
* optional `hint` carries a remedy only one host has.
|
|
809
|
+
*/
|
|
810
|
+
export declare const missingDirectoryError: (args: {
|
|
811
|
+
generatorName: string | undefined;
|
|
812
|
+
hint?: string;
|
|
813
|
+
}) => InputError;
|
|
814
|
+
|
|
810
815
|
/**
|
|
811
816
|
* A required input that cannot be asked for, because stdin is not a terminal.
|
|
812
817
|
*
|
package/dist/src/index.js
CHANGED
|
@@ -16,15 +16,11 @@ var h = /* @__PURE__ */ new Set([
|
|
|
16
16
|
"help",
|
|
17
17
|
"instancePath",
|
|
18
18
|
"template"
|
|
19
|
-
]), g = "all",
|
|
20
|
-
"instancePath",
|
|
21
|
-
"directory",
|
|
22
|
-
"outputPath"
|
|
23
|
-
], InputError = class extends Error {
|
|
19
|
+
]), g = "all", InputError = class extends Error {
|
|
24
20
|
constructor(e) {
|
|
25
21
|
super(e), this.name = "InputError";
|
|
26
22
|
}
|
|
27
|
-
}, missingInputError = (e) => new InputError(`${e} is required, and stdin is not a terminal so it cannot be asked for. Pass --${e}.`);
|
|
23
|
+
}, missingInputError = (e) => new InputError(`${e} is required, and stdin is not a terminal so it cannot be asked for. Pass --${e}.`), missingDirectoryError = (e) => new InputError(`${e.generatorName === void 0 ? "This generator" : `Generator ${e.generatorName}`} cannot tell where to write its output. Pass --directory=<parent folder> (the folder the output is created inside).${e.hint === void 0 ? "" : ` ${e.hint}`}`);
|
|
28
24
|
//#endregion
|
|
29
25
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/configuration/configuration.utilities.ts
|
|
30
26
|
function assertNoCollisions(e, t) {
|
|
@@ -86,7 +82,7 @@ var UnknownConfigurationFileTypeError = class extends Error {
|
|
|
86
82
|
constructor(e) {
|
|
87
83
|
super(`Unsupported configuration file type: ${e}`), this.name = "UnknownConfigurationFileTypeError";
|
|
88
84
|
}
|
|
89
|
-
},
|
|
85
|
+
}, _ = "pnpm-workspace.yaml", v = /* @__PURE__ */ new Set([
|
|
90
86
|
".cjs",
|
|
91
87
|
".cts",
|
|
92
88
|
".js",
|
|
@@ -95,16 +91,16 @@ var UnknownConfigurationFileTypeError = class extends Error {
|
|
|
95
91
|
".mjs",
|
|
96
92
|
".mts",
|
|
97
93
|
".ts"
|
|
98
|
-
]),
|
|
94
|
+
]), y = e.lazy(() => e.union([
|
|
99
95
|
e.string(),
|
|
100
96
|
e.number(),
|
|
101
97
|
e.boolean(),
|
|
102
98
|
e.null(),
|
|
103
|
-
e.array(
|
|
104
|
-
e.record(e.string(),
|
|
105
|
-
])),
|
|
99
|
+
e.array(y),
|
|
100
|
+
e.record(e.string(), y)
|
|
101
|
+
])), b = e.array(e.strictObject({
|
|
106
102
|
description: e.string().optional(),
|
|
107
|
-
inputs: e.record(e.string(), e.record(e.string(),
|
|
103
|
+
inputs: e.record(e.string(), e.record(e.string(), y)).optional(),
|
|
108
104
|
instances: e.array(e.object({
|
|
109
105
|
exclude: e.array(e.string()).optional(),
|
|
110
106
|
patterns: e.array(e.string()).optional(),
|
|
@@ -117,12 +113,12 @@ var UnknownConfigurationFileTypeError = class extends Error {
|
|
|
117
113
|
threshold: e.number().min(0).max(1).optional()
|
|
118
114
|
})).superRefine(assertNoCollisions);
|
|
119
115
|
//#endregion
|
|
120
|
-
//#region \0@oxc-project+runtime@0.
|
|
116
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateMetadata.js
|
|
121
117
|
function __decorateMetadata(e, t) {
|
|
122
118
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
123
119
|
}
|
|
124
120
|
//#endregion
|
|
125
|
-
//#region \0@oxc-project+runtime@0.
|
|
121
|
+
//#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
|
|
126
122
|
function __decorate(e, t, n, r) {
|
|
127
123
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
128
124
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
@@ -131,7 +127,7 @@ function __decorate(e, t, n, r) {
|
|
|
131
127
|
}
|
|
132
128
|
//#endregion
|
|
133
129
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input-options.service.ts
|
|
134
|
-
var
|
|
130
|
+
var x = class InputOptionsService {
|
|
135
131
|
constructor() {}
|
|
136
132
|
collectOneInput(e) {
|
|
137
133
|
let t = e.commandArguments[e.argumentIndex];
|
|
@@ -172,23 +168,11 @@ var S = class InputOptionsService {
|
|
|
172
168
|
for (let [n, r] of Object.entries(e)) t[n] = r === void 0 ? void 0 : typeof r == "string" ? r : typeof r == "number" || typeof r == "boolean" ? `${r}` : JSON.stringify(r);
|
|
173
169
|
return t;
|
|
174
170
|
}
|
|
175
|
-
resolveTargetDirectoryPath(e) {
|
|
176
|
-
for (let t of _) {
|
|
177
|
-
let n = e.options[t];
|
|
178
|
-
if (typeof n == "string") return n;
|
|
179
|
-
}
|
|
180
|
-
let n = e.options.projectName ?? e.options.project;
|
|
181
|
-
if (typeof n == "string") {
|
|
182
|
-
let t = e.resolveProjectRootPath?.(n);
|
|
183
|
-
if (typeof t == "string") return t;
|
|
184
|
-
}
|
|
185
|
-
return t.join(e.defaultGeneratedOutputDirectory ?? "generated", e.generatorName);
|
|
186
|
-
}
|
|
187
171
|
};
|
|
188
|
-
|
|
172
|
+
x = __decorate([n(), __decorateMetadata("design:paramtypes", [])], x);
|
|
189
173
|
//#endregion
|
|
190
174
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input-schema.service.ts
|
|
191
|
-
var
|
|
175
|
+
var S = class InputSchemaService {
|
|
192
176
|
constructor() {}
|
|
193
177
|
readSchemaProperty(e, t) {
|
|
194
178
|
if (typeof e == "object" && e) return Object.entries(e).find(([e]) => e === t)?.[1];
|
|
@@ -243,10 +227,10 @@ var C = class InputSchemaService {
|
|
|
243
227
|
}) : r;
|
|
244
228
|
}
|
|
245
229
|
};
|
|
246
|
-
|
|
230
|
+
S = __decorate([n(), __decorateMetadata("design:paramtypes", [])], S);
|
|
247
231
|
//#endregion
|
|
248
232
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input-prompting.service.ts
|
|
249
|
-
var
|
|
233
|
+
var C = class InputPromptingService {
|
|
250
234
|
inputSchemaService;
|
|
251
235
|
constructor(e) {
|
|
252
236
|
this.inputSchemaService = e;
|
|
@@ -309,10 +293,10 @@ var w = class InputPromptingService {
|
|
|
309
293
|
return n.length === 0 ? void 0 : n;
|
|
310
294
|
}
|
|
311
295
|
};
|
|
312
|
-
|
|
296
|
+
C = __decorate([n(), __decorateMetadata("design:paramtypes", [S === void 0 ? Object : S])], C);
|
|
313
297
|
//#endregion
|
|
314
298
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input.service.ts
|
|
315
|
-
var
|
|
299
|
+
var w = class InputService {
|
|
316
300
|
inputOptionsService;
|
|
317
301
|
inputPromptingService;
|
|
318
302
|
inputSchemaService;
|
|
@@ -393,55 +377,55 @@ var T = class InputService {
|
|
|
393
377
|
});
|
|
394
378
|
}
|
|
395
379
|
};
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
])],
|
|
380
|
+
w = __decorate([n(), __decorateMetadata("design:paramtypes", [
|
|
381
|
+
x === void 0 ? Object : x,
|
|
382
|
+
C === void 0 ? Object : C,
|
|
383
|
+
S === void 0 ? Object : S
|
|
384
|
+
])], w);
|
|
401
385
|
//#endregion
|
|
402
386
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input.module.ts
|
|
403
|
-
var
|
|
404
|
-
|
|
387
|
+
var T = class InputModule {};
|
|
388
|
+
T = __decorate([r({
|
|
405
389
|
controllers: [],
|
|
406
390
|
exports: [
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
391
|
+
x,
|
|
392
|
+
C,
|
|
393
|
+
w
|
|
410
394
|
],
|
|
411
395
|
imports: [],
|
|
412
396
|
providers: [
|
|
413
|
-
|
|
414
|
-
w,
|
|
397
|
+
x,
|
|
415
398
|
C,
|
|
416
|
-
|
|
399
|
+
S,
|
|
400
|
+
w
|
|
417
401
|
]
|
|
418
|
-
})],
|
|
402
|
+
})], T);
|
|
419
403
|
//#endregion
|
|
420
404
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/instance-group/instance-group.service.ts
|
|
421
|
-
var
|
|
405
|
+
var E = class InstanceGroupService {
|
|
422
406
|
constructor() {}
|
|
423
407
|
isProjectScoped(e) {
|
|
424
408
|
return e.tags !== void 0 && e.tags.length > 0;
|
|
425
409
|
}
|
|
426
410
|
};
|
|
427
|
-
|
|
411
|
+
E = __decorate([n(), __decorateMetadata("design:paramtypes", [])], E);
|
|
428
412
|
//#endregion
|
|
429
413
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/instance-group/instance-group.module.ts
|
|
430
|
-
var
|
|
431
|
-
|
|
414
|
+
var D = class InstanceGroupModule {};
|
|
415
|
+
D = __decorate([r({
|
|
432
416
|
controllers: [],
|
|
433
|
-
exports: [
|
|
417
|
+
exports: [E],
|
|
434
418
|
imports: [],
|
|
435
|
-
providers: [
|
|
436
|
-
})],
|
|
419
|
+
providers: [E]
|
|
420
|
+
})], D);
|
|
437
421
|
//#endregion
|
|
438
422
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/rendering/rendering.constants.ts
|
|
439
|
-
var
|
|
423
|
+
var O = { escape: String }, MissingSubstitutionError = class extends Error {
|
|
440
424
|
constructor(e) {
|
|
441
425
|
let t = e.placeholders.map((e) => `{{${e}}}`).join(", ");
|
|
442
426
|
super(`No value was supplied for ${t} while rendering ${e.subject}. Declare each one as an input of the generator, and in the matching instance group's substitutions.`), this.name = "MissingSubstitutionError";
|
|
443
427
|
}
|
|
444
|
-
},
|
|
428
|
+
}, k = /conformetry[0-9a-f]{32}/g, A = "conformetry", j = class RenderingService {
|
|
445
429
|
constructor() {}
|
|
446
430
|
assertEverySubstitutionSupplied(e) {
|
|
447
431
|
let t = this.collectInterpolatedNames(e.template).filter((t) => !Object.hasOwn(e.substitutions, t));
|
|
@@ -473,29 +457,29 @@ var k = { escape: String }, MissingSubstitutionError = class extends Error {
|
|
|
473
457
|
subject: e.subject ?? "a template file",
|
|
474
458
|
substitutions: e.substitutions,
|
|
475
459
|
template: e.templateContent
|
|
476
|
-
}), o.render(e.templateContent, e.substitutions, {},
|
|
460
|
+
}), o.render(e.templateContent, e.substitutions, {}, O);
|
|
477
461
|
}
|
|
478
462
|
renderPath(e) {
|
|
479
463
|
return this.assertEverySubstitutionSupplied({
|
|
480
464
|
subject: e.subject ?? e.templatePath,
|
|
481
465
|
substitutions: e.substitutions,
|
|
482
466
|
template: e.templatePath
|
|
483
|
-
}), o.render(e.templatePath, e.substitutions, {},
|
|
467
|
+
}), o.render(e.templatePath, e.substitutions, {}, O);
|
|
484
468
|
}
|
|
485
469
|
};
|
|
486
|
-
|
|
470
|
+
j = __decorate([n(), __decorateMetadata("design:paramtypes", [])], j);
|
|
487
471
|
//#endregion
|
|
488
472
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/rendering/rendering.module.ts
|
|
489
|
-
var
|
|
490
|
-
|
|
473
|
+
var M = class RenderingModule {};
|
|
474
|
+
M = __decorate([r({
|
|
491
475
|
controllers: [],
|
|
492
|
-
exports: [
|
|
476
|
+
exports: [j],
|
|
493
477
|
imports: [],
|
|
494
|
-
providers: [
|
|
495
|
-
})],
|
|
478
|
+
providers: [j]
|
|
479
|
+
})], M);
|
|
496
480
|
//#endregion
|
|
497
481
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/template-discovery/template-discovery.service.ts
|
|
498
|
-
var
|
|
482
|
+
var N = class TemplateDiscoveryService {
|
|
499
483
|
renderingService;
|
|
500
484
|
constructor(e) {
|
|
501
485
|
this.renderingService = e;
|
|
@@ -569,23 +553,23 @@ var P = class TemplateDiscoveryService {
|
|
|
569
553
|
}));
|
|
570
554
|
}
|
|
571
555
|
};
|
|
572
|
-
|
|
556
|
+
N = __decorate([n(), __decorateMetadata("design:paramtypes", [j === void 0 ? Object : j])], N);
|
|
573
557
|
//#endregion
|
|
574
558
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/template-discovery/template-discovery.module.ts
|
|
575
|
-
var
|
|
576
|
-
|
|
559
|
+
var P = class TemplateDiscoveryModule {};
|
|
560
|
+
P = __decorate([r({
|
|
577
561
|
controllers: [],
|
|
578
|
-
exports: [
|
|
579
|
-
imports: [
|
|
580
|
-
providers: [
|
|
581
|
-
})],
|
|
562
|
+
exports: [N],
|
|
563
|
+
imports: [M],
|
|
564
|
+
providers: [N]
|
|
565
|
+
})], P);
|
|
582
566
|
//#endregion
|
|
583
567
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/instance-discovery/instance-discovery.constants.ts
|
|
584
|
-
var
|
|
568
|
+
var F = /\.[^.]+$/u, I = [
|
|
585
569
|
"*",
|
|
586
570
|
"?",
|
|
587
571
|
"]"
|
|
588
|
-
],
|
|
572
|
+
], L = class InstanceDiscoveryLocatingService {
|
|
589
573
|
constructor() {}
|
|
590
574
|
deriveLocationSubstitutions(e) {
|
|
591
575
|
let [n = ""] = t.relative(e.workingDirectory, t.join(e.instancePath, e.nameStem)).split(t.sep);
|
|
@@ -605,11 +589,11 @@ var I = /\.[^.]+$/u, L = [
|
|
|
605
589
|
return (e.exclude ?? []).some((e) => t.matchesGlob(n, e));
|
|
606
590
|
}
|
|
607
591
|
resolveGlobSuffix(e) {
|
|
608
|
-
let n = t.basename(e), r = Math.max(...
|
|
592
|
+
let n = t.basename(e), r = Math.max(...I.map((e) => n.lastIndexOf(e)));
|
|
609
593
|
return r === -1 ? "" : n.slice(r + 1);
|
|
610
594
|
}
|
|
611
595
|
resolveNameStem(e) {
|
|
612
|
-
return e.isDirectory ? e.entryName : e.suffix !== "" && e.entryName.endsWith(e.suffix) ? e.entryName.slice(0, -e.suffix.length) : e.entryName.replace(
|
|
596
|
+
return e.isDirectory ? e.entryName : e.suffix !== "" && e.entryName.endsWith(e.suffix) ? e.entryName.slice(0, -e.suffix.length) : e.entryName.replace(F, "");
|
|
613
597
|
}
|
|
614
598
|
findInstances(e) {
|
|
615
599
|
let n = /* @__PURE__ */ new Map();
|
|
@@ -655,24 +639,24 @@ var I = /\.[^.]+$/u, L = [
|
|
|
655
639
|
});
|
|
656
640
|
}
|
|
657
641
|
};
|
|
658
|
-
|
|
642
|
+
L = __decorate([n(), __decorateMetadata("design:paramtypes", [])], L);
|
|
659
643
|
//#endregion
|
|
660
644
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/rendering/rendering.utilities.ts
|
|
661
645
|
function capturePlaceholderValues(e) {
|
|
662
|
-
let t = e.templateText.match(
|
|
646
|
+
let t = e.templateText.match(k) ?? [];
|
|
663
647
|
if (t.length === 0) return;
|
|
664
|
-
let n = i.escapeRegExp(e.templateText).replaceAll(
|
|
648
|
+
let n = i.escapeRegExp(e.templateText).replaceAll(k, String.raw`([\s\S]+?)`), r = RegExp(`^${n}$`, "u").exec(e.instanceText);
|
|
665
649
|
if (r === null) return;
|
|
666
650
|
let a = {};
|
|
667
651
|
for (let [e, n] of t.entries()) a[n] ??= r[e + 1] ?? "";
|
|
668
652
|
return a;
|
|
669
653
|
}
|
|
670
654
|
function createPlaceholderValue() {
|
|
671
|
-
return `${
|
|
655
|
+
return `${A}${l().replaceAll("-", "")}`;
|
|
672
656
|
}
|
|
673
657
|
//#endregion
|
|
674
658
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/instance-discovery/instance-discovery-matching.service.ts
|
|
675
|
-
var
|
|
659
|
+
var R = class InstanceDiscoveryMatchingService {
|
|
676
660
|
templateDiscoveryService;
|
|
677
661
|
renderingService;
|
|
678
662
|
constructor(e, t) {
|
|
@@ -715,15 +699,11 @@ var z = class InstanceDiscoveryMatchingService {
|
|
|
715
699
|
continue;
|
|
716
700
|
}
|
|
717
701
|
let s = a.filter((e) => e.matchRatio === o.matchRatio && e.matchedFileCount === o.matchedFileCount);
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
});
|
|
724
|
-
continue;
|
|
725
|
-
}
|
|
726
|
-
t.push(...s.map((e) => ({
|
|
702
|
+
s.length > 1 && o.matchRatio < 1 ? n.push({
|
|
703
|
+
instance: r,
|
|
704
|
+
reason: "ambiguous",
|
|
705
|
+
tiedTemplateNames: s.map((e) => e.template.name)
|
|
706
|
+
}) : t.push(...s.map((e) => ({
|
|
727
707
|
instance: r,
|
|
728
708
|
matchedFileCount: e.matchedFileCount,
|
|
729
709
|
placeholderValues: e.placeholderValues,
|
|
@@ -756,10 +736,10 @@ var z = class InstanceDiscoveryMatchingService {
|
|
|
756
736
|
}).filter((e) => e.matchedFileCount > 0 && e.matchRatio > 0).toSorted((e, t) => this.compareMatches(e, t));
|
|
757
737
|
}
|
|
758
738
|
};
|
|
759
|
-
|
|
739
|
+
R = __decorate([n(), __decorateMetadata("design:paramtypes", [N === void 0 ? Object : N, j === void 0 ? Object : j])], R);
|
|
760
740
|
//#endregion
|
|
761
741
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/instance-discovery/instance-discovery.service.ts
|
|
762
|
-
var
|
|
742
|
+
var z = class InstanceDiscoveryService {
|
|
763
743
|
instanceDiscoveryLocatingService;
|
|
764
744
|
instanceDiscoveryMatchingService;
|
|
765
745
|
instanceGroupService;
|
|
@@ -873,37 +853,37 @@ var B = class InstanceDiscoveryService {
|
|
|
873
853
|
};
|
|
874
854
|
}
|
|
875
855
|
};
|
|
876
|
-
|
|
856
|
+
z = __decorate([n(), __decorateMetadata("design:paramtypes", [
|
|
857
|
+
L === void 0 ? Object : L,
|
|
877
858
|
R === void 0 ? Object : R,
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
])], B);
|
|
859
|
+
E === void 0 ? Object : E,
|
|
860
|
+
N === void 0 ? Object : N
|
|
861
|
+
])], z);
|
|
882
862
|
//#endregion
|
|
883
863
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/instance-discovery/instance-discovery.module.ts
|
|
884
|
-
var
|
|
885
|
-
|
|
864
|
+
var B = class InstanceDiscoveryModule {};
|
|
865
|
+
B = __decorate([r({
|
|
886
866
|
controllers: [],
|
|
887
867
|
exports: [
|
|
868
|
+
L,
|
|
888
869
|
R,
|
|
889
870
|
z,
|
|
890
|
-
|
|
891
|
-
F
|
|
871
|
+
P
|
|
892
872
|
],
|
|
893
873
|
imports: [
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
874
|
+
D,
|
|
875
|
+
M,
|
|
876
|
+
P
|
|
897
877
|
],
|
|
898
878
|
providers: [
|
|
879
|
+
L,
|
|
899
880
|
R,
|
|
900
|
-
z
|
|
901
|
-
B
|
|
881
|
+
z
|
|
902
882
|
]
|
|
903
|
-
})],
|
|
883
|
+
})], B);
|
|
904
884
|
//#endregion
|
|
905
885
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/configuration/configuration.service.ts
|
|
906
|
-
var
|
|
886
|
+
var V = class ConfigurationService {
|
|
907
887
|
inputPromptingService;
|
|
908
888
|
inputService;
|
|
909
889
|
instanceDiscoveryService;
|
|
@@ -926,7 +906,7 @@ var H = class ConfigurationService {
|
|
|
926
906
|
async findWorkspaceRoot() {
|
|
927
907
|
let e = t.resolve(process.cwd());
|
|
928
908
|
for (;;) try {
|
|
929
|
-
return await u(t.join(e,
|
|
909
|
+
return await u(t.join(e, _)), e;
|
|
930
910
|
} catch {
|
|
931
911
|
let n = t.dirname(e);
|
|
932
912
|
if (n === e) return;
|
|
@@ -972,12 +952,12 @@ var H = class ConfigurationService {
|
|
|
972
952
|
}
|
|
973
953
|
async loadConformetryConfiguration(e) {
|
|
974
954
|
let n = await this.resolveConfigurationPath(e), r = t.extname(n).toLowerCase();
|
|
975
|
-
if (!
|
|
955
|
+
if (!v.has(r)) throw new UnknownConfigurationFileTypeError(n);
|
|
976
956
|
let i = await this.loadConfigurationModule({
|
|
977
957
|
configurationPath: n,
|
|
978
958
|
extension: r
|
|
979
959
|
});
|
|
980
|
-
return
|
|
960
|
+
return b.parse(i).map((e) => this.applyGeneratorDefaults(e));
|
|
981
961
|
}
|
|
982
962
|
matchInstances(e) {
|
|
983
963
|
return this.instanceDiscoveryService.matchInstances(e);
|
|
@@ -1022,28 +1002,28 @@ var H = class ConfigurationService {
|
|
|
1022
1002
|
return this.instanceDiscoveryService.resolveInventoriedTemplates(e);
|
|
1023
1003
|
}
|
|
1024
1004
|
};
|
|
1025
|
-
|
|
1005
|
+
V = __decorate([n(), __decorateMetadata("design:paramtypes", [
|
|
1006
|
+
C === void 0 ? Object : C,
|
|
1026
1007
|
w === void 0 ? Object : w,
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
])], H);
|
|
1008
|
+
z === void 0 ? Object : z,
|
|
1009
|
+
E === void 0 ? Object : E,
|
|
1010
|
+
j === void 0 ? Object : j,
|
|
1011
|
+
N === void 0 ? Object : N
|
|
1012
|
+
])], V);
|
|
1033
1013
|
//#endregion
|
|
1034
1014
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/configuration/configuration.module.ts
|
|
1035
|
-
var
|
|
1036
|
-
|
|
1015
|
+
var H = class ConfigurationModule {};
|
|
1016
|
+
H = __decorate([r({
|
|
1037
1017
|
controllers: [],
|
|
1038
|
-
exports: [
|
|
1018
|
+
exports: [V],
|
|
1039
1019
|
imports: [
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1020
|
+
T,
|
|
1021
|
+
B,
|
|
1022
|
+
D,
|
|
1023
|
+
M,
|
|
1024
|
+
P
|
|
1045
1025
|
],
|
|
1046
|
-
providers: [
|
|
1047
|
-
})],
|
|
1026
|
+
providers: [V]
|
|
1027
|
+
})], H);
|
|
1048
1028
|
//#endregion
|
|
1049
|
-
export { g as ALL_TEMPLATES_SELECTION,
|
|
1029
|
+
export { g as ALL_TEMPLATES_SELECTION, H as ConfigurationModule, V as ConfigurationService, InputError, MissingSubstitutionError, UnknownConfigurationFileTypeError, capturePlaceholderValues, createPlaceholderValue, missingDirectoryError, missingInputError };
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"url": "https://github.com/organizzolini/codebase/issues"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@conformetry/core": "0.0.
|
|
7
|
+
"@conformetry/core": "0.0.16",
|
|
8
8
|
"@nestjs/common": "^11.1.21 || ^12.0.1",
|
|
9
9
|
"jiti": "^2.7.0",
|
|
10
10
|
"jsonc-parser": "^3.3.1",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"strict": true
|
|
68
68
|
},
|
|
69
69
|
"types": "./dist/src/index.d.ts",
|
|
70
|
-
"version": "0.0.
|
|
70
|
+
"version": "0.0.17"
|
|
71
71
|
}
|