@conformetry/configuration 0.0.9 → 0.0.11
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 +12 -0
- package/README.md +8 -8
- package/dist/src/index.js +141 -141
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 0.0.11 (2026-10-08)
|
|
2
|
+
|
|
3
|
+
### 🧱 Updated Dependencies
|
|
4
|
+
|
|
5
|
+
- Updated conformetry-core to 0.0.10
|
|
6
|
+
|
|
7
|
+
## 0.0.10 (2026-10-08)
|
|
8
|
+
|
|
9
|
+
### 🧱 Updated Dependencies
|
|
10
|
+
|
|
11
|
+
- Updated conformetry-core to 0.0.9
|
|
12
|
+
|
|
1
13
|
## 0.0.9 (2026-10-08)
|
|
2
14
|
|
|
3
15
|
### 🧱 Updated Dependencies
|
package/README.md
CHANGED
|
@@ -737,13 +737,13 @@ graph LR
|
|
|
737
737
|
### Project
|
|
738
738
|
|
|
739
739
|

|
|
740
|
-

|
|
741
741
|

|
|
742
742
|

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

|
|
747
747
|
|
|
748
748
|
### TypeScript
|
|
749
749
|
|
|
@@ -925,16 +925,16 @@ graph LR
|
|
|
925
925
|
### Markdown
|
|
926
926
|
|
|
927
927
|

|
|
928
|
-

|
|
929
929
|

|
|
930
|
-

|
|
931
|
+

|
|
932
932
|

|
|
933
933
|

|
|
934
934
|

|
|
935
|
-

|
|
936
|
+

|
|
937
|
+

|
|
938
938
|

|
|
939
939
|

|
|
940
940
|

|
package/dist/src/index.js
CHANGED
|
@@ -6,41 +6,41 @@ import a from "prompts";
|
|
|
6
6
|
import o from "mustache";
|
|
7
7
|
import s, { existsSync as c } from "node:fs";
|
|
8
8
|
import { randomUUID as l } from "node:crypto";
|
|
9
|
-
import { access as u, readFile as
|
|
10
|
-
import { fileURLToPath as
|
|
11
|
-
import { createJiti as
|
|
12
|
-
import { parse as
|
|
13
|
-
//#region
|
|
14
|
-
var
|
|
9
|
+
import { access as u, readFile as d } from "node:fs/promises";
|
|
10
|
+
import { fileURLToPath as f } from "node:url";
|
|
11
|
+
import { createJiti as p } from "jiti";
|
|
12
|
+
import { parse as m } from "jsonc-parser";
|
|
13
|
+
//#region \0rolldown/runtime.js
|
|
14
|
+
var h = /* @__PURE__ */ new Set([
|
|
15
15
|
"config",
|
|
16
16
|
"help",
|
|
17
17
|
"instancePath",
|
|
18
18
|
"template"
|
|
19
|
-
]),
|
|
19
|
+
]), g = "all", _ = [
|
|
20
20
|
"instancePath",
|
|
21
21
|
"directory",
|
|
22
22
|
"outputPath"
|
|
23
|
-
],
|
|
23
|
+
], InputError = class extends Error {
|
|
24
24
|
constructor(e) {
|
|
25
25
|
super(e), this.name = "InputError";
|
|
26
26
|
}
|
|
27
|
-
},
|
|
27
|
+
}, missingInputError = (e) => new InputError(`${e} is required, and stdin is not a terminal so it cannot be asked for. Pass --${e}.`);
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/configuration/configuration.utilities.ts
|
|
30
|
-
function
|
|
30
|
+
function assertNoCollisions(e, t) {
|
|
31
31
|
let n = [
|
|
32
|
-
...
|
|
32
|
+
...findDuplicates({
|
|
33
33
|
definitions: e,
|
|
34
34
|
describe: (e, t) => `"${e}" is the name of more than one generator: ${t.join(", ")}. A host resolves the first match, leaving the others unreachable.`,
|
|
35
35
|
keysOf: (e) => [e.name]
|
|
36
36
|
}),
|
|
37
|
-
...
|
|
37
|
+
...findDuplicates({
|
|
38
38
|
definitions: e,
|
|
39
39
|
describe: (e, t) => `${e} is the template of more than one generator: ${t.join(", ")}. Validation cannot tell which one a matching instance belongs to.`,
|
|
40
40
|
keysOf: (e) => [e.templatePath]
|
|
41
41
|
}),
|
|
42
|
-
...
|
|
43
|
-
...
|
|
42
|
+
...findUnusableNames(e),
|
|
43
|
+
...findReservedNames(e)
|
|
44
44
|
];
|
|
45
45
|
for (let e of n) t.addIssue({
|
|
46
46
|
code: "custom",
|
|
@@ -48,7 +48,7 @@ function y(e, t) {
|
|
|
48
48
|
path: e.path
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function findDuplicates(e) {
|
|
52
52
|
let t = /* @__PURE__ */ new Map();
|
|
53
53
|
for (let [n, r] of e.definitions.entries()) for (let i of e.keysOf(r)) {
|
|
54
54
|
let e = t.get(i);
|
|
@@ -62,7 +62,7 @@ function b(e) {
|
|
|
62
62
|
path: [n.lastIndex]
|
|
63
63
|
}));
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function findReservedNames(e) {
|
|
66
66
|
return e.map((e, t) => ({
|
|
67
67
|
index: t,
|
|
68
68
|
name: e.name
|
|
@@ -71,7 +71,7 @@ function te(e) {
|
|
|
71
71
|
path: [e]
|
|
72
72
|
}));
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function findUnusableNames(e) {
|
|
75
75
|
return e.map((e, t) => ({
|
|
76
76
|
index: t,
|
|
77
77
|
name: e.name
|
|
@@ -82,11 +82,11 @@ function x(e) {
|
|
|
82
82
|
}
|
|
83
83
|
//#endregion
|
|
84
84
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/configuration/configuration.constants.ts
|
|
85
|
-
var
|
|
85
|
+
var UnknownConfigurationFileTypeError = class extends Error {
|
|
86
86
|
constructor(e) {
|
|
87
87
|
super(`Unsupported configuration file type: ${e}`), this.name = "UnknownConfigurationFileTypeError";
|
|
88
88
|
}
|
|
89
|
-
},
|
|
89
|
+
}, v = "pnpm-workspace.yaml", y = /* @__PURE__ */ new Set([
|
|
90
90
|
".cjs",
|
|
91
91
|
".cts",
|
|
92
92
|
".js",
|
|
@@ -95,16 +95,16 @@ var S = class extends Error {
|
|
|
95
95
|
".mjs",
|
|
96
96
|
".mts",
|
|
97
97
|
".ts"
|
|
98
|
-
]),
|
|
98
|
+
]), b = e.lazy(() => e.union([
|
|
99
99
|
e.string(),
|
|
100
100
|
e.number(),
|
|
101
101
|
e.boolean(),
|
|
102
102
|
e.null(),
|
|
103
|
-
e.array(
|
|
104
|
-
e.record(e.string(),
|
|
105
|
-
])),
|
|
103
|
+
e.array(b),
|
|
104
|
+
e.record(e.string(), b)
|
|
105
|
+
])), x = e.array(e.strictObject({
|
|
106
106
|
description: e.string().optional(),
|
|
107
|
-
inputs: e.record(e.string(), e.record(e.string(),
|
|
107
|
+
inputs: e.record(e.string(), e.record(e.string(), b)).optional(),
|
|
108
108
|
instances: e.array(e.object({
|
|
109
109
|
exclude: e.array(e.string()).optional(),
|
|
110
110
|
patterns: e.array(e.string()).optional(),
|
|
@@ -115,15 +115,15 @@ var S = class extends Error {
|
|
|
115
115
|
name: e.string(),
|
|
116
116
|
templatePath: e.string(),
|
|
117
117
|
threshold: e.number().min(0).max(1).optional()
|
|
118
|
-
})).superRefine(
|
|
118
|
+
})).superRefine(assertNoCollisions);
|
|
119
119
|
//#endregion
|
|
120
120
|
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorateMetadata.js
|
|
121
|
-
function
|
|
121
|
+
function __decorateMetadata(e, t) {
|
|
122
122
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
123
123
|
}
|
|
124
124
|
//#endregion
|
|
125
125
|
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorate.js
|
|
126
|
-
function
|
|
126
|
+
function __decorate(e, t, n, r) {
|
|
127
127
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
128
128
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
129
129
|
else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
|
|
@@ -131,7 +131,7 @@ function O(e, t, n, r) {
|
|
|
131
131
|
}
|
|
132
132
|
//#endregion
|
|
133
133
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input-options.service.ts
|
|
134
|
-
var
|
|
134
|
+
var S = class InputOptionsService {
|
|
135
135
|
constructor() {}
|
|
136
136
|
collectOneInput(e) {
|
|
137
137
|
let t = e.commandArguments[e.argumentIndex];
|
|
@@ -143,7 +143,7 @@ var k = class {
|
|
|
143
143
|
argumentIndex: e.argumentIndex,
|
|
144
144
|
commandArguments: e.commandArguments
|
|
145
145
|
});
|
|
146
|
-
return r === void 0 || i === void 0 ||
|
|
146
|
+
return r === void 0 || i === void 0 || h.has(n) ? 1 : (e.generatorInputs[r] = i, t.includes("=") ? 1 : 2);
|
|
147
147
|
}
|
|
148
148
|
readOptionName(e) {
|
|
149
149
|
return e.includes("=") ? e.slice(2).split("=", 1)[0] ?? "" : e.slice(2);
|
|
@@ -173,7 +173,7 @@ var k = class {
|
|
|
173
173
|
return t;
|
|
174
174
|
}
|
|
175
175
|
resolveTargetDirectoryPath(e) {
|
|
176
|
-
for (let t of
|
|
176
|
+
for (let t of _) {
|
|
177
177
|
let n = e.options[t];
|
|
178
178
|
if (typeof n == "string") return n;
|
|
179
179
|
}
|
|
@@ -185,10 +185,10 @@ var k = class {
|
|
|
185
185
|
return t.join(e.defaultGeneratedOutputDirectory ?? "generated", e.generatorName);
|
|
186
186
|
}
|
|
187
187
|
};
|
|
188
|
-
|
|
188
|
+
S = __decorate([n(), __decorateMetadata("design:paramtypes", [])], S);
|
|
189
189
|
//#endregion
|
|
190
190
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input-schema.service.ts
|
|
191
|
-
var
|
|
191
|
+
var C = class InputSchemaService {
|
|
192
192
|
constructor() {}
|
|
193
193
|
readSchemaProperty(e, t) {
|
|
194
194
|
if (typeof e == "object" && e) return Object.entries(e).find(([e]) => e === t)?.[1];
|
|
@@ -243,17 +243,17 @@ var A = class {
|
|
|
243
243
|
}) : r;
|
|
244
244
|
}
|
|
245
245
|
};
|
|
246
|
-
|
|
246
|
+
C = __decorate([n(), __decorateMetadata("design:paramtypes", [])], C);
|
|
247
247
|
//#endregion
|
|
248
248
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input-prompting.service.ts
|
|
249
|
-
var
|
|
249
|
+
var w = class InputPromptingService {
|
|
250
250
|
inputSchemaService;
|
|
251
251
|
constructor(e) {
|
|
252
252
|
this.inputSchemaService = e;
|
|
253
253
|
}
|
|
254
254
|
promptRunner = a;
|
|
255
255
|
assertCanPrompt(e) {
|
|
256
|
-
if (!this.isAtTerminal()) throw
|
|
256
|
+
if (!this.isAtTerminal()) throw missingInputError(e);
|
|
257
257
|
}
|
|
258
258
|
describeChoice(e) {
|
|
259
259
|
return {
|
|
@@ -309,10 +309,10 @@ var j = class {
|
|
|
309
309
|
return n.length === 0 ? void 0 : n;
|
|
310
310
|
}
|
|
311
311
|
};
|
|
312
|
-
|
|
312
|
+
w = __decorate([n(), __decorateMetadata("design:paramtypes", [C === void 0 ? Object : C])], w);
|
|
313
313
|
//#endregion
|
|
314
314
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input.service.ts
|
|
315
|
-
var
|
|
315
|
+
var T = class InputService {
|
|
316
316
|
inputOptionsService;
|
|
317
317
|
inputPromptingService;
|
|
318
318
|
inputSchemaService;
|
|
@@ -345,7 +345,7 @@ var M = class {
|
|
|
345
345
|
}
|
|
346
346
|
async resolveMissingValue(e) {
|
|
347
347
|
if (!this.inputPromptingService.isAtTerminal()) {
|
|
348
|
-
if (e.isRequired) throw
|
|
348
|
+
if (e.isRequired) throw missingInputError(e.inputName);
|
|
349
349
|
return;
|
|
350
350
|
}
|
|
351
351
|
let t = await this.inputPromptingService.promptForInput(e), n = this.inputSchemaService.validateValue({
|
|
@@ -393,59 +393,59 @@ var M = class {
|
|
|
393
393
|
});
|
|
394
394
|
}
|
|
395
395
|
};
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
])],
|
|
396
|
+
T = __decorate([n(), __decorateMetadata("design:paramtypes", [
|
|
397
|
+
S === void 0 ? Object : S,
|
|
398
|
+
w === void 0 ? Object : w,
|
|
399
|
+
C === void 0 ? Object : C
|
|
400
|
+
])], T);
|
|
401
401
|
//#endregion
|
|
402
402
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/input/input.module.ts
|
|
403
|
-
var
|
|
404
|
-
|
|
403
|
+
var E = class InputModule {};
|
|
404
|
+
E = __decorate([r({
|
|
405
405
|
controllers: [],
|
|
406
406
|
exports: [
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
407
|
+
S,
|
|
408
|
+
w,
|
|
409
|
+
T
|
|
410
410
|
],
|
|
411
411
|
imports: [],
|
|
412
412
|
providers: [
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
413
|
+
S,
|
|
414
|
+
w,
|
|
415
|
+
C,
|
|
416
|
+
T
|
|
417
417
|
]
|
|
418
|
-
})],
|
|
418
|
+
})], E);
|
|
419
419
|
//#endregion
|
|
420
420
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/instance-group/instance-group.service.ts
|
|
421
|
-
var
|
|
421
|
+
var D = class InstanceGroupService {
|
|
422
422
|
constructor() {}
|
|
423
423
|
isProjectScoped(e) {
|
|
424
424
|
return e.tags !== void 0 && e.tags.length > 0;
|
|
425
425
|
}
|
|
426
426
|
};
|
|
427
|
-
|
|
427
|
+
D = __decorate([n(), __decorateMetadata("design:paramtypes", [])], D);
|
|
428
428
|
//#endregion
|
|
429
429
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/instance-group/instance-group.module.ts
|
|
430
|
-
var
|
|
431
|
-
|
|
430
|
+
var O = class InstanceGroupModule {};
|
|
431
|
+
O = __decorate([r({
|
|
432
432
|
controllers: [],
|
|
433
|
-
exports: [
|
|
433
|
+
exports: [D],
|
|
434
434
|
imports: [],
|
|
435
|
-
providers: [
|
|
436
|
-
})],
|
|
435
|
+
providers: [D]
|
|
436
|
+
})], O);
|
|
437
437
|
//#endregion
|
|
438
438
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/rendering/rendering.constants.ts
|
|
439
|
-
var
|
|
439
|
+
var k = { escape: String }, MissingSubstitutionError = class extends Error {
|
|
440
440
|
constructor(e) {
|
|
441
441
|
let t = e.placeholders.map((e) => `{{${e}}}`).join(", ");
|
|
442
442
|
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
443
|
}
|
|
444
|
-
},
|
|
444
|
+
}, A = /conformetry[0-9a-f]{32}/g, j = "conformetry", M = class RenderingService {
|
|
445
445
|
constructor() {}
|
|
446
446
|
assertEverySubstitutionSupplied(e) {
|
|
447
447
|
let t = this.collectInterpolatedNames(e.template).filter((t) => !Object.hasOwn(e.substitutions, t));
|
|
448
|
-
if (t.length > 0) throw new
|
|
448
|
+
if (t.length > 0) throw new MissingSubstitutionError({
|
|
449
449
|
placeholders: t,
|
|
450
450
|
subject: e.subject
|
|
451
451
|
});
|
|
@@ -460,42 +460,42 @@ var I = { escape: String }, L = class extends Error {
|
|
|
460
460
|
};
|
|
461
461
|
}
|
|
462
462
|
collectInterpolatedNames(e) {
|
|
463
|
-
let t = /* @__PURE__ */ new Set(),
|
|
464
|
-
for (let
|
|
465
|
-
let e =
|
|
466
|
-
(e === "name" || e === "&") &&
|
|
463
|
+
let t = /* @__PURE__ */ new Set(), walk = (e) => {
|
|
464
|
+
for (let n of e) {
|
|
465
|
+
let e = n[0], r = n[1], i = n[4];
|
|
466
|
+
(e === "name" || e === "&") && r !== "." && t.add(r), Array.isArray(i) && walk(i);
|
|
467
467
|
}
|
|
468
468
|
};
|
|
469
|
-
return
|
|
469
|
+
return walk(o.parse(e)), [...t];
|
|
470
470
|
}
|
|
471
471
|
renderContent(e) {
|
|
472
472
|
return this.assertEverySubstitutionSupplied({
|
|
473
473
|
subject: e.subject ?? "a template file",
|
|
474
474
|
substitutions: e.substitutions,
|
|
475
475
|
template: e.templateContent
|
|
476
|
-
}), o.render(e.templateContent, e.substitutions, {},
|
|
476
|
+
}), o.render(e.templateContent, e.substitutions, {}, k);
|
|
477
477
|
}
|
|
478
478
|
renderPath(e) {
|
|
479
479
|
return this.assertEverySubstitutionSupplied({
|
|
480
480
|
subject: e.subject ?? e.templatePath,
|
|
481
481
|
substitutions: e.substitutions,
|
|
482
482
|
template: e.templatePath
|
|
483
|
-
}), o.render(e.templatePath, e.substitutions, {},
|
|
483
|
+
}), o.render(e.templatePath, e.substitutions, {}, k);
|
|
484
484
|
}
|
|
485
485
|
};
|
|
486
|
-
|
|
486
|
+
M = __decorate([n(), __decorateMetadata("design:paramtypes", [])], M);
|
|
487
487
|
//#endregion
|
|
488
488
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/rendering/rendering.module.ts
|
|
489
|
-
var
|
|
490
|
-
|
|
489
|
+
var N = class RenderingModule {};
|
|
490
|
+
N = __decorate([r({
|
|
491
491
|
controllers: [],
|
|
492
|
-
exports: [
|
|
492
|
+
exports: [M],
|
|
493
493
|
imports: [],
|
|
494
|
-
providers: [
|
|
495
|
-
})],
|
|
494
|
+
providers: [M]
|
|
495
|
+
})], N);
|
|
496
496
|
//#endregion
|
|
497
497
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/template-discovery/template-discovery.service.ts
|
|
498
|
-
var
|
|
498
|
+
var P = class TemplateDiscoveryService {
|
|
499
499
|
renderingService;
|
|
500
500
|
constructor(e) {
|
|
501
501
|
this.renderingService = e;
|
|
@@ -569,23 +569,23 @@ var H = class {
|
|
|
569
569
|
}));
|
|
570
570
|
}
|
|
571
571
|
};
|
|
572
|
-
|
|
572
|
+
P = __decorate([n(), __decorateMetadata("design:paramtypes", [M === void 0 ? Object : M])], P);
|
|
573
573
|
//#endregion
|
|
574
574
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/template-discovery/template-discovery.module.ts
|
|
575
|
-
var
|
|
576
|
-
|
|
575
|
+
var F = class TemplateDiscoveryModule {};
|
|
576
|
+
F = __decorate([r({
|
|
577
577
|
controllers: [],
|
|
578
|
-
exports: [
|
|
579
|
-
imports: [
|
|
580
|
-
providers: [
|
|
581
|
-
})],
|
|
578
|
+
exports: [P],
|
|
579
|
+
imports: [N],
|
|
580
|
+
providers: [P]
|
|
581
|
+
})], F);
|
|
582
582
|
//#endregion
|
|
583
583
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/instance-discovery/instance-discovery.constants.ts
|
|
584
|
-
var
|
|
584
|
+
var I = /\.[^.]+$/u, L = [
|
|
585
585
|
"*",
|
|
586
586
|
"?",
|
|
587
587
|
"]"
|
|
588
|
-
],
|
|
588
|
+
], R = class InstanceDiscoveryLocatingService {
|
|
589
589
|
constructor() {}
|
|
590
590
|
deriveLocationSubstitutions(e) {
|
|
591
591
|
let [n = ""] = t.relative(e.workingDirectory, t.join(e.instancePath, e.nameStem)).split(t.sep);
|
|
@@ -605,11 +605,11 @@ var W = /\.[^.]+$/u, G = [
|
|
|
605
605
|
return (e.exclude ?? []).some((e) => t.matchesGlob(n, e));
|
|
606
606
|
}
|
|
607
607
|
resolveGlobSuffix(e) {
|
|
608
|
-
let n = t.basename(e), r = Math.max(...
|
|
608
|
+
let n = t.basename(e), r = Math.max(...L.map((e) => n.lastIndexOf(e)));
|
|
609
609
|
return r === -1 ? "" : n.slice(r + 1);
|
|
610
610
|
}
|
|
611
611
|
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(
|
|
612
|
+
return e.isDirectory ? e.entryName : e.suffix !== "" && e.entryName.endsWith(e.suffix) ? e.entryName.slice(0, -e.suffix.length) : e.entryName.replace(I, "");
|
|
613
613
|
}
|
|
614
614
|
findInstances(e) {
|
|
615
615
|
let n = /* @__PURE__ */ new Map();
|
|
@@ -655,24 +655,24 @@ var W = /\.[^.]+$/u, G = [
|
|
|
655
655
|
});
|
|
656
656
|
}
|
|
657
657
|
};
|
|
658
|
-
|
|
658
|
+
R = __decorate([n(), __decorateMetadata("design:paramtypes", [])], R);
|
|
659
659
|
//#endregion
|
|
660
660
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/rendering/rendering.utilities.ts
|
|
661
|
-
function
|
|
662
|
-
let t = e.templateText.match(
|
|
661
|
+
function capturePlaceholderValues(e) {
|
|
662
|
+
let t = e.templateText.match(A) ?? [];
|
|
663
663
|
if (t.length === 0) return;
|
|
664
|
-
let n = i.escapeRegExp(e.templateText).replaceAll(
|
|
664
|
+
let n = i.escapeRegExp(e.templateText).replaceAll(A, String.raw`([\s\S]+?)`), r = RegExp(`^${n}$`, "u").exec(e.instanceText);
|
|
665
665
|
if (r === null) return;
|
|
666
666
|
let a = {};
|
|
667
667
|
for (let [e, n] of t.entries()) a[n] ??= r[e + 1] ?? "";
|
|
668
668
|
return a;
|
|
669
669
|
}
|
|
670
|
-
function
|
|
671
|
-
return `${
|
|
670
|
+
function createPlaceholderValue() {
|
|
671
|
+
return `${j}${l().replaceAll("-", "")}`;
|
|
672
672
|
}
|
|
673
673
|
//#endregion
|
|
674
674
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/instance-discovery/instance-discovery-matching.service.ts
|
|
675
|
-
var
|
|
675
|
+
var z = class InstanceDiscoveryMatchingService {
|
|
676
676
|
templateDiscoveryService;
|
|
677
677
|
renderingService;
|
|
678
678
|
constructor(e, t) {
|
|
@@ -682,7 +682,7 @@ var Y = class {
|
|
|
682
682
|
return e.matchRatio === t.matchRatio ? e.matchedFileCount === t.matchedFileCount ? e.template.name.localeCompare(t.template.name) : t.matchedFileCount - e.matchedFileCount : t.matchRatio - e.matchRatio;
|
|
683
683
|
}
|
|
684
684
|
fillPlaceholders(e) {
|
|
685
|
-
let t = Object.fromEntries((e.template.placeholderNames ?? []).filter((t) => !Object.hasOwn(e.substitutions, t)).map((e) => [e,
|
|
685
|
+
let t = Object.fromEntries((e.template.placeholderNames ?? []).filter((t) => !Object.hasOwn(e.substitutions, t)).map((e) => [e, createPlaceholderValue()]));
|
|
686
686
|
return {
|
|
687
687
|
placeholderValues: t,
|
|
688
688
|
substitutions: {
|
|
@@ -756,10 +756,10 @@ var Y = class {
|
|
|
756
756
|
}).filter((e) => e.matchedFileCount > 0 && e.matchRatio > 0).toSorted((e, t) => this.compareMatches(e, t));
|
|
757
757
|
}
|
|
758
758
|
};
|
|
759
|
-
|
|
759
|
+
z = __decorate([n(), __decorateMetadata("design:paramtypes", [P === void 0 ? Object : P, M === void 0 ? Object : M])], z);
|
|
760
760
|
//#endregion
|
|
761
761
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/instance-discovery/instance-discovery.service.ts
|
|
762
|
-
var
|
|
762
|
+
var B = class InstanceDiscoveryService {
|
|
763
763
|
instanceDiscoveryLocatingService;
|
|
764
764
|
instanceDiscoveryMatchingService;
|
|
765
765
|
instanceGroupService;
|
|
@@ -873,37 +873,37 @@ var X = class {
|
|
|
873
873
|
};
|
|
874
874
|
}
|
|
875
875
|
};
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
])],
|
|
876
|
+
B = __decorate([n(), __decorateMetadata("design:paramtypes", [
|
|
877
|
+
R === void 0 ? Object : R,
|
|
878
|
+
z === void 0 ? Object : z,
|
|
879
|
+
D === void 0 ? Object : D,
|
|
880
|
+
P === void 0 ? Object : P
|
|
881
|
+
])], B);
|
|
882
882
|
//#endregion
|
|
883
883
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/instance-discovery/instance-discovery.module.ts
|
|
884
|
-
var
|
|
885
|
-
|
|
884
|
+
var V = class InstanceDiscoveryModule {};
|
|
885
|
+
V = __decorate([r({
|
|
886
886
|
controllers: [],
|
|
887
887
|
exports: [
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
888
|
+
R,
|
|
889
|
+
z,
|
|
890
|
+
B,
|
|
891
|
+
F
|
|
892
892
|
],
|
|
893
893
|
imports: [
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
894
|
+
O,
|
|
895
|
+
N,
|
|
896
|
+
F
|
|
897
897
|
],
|
|
898
898
|
providers: [
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
899
|
+
R,
|
|
900
|
+
z,
|
|
901
|
+
B
|
|
902
902
|
]
|
|
903
|
-
})],
|
|
903
|
+
})], V);
|
|
904
904
|
//#endregion
|
|
905
905
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/configuration/configuration.service.ts
|
|
906
|
-
var
|
|
906
|
+
var H = class ConfigurationService {
|
|
907
907
|
inputPromptingService;
|
|
908
908
|
inputService;
|
|
909
909
|
instanceDiscoveryService;
|
|
@@ -926,7 +926,7 @@ var Q = class {
|
|
|
926
926
|
async findWorkspaceRoot() {
|
|
927
927
|
let e = t.resolve(process.cwd());
|
|
928
928
|
for (;;) try {
|
|
929
|
-
return await u(t.join(e,
|
|
929
|
+
return await u(t.join(e, v)), e;
|
|
930
930
|
} catch {
|
|
931
931
|
let n = t.dirname(e);
|
|
932
932
|
if (n === e) return;
|
|
@@ -935,14 +935,14 @@ var Q = class {
|
|
|
935
935
|
}
|
|
936
936
|
async loadConfigurationModule(e) {
|
|
937
937
|
if (e.extension === ".json" || e.extension === ".jsonc") return this.loadJsonConfiguration(e);
|
|
938
|
-
let t = await f(
|
|
938
|
+
let t = await p(f(import.meta.url)).import(e.configurationPath, { default: !0 });
|
|
939
939
|
if (typeof t != "object" || !t) return [];
|
|
940
940
|
let n = t.default;
|
|
941
941
|
return typeof n == "object" && n ? n : t;
|
|
942
942
|
}
|
|
943
943
|
async loadJsonConfiguration(e) {
|
|
944
|
-
let t = await
|
|
945
|
-
return e.extension === ".jsonc" ?
|
|
944
|
+
let t = await d(e.configurationPath, "utf8");
|
|
945
|
+
return e.extension === ".jsonc" ? m(t) : JSON.parse(t);
|
|
946
946
|
}
|
|
947
947
|
async resolveConfigurationPath(e) {
|
|
948
948
|
let n = t.resolve(e);
|
|
@@ -972,12 +972,12 @@ var Q = class {
|
|
|
972
972
|
}
|
|
973
973
|
async loadConformetryConfiguration(e) {
|
|
974
974
|
let n = await this.resolveConfigurationPath(e), r = t.extname(n).toLowerCase();
|
|
975
|
-
if (!
|
|
975
|
+
if (!y.has(r)) throw new UnknownConfigurationFileTypeError(n);
|
|
976
976
|
let i = await this.loadConfigurationModule({
|
|
977
977
|
configurationPath: n,
|
|
978
978
|
extension: r
|
|
979
979
|
});
|
|
980
|
-
return
|
|
980
|
+
return x.parse(i).map((e) => this.applyGeneratorDefaults(e));
|
|
981
981
|
}
|
|
982
982
|
matchInstances(e) {
|
|
983
983
|
return this.instanceDiscoveryService.matchInstances(e);
|
|
@@ -1022,28 +1022,28 @@ var Q = class {
|
|
|
1022
1022
|
return this.instanceDiscoveryService.resolveInventoriedTemplates(e);
|
|
1023
1023
|
}
|
|
1024
1024
|
};
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
X === void 0 ? Object : X,
|
|
1029
|
-
P === void 0 ? Object : P,
|
|
1025
|
+
H = __decorate([n(), __decorateMetadata("design:paramtypes", [
|
|
1026
|
+
w === void 0 ? Object : w,
|
|
1027
|
+
T === void 0 ? Object : T,
|
|
1030
1028
|
B === void 0 ? Object : B,
|
|
1031
|
-
|
|
1032
|
-
|
|
1029
|
+
D === void 0 ? Object : D,
|
|
1030
|
+
M === void 0 ? Object : M,
|
|
1031
|
+
P === void 0 ? Object : P
|
|
1032
|
+
])], H);
|
|
1033
1033
|
//#endregion
|
|
1034
1034
|
//#region packages/ic-suite/conformetry/conformetry-configuration/src/modules/configuration/configuration.module.ts
|
|
1035
|
-
var
|
|
1036
|
-
|
|
1035
|
+
var U = class ConfigurationModule {};
|
|
1036
|
+
U = __decorate([r({
|
|
1037
1037
|
controllers: [],
|
|
1038
|
-
exports: [
|
|
1038
|
+
exports: [H],
|
|
1039
1039
|
imports: [
|
|
1040
|
-
|
|
1041
|
-
Z,
|
|
1042
|
-
F,
|
|
1040
|
+
E,
|
|
1043
1041
|
V,
|
|
1044
|
-
|
|
1042
|
+
O,
|
|
1043
|
+
N,
|
|
1044
|
+
F
|
|
1045
1045
|
],
|
|
1046
|
-
providers: [
|
|
1047
|
-
})],
|
|
1046
|
+
providers: [H]
|
|
1047
|
+
})], U);
|
|
1048
1048
|
//#endregion
|
|
1049
|
-
export {
|
|
1049
|
+
export { g as ALL_TEMPLATES_SELECTION, U as ConfigurationModule, H as ConfigurationService, InputError, MissingSubstitutionError, UnknownConfigurationFileTypeError, capturePlaceholderValues, createPlaceholderValue, 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.10",
|
|
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.11"
|
|
71
71
|
}
|