@conformetry/cli 0.0.14 → 0.0.16

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,27 @@
1
+ ## 0.0.16 (2026-10-13)
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **caelundas,conformetry:** 🐛 require an explicit directory instead of defaulting the destination ([#1395](https://github.com/organizzolini/codebase/pull/1395))
6
+
7
+ ### 🧱 Updated Dependencies
8
+
9
+ - Updated conformetry-configuration to 0.0.16
10
+ - Updated conformetry-generation to 0.0.16
11
+ - Updated conformetry-validation to 0.0.15
12
+ - Updated conformetry-output to 0.0.15
13
+ - Updated conformetry-core to 0.0.15
14
+
15
+ ## 0.0.15 (2026-10-12)
16
+
17
+ ### 🧱 Updated Dependencies
18
+
19
+ - Updated conformetry-configuration to 0.0.15
20
+ - Updated conformetry-generation to 0.0.15
21
+ - Updated conformetry-validation to 0.0.14
22
+ - Updated conformetry-output to 0.0.14
23
+ - Updated conformetry-core to 0.0.14
24
+
1
25
  ## 0.0.14 (2026-10-12)
2
26
 
3
27
  ### 🧱 Updated Dependencies
package/README.md CHANGED
@@ -68,7 +68,7 @@ Renders one template folder into a target directory.
68
68
  | ---- | ------- |
69
69
  | `--template [name]` | Which template from the registry to render. Asked for when omitted |
70
70
  | `--config [path]` | Configuration file to read. Defaults to `configuration/conformetry.config.ts` |
71
- | `--directory [path]` | Where to write the rendered files |
71
+ | `--directory [path]` | Where to write the rendered files. Required: the run is refused without it |
72
72
 
73
73
  A template's own inputs are passed as flags alongside these:
74
74
 
@@ -1094,14 +1094,14 @@ graph LR
1094
1094
 
1095
1095
  ### Project
1096
1096
 
1097
- ![Lines of Code](https://img.shields.io/badge/Lines_of_Code-3247-22c55e?style=flat-square)
1098
- ![Repository Size](https://img.shields.io/badge/Repository_Size-123.05_kB-6b7280?style=flat-square)
1097
+ ![Lines of Code](https://img.shields.io/badge/Lines_of_Code-3280-22c55e?style=flat-square)
1098
+ ![Repository Size](https://img.shields.io/badge/Repository_Size-124.97_kB-6b7280?style=flat-square)
1099
1099
  ![Folders](https://img.shields.io/badge/Folders-7-4a4a4a?style=flat-square)
1100
1100
  ![Source Files](https://img.shields.io/badge/Source_Files-37-3178c6?style=flat-square)
1101
1101
 
1102
1102
  ### Measured Targets
1103
1103
 
1104
- ![Compiled JavaScript Size](https://img.shields.io/badge/Compiled_JavaScript_Size-6.49_kB_gzip-6b7280?style=flat-square)
1104
+ ![Compiled JavaScript Size](https://img.shields.io/badge/Compiled_JavaScript_Size-6.50_kB_gzip-6b7280?style=flat-square)
1105
1105
 
1106
1106
  ### TypeScript
1107
1107
 
@@ -1110,7 +1110,7 @@ graph LR
1110
1110
  ![Generic Declarations](https://img.shields.io/badge/Generic_Declarations-0-0369a1?style=flat-square)
1111
1111
  ![Enums](https://img.shields.io/badge/Enums-0-f97316?style=flat-square)
1112
1112
  ![Decorators](https://img.shields.io/badge/Decorators-27-db2777?style=flat-square)
1113
- ![Doc Comments](https://img.shields.io/badge/Doc_Comments-61-6366f1?style=flat-square)
1113
+ ![Doc Comments](https://img.shields.io/badge/Doc_Comments-62-6366f1?style=flat-square)
1114
1114
  ![Static Methods](https://img.shields.io/badge/Static_Methods-0-166534?style=flat-square)
1115
1115
 
1116
1116
  ### JavaScript
@@ -1120,14 +1120,14 @@ graph LR
1120
1120
  ![External Packages](https://img.shields.io/badge/External_Packages-18-8b5cf6?style=flat-square)
1121
1121
  ![Classes](https://img.shields.io/badge/Classes-10-7c3aed?style=flat-square)
1122
1122
  ![Functions](https://img.shields.io/badge/Functions-168-16a34a?style=flat-square)
1123
- ![Methods](https://img.shields.io/badge/Methods-50-15803d?style=flat-square)
1124
- ![Sync Functions](https://img.shields.io/badge/Sync_Functions-115-4ade80?style=flat-square)
1123
+ ![Methods](https://img.shields.io/badge/Methods-52-15803d?style=flat-square)
1124
+ ![Sync Functions](https://img.shields.io/badge/Sync_Functions-117-4ade80?style=flat-square)
1125
1125
  ![Async Functions](https://img.shields.io/badge/Async_Functions-103-059669?style=flat-square)
1126
- ![Constants](https://img.shields.io/badge/Constants-103-dc2626?style=flat-square)
1126
+ ![Constants](https://img.shields.io/badge/Constants-104-dc2626?style=flat-square)
1127
1127
  ![Imports](https://img.shields.io/badge/Imports-136-0284c7?style=flat-square)
1128
- ![Exported Symbols](https://img.shields.io/badge/Exported_Symbols-26-ea580c?style=flat-square)
1129
- ![Comments](https://img.shields.io/badge/Comments-218-64748b?style=flat-square)
1130
- ![Comment Lines](https://img.shields.io/badge/Comment_Lines-394-475569?style=flat-square)
1128
+ ![Exported Symbols](https://img.shields.io/badge/Exported_Symbols-25-ea580c?style=flat-square)
1129
+ ![Comments](https://img.shields.io/badge/Comments-221-64748b?style=flat-square)
1130
+ ![Comment Lines](https://img.shields.io/badge/Comment_Lines-403-475569?style=flat-square)
1131
1131
  ![TODO Comments](https://img.shields.io/badge/TODO_Comments-0-ca8a04?style=flat-square)
1132
1132
 
1133
1133
  ### Python
@@ -1283,20 +1283,20 @@ graph LR
1283
1283
  ### Markdown
1284
1284
 
1285
1285
  ![Markdown Files](https://img.shields.io/badge/Markdown_Files-2-083fa1?style=flat-square)
1286
- ![Markdown Lines](https://img.shields.io/badge/Markdown_Lines-350-1f6feb?style=flat-square)
1286
+ ![Markdown Lines](https://img.shields.io/badge/Markdown_Lines-374-1f6feb?style=flat-square)
1287
1287
  ![H1](https://img.shields.io/badge/H1-1-7c3aed?style=flat-square)
1288
- ![H2](https://img.shields.io/badge/H2-17-8b5cf6?style=flat-square)
1289
- ![H3](https://img.shields.io/badge/H3-26-a78bfa?style=flat-square)
1288
+ ![H2](https://img.shields.io/badge/H2-19-8b5cf6?style=flat-square)
1289
+ ![H3](https://img.shields.io/badge/H3-29-a78bfa?style=flat-square)
1290
1290
  ![H4](https://img.shields.io/badge/H4-0-c4b5fd?style=flat-square)
1291
1291
  ![H5](https://img.shields.io/badge/H5-0-ddd6fe?style=flat-square)
1292
1292
  ![H6](https://img.shields.io/badge/H6-0-ede9fe?style=flat-square)
1293
- ![Paragraphs](https://img.shields.io/badge/Paragraphs-97-64748b?style=flat-square)
1294
- ![Lists](https://img.shields.io/badge/Lists-18-16a34a?style=flat-square)
1295
- ![List Items](https://img.shields.io/badge/List_Items-76-22c55e?style=flat-square)
1293
+ ![Paragraphs](https://img.shields.io/badge/Paragraphs-108-64748b?style=flat-square)
1294
+ ![Lists](https://img.shields.io/badge/Lists-21-16a34a?style=flat-square)
1295
+ ![List Items](https://img.shields.io/badge/List_Items-87-22c55e?style=flat-square)
1296
1296
  ![Task List Items](https://img.shields.io/badge/Task_List_Items-0-4ade80?style=flat-square)
1297
1297
  ![Tables](https://img.shields.io/badge/Tables-2-0284c7?style=flat-square)
1298
1298
  ![Table Rows](https://img.shields.io/badge/Table_Rows-10-0ea5e9?style=flat-square)
1299
- ![Links](https://img.shields.io/badge/Links-13-059669?style=flat-square)
1299
+ ![Links](https://img.shields.io/badge/Links-14-059669?style=flat-square)
1300
1300
  ![Images](https://img.shields.io/badge/Images-0-10b981?style=flat-square)
1301
1301
  ![Code Blocks](https://img.shields.io/badge/Code_Blocks-13-dc2626?style=flat-square)
1302
1302
  ![Inline Code](https://img.shields.io/badge/Inline_Code-78-ef4444?style=flat-square)
@@ -5,16 +5,16 @@ import { existsSync as s, mkdirSync as c } from "node:fs";
5
5
  import l from "node:path";
6
6
  import u from "pino";
7
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";
8
+ import { ALL_TEMPLATES_SELECTION as f, ConfigurationModule as p, ConfigurationService as m, InputError as h, missingDirectoryError as g } from "@conformetry/configuration";
9
+ import { GenerationModule as _, GenerationService as v } from "@conformetry/generation";
10
+ import { Command as y, CommandRunner as b, Option as x } from "nest-commander";
11
+ import { InventoryModule as S, InventoryService as C, ReportingModule as w, ReportingService as T } from "@conformetry/output";
12
+ import { ValidationModule as E, ValidationService as D } from "@conformetry/validation";
13
13
  //#region \0rolldown/runtime.js
14
- var D = Object.defineProperty, __name = (e, t) => D(e, "name", {
14
+ var O = Object.defineProperty, __name = (e, t) => O(e, "name", {
15
15
  value: t,
16
16
  configurable: !0
17
- }), O = /^(\p{Extended_Pictographic}️?(?:‍\p{Extended_Pictographic}️?)*)\s+/u, k = /^([A-Za-z]+)/, A = /* @__PURE__ */ new Set([
17
+ }), k = /^(\p{Extended_Pictographic}️?(?:‍\p{Extended_Pictographic}️?)*)\s+/u, A = /^([A-Za-z]+)/, j = /* @__PURE__ */ new Set([
18
18
  "built",
19
19
  "cut",
20
20
  "found",
@@ -32,7 +32,7 @@ var D = Object.defineProperty, __name = (e, t) => D(e, "name", {
32
32
  "split",
33
33
  "took",
34
34
  "wrote"
35
- ]), j = /* @__PURE__ */ new Set([
35
+ ]), M = /* @__PURE__ */ new Set([
36
36
  "CommandFactory",
37
37
  "ExceptionHandler",
38
38
  "GraphQLModule",
@@ -44,12 +44,12 @@ var D = Object.defineProperty, __name = (e, t) => D(e, "name", {
44
44
  "TypeOrmModule"
45
45
  ]);
46
46
  //#endregion
47
- //#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorateMetadata.js
47
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorateMetadata.js
48
48
  function __decorateMetadata(e, t) {
49
49
  if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(e, t);
50
50
  }
51
51
  //#endregion
52
- //#region \0@oxc-project+runtime@0.151.0/helpers/esm/decorate.js
52
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/decorate.js
53
53
  function __decorate(e, t, n, r) {
54
54
  var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
55
55
  if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r);
@@ -58,9 +58,9 @@ function __decorate(e, t, n, r) {
58
58
  }
59
59
  //#endregion
60
60
  //#region packages/logging/src/modules/logger/logger.service.ts
61
- var M, N = class LoggerService extends e {
61
+ var N, P = class LoggerService extends e {
62
62
  static {
63
- M = this;
63
+ N = this;
64
64
  }
65
65
  constructor() {
66
66
  super();
@@ -68,15 +68,15 @@ var M, N = class LoggerService extends e {
68
68
  static isProduction = process.env.NODE_ENV === "production";
69
69
  static rootLogger;
70
70
  static writesToStandardError = !1;
71
- child = M.root;
71
+ child = N.root;
72
72
  static createRootLogger() {
73
73
  let e = process.env.LOG_LEVEL ?? "info";
74
- return M.isProduction ? M.writesToStandardError ? u({ level: e }, u.destination(2)) : u({ level: e }) : u({
74
+ return N.isProduction ? N.writesToStandardError ? u({ level: e }, u.destination(2)) : u({ level: e }) : u({
75
75
  level: e,
76
76
  transport: {
77
77
  options: {
78
78
  colorize: !0,
79
- destination: M.writesToStandardError ? 2 : 1,
79
+ destination: N.writesToStandardError ? 2 : 1,
80
80
  ignore: "pid,hostname,emoji",
81
81
  messageFormat: "{emoji} {msg}",
82
82
  singleLine: !0
@@ -86,14 +86,10 @@ var M, N = class LoggerService extends e {
86
86
  });
87
87
  }
88
88
  static logToStandardError() {
89
- if (M.rootLogger !== void 0) {
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.");
91
- return;
92
- }
93
- M.writesToStandardError = !0;
89
+ N.rootLogger === void 0 ? N.writesToStandardError = !0 : 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.");
94
90
  }
95
91
  assertConventionalMessage(e) {
96
- if (M.isProduction || this.shouldSkipConventionalMessageValidation(e.context)) return;
92
+ if (N.isProduction || this.shouldSkipConventionalMessageValidation(e.context)) return;
97
93
  let t = this.getConventionalMessageViolation(e.parsed);
98
94
  if (t !== void 0) throw Error(t);
99
95
  }
@@ -104,21 +100,21 @@ var M, N = class LoggerService extends e {
104
100
  }), {
105
101
  ...e.data,
106
102
  context: e.context,
107
- ...M.isProduction ? {} : { emoji: e.parsed.emoji }
103
+ ...N.isProduction ? {} : { emoji: e.parsed.emoji }
108
104
  };
109
105
  }
110
106
  getConventionalMessageViolation(e) {
111
107
  let t = e.emoji, n = e.text;
112
108
  if (t === void 0) return `Log message must start with an emoji naming its subject, then a verb: "${n}"`;
113
- let r = k.exec(n)?.[1];
109
+ let r = A.exec(n)?.[1];
114
110
  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}"`;
115
111
  }
116
112
  isConventionalVerb(e) {
117
113
  let t = e.toLowerCase();
118
- return t.endsWith("ing") || t.endsWith("ed") || A.has(t);
114
+ return t.endsWith("ing") || t.endsWith("ed") || j.has(t);
119
115
  }
120
116
  parseMessage(e) {
121
- let t = String(e), n = O.exec(t), r = n?.[1];
117
+ let t = String(e), n = k.exec(t), r = n?.[1];
122
118
  return r === void 0 ? {
123
119
  emoji: void 0,
124
120
  text: t
@@ -128,10 +124,10 @@ var M, N = class LoggerService extends e {
128
124
  };
129
125
  }
130
126
  shouldSkipConventionalMessageValidation(e) {
131
- return e !== void 0 && j.has(e);
127
+ return e !== void 0 && M.has(e);
132
128
  }
133
129
  static get root() {
134
- return M.rootLogger ??= M.createRootLogger(), M.rootLogger;
130
+ return N.rootLogger ??= N.createRootLogger(), N.rootLogger;
135
131
  }
136
132
  buildErrorLogEntry(e, t) {
137
133
  let n = t instanceof Error ? t.stack || t.message : String(t);
@@ -175,7 +171,7 @@ var M, N = class LoggerService extends e {
175
171
  this.info(e, t, n);
176
172
  }
177
173
  setContext(e) {
178
- super.setContext(e), this.child = M.root.child({ context: e });
174
+ super.setContext(e), this.child = N.root.child({ context: e });
179
175
  }
180
176
  verbose(e, t, n) {
181
177
  let r = this.parseMessage(e);
@@ -194,22 +190,22 @@ var M, N = class LoggerService extends e {
194
190
  }), r.text);
195
191
  }
196
192
  };
197
- N = M = __decorate([n({ scope: i.TRANSIENT }), __decorateMetadata("design:paramtypes", [])], N);
193
+ P = N = __decorate([n({ scope: i.TRANSIENT }), __decorateMetadata("design:paramtypes", [])], P);
198
194
  //#endregion
199
195
  //#region packages/logging/src/modules/logger/logger.module.ts
200
- var P = class LoggerModule {};
201
- P = __decorate([t(), r({
196
+ var F = class LoggerModule {};
197
+ F = __decorate([t(), r({
202
198
  controllers: [],
203
- exports: [N],
199
+ exports: [P],
204
200
  imports: [],
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 {
201
+ providers: [P]
202
+ })], F);
203
+ 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."), I = d.object({}), missingTemplateError = (e) => new h(`No template was selected. Pass --template. Available: ${e.join(", ")}`), L, R = L = class GenerateCommand extends b {
208
204
  configurationService;
209
205
  generationService;
210
206
  logger;
211
207
  constructor(e, t, n) {
212
- super(), this.configurationService = e, this.generationService = t, this.logger = n, this.logger.setContext(I.name);
208
+ super(), this.configurationService = e, this.generationService = t, this.logger = n, this.logger.setContext(L.name);
213
209
  }
214
210
  async generate(e, t) {
215
211
  let n = [...e, ...process.argv.slice(2)];
@@ -219,28 +215,23 @@ var unknownTemplateError = (e) => /* @__PURE__ */ Error(`Unknown template "${e.t
219
215
  templateName: t.template
220
216
  });
221
217
  this.logger.debug("🏗 Generating a conformetry instance", void 0, { template: i });
222
- let a = r.find((e) => e.name === i);
223
- if (a === void 0) throw this.logger.error("🚫 Rejected an unknown template", void 0, { template: i }), unknownTemplateError({
224
- availableTemplateNames: r.map((e) => e.name),
225
- templateName: i
226
- });
227
- let o = {
218
+ let a = this.requireDefinition(r, i), o = this.requireDirectory(t, a.name), s = {
228
219
  properties: a.inputs,
229
220
  required: Object.keys(a.inputs)
230
- }, s = await this.configurationService.resolveGeneratorInputs({
221
+ }, c = await this.configurationService.resolveGeneratorInputs({
231
222
  rawArguments: n,
232
- schema: o
233
- }), c = await this.generationService.runGenerator({
223
+ schema: s
224
+ }), l = await this.generationService.runGenerator({
234
225
  definition: {
235
226
  name: a.name,
236
227
  templateDirectoryPath: a.templatePath
237
228
  },
238
- inputs: s,
239
- instancePath: t.directory ?? `generated/${a.name}`
229
+ inputs: c,
230
+ instancePath: o
240
231
  });
241
- process.stdout.write(`${c.generatedFilePaths.map((e) => ` ${e}`).join("\n")}\n`), this.logger.info("✨ Generated instance files", void 0, {
242
- count: c.generatedFilePaths.length,
243
- outputDirectoryPath: c.outputDirectoryPath
232
+ process.stdout.write(`${l.generatedFilePaths.map((e) => ` ${e}`).join("\n")}\n`), this.logger.info("✨ Generated instance files", void 0, {
233
+ count: l.generatedFilePaths.length,
234
+ outputDirectoryPath: l.outputDirectoryPath
244
235
  });
245
236
  }
246
237
  rejectCommandLine(e) {
@@ -249,6 +240,18 @@ var unknownTemplateError = (e) => /* @__PURE__ */ Error(`Unknown template "${e.t
249
240
  rejectRemovedGeneratorOption(e) {
250
241
  if (e.some((e) => e === "--generator" || e.startsWith("--generator="))) throw this.logger.error("🚫 Rejected a removed option", void 0, { option: "--generator" }), removedGeneratorOptionError();
251
242
  }
243
+ requireDefinition(e, t) {
244
+ let n = e.find((e) => e.name === t);
245
+ if (n === void 0) throw this.logger.error("🚫 Rejected an unknown template", void 0, { template: t }), unknownTemplateError({
246
+ availableTemplateNames: e.map((e) => e.name),
247
+ templateName: t
248
+ });
249
+ return n;
250
+ }
251
+ requireDirectory(e, t) {
252
+ if (e.directory === void 0) throw this.logger.error("🚫 Rejected a run with no directory", void 0, { template: t }), g({ generatorName: t });
253
+ return e.directory;
254
+ }
252
255
  async resolveTemplateName(e) {
253
256
  if (e.templateName !== void 0) return e.templateName;
254
257
  let t = e.configuration.map((e) => e.name);
@@ -276,31 +279,31 @@ var unknownTemplateError = (e) => /* @__PURE__ */ Error(`Unknown template "${e.t
276
279
  }
277
280
  };
278
281
  __decorate([
279
- b({
282
+ x({
280
283
  description: "Path to the conformetry configuration file",
281
284
  flags: "--config [path]"
282
285
  }),
283
286
  __decorateMetadata("design:type", Function),
284
287
  __decorateMetadata("design:paramtypes", [Object]),
285
288
  __decorateMetadata("design:returntype", Object)
286
- ], L.prototype, "parseConfig", null), __decorate([
287
- b({
289
+ ], R.prototype, "parseConfig", null), __decorate([
290
+ x({
288
291
  description: "Directory to write generated files into",
289
292
  flags: "--directory [path]"
290
293
  }),
291
294
  __decorateMetadata("design:type", Function),
292
295
  __decorateMetadata("design:paramtypes", [Object]),
293
296
  __decorateMetadata("design:returntype", Object)
294
- ], L.prototype, "parseDirectory", null), __decorate([
295
- b({
297
+ ], R.prototype, "parseDirectory", null), __decorate([
298
+ x({
296
299
  description: "Name of the template to render",
297
300
  flags: "--template [name]"
298
301
  }),
299
302
  __decorateMetadata("design:type", Function),
300
303
  __decorateMetadata("design:paramtypes", [Object]),
301
304
  __decorateMetadata("design:returntype", Object)
302
- ], L.prototype, "parseTemplate", null), L = I = __decorate([
303
- v({
305
+ ], R.prototype, "parseTemplate", null), R = L = __decorate([
306
+ y({
304
307
  allowUnknownOptions: !0,
305
308
  description: "Render a template into a new instance",
306
309
  name: "generate"
@@ -308,31 +311,31 @@ __decorate([
308
311
  n(),
309
312
  __decorateMetadata("design:paramtypes", [
310
313
  m === void 0 ? Object : m,
311
- _ === void 0 ? Object : _,
312
- N === void 0 ? Object : N
314
+ v === void 0 ? Object : v,
315
+ P === void 0 ? Object : P
313
316
  ])
314
- ], L);
317
+ ], R);
315
318
  //#endregion
316
319
  //#region packages/ic-suite/conformetry/conformetry-cli/src/modules/generate/generate.module.ts
317
- var R = class GenerateModule {};
318
- R = __decorate([r({
320
+ var z = class GenerateModule {};
321
+ z = __decorate([r({
319
322
  controllers: [],
320
- exports: [L],
323
+ exports: [R],
321
324
  imports: [
322
325
  p,
323
- g,
324
- P
326
+ _,
327
+ F
325
328
  ],
326
- providers: [L]
327
- })], R);
329
+ providers: [R]
330
+ })], z);
328
331
  //#endregion
329
332
  //#region packages/ic-suite/conformetry/conformetry-cli/src/modules/instances/instances.constants.ts
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 {
333
+ var B = "No instances were found. Check the instance globs in the configuration.", V = "No instance is explained by those templates.", H, U = H = class InstancesCommand extends b {
331
334
  configurationService;
332
335
  inventoryService;
333
336
  logger;
334
337
  constructor(e, t, n) {
335
- super(), this.configurationService = e, this.inventoryService = t, this.logger = n, this.logger.setContext(V.name);
338
+ super(), this.configurationService = e, this.inventoryService = t, this.logger = n, this.logger.setContext(H.name);
336
339
  }
337
340
  parseConfig(e) {
338
341
  return this.configurationService.parseOptionalOption(e);
@@ -353,74 +356,66 @@ var z = "No instances were found. Check the instance globs in the configuration.
353
356
  }),
354
357
  workingDirectory: n
355
358
  });
356
- if (t.json === !0) {
357
- console.info(JSON.stringify(i, void 0, 2));
358
- return;
359
- }
360
- if (i.length === 0) {
361
- console.info(t.templates === void 0 ? z : B);
362
- return;
363
- }
364
- console.info(this.inventoryService.describeInstances(i).join("\n"));
359
+ t.json === !0 ? console.info(JSON.stringify(i, void 0, 2)) : i.length === 0 ? console.info(t.templates === void 0 ? B : V) : console.info(this.inventoryService.describeInstances(i).join("\n"));
365
360
  }
366
361
  };
367
362
  __decorate([
368
- b({
363
+ x({
369
364
  description: "Path to the conformetry configuration file",
370
365
  flags: "--config [path]"
371
366
  }),
372
367
  __decorateMetadata("design:type", Function),
373
368
  __decorateMetadata("design:paramtypes", [Object]),
374
369
  __decorateMetadata("design:returntype", Object)
375
- ], H.prototype, "parseConfig", null), __decorate([
376
- b({
370
+ ], U.prototype, "parseConfig", null), __decorate([
371
+ x({
377
372
  description: "Write the listing as JSON",
378
373
  flags: "--json"
379
374
  }),
380
375
  __decorateMetadata("design:type", Function),
381
376
  __decorateMetadata("design:paramtypes", []),
382
377
  __decorateMetadata("design:returntype", Boolean)
383
- ], H.prototype, "parseJson", null), __decorate([
384
- b({
378
+ ], U.prototype, "parseJson", null), __decorate([
379
+ x({
385
380
  description: "Comma-separated template names; report only the instances they explain",
386
381
  flags: "--templates [names]"
387
382
  }),
388
383
  __decorateMetadata("design:type", Function),
389
384
  __decorateMetadata("design:paramtypes", [Object]),
390
385
  __decorateMetadata("design:returntype", Object)
391
- ], H.prototype, "parseTemplates", null), H = V = __decorate([
392
- v({
386
+ ], U.prototype, "parseTemplates", null), U = H = __decorate([
387
+ y({
393
388
  description: "List the generated code the configuration finds, and what explains it",
394
389
  name: "instances"
395
390
  }),
396
391
  n(),
397
392
  __decorateMetadata("design:paramtypes", [
398
393
  m === void 0 ? Object : m,
399
- S === void 0 ? Object : S,
400
- N === void 0 ? Object : N
394
+ C === void 0 ? Object : C,
395
+ P === void 0 ? Object : P
401
396
  ])
402
- ], H);
397
+ ], U);
403
398
  //#endregion
404
399
  //#region packages/ic-suite/conformetry/conformetry-cli/src/modules/instances/instances.module.ts
405
- var U = class InstancesModule {};
406
- U = __decorate([r({
400
+ var W = class InstancesModule {};
401
+ W = __decorate([r({
407
402
  controllers: [],
408
- exports: [H],
403
+ exports: [U],
409
404
  imports: [
410
405
  p,
411
- x,
412
- P
406
+ S,
407
+ F
413
408
  ],
414
- providers: [H]
415
- })], U);
409
+ providers: [U]
410
+ })], W);
416
411
  //#endregion
417
412
  //#region packages/ic-suite/conformetry/conformetry-cli/src/modules/templates/templates.constants.ts
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 {
413
+ var G = "No templates are declared in the configuration.", K = "No template explains those paths. Either they are not generated code, or they have drifted past recognition.", q, J = q = class TemplatesCommand extends b {
419
414
  configurationService;
420
415
  inventoryService;
421
416
  logger;
422
417
  constructor(e, t, n) {
423
- super(), this.configurationService = e, this.inventoryService = t, this.logger = n, this.logger.setContext(K.name);
418
+ super(), this.configurationService = e, this.inventoryService = t, this.logger = n, this.logger.setContext(q.name);
424
419
  }
425
420
  parseConfig(e) {
426
421
  return this.configurationService.parseOptionalOption(e);
@@ -441,78 +436,70 @@ var W = "No templates are declared in the configuration.", G = "No template expl
441
436
  }),
442
437
  workingDirectory: n
443
438
  });
444
- if (t.json === !0) {
445
- console.info(JSON.stringify(i, void 0, 2));
446
- return;
447
- }
448
- if (i.length === 0) {
449
- console.info(t.instances === void 0 ? W : G);
450
- return;
451
- }
452
- console.info(this.inventoryService.describeTemplates({
439
+ t.json === !0 ? console.info(JSON.stringify(i, void 0, 2)) : i.length === 0 ? console.info(t.instances === void 0 ? G : K) : console.info(this.inventoryService.describeTemplates({
453
440
  showInstances: t.instances !== void 0,
454
441
  templates: i
455
442
  }).join("\n"));
456
443
  }
457
444
  };
458
445
  __decorate([
459
- b({
446
+ x({
460
447
  description: "Path to the conformetry configuration file",
461
448
  flags: "--config [path]"
462
449
  }),
463
450
  __decorateMetadata("design:type", Function),
464
451
  __decorateMetadata("design:paramtypes", [Object]),
465
452
  __decorateMetadata("design:returntype", Object)
466
- ], q.prototype, "parseConfig", null), __decorate([
467
- b({
453
+ ], J.prototype, "parseConfig", null), __decorate([
454
+ x({
468
455
  description: "Comma-separated paths or globs; report only the templates that explain them",
469
456
  flags: "--instances [globs]"
470
457
  }),
471
458
  __decorateMetadata("design:type", Function),
472
459
  __decorateMetadata("design:paramtypes", [Object]),
473
460
  __decorateMetadata("design:returntype", Object)
474
- ], q.prototype, "parseInstances", null), __decorate([
475
- b({
461
+ ], J.prototype, "parseInstances", null), __decorate([
462
+ x({
476
463
  description: "Write the listing as JSON",
477
464
  flags: "--json"
478
465
  }),
479
466
  __decorateMetadata("design:type", Function),
480
467
  __decorateMetadata("design:paramtypes", []),
481
468
  __decorateMetadata("design:returntype", Boolean)
482
- ], q.prototype, "parseJson", null), q = K = __decorate([
483
- v({
469
+ ], J.prototype, "parseJson", null), J = q = __decorate([
470
+ y({
484
471
  description: "Name the templates the configuration declares, or which ones explain a path",
485
472
  name: "templates"
486
473
  }),
487
474
  n(),
488
475
  __decorateMetadata("design:paramtypes", [
489
476
  m === void 0 ? Object : m,
490
- S === void 0 ? Object : S,
491
- N === void 0 ? Object : N
477
+ C === void 0 ? Object : C,
478
+ P === void 0 ? Object : P
492
479
  ])
493
- ], q);
480
+ ], J);
494
481
  //#endregion
495
482
  //#region packages/ic-suite/conformetry/conformetry-cli/src/modules/templates/templates.module.ts
496
- var J = class TemplatesModule {};
497
- J = __decorate([r({
483
+ var Y = class TemplatesModule {};
484
+ Y = __decorate([r({
498
485
  controllers: [],
499
- exports: [q],
486
+ exports: [J],
500
487
  imports: [
501
488
  p,
502
- x,
503
- P
489
+ S,
490
+ F
504
491
  ],
505
- providers: [q]
506
- })], J);
492
+ providers: [J]
493
+ })], Y);
507
494
  //#endregion
508
495
  //#region packages/ic-suite/conformetry/conformetry-cli/src/modules/validate/validate.command.ts
509
- var Y, X = Y = class ValidateCommand extends y {
496
+ var X, Z = X = class ValidateCommand extends b {
510
497
  configurationService;
511
498
  reportingService;
512
499
  validationService;
513
500
  logger;
514
501
  constructor(e, t, n, r) {
515
- super(), this.configurationService = e, this.reportingService = t, this.validationService = n, this.logger = r, this.logger.setContext(Y.name);
502
+ super(), this.configurationService = e, this.reportingService = t, this.validationService = n, this.logger = r, this.logger.setContext(X.name);
516
503
  }
517
504
  describeFailure(e) {
518
505
  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("; ")}.`;
@@ -627,87 +614,87 @@ var Y, X = Y = class ValidateCommand extends y {
627
614
  }
628
615
  };
629
616
  __decorate([
630
- b({
617
+ x({
631
618
  description: "Path to the conformetry configuration file",
632
619
  flags: "--config [path]"
633
620
  }),
634
621
  __decorateMetadata("design:type", Function),
635
622
  __decorateMetadata("design:paramtypes", [Object]),
636
623
  __decorateMetadata("design:returntype", Object)
637
- ], X.prototype, "parseConfig", null), __decorate([
638
- b({
624
+ ], Z.prototype, "parseConfig", null), __decorate([
625
+ x({
639
626
  description: "Comma-separated glob patterns to validate, overriding the configuration",
640
627
  flags: "--instances [globs]"
641
628
  }),
642
629
  __decorateMetadata("design:type", Function),
643
630
  __decorateMetadata("design:paramtypes", [Object]),
644
631
  __decorateMetadata("design:returntype", Object)
645
- ], X.prototype, "parseInstances", null), __decorate([
646
- b({
632
+ ], Z.prototype, "parseInstances", null), __decorate([
633
+ x({
647
634
  description: "Comma-separated language names to run",
648
635
  flags: "--languages [languages]"
649
636
  }),
650
637
  __decorateMetadata("design:type", Function),
651
638
  __decorateMetadata("design:paramtypes", [Object]),
652
639
  __decorateMetadata("design:returntype", Object)
653
- ], X.prototype, "parseLanguages", null), __decorate([
654
- b({
640
+ ], Z.prototype, "parseLanguages", null), __decorate([
641
+ x({
655
642
  description: `Comma-separated template names to validate, or "${f}" for every one`,
656
643
  flags: "--templates [names]"
657
644
  }),
658
645
  __decorateMetadata("design:type", Function),
659
646
  __decorateMetadata("design:paramtypes", [Object]),
660
647
  __decorateMetadata("design:returntype", Object)
661
- ], X.prototype, "parseTemplates", null), __decorate([
662
- b({
648
+ ], Z.prototype, "parseTemplates", null), __decorate([
649
+ x({
663
650
  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",
664
651
  flags: "--threshold [ratio]"
665
652
  }),
666
653
  __decorateMetadata("design:type", Function),
667
654
  __decorateMetadata("design:paramtypes", [Object]),
668
655
  __decorateMetadata("design:returntype", Object)
669
- ], X.prototype, "parseThreshold", null), X = Y = __decorate([
670
- v({
656
+ ], Z.prototype, "parseThreshold", null), Z = X = __decorate([
657
+ y({
671
658
  description: "Measure instances against their templates and report every difference",
672
659
  name: "validate"
673
660
  }),
674
661
  n(),
675
662
  __decorateMetadata("design:paramtypes", [
676
663
  m === void 0 ? Object : m,
677
- w === void 0 ? Object : w,
678
- E === void 0 ? Object : E,
679
- N === void 0 ? Object : N
664
+ T === void 0 ? Object : T,
665
+ D === void 0 ? Object : D,
666
+ P === void 0 ? Object : P
680
667
  ])
681
- ], X);
668
+ ], Z);
682
669
  //#endregion
683
670
  //#region packages/ic-suite/conformetry/conformetry-cli/src/modules/validate/validate.module.ts
684
- var Z = class ValidateModule {};
685
- Z = __decorate([r({
671
+ var Q = class ValidateModule {};
672
+ Q = __decorate([r({
686
673
  controllers: [],
687
- exports: [X],
674
+ exports: [Z],
688
675
  imports: [
689
676
  p,
690
- P,
691
- C,
692
- T
677
+ F,
678
+ w,
679
+ E
693
680
  ],
694
- providers: [X]
695
- })], Z);
681
+ providers: [Z]
682
+ })], Q);
696
683
  //#endregion
697
684
  //#region packages/ic-suite/conformetry/conformetry-cli/src/main.module.ts
698
- var Q = class MainModule {};
699
- Q = __decorate([r({ imports: [
685
+ var $ = class MainModule {};
686
+ $ = __decorate([r({ imports: [
700
687
  a.forRoot({
701
688
  envFilePath: ".env",
702
689
  isGlobal: !0,
703
- validate: (e) => F.parse(e)
690
+ validate: (e) => I.parse(e)
704
691
  }),
705
692
  o,
706
- P,
707
- R,
708
- U,
709
- J,
710
- Z
711
- ] })], Q);
693
+ F,
694
+ z,
695
+ W,
696
+ Y,
697
+ Q
698
+ ] })], $);
712
699
  //#endregion
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 };
700
+ export { J as a, z as c, __name as d, Y as i, R as l, Q as n, W as o, Z as r, U as s, $ as t, P as u };
@@ -47,6 +47,17 @@ export declare class GenerateCommand extends CommandRunner {
47
47
  * script to prompt or to fail for the wrong reason.
48
48
  */
49
49
  private rejectRemovedGeneratorOption;
50
+ /** The configured template of that name, or a refusal listing the real ones. */
51
+ private requireDefinition;
52
+ /**
53
+ * The directory to write into, or a refusal when the caller named none.
54
+ *
55
+ * Required, unlike on the Nx host: nothing here can locate a project, so a
56
+ * missing flag would otherwise write somewhere the caller never chose. It is
57
+ * checked before any input is asked for, so nobody answers prompts for a
58
+ * run that was never going to happen.
59
+ */
60
+ private requireDirectory;
50
61
  /**
51
62
  * Settles which template to render: the one named, the one picked, or none.
52
63
  *
package/dist/src/index.js CHANGED
@@ -1,2 +1 @@
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
- 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 };
1
+ export { l as GenerateCommand, c as GenerateModule, s as InstancesCommand, o as InstancesModule, t as MainModule, a as TemplatesCommand, i as TemplatesModule, r as ValidateCommand, n as ValidateModule } from "../main.module-Dk88Dy1P.js";
package/dist/src/main.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { t as e, u as t } from "../main.module-D7s1s-1a.js";
2
+ import { t as e, u as t } from "../main.module-Dk88Dy1P.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
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.14",
11
- "@conformetry/generation": "0.0.14",
12
- "@conformetry/output": "0.0.13",
13
- "@conformetry/validation": "0.0.13",
10
+ "@conformetry/configuration": "0.0.16",
11
+ "@conformetry/generation": "0.0.16",
12
+ "@conformetry/output": "0.0.15",
13
+ "@conformetry/validation": "0.0.15",
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.13",
26
+ "@conformetry/core": "0.0.15",
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.14"
78
+ "version": "0.0.16"
79
79
  }