@solid-stack/mason 1.0.24 → 1.0.25

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/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import fs4 from 'fs';
2
2
  import path2 from 'path';
3
- import * as p14 from '@clack/prompts';
4
- import pc14 from 'picocolors';
3
+ import * as p15 from '@clack/prompts';
4
+ import pc15 from 'picocolors';
5
5
  import { fileURLToPath } from 'url';
6
6
  import { execSync } from 'child_process';
7
7
  import { createHash } from 'crypto';
@@ -112,17 +112,17 @@ function writeFileSafely(absolutePath, content, options = {}) {
112
112
  function printGeneratedFiles(files, isDryRun = false) {
113
113
  console.log("");
114
114
  if (isDryRun) {
115
- p14.log.warn(pc14.yellow(pc14.bold("[DRY RUN PREVIEW] No files were written to disk.")));
115
+ p15.log.warn(pc15.yellow(pc15.bold("[DRY RUN PREVIEW] No files were written to disk.")));
116
116
  }
117
117
  for (const f of files) {
118
118
  if (f.action === "created") {
119
- p14.log.success(`${pc14.bold(f.relativePath)} ${pc14.dim("(created)")}`);
119
+ p15.log.success(`${pc15.bold(f.relativePath)} ${pc15.dim("(created)")}`);
120
120
  } else if (f.action === "overwritten") {
121
- p14.log.warn(`${pc14.bold(f.relativePath)} ${pc14.dim("(overwritten)")}`);
121
+ p15.log.warn(`${pc15.bold(f.relativePath)} ${pc15.dim("(overwritten)")}`);
122
122
  } else if (f.action === "skipped") {
123
- p14.log.info(`${pc14.dim(f.relativePath)} ${pc14.dim("(skipped - already exists, pass -o to overwrite)")}`);
123
+ p15.log.info(`${pc15.dim(f.relativePath)} ${pc15.dim("(skipped - already exists, pass -o to overwrite)")}`);
124
124
  } else {
125
- p14.log.info(`${pc14.bold(f.relativePath)} ${pc14.dim("(preview)")}`);
125
+ p15.log.info(`${pc15.bold(f.relativePath)} ${pc15.dim("(preview)")}`);
126
126
  }
127
127
  }
128
128
  }
@@ -324,23 +324,23 @@ var PromptCancelledError = class extends Error {
324
324
  }
325
325
  };
326
326
  function handleCancel(result) {
327
- if (p14.isCancel(result)) {
328
- p14.cancel("Operation cancelled.");
327
+ if (p15.isCancel(result)) {
328
+ p15.cancel("Operation cancelled.");
329
329
  throw new PromptCancelledError();
330
330
  }
331
331
  return result;
332
332
  }
333
333
  function printBanner() {
334
334
  console.log("");
335
- p14.intro(pc14.bgCyan(pc14.black(" @solid-stack/mason ")));
335
+ p15.intro(pc15.bgCyan(pc15.black(" @solid-stack/mason ")));
336
336
  }
337
337
  async function promptProperties(options = {}) {
338
338
  const properties = options.defaults ? [...options.defaults] : [];
339
339
  if (properties.length > 0) {
340
- const summary = properties.map((p16) => `${p16.name}: ${p16.type}${p16.optional ? "?" : ""}`).join(", ");
341
- p14.log.info(pc14.dim(`Pre-configured fields: ${summary}`));
340
+ const summary = properties.map((p18) => `${p18.name}: ${p18.type}${p18.optional ? "?" : ""}`).join(", ");
341
+ p15.log.info(pc15.dim(`Pre-configured fields: ${summary}`));
342
342
  const addMore = handleCancel(
343
- await p14.confirm({
343
+ await p15.confirm({
344
344
  message: "Would you like to add custom fields/properties?",
345
345
  initialValue: false
346
346
  })
@@ -349,10 +349,10 @@ async function promptProperties(options = {}) {
349
349
  return properties;
350
350
  }
351
351
  }
352
- p14.log.info(pc14.cyan("Enter properties (leave name blank when finished):"));
352
+ p15.log.info(pc15.cyan("Enter properties (leave name blank when finished):"));
353
353
  while (true) {
354
354
  const name = handleCancel(
355
- await p14.text({
355
+ await p15.text({
356
356
  message: "Property name (or press Enter to finish):",
357
357
  placeholder: "e.g. title, email, status"
358
358
  })
@@ -361,7 +361,7 @@ async function promptProperties(options = {}) {
361
361
  break;
362
362
  }
363
363
  const type = handleCancel(
364
- await p14.select({
364
+ await p15.select({
365
365
  message: `Type for property "${name.trim()}":`,
366
366
  options: [
367
367
  { value: "string", label: "string" },
@@ -378,7 +378,7 @@ async function promptProperties(options = {}) {
378
378
  let finalType = type;
379
379
  if (type === "custom") {
380
380
  finalType = handleCancel(
381
- await p14.text({
381
+ await p15.text({
382
382
  message: `Enter custom type for "${name.trim()}":`,
383
383
  placeholder: "e.g. UserRole, string | null",
384
384
  validate: (val) => val && val.trim() ? void 0 : "Type cannot be empty"
@@ -386,7 +386,7 @@ async function promptProperties(options = {}) {
386
386
  );
387
387
  }
388
388
  const optional = handleCancel(
389
- await p14.confirm({
389
+ await p15.confirm({
390
390
  message: `Is "${name.trim()}" optional?`,
391
391
  initialValue: false
392
392
  })
@@ -396,8 +396,8 @@ async function promptProperties(options = {}) {
396
396
  type: finalType.trim(),
397
397
  optional
398
398
  });
399
- p14.log.success(
400
- pc14.green(`Added: ${name.trim()}${optional ? "?" : ""}: ${finalType.trim()}`)
399
+ p15.log.success(
400
+ pc15.green(`Added: ${name.trim()}${optional ? "?" : ""}: ${finalType.trim()}`)
401
401
  );
402
402
  }
403
403
  return properties;
@@ -605,8 +605,8 @@ function getMissingNpmPackages(projectRoot, requiredPackages) {
605
605
  ...Object.keys(pkg.devDependencies || {}),
606
606
  ...Object.keys(pkg.peerDependencies || {})
607
607
  ]);
608
- return requiredPackages.filter((p16) => {
609
- const nameOnly = p16.startsWith("@") ? `@${p16.slice(1).split("@")[0] || ""}` : p16.split("@")[0] || p16;
608
+ return requiredPackages.filter((p18) => {
609
+ const nameOnly = p18.startsWith("@") ? `@${p18.slice(1).split("@")[0] || ""}` : p18.split("@")[0] || p18;
610
610
  return !installed.has(nameOnly);
611
611
  });
612
612
  } catch {
@@ -631,7 +631,7 @@ function installNpmPackages(projectRoot, packages, pm) {
631
631
  installCmd = `npm install ${packages.join(" ")}`;
632
632
  break;
633
633
  }
634
- p14.log.info(`Installing missing dependencies with ${manager}: ${pc14.cyan(packages.join(", "))}`);
634
+ p15.log.info(`Installing missing dependencies with ${manager}: ${pc15.cyan(packages.join(", "))}`);
635
635
  execSync(installCmd, {
636
636
  cwd: projectRoot,
637
637
  stdio: "inherit"
@@ -833,7 +833,7 @@ function generateInterfaceCode(ifaceName, kind = "abstractClass", entityName, me
833
833
  const idKey = `${entityKey}Id`;
834
834
  const listKey = `${entityKey}s`;
835
835
  const formattedCustomMethods = customMethods.map((m) => {
836
- const params = m.params && m.params.length > 0 ? m.params.map((p16) => `${p16.name}: ${p16.type}`).join("; ") : "";
836
+ const params = m.params && m.params.length > 0 ? m.params.map((p18) => `${p18.name}: ${p18.type}`).join("; ") : "";
837
837
  const returnType = m.returnType ? `Promise<${m.returnType}>` : "Promise<void>";
838
838
  return {
839
839
  name: m.name,
@@ -1414,22 +1414,22 @@ function generateUseCaseCode(useCaseName, dependencies = [], inputProps = [], ou
1414
1414
  from: /^I[A-Z]/.test(dep) ? `../domain/${dep}.js` : `./${dep}.js`
1415
1415
  }));
1416
1416
  const domainTypesToImport = new Set(domainImports);
1417
- for (const p16 of [...inputProps, ...outputProps]) {
1418
- const rawType = p16.type.trim();
1417
+ for (const p18 of [...inputProps, ...outputProps]) {
1418
+ const rawType = p18.type.trim();
1419
1419
  const baseType = rawType.replace(/\[\]$/, "").trim();
1420
1420
  if (!primitiveTypes.has(baseType) && /^[A-Z][A-Za-z0-9_]*$/.test(baseType) && !dependencies.includes(baseType)) {
1421
1421
  domainTypesToImport.add(baseType);
1422
1422
  }
1423
1423
  }
1424
- const formattedInputProps = inputProps.map((p16) => ({
1425
- name: p16.name,
1426
- optional: p16.optional,
1427
- type: p16.optional && !p16.type.includes("undefined") ? `${p16.type} | undefined` : p16.type
1424
+ const formattedInputProps = inputProps.map((p18) => ({
1425
+ name: p18.name,
1426
+ optional: p18.optional,
1427
+ type: p18.optional && !p18.type.includes("undefined") ? `${p18.type} | undefined` : p18.type
1428
1428
  }));
1429
- const formattedOutputProps = outputProps.map((p16) => ({
1430
- name: p16.name,
1431
- optional: p16.optional,
1432
- type: p16.optional && !p16.type.includes("undefined") ? `${p16.type} | undefined` : p16.type
1429
+ const formattedOutputProps = outputProps.map((p18) => ({
1430
+ name: p18.name,
1431
+ optional: p18.optional,
1432
+ type: p18.optional && !p18.type.includes("undefined") ? `${p18.type} | undefined` : p18.type
1433
1433
  }));
1434
1434
  const formattedDeps = dependencies.map((dep) => ({
1435
1435
  key: toCamelCase(dep),
@@ -2104,7 +2104,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2104
2104
  }
2105
2105
  if (!name) {
2106
2106
  name = handleCancel(
2107
- await p14.text({
2107
+ await p15.text({
2108
2108
  message: "What is the feature name?",
2109
2109
  placeholder: "e.g. users, auth, orders, billing",
2110
2110
  validate: (val) => {
@@ -2120,7 +2120,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2120
2120
  let targetDirRel = defaultDir;
2121
2121
  if (!flags.yes && !flags.target && !flags.dest) {
2122
2122
  targetDirRel = handleCancel(
2123
- await p14.text({
2123
+ await p15.text({
2124
2124
  message: "Target directory for the feature:",
2125
2125
  initialValue: defaultDir,
2126
2126
  defaultValue: defaultDir
@@ -2142,14 +2142,14 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2142
2142
  const customUseCases = [];
2143
2143
  if (!flags.yes) {
2144
2144
  includeExpress = handleCancel(
2145
- await p14.confirm({
2145
+ await p15.confirm({
2146
2146
  message: "Include Express Presentation layer (pxExpress routes & handlers)?",
2147
2147
  initialValue: true
2148
2148
  })
2149
2149
  );
2150
2150
  if (includeExpress) {
2151
2151
  routePath = handleCancel(
2152
- await p14.text({
2152
+ await p15.text({
2153
2153
  message: "Express route prefix:",
2154
2154
  initialValue: `/${normalizedName}`,
2155
2155
  defaultValue: `/${normalizedName}`
@@ -2157,14 +2157,14 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2157
2157
  ).trim();
2158
2158
  }
2159
2159
  includeDomain = handleCancel(
2160
- await p14.confirm({
2160
+ await p15.confirm({
2161
2161
  message: "Include Domain Entity/Entities?",
2162
2162
  initialValue: true
2163
2163
  })
2164
2164
  );
2165
2165
  if (includeDomain) {
2166
2166
  const domainInput = handleCancel(
2167
- await p14.text({
2167
+ await p15.text({
2168
2168
  message: "Domain entity name(s) (comma-separated):",
2169
2169
  initialValue: defaultEntity,
2170
2170
  defaultValue: defaultEntity,
@@ -2183,21 +2183,21 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2183
2183
  entityNames = [defaultEntity];
2184
2184
  }
2185
2185
  includeInterface = handleCancel(
2186
- await p14.confirm({
2186
+ await p15.confirm({
2187
2187
  message: `Include Domain Repository interface(s) for ${entityNames.join(", ")}?`,
2188
2188
  initialValue: true
2189
2189
  })
2190
2190
  );
2191
2191
  if (includeInterface) {
2192
2192
  includeInfra = handleCancel(
2193
- await p14.confirm({
2193
+ await p15.confirm({
2194
2194
  message: `Include Infrastructure Stub implementation(s) for ${entityNames.join(", ")}?`,
2195
2195
  initialValue: true
2196
2196
  })
2197
2197
  );
2198
2198
  }
2199
2199
  includeUseCase = handleCancel(
2200
- await p14.confirm({
2200
+ await p15.confirm({
2201
2201
  message: "Include Domain Use Cases?",
2202
2202
  initialValue: true
2203
2203
  })
@@ -2211,7 +2211,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2211
2211
  { value: "delete", label: "Delete (Delete<Entity>)", hint: "DELETE /:id" }
2212
2212
  ];
2213
2213
  crudOperations = handleCancel(
2214
- await p14.multiselect({
2214
+ await p15.multiselect({
2215
2215
  message: "Select standard CRUD use cases to generate:",
2216
2216
  options: crudChoices,
2217
2217
  initialValues: ["create", "read", "list", "update", "delete"],
@@ -2219,13 +2219,13 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2219
2219
  })
2220
2220
  );
2221
2221
  includeTests = handleCancel(
2222
- await p14.confirm({
2222
+ await p15.confirm({
2223
2223
  message: "Generate Vitest unit tests for use cases?",
2224
2224
  initialValue: true
2225
2225
  })
2226
2226
  );
2227
2227
  const wantCustom = handleCancel(
2228
- await p14.confirm({
2228
+ await p15.confirm({
2229
2229
  message: "Do you want to add any custom use cases to this feature?",
2230
2230
  initialValue: false
2231
2231
  })
@@ -2235,7 +2235,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2235
2235
  const availableIfaces = entityNames.map((e) => `I${e}Repository`);
2236
2236
  while (addMore) {
2237
2237
  const customName = handleCancel(
2238
- await p14.text({
2238
+ await p15.text({
2239
2239
  message: "Custom Use Case name:",
2240
2240
  placeholder: "e.g. ResetPassword, VerifyEmail, AssignRole",
2241
2241
  validate: (v) => v && v.trim() ? void 0 : "Use Case name cannot be empty"
@@ -2245,7 +2245,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2245
2245
  let selectedDeps = [];
2246
2246
  if (availableIfaces.length > 0) {
2247
2247
  selectedDeps = handleCancel(
2248
- await p14.multiselect({
2248
+ await p15.multiselect({
2249
2249
  message: `Select domain interfaces to inject into ${customUcName}:`,
2250
2250
  options: availableIfaces.map((i) => ({ value: i, label: i })),
2251
2251
  required: false
@@ -2254,7 +2254,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2254
2254
  }
2255
2255
  let customInputProps = [];
2256
2256
  const hasInput = handleCancel(
2257
- await p14.confirm({
2257
+ await p15.confirm({
2258
2258
  message: `Does ${customUcName} accept input arguments?`,
2259
2259
  initialValue: true
2260
2260
  })
@@ -2265,7 +2265,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2265
2265
  }
2266
2266
  let customOutputProps = [];
2267
2267
  const hasCustomOutput = handleCancel(
2268
- await p14.confirm({
2268
+ await p15.confirm({
2269
2269
  message: `Does ${customUcName} return custom output data?`,
2270
2270
  initialValue: false
2271
2271
  })
@@ -2275,7 +2275,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2275
2275
  });
2276
2276
  }
2277
2277
  const customIncludeTest = handleCancel(
2278
- await p14.confirm({
2278
+ await p15.confirm({
2279
2279
  message: `Generate Vitest unit test for ${customUcName}?`,
2280
2280
  initialValue: true
2281
2281
  })
@@ -2285,14 +2285,14 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2285
2285
  let customHttpPath = `/${toKebabCase(customUcName)}`;
2286
2286
  if (includeExpress) {
2287
2287
  customCreateHttp = handleCancel(
2288
- await p14.confirm({
2288
+ await p15.confirm({
2289
2289
  message: `Generate a matching ExpressRoute HTTP handler for ${customUcName}?`,
2290
2290
  initialValue: true
2291
2291
  })
2292
2292
  );
2293
2293
  if (customCreateHttp) {
2294
2294
  customHttpMethod = handleCancel(
2295
- await p14.select({
2295
+ await p15.select({
2296
2296
  message: "HTTP method for route:",
2297
2297
  options: [
2298
2298
  { value: "post", label: "POST" },
@@ -2305,7 +2305,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2305
2305
  })
2306
2306
  );
2307
2307
  customHttpPath = handleCancel(
2308
- await p14.text({
2308
+ await p15.text({
2309
2309
  message: "Route subpath (relative to feature prefix):",
2310
2310
  initialValue: `/${toKebabCase(customUcName)}`,
2311
2311
  defaultValue: `/${toKebabCase(customUcName)}`
@@ -2326,7 +2326,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2326
2326
  validationFields: customInputProps
2327
2327
  });
2328
2328
  addMore = handleCancel(
2329
- await p14.confirm({
2329
+ await p15.confirm({
2330
2330
  message: "Add another custom use case?",
2331
2331
  initialValue: false
2332
2332
  })
@@ -2335,7 +2335,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2335
2335
  }
2336
2336
  }
2337
2337
  includeDiProvider = handleCancel(
2338
- await p14.confirm({
2338
+ await p15.confirm({
2339
2339
  message: "Generate / update feature DI provider (diProvider.ts)?",
2340
2340
  initialValue: true
2341
2341
  })
@@ -2347,8 +2347,8 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2347
2347
  entityNames = [defaultEntity];
2348
2348
  }
2349
2349
  }
2350
- const s = p14.spinner();
2351
- s.start(`Generating feature '${pc14.cyan(normalizedName)}'...`);
2350
+ const s = p15.spinner();
2351
+ s.start(`Generating feature '${pc15.cyan(normalizedName)}'...`);
2352
2352
  const options = {
2353
2353
  name: normalizedName,
2354
2354
  projectRoot,
@@ -2394,8 +2394,8 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
2394
2394
  }
2395
2395
  s.stop("Feature scaffolded successfully!");
2396
2396
  printGeneratedFiles(files, options.dryRun);
2397
- p14.outro(
2398
- pc14.green(
2397
+ p15.outro(
2398
+ pc15.green(
2399
2399
  `\u2713 Feature '${normalizedName}' initialized in ${path2.relative(projectRoot, targetDir)} (uncommitted, unregistered)`
2400
2400
  )
2401
2401
  );
@@ -2509,7 +2509,7 @@ async function runSharedCommand(sharedNameArg, flags = {}) {
2509
2509
  }
2510
2510
  if (!name) {
2511
2511
  name = handleCancel(
2512
- await p14.text({
2512
+ await p15.text({
2513
2513
  message: "What is the shared module name?",
2514
2514
  placeholder: "e.g. hasher, time, uuid, cache, logger",
2515
2515
  validate: (val) => {
@@ -2525,7 +2525,7 @@ async function runSharedCommand(sharedNameArg, flags = {}) {
2525
2525
  let targetDirRel = defaultDir;
2526
2526
  if (!flags.yes && !flags.target && !flags.dest) {
2527
2527
  targetDirRel = handleCancel(
2528
- await p14.text({
2528
+ await p15.text({
2529
2529
  message: "Target directory for the shared module:",
2530
2530
  initialValue: defaultDir,
2531
2531
  defaultValue: defaultDir
@@ -2537,21 +2537,21 @@ async function runSharedCommand(sharedNameArg, flags = {}) {
2537
2537
  let includeStub = true;
2538
2538
  if (!flags.yes) {
2539
2539
  description = handleCancel(
2540
- await p14.text({
2540
+ await p15.text({
2541
2541
  message: "Module description (optional):",
2542
2542
  placeholder: "e.g. In-memory caching and Redis port abstraction",
2543
2543
  initialValue: ""
2544
2544
  })
2545
2545
  ).trim();
2546
2546
  includeStub = handleCancel(
2547
- await p14.confirm({
2547
+ await p15.confirm({
2548
2548
  message: "Include stub implementation in infrastructure/?",
2549
2549
  initialValue: true
2550
2550
  })
2551
2551
  );
2552
2552
  }
2553
- const s = p14.spinner();
2554
- s.start(`Generating shared module '${pc14.cyan(normalizedName)}'...`);
2553
+ const s = p15.spinner();
2554
+ s.start(`Generating shared module '${pc15.cyan(normalizedName)}'...`);
2555
2555
  const files = generateShared({
2556
2556
  name: normalizedName,
2557
2557
  description,
@@ -2564,8 +2564,8 @@ async function runSharedCommand(sharedNameArg, flags = {}) {
2564
2564
  });
2565
2565
  s.stop("Shared module generated successfully!");
2566
2566
  printGeneratedFiles(files, Boolean(flags.dryRun));
2567
- p14.outro(
2568
- pc14.green(
2567
+ p15.outro(
2568
+ pc15.green(
2569
2569
  `\u2713 Shared module '${normalizedName}' initialized in ${path2.relative(projectRoot, targetDir)} (uncommitted, unregistered)`
2570
2570
  )
2571
2571
  );
@@ -2579,14 +2579,14 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
2579
2579
  const featureOptions = existingFeatures.map((f) => ({ value: f, label: f }));
2580
2580
  featureOptions.push({ value: "__custom__", label: "\u270F\uFE0F Enter custom feature name..." });
2581
2581
  const selected = handleCancel(
2582
- await p14.select({
2582
+ await p15.select({
2583
2583
  message: "Select target feature:",
2584
2584
  options: featureOptions
2585
2585
  })
2586
2586
  );
2587
2587
  if (selected === "__custom__") {
2588
2588
  feature = handleCancel(
2589
- await p14.text({
2589
+ await p15.text({
2590
2590
  message: "Enter feature name:",
2591
2591
  validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
2592
2592
  })
@@ -2596,7 +2596,7 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
2596
2596
  }
2597
2597
  } else {
2598
2598
  feature = handleCancel(
2599
- await p14.text({
2599
+ await p15.text({
2600
2600
  message: "Enter target feature name:",
2601
2601
  validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
2602
2602
  })
@@ -2607,7 +2607,7 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
2607
2607
  let name = useCaseNameArg?.trim();
2608
2608
  if (!name) {
2609
2609
  name = handleCancel(
2610
- await p14.text({
2610
+ await p15.text({
2611
2611
  message: "Use Case name:",
2612
2612
  placeholder: "e.g. CreateUser, GetUser, CancelOrder",
2613
2613
  validate: (v) => v && v.trim() ? void 0 : "Use Case name cannot be empty"
@@ -2623,7 +2623,7 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
2623
2623
  label: i.name
2624
2624
  }));
2625
2625
  selectedDeps = handleCancel(
2626
- await p14.multiselect({
2626
+ await p15.multiselect({
2627
2627
  message: "Select domain interfaces to inject into use case:",
2628
2628
  options: multiOptions,
2629
2629
  required: false
@@ -2638,7 +2638,7 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
2638
2638
  let httpPath = "/";
2639
2639
  if (!flags.yes) {
2640
2640
  const hasInput = handleCancel(
2641
- await p14.confirm({
2641
+ await p15.confirm({
2642
2642
  message: "Does this use case accept input arguments?",
2643
2643
  initialValue: true
2644
2644
  })
@@ -2648,7 +2648,7 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
2648
2648
  });
2649
2649
  }
2650
2650
  const hasCustomOutput = handleCancel(
2651
- await p14.confirm({
2651
+ await p15.confirm({
2652
2652
  message: "Does this use case return custom output data?",
2653
2653
  initialValue: false
2654
2654
  })
@@ -2658,20 +2658,20 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
2658
2658
  });
2659
2659
  }
2660
2660
  includeTest = handleCancel(
2661
- await p14.confirm({
2661
+ await p15.confirm({
2662
2662
  message: "Generate Vitest unit test skeleton (.test.ts)?",
2663
2663
  initialValue: true
2664
2664
  })
2665
2665
  );
2666
2666
  createHttp = handleCancel(
2667
- await p14.confirm({
2667
+ await p15.confirm({
2668
2668
  message: "Generate a matching ExpressRoute HTTP handler?",
2669
2669
  initialValue: false
2670
2670
  })
2671
2671
  );
2672
2672
  if (createHttp) {
2673
2673
  httpMethod = handleCancel(
2674
- await p14.select({
2674
+ await p15.select({
2675
2675
  message: "HTTP method for route:",
2676
2676
  options: [
2677
2677
  { value: "post", label: "POST" },
@@ -2684,7 +2684,7 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
2684
2684
  })
2685
2685
  );
2686
2686
  httpPath = handleCancel(
2687
- await p14.text({
2687
+ await p15.text({
2688
2688
  message: "Route subpath (relative to feature prefix):",
2689
2689
  initialValue: "/",
2690
2690
  defaultValue: "/"
@@ -2692,8 +2692,8 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
2692
2692
  ).trim();
2693
2693
  }
2694
2694
  }
2695
- const s = p14.spinner();
2696
- s.start(`Generating use case '${pc14.cyan(ucName)}'...`);
2695
+ const s = p15.spinner();
2696
+ s.start(`Generating use case '${pc15.cyan(ucName)}'...`);
2697
2697
  const options = {
2698
2698
  name: ucName,
2699
2699
  feature,
@@ -2725,7 +2725,7 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
2725
2725
  }
2726
2726
  s.stop("Use case generated successfully!");
2727
2727
  printGeneratedFiles(files, options.dryRun);
2728
- p14.outro(pc14.green(`Use case '${ucName}' created in feature '${feature}'!`));
2728
+ p15.outro(pc15.green(`Use case '${ucName}' created in feature '${feature}'!`));
2729
2729
  }
2730
2730
  async function runDomainCommand(domainNameArg, flags = {}) {
2731
2731
  const projectRoot = findProjectRoot();
@@ -2736,14 +2736,14 @@ async function runDomainCommand(domainNameArg, flags = {}) {
2736
2736
  const featureOptions = existingFeatures.map((f) => ({ value: f, label: f }));
2737
2737
  featureOptions.push({ value: "__custom__", label: "\u270F\uFE0F Enter custom feature name..." });
2738
2738
  const selected = handleCancel(
2739
- await p14.select({
2739
+ await p15.select({
2740
2740
  message: "Select target feature:",
2741
2741
  options: featureOptions
2742
2742
  })
2743
2743
  );
2744
2744
  if (selected === "__custom__") {
2745
2745
  feature = handleCancel(
2746
- await p14.text({
2746
+ await p15.text({
2747
2747
  message: "Enter feature name:",
2748
2748
  validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
2749
2749
  })
@@ -2753,7 +2753,7 @@ async function runDomainCommand(domainNameArg, flags = {}) {
2753
2753
  }
2754
2754
  } else {
2755
2755
  feature = handleCancel(
2756
- await p14.text({
2756
+ await p15.text({
2757
2757
  message: "Enter target feature name:",
2758
2758
  validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
2759
2759
  })
@@ -2764,7 +2764,7 @@ async function runDomainCommand(domainNameArg, flags = {}) {
2764
2764
  let name = domainNameArg?.trim();
2765
2765
  if (!name) {
2766
2766
  name = handleCancel(
2767
- await p14.text({
2767
+ await p15.text({
2768
2768
  message: "Domain model / entity name:",
2769
2769
  placeholder: "e.g. User, Order, Product, Address",
2770
2770
  validate: (v) => v && v.trim() ? void 0 : "Domain name cannot be empty"
@@ -2776,7 +2776,7 @@ async function runDomainCommand(domainNameArg, flags = {}) {
2776
2776
  let properties = [];
2777
2777
  if (!flags.yes) {
2778
2778
  kind = handleCancel(
2779
- await p14.select({
2779
+ await p15.select({
2780
2780
  message: "Select domain model type:",
2781
2781
  options: [
2782
2782
  { value: "interface", label: "TypeScript Interface (pure data structure)" },
@@ -2795,8 +2795,8 @@ async function runDomainCommand(domainNameArg, flags = {}) {
2795
2795
  defaults: kind === "valueObject" ? [{ name: "value", type: "string" }] : defaultProps
2796
2796
  });
2797
2797
  }
2798
- const s = p14.spinner();
2799
- s.start(`Generating domain model '${pc14.cyan(entityName)}'...`);
2798
+ const s = p15.spinner();
2799
+ s.start(`Generating domain model '${pc15.cyan(entityName)}'...`);
2800
2800
  const options = {
2801
2801
  name: entityName,
2802
2802
  feature,
@@ -2809,7 +2809,7 @@ async function runDomainCommand(domainNameArg, flags = {}) {
2809
2809
  const file = generateDomain(options);
2810
2810
  s.stop("Domain model generated successfully!");
2811
2811
  printGeneratedFiles([file], options.dryRun);
2812
- p14.outro(pc14.green(`Domain model '${entityName}' created in feature '${feature}'!`));
2812
+ p15.outro(pc15.green(`Domain model '${entityName}' created in feature '${feature}'!`));
2813
2813
  }
2814
2814
  async function runInfrastructureCommand(classNameArg, flags = {}) {
2815
2815
  const projectRoot = findProjectRoot();
@@ -2818,7 +2818,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
2818
2818
  let feature = flags.feature?.trim();
2819
2819
  if (!flags.yes && !flags.global && !flags.feature) {
2820
2820
  scope = handleCancel(
2821
- await p14.select({
2821
+ await p15.select({
2822
2822
  message: "Where should this infrastructure implementation be placed?",
2823
2823
  options: [
2824
2824
  { value: "feature", label: "Feature-level (features/<feature>/infrastructure)" },
@@ -2833,14 +2833,14 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
2833
2833
  const featureOptions = existingFeatures.map((f) => ({ value: f, label: f }));
2834
2834
  featureOptions.push({ value: "__custom__", label: "\u270F\uFE0F Enter custom feature name..." });
2835
2835
  const selected = handleCancel(
2836
- await p14.select({
2836
+ await p15.select({
2837
2837
  message: "Select target feature:",
2838
2838
  options: featureOptions
2839
2839
  })
2840
2840
  );
2841
2841
  if (selected === "__custom__") {
2842
2842
  feature = handleCancel(
2843
- await p14.text({
2843
+ await p15.text({
2844
2844
  message: "Enter feature name:",
2845
2845
  validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
2846
2846
  })
@@ -2850,7 +2850,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
2850
2850
  }
2851
2851
  } else {
2852
2852
  feature = handleCancel(
2853
- await p14.text({
2853
+ await p15.text({
2854
2854
  message: "Enter target feature name:",
2855
2855
  validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
2856
2856
  })
@@ -2863,7 +2863,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
2863
2863
  let name = classNameArg?.trim();
2864
2864
  if (!name) {
2865
2865
  name = handleCancel(
2866
- await p14.text({
2866
+ await p15.text({
2867
2867
  message: "Infrastructure class name:",
2868
2868
  placeholder: "e.g. StubUserRepository, PostgresUserRepository, S3FileStorage",
2869
2869
  validate: (v) => v && v.trim() ? void 0 : "Class name cannot be empty"
@@ -2882,7 +2882,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
2882
2882
  (i) => className.toLowerCase().includes(removeInterfacePrefix(i.name).toLowerCase())
2883
2883
  );
2884
2884
  const ifaceChoice = handleCancel(
2885
- await p14.select({
2885
+ await p15.select({
2886
2886
  message: "Does this class implement a domain interface or abstract class?",
2887
2887
  options: [
2888
2888
  ...interfaces.map((i) => ({ value: i.name, label: i.name })),
@@ -2894,7 +2894,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
2894
2894
  );
2895
2895
  if (ifaceChoice === "__custom__") {
2896
2896
  implementsInterface = handleCancel(
2897
- await p14.text({
2897
+ await p15.text({
2898
2898
  message: "Enter interface or abstract class name:",
2899
2899
  placeholder: "e.g. IUserRepository, BaseStorageAdapter",
2900
2900
  validate: (v) => v && v.trim() ? void 0 : "Name cannot be empty"
@@ -2905,14 +2905,14 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
2905
2905
  }
2906
2906
  } else {
2907
2907
  const wantImpl = handleCancel(
2908
- await p14.confirm({
2908
+ await p15.confirm({
2909
2909
  message: "Does this class implement a domain interface or abstract class?",
2910
2910
  initialValue: false
2911
2911
  })
2912
2912
  );
2913
2913
  if (wantImpl) {
2914
2914
  implementsInterface = handleCancel(
2915
- await p14.text({
2915
+ await p15.text({
2916
2916
  message: "Enter interface or abstract class name:",
2917
2917
  placeholder: "e.g. IUserRepository, BaseStorageAdapter",
2918
2918
  validate: (v) => v && v.trim() ? void 0 : "Name cannot be empty"
@@ -2932,7 +2932,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
2932
2932
  const allInterfaces = listDomainInterfaces(projectRoot);
2933
2933
  if (allInterfaces.length > 0) {
2934
2934
  const ifaceChoice = handleCancel(
2935
- await p14.select({
2935
+ await p15.select({
2936
2936
  message: "Does this class implement an interface or abstract class?",
2937
2937
  options: [
2938
2938
  ...allInterfaces.map((i) => ({ value: i.name, label: `${i.name} (${i.feature})` })),
@@ -2944,7 +2944,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
2944
2944
  );
2945
2945
  if (ifaceChoice === "__custom__") {
2946
2946
  implementsInterface = handleCancel(
2947
- await p14.text({
2947
+ await p15.text({
2948
2948
  message: "Enter interface or abstract class name:",
2949
2949
  placeholder: "e.g. IAuthRepository",
2950
2950
  validate: (v) => v && v.trim() ? void 0 : "Name cannot be empty"
@@ -2957,7 +2957,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
2957
2957
  }
2958
2958
  if (!flags.yes && !flags.kind) {
2959
2959
  kind = handleCancel(
2960
- await p14.select({
2960
+ await p15.select({
2961
2961
  message: "Select implementation kind:",
2962
2962
  options: [
2963
2963
  { value: "stub", label: "In-Memory Stub (with in-memory store and test helper methods)" },
@@ -2968,7 +2968,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
2968
2968
  );
2969
2969
  if (scope === "feature" && feature && implementsInterface) {
2970
2970
  registerInProvider = handleCancel(
2971
- await p14.confirm({
2971
+ await p15.confirm({
2972
2972
  message: "Register this implementation in feature diProvider.ts?",
2973
2973
  initialValue: true
2974
2974
  })
@@ -2977,8 +2977,8 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
2977
2977
  } else if (flags.yes && scope === "feature" && feature && implementsInterface) {
2978
2978
  registerInProvider = !flags.noProvider;
2979
2979
  }
2980
- const s = p14.spinner();
2981
- s.start(`Generating infrastructure class '${pc14.cyan(className)}'...`);
2980
+ const s = p15.spinner();
2981
+ s.start(`Generating infrastructure class '${pc15.cyan(className)}'...`);
2982
2982
  const files = [];
2983
2983
  const options = {
2984
2984
  name: className,
@@ -3013,7 +3013,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
3013
3013
  }
3014
3014
  s.stop("Infrastructure class generated successfully!");
3015
3015
  printGeneratedFiles(files, options.dryRun);
3016
- p14.outro(pc14.green(`Infrastructure class '${className}' created!`));
3016
+ p15.outro(pc15.green(`Infrastructure class '${className}' created!`));
3017
3017
  }
3018
3018
  async function runInterfaceCommand(interfaceNameArg, flags = {}) {
3019
3019
  const projectRoot = findProjectRoot();
@@ -3024,14 +3024,14 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
3024
3024
  const featureOptions = existingFeatures.map((f) => ({ value: f, label: f }));
3025
3025
  featureOptions.push({ value: "__custom__", label: "\u270F\uFE0F Enter custom feature name..." });
3026
3026
  const selected = handleCancel(
3027
- await p14.select({
3027
+ await p15.select({
3028
3028
  message: "Select target feature:",
3029
3029
  options: featureOptions
3030
3030
  })
3031
3031
  );
3032
3032
  if (selected === "__custom__") {
3033
3033
  feature = handleCancel(
3034
- await p14.text({
3034
+ await p15.text({
3035
3035
  message: "Enter feature name:",
3036
3036
  validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
3037
3037
  })
@@ -3041,7 +3041,7 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
3041
3041
  }
3042
3042
  } else {
3043
3043
  feature = handleCancel(
3044
- await p14.text({
3044
+ await p15.text({
3045
3045
  message: "Enter target feature name:",
3046
3046
  validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
3047
3047
  })
@@ -3052,7 +3052,7 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
3052
3052
  let name = interfaceNameArg?.trim();
3053
3053
  if (!name) {
3054
3054
  name = handleCancel(
3055
- await p14.text({
3055
+ await p15.text({
3056
3056
  message: "Domain interface name:",
3057
3057
  placeholder: "e.g. IUserRepository, IPaymentService",
3058
3058
  validate: (v) => v && v.trim() ? void 0 : "Interface name cannot be empty"
@@ -3070,7 +3070,7 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
3070
3070
  if (!flags.yes) {
3071
3071
  if (existingEntities.length > 0) {
3072
3072
  const selectedEntity = handleCancel(
3073
- await p14.select({
3073
+ await p15.select({
3074
3074
  message: "Select domain entity associated with this interface:",
3075
3075
  options: [
3076
3076
  ...existingEntities.map((e) => ({ value: e.name, label: e.name })),
@@ -3081,7 +3081,7 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
3081
3081
  );
3082
3082
  if (selectedEntity === "__custom__") {
3083
3083
  entityName = handleCancel(
3084
- await p14.text({
3084
+ await p15.text({
3085
3085
  message: "Enter entity name:",
3086
3086
  defaultValue: removeInterfacePrefix(ifaceName).replace(/Repository$|Service$/, "")
3087
3087
  })
@@ -3091,7 +3091,7 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
3091
3091
  }
3092
3092
  }
3093
3093
  kind = handleCancel(
3094
- await p14.select({
3094
+ await p15.select({
3095
3095
  message: "Interface definition style:",
3096
3096
  options: [
3097
3097
  { value: "abstractClass", label: "Abstract Class (Recommended - acts as DI token & type)" },
@@ -3101,7 +3101,7 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
3101
3101
  })
3102
3102
  );
3103
3103
  methodsPreset = handleCancel(
3104
- await p14.select({
3104
+ await p15.select({
3105
3105
  message: "Method signature preset:",
3106
3106
  options: [
3107
3107
  { value: "crud", label: "Standard CRUD (GetById, List, Create, Update, Delete)" },
@@ -3111,22 +3111,22 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
3111
3111
  })
3112
3112
  );
3113
3113
  generateStub = handleCancel(
3114
- await p14.confirm({
3114
+ await p15.confirm({
3115
3115
  message: "Auto-generate Infrastructure Stub implementation?",
3116
3116
  initialValue: true
3117
3117
  })
3118
3118
  );
3119
3119
  if (generateStub) {
3120
3120
  registerInProvider = handleCancel(
3121
- await p14.confirm({
3121
+ await p15.confirm({
3122
3122
  message: "Auto-register interface & stub in feature diProvider.ts?",
3123
3123
  initialValue: true
3124
3124
  })
3125
3125
  );
3126
3126
  }
3127
3127
  }
3128
- const s = p14.spinner();
3129
- s.start(`Generating interface '${pc14.cyan(ifaceName)}'...`);
3128
+ const s = p15.spinner();
3129
+ s.start(`Generating interface '${pc15.cyan(ifaceName)}'...`);
3130
3130
  const files = [];
3131
3131
  const options = {
3132
3132
  name: ifaceName,
@@ -3175,7 +3175,7 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
3175
3175
  }
3176
3176
  s.stop("Interface generated successfully!");
3177
3177
  printGeneratedFiles(files, options.dryRun);
3178
- p14.outro(pc14.green(`Interface '${ifaceName}' created in feature '${feature}'!`));
3178
+ p15.outro(pc15.green(`Interface '${ifaceName}' created in feature '${feature}'!`));
3179
3179
  }
3180
3180
  async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
3181
3181
  const projectRoot = findProjectRoot();
@@ -3186,14 +3186,14 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
3186
3186
  const featureOptions = existingFeatures.map((f) => ({ value: f, label: f }));
3187
3187
  featureOptions.push({ value: "__custom__", label: "\u270F\uFE0F Enter custom feature name..." });
3188
3188
  const selected = handleCancel(
3189
- await p14.select({
3189
+ await p15.select({
3190
3190
  message: "Select target feature:",
3191
3191
  options: featureOptions
3192
3192
  })
3193
3193
  );
3194
3194
  if (selected === "__custom__") {
3195
3195
  feature = handleCancel(
3196
- await p14.text({
3196
+ await p15.text({
3197
3197
  message: "Enter feature name:",
3198
3198
  validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
3199
3199
  })
@@ -3203,7 +3203,7 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
3203
3203
  }
3204
3204
  } else {
3205
3205
  feature = handleCancel(
3206
- await p14.text({
3206
+ await p15.text({
3207
3207
  message: "Enter target feature name:",
3208
3208
  validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
3209
3209
  })
@@ -3214,7 +3214,7 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
3214
3214
  let name = handlerNameArg?.trim();
3215
3215
  if (!name) {
3216
3216
  name = handleCancel(
3217
- await p14.text({
3217
+ await p15.text({
3218
3218
  message: "HTTP Route Handler class name:",
3219
3219
  placeholder: "e.g. CreateUserHttp, GetUserHttp, HealthHttp",
3220
3220
  validate: (v) => v && v.trim() ? void 0 : "Handler name cannot be empty"
@@ -3233,7 +3233,7 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
3233
3233
  let validationFields = [];
3234
3234
  if (!flags.yes) {
3235
3235
  method = handleCancel(
3236
- await p14.select({
3236
+ await p15.select({
3237
3237
  message: "HTTP Method:",
3238
3238
  options: [
3239
3239
  { value: "get", label: "GET" },
@@ -3247,7 +3247,7 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
3247
3247
  );
3248
3248
  const defaultPath = method === "get" ? "/" : "/";
3249
3249
  subPath = handleCancel(
3250
- await p14.text({
3250
+ await p15.text({
3251
3251
  message: "Route subpath (relative to feature prefix):",
3252
3252
  initialValue: defaultPath,
3253
3253
  defaultValue: defaultPath
@@ -3258,7 +3258,7 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
3258
3258
  const ucOptions = useCases.map((u) => ({ value: u.name, label: u.name }));
3259
3259
  ucOptions.push({ value: "__none__", label: "None / Standalone Handler" });
3260
3260
  const chosenUc = handleCancel(
3261
- await p14.select({
3261
+ await p15.select({
3262
3262
  message: "Connect this handler to a domain Use Case?",
3263
3263
  options: ucOptions,
3264
3264
  initialValue: ucOptions[0]?.value
@@ -3269,7 +3269,7 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
3269
3269
  }
3270
3270
  }
3271
3271
  includeValidation = handleCancel(
3272
- await p14.confirm({
3272
+ await p15.confirm({
3273
3273
  message: "Include Zod inbound request validation?",
3274
3274
  initialValue: method !== "delete"
3275
3275
  })
@@ -3277,7 +3277,7 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
3277
3277
  if (includeValidation) {
3278
3278
  const defaultSource = method === "get" ? "query" : "body";
3279
3279
  validationSource = handleCancel(
3280
- await p14.select({
3280
+ await p15.select({
3281
3281
  message: "Validation data source:",
3282
3282
  options: [
3283
3283
  { value: "body", label: "req.body (for POST / PUT / PATCH payloads)" },
@@ -3291,8 +3291,8 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
3291
3291
  });
3292
3292
  }
3293
3293
  }
3294
- const s = p14.spinner();
3295
- s.start(`Generating HTTP handler '${pc14.cyan(className)}'...`);
3294
+ const s = p15.spinner();
3295
+ s.start(`Generating HTTP handler '${pc15.cyan(className)}'...`);
3296
3296
  const options = {
3297
3297
  name: className,
3298
3298
  feature,
@@ -3310,7 +3310,7 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
3310
3310
  const files = generateHttpHandler(options);
3311
3311
  s.stop("HTTP handler generated successfully!");
3312
3312
  printGeneratedFiles(files, options.dryRun);
3313
- p14.outro(pc14.green(`HTTP handler '${className}' created in feature '${feature}'!`));
3313
+ p15.outro(pc15.green(`HTTP handler '${className}' created in feature '${feature}'!`));
3314
3314
  }
3315
3315
  function generateInjectableCode(className, dependencies = [], methods = [], implementsInterface) {
3316
3316
  const formattedDeps = dependencies.map((dep) => ({
@@ -3320,7 +3320,7 @@ function generateInjectableCode(className, dependencies = [], methods = [], impl
3320
3320
  const formattedMethods = methods.map((m) => {
3321
3321
  const isAsync = m.async !== false;
3322
3322
  const retType = m.returnType ? isAsync ? `Promise<${m.returnType}>` : m.returnType : isAsync ? "Promise<void>" : "void";
3323
- const params = m.params && m.params.length > 0 ? m.params.map((p16) => `${p16.name}: ${p16.type}`).join(", ") : "";
3323
+ const params = m.params && m.params.length > 0 ? m.params.map((p18) => `${p18.name}: ${p18.type}`).join(", ") : "";
3324
3324
  return {
3325
3325
  name: m.name,
3326
3326
  isAsync,
@@ -3390,7 +3390,7 @@ async function runInjectableCommand(classNameArg, flags = {}) {
3390
3390
  let name = classNameArg?.trim();
3391
3391
  if (!name) {
3392
3392
  name = handleCancel(
3393
- await p14.text({
3393
+ await p15.text({
3394
3394
  message: "Injectable class name:",
3395
3395
  placeholder: "e.g. PasswordHasher, TokenService, UserTransformer",
3396
3396
  validate: (v) => v && v.trim() ? void 0 : "Class name cannot be empty"
@@ -3403,7 +3403,7 @@ async function runInjectableCommand(classNameArg, flags = {}) {
3403
3403
  let customPath;
3404
3404
  if (!flags.yes) {
3405
3405
  location = handleCancel(
3406
- await p14.select({
3406
+ await p15.select({
3407
3407
  message: "Select target architectural location:",
3408
3408
  options: [
3409
3409
  { value: "feature-service", label: "Feature Service (features/<feature>/services/)" },
@@ -3421,14 +3421,14 @@ async function runInjectableCommand(classNameArg, flags = {}) {
3421
3421
  const featureOptions = existingFeatures.map((f) => ({ value: f, label: f }));
3422
3422
  featureOptions.push({ value: "__custom__", label: "\u270F\uFE0F Enter custom feature name..." });
3423
3423
  const selected = handleCancel(
3424
- await p14.select({
3424
+ await p15.select({
3425
3425
  message: "Select target feature:",
3426
3426
  options: featureOptions
3427
3427
  })
3428
3428
  );
3429
3429
  if (selected === "__custom__") {
3430
3430
  feature = handleCancel(
3431
- await p14.text({
3431
+ await p15.text({
3432
3432
  message: "Enter feature name:",
3433
3433
  validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
3434
3434
  })
@@ -3438,7 +3438,7 @@ async function runInjectableCommand(classNameArg, flags = {}) {
3438
3438
  }
3439
3439
  } else {
3440
3440
  feature = handleCancel(
3441
- await p14.text({
3441
+ await p15.text({
3442
3442
  message: "Enter target feature name:",
3443
3443
  validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
3444
3444
  })
@@ -3448,7 +3448,7 @@ async function runInjectableCommand(classNameArg, flags = {}) {
3448
3448
  feature = toCamelCase(feature);
3449
3449
  } else if (location === "custom") {
3450
3450
  customPath = handleCancel(
3451
- await p14.text({
3451
+ await p15.text({
3452
3452
  message: "Enter destination directory path:",
3453
3453
  placeholder: "e.g. src/services or lib/utils",
3454
3454
  validate: (v) => v && v.trim() ? void 0 : "Path cannot be empty"
@@ -3459,14 +3459,14 @@ async function runInjectableCommand(classNameArg, flags = {}) {
3459
3459
  let generateInterface2 = false;
3460
3460
  if (!flags.yes) {
3461
3461
  generateInterface2 = handleCancel(
3462
- await p14.confirm({
3462
+ await p15.confirm({
3463
3463
  message: `Generate abstract class interface (I${className}) as runtime DI token?`,
3464
3464
  initialValue: false
3465
3465
  })
3466
3466
  );
3467
3467
  }
3468
- const s = p14.spinner();
3469
- s.start(`Generating injectable '${pc14.cyan(className)}'...`);
3468
+ const s = p15.spinner();
3469
+ s.start(`Generating injectable '${pc15.cyan(className)}'...`);
3470
3470
  const options = {
3471
3471
  name: className,
3472
3472
  feature,
@@ -3480,12 +3480,44 @@ async function runInjectableCommand(classNameArg, flags = {}) {
3480
3480
  const files = generateInjectable(options);
3481
3481
  s.stop("Injectable class generated successfully!");
3482
3482
  printGeneratedFiles(files, options.dryRun);
3483
- p14.outro(pc14.green(`Injectable '${className}' created successfully!`));
3483
+ p15.outro(pc15.green(`Injectable '${className}' created successfully!`));
3484
3484
  }
3485
+ async function runEnvCommand(flags = {}) {
3486
+ const projectRoot = flags.cwd || flags.targetDir || findProjectRoot();
3487
+ const s = p15.spinner();
3488
+ s.start("Scanning for .example environment files...");
3489
+ const files = fs4.readdirSync(projectRoot);
3490
+ const exampleFiles = files.filter((file) => file.startsWith(".env") && file.endsWith(".example")).sort();
3491
+ if (exampleFiles.length === 0) {
3492
+ s.stop("No .example files found.");
3493
+ p15.log.info(pc15.yellow(`No files matching '.env*.example' were found in ${projectRoot}`));
3494
+ return [];
3495
+ }
3496
+ s.message(`Found ${exampleFiles.length} template(s). Generating...`);
3497
+ const generatedFiles = [];
3498
+ for (const exampleFile of exampleFiles) {
3499
+ const sourcePath = path2.join(projectRoot, exampleFile);
3500
+ const targetFile = exampleFile.replace(/\.example$/, "");
3501
+ const targetPath = path2.join(projectRoot, targetFile);
3502
+ const content = fs4.readFileSync(sourcePath, "utf-8");
3503
+ const genFile = writeFileSafely(targetPath, content, {
3504
+ projectRoot,
3505
+ dryRun: Boolean(flags.dryRun),
3506
+ overwrite: Boolean(flags.overwrite)
3507
+ });
3508
+ generatedFiles.push(genFile);
3509
+ }
3510
+ s.stop("Environment files processed!");
3511
+ printGeneratedFiles(generatedFiles, Boolean(flags.dryRun));
3512
+ p15.outro(pc15.green("\u2713 Local environment files are ready!"));
3513
+ return generatedFiles;
3514
+ }
3515
+
3516
+ // src/commands/menu.ts
3485
3517
  async function runInteractiveMenu(flags = {}) {
3486
3518
  printBanner();
3487
3519
  const choice = handleCancel(
3488
- await p14.select({
3520
+ await p15.select({
3489
3521
  message: "What would you like to create in your architecture?",
3490
3522
  options: [
3491
3523
  {
@@ -3527,6 +3559,11 @@ async function runInteractiveMenu(flags = {}) {
3527
3559
  value: "injectable",
3528
3560
  label: "Injectable Service",
3529
3561
  hint: "Generic @MakeInjectable class for services, transformers, or modules"
3562
+ },
3563
+ {
3564
+ value: "env",
3565
+ label: "Generate Env Files",
3566
+ hint: "Clone .env*.example files to local .env equivalents"
3530
3567
  }
3531
3568
  ]
3532
3569
  })
@@ -3556,6 +3593,9 @@ async function runInteractiveMenu(flags = {}) {
3556
3593
  case "injectable":
3557
3594
  await runInjectableCommand(void 0, flags);
3558
3595
  break;
3596
+ case "env":
3597
+ await runEnvCommand(flags);
3598
+ break;
3559
3599
  }
3560
3600
  }
3561
3601
 
@@ -3593,8 +3633,8 @@ async function handleCreate(type, name, flags = {}) {
3593
3633
  await runInjectableCommand(name, flags);
3594
3634
  break;
3595
3635
  default:
3596
- p14.log.error(
3597
- pc14.red(
3636
+ p15.log.error(
3637
+ pc15.red(
3598
3638
  `Unknown component type: "${type}". Allowed types: feature, shared, usecase, domain, infrastructure, interface, httpHandler, injectable.`
3599
3639
  )
3600
3640
  );
@@ -3602,9 +3642,9 @@ async function handleCreate(type, name, flags = {}) {
3602
3642
  }
3603
3643
  }
3604
3644
  var importPrompts = {
3605
- select: p14.select,
3606
- text: p14.text,
3607
- confirm: p14.confirm
3645
+ select: p15.select,
3646
+ text: p15.text,
3647
+ confirm: p15.confirm
3608
3648
  };
3609
3649
  function isTestFile(filePath) {
3610
3650
  const normalized = filePath.replace(/\\/g, "/");
@@ -3714,19 +3754,19 @@ async function handleImport(typeArg, nameArg, flags = {}) {
3714
3754
  );
3715
3755
  }
3716
3756
  if (type !== "shared" && type !== "feature") {
3717
- p14.log.error(pc14.red(`Invalid module type: "${typeArg}". Must be "shared" or "feature".`));
3757
+ p15.log.error(pc15.red(`Invalid module type: "${typeArg}". Must be "shared" or "feature".`));
3718
3758
  process.exit(1);
3719
3759
  }
3720
3760
  const registryBase = getRegistryBase(projectRoot, flags.registry);
3721
- const s = p14.spinner();
3722
- s.start(`Connecting to registry at ${pc14.dim(registryBase)}...`);
3761
+ const s = p15.spinner();
3762
+ s.start(`Connecting to registry at ${pc15.dim(registryBase)}...`);
3723
3763
  let index;
3724
3764
  try {
3725
3765
  index = await fetchRegistryIndex(registryBase);
3726
3766
  s.stop("Registry index loaded.");
3727
3767
  } catch (err) {
3728
- s.stop(pc14.red("Failed to load registry index."));
3729
- p14.log.error(pc14.red(err.message || String(err)));
3768
+ s.stop(pc15.red("Failed to load registry index."));
3769
+ p15.log.error(pc15.red(err.message || String(err)));
3730
3770
  process.exit(1);
3731
3771
  }
3732
3772
  const availableList = type === "shared" ? index.shared : index.features;
@@ -3734,7 +3774,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
3734
3774
  let name = nameArg?.trim();
3735
3775
  if (!name) {
3736
3776
  if (availableList.length === 0) {
3737
- p14.log.warn(`No ${type} modules available in the registry.`);
3777
+ p15.log.warn(`No ${type} modules available in the registry.`);
3738
3778
  return;
3739
3779
  }
3740
3780
  name = handleCancel(
@@ -3750,9 +3790,9 @@ async function handleImport(typeArg, nameArg, flags = {}) {
3750
3790
  }
3751
3791
  if (!candidateNames.includes(name)) {
3752
3792
  const closest = findClosestMatch(name, candidateNames);
3753
- p14.log.error(pc14.red(`\u274C Module '${name}' not found in the ${type} registry.`));
3793
+ p15.log.error(pc15.red(`\u274C Module '${name}' not found in the ${type} registry.`));
3754
3794
  if (closest) {
3755
- p14.log.info(pc14.yellow(`Did you mean '${pc14.cyan(closest)}'?`));
3795
+ p15.log.info(pc15.yellow(`Did you mean '${pc15.cyan(closest)}'?`));
3756
3796
  }
3757
3797
  process.exit(1);
3758
3798
  }
@@ -3764,7 +3804,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
3764
3804
  try {
3765
3805
  manifest = await fetchModuleManifest(registryBase, modType, modName);
3766
3806
  } catch (err) {
3767
- p14.log.error(pc14.red(`Failed to fetch manifest for ${modType} '${modName}': ${err.message}`));
3807
+ p15.log.error(pc15.red(`Failed to fetch manifest for ${modType} '${modName}': ${err.message}`));
3768
3808
  process.exit(1);
3769
3809
  }
3770
3810
  nodes.set(key, {
@@ -3804,7 +3844,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
3804
3844
  buildTopologicalOrder(rootKey);
3805
3845
  const resolutions = /* @__PURE__ */ new Map();
3806
3846
  const globalAliasMap = /* @__PURE__ */ new Map();
3807
- p14.log.step(`Importing ${type}: ${pc14.cyan(name)}...`);
3847
+ p15.log.step(`Importing ${type}: ${pc15.cyan(name)}...`);
3808
3848
  for (const key of orderedKeys) {
3809
3849
  const node = nodes.get(key);
3810
3850
  const { type: modType, name: registryName, manifest } = node;
@@ -3836,8 +3876,8 @@ async function handleImport(typeArg, nameArg, flags = {}) {
3836
3876
  const programmaticPointTo = pointToMap[registryName] || pointToMap[`${modType}/${registryName}`];
3837
3877
  if (programmaticPointTo) {
3838
3878
  if (!checkModuleExists(projectRoot, modType, programmaticPointTo)) {
3839
- p14.log.error(
3840
- pc14.red(
3879
+ p15.log.error(
3880
+ pc15.red(
3841
3881
  `Module '${programmaticPointTo}' specified in --point-to does not exist in ${folder}.`
3842
3882
  )
3843
3883
  );
@@ -3845,7 +3885,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
3845
3885
  }
3846
3886
  globalAliasMap.set(`@/${folder}/${registryName}/`, `@/${folder}/${programmaticPointTo}/`);
3847
3887
  globalAliasMap.set(`@/${folder}/${registryName}`, `@/${folder}/${programmaticPointTo}`);
3848
- p14.log.step(`Pointing '${modType}/${registryName}' to existing '${folder}/${programmaticPointTo}'`);
3888
+ p15.log.step(`Pointing '${modType}/${registryName}' to existing '${folder}/${programmaticPointTo}'`);
3849
3889
  resolutions.set(key, {
3850
3890
  type: modType,
3851
3891
  registryName,
@@ -3861,7 +3901,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
3861
3901
  globalAliasMap.set(`@/${folder}/${registryName}`, `@/${folder}/${programmaticAlias}`);
3862
3902
  const baseDir = getModuleBaseDir(projectRoot, modType);
3863
3903
  const displayDest = path2.relative(projectRoot, path2.join(baseDir, programmaticAlias));
3864
- p14.log.step(`Importing '${registryName}' into '${displayDest}'...`);
3904
+ p15.log.step(`Importing '${registryName}' into '${displayDest}'...`);
3865
3905
  resolutions.set(key, {
3866
3906
  type: modType,
3867
3907
  registryName,
@@ -3873,7 +3913,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
3873
3913
  }
3874
3914
  const existingDir = getExistingModuleDir(projectRoot, modType, registryName);
3875
3915
  if (!existingDir) {
3876
- p14.log.info(` \u21B3 Resolving required ${modType} dependency: ${pc14.cyan(registryName)}`);
3916
+ p15.log.info(` \u21B3 Resolving required ${modType} dependency: ${pc15.cyan(registryName)}`);
3877
3917
  resolutions.set(key, {
3878
3918
  type: modType,
3879
3919
  registryName,
@@ -3889,7 +3929,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
3889
3929
  const remoteIntegrity = manifest.integrity || entry?.integrity;
3890
3930
  const localHash = computeDirectoryHash(existingDir);
3891
3931
  if (remoteIntegrity && localHash === remoteIntegrity) {
3892
- p14.log.step(`\u2713 ${modType}/${registryName} is up to date (reusing existing)`);
3932
+ p15.log.step(`\u2713 ${modType}/${registryName} is up to date (reusing existing)`);
3893
3933
  resolutions.set(key, {
3894
3934
  type: modType,
3895
3935
  registryName,
@@ -3900,7 +3940,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
3900
3940
  continue;
3901
3941
  }
3902
3942
  if (flags.overwrite) {
3903
- p14.log.step(`Overwriting '${modType}/${registryName}' with registry version (--overwrite)...`);
3943
+ p15.log.step(`Overwriting '${modType}/${registryName}' with registry version (--overwrite)...`);
3904
3944
  resolutions.set(key, {
3905
3945
  type: modType,
3906
3946
  registryName,
@@ -3911,7 +3951,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
3911
3951
  continue;
3912
3952
  }
3913
3953
  if (flags.yes) {
3914
- p14.log.info(`Using existing '${modType}/${registryName}'`);
3954
+ p15.log.info(`Using existing '${modType}/${registryName}'`);
3915
3955
  resolutions.set(key, {
3916
3956
  type: modType,
3917
3957
  registryName,
@@ -3945,7 +3985,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
3945
3985
  })
3946
3986
  );
3947
3987
  if (choice === "keep_existing" || choice === "use_existing") {
3948
- p14.log.step(`Skipping '${modType}/${registryName}' (keeping existing)`);
3988
+ p15.log.step(`Skipping '${modType}/${registryName}' (keeping existing)`);
3949
3989
  resolutions.set(key, {
3950
3990
  type: modType,
3951
3991
  registryName,
@@ -4017,7 +4057,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
4017
4057
  chosenName = chosenName.replace(/^@\/(shared|features)\//, "").replace(/^(src\/)?(shared|features)\//, "").replace(/^\/+|\/+$/g, "").trim();
4018
4058
  globalAliasMap.set(`@/${folder}/${registryName}/`, `@/${folder}/${chosenName}/`);
4019
4059
  globalAliasMap.set(`@/${folder}/${registryName}`, `@/${folder}/${chosenName}`);
4020
- p14.log.step(`Pointing '${modType}/${registryName}' to existing '${folder}/${chosenName}'`);
4060
+ p15.log.step(`Pointing '${modType}/${registryName}' to existing '${folder}/${chosenName}'`);
4021
4061
  resolutions.set(key, {
4022
4062
  type: modType,
4023
4063
  registryName,
@@ -4049,7 +4089,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
4049
4089
  globalAliasMap.set(`@/${folder}/${registryName}`, `@/${folder}/${newName}`);
4050
4090
  const baseDir = getModuleBaseDir(projectRoot, modType);
4051
4091
  const displayDest = path2.relative(projectRoot, path2.join(baseDir, newName));
4052
- p14.log.step(`Importing '${registryName}' into '${displayDest}'...`);
4092
+ p15.log.step(`Importing '${registryName}' into '${displayDest}'...`);
4053
4093
  resolutions.set(key, {
4054
4094
  type: modType,
4055
4095
  registryName,
@@ -4060,7 +4100,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
4060
4100
  continue;
4061
4101
  }
4062
4102
  if (choice === "overwrite") {
4063
- p14.log.step(`Overwriting '${modType}/${registryName}' with registry version...`);
4103
+ p15.log.step(`Overwriting '${modType}/${registryName}' with registry version...`);
4064
4104
  resolutions.set(key, {
4065
4105
  type: modType,
4066
4106
  registryName,
@@ -4103,8 +4143,8 @@ async function handleImport(typeArg, nameArg, flags = {}) {
4103
4143
  const targetDir = path2.join(getModuleBaseDir(projectRoot, res.type), res.targetName);
4104
4144
  const isOverwrite = Boolean(flags.overwrite || res.action === "overwrite");
4105
4145
  if (key !== rootKey) {
4106
- p14.log.step(
4107
- `Importing ${res.type}: ${pc14.cyan(res.targetName)}${res.targetName !== res.registryName ? pc14.dim(` (from ${res.registryName})`) : ""}...`
4146
+ p15.log.step(
4147
+ `Importing ${res.type}: ${pc15.cyan(res.targetName)}${res.targetName !== res.registryName ? pc15.dim(` (from ${res.registryName})`) : ""}...`
4108
4148
  );
4109
4149
  }
4110
4150
  if (res.action === "overwrite" && !flags.dryRun) {
@@ -4122,8 +4162,8 @@ async function handleImport(typeArg, nameArg, flags = {}) {
4122
4162
  const remoteFilePath = `${folder}/${res.registryName}/${file}`;
4123
4163
  const localFilePath = path2.join(targetDir, file);
4124
4164
  if (fs4.existsSync(localFilePath) && !isOverwrite) {
4125
- p14.log.warn(
4126
- ` \u21B3 Skipping existing file: ${pc14.dim(path2.relative(projectRoot, localFilePath))} (use --overwrite to replace)`
4165
+ p15.log.warn(
4166
+ ` \u21B3 Skipping existing file: ${pc15.dim(path2.relative(projectRoot, localFilePath))} (use --overwrite to replace)`
4127
4167
  );
4128
4168
  continue;
4129
4169
  }
@@ -4135,18 +4175,18 @@ async function handleImport(typeArg, nameArg, flags = {}) {
4135
4175
  }
4136
4176
  const displayPath = path2.relative(projectRoot, localFilePath);
4137
4177
  totalWrittenFiles.push(displayPath);
4138
- p14.log.message(` ${pc14.green("+")} ${displayPath}`);
4178
+ p15.log.message(` ${pc15.green("+")} ${displayPath}`);
4139
4179
  }
4140
4180
  }
4141
4181
  const missingNpm = getMissingNpmPackages(projectRoot, Array.from(requiredNpmPackages));
4142
4182
  if (missingNpm.length > 0) {
4143
4183
  if (flags.skipInstall || flags.dryRun) {
4144
- p14.log.info(`Required npm dependencies to install: ${pc14.cyan(missingNpm.join(", "))}`);
4184
+ p15.log.info(`Required npm dependencies to install: ${pc15.cyan(missingNpm.join(", "))}`);
4145
4185
  } else {
4146
4186
  try {
4147
4187
  installNpmPackages(projectRoot, missingNpm);
4148
4188
  } catch (err) {
4149
- p14.log.warn(
4189
+ p15.log.warn(
4150
4190
  `Could not automatically install packages (${err.message}). Please run: npm install ${missingNpm.join(
4151
4191
  " "
4152
4192
  )}`
@@ -4155,13 +4195,13 @@ async function handleImport(typeArg, nameArg, flags = {}) {
4155
4195
  }
4156
4196
  }
4157
4197
  if (flags.dryRun) {
4158
- p14.log.info(pc14.yellow("Dry run complete: No files were written to disk."));
4198
+ p15.log.info(pc15.yellow("Dry run complete: No files were written to disk."));
4159
4199
  } else {
4160
4200
  const rootRes = resolutions.get(rootKey);
4161
4201
  const baseDir = getModuleBaseDir(projectRoot, type);
4162
4202
  const displayTarget = path2.relative(projectRoot, path2.join(baseDir, rootRes.targetName));
4163
- p14.log.success(
4164
- pc14.green(
4203
+ p15.log.success(
4204
+ pc15.green(
4165
4205
  `Successfully imported ${type} '${name}' (${totalWrittenFiles.length} file${totalWrittenFiles.length === 1 ? "" : "s"} placed in ${displayTarget})`
4166
4206
  )
4167
4207
  );
@@ -4384,10 +4424,10 @@ var FeatureDependencyGraph = class {
4384
4424
  if (cycle) return cycle;
4385
4425
  } else if (inStack.has(next)) {
4386
4426
  const cycle = [next];
4387
- let p16 = curr;
4388
- while (p16 !== next) {
4389
- cycle.push(p16);
4390
- p16 = parent.get(p16) || next;
4427
+ let p18 = curr;
4428
+ while (p18 !== next) {
4429
+ cycle.push(p18);
4430
+ p18 = parent.get(p18) || next;
4391
4431
  }
4392
4432
  cycle.push(next);
4393
4433
  cycle.reverse();
@@ -5289,15 +5329,15 @@ ${compiledDetails}
5289
5329
  // src/commands/lint.ts
5290
5330
  function formatViolation(v) {
5291
5331
  const lines = [];
5292
- lines.push(pc14.underline(pc14.cyan(v.relativePath)) + pc14.dim(":") + pc14.yellow(String(v.line)));
5332
+ lines.push(pc15.underline(pc15.cyan(v.relativePath)) + pc15.dim(":") + pc15.yellow(String(v.line)));
5293
5333
  const gutter = `${String(v.line).padStart(4, " ")} | `;
5294
- lines.push(pc14.dim(gutter) + v.code);
5334
+ lines.push(pc15.dim(gutter) + v.code);
5295
5335
  const categoryShort = v.category.replace(" Violation", "");
5296
5336
  lines.push(
5297
- " " + pc14.red(pc14.bold("\u2716")) + " " + pc14.red(`[${categoryShort}]`) + " " + v.advice
5337
+ " " + pc15.red(pc15.bold("\u2716")) + " " + pc15.red(`[${categoryShort}]`) + " " + v.advice
5298
5338
  );
5299
5339
  if (v.fixExample?.good) {
5300
- lines.push(" " + pc14.dim("\u2192") + " " + pc14.dim(v.fixExample.good));
5340
+ lines.push(" " + pc15.dim("\u2192") + " " + pc15.dim(v.fixExample.good));
5301
5341
  }
5302
5342
  return lines.join("\n");
5303
5343
  }
@@ -5322,7 +5362,7 @@ async function handleLint(flags = {}) {
5322
5362
  console.log("");
5323
5363
  }
5324
5364
  console.log(
5325
- pc14.red(
5365
+ pc15.red(
5326
5366
  `\u2716 Dependency rules check failed with ${summary.totalViolations} error${summary.totalViolations > 1 ? "s" : ""} across ${summary.violatedFeatures} feature${summary.violatedFeatures > 1 ? "s" : ""} (${summary.totalFeatures} features scanned).`
5327
5367
  )
5328
5368
  );
@@ -5341,7 +5381,7 @@ ${compiledDetails}
5341
5381
  }
5342
5382
  if (!quiet) {
5343
5383
  console.log(
5344
- pc14.green(
5384
+ pc15.green(
5345
5385
  `\u2714 Dependency rules verified across ${summary.totalFeatures} feature${summary.totalFeatures === 1 ? "" : "s"}.`
5346
5386
  )
5347
5387
  );
@@ -5356,21 +5396,55 @@ ${compiledDetails}
5356
5396
  console.log(formatViolation(v));
5357
5397
  console.log("");
5358
5398
  }
5359
- console.log(pc14.red(`\u2716 Dependency rules check failed (1 error).`));
5399
+ console.log(pc15.red(`\u2716 Dependency rules check failed (1 error).`));
5360
5400
  console.log("");
5361
5401
  }
5362
5402
  }
5363
5403
  throw err;
5364
5404
  }
5365
5405
  }
5406
+ async function handleInit(type, flags = {}) {
5407
+ if (!type) {
5408
+ const choice = handleCancel(
5409
+ await p15.select({
5410
+ message: "What would you like to initialize?",
5411
+ options: [
5412
+ {
5413
+ value: "env",
5414
+ label: "Environment Files",
5415
+ hint: "Generate local .env files from .env*.example templates"
5416
+ }
5417
+ ]
5418
+ })
5419
+ );
5420
+ if (choice === "env") {
5421
+ await runEnvCommand(flags);
5422
+ }
5423
+ return;
5424
+ }
5425
+ const normalized = type.trim().toLowerCase();
5426
+ if (normalized === "env") {
5427
+ await runEnvCommand(flags);
5428
+ } else {
5429
+ p15.log.error(
5430
+ pc15.red(
5431
+ `Unknown init target: "${type}". Allowed targets: env.`
5432
+ )
5433
+ );
5434
+ if (process.env.VITEST) {
5435
+ throw new Error(`Unknown init target: "${type}". Allowed targets: env.`);
5436
+ }
5437
+ process.exit(1);
5438
+ }
5439
+ }
5366
5440
 
5367
5441
  // src/cli.ts
5368
5442
  function createCli() {
5369
5443
  const cli = cac("mason");
5370
5444
  cli.command("[...args]", "Interactive scaffolding and import wizard").option("-d, --dry-run", "Preview changes without writing to disk").option("-o, --overwrite", "Overwrite existing files").option("-y, --yes", "Accept defaults and skip interactive prompts").option("--registry", "Run in registry mode").option("--point-to <mapping>", "Point a dependency to an existing local module (e.g. --point-to time:mytime)").option("--alias <mapping>", "Import a dependency fresh under an alias name (e.g. --alias time:time-mason)").option("--tests", "Include test files (use --no-tests to exclude)").action(async (args, flags) => {
5371
5445
  if (args && args.length > 0) {
5372
- p14.log.error(
5373
- pc14.red(
5446
+ p15.log.error(
5447
+ pc15.red(
5374
5448
  `Unknown command: "${args.join(" ")}". Use --help to list available commands.`
5375
5449
  )
5376
5450
  );
@@ -5381,7 +5455,7 @@ function createCli() {
5381
5455
  const mode = getEffectiveMode(projectRoot, flags);
5382
5456
  if (mode === "registry") {
5383
5457
  const choice2 = handleCancel(
5384
- await p14.select({
5458
+ await p15.select({
5385
5459
  message: "\u{1F3DB}\uFE0F Mason (Registry Mode): What would you like to scaffold?",
5386
5460
  options: [
5387
5461
  {
@@ -5424,7 +5498,7 @@ function createCli() {
5424
5498
  return;
5425
5499
  }
5426
5500
  const choice = handleCancel(
5427
- await p14.select({
5501
+ await p15.select({
5428
5502
  message: "\u{1F9F1} Mason: What would you like to do?",
5429
5503
  options: [
5430
5504
  {
@@ -5441,6 +5515,11 @@ function createCli() {
5441
5515
  value: "lint",
5442
5516
  label: "Lint dependency rules",
5443
5517
  hint: "Scan codebase and verify Clean Architecture dependency rules"
5518
+ },
5519
+ {
5520
+ value: "init",
5521
+ label: "Initialize environment",
5522
+ hint: "Generate local .env files from .env*.example templates"
5444
5523
  }
5445
5524
  ]
5446
5525
  })
@@ -5451,6 +5530,8 @@ function createCli() {
5451
5530
  await handleImport(void 0, void 0, flags);
5452
5531
  } else if (choice === "lint") {
5453
5532
  await handleLint(flags);
5533
+ } else if (choice === "init") {
5534
+ await handleInit("env", flags);
5454
5535
  }
5455
5536
  } catch (err) {
5456
5537
  handleCliError(err);
@@ -5498,6 +5579,16 @@ function createCli() {
5498
5579
  handleCliError(err);
5499
5580
  }
5500
5581
  });
5582
+ cli.command(
5583
+ "init [type]",
5584
+ "Initialize project configurations and resources (e.g. 'mason init env')"
5585
+ ).option("-d, --dry-run", "Preview changes without writing to disk").option("-o, --overwrite", "Overwrite existing .env files").example("mason init env").example("mason init env --overwrite").example("mason init env --dry-run").action(async (type, flags = {}) => {
5586
+ try {
5587
+ await handleInit(type, flags);
5588
+ } catch (err) {
5589
+ handleCliError(err);
5590
+ }
5591
+ });
5501
5592
  const createSubtypes = [
5502
5593
  "feature",
5503
5594
  "shared",
@@ -5529,7 +5620,7 @@ function handleCliError(err) {
5529
5620
  process.exit(0);
5530
5621
  }
5531
5622
  const message = err instanceof Error ? err.message : String(err);
5532
- p14.log.error(pc14.red(`Error: ${message}`));
5623
+ p15.log.error(pc15.red(`Error: ${message}`));
5533
5624
  if (process.env.VITEST) {
5534
5625
  throw err;
5535
5626
  }
@@ -5540,6 +5631,6 @@ async function runCli(argv = process.argv) {
5540
5631
  cli.parse(argv, { run: true });
5541
5632
  }
5542
5633
 
5543
- export { DEFAULT_REGISTRY_BASE, DependencyRuleError, FeatureDependencyGraph, PromptCancelledError, computeDirectoryHash, concreteInfraTemplate, createCli, detectPackageManager, diProviderTemplate, domainClassTemplate, domainInterfaceTemplate, domainValueObjectTemplate, ensureInterfacePrefix, expressIndexTemplate, fetchModuleManifest, fetchRegistryFile, fetchRegistryIndex, findClosestMatch, findInterfaceFile, findLocalRegistry, findProjectRoot, generateConcreteInfraCode, generateDomain, generateDomainEntityCode, generateFeature, generateHttpHandler, generateHttpHandlerCode, generateInfrastructure, generateInjectable, generateInjectableCode, generateInterface, generateInterfaceCode, generateShared, generateStubCode, generateUseCase, generateUseCaseCode, generateUseCaseTestCode, getAllFiles, getConfiguredFeaturesDir, getConfiguredSharedDir, getEffectiveMode, getMissingNpmPackages, getRegistryBase, getTemplatesDir, handleCancel, handleCreate, handleImport, handleLint, hbs, httpHandlerTemplate, injectableInterfaceTemplate, injectableTemplate, installNpmPackages, interfaceTemplate, isValidIdentifier, levenshteinDistance, lintCodebase, listDomainEntities, listDomainInterfaces, listExistingFeatures, listExistingShared, listUseCases, loadInterfaceHierarchy, loadMasonConfig, loadTemplate, normalizeRegistryUrl, parseInterfaceMethodsAndImports, printBanner, printGeneratedFiles, promptProperties, removeInterfacePrefix, renderTemplate, renderTemplateFile, resolveFeaturesDir, resolveSharedDir, runCli, runSharedCommand, stubInfraTemplate, synthesizeCrudMethods, toCamelCase, toKebabCase, toPascalCase, toPlural, toSingular, toStubName, updateOrGenerateDiProvider, useCaseTemplate, useCaseTestTemplate, writeFileSafely };
5634
+ export { DEFAULT_REGISTRY_BASE, DependencyRuleError, FeatureDependencyGraph, PromptCancelledError, computeDirectoryHash, concreteInfraTemplate, createCli, detectPackageManager, diProviderTemplate, domainClassTemplate, domainInterfaceTemplate, domainValueObjectTemplate, ensureInterfacePrefix, expressIndexTemplate, fetchModuleManifest, fetchRegistryFile, fetchRegistryIndex, findClosestMatch, findInterfaceFile, findLocalRegistry, findProjectRoot, generateConcreteInfraCode, generateDomain, generateDomainEntityCode, generateFeature, generateHttpHandler, generateHttpHandlerCode, generateInfrastructure, generateInjectable, generateInjectableCode, generateInterface, generateInterfaceCode, generateShared, generateStubCode, generateUseCase, generateUseCaseCode, generateUseCaseTestCode, getAllFiles, getConfiguredFeaturesDir, getConfiguredSharedDir, getEffectiveMode, getMissingNpmPackages, getRegistryBase, getTemplatesDir, handleCancel, handleCreate, handleImport, handleInit, handleLint, hbs, httpHandlerTemplate, injectableInterfaceTemplate, injectableTemplate, installNpmPackages, interfaceTemplate, isValidIdentifier, levenshteinDistance, lintCodebase, listDomainEntities, listDomainInterfaces, listExistingFeatures, listExistingShared, listUseCases, loadInterfaceHierarchy, loadMasonConfig, loadTemplate, normalizeRegistryUrl, parseInterfaceMethodsAndImports, printBanner, printGeneratedFiles, promptProperties, removeInterfacePrefix, renderTemplate, renderTemplateFile, resolveFeaturesDir, resolveSharedDir, runCli, runEnvCommand, runSharedCommand, stubInfraTemplate, synthesizeCrudMethods, toCamelCase, toKebabCase, toPascalCase, toPlural, toSingular, toStubName, updateOrGenerateDiProvider, useCaseTemplate, useCaseTestTemplate, writeFileSafely };
5544
5635
  //# sourceMappingURL=index.js.map
5545
5636
  //# sourceMappingURL=index.js.map