@conformetry/cli 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 +20 -0
- package/README.md +8 -8
- package/dist/{main.module-rxiDQ87q.js → main.module-D7s1s-1a.js} +194 -191
- package/dist/src/index.js +1 -1
- package/dist/src/main.js +3 -3
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## 0.0.11 (2026-10-08)
|
|
2
|
+
|
|
3
|
+
### 🧱 Updated Dependencies
|
|
4
|
+
|
|
5
|
+
- Updated conformetry-configuration to 0.0.12
|
|
6
|
+
- Updated conformetry-generation to 0.0.12
|
|
7
|
+
- Updated conformetry-validation to 0.0.11
|
|
8
|
+
- Updated conformetry-output to 0.0.11
|
|
9
|
+
- Updated conformetry-core to 0.0.11
|
|
10
|
+
|
|
11
|
+
## 0.0.10 (2026-10-08)
|
|
12
|
+
|
|
13
|
+
### 🧱 Updated Dependencies
|
|
14
|
+
|
|
15
|
+
- Updated conformetry-configuration to 0.0.11
|
|
16
|
+
- Updated conformetry-generation to 0.0.11
|
|
17
|
+
- Updated conformetry-validation to 0.0.10
|
|
18
|
+
- Updated conformetry-output to 0.0.10
|
|
19
|
+
- Updated conformetry-core to 0.0.10
|
|
20
|
+
|
|
1
21
|
## 0.0.9 (2026-10-08)
|
|
2
22
|
|
|
3
23
|
### 🧱 Updated Dependencies
|
package/README.md
CHANGED
|
@@ -1095,13 +1095,13 @@ graph LR
|
|
|
1095
1095
|
### Project
|
|
1096
1096
|
|
|
1097
1097
|

|
|
1098
|
-

|
|
1099
1099
|

|
|
1100
1100
|

|
|
1101
1101
|
|
|
1102
1102
|
### Measured Targets
|
|
1103
1103
|
|
|
1104
|
-

|
|
1105
1105
|
|
|
1106
1106
|
### TypeScript
|
|
1107
1107
|
|
|
@@ -1283,16 +1283,16 @@ graph LR
|
|
|
1283
1283
|
### Markdown
|
|
1284
1284
|
|
|
1285
1285
|

|
|
1286
|
-

|
|
1287
1287
|

|
|
1288
|
-

|
|
1289
|
+

|
|
1290
1290
|

|
|
1291
1291
|

|
|
1292
1292
|

|
|
1293
|
-

|
|
1294
|
+

|
|
1295
|
+

|
|
1296
1296
|

|
|
1297
1297
|

|
|
1298
1298
|

|
|
@@ -4,14 +4,17 @@ import { DiscoveryModule as o } from "@nestjs/core";
|
|
|
4
4
|
import { existsSync as s, mkdirSync as c } from "node:fs";
|
|
5
5
|
import l from "node:path";
|
|
6
6
|
import u from "pino";
|
|
7
|
-
import { z as
|
|
8
|
-
import { ALL_TEMPLATES_SELECTION as
|
|
9
|
-
import { GenerationModule as
|
|
10
|
-
import { Command as
|
|
11
|
-
import { InventoryModule as
|
|
12
|
-
import { ValidationModule as
|
|
13
|
-
//#region
|
|
14
|
-
var
|
|
7
|
+
import { z as d } from "zod";
|
|
8
|
+
import { ALL_TEMPLATES_SELECTION as f, ConfigurationModule as p, ConfigurationService as m, InputError as h } from "@conformetry/configuration";
|
|
9
|
+
import { GenerationModule as g, GenerationService as _ } from "@conformetry/generation";
|
|
10
|
+
import { Command as v, CommandRunner as y, Option as b } from "nest-commander";
|
|
11
|
+
import { InventoryModule as x, InventoryService as S, ReportingModule as C, ReportingService as w } from "@conformetry/output";
|
|
12
|
+
import { ValidationModule as T, ValidationService as E } from "@conformetry/validation";
|
|
13
|
+
//#region \0rolldown/runtime.js
|
|
14
|
+
var D = Object.defineProperty, __name = (e, t) => D(e, "name", {
|
|
15
|
+
value: t,
|
|
16
|
+
configurable: !0
|
|
17
|
+
}), O = /^(\p{Extended_Pictographic}️?(?:\p{Extended_Pictographic}️?)*)\s+/u, k = /^([A-Za-z]+)/, A = /* @__PURE__ */ new Set([
|
|
15
18
|
"built",
|
|
16
19
|
"cut",
|
|
17
20
|
"found",
|
|
@@ -29,7 +32,7 @@ var T = /^(\p{Extended_Pictographic}️?(?:\p{Extended_Pictographic}️?)*)\s
|
|
|
29
32
|
"split",
|
|
30
33
|
"took",
|
|
31
34
|
"wrote"
|
|
32
|
-
]),
|
|
35
|
+
]), j = /* @__PURE__ */ new Set([
|
|
33
36
|
"CommandFactory",
|
|
34
37
|
"ExceptionHandler",
|
|
35
38
|
"GraphQLModule",
|
|
@@ -42,12 +45,12 @@ var T = /^(\p{Extended_Pictographic}️?(?:\p{Extended_Pictographic}️?)*)\s
|
|
|
42
45
|
]);
|
|
43
46
|
//#endregion
|
|
44
47
|
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorateMetadata.js
|
|
45
|
-
function
|
|
48
|
+
function __decorateMetadata(e, t) {
|
|
46
49
|
if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
|
|
47
50
|
}
|
|
48
51
|
//#endregion
|
|
49
52
|
//#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorate.js
|
|
50
|
-
function
|
|
53
|
+
function __decorate(e, t, n, r) {
|
|
51
54
|
var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
|
|
52
55
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
|
|
53
56
|
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);
|
|
@@ -55,9 +58,9 @@ function A(e, t, n, r) {
|
|
|
55
58
|
}
|
|
56
59
|
//#endregion
|
|
57
60
|
//#region packages/logging/src/modules/logger/logger.service.ts
|
|
58
|
-
var
|
|
61
|
+
var M, N = class LoggerService extends e {
|
|
59
62
|
static {
|
|
60
|
-
|
|
63
|
+
M = this;
|
|
61
64
|
}
|
|
62
65
|
constructor() {
|
|
63
66
|
super();
|
|
@@ -65,15 +68,15 @@ var j, M = class extends e {
|
|
|
65
68
|
static isProduction = process.env.NODE_ENV === "production";
|
|
66
69
|
static rootLogger;
|
|
67
70
|
static writesToStandardError = !1;
|
|
68
|
-
child =
|
|
71
|
+
child = M.root;
|
|
69
72
|
static createRootLogger() {
|
|
70
73
|
let e = process.env.LOG_LEVEL ?? "info";
|
|
71
|
-
return
|
|
74
|
+
return M.isProduction ? M.writesToStandardError ? u({ level: e }, u.destination(2)) : u({ level: e }) : u({
|
|
72
75
|
level: e,
|
|
73
76
|
transport: {
|
|
74
77
|
options: {
|
|
75
78
|
colorize: !0,
|
|
76
|
-
destination:
|
|
79
|
+
destination: M.writesToStandardError ? 2 : 1,
|
|
77
80
|
ignore: "pid,hostname,emoji",
|
|
78
81
|
messageFormat: "{emoji} {msg}",
|
|
79
82
|
singleLine: !0
|
|
@@ -83,14 +86,14 @@ var j, M = class extends e {
|
|
|
83
86
|
});
|
|
84
87
|
}
|
|
85
88
|
static logToStandardError() {
|
|
86
|
-
if (
|
|
89
|
+
if (M.rootLogger !== void 0) {
|
|
87
90
|
process.emitWarning("LoggerService.logToStandardError() was called after the first log line, so log lines still go to standard output and anything piping that stream will read them as data. Call it as the first statement of the application's bootstrap.");
|
|
88
91
|
return;
|
|
89
92
|
}
|
|
90
|
-
|
|
93
|
+
M.writesToStandardError = !0;
|
|
91
94
|
}
|
|
92
95
|
assertConventionalMessage(e) {
|
|
93
|
-
if (
|
|
96
|
+
if (M.isProduction || this.shouldSkipConventionalMessageValidation(e.context)) return;
|
|
94
97
|
let t = this.getConventionalMessageViolation(e.parsed);
|
|
95
98
|
if (t !== void 0) throw Error(t);
|
|
96
99
|
}
|
|
@@ -101,21 +104,21 @@ var j, M = class extends e {
|
|
|
101
104
|
}), {
|
|
102
105
|
...e.data,
|
|
103
106
|
context: e.context,
|
|
104
|
-
...
|
|
107
|
+
...M.isProduction ? {} : { emoji: e.parsed.emoji }
|
|
105
108
|
};
|
|
106
109
|
}
|
|
107
110
|
getConventionalMessageViolation(e) {
|
|
108
111
|
let t = e.emoji, n = e.text;
|
|
109
112
|
if (t === void 0) return `Log message must start with an emoji naming its subject, then a verb: "${n}"`;
|
|
110
|
-
let r =
|
|
113
|
+
let r = k.exec(n)?.[1];
|
|
111
114
|
if (r === void 0 || !this.isConventionalVerb(r)) return `Log message must begin with a verb in present progressive or past tense, got "${r ?? ""}": "${t} ${n}"`;
|
|
112
115
|
}
|
|
113
116
|
isConventionalVerb(e) {
|
|
114
117
|
let t = e.toLowerCase();
|
|
115
|
-
return t.endsWith("ing") || t.endsWith("ed") ||
|
|
118
|
+
return t.endsWith("ing") || t.endsWith("ed") || A.has(t);
|
|
116
119
|
}
|
|
117
120
|
parseMessage(e) {
|
|
118
|
-
let t = String(e), n =
|
|
121
|
+
let t = String(e), n = O.exec(t), r = n?.[1];
|
|
119
122
|
return r === void 0 ? {
|
|
120
123
|
emoji: void 0,
|
|
121
124
|
text: t
|
|
@@ -125,10 +128,10 @@ var j, M = class extends e {
|
|
|
125
128
|
};
|
|
126
129
|
}
|
|
127
130
|
shouldSkipConventionalMessageValidation(e) {
|
|
128
|
-
return e !== void 0 &&
|
|
131
|
+
return e !== void 0 && j.has(e);
|
|
129
132
|
}
|
|
130
133
|
static get root() {
|
|
131
|
-
return
|
|
134
|
+
return M.rootLogger ??= M.createRootLogger(), M.rootLogger;
|
|
132
135
|
}
|
|
133
136
|
buildErrorLogEntry(e, t) {
|
|
134
137
|
let n = t instanceof Error ? t.stack || t.message : String(t);
|
|
@@ -172,7 +175,7 @@ var j, M = class extends e {
|
|
|
172
175
|
this.info(e, t, n);
|
|
173
176
|
}
|
|
174
177
|
setContext(e) {
|
|
175
|
-
super.setContext(e), this.child =
|
|
178
|
+
super.setContext(e), this.child = M.root.child({ context: e });
|
|
176
179
|
}
|
|
177
180
|
verbose(e, t, n) {
|
|
178
181
|
let r = this.parseMessage(e);
|
|
@@ -191,22 +194,22 @@ var j, M = class extends e {
|
|
|
191
194
|
}), r.text);
|
|
192
195
|
}
|
|
193
196
|
};
|
|
194
|
-
|
|
197
|
+
N = M = __decorate([n({ scope: i.TRANSIENT }), __decorateMetadata("design:paramtypes", [])], N);
|
|
195
198
|
//#endregion
|
|
196
199
|
//#region packages/logging/src/modules/logger/logger.module.ts
|
|
197
|
-
var
|
|
198
|
-
|
|
200
|
+
var P = class LoggerModule {};
|
|
201
|
+
P = __decorate([t(), r({
|
|
199
202
|
controllers: [],
|
|
200
|
-
exports: [
|
|
203
|
+
exports: [N],
|
|
201
204
|
imports: [],
|
|
202
|
-
providers: [
|
|
203
|
-
})],
|
|
204
|
-
var
|
|
205
|
+
providers: [N]
|
|
206
|
+
})], P);
|
|
207
|
+
var unknownTemplateError = (e) => /* @__PURE__ */ Error(`Unknown template "${e.templateName}". Available: ${e.availableTemplateNames.join(", ")}`), removedGeneratorOptionError = () => /* @__PURE__ */ Error("--generator was removed. Pass --template instead: it is the word the configuration, the templates command, and the conformance report already use."), F = d.object({}), missingTemplateError = (e) => new h(`No template was selected. Pass --template. Available: ${e.join(", ")}`), I, L = I = class GenerateCommand extends y {
|
|
205
208
|
configurationService;
|
|
206
209
|
generationService;
|
|
207
210
|
logger;
|
|
208
211
|
constructor(e, t, n) {
|
|
209
|
-
super(), this.configurationService = e, this.generationService = t, this.logger = n, this.logger.setContext(
|
|
212
|
+
super(), this.configurationService = e, this.generationService = t, this.logger = n, this.logger.setContext(I.name);
|
|
210
213
|
}
|
|
211
214
|
async generate(e, t) {
|
|
212
215
|
let n = [...e, ...process.argv.slice(2)];
|
|
@@ -217,7 +220,7 @@ var P = (e) => /* @__PURE__ */ Error(`Unknown template "${e.templateName}". Avai
|
|
|
217
220
|
});
|
|
218
221
|
this.logger.debug("🏗 Generating a conformetry instance", void 0, { template: i });
|
|
219
222
|
let a = r.find((e) => e.name === i);
|
|
220
|
-
if (a === void 0) throw this.logger.error("🚫 Rejected an unknown template", void 0, { template: i }),
|
|
223
|
+
if (a === void 0) throw this.logger.error("🚫 Rejected an unknown template", void 0, { template: i }), unknownTemplateError({
|
|
221
224
|
availableTemplateNames: r.map((e) => e.name),
|
|
222
225
|
templateName: i
|
|
223
226
|
});
|
|
@@ -244,14 +247,14 @@ var P = (e) => /* @__PURE__ */ Error(`Unknown template "${e.templateName}". Avai
|
|
|
244
247
|
this.logger.error("🚫 Rejected the command line", void 0, { reason: e.message }), process.exitCode = 1;
|
|
245
248
|
}
|
|
246
249
|
rejectRemovedGeneratorOption(e) {
|
|
247
|
-
if (e.some((e) => e === "--generator" || e.startsWith("--generator="))) throw this.logger.error("🚫 Rejected a removed option", void 0, { option: "--generator" }),
|
|
250
|
+
if (e.some((e) => e === "--generator" || e.startsWith("--generator="))) throw this.logger.error("🚫 Rejected a removed option", void 0, { option: "--generator" }), removedGeneratorOptionError();
|
|
248
251
|
}
|
|
249
252
|
async resolveTemplateName(e) {
|
|
250
253
|
if (e.templateName !== void 0) return e.templateName;
|
|
251
254
|
let t = e.configuration.map((e) => e.name);
|
|
252
|
-
if (!this.configurationService.isAtTerminal()) throw
|
|
255
|
+
if (!this.configurationService.isAtTerminal()) throw missingTemplateError(t);
|
|
253
256
|
let n = await this.configurationService.promptForTemplate(e.configuration);
|
|
254
|
-
if (n === void 0) throw
|
|
257
|
+
if (n === void 0) throw missingTemplateError(t);
|
|
255
258
|
return n;
|
|
256
259
|
}
|
|
257
260
|
parseConfig(e) {
|
|
@@ -267,69 +270,69 @@ var P = (e) => /* @__PURE__ */ Error(`Unknown template "${e.templateName}". Avai
|
|
|
267
270
|
try {
|
|
268
271
|
await this.generate(e, t);
|
|
269
272
|
} catch (e) {
|
|
270
|
-
if (!(e instanceof
|
|
273
|
+
if (!(e instanceof h)) throw e;
|
|
271
274
|
this.rejectCommandLine(e);
|
|
272
275
|
}
|
|
273
276
|
}
|
|
274
277
|
};
|
|
275
|
-
|
|
276
|
-
|
|
278
|
+
__decorate([
|
|
279
|
+
b({
|
|
277
280
|
description: "Path to the conformetry configuration file",
|
|
278
281
|
flags: "--config [path]"
|
|
279
282
|
}),
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
],
|
|
284
|
-
|
|
283
|
+
__decorateMetadata("design:type", Function),
|
|
284
|
+
__decorateMetadata("design:paramtypes", [Object]),
|
|
285
|
+
__decorateMetadata("design:returntype", Object)
|
|
286
|
+
], L.prototype, "parseConfig", null), __decorate([
|
|
287
|
+
b({
|
|
285
288
|
description: "Directory to write generated files into",
|
|
286
289
|
flags: "--directory [path]"
|
|
287
290
|
}),
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
],
|
|
292
|
-
|
|
291
|
+
__decorateMetadata("design:type", Function),
|
|
292
|
+
__decorateMetadata("design:paramtypes", [Object]),
|
|
293
|
+
__decorateMetadata("design:returntype", Object)
|
|
294
|
+
], L.prototype, "parseDirectory", null), __decorate([
|
|
295
|
+
b({
|
|
293
296
|
description: "Name of the template to render",
|
|
294
297
|
flags: "--template [name]"
|
|
295
298
|
}),
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
],
|
|
300
|
-
|
|
299
|
+
__decorateMetadata("design:type", Function),
|
|
300
|
+
__decorateMetadata("design:paramtypes", [Object]),
|
|
301
|
+
__decorateMetadata("design:returntype", Object)
|
|
302
|
+
], L.prototype, "parseTemplate", null), L = I = __decorate([
|
|
303
|
+
v({
|
|
301
304
|
allowUnknownOptions: !0,
|
|
302
305
|
description: "Render a template into a new instance",
|
|
303
306
|
name: "generate"
|
|
304
307
|
}),
|
|
305
308
|
n(),
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
309
|
+
__decorateMetadata("design:paramtypes", [
|
|
310
|
+
m === void 0 ? Object : m,
|
|
311
|
+
_ === void 0 ? Object : _,
|
|
312
|
+
N === void 0 ? Object : N
|
|
310
313
|
])
|
|
311
|
-
],
|
|
314
|
+
], L);
|
|
312
315
|
//#endregion
|
|
313
316
|
//#region packages/ic-suite/conformetry/conformetry-cli/src/modules/generate/generate.module.ts
|
|
314
|
-
var
|
|
315
|
-
|
|
317
|
+
var R = class GenerateModule {};
|
|
318
|
+
R = __decorate([r({
|
|
316
319
|
controllers: [],
|
|
317
|
-
exports: [
|
|
320
|
+
exports: [L],
|
|
318
321
|
imports: [
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
+
p,
|
|
323
|
+
g,
|
|
324
|
+
P
|
|
322
325
|
],
|
|
323
|
-
providers: [
|
|
324
|
-
})],
|
|
326
|
+
providers: [L]
|
|
327
|
+
})], R);
|
|
325
328
|
//#endregion
|
|
326
329
|
//#region packages/ic-suite/conformetry/conformetry-cli/src/modules/instances/instances.constants.ts
|
|
327
|
-
var
|
|
330
|
+
var z = "No instances were found. Check the instance globs in the configuration.", B = "No instance is explained by those templates.", V, H = V = class InstancesCommand extends y {
|
|
328
331
|
configurationService;
|
|
329
332
|
inventoryService;
|
|
330
333
|
logger;
|
|
331
334
|
constructor(e, t, n) {
|
|
332
|
-
super(), this.configurationService = e, this.inventoryService = t, this.logger = n, this.logger.setContext(
|
|
335
|
+
super(), this.configurationService = e, this.inventoryService = t, this.logger = n, this.logger.setContext(V.name);
|
|
333
336
|
}
|
|
334
337
|
parseConfig(e) {
|
|
335
338
|
return this.configurationService.parseOptionalOption(e);
|
|
@@ -355,69 +358,69 @@ var ne = "No instances were found. Check the instance globs in the configuration
|
|
|
355
358
|
return;
|
|
356
359
|
}
|
|
357
360
|
if (i.length === 0) {
|
|
358
|
-
console.info(t.templates === void 0 ?
|
|
361
|
+
console.info(t.templates === void 0 ? z : B);
|
|
359
362
|
return;
|
|
360
363
|
}
|
|
361
364
|
console.info(this.inventoryService.describeInstances(i).join("\n"));
|
|
362
365
|
}
|
|
363
366
|
};
|
|
364
|
-
|
|
365
|
-
|
|
367
|
+
__decorate([
|
|
368
|
+
b({
|
|
366
369
|
description: "Path to the conformetry configuration file",
|
|
367
370
|
flags: "--config [path]"
|
|
368
371
|
}),
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
],
|
|
373
|
-
|
|
372
|
+
__decorateMetadata("design:type", Function),
|
|
373
|
+
__decorateMetadata("design:paramtypes", [Object]),
|
|
374
|
+
__decorateMetadata("design:returntype", Object)
|
|
375
|
+
], H.prototype, "parseConfig", null), __decorate([
|
|
376
|
+
b({
|
|
374
377
|
description: "Write the listing as JSON",
|
|
375
378
|
flags: "--json"
|
|
376
379
|
}),
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
],
|
|
381
|
-
|
|
380
|
+
__decorateMetadata("design:type", Function),
|
|
381
|
+
__decorateMetadata("design:paramtypes", []),
|
|
382
|
+
__decorateMetadata("design:returntype", Boolean)
|
|
383
|
+
], H.prototype, "parseJson", null), __decorate([
|
|
384
|
+
b({
|
|
382
385
|
description: "Comma-separated template names; report only the instances they explain",
|
|
383
386
|
flags: "--templates [names]"
|
|
384
387
|
}),
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
],
|
|
389
|
-
|
|
388
|
+
__decorateMetadata("design:type", Function),
|
|
389
|
+
__decorateMetadata("design:paramtypes", [Object]),
|
|
390
|
+
__decorateMetadata("design:returntype", Object)
|
|
391
|
+
], H.prototype, "parseTemplates", null), H = V = __decorate([
|
|
392
|
+
v({
|
|
390
393
|
description: "List the generated code the configuration finds, and what explains it",
|
|
391
394
|
name: "instances"
|
|
392
395
|
}),
|
|
393
396
|
n(),
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
397
|
+
__decorateMetadata("design:paramtypes", [
|
|
398
|
+
m === void 0 ? Object : m,
|
|
399
|
+
S === void 0 ? Object : S,
|
|
400
|
+
N === void 0 ? Object : N
|
|
398
401
|
])
|
|
399
|
-
],
|
|
402
|
+
], H);
|
|
400
403
|
//#endregion
|
|
401
404
|
//#region packages/ic-suite/conformetry/conformetry-cli/src/modules/instances/instances.module.ts
|
|
402
|
-
var
|
|
403
|
-
|
|
405
|
+
var U = class InstancesModule {};
|
|
406
|
+
U = __decorate([r({
|
|
404
407
|
controllers: [],
|
|
405
|
-
exports: [
|
|
408
|
+
exports: [H],
|
|
406
409
|
imports: [
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
+
p,
|
|
411
|
+
x,
|
|
412
|
+
P
|
|
410
413
|
],
|
|
411
|
-
providers: [
|
|
412
|
-
})],
|
|
414
|
+
providers: [H]
|
|
415
|
+
})], U);
|
|
413
416
|
//#endregion
|
|
414
417
|
//#region packages/ic-suite/conformetry/conformetry-cli/src/modules/templates/templates.constants.ts
|
|
415
|
-
var
|
|
418
|
+
var W = "No templates are declared in the configuration.", G = "No template explains those paths. Either they are not generated code, or they have drifted past recognition.", K, q = K = class TemplatesCommand extends y {
|
|
416
419
|
configurationService;
|
|
417
420
|
inventoryService;
|
|
418
421
|
logger;
|
|
419
422
|
constructor(e, t, n) {
|
|
420
|
-
super(), this.configurationService = e, this.inventoryService = t, this.logger = n, this.logger.setContext(
|
|
423
|
+
super(), this.configurationService = e, this.inventoryService = t, this.logger = n, this.logger.setContext(K.name);
|
|
421
424
|
}
|
|
422
425
|
parseConfig(e) {
|
|
423
426
|
return this.configurationService.parseOptionalOption(e);
|
|
@@ -443,7 +446,7 @@ var G = "No templates are declared in the configuration.", K = "No template expl
|
|
|
443
446
|
return;
|
|
444
447
|
}
|
|
445
448
|
if (i.length === 0) {
|
|
446
|
-
console.info(t.instances === void 0 ?
|
|
449
|
+
console.info(t.instances === void 0 ? W : G);
|
|
447
450
|
return;
|
|
448
451
|
}
|
|
449
452
|
console.info(this.inventoryService.describeTemplates({
|
|
@@ -452,64 +455,64 @@ var G = "No templates are declared in the configuration.", K = "No template expl
|
|
|
452
455
|
}).join("\n"));
|
|
453
456
|
}
|
|
454
457
|
};
|
|
455
|
-
|
|
456
|
-
|
|
458
|
+
__decorate([
|
|
459
|
+
b({
|
|
457
460
|
description: "Path to the conformetry configuration file",
|
|
458
461
|
flags: "--config [path]"
|
|
459
462
|
}),
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
],
|
|
464
|
-
|
|
463
|
+
__decorateMetadata("design:type", Function),
|
|
464
|
+
__decorateMetadata("design:paramtypes", [Object]),
|
|
465
|
+
__decorateMetadata("design:returntype", Object)
|
|
466
|
+
], q.prototype, "parseConfig", null), __decorate([
|
|
467
|
+
b({
|
|
465
468
|
description: "Comma-separated paths or globs; report only the templates that explain them",
|
|
466
469
|
flags: "--instances [globs]"
|
|
467
470
|
}),
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
],
|
|
472
|
-
|
|
471
|
+
__decorateMetadata("design:type", Function),
|
|
472
|
+
__decorateMetadata("design:paramtypes", [Object]),
|
|
473
|
+
__decorateMetadata("design:returntype", Object)
|
|
474
|
+
], q.prototype, "parseInstances", null), __decorate([
|
|
475
|
+
b({
|
|
473
476
|
description: "Write the listing as JSON",
|
|
474
477
|
flags: "--json"
|
|
475
478
|
}),
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
],
|
|
480
|
-
|
|
479
|
+
__decorateMetadata("design:type", Function),
|
|
480
|
+
__decorateMetadata("design:paramtypes", []),
|
|
481
|
+
__decorateMetadata("design:returntype", Boolean)
|
|
482
|
+
], q.prototype, "parseJson", null), q = K = __decorate([
|
|
483
|
+
v({
|
|
481
484
|
description: "Name the templates the configuration declares, or which ones explain a path",
|
|
482
485
|
name: "templates"
|
|
483
486
|
}),
|
|
484
487
|
n(),
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
488
|
+
__decorateMetadata("design:paramtypes", [
|
|
489
|
+
m === void 0 ? Object : m,
|
|
490
|
+
S === void 0 ? Object : S,
|
|
491
|
+
N === void 0 ? Object : N
|
|
489
492
|
])
|
|
490
|
-
],
|
|
493
|
+
], q);
|
|
491
494
|
//#endregion
|
|
492
495
|
//#region packages/ic-suite/conformetry/conformetry-cli/src/modules/templates/templates.module.ts
|
|
493
|
-
var
|
|
494
|
-
|
|
496
|
+
var J = class TemplatesModule {};
|
|
497
|
+
J = __decorate([r({
|
|
495
498
|
controllers: [],
|
|
496
|
-
exports: [
|
|
499
|
+
exports: [q],
|
|
497
500
|
imports: [
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
+
p,
|
|
502
|
+
x,
|
|
503
|
+
P
|
|
501
504
|
],
|
|
502
|
-
providers: [
|
|
503
|
-
})],
|
|
505
|
+
providers: [q]
|
|
506
|
+
})], J);
|
|
504
507
|
//#endregion
|
|
505
508
|
//#region packages/ic-suite/conformetry/conformetry-cli/src/modules/validate/validate.command.ts
|
|
506
|
-
var
|
|
509
|
+
var Y, X = Y = class ValidateCommand extends y {
|
|
507
510
|
configurationService;
|
|
508
511
|
reportingService;
|
|
509
512
|
validationService;
|
|
510
513
|
logger;
|
|
511
514
|
constructor(e, t, n, r) {
|
|
512
|
-
super(), this.configurationService = e, this.reportingService = t, this.validationService = n, this.logger = r, this.logger.setContext(
|
|
515
|
+
super(), this.configurationService = e, this.reportingService = t, this.validationService = n, this.logger = r, this.logger.setContext(Y.name);
|
|
513
516
|
}
|
|
514
517
|
describeFailure(e) {
|
|
515
518
|
return `Validation failed: ${[...e.scores.filter((e) => !e.ok).map((e) => `${e.instancePath} scored ${this.reportingService.formatPercentage(e.score)} against ${e.templateName} (threshold ${this.reportingService.formatPercentage(e.threshold)})`), ...e.unmatched.length === 0 ? [] : [`${String(e.unmatched.length)} instance(s) matched no template`]].join("; ")}.`;
|
|
@@ -569,9 +572,9 @@ var X, Z = X = class extends v {
|
|
|
569
572
|
}
|
|
570
573
|
async selectTemplates(e) {
|
|
571
574
|
let t = e.templateNames ?? await this.promptForTemplateNames(e.configuration);
|
|
572
|
-
if (!(t === void 0 || t.includes(
|
|
575
|
+
if (!(t === void 0 || t.includes(f))) return t.map((t) => {
|
|
573
576
|
let n = e.configuration.find((e) => e.name === t);
|
|
574
|
-
if (n === void 0) throw this.logger.error("🚫 Rejected an unknown template", void 0, { template: t }),
|
|
577
|
+
if (n === void 0) throw this.logger.error("🚫 Rejected an unknown template", void 0, { template: t }), unknownTemplateError({
|
|
575
578
|
availableTemplateNames: e.configuration.map((e) => e.name),
|
|
576
579
|
templateName: t
|
|
577
580
|
});
|
|
@@ -623,88 +626,88 @@ var X, Z = X = class extends v {
|
|
|
623
626
|
});
|
|
624
627
|
}
|
|
625
628
|
};
|
|
626
|
-
|
|
627
|
-
|
|
629
|
+
__decorate([
|
|
630
|
+
b({
|
|
628
631
|
description: "Path to the conformetry configuration file",
|
|
629
632
|
flags: "--config [path]"
|
|
630
633
|
}),
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
],
|
|
635
|
-
|
|
634
|
+
__decorateMetadata("design:type", Function),
|
|
635
|
+
__decorateMetadata("design:paramtypes", [Object]),
|
|
636
|
+
__decorateMetadata("design:returntype", Object)
|
|
637
|
+
], X.prototype, "parseConfig", null), __decorate([
|
|
638
|
+
b({
|
|
636
639
|
description: "Comma-separated glob patterns to validate, overriding the configuration",
|
|
637
640
|
flags: "--instances [globs]"
|
|
638
641
|
}),
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
],
|
|
643
|
-
|
|
642
|
+
__decorateMetadata("design:type", Function),
|
|
643
|
+
__decorateMetadata("design:paramtypes", [Object]),
|
|
644
|
+
__decorateMetadata("design:returntype", Object)
|
|
645
|
+
], X.prototype, "parseInstances", null), __decorate([
|
|
646
|
+
b({
|
|
644
647
|
description: "Comma-separated language names to run",
|
|
645
648
|
flags: "--languages [languages]"
|
|
646
649
|
}),
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
],
|
|
651
|
-
|
|
652
|
-
description: `Comma-separated template names to validate, or "${
|
|
650
|
+
__decorateMetadata("design:type", Function),
|
|
651
|
+
__decorateMetadata("design:paramtypes", [Object]),
|
|
652
|
+
__decorateMetadata("design:returntype", Object)
|
|
653
|
+
], X.prototype, "parseLanguages", null), __decorate([
|
|
654
|
+
b({
|
|
655
|
+
description: `Comma-separated template names to validate, or "${f}" for every one`,
|
|
653
656
|
flags: "--templates [names]"
|
|
654
657
|
}),
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
],
|
|
659
|
-
|
|
658
|
+
__decorateMetadata("design:type", Function),
|
|
659
|
+
__decorateMetadata("design:paramtypes", [Object]),
|
|
660
|
+
__decorateMetadata("design:returntype", Object)
|
|
661
|
+
], X.prototype, "parseTemplates", null), __decorate([
|
|
662
|
+
b({
|
|
660
663
|
description: "Lowest conformance score an instance may have, from 0 to 1. Overridden by a generator's own threshold and by an instance group's",
|
|
661
664
|
flags: "--threshold [ratio]"
|
|
662
665
|
}),
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
],
|
|
667
|
-
|
|
666
|
+
__decorateMetadata("design:type", Function),
|
|
667
|
+
__decorateMetadata("design:paramtypes", [Object]),
|
|
668
|
+
__decorateMetadata("design:returntype", Object)
|
|
669
|
+
], X.prototype, "parseThreshold", null), X = Y = __decorate([
|
|
670
|
+
v({
|
|
668
671
|
description: "Measure instances against their templates and report every difference",
|
|
669
672
|
name: "validate"
|
|
670
673
|
}),
|
|
671
674
|
n(),
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
S === void 0 ? Object : S,
|
|
675
|
+
__decorateMetadata("design:paramtypes", [
|
|
676
|
+
m === void 0 ? Object : m,
|
|
675
677
|
w === void 0 ? Object : w,
|
|
676
|
-
|
|
678
|
+
E === void 0 ? Object : E,
|
|
679
|
+
N === void 0 ? Object : N
|
|
677
680
|
])
|
|
678
|
-
],
|
|
681
|
+
], X);
|
|
679
682
|
//#endregion
|
|
680
683
|
//#region packages/ic-suite/conformetry/conformetry-cli/src/modules/validate/validate.module.ts
|
|
681
|
-
var
|
|
682
|
-
|
|
684
|
+
var Z = class ValidateModule {};
|
|
685
|
+
Z = __decorate([r({
|
|
683
686
|
controllers: [],
|
|
684
|
-
exports: [
|
|
687
|
+
exports: [X],
|
|
685
688
|
imports: [
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
689
|
+
p,
|
|
690
|
+
P,
|
|
691
|
+
C,
|
|
692
|
+
T
|
|
690
693
|
],
|
|
691
|
-
providers: [
|
|
692
|
-
})],
|
|
694
|
+
providers: [X]
|
|
695
|
+
})], Z);
|
|
693
696
|
//#endregion
|
|
694
697
|
//#region packages/ic-suite/conformetry/conformetry-cli/src/main.module.ts
|
|
695
|
-
var
|
|
696
|
-
|
|
698
|
+
var Q = class MainModule {};
|
|
699
|
+
Q = __decorate([r({ imports: [
|
|
697
700
|
a.forRoot({
|
|
698
701
|
envFilePath: ".env",
|
|
699
702
|
isGlobal: !0,
|
|
700
|
-
validate: (e) =>
|
|
703
|
+
validate: (e) => F.parse(e)
|
|
701
704
|
}),
|
|
702
705
|
o,
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
] })],
|
|
706
|
+
P,
|
|
707
|
+
R,
|
|
708
|
+
U,
|
|
709
|
+
J,
|
|
710
|
+
Z
|
|
711
|
+
] })], Q);
|
|
709
712
|
//#endregion
|
|
710
|
-
export {
|
|
713
|
+
export { q as a, R as c, __name as d, J as i, L as l, Z as n, U as o, X as r, H as s, Q as t, N as u };
|
package/dist/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "../main.module-
|
|
1
|
+
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c } from "../main.module-D7s1s-1a.js";
|
|
2
2
|
export { r as GenerateCommand, t as GenerateModule, s as InstancesCommand, a as InstancesModule, c as MainModule, e as TemplatesCommand, n as TemplatesModule, o as ValidateCommand, i as ValidateModule };
|
package/dist/src/main.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { t as e, u as t } from "../main.module-
|
|
2
|
+
import { t as e, u as t } from "../main.module-D7s1s-1a.js";
|
|
3
3
|
import { CommandFactory as n } from "nest-commander";
|
|
4
4
|
import "reflect-metadata";
|
|
5
5
|
//#region packages/ic-suite/conformetry/conformetry-cli/src/main.ts
|
|
6
|
-
async function
|
|
6
|
+
async function main() {
|
|
7
7
|
let r = new t();
|
|
8
8
|
r.setContext("CommandFactory"), await n.run(e, {
|
|
9
9
|
bufferLogs: !0,
|
|
@@ -16,5 +16,5 @@ async function r() {
|
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
main();
|
|
20
20
|
//#endregion
|
package/package.json
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
"url": "https://github.com/organizzolini/codebase/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@conformetry/configuration": "0.0.
|
|
11
|
-
"@conformetry/generation": "0.0.
|
|
12
|
-
"@conformetry/output": "0.0.
|
|
13
|
-
"@conformetry/validation": "0.0.
|
|
10
|
+
"@conformetry/configuration": "0.0.12",
|
|
11
|
+
"@conformetry/generation": "0.0.12",
|
|
12
|
+
"@conformetry/output": "0.0.11",
|
|
13
|
+
"@conformetry/validation": "0.0.11",
|
|
14
14
|
"@nestjs/common": "^11.1.21 || ^12.0.1",
|
|
15
15
|
"@nestjs/config": "^12.0.0",
|
|
16
16
|
"@nestjs/core": "^11.1.21 || ^12.0.1",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"description": "Command-line toolchain for scaffolding code from templates and holding implementations to them",
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@codebase/logging": "0.0.1",
|
|
26
|
-
"@conformetry/core": "0.0.
|
|
26
|
+
"@conformetry/core": "0.0.11",
|
|
27
27
|
"@golevelup/ts-vitest": "^4.0.0",
|
|
28
28
|
"@nestjs/testing": "^12.0.1",
|
|
29
29
|
"@nx/eslint-plugin": "^23.0.0",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"strict": true
|
|
76
76
|
},
|
|
77
77
|
"types": "./dist/src/index.d.ts",
|
|
78
|
-
"version": "0.0.
|
|
78
|
+
"version": "0.0.11"
|
|
79
79
|
}
|