@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/bin.cjs +363 -272
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +360 -269
- package/dist/bin.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/commands/env.d.ts +3 -0
- package/dist/commands/env.d.ts.map +1 -0
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/menu.d.ts.map +1 -1
- package/dist/index.cjs +291 -198
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +288 -197
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var fs4 = require('fs');
|
|
4
4
|
var path2 = require('path');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var p15 = require('@clack/prompts');
|
|
6
|
+
var pc15 = require('picocolors');
|
|
7
7
|
var url = require('url');
|
|
8
8
|
var child_process = require('child_process');
|
|
9
9
|
var crypto = require('crypto');
|
|
@@ -33,8 +33,8 @@ function _interopNamespace(e) {
|
|
|
33
33
|
|
|
34
34
|
var fs4__default = /*#__PURE__*/_interopDefault(fs4);
|
|
35
35
|
var path2__default = /*#__PURE__*/_interopDefault(path2);
|
|
36
|
-
var
|
|
37
|
-
var
|
|
36
|
+
var p15__namespace = /*#__PURE__*/_interopNamespace(p15);
|
|
37
|
+
var pc15__default = /*#__PURE__*/_interopDefault(pc15);
|
|
38
38
|
var Handlebars__default = /*#__PURE__*/_interopDefault(Handlebars);
|
|
39
39
|
|
|
40
40
|
// src/utils/formatting.ts
|
|
@@ -141,17 +141,17 @@ function writeFileSafely(absolutePath, content, options = {}) {
|
|
|
141
141
|
function printGeneratedFiles(files, isDryRun = false) {
|
|
142
142
|
console.log("");
|
|
143
143
|
if (isDryRun) {
|
|
144
|
-
|
|
144
|
+
p15__namespace.log.warn(pc15__default.default.yellow(pc15__default.default.bold("[DRY RUN PREVIEW] No files were written to disk.")));
|
|
145
145
|
}
|
|
146
146
|
for (const f of files) {
|
|
147
147
|
if (f.action === "created") {
|
|
148
|
-
|
|
148
|
+
p15__namespace.log.success(`${pc15__default.default.bold(f.relativePath)} ${pc15__default.default.dim("(created)")}`);
|
|
149
149
|
} else if (f.action === "overwritten") {
|
|
150
|
-
|
|
150
|
+
p15__namespace.log.warn(`${pc15__default.default.bold(f.relativePath)} ${pc15__default.default.dim("(overwritten)")}`);
|
|
151
151
|
} else if (f.action === "skipped") {
|
|
152
|
-
|
|
152
|
+
p15__namespace.log.info(`${pc15__default.default.dim(f.relativePath)} ${pc15__default.default.dim("(skipped - already exists, pass -o to overwrite)")}`);
|
|
153
153
|
} else {
|
|
154
|
-
|
|
154
|
+
p15__namespace.log.info(`${pc15__default.default.bold(f.relativePath)} ${pc15__default.default.dim("(preview)")}`);
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
}
|
|
@@ -353,23 +353,23 @@ var PromptCancelledError = class extends Error {
|
|
|
353
353
|
}
|
|
354
354
|
};
|
|
355
355
|
function handleCancel(result) {
|
|
356
|
-
if (
|
|
357
|
-
|
|
356
|
+
if (p15__namespace.isCancel(result)) {
|
|
357
|
+
p15__namespace.cancel("Operation cancelled.");
|
|
358
358
|
throw new PromptCancelledError();
|
|
359
359
|
}
|
|
360
360
|
return result;
|
|
361
361
|
}
|
|
362
362
|
function printBanner() {
|
|
363
363
|
console.log("");
|
|
364
|
-
|
|
364
|
+
p15__namespace.intro(pc15__default.default.bgCyan(pc15__default.default.black(" @solid-stack/mason ")));
|
|
365
365
|
}
|
|
366
366
|
async function promptProperties(options = {}) {
|
|
367
367
|
const properties = options.defaults ? [...options.defaults] : [];
|
|
368
368
|
if (properties.length > 0) {
|
|
369
|
-
const summary = properties.map((
|
|
370
|
-
|
|
369
|
+
const summary = properties.map((p18) => `${p18.name}: ${p18.type}${p18.optional ? "?" : ""}`).join(", ");
|
|
370
|
+
p15__namespace.log.info(pc15__default.default.dim(`Pre-configured fields: ${summary}`));
|
|
371
371
|
const addMore = handleCancel(
|
|
372
|
-
await
|
|
372
|
+
await p15__namespace.confirm({
|
|
373
373
|
message: "Would you like to add custom fields/properties?",
|
|
374
374
|
initialValue: false
|
|
375
375
|
})
|
|
@@ -378,10 +378,10 @@ async function promptProperties(options = {}) {
|
|
|
378
378
|
return properties;
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
|
-
|
|
381
|
+
p15__namespace.log.info(pc15__default.default.cyan("Enter properties (leave name blank when finished):"));
|
|
382
382
|
while (true) {
|
|
383
383
|
const name = handleCancel(
|
|
384
|
-
await
|
|
384
|
+
await p15__namespace.text({
|
|
385
385
|
message: "Property name (or press Enter to finish):",
|
|
386
386
|
placeholder: "e.g. title, email, status"
|
|
387
387
|
})
|
|
@@ -390,7 +390,7 @@ async function promptProperties(options = {}) {
|
|
|
390
390
|
break;
|
|
391
391
|
}
|
|
392
392
|
const type = handleCancel(
|
|
393
|
-
await
|
|
393
|
+
await p15__namespace.select({
|
|
394
394
|
message: `Type for property "${name.trim()}":`,
|
|
395
395
|
options: [
|
|
396
396
|
{ value: "string", label: "string" },
|
|
@@ -407,7 +407,7 @@ async function promptProperties(options = {}) {
|
|
|
407
407
|
let finalType = type;
|
|
408
408
|
if (type === "custom") {
|
|
409
409
|
finalType = handleCancel(
|
|
410
|
-
await
|
|
410
|
+
await p15__namespace.text({
|
|
411
411
|
message: `Enter custom type for "${name.trim()}":`,
|
|
412
412
|
placeholder: "e.g. UserRole, string | null",
|
|
413
413
|
validate: (val) => val && val.trim() ? void 0 : "Type cannot be empty"
|
|
@@ -415,7 +415,7 @@ async function promptProperties(options = {}) {
|
|
|
415
415
|
);
|
|
416
416
|
}
|
|
417
417
|
const optional = handleCancel(
|
|
418
|
-
await
|
|
418
|
+
await p15__namespace.confirm({
|
|
419
419
|
message: `Is "${name.trim()}" optional?`,
|
|
420
420
|
initialValue: false
|
|
421
421
|
})
|
|
@@ -425,8 +425,8 @@ async function promptProperties(options = {}) {
|
|
|
425
425
|
type: finalType.trim(),
|
|
426
426
|
optional
|
|
427
427
|
});
|
|
428
|
-
|
|
429
|
-
|
|
428
|
+
p15__namespace.log.success(
|
|
429
|
+
pc15__default.default.green(`Added: ${name.trim()}${optional ? "?" : ""}: ${finalType.trim()}`)
|
|
430
430
|
);
|
|
431
431
|
}
|
|
432
432
|
return properties;
|
|
@@ -634,8 +634,8 @@ function getMissingNpmPackages(projectRoot, requiredPackages) {
|
|
|
634
634
|
...Object.keys(pkg.devDependencies || {}),
|
|
635
635
|
...Object.keys(pkg.peerDependencies || {})
|
|
636
636
|
]);
|
|
637
|
-
return requiredPackages.filter((
|
|
638
|
-
const nameOnly =
|
|
637
|
+
return requiredPackages.filter((p18) => {
|
|
638
|
+
const nameOnly = p18.startsWith("@") ? `@${p18.slice(1).split("@")[0] || ""}` : p18.split("@")[0] || p18;
|
|
639
639
|
return !installed.has(nameOnly);
|
|
640
640
|
});
|
|
641
641
|
} catch {
|
|
@@ -660,7 +660,7 @@ function installNpmPackages(projectRoot, packages, pm) {
|
|
|
660
660
|
installCmd = `npm install ${packages.join(" ")}`;
|
|
661
661
|
break;
|
|
662
662
|
}
|
|
663
|
-
|
|
663
|
+
p15__namespace.log.info(`Installing missing dependencies with ${manager}: ${pc15__default.default.cyan(packages.join(", "))}`);
|
|
664
664
|
child_process.execSync(installCmd, {
|
|
665
665
|
cwd: projectRoot,
|
|
666
666
|
stdio: "inherit"
|
|
@@ -862,7 +862,7 @@ function generateInterfaceCode(ifaceName, kind = "abstractClass", entityName, me
|
|
|
862
862
|
const idKey = `${entityKey}Id`;
|
|
863
863
|
const listKey = `${entityKey}s`;
|
|
864
864
|
const formattedCustomMethods = customMethods.map((m) => {
|
|
865
|
-
const params = m.params && m.params.length > 0 ? m.params.map((
|
|
865
|
+
const params = m.params && m.params.length > 0 ? m.params.map((p18) => `${p18.name}: ${p18.type}`).join("; ") : "";
|
|
866
866
|
const returnType = m.returnType ? `Promise<${m.returnType}>` : "Promise<void>";
|
|
867
867
|
return {
|
|
868
868
|
name: m.name,
|
|
@@ -1443,22 +1443,22 @@ function generateUseCaseCode(useCaseName, dependencies = [], inputProps = [], ou
|
|
|
1443
1443
|
from: /^I[A-Z]/.test(dep) ? `../domain/${dep}.js` : `./${dep}.js`
|
|
1444
1444
|
}));
|
|
1445
1445
|
const domainTypesToImport = new Set(domainImports);
|
|
1446
|
-
for (const
|
|
1447
|
-
const rawType =
|
|
1446
|
+
for (const p18 of [...inputProps, ...outputProps]) {
|
|
1447
|
+
const rawType = p18.type.trim();
|
|
1448
1448
|
const baseType = rawType.replace(/\[\]$/, "").trim();
|
|
1449
1449
|
if (!primitiveTypes.has(baseType) && /^[A-Z][A-Za-z0-9_]*$/.test(baseType) && !dependencies.includes(baseType)) {
|
|
1450
1450
|
domainTypesToImport.add(baseType);
|
|
1451
1451
|
}
|
|
1452
1452
|
}
|
|
1453
|
-
const formattedInputProps = inputProps.map((
|
|
1454
|
-
name:
|
|
1455
|
-
optional:
|
|
1456
|
-
type:
|
|
1453
|
+
const formattedInputProps = inputProps.map((p18) => ({
|
|
1454
|
+
name: p18.name,
|
|
1455
|
+
optional: p18.optional,
|
|
1456
|
+
type: p18.optional && !p18.type.includes("undefined") ? `${p18.type} | undefined` : p18.type
|
|
1457
1457
|
}));
|
|
1458
|
-
const formattedOutputProps = outputProps.map((
|
|
1459
|
-
name:
|
|
1460
|
-
optional:
|
|
1461
|
-
type:
|
|
1458
|
+
const formattedOutputProps = outputProps.map((p18) => ({
|
|
1459
|
+
name: p18.name,
|
|
1460
|
+
optional: p18.optional,
|
|
1461
|
+
type: p18.optional && !p18.type.includes("undefined") ? `${p18.type} | undefined` : p18.type
|
|
1462
1462
|
}));
|
|
1463
1463
|
const formattedDeps = dependencies.map((dep) => ({
|
|
1464
1464
|
key: toCamelCase(dep),
|
|
@@ -2133,7 +2133,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2133
2133
|
}
|
|
2134
2134
|
if (!name) {
|
|
2135
2135
|
name = handleCancel(
|
|
2136
|
-
await
|
|
2136
|
+
await p15__namespace.text({
|
|
2137
2137
|
message: "What is the feature name?",
|
|
2138
2138
|
placeholder: "e.g. users, auth, orders, billing",
|
|
2139
2139
|
validate: (val) => {
|
|
@@ -2149,7 +2149,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2149
2149
|
let targetDirRel = defaultDir;
|
|
2150
2150
|
if (!flags.yes && !flags.target && !flags.dest) {
|
|
2151
2151
|
targetDirRel = handleCancel(
|
|
2152
|
-
await
|
|
2152
|
+
await p15__namespace.text({
|
|
2153
2153
|
message: "Target directory for the feature:",
|
|
2154
2154
|
initialValue: defaultDir,
|
|
2155
2155
|
defaultValue: defaultDir
|
|
@@ -2171,14 +2171,14 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2171
2171
|
const customUseCases = [];
|
|
2172
2172
|
if (!flags.yes) {
|
|
2173
2173
|
includeExpress = handleCancel(
|
|
2174
|
-
await
|
|
2174
|
+
await p15__namespace.confirm({
|
|
2175
2175
|
message: "Include Express Presentation layer (pxExpress routes & handlers)?",
|
|
2176
2176
|
initialValue: true
|
|
2177
2177
|
})
|
|
2178
2178
|
);
|
|
2179
2179
|
if (includeExpress) {
|
|
2180
2180
|
routePath = handleCancel(
|
|
2181
|
-
await
|
|
2181
|
+
await p15__namespace.text({
|
|
2182
2182
|
message: "Express route prefix:",
|
|
2183
2183
|
initialValue: `/${normalizedName}`,
|
|
2184
2184
|
defaultValue: `/${normalizedName}`
|
|
@@ -2186,14 +2186,14 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2186
2186
|
).trim();
|
|
2187
2187
|
}
|
|
2188
2188
|
includeDomain = handleCancel(
|
|
2189
|
-
await
|
|
2189
|
+
await p15__namespace.confirm({
|
|
2190
2190
|
message: "Include Domain Entity/Entities?",
|
|
2191
2191
|
initialValue: true
|
|
2192
2192
|
})
|
|
2193
2193
|
);
|
|
2194
2194
|
if (includeDomain) {
|
|
2195
2195
|
const domainInput = handleCancel(
|
|
2196
|
-
await
|
|
2196
|
+
await p15__namespace.text({
|
|
2197
2197
|
message: "Domain entity name(s) (comma-separated):",
|
|
2198
2198
|
initialValue: defaultEntity,
|
|
2199
2199
|
defaultValue: defaultEntity,
|
|
@@ -2212,21 +2212,21 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2212
2212
|
entityNames = [defaultEntity];
|
|
2213
2213
|
}
|
|
2214
2214
|
includeInterface = handleCancel(
|
|
2215
|
-
await
|
|
2215
|
+
await p15__namespace.confirm({
|
|
2216
2216
|
message: `Include Domain Repository interface(s) for ${entityNames.join(", ")}?`,
|
|
2217
2217
|
initialValue: true
|
|
2218
2218
|
})
|
|
2219
2219
|
);
|
|
2220
2220
|
if (includeInterface) {
|
|
2221
2221
|
includeInfra = handleCancel(
|
|
2222
|
-
await
|
|
2222
|
+
await p15__namespace.confirm({
|
|
2223
2223
|
message: `Include Infrastructure Stub implementation(s) for ${entityNames.join(", ")}?`,
|
|
2224
2224
|
initialValue: true
|
|
2225
2225
|
})
|
|
2226
2226
|
);
|
|
2227
2227
|
}
|
|
2228
2228
|
includeUseCase = handleCancel(
|
|
2229
|
-
await
|
|
2229
|
+
await p15__namespace.confirm({
|
|
2230
2230
|
message: "Include Domain Use Cases?",
|
|
2231
2231
|
initialValue: true
|
|
2232
2232
|
})
|
|
@@ -2240,7 +2240,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2240
2240
|
{ value: "delete", label: "Delete (Delete<Entity>)", hint: "DELETE /:id" }
|
|
2241
2241
|
];
|
|
2242
2242
|
crudOperations = handleCancel(
|
|
2243
|
-
await
|
|
2243
|
+
await p15__namespace.multiselect({
|
|
2244
2244
|
message: "Select standard CRUD use cases to generate:",
|
|
2245
2245
|
options: crudChoices,
|
|
2246
2246
|
initialValues: ["create", "read", "list", "update", "delete"],
|
|
@@ -2248,13 +2248,13 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2248
2248
|
})
|
|
2249
2249
|
);
|
|
2250
2250
|
includeTests = handleCancel(
|
|
2251
|
-
await
|
|
2251
|
+
await p15__namespace.confirm({
|
|
2252
2252
|
message: "Generate Vitest unit tests for use cases?",
|
|
2253
2253
|
initialValue: true
|
|
2254
2254
|
})
|
|
2255
2255
|
);
|
|
2256
2256
|
const wantCustom = handleCancel(
|
|
2257
|
-
await
|
|
2257
|
+
await p15__namespace.confirm({
|
|
2258
2258
|
message: "Do you want to add any custom use cases to this feature?",
|
|
2259
2259
|
initialValue: false
|
|
2260
2260
|
})
|
|
@@ -2264,7 +2264,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2264
2264
|
const availableIfaces = entityNames.map((e) => `I${e}Repository`);
|
|
2265
2265
|
while (addMore) {
|
|
2266
2266
|
const customName = handleCancel(
|
|
2267
|
-
await
|
|
2267
|
+
await p15__namespace.text({
|
|
2268
2268
|
message: "Custom Use Case name:",
|
|
2269
2269
|
placeholder: "e.g. ResetPassword, VerifyEmail, AssignRole",
|
|
2270
2270
|
validate: (v) => v && v.trim() ? void 0 : "Use Case name cannot be empty"
|
|
@@ -2274,7 +2274,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2274
2274
|
let selectedDeps = [];
|
|
2275
2275
|
if (availableIfaces.length > 0) {
|
|
2276
2276
|
selectedDeps = handleCancel(
|
|
2277
|
-
await
|
|
2277
|
+
await p15__namespace.multiselect({
|
|
2278
2278
|
message: `Select domain interfaces to inject into ${customUcName}:`,
|
|
2279
2279
|
options: availableIfaces.map((i) => ({ value: i, label: i })),
|
|
2280
2280
|
required: false
|
|
@@ -2283,7 +2283,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2283
2283
|
}
|
|
2284
2284
|
let customInputProps = [];
|
|
2285
2285
|
const hasInput = handleCancel(
|
|
2286
|
-
await
|
|
2286
|
+
await p15__namespace.confirm({
|
|
2287
2287
|
message: `Does ${customUcName} accept input arguments?`,
|
|
2288
2288
|
initialValue: true
|
|
2289
2289
|
})
|
|
@@ -2294,7 +2294,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2294
2294
|
}
|
|
2295
2295
|
let customOutputProps = [];
|
|
2296
2296
|
const hasCustomOutput = handleCancel(
|
|
2297
|
-
await
|
|
2297
|
+
await p15__namespace.confirm({
|
|
2298
2298
|
message: `Does ${customUcName} return custom output data?`,
|
|
2299
2299
|
initialValue: false
|
|
2300
2300
|
})
|
|
@@ -2304,7 +2304,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2304
2304
|
});
|
|
2305
2305
|
}
|
|
2306
2306
|
const customIncludeTest = handleCancel(
|
|
2307
|
-
await
|
|
2307
|
+
await p15__namespace.confirm({
|
|
2308
2308
|
message: `Generate Vitest unit test for ${customUcName}?`,
|
|
2309
2309
|
initialValue: true
|
|
2310
2310
|
})
|
|
@@ -2314,14 +2314,14 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2314
2314
|
let customHttpPath = `/${toKebabCase(customUcName)}`;
|
|
2315
2315
|
if (includeExpress) {
|
|
2316
2316
|
customCreateHttp = handleCancel(
|
|
2317
|
-
await
|
|
2317
|
+
await p15__namespace.confirm({
|
|
2318
2318
|
message: `Generate a matching ExpressRoute HTTP handler for ${customUcName}?`,
|
|
2319
2319
|
initialValue: true
|
|
2320
2320
|
})
|
|
2321
2321
|
);
|
|
2322
2322
|
if (customCreateHttp) {
|
|
2323
2323
|
customHttpMethod = handleCancel(
|
|
2324
|
-
await
|
|
2324
|
+
await p15__namespace.select({
|
|
2325
2325
|
message: "HTTP method for route:",
|
|
2326
2326
|
options: [
|
|
2327
2327
|
{ value: "post", label: "POST" },
|
|
@@ -2334,7 +2334,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2334
2334
|
})
|
|
2335
2335
|
);
|
|
2336
2336
|
customHttpPath = handleCancel(
|
|
2337
|
-
await
|
|
2337
|
+
await p15__namespace.text({
|
|
2338
2338
|
message: "Route subpath (relative to feature prefix):",
|
|
2339
2339
|
initialValue: `/${toKebabCase(customUcName)}`,
|
|
2340
2340
|
defaultValue: `/${toKebabCase(customUcName)}`
|
|
@@ -2355,7 +2355,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2355
2355
|
validationFields: customInputProps
|
|
2356
2356
|
});
|
|
2357
2357
|
addMore = handleCancel(
|
|
2358
|
-
await
|
|
2358
|
+
await p15__namespace.confirm({
|
|
2359
2359
|
message: "Add another custom use case?",
|
|
2360
2360
|
initialValue: false
|
|
2361
2361
|
})
|
|
@@ -2364,7 +2364,7 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2364
2364
|
}
|
|
2365
2365
|
}
|
|
2366
2366
|
includeDiProvider = handleCancel(
|
|
2367
|
-
await
|
|
2367
|
+
await p15__namespace.confirm({
|
|
2368
2368
|
message: "Generate / update feature DI provider (diProvider.ts)?",
|
|
2369
2369
|
initialValue: true
|
|
2370
2370
|
})
|
|
@@ -2376,8 +2376,8 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2376
2376
|
entityNames = [defaultEntity];
|
|
2377
2377
|
}
|
|
2378
2378
|
}
|
|
2379
|
-
const s =
|
|
2380
|
-
s.start(`Generating feature '${
|
|
2379
|
+
const s = p15__namespace.spinner();
|
|
2380
|
+
s.start(`Generating feature '${pc15__default.default.cyan(normalizedName)}'...`);
|
|
2381
2381
|
const options = {
|
|
2382
2382
|
name: normalizedName,
|
|
2383
2383
|
projectRoot,
|
|
@@ -2423,8 +2423,8 @@ async function runFeatureCommand(featureNameArg, flags = {}) {
|
|
|
2423
2423
|
}
|
|
2424
2424
|
s.stop("Feature scaffolded successfully!");
|
|
2425
2425
|
printGeneratedFiles(files, options.dryRun);
|
|
2426
|
-
|
|
2427
|
-
|
|
2426
|
+
p15__namespace.outro(
|
|
2427
|
+
pc15__default.default.green(
|
|
2428
2428
|
`\u2713 Feature '${normalizedName}' initialized in ${path2__default.default.relative(projectRoot, targetDir)} (uncommitted, unregistered)`
|
|
2429
2429
|
)
|
|
2430
2430
|
);
|
|
@@ -2538,7 +2538,7 @@ async function runSharedCommand(sharedNameArg, flags = {}) {
|
|
|
2538
2538
|
}
|
|
2539
2539
|
if (!name) {
|
|
2540
2540
|
name = handleCancel(
|
|
2541
|
-
await
|
|
2541
|
+
await p15__namespace.text({
|
|
2542
2542
|
message: "What is the shared module name?",
|
|
2543
2543
|
placeholder: "e.g. hasher, time, uuid, cache, logger",
|
|
2544
2544
|
validate: (val) => {
|
|
@@ -2554,7 +2554,7 @@ async function runSharedCommand(sharedNameArg, flags = {}) {
|
|
|
2554
2554
|
let targetDirRel = defaultDir;
|
|
2555
2555
|
if (!flags.yes && !flags.target && !flags.dest) {
|
|
2556
2556
|
targetDirRel = handleCancel(
|
|
2557
|
-
await
|
|
2557
|
+
await p15__namespace.text({
|
|
2558
2558
|
message: "Target directory for the shared module:",
|
|
2559
2559
|
initialValue: defaultDir,
|
|
2560
2560
|
defaultValue: defaultDir
|
|
@@ -2566,21 +2566,21 @@ async function runSharedCommand(sharedNameArg, flags = {}) {
|
|
|
2566
2566
|
let includeStub = true;
|
|
2567
2567
|
if (!flags.yes) {
|
|
2568
2568
|
description = handleCancel(
|
|
2569
|
-
await
|
|
2569
|
+
await p15__namespace.text({
|
|
2570
2570
|
message: "Module description (optional):",
|
|
2571
2571
|
placeholder: "e.g. In-memory caching and Redis port abstraction",
|
|
2572
2572
|
initialValue: ""
|
|
2573
2573
|
})
|
|
2574
2574
|
).trim();
|
|
2575
2575
|
includeStub = handleCancel(
|
|
2576
|
-
await
|
|
2576
|
+
await p15__namespace.confirm({
|
|
2577
2577
|
message: "Include stub implementation in infrastructure/?",
|
|
2578
2578
|
initialValue: true
|
|
2579
2579
|
})
|
|
2580
2580
|
);
|
|
2581
2581
|
}
|
|
2582
|
-
const s =
|
|
2583
|
-
s.start(`Generating shared module '${
|
|
2582
|
+
const s = p15__namespace.spinner();
|
|
2583
|
+
s.start(`Generating shared module '${pc15__default.default.cyan(normalizedName)}'...`);
|
|
2584
2584
|
const files = generateShared({
|
|
2585
2585
|
name: normalizedName,
|
|
2586
2586
|
description,
|
|
@@ -2593,8 +2593,8 @@ async function runSharedCommand(sharedNameArg, flags = {}) {
|
|
|
2593
2593
|
});
|
|
2594
2594
|
s.stop("Shared module generated successfully!");
|
|
2595
2595
|
printGeneratedFiles(files, Boolean(flags.dryRun));
|
|
2596
|
-
|
|
2597
|
-
|
|
2596
|
+
p15__namespace.outro(
|
|
2597
|
+
pc15__default.default.green(
|
|
2598
2598
|
`\u2713 Shared module '${normalizedName}' initialized in ${path2__default.default.relative(projectRoot, targetDir)} (uncommitted, unregistered)`
|
|
2599
2599
|
)
|
|
2600
2600
|
);
|
|
@@ -2608,14 +2608,14 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
|
|
|
2608
2608
|
const featureOptions = existingFeatures.map((f) => ({ value: f, label: f }));
|
|
2609
2609
|
featureOptions.push({ value: "__custom__", label: "\u270F\uFE0F Enter custom feature name..." });
|
|
2610
2610
|
const selected = handleCancel(
|
|
2611
|
-
await
|
|
2611
|
+
await p15__namespace.select({
|
|
2612
2612
|
message: "Select target feature:",
|
|
2613
2613
|
options: featureOptions
|
|
2614
2614
|
})
|
|
2615
2615
|
);
|
|
2616
2616
|
if (selected === "__custom__") {
|
|
2617
2617
|
feature = handleCancel(
|
|
2618
|
-
await
|
|
2618
|
+
await p15__namespace.text({
|
|
2619
2619
|
message: "Enter feature name:",
|
|
2620
2620
|
validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
|
|
2621
2621
|
})
|
|
@@ -2625,7 +2625,7 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
|
|
|
2625
2625
|
}
|
|
2626
2626
|
} else {
|
|
2627
2627
|
feature = handleCancel(
|
|
2628
|
-
await
|
|
2628
|
+
await p15__namespace.text({
|
|
2629
2629
|
message: "Enter target feature name:",
|
|
2630
2630
|
validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
|
|
2631
2631
|
})
|
|
@@ -2636,7 +2636,7 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
|
|
|
2636
2636
|
let name = useCaseNameArg?.trim();
|
|
2637
2637
|
if (!name) {
|
|
2638
2638
|
name = handleCancel(
|
|
2639
|
-
await
|
|
2639
|
+
await p15__namespace.text({
|
|
2640
2640
|
message: "Use Case name:",
|
|
2641
2641
|
placeholder: "e.g. CreateUser, GetUser, CancelOrder",
|
|
2642
2642
|
validate: (v) => v && v.trim() ? void 0 : "Use Case name cannot be empty"
|
|
@@ -2652,7 +2652,7 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
|
|
|
2652
2652
|
label: i.name
|
|
2653
2653
|
}));
|
|
2654
2654
|
selectedDeps = handleCancel(
|
|
2655
|
-
await
|
|
2655
|
+
await p15__namespace.multiselect({
|
|
2656
2656
|
message: "Select domain interfaces to inject into use case:",
|
|
2657
2657
|
options: multiOptions,
|
|
2658
2658
|
required: false
|
|
@@ -2667,7 +2667,7 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
|
|
|
2667
2667
|
let httpPath = "/";
|
|
2668
2668
|
if (!flags.yes) {
|
|
2669
2669
|
const hasInput = handleCancel(
|
|
2670
|
-
await
|
|
2670
|
+
await p15__namespace.confirm({
|
|
2671
2671
|
message: "Does this use case accept input arguments?",
|
|
2672
2672
|
initialValue: true
|
|
2673
2673
|
})
|
|
@@ -2677,7 +2677,7 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
|
|
|
2677
2677
|
});
|
|
2678
2678
|
}
|
|
2679
2679
|
const hasCustomOutput = handleCancel(
|
|
2680
|
-
await
|
|
2680
|
+
await p15__namespace.confirm({
|
|
2681
2681
|
message: "Does this use case return custom output data?",
|
|
2682
2682
|
initialValue: false
|
|
2683
2683
|
})
|
|
@@ -2687,20 +2687,20 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
|
|
|
2687
2687
|
});
|
|
2688
2688
|
}
|
|
2689
2689
|
includeTest = handleCancel(
|
|
2690
|
-
await
|
|
2690
|
+
await p15__namespace.confirm({
|
|
2691
2691
|
message: "Generate Vitest unit test skeleton (.test.ts)?",
|
|
2692
2692
|
initialValue: true
|
|
2693
2693
|
})
|
|
2694
2694
|
);
|
|
2695
2695
|
createHttp = handleCancel(
|
|
2696
|
-
await
|
|
2696
|
+
await p15__namespace.confirm({
|
|
2697
2697
|
message: "Generate a matching ExpressRoute HTTP handler?",
|
|
2698
2698
|
initialValue: false
|
|
2699
2699
|
})
|
|
2700
2700
|
);
|
|
2701
2701
|
if (createHttp) {
|
|
2702
2702
|
httpMethod = handleCancel(
|
|
2703
|
-
await
|
|
2703
|
+
await p15__namespace.select({
|
|
2704
2704
|
message: "HTTP method for route:",
|
|
2705
2705
|
options: [
|
|
2706
2706
|
{ value: "post", label: "POST" },
|
|
@@ -2713,7 +2713,7 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
|
|
|
2713
2713
|
})
|
|
2714
2714
|
);
|
|
2715
2715
|
httpPath = handleCancel(
|
|
2716
|
-
await
|
|
2716
|
+
await p15__namespace.text({
|
|
2717
2717
|
message: "Route subpath (relative to feature prefix):",
|
|
2718
2718
|
initialValue: "/",
|
|
2719
2719
|
defaultValue: "/"
|
|
@@ -2721,8 +2721,8 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
|
|
|
2721
2721
|
).trim();
|
|
2722
2722
|
}
|
|
2723
2723
|
}
|
|
2724
|
-
const s =
|
|
2725
|
-
s.start(`Generating use case '${
|
|
2724
|
+
const s = p15__namespace.spinner();
|
|
2725
|
+
s.start(`Generating use case '${pc15__default.default.cyan(ucName)}'...`);
|
|
2726
2726
|
const options = {
|
|
2727
2727
|
name: ucName,
|
|
2728
2728
|
feature,
|
|
@@ -2754,7 +2754,7 @@ async function runUseCaseCommand(useCaseNameArg, flags = {}) {
|
|
|
2754
2754
|
}
|
|
2755
2755
|
s.stop("Use case generated successfully!");
|
|
2756
2756
|
printGeneratedFiles(files, options.dryRun);
|
|
2757
|
-
|
|
2757
|
+
p15__namespace.outro(pc15__default.default.green(`Use case '${ucName}' created in feature '${feature}'!`));
|
|
2758
2758
|
}
|
|
2759
2759
|
async function runDomainCommand(domainNameArg, flags = {}) {
|
|
2760
2760
|
const projectRoot = findProjectRoot();
|
|
@@ -2765,14 +2765,14 @@ async function runDomainCommand(domainNameArg, flags = {}) {
|
|
|
2765
2765
|
const featureOptions = existingFeatures.map((f) => ({ value: f, label: f }));
|
|
2766
2766
|
featureOptions.push({ value: "__custom__", label: "\u270F\uFE0F Enter custom feature name..." });
|
|
2767
2767
|
const selected = handleCancel(
|
|
2768
|
-
await
|
|
2768
|
+
await p15__namespace.select({
|
|
2769
2769
|
message: "Select target feature:",
|
|
2770
2770
|
options: featureOptions
|
|
2771
2771
|
})
|
|
2772
2772
|
);
|
|
2773
2773
|
if (selected === "__custom__") {
|
|
2774
2774
|
feature = handleCancel(
|
|
2775
|
-
await
|
|
2775
|
+
await p15__namespace.text({
|
|
2776
2776
|
message: "Enter feature name:",
|
|
2777
2777
|
validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
|
|
2778
2778
|
})
|
|
@@ -2782,7 +2782,7 @@ async function runDomainCommand(domainNameArg, flags = {}) {
|
|
|
2782
2782
|
}
|
|
2783
2783
|
} else {
|
|
2784
2784
|
feature = handleCancel(
|
|
2785
|
-
await
|
|
2785
|
+
await p15__namespace.text({
|
|
2786
2786
|
message: "Enter target feature name:",
|
|
2787
2787
|
validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
|
|
2788
2788
|
})
|
|
@@ -2793,7 +2793,7 @@ async function runDomainCommand(domainNameArg, flags = {}) {
|
|
|
2793
2793
|
let name = domainNameArg?.trim();
|
|
2794
2794
|
if (!name) {
|
|
2795
2795
|
name = handleCancel(
|
|
2796
|
-
await
|
|
2796
|
+
await p15__namespace.text({
|
|
2797
2797
|
message: "Domain model / entity name:",
|
|
2798
2798
|
placeholder: "e.g. User, Order, Product, Address",
|
|
2799
2799
|
validate: (v) => v && v.trim() ? void 0 : "Domain name cannot be empty"
|
|
@@ -2805,7 +2805,7 @@ async function runDomainCommand(domainNameArg, flags = {}) {
|
|
|
2805
2805
|
let properties = [];
|
|
2806
2806
|
if (!flags.yes) {
|
|
2807
2807
|
kind = handleCancel(
|
|
2808
|
-
await
|
|
2808
|
+
await p15__namespace.select({
|
|
2809
2809
|
message: "Select domain model type:",
|
|
2810
2810
|
options: [
|
|
2811
2811
|
{ value: "interface", label: "TypeScript Interface (pure data structure)" },
|
|
@@ -2824,8 +2824,8 @@ async function runDomainCommand(domainNameArg, flags = {}) {
|
|
|
2824
2824
|
defaults: kind === "valueObject" ? [{ name: "value", type: "string" }] : defaultProps
|
|
2825
2825
|
});
|
|
2826
2826
|
}
|
|
2827
|
-
const s =
|
|
2828
|
-
s.start(`Generating domain model '${
|
|
2827
|
+
const s = p15__namespace.spinner();
|
|
2828
|
+
s.start(`Generating domain model '${pc15__default.default.cyan(entityName)}'...`);
|
|
2829
2829
|
const options = {
|
|
2830
2830
|
name: entityName,
|
|
2831
2831
|
feature,
|
|
@@ -2838,7 +2838,7 @@ async function runDomainCommand(domainNameArg, flags = {}) {
|
|
|
2838
2838
|
const file = generateDomain(options);
|
|
2839
2839
|
s.stop("Domain model generated successfully!");
|
|
2840
2840
|
printGeneratedFiles([file], options.dryRun);
|
|
2841
|
-
|
|
2841
|
+
p15__namespace.outro(pc15__default.default.green(`Domain model '${entityName}' created in feature '${feature}'!`));
|
|
2842
2842
|
}
|
|
2843
2843
|
async function runInfrastructureCommand(classNameArg, flags = {}) {
|
|
2844
2844
|
const projectRoot = findProjectRoot();
|
|
@@ -2847,7 +2847,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
|
|
|
2847
2847
|
let feature = flags.feature?.trim();
|
|
2848
2848
|
if (!flags.yes && !flags.global && !flags.feature) {
|
|
2849
2849
|
scope = handleCancel(
|
|
2850
|
-
await
|
|
2850
|
+
await p15__namespace.select({
|
|
2851
2851
|
message: "Where should this infrastructure implementation be placed?",
|
|
2852
2852
|
options: [
|
|
2853
2853
|
{ value: "feature", label: "Feature-level (features/<feature>/infrastructure)" },
|
|
@@ -2862,14 +2862,14 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
|
|
|
2862
2862
|
const featureOptions = existingFeatures.map((f) => ({ value: f, label: f }));
|
|
2863
2863
|
featureOptions.push({ value: "__custom__", label: "\u270F\uFE0F Enter custom feature name..." });
|
|
2864
2864
|
const selected = handleCancel(
|
|
2865
|
-
await
|
|
2865
|
+
await p15__namespace.select({
|
|
2866
2866
|
message: "Select target feature:",
|
|
2867
2867
|
options: featureOptions
|
|
2868
2868
|
})
|
|
2869
2869
|
);
|
|
2870
2870
|
if (selected === "__custom__") {
|
|
2871
2871
|
feature = handleCancel(
|
|
2872
|
-
await
|
|
2872
|
+
await p15__namespace.text({
|
|
2873
2873
|
message: "Enter feature name:",
|
|
2874
2874
|
validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
|
|
2875
2875
|
})
|
|
@@ -2879,7 +2879,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
|
|
|
2879
2879
|
}
|
|
2880
2880
|
} else {
|
|
2881
2881
|
feature = handleCancel(
|
|
2882
|
-
await
|
|
2882
|
+
await p15__namespace.text({
|
|
2883
2883
|
message: "Enter target feature name:",
|
|
2884
2884
|
validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
|
|
2885
2885
|
})
|
|
@@ -2892,7 +2892,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
|
|
|
2892
2892
|
let name = classNameArg?.trim();
|
|
2893
2893
|
if (!name) {
|
|
2894
2894
|
name = handleCancel(
|
|
2895
|
-
await
|
|
2895
|
+
await p15__namespace.text({
|
|
2896
2896
|
message: "Infrastructure class name:",
|
|
2897
2897
|
placeholder: "e.g. StubUserRepository, PostgresUserRepository, S3FileStorage",
|
|
2898
2898
|
validate: (v) => v && v.trim() ? void 0 : "Class name cannot be empty"
|
|
@@ -2911,7 +2911,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
|
|
|
2911
2911
|
(i) => className.toLowerCase().includes(removeInterfacePrefix(i.name).toLowerCase())
|
|
2912
2912
|
);
|
|
2913
2913
|
const ifaceChoice = handleCancel(
|
|
2914
|
-
await
|
|
2914
|
+
await p15__namespace.select({
|
|
2915
2915
|
message: "Does this class implement a domain interface or abstract class?",
|
|
2916
2916
|
options: [
|
|
2917
2917
|
...interfaces.map((i) => ({ value: i.name, label: i.name })),
|
|
@@ -2923,7 +2923,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
|
|
|
2923
2923
|
);
|
|
2924
2924
|
if (ifaceChoice === "__custom__") {
|
|
2925
2925
|
implementsInterface = handleCancel(
|
|
2926
|
-
await
|
|
2926
|
+
await p15__namespace.text({
|
|
2927
2927
|
message: "Enter interface or abstract class name:",
|
|
2928
2928
|
placeholder: "e.g. IUserRepository, BaseStorageAdapter",
|
|
2929
2929
|
validate: (v) => v && v.trim() ? void 0 : "Name cannot be empty"
|
|
@@ -2934,14 +2934,14 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
|
|
|
2934
2934
|
}
|
|
2935
2935
|
} else {
|
|
2936
2936
|
const wantImpl = handleCancel(
|
|
2937
|
-
await
|
|
2937
|
+
await p15__namespace.confirm({
|
|
2938
2938
|
message: "Does this class implement a domain interface or abstract class?",
|
|
2939
2939
|
initialValue: false
|
|
2940
2940
|
})
|
|
2941
2941
|
);
|
|
2942
2942
|
if (wantImpl) {
|
|
2943
2943
|
implementsInterface = handleCancel(
|
|
2944
|
-
await
|
|
2944
|
+
await p15__namespace.text({
|
|
2945
2945
|
message: "Enter interface or abstract class name:",
|
|
2946
2946
|
placeholder: "e.g. IUserRepository, BaseStorageAdapter",
|
|
2947
2947
|
validate: (v) => v && v.trim() ? void 0 : "Name cannot be empty"
|
|
@@ -2961,7 +2961,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
|
|
|
2961
2961
|
const allInterfaces = listDomainInterfaces(projectRoot);
|
|
2962
2962
|
if (allInterfaces.length > 0) {
|
|
2963
2963
|
const ifaceChoice = handleCancel(
|
|
2964
|
-
await
|
|
2964
|
+
await p15__namespace.select({
|
|
2965
2965
|
message: "Does this class implement an interface or abstract class?",
|
|
2966
2966
|
options: [
|
|
2967
2967
|
...allInterfaces.map((i) => ({ value: i.name, label: `${i.name} (${i.feature})` })),
|
|
@@ -2973,7 +2973,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
|
|
|
2973
2973
|
);
|
|
2974
2974
|
if (ifaceChoice === "__custom__") {
|
|
2975
2975
|
implementsInterface = handleCancel(
|
|
2976
|
-
await
|
|
2976
|
+
await p15__namespace.text({
|
|
2977
2977
|
message: "Enter interface or abstract class name:",
|
|
2978
2978
|
placeholder: "e.g. IAuthRepository",
|
|
2979
2979
|
validate: (v) => v && v.trim() ? void 0 : "Name cannot be empty"
|
|
@@ -2986,7 +2986,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
|
|
|
2986
2986
|
}
|
|
2987
2987
|
if (!flags.yes && !flags.kind) {
|
|
2988
2988
|
kind = handleCancel(
|
|
2989
|
-
await
|
|
2989
|
+
await p15__namespace.select({
|
|
2990
2990
|
message: "Select implementation kind:",
|
|
2991
2991
|
options: [
|
|
2992
2992
|
{ value: "stub", label: "In-Memory Stub (with in-memory store and test helper methods)" },
|
|
@@ -2997,7 +2997,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
|
|
|
2997
2997
|
);
|
|
2998
2998
|
if (scope === "feature" && feature && implementsInterface) {
|
|
2999
2999
|
registerInProvider = handleCancel(
|
|
3000
|
-
await
|
|
3000
|
+
await p15__namespace.confirm({
|
|
3001
3001
|
message: "Register this implementation in feature diProvider.ts?",
|
|
3002
3002
|
initialValue: true
|
|
3003
3003
|
})
|
|
@@ -3006,8 +3006,8 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
|
|
|
3006
3006
|
} else if (flags.yes && scope === "feature" && feature && implementsInterface) {
|
|
3007
3007
|
registerInProvider = !flags.noProvider;
|
|
3008
3008
|
}
|
|
3009
|
-
const s =
|
|
3010
|
-
s.start(`Generating infrastructure class '${
|
|
3009
|
+
const s = p15__namespace.spinner();
|
|
3010
|
+
s.start(`Generating infrastructure class '${pc15__default.default.cyan(className)}'...`);
|
|
3011
3011
|
const files = [];
|
|
3012
3012
|
const options = {
|
|
3013
3013
|
name: className,
|
|
@@ -3042,7 +3042,7 @@ async function runInfrastructureCommand(classNameArg, flags = {}) {
|
|
|
3042
3042
|
}
|
|
3043
3043
|
s.stop("Infrastructure class generated successfully!");
|
|
3044
3044
|
printGeneratedFiles(files, options.dryRun);
|
|
3045
|
-
|
|
3045
|
+
p15__namespace.outro(pc15__default.default.green(`Infrastructure class '${className}' created!`));
|
|
3046
3046
|
}
|
|
3047
3047
|
async function runInterfaceCommand(interfaceNameArg, flags = {}) {
|
|
3048
3048
|
const projectRoot = findProjectRoot();
|
|
@@ -3053,14 +3053,14 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
|
|
|
3053
3053
|
const featureOptions = existingFeatures.map((f) => ({ value: f, label: f }));
|
|
3054
3054
|
featureOptions.push({ value: "__custom__", label: "\u270F\uFE0F Enter custom feature name..." });
|
|
3055
3055
|
const selected = handleCancel(
|
|
3056
|
-
await
|
|
3056
|
+
await p15__namespace.select({
|
|
3057
3057
|
message: "Select target feature:",
|
|
3058
3058
|
options: featureOptions
|
|
3059
3059
|
})
|
|
3060
3060
|
);
|
|
3061
3061
|
if (selected === "__custom__") {
|
|
3062
3062
|
feature = handleCancel(
|
|
3063
|
-
await
|
|
3063
|
+
await p15__namespace.text({
|
|
3064
3064
|
message: "Enter feature name:",
|
|
3065
3065
|
validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
|
|
3066
3066
|
})
|
|
@@ -3070,7 +3070,7 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
|
|
|
3070
3070
|
}
|
|
3071
3071
|
} else {
|
|
3072
3072
|
feature = handleCancel(
|
|
3073
|
-
await
|
|
3073
|
+
await p15__namespace.text({
|
|
3074
3074
|
message: "Enter target feature name:",
|
|
3075
3075
|
validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
|
|
3076
3076
|
})
|
|
@@ -3081,7 +3081,7 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
|
|
|
3081
3081
|
let name = interfaceNameArg?.trim();
|
|
3082
3082
|
if (!name) {
|
|
3083
3083
|
name = handleCancel(
|
|
3084
|
-
await
|
|
3084
|
+
await p15__namespace.text({
|
|
3085
3085
|
message: "Domain interface name:",
|
|
3086
3086
|
placeholder: "e.g. IUserRepository, IPaymentService",
|
|
3087
3087
|
validate: (v) => v && v.trim() ? void 0 : "Interface name cannot be empty"
|
|
@@ -3099,7 +3099,7 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
|
|
|
3099
3099
|
if (!flags.yes) {
|
|
3100
3100
|
if (existingEntities.length > 0) {
|
|
3101
3101
|
const selectedEntity = handleCancel(
|
|
3102
|
-
await
|
|
3102
|
+
await p15__namespace.select({
|
|
3103
3103
|
message: "Select domain entity associated with this interface:",
|
|
3104
3104
|
options: [
|
|
3105
3105
|
...existingEntities.map((e) => ({ value: e.name, label: e.name })),
|
|
@@ -3110,7 +3110,7 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
|
|
|
3110
3110
|
);
|
|
3111
3111
|
if (selectedEntity === "__custom__") {
|
|
3112
3112
|
entityName = handleCancel(
|
|
3113
|
-
await
|
|
3113
|
+
await p15__namespace.text({
|
|
3114
3114
|
message: "Enter entity name:",
|
|
3115
3115
|
defaultValue: removeInterfacePrefix(ifaceName).replace(/Repository$|Service$/, "")
|
|
3116
3116
|
})
|
|
@@ -3120,7 +3120,7 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
|
|
|
3120
3120
|
}
|
|
3121
3121
|
}
|
|
3122
3122
|
kind = handleCancel(
|
|
3123
|
-
await
|
|
3123
|
+
await p15__namespace.select({
|
|
3124
3124
|
message: "Interface definition style:",
|
|
3125
3125
|
options: [
|
|
3126
3126
|
{ value: "abstractClass", label: "Abstract Class (Recommended - acts as DI token & type)" },
|
|
@@ -3130,7 +3130,7 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
|
|
|
3130
3130
|
})
|
|
3131
3131
|
);
|
|
3132
3132
|
methodsPreset = handleCancel(
|
|
3133
|
-
await
|
|
3133
|
+
await p15__namespace.select({
|
|
3134
3134
|
message: "Method signature preset:",
|
|
3135
3135
|
options: [
|
|
3136
3136
|
{ value: "crud", label: "Standard CRUD (GetById, List, Create, Update, Delete)" },
|
|
@@ -3140,22 +3140,22 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
|
|
|
3140
3140
|
})
|
|
3141
3141
|
);
|
|
3142
3142
|
generateStub = handleCancel(
|
|
3143
|
-
await
|
|
3143
|
+
await p15__namespace.confirm({
|
|
3144
3144
|
message: "Auto-generate Infrastructure Stub implementation?",
|
|
3145
3145
|
initialValue: true
|
|
3146
3146
|
})
|
|
3147
3147
|
);
|
|
3148
3148
|
if (generateStub) {
|
|
3149
3149
|
registerInProvider = handleCancel(
|
|
3150
|
-
await
|
|
3150
|
+
await p15__namespace.confirm({
|
|
3151
3151
|
message: "Auto-register interface & stub in feature diProvider.ts?",
|
|
3152
3152
|
initialValue: true
|
|
3153
3153
|
})
|
|
3154
3154
|
);
|
|
3155
3155
|
}
|
|
3156
3156
|
}
|
|
3157
|
-
const s =
|
|
3158
|
-
s.start(`Generating interface '${
|
|
3157
|
+
const s = p15__namespace.spinner();
|
|
3158
|
+
s.start(`Generating interface '${pc15__default.default.cyan(ifaceName)}'...`);
|
|
3159
3159
|
const files = [];
|
|
3160
3160
|
const options = {
|
|
3161
3161
|
name: ifaceName,
|
|
@@ -3204,7 +3204,7 @@ async function runInterfaceCommand(interfaceNameArg, flags = {}) {
|
|
|
3204
3204
|
}
|
|
3205
3205
|
s.stop("Interface generated successfully!");
|
|
3206
3206
|
printGeneratedFiles(files, options.dryRun);
|
|
3207
|
-
|
|
3207
|
+
p15__namespace.outro(pc15__default.default.green(`Interface '${ifaceName}' created in feature '${feature}'!`));
|
|
3208
3208
|
}
|
|
3209
3209
|
async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
|
|
3210
3210
|
const projectRoot = findProjectRoot();
|
|
@@ -3215,14 +3215,14 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
|
|
|
3215
3215
|
const featureOptions = existingFeatures.map((f) => ({ value: f, label: f }));
|
|
3216
3216
|
featureOptions.push({ value: "__custom__", label: "\u270F\uFE0F Enter custom feature name..." });
|
|
3217
3217
|
const selected = handleCancel(
|
|
3218
|
-
await
|
|
3218
|
+
await p15__namespace.select({
|
|
3219
3219
|
message: "Select target feature:",
|
|
3220
3220
|
options: featureOptions
|
|
3221
3221
|
})
|
|
3222
3222
|
);
|
|
3223
3223
|
if (selected === "__custom__") {
|
|
3224
3224
|
feature = handleCancel(
|
|
3225
|
-
await
|
|
3225
|
+
await p15__namespace.text({
|
|
3226
3226
|
message: "Enter feature name:",
|
|
3227
3227
|
validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
|
|
3228
3228
|
})
|
|
@@ -3232,7 +3232,7 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
|
|
|
3232
3232
|
}
|
|
3233
3233
|
} else {
|
|
3234
3234
|
feature = handleCancel(
|
|
3235
|
-
await
|
|
3235
|
+
await p15__namespace.text({
|
|
3236
3236
|
message: "Enter target feature name:",
|
|
3237
3237
|
validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
|
|
3238
3238
|
})
|
|
@@ -3243,7 +3243,7 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
|
|
|
3243
3243
|
let name = handlerNameArg?.trim();
|
|
3244
3244
|
if (!name) {
|
|
3245
3245
|
name = handleCancel(
|
|
3246
|
-
await
|
|
3246
|
+
await p15__namespace.text({
|
|
3247
3247
|
message: "HTTP Route Handler class name:",
|
|
3248
3248
|
placeholder: "e.g. CreateUserHttp, GetUserHttp, HealthHttp",
|
|
3249
3249
|
validate: (v) => v && v.trim() ? void 0 : "Handler name cannot be empty"
|
|
@@ -3262,7 +3262,7 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
|
|
|
3262
3262
|
let validationFields = [];
|
|
3263
3263
|
if (!flags.yes) {
|
|
3264
3264
|
method = handleCancel(
|
|
3265
|
-
await
|
|
3265
|
+
await p15__namespace.select({
|
|
3266
3266
|
message: "HTTP Method:",
|
|
3267
3267
|
options: [
|
|
3268
3268
|
{ value: "get", label: "GET" },
|
|
@@ -3276,7 +3276,7 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
|
|
|
3276
3276
|
);
|
|
3277
3277
|
const defaultPath = method === "get" ? "/" : "/";
|
|
3278
3278
|
subPath = handleCancel(
|
|
3279
|
-
await
|
|
3279
|
+
await p15__namespace.text({
|
|
3280
3280
|
message: "Route subpath (relative to feature prefix):",
|
|
3281
3281
|
initialValue: defaultPath,
|
|
3282
3282
|
defaultValue: defaultPath
|
|
@@ -3287,7 +3287,7 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
|
|
|
3287
3287
|
const ucOptions = useCases.map((u) => ({ value: u.name, label: u.name }));
|
|
3288
3288
|
ucOptions.push({ value: "__none__", label: "None / Standalone Handler" });
|
|
3289
3289
|
const chosenUc = handleCancel(
|
|
3290
|
-
await
|
|
3290
|
+
await p15__namespace.select({
|
|
3291
3291
|
message: "Connect this handler to a domain Use Case?",
|
|
3292
3292
|
options: ucOptions,
|
|
3293
3293
|
initialValue: ucOptions[0]?.value
|
|
@@ -3298,7 +3298,7 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
|
|
|
3298
3298
|
}
|
|
3299
3299
|
}
|
|
3300
3300
|
includeValidation = handleCancel(
|
|
3301
|
-
await
|
|
3301
|
+
await p15__namespace.confirm({
|
|
3302
3302
|
message: "Include Zod inbound request validation?",
|
|
3303
3303
|
initialValue: method !== "delete"
|
|
3304
3304
|
})
|
|
@@ -3306,7 +3306,7 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
|
|
|
3306
3306
|
if (includeValidation) {
|
|
3307
3307
|
const defaultSource = method === "get" ? "query" : "body";
|
|
3308
3308
|
validationSource = handleCancel(
|
|
3309
|
-
await
|
|
3309
|
+
await p15__namespace.select({
|
|
3310
3310
|
message: "Validation data source:",
|
|
3311
3311
|
options: [
|
|
3312
3312
|
{ value: "body", label: "req.body (for POST / PUT / PATCH payloads)" },
|
|
@@ -3320,8 +3320,8 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
|
|
|
3320
3320
|
});
|
|
3321
3321
|
}
|
|
3322
3322
|
}
|
|
3323
|
-
const s =
|
|
3324
|
-
s.start(`Generating HTTP handler '${
|
|
3323
|
+
const s = p15__namespace.spinner();
|
|
3324
|
+
s.start(`Generating HTTP handler '${pc15__default.default.cyan(className)}'...`);
|
|
3325
3325
|
const options = {
|
|
3326
3326
|
name: className,
|
|
3327
3327
|
feature,
|
|
@@ -3339,7 +3339,7 @@ async function runHttpHandlerCommand(handlerNameArg, flags = {}) {
|
|
|
3339
3339
|
const files = generateHttpHandler(options);
|
|
3340
3340
|
s.stop("HTTP handler generated successfully!");
|
|
3341
3341
|
printGeneratedFiles(files, options.dryRun);
|
|
3342
|
-
|
|
3342
|
+
p15__namespace.outro(pc15__default.default.green(`HTTP handler '${className}' created in feature '${feature}'!`));
|
|
3343
3343
|
}
|
|
3344
3344
|
function generateInjectableCode(className, dependencies = [], methods = [], implementsInterface) {
|
|
3345
3345
|
const formattedDeps = dependencies.map((dep) => ({
|
|
@@ -3349,7 +3349,7 @@ function generateInjectableCode(className, dependencies = [], methods = [], impl
|
|
|
3349
3349
|
const formattedMethods = methods.map((m) => {
|
|
3350
3350
|
const isAsync = m.async !== false;
|
|
3351
3351
|
const retType = m.returnType ? isAsync ? `Promise<${m.returnType}>` : m.returnType : isAsync ? "Promise<void>" : "void";
|
|
3352
|
-
const params = m.params && m.params.length > 0 ? m.params.map((
|
|
3352
|
+
const params = m.params && m.params.length > 0 ? m.params.map((p18) => `${p18.name}: ${p18.type}`).join(", ") : "";
|
|
3353
3353
|
return {
|
|
3354
3354
|
name: m.name,
|
|
3355
3355
|
isAsync,
|
|
@@ -3419,7 +3419,7 @@ async function runInjectableCommand(classNameArg, flags = {}) {
|
|
|
3419
3419
|
let name = classNameArg?.trim();
|
|
3420
3420
|
if (!name) {
|
|
3421
3421
|
name = handleCancel(
|
|
3422
|
-
await
|
|
3422
|
+
await p15__namespace.text({
|
|
3423
3423
|
message: "Injectable class name:",
|
|
3424
3424
|
placeholder: "e.g. PasswordHasher, TokenService, UserTransformer",
|
|
3425
3425
|
validate: (v) => v && v.trim() ? void 0 : "Class name cannot be empty"
|
|
@@ -3432,7 +3432,7 @@ async function runInjectableCommand(classNameArg, flags = {}) {
|
|
|
3432
3432
|
let customPath;
|
|
3433
3433
|
if (!flags.yes) {
|
|
3434
3434
|
location = handleCancel(
|
|
3435
|
-
await
|
|
3435
|
+
await p15__namespace.select({
|
|
3436
3436
|
message: "Select target architectural location:",
|
|
3437
3437
|
options: [
|
|
3438
3438
|
{ value: "feature-service", label: "Feature Service (features/<feature>/services/)" },
|
|
@@ -3450,14 +3450,14 @@ async function runInjectableCommand(classNameArg, flags = {}) {
|
|
|
3450
3450
|
const featureOptions = existingFeatures.map((f) => ({ value: f, label: f }));
|
|
3451
3451
|
featureOptions.push({ value: "__custom__", label: "\u270F\uFE0F Enter custom feature name..." });
|
|
3452
3452
|
const selected = handleCancel(
|
|
3453
|
-
await
|
|
3453
|
+
await p15__namespace.select({
|
|
3454
3454
|
message: "Select target feature:",
|
|
3455
3455
|
options: featureOptions
|
|
3456
3456
|
})
|
|
3457
3457
|
);
|
|
3458
3458
|
if (selected === "__custom__") {
|
|
3459
3459
|
feature = handleCancel(
|
|
3460
|
-
await
|
|
3460
|
+
await p15__namespace.text({
|
|
3461
3461
|
message: "Enter feature name:",
|
|
3462
3462
|
validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
|
|
3463
3463
|
})
|
|
@@ -3467,7 +3467,7 @@ async function runInjectableCommand(classNameArg, flags = {}) {
|
|
|
3467
3467
|
}
|
|
3468
3468
|
} else {
|
|
3469
3469
|
feature = handleCancel(
|
|
3470
|
-
await
|
|
3470
|
+
await p15__namespace.text({
|
|
3471
3471
|
message: "Enter target feature name:",
|
|
3472
3472
|
validate: (v) => v && v.trim() ? void 0 : "Feature name cannot be empty"
|
|
3473
3473
|
})
|
|
@@ -3477,7 +3477,7 @@ async function runInjectableCommand(classNameArg, flags = {}) {
|
|
|
3477
3477
|
feature = toCamelCase(feature);
|
|
3478
3478
|
} else if (location === "custom") {
|
|
3479
3479
|
customPath = handleCancel(
|
|
3480
|
-
await
|
|
3480
|
+
await p15__namespace.text({
|
|
3481
3481
|
message: "Enter destination directory path:",
|
|
3482
3482
|
placeholder: "e.g. src/services or lib/utils",
|
|
3483
3483
|
validate: (v) => v && v.trim() ? void 0 : "Path cannot be empty"
|
|
@@ -3488,14 +3488,14 @@ async function runInjectableCommand(classNameArg, flags = {}) {
|
|
|
3488
3488
|
let generateInterface2 = false;
|
|
3489
3489
|
if (!flags.yes) {
|
|
3490
3490
|
generateInterface2 = handleCancel(
|
|
3491
|
-
await
|
|
3491
|
+
await p15__namespace.confirm({
|
|
3492
3492
|
message: `Generate abstract class interface (I${className}) as runtime DI token?`,
|
|
3493
3493
|
initialValue: false
|
|
3494
3494
|
})
|
|
3495
3495
|
);
|
|
3496
3496
|
}
|
|
3497
|
-
const s =
|
|
3498
|
-
s.start(`Generating injectable '${
|
|
3497
|
+
const s = p15__namespace.spinner();
|
|
3498
|
+
s.start(`Generating injectable '${pc15__default.default.cyan(className)}'...`);
|
|
3499
3499
|
const options = {
|
|
3500
3500
|
name: className,
|
|
3501
3501
|
feature,
|
|
@@ -3509,12 +3509,44 @@ async function runInjectableCommand(classNameArg, flags = {}) {
|
|
|
3509
3509
|
const files = generateInjectable(options);
|
|
3510
3510
|
s.stop("Injectable class generated successfully!");
|
|
3511
3511
|
printGeneratedFiles(files, options.dryRun);
|
|
3512
|
-
|
|
3512
|
+
p15__namespace.outro(pc15__default.default.green(`Injectable '${className}' created successfully!`));
|
|
3513
3513
|
}
|
|
3514
|
+
async function runEnvCommand(flags = {}) {
|
|
3515
|
+
const projectRoot = flags.cwd || flags.targetDir || findProjectRoot();
|
|
3516
|
+
const s = p15__namespace.spinner();
|
|
3517
|
+
s.start("Scanning for .example environment files...");
|
|
3518
|
+
const files = fs4__default.default.readdirSync(projectRoot);
|
|
3519
|
+
const exampleFiles = files.filter((file) => file.startsWith(".env") && file.endsWith(".example")).sort();
|
|
3520
|
+
if (exampleFiles.length === 0) {
|
|
3521
|
+
s.stop("No .example files found.");
|
|
3522
|
+
p15__namespace.log.info(pc15__default.default.yellow(`No files matching '.env*.example' were found in ${projectRoot}`));
|
|
3523
|
+
return [];
|
|
3524
|
+
}
|
|
3525
|
+
s.message(`Found ${exampleFiles.length} template(s). Generating...`);
|
|
3526
|
+
const generatedFiles = [];
|
|
3527
|
+
for (const exampleFile of exampleFiles) {
|
|
3528
|
+
const sourcePath = path2__default.default.join(projectRoot, exampleFile);
|
|
3529
|
+
const targetFile = exampleFile.replace(/\.example$/, "");
|
|
3530
|
+
const targetPath = path2__default.default.join(projectRoot, targetFile);
|
|
3531
|
+
const content = fs4__default.default.readFileSync(sourcePath, "utf-8");
|
|
3532
|
+
const genFile = writeFileSafely(targetPath, content, {
|
|
3533
|
+
projectRoot,
|
|
3534
|
+
dryRun: Boolean(flags.dryRun),
|
|
3535
|
+
overwrite: Boolean(flags.overwrite)
|
|
3536
|
+
});
|
|
3537
|
+
generatedFiles.push(genFile);
|
|
3538
|
+
}
|
|
3539
|
+
s.stop("Environment files processed!");
|
|
3540
|
+
printGeneratedFiles(generatedFiles, Boolean(flags.dryRun));
|
|
3541
|
+
p15__namespace.outro(pc15__default.default.green("\u2713 Local environment files are ready!"));
|
|
3542
|
+
return generatedFiles;
|
|
3543
|
+
}
|
|
3544
|
+
|
|
3545
|
+
// src/commands/menu.ts
|
|
3514
3546
|
async function runInteractiveMenu(flags = {}) {
|
|
3515
3547
|
printBanner();
|
|
3516
3548
|
const choice = handleCancel(
|
|
3517
|
-
await
|
|
3549
|
+
await p15__namespace.select({
|
|
3518
3550
|
message: "What would you like to create in your architecture?",
|
|
3519
3551
|
options: [
|
|
3520
3552
|
{
|
|
@@ -3556,6 +3588,11 @@ async function runInteractiveMenu(flags = {}) {
|
|
|
3556
3588
|
value: "injectable",
|
|
3557
3589
|
label: "Injectable Service",
|
|
3558
3590
|
hint: "Generic @MakeInjectable class for services, transformers, or modules"
|
|
3591
|
+
},
|
|
3592
|
+
{
|
|
3593
|
+
value: "env",
|
|
3594
|
+
label: "Generate Env Files",
|
|
3595
|
+
hint: "Clone .env*.example files to local .env equivalents"
|
|
3559
3596
|
}
|
|
3560
3597
|
]
|
|
3561
3598
|
})
|
|
@@ -3585,6 +3622,9 @@ async function runInteractiveMenu(flags = {}) {
|
|
|
3585
3622
|
case "injectable":
|
|
3586
3623
|
await runInjectableCommand(void 0, flags);
|
|
3587
3624
|
break;
|
|
3625
|
+
case "env":
|
|
3626
|
+
await runEnvCommand(flags);
|
|
3627
|
+
break;
|
|
3588
3628
|
}
|
|
3589
3629
|
}
|
|
3590
3630
|
|
|
@@ -3622,8 +3662,8 @@ async function handleCreate(type, name, flags = {}) {
|
|
|
3622
3662
|
await runInjectableCommand(name, flags);
|
|
3623
3663
|
break;
|
|
3624
3664
|
default:
|
|
3625
|
-
|
|
3626
|
-
|
|
3665
|
+
p15__namespace.log.error(
|
|
3666
|
+
pc15__default.default.red(
|
|
3627
3667
|
`Unknown component type: "${type}". Allowed types: feature, shared, usecase, domain, infrastructure, interface, httpHandler, injectable.`
|
|
3628
3668
|
)
|
|
3629
3669
|
);
|
|
@@ -3631,9 +3671,9 @@ async function handleCreate(type, name, flags = {}) {
|
|
|
3631
3671
|
}
|
|
3632
3672
|
}
|
|
3633
3673
|
var importPrompts = {
|
|
3634
|
-
select:
|
|
3635
|
-
text:
|
|
3636
|
-
confirm:
|
|
3674
|
+
select: p15__namespace.select,
|
|
3675
|
+
text: p15__namespace.text,
|
|
3676
|
+
confirm: p15__namespace.confirm
|
|
3637
3677
|
};
|
|
3638
3678
|
function isTestFile(filePath) {
|
|
3639
3679
|
const normalized = filePath.replace(/\\/g, "/");
|
|
@@ -3743,19 +3783,19 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
3743
3783
|
);
|
|
3744
3784
|
}
|
|
3745
3785
|
if (type !== "shared" && type !== "feature") {
|
|
3746
|
-
|
|
3786
|
+
p15__namespace.log.error(pc15__default.default.red(`Invalid module type: "${typeArg}". Must be "shared" or "feature".`));
|
|
3747
3787
|
process.exit(1);
|
|
3748
3788
|
}
|
|
3749
3789
|
const registryBase = getRegistryBase(projectRoot, flags.registry);
|
|
3750
|
-
const s =
|
|
3751
|
-
s.start(`Connecting to registry at ${
|
|
3790
|
+
const s = p15__namespace.spinner();
|
|
3791
|
+
s.start(`Connecting to registry at ${pc15__default.default.dim(registryBase)}...`);
|
|
3752
3792
|
let index;
|
|
3753
3793
|
try {
|
|
3754
3794
|
index = await fetchRegistryIndex(registryBase);
|
|
3755
3795
|
s.stop("Registry index loaded.");
|
|
3756
3796
|
} catch (err) {
|
|
3757
|
-
s.stop(
|
|
3758
|
-
|
|
3797
|
+
s.stop(pc15__default.default.red("Failed to load registry index."));
|
|
3798
|
+
p15__namespace.log.error(pc15__default.default.red(err.message || String(err)));
|
|
3759
3799
|
process.exit(1);
|
|
3760
3800
|
}
|
|
3761
3801
|
const availableList = type === "shared" ? index.shared : index.features;
|
|
@@ -3763,7 +3803,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
3763
3803
|
let name = nameArg?.trim();
|
|
3764
3804
|
if (!name) {
|
|
3765
3805
|
if (availableList.length === 0) {
|
|
3766
|
-
|
|
3806
|
+
p15__namespace.log.warn(`No ${type} modules available in the registry.`);
|
|
3767
3807
|
return;
|
|
3768
3808
|
}
|
|
3769
3809
|
name = handleCancel(
|
|
@@ -3779,9 +3819,9 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
3779
3819
|
}
|
|
3780
3820
|
if (!candidateNames.includes(name)) {
|
|
3781
3821
|
const closest = findClosestMatch(name, candidateNames);
|
|
3782
|
-
|
|
3822
|
+
p15__namespace.log.error(pc15__default.default.red(`\u274C Module '${name}' not found in the ${type} registry.`));
|
|
3783
3823
|
if (closest) {
|
|
3784
|
-
|
|
3824
|
+
p15__namespace.log.info(pc15__default.default.yellow(`Did you mean '${pc15__default.default.cyan(closest)}'?`));
|
|
3785
3825
|
}
|
|
3786
3826
|
process.exit(1);
|
|
3787
3827
|
}
|
|
@@ -3793,7 +3833,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
3793
3833
|
try {
|
|
3794
3834
|
manifest = await fetchModuleManifest(registryBase, modType, modName);
|
|
3795
3835
|
} catch (err) {
|
|
3796
|
-
|
|
3836
|
+
p15__namespace.log.error(pc15__default.default.red(`Failed to fetch manifest for ${modType} '${modName}': ${err.message}`));
|
|
3797
3837
|
process.exit(1);
|
|
3798
3838
|
}
|
|
3799
3839
|
nodes.set(key, {
|
|
@@ -3833,7 +3873,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
3833
3873
|
buildTopologicalOrder(rootKey);
|
|
3834
3874
|
const resolutions = /* @__PURE__ */ new Map();
|
|
3835
3875
|
const globalAliasMap = /* @__PURE__ */ new Map();
|
|
3836
|
-
|
|
3876
|
+
p15__namespace.log.step(`Importing ${type}: ${pc15__default.default.cyan(name)}...`);
|
|
3837
3877
|
for (const key of orderedKeys) {
|
|
3838
3878
|
const node = nodes.get(key);
|
|
3839
3879
|
const { type: modType, name: registryName, manifest } = node;
|
|
@@ -3865,8 +3905,8 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
3865
3905
|
const programmaticPointTo = pointToMap[registryName] || pointToMap[`${modType}/${registryName}`];
|
|
3866
3906
|
if (programmaticPointTo) {
|
|
3867
3907
|
if (!checkModuleExists(projectRoot, modType, programmaticPointTo)) {
|
|
3868
|
-
|
|
3869
|
-
|
|
3908
|
+
p15__namespace.log.error(
|
|
3909
|
+
pc15__default.default.red(
|
|
3870
3910
|
`Module '${programmaticPointTo}' specified in --point-to does not exist in ${folder}.`
|
|
3871
3911
|
)
|
|
3872
3912
|
);
|
|
@@ -3874,7 +3914,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
3874
3914
|
}
|
|
3875
3915
|
globalAliasMap.set(`@/${folder}/${registryName}/`, `@/${folder}/${programmaticPointTo}/`);
|
|
3876
3916
|
globalAliasMap.set(`@/${folder}/${registryName}`, `@/${folder}/${programmaticPointTo}`);
|
|
3877
|
-
|
|
3917
|
+
p15__namespace.log.step(`Pointing '${modType}/${registryName}' to existing '${folder}/${programmaticPointTo}'`);
|
|
3878
3918
|
resolutions.set(key, {
|
|
3879
3919
|
type: modType,
|
|
3880
3920
|
registryName,
|
|
@@ -3890,7 +3930,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
3890
3930
|
globalAliasMap.set(`@/${folder}/${registryName}`, `@/${folder}/${programmaticAlias}`);
|
|
3891
3931
|
const baseDir = getModuleBaseDir(projectRoot, modType);
|
|
3892
3932
|
const displayDest = path2__default.default.relative(projectRoot, path2__default.default.join(baseDir, programmaticAlias));
|
|
3893
|
-
|
|
3933
|
+
p15__namespace.log.step(`Importing '${registryName}' into '${displayDest}'...`);
|
|
3894
3934
|
resolutions.set(key, {
|
|
3895
3935
|
type: modType,
|
|
3896
3936
|
registryName,
|
|
@@ -3902,7 +3942,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
3902
3942
|
}
|
|
3903
3943
|
const existingDir = getExistingModuleDir(projectRoot, modType, registryName);
|
|
3904
3944
|
if (!existingDir) {
|
|
3905
|
-
|
|
3945
|
+
p15__namespace.log.info(` \u21B3 Resolving required ${modType} dependency: ${pc15__default.default.cyan(registryName)}`);
|
|
3906
3946
|
resolutions.set(key, {
|
|
3907
3947
|
type: modType,
|
|
3908
3948
|
registryName,
|
|
@@ -3918,7 +3958,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
3918
3958
|
const remoteIntegrity = manifest.integrity || entry?.integrity;
|
|
3919
3959
|
const localHash = computeDirectoryHash(existingDir);
|
|
3920
3960
|
if (remoteIntegrity && localHash === remoteIntegrity) {
|
|
3921
|
-
|
|
3961
|
+
p15__namespace.log.step(`\u2713 ${modType}/${registryName} is up to date (reusing existing)`);
|
|
3922
3962
|
resolutions.set(key, {
|
|
3923
3963
|
type: modType,
|
|
3924
3964
|
registryName,
|
|
@@ -3929,7 +3969,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
3929
3969
|
continue;
|
|
3930
3970
|
}
|
|
3931
3971
|
if (flags.overwrite) {
|
|
3932
|
-
|
|
3972
|
+
p15__namespace.log.step(`Overwriting '${modType}/${registryName}' with registry version (--overwrite)...`);
|
|
3933
3973
|
resolutions.set(key, {
|
|
3934
3974
|
type: modType,
|
|
3935
3975
|
registryName,
|
|
@@ -3940,7 +3980,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
3940
3980
|
continue;
|
|
3941
3981
|
}
|
|
3942
3982
|
if (flags.yes) {
|
|
3943
|
-
|
|
3983
|
+
p15__namespace.log.info(`Using existing '${modType}/${registryName}'`);
|
|
3944
3984
|
resolutions.set(key, {
|
|
3945
3985
|
type: modType,
|
|
3946
3986
|
registryName,
|
|
@@ -3974,7 +4014,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
3974
4014
|
})
|
|
3975
4015
|
);
|
|
3976
4016
|
if (choice === "keep_existing" || choice === "use_existing") {
|
|
3977
|
-
|
|
4017
|
+
p15__namespace.log.step(`Skipping '${modType}/${registryName}' (keeping existing)`);
|
|
3978
4018
|
resolutions.set(key, {
|
|
3979
4019
|
type: modType,
|
|
3980
4020
|
registryName,
|
|
@@ -4046,7 +4086,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
4046
4086
|
chosenName = chosenName.replace(/^@\/(shared|features)\//, "").replace(/^(src\/)?(shared|features)\//, "").replace(/^\/+|\/+$/g, "").trim();
|
|
4047
4087
|
globalAliasMap.set(`@/${folder}/${registryName}/`, `@/${folder}/${chosenName}/`);
|
|
4048
4088
|
globalAliasMap.set(`@/${folder}/${registryName}`, `@/${folder}/${chosenName}`);
|
|
4049
|
-
|
|
4089
|
+
p15__namespace.log.step(`Pointing '${modType}/${registryName}' to existing '${folder}/${chosenName}'`);
|
|
4050
4090
|
resolutions.set(key, {
|
|
4051
4091
|
type: modType,
|
|
4052
4092
|
registryName,
|
|
@@ -4078,7 +4118,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
4078
4118
|
globalAliasMap.set(`@/${folder}/${registryName}`, `@/${folder}/${newName}`);
|
|
4079
4119
|
const baseDir = getModuleBaseDir(projectRoot, modType);
|
|
4080
4120
|
const displayDest = path2__default.default.relative(projectRoot, path2__default.default.join(baseDir, newName));
|
|
4081
|
-
|
|
4121
|
+
p15__namespace.log.step(`Importing '${registryName}' into '${displayDest}'...`);
|
|
4082
4122
|
resolutions.set(key, {
|
|
4083
4123
|
type: modType,
|
|
4084
4124
|
registryName,
|
|
@@ -4089,7 +4129,7 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
4089
4129
|
continue;
|
|
4090
4130
|
}
|
|
4091
4131
|
if (choice === "overwrite") {
|
|
4092
|
-
|
|
4132
|
+
p15__namespace.log.step(`Overwriting '${modType}/${registryName}' with registry version...`);
|
|
4093
4133
|
resolutions.set(key, {
|
|
4094
4134
|
type: modType,
|
|
4095
4135
|
registryName,
|
|
@@ -4132,8 +4172,8 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
4132
4172
|
const targetDir = path2__default.default.join(getModuleBaseDir(projectRoot, res.type), res.targetName);
|
|
4133
4173
|
const isOverwrite = Boolean(flags.overwrite || res.action === "overwrite");
|
|
4134
4174
|
if (key !== rootKey) {
|
|
4135
|
-
|
|
4136
|
-
`Importing ${res.type}: ${
|
|
4175
|
+
p15__namespace.log.step(
|
|
4176
|
+
`Importing ${res.type}: ${pc15__default.default.cyan(res.targetName)}${res.targetName !== res.registryName ? pc15__default.default.dim(` (from ${res.registryName})`) : ""}...`
|
|
4137
4177
|
);
|
|
4138
4178
|
}
|
|
4139
4179
|
if (res.action === "overwrite" && !flags.dryRun) {
|
|
@@ -4151,8 +4191,8 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
4151
4191
|
const remoteFilePath = `${folder}/${res.registryName}/${file}`;
|
|
4152
4192
|
const localFilePath = path2__default.default.join(targetDir, file);
|
|
4153
4193
|
if (fs4__default.default.existsSync(localFilePath) && !isOverwrite) {
|
|
4154
|
-
|
|
4155
|
-
` \u21B3 Skipping existing file: ${
|
|
4194
|
+
p15__namespace.log.warn(
|
|
4195
|
+
` \u21B3 Skipping existing file: ${pc15__default.default.dim(path2__default.default.relative(projectRoot, localFilePath))} (use --overwrite to replace)`
|
|
4156
4196
|
);
|
|
4157
4197
|
continue;
|
|
4158
4198
|
}
|
|
@@ -4164,18 +4204,18 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
4164
4204
|
}
|
|
4165
4205
|
const displayPath = path2__default.default.relative(projectRoot, localFilePath);
|
|
4166
4206
|
totalWrittenFiles.push(displayPath);
|
|
4167
|
-
|
|
4207
|
+
p15__namespace.log.message(` ${pc15__default.default.green("+")} ${displayPath}`);
|
|
4168
4208
|
}
|
|
4169
4209
|
}
|
|
4170
4210
|
const missingNpm = getMissingNpmPackages(projectRoot, Array.from(requiredNpmPackages));
|
|
4171
4211
|
if (missingNpm.length > 0) {
|
|
4172
4212
|
if (flags.skipInstall || flags.dryRun) {
|
|
4173
|
-
|
|
4213
|
+
p15__namespace.log.info(`Required npm dependencies to install: ${pc15__default.default.cyan(missingNpm.join(", "))}`);
|
|
4174
4214
|
} else {
|
|
4175
4215
|
try {
|
|
4176
4216
|
installNpmPackages(projectRoot, missingNpm);
|
|
4177
4217
|
} catch (err) {
|
|
4178
|
-
|
|
4218
|
+
p15__namespace.log.warn(
|
|
4179
4219
|
`Could not automatically install packages (${err.message}). Please run: npm install ${missingNpm.join(
|
|
4180
4220
|
" "
|
|
4181
4221
|
)}`
|
|
@@ -4184,13 +4224,13 @@ async function handleImport(typeArg, nameArg, flags = {}) {
|
|
|
4184
4224
|
}
|
|
4185
4225
|
}
|
|
4186
4226
|
if (flags.dryRun) {
|
|
4187
|
-
|
|
4227
|
+
p15__namespace.log.info(pc15__default.default.yellow("Dry run complete: No files were written to disk."));
|
|
4188
4228
|
} else {
|
|
4189
4229
|
const rootRes = resolutions.get(rootKey);
|
|
4190
4230
|
const baseDir = getModuleBaseDir(projectRoot, type);
|
|
4191
4231
|
const displayTarget = path2__default.default.relative(projectRoot, path2__default.default.join(baseDir, rootRes.targetName));
|
|
4192
|
-
|
|
4193
|
-
|
|
4232
|
+
p15__namespace.log.success(
|
|
4233
|
+
pc15__default.default.green(
|
|
4194
4234
|
`Successfully imported ${type} '${name}' (${totalWrittenFiles.length} file${totalWrittenFiles.length === 1 ? "" : "s"} placed in ${displayTarget})`
|
|
4195
4235
|
)
|
|
4196
4236
|
);
|
|
@@ -4413,10 +4453,10 @@ var FeatureDependencyGraph = class {
|
|
|
4413
4453
|
if (cycle) return cycle;
|
|
4414
4454
|
} else if (inStack.has(next)) {
|
|
4415
4455
|
const cycle = [next];
|
|
4416
|
-
let
|
|
4417
|
-
while (
|
|
4418
|
-
cycle.push(
|
|
4419
|
-
|
|
4456
|
+
let p18 = curr;
|
|
4457
|
+
while (p18 !== next) {
|
|
4458
|
+
cycle.push(p18);
|
|
4459
|
+
p18 = parent.get(p18) || next;
|
|
4420
4460
|
}
|
|
4421
4461
|
cycle.push(next);
|
|
4422
4462
|
cycle.reverse();
|
|
@@ -5318,15 +5358,15 @@ ${compiledDetails}
|
|
|
5318
5358
|
// src/commands/lint.ts
|
|
5319
5359
|
function formatViolation(v) {
|
|
5320
5360
|
const lines = [];
|
|
5321
|
-
lines.push(
|
|
5361
|
+
lines.push(pc15__default.default.underline(pc15__default.default.cyan(v.relativePath)) + pc15__default.default.dim(":") + pc15__default.default.yellow(String(v.line)));
|
|
5322
5362
|
const gutter = `${String(v.line).padStart(4, " ")} | `;
|
|
5323
|
-
lines.push(
|
|
5363
|
+
lines.push(pc15__default.default.dim(gutter) + v.code);
|
|
5324
5364
|
const categoryShort = v.category.replace(" Violation", "");
|
|
5325
5365
|
lines.push(
|
|
5326
|
-
" " +
|
|
5366
|
+
" " + pc15__default.default.red(pc15__default.default.bold("\u2716")) + " " + pc15__default.default.red(`[${categoryShort}]`) + " " + v.advice
|
|
5327
5367
|
);
|
|
5328
5368
|
if (v.fixExample?.good) {
|
|
5329
|
-
lines.push(" " +
|
|
5369
|
+
lines.push(" " + pc15__default.default.dim("\u2192") + " " + pc15__default.default.dim(v.fixExample.good));
|
|
5330
5370
|
}
|
|
5331
5371
|
return lines.join("\n");
|
|
5332
5372
|
}
|
|
@@ -5351,7 +5391,7 @@ async function handleLint(flags = {}) {
|
|
|
5351
5391
|
console.log("");
|
|
5352
5392
|
}
|
|
5353
5393
|
console.log(
|
|
5354
|
-
|
|
5394
|
+
pc15__default.default.red(
|
|
5355
5395
|
`\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).`
|
|
5356
5396
|
)
|
|
5357
5397
|
);
|
|
@@ -5370,7 +5410,7 @@ ${compiledDetails}
|
|
|
5370
5410
|
}
|
|
5371
5411
|
if (!quiet) {
|
|
5372
5412
|
console.log(
|
|
5373
|
-
|
|
5413
|
+
pc15__default.default.green(
|
|
5374
5414
|
`\u2714 Dependency rules verified across ${summary.totalFeatures} feature${summary.totalFeatures === 1 ? "" : "s"}.`
|
|
5375
5415
|
)
|
|
5376
5416
|
);
|
|
@@ -5385,21 +5425,55 @@ ${compiledDetails}
|
|
|
5385
5425
|
console.log(formatViolation(v));
|
|
5386
5426
|
console.log("");
|
|
5387
5427
|
}
|
|
5388
|
-
console.log(
|
|
5428
|
+
console.log(pc15__default.default.red(`\u2716 Dependency rules check failed (1 error).`));
|
|
5389
5429
|
console.log("");
|
|
5390
5430
|
}
|
|
5391
5431
|
}
|
|
5392
5432
|
throw err;
|
|
5393
5433
|
}
|
|
5394
5434
|
}
|
|
5435
|
+
async function handleInit(type, flags = {}) {
|
|
5436
|
+
if (!type) {
|
|
5437
|
+
const choice = handleCancel(
|
|
5438
|
+
await p15__namespace.select({
|
|
5439
|
+
message: "What would you like to initialize?",
|
|
5440
|
+
options: [
|
|
5441
|
+
{
|
|
5442
|
+
value: "env",
|
|
5443
|
+
label: "Environment Files",
|
|
5444
|
+
hint: "Generate local .env files from .env*.example templates"
|
|
5445
|
+
}
|
|
5446
|
+
]
|
|
5447
|
+
})
|
|
5448
|
+
);
|
|
5449
|
+
if (choice === "env") {
|
|
5450
|
+
await runEnvCommand(flags);
|
|
5451
|
+
}
|
|
5452
|
+
return;
|
|
5453
|
+
}
|
|
5454
|
+
const normalized = type.trim().toLowerCase();
|
|
5455
|
+
if (normalized === "env") {
|
|
5456
|
+
await runEnvCommand(flags);
|
|
5457
|
+
} else {
|
|
5458
|
+
p15__namespace.log.error(
|
|
5459
|
+
pc15__default.default.red(
|
|
5460
|
+
`Unknown init target: "${type}". Allowed targets: env.`
|
|
5461
|
+
)
|
|
5462
|
+
);
|
|
5463
|
+
if (process.env.VITEST) {
|
|
5464
|
+
throw new Error(`Unknown init target: "${type}". Allowed targets: env.`);
|
|
5465
|
+
}
|
|
5466
|
+
process.exit(1);
|
|
5467
|
+
}
|
|
5468
|
+
}
|
|
5395
5469
|
|
|
5396
5470
|
// src/cli.ts
|
|
5397
5471
|
function createCli() {
|
|
5398
5472
|
const cli = cac.cac("mason");
|
|
5399
5473
|
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) => {
|
|
5400
5474
|
if (args && args.length > 0) {
|
|
5401
|
-
|
|
5402
|
-
|
|
5475
|
+
p15__namespace.log.error(
|
|
5476
|
+
pc15__default.default.red(
|
|
5403
5477
|
`Unknown command: "${args.join(" ")}". Use --help to list available commands.`
|
|
5404
5478
|
)
|
|
5405
5479
|
);
|
|
@@ -5410,7 +5484,7 @@ function createCli() {
|
|
|
5410
5484
|
const mode = getEffectiveMode(projectRoot, flags);
|
|
5411
5485
|
if (mode === "registry") {
|
|
5412
5486
|
const choice2 = handleCancel(
|
|
5413
|
-
await
|
|
5487
|
+
await p15__namespace.select({
|
|
5414
5488
|
message: "\u{1F3DB}\uFE0F Mason (Registry Mode): What would you like to scaffold?",
|
|
5415
5489
|
options: [
|
|
5416
5490
|
{
|
|
@@ -5453,7 +5527,7 @@ function createCli() {
|
|
|
5453
5527
|
return;
|
|
5454
5528
|
}
|
|
5455
5529
|
const choice = handleCancel(
|
|
5456
|
-
await
|
|
5530
|
+
await p15__namespace.select({
|
|
5457
5531
|
message: "\u{1F9F1} Mason: What would you like to do?",
|
|
5458
5532
|
options: [
|
|
5459
5533
|
{
|
|
@@ -5470,6 +5544,11 @@ function createCli() {
|
|
|
5470
5544
|
value: "lint",
|
|
5471
5545
|
label: "Lint dependency rules",
|
|
5472
5546
|
hint: "Scan codebase and verify Clean Architecture dependency rules"
|
|
5547
|
+
},
|
|
5548
|
+
{
|
|
5549
|
+
value: "init",
|
|
5550
|
+
label: "Initialize environment",
|
|
5551
|
+
hint: "Generate local .env files from .env*.example templates"
|
|
5473
5552
|
}
|
|
5474
5553
|
]
|
|
5475
5554
|
})
|
|
@@ -5480,6 +5559,8 @@ function createCli() {
|
|
|
5480
5559
|
await handleImport(void 0, void 0, flags);
|
|
5481
5560
|
} else if (choice === "lint") {
|
|
5482
5561
|
await handleLint(flags);
|
|
5562
|
+
} else if (choice === "init") {
|
|
5563
|
+
await handleInit("env", flags);
|
|
5483
5564
|
}
|
|
5484
5565
|
} catch (err) {
|
|
5485
5566
|
handleCliError(err);
|
|
@@ -5527,6 +5608,16 @@ function createCli() {
|
|
|
5527
5608
|
handleCliError(err);
|
|
5528
5609
|
}
|
|
5529
5610
|
});
|
|
5611
|
+
cli.command(
|
|
5612
|
+
"init [type]",
|
|
5613
|
+
"Initialize project configurations and resources (e.g. 'mason init env')"
|
|
5614
|
+
).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 = {}) => {
|
|
5615
|
+
try {
|
|
5616
|
+
await handleInit(type, flags);
|
|
5617
|
+
} catch (err) {
|
|
5618
|
+
handleCliError(err);
|
|
5619
|
+
}
|
|
5620
|
+
});
|
|
5530
5621
|
const createSubtypes = [
|
|
5531
5622
|
"feature",
|
|
5532
5623
|
"shared",
|
|
@@ -5558,7 +5649,7 @@ function handleCliError(err) {
|
|
|
5558
5649
|
process.exit(0);
|
|
5559
5650
|
}
|
|
5560
5651
|
const message = err instanceof Error ? err.message : String(err);
|
|
5561
|
-
|
|
5652
|
+
p15__namespace.log.error(pc15__default.default.red(`Error: ${message}`));
|
|
5562
5653
|
if (process.env.VITEST) {
|
|
5563
5654
|
throw err;
|
|
5564
5655
|
}
|
|
@@ -5616,6 +5707,7 @@ exports.getTemplatesDir = getTemplatesDir;
|
|
|
5616
5707
|
exports.handleCancel = handleCancel;
|
|
5617
5708
|
exports.handleCreate = handleCreate;
|
|
5618
5709
|
exports.handleImport = handleImport;
|
|
5710
|
+
exports.handleInit = handleInit;
|
|
5619
5711
|
exports.handleLint = handleLint;
|
|
5620
5712
|
exports.hbs = hbs;
|
|
5621
5713
|
exports.httpHandlerTemplate = httpHandlerTemplate;
|
|
@@ -5645,6 +5737,7 @@ exports.renderTemplateFile = renderTemplateFile;
|
|
|
5645
5737
|
exports.resolveFeaturesDir = resolveFeaturesDir;
|
|
5646
5738
|
exports.resolveSharedDir = resolveSharedDir;
|
|
5647
5739
|
exports.runCli = runCli;
|
|
5740
|
+
exports.runEnvCommand = runEnvCommand;
|
|
5648
5741
|
exports.runSharedCommand = runSharedCommand;
|
|
5649
5742
|
exports.stubInfraTemplate = stubInfraTemplate;
|
|
5650
5743
|
exports.synthesizeCrudMethods = synthesizeCrudMethods;
|