@fluojs/cli 1.0.0-beta.1 → 1.0.0-beta.3
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/README.ko.md +56 -7
- package/README.md +56 -7
- package/dist/cli.d.ts +12 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +69 -33
- package/dist/commands/generate.d.ts +11 -1
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +71 -2
- package/dist/commands/inspect.d.ts +20 -0
- package/dist/commands/inspect.d.ts.map +1 -1
- package/dist/commands/inspect.js +153 -31
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +42 -0
- package/dist/commands/new.d.ts.map +1 -1
- package/dist/commands/new.js +25 -1
- package/dist/generator-types.d.ts +15 -1
- package/dist/generator-types.d.ts.map +1 -1
- package/dist/generators/controller.d.ts +7 -0
- package/dist/generators/controller.d.ts.map +1 -1
- package/dist/generators/controller.js +8 -0
- package/dist/generators/guard.d.ts +6 -0
- package/dist/generators/guard.d.ts.map +1 -1
- package/dist/generators/guard.js +7 -0
- package/dist/generators/interceptor.d.ts +6 -0
- package/dist/generators/interceptor.d.ts.map +1 -1
- package/dist/generators/interceptor.js +7 -0
- package/dist/generators/manifest.d.ts +267 -0
- package/dist/generators/manifest.d.ts.map +1 -1
- package/dist/generators/manifest.js +86 -1
- package/dist/generators/middleware.d.ts +6 -0
- package/dist/generators/middleware.d.ts.map +1 -1
- package/dist/generators/middleware.js +7 -0
- package/dist/generators/module.d.ts +22 -0
- package/dist/generators/module.d.ts.map +1 -1
- package/dist/generators/module.js +25 -0
- package/dist/generators/render.d.ts +7 -0
- package/dist/generators/render.d.ts.map +1 -1
- package/dist/generators/render.js +8 -0
- package/dist/generators/repository.d.ts +7 -0
- package/dist/generators/repository.d.ts.map +1 -1
- package/dist/generators/repository.js +8 -0
- package/dist/generators/request-dto.d.ts +6 -0
- package/dist/generators/request-dto.d.ts.map +1 -1
- package/dist/generators/request-dto.js +7 -0
- package/dist/generators/response-dto.d.ts +6 -0
- package/dist/generators/response-dto.d.ts.map +1 -1
- package/dist/generators/response-dto.js +7 -0
- package/dist/generators/service.d.ts +7 -0
- package/dist/generators/service.d.ts.map +1 -1
- package/dist/generators/service.js +8 -0
- package/dist/generators/utils.d.ts +18 -0
- package/dist/generators/utils.d.ts.map +1 -1
- package/dist/generators/utils.js +20 -0
- package/dist/help.d.ts +13 -0
- package/dist/help.d.ts.map +1 -1
- package/dist/help.js +15 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/new/package-spec-resolver.d.ts +7 -0
- package/dist/new/package-spec-resolver.d.ts.map +1 -1
- package/dist/new/package-spec-resolver.js +8 -0
- package/dist/new/prompt.d.ts +1 -0
- package/dist/new/prompt.d.ts.map +1 -1
- package/dist/new/prompt.js +12 -4
- package/dist/new/scaffold.d.ts.map +1 -1
- package/dist/new/scaffold.js +17 -1
- package/dist/prompt-cancel.d.ts +44 -0
- package/dist/prompt-cancel.d.ts.map +1 -0
- package/dist/prompt-cancel.js +49 -0
- package/dist/registry.d.ts +4 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +13 -5
- package/dist/transforms/nestjs-migrate.d.ts +48 -0
- package/dist/transforms/nestjs-migrate.d.ts.map +1 -1
- package/dist/transforms/nestjs-migrate.js +62 -0
- package/dist/update-check.d.ts +82 -0
- package/dist/update-check.d.ts.map +1 -0
- package/dist/update-check.js +475 -0
- package/package.json +10 -2
|
@@ -10,6 +10,53 @@ function writeFileIfChanged(filePath, content) {
|
|
|
10
10
|
writeFileSync(filePath, content, 'utf8');
|
|
11
11
|
return true;
|
|
12
12
|
}
|
|
13
|
+
|
|
14
|
+
/** Describes how one generated artifact would interact with the workspace. */
|
|
15
|
+
|
|
16
|
+
/** One path-level action reported by generate dry-run previews and structured results. */
|
|
17
|
+
|
|
18
|
+
function planFileWrite(filePath, content, options) {
|
|
19
|
+
if (!existsSync(filePath)) {
|
|
20
|
+
return {
|
|
21
|
+
action: 'create',
|
|
22
|
+
path: filePath
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
if (!options.force) {
|
|
26
|
+
return {
|
|
27
|
+
action: 'skip',
|
|
28
|
+
path: filePath
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (readFileSync(filePath, 'utf8') === content) {
|
|
32
|
+
return {
|
|
33
|
+
action: 'unchanged',
|
|
34
|
+
path: filePath
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
action: 'overwrite',
|
|
39
|
+
path: filePath
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function planModuleWrite(modulePath, content) {
|
|
43
|
+
if (!existsSync(modulePath)) {
|
|
44
|
+
return {
|
|
45
|
+
action: 'module-create',
|
|
46
|
+
path: modulePath
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (readFileSync(modulePath, 'utf8') === content) {
|
|
50
|
+
return {
|
|
51
|
+
action: 'module-unchanged',
|
|
52
|
+
path: modulePath
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
action: 'module-update',
|
|
57
|
+
path: modulePath
|
|
58
|
+
};
|
|
59
|
+
}
|
|
13
60
|
function createGeneratorOptions(kind, domainDirectory, kebab, options) {
|
|
14
61
|
return {
|
|
15
62
|
...options,
|
|
@@ -17,6 +64,15 @@ function createGeneratorOptions(kind, domainDirectory, kebab, options) {
|
|
|
17
64
|
hasService: options.hasService ?? (kind === 'controller' ? existsSync(join(domainDirectory, `${kebab}.service.ts`)) : undefined)
|
|
18
65
|
};
|
|
19
66
|
}
|
|
67
|
+
function resolveDomainDirectory(kind, resolvedBase, kebab, options) {
|
|
68
|
+
if (kind === 'request-dto' && options.targetFeature !== undefined) {
|
|
69
|
+
const normalizedFeature = options.targetFeature.trim();
|
|
70
|
+
const featureKebab = assertValidResourceName(normalizedFeature);
|
|
71
|
+
const featureDirectory = /^[A-Z]/u.test(normalizedFeature) ? toPlural(featureKebab) : featureKebab;
|
|
72
|
+
return join(resolvedBase, featureDirectory);
|
|
73
|
+
}
|
|
74
|
+
return join(resolvedBase, toPlural(kebab));
|
|
75
|
+
}
|
|
20
76
|
function assertValidResourceName(name) {
|
|
21
77
|
const kebab = toKebabCase(name);
|
|
22
78
|
if (name.trim().length === 0) {
|
|
@@ -88,7 +144,7 @@ function prepareModuleUpdate(domainDirectory, normalizedName, kind, classSuffix,
|
|
|
88
144
|
* @param kind Generator kind to execute.
|
|
89
145
|
* @param name Resource name supplied by the caller before normalization.
|
|
90
146
|
* @param baseDirectory Source directory that should receive the generated domain folder.
|
|
91
|
-
* @param options Optional generation flags that control overwrites and sibling-aware templates.
|
|
147
|
+
* @param options Optional generation flags that control overwrites, request DTO feature placement, and sibling-aware templates.
|
|
92
148
|
* @returns Structured file and wiring metadata for the completed generation run.
|
|
93
149
|
* @throws {Error} When the resource name is invalid, the generator kind is unknown, or the target module source cannot be updated safely.
|
|
94
150
|
*/
|
|
@@ -97,11 +153,23 @@ export function runGenerateCommand(kind, name, baseDirectory, options = {}) {
|
|
|
97
153
|
const kebab = assertValidResourceName(normalizedName);
|
|
98
154
|
const generator = findGeneratorDefinition(kind);
|
|
99
155
|
const resolvedBase = resolve(baseDirectory);
|
|
100
|
-
const domainDirectory =
|
|
156
|
+
const domainDirectory = resolveDomainDirectory(kind, resolvedBase, kebab, options);
|
|
101
157
|
const generatorOptions = createGeneratorOptions(kind, domainDirectory, kebab, options);
|
|
102
158
|
const files = generator.factory(normalizedName, generatorOptions);
|
|
103
159
|
const moduleRegistration = 'moduleRegistration' in generator ? generator.moduleRegistration : undefined;
|
|
104
160
|
const moduleUpdate = moduleRegistration ? prepareModuleUpdate(domainDirectory, normalizedName, kind, moduleRegistration.classSuffix, moduleRegistration.arrayKey) : undefined;
|
|
161
|
+
const plannedFiles = files.map(file => planFileWrite(join(domainDirectory, file.path), file.content, options));
|
|
162
|
+
const modulePlan = moduleUpdate ? planModuleWrite(moduleUpdate.modulePath, moduleUpdate.source) : undefined;
|
|
163
|
+
if (options.dryRun) {
|
|
164
|
+
return {
|
|
165
|
+
generatedFiles: [],
|
|
166
|
+
moduleRegistered: moduleUpdate !== undefined,
|
|
167
|
+
modulePath: moduleUpdate?.modulePath,
|
|
168
|
+
nextStepHint: generator.nextStepHint,
|
|
169
|
+
plannedFiles: modulePlan ? [...plannedFiles, modulePlan] : plannedFiles,
|
|
170
|
+
wiringBehavior: generator.wiringBehavior
|
|
171
|
+
};
|
|
172
|
+
}
|
|
105
173
|
mkdirSync(domainDirectory, {
|
|
106
174
|
recursive: true
|
|
107
175
|
});
|
|
@@ -129,6 +197,7 @@ export function runGenerateCommand(kind, name, baseDirectory, options = {}) {
|
|
|
129
197
|
moduleRegistered: moduleRegistered,
|
|
130
198
|
modulePath: resolvedModulePath,
|
|
131
199
|
nextStepHint: generator.nextStepHint,
|
|
200
|
+
plannedFiles: modulePlan ? [...plannedFiles, modulePlan] : plannedFiles,
|
|
132
201
|
wiringBehavior: generator.wiringBehavior
|
|
133
202
|
};
|
|
134
203
|
}
|
|
@@ -1,14 +1,34 @@
|
|
|
1
|
+
import { type PlatformShellSnapshot } from '@fluojs/runtime';
|
|
1
2
|
type CliStream = {
|
|
2
3
|
write(message: string): unknown;
|
|
3
4
|
};
|
|
5
|
+
type InspectPrompter = {
|
|
6
|
+
close?(): void;
|
|
7
|
+
confirm(message: string, defaultValue: boolean): Promise<boolean>;
|
|
8
|
+
};
|
|
9
|
+
type ReadableStream = {
|
|
10
|
+
isTTY?: boolean;
|
|
11
|
+
};
|
|
12
|
+
type StudioMermaidRenderer = (snapshot: PlatformShellSnapshot) => string;
|
|
13
|
+
type StudioMermaidRendererLoader = (cwd: string) => Promise<StudioMermaidRenderer | undefined>;
|
|
4
14
|
/**
|
|
5
15
|
* Runtime options for the inspect command when used programmatically.
|
|
6
16
|
*/
|
|
7
17
|
export interface InspectCommandRuntimeOptions {
|
|
18
|
+
/** Whether the caller is running under CI/non-interactive automation. */
|
|
19
|
+
ci?: boolean;
|
|
8
20
|
/** Current working directory for module resolution. */
|
|
9
21
|
cwd?: string;
|
|
22
|
+
/** Force or disable interactive prompts for optional Studio guidance. */
|
|
23
|
+
interactive?: boolean;
|
|
24
|
+
/** Optional test/editor hook for resolving Studio's Mermaid renderer. */
|
|
25
|
+
loadStudioMermaidRenderer?: StudioMermaidRendererLoader;
|
|
26
|
+
/** Custom prompt implementation used only when Studio is missing for Mermaid output. */
|
|
27
|
+
prompt?: InspectPrompter;
|
|
10
28
|
/** Custom stream for error output. */
|
|
11
29
|
stderr?: CliStream;
|
|
30
|
+
/** Custom stream for terminal detection. */
|
|
31
|
+
stdin?: ReadableStream;
|
|
12
32
|
/** Custom stream for standard output. */
|
|
13
33
|
stdout?: CliStream;
|
|
14
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/commands/inspect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../src/commands/inspect.ts"],"names":[],"mappings":"AAMA,OAAO,EAML,KAAK,qBAAqB,EAE3B,MAAM,iBAAiB,CAAC;AAKzB,KAAK,SAAS,GAAG;IACf,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,KAAK,CAAC,IAAI,IAAI,CAAC;IACf,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACnE,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,KAAK,qBAAqB,GAAG,CAAC,QAAQ,EAAE,qBAAqB,KAAK,MAAM,CAAC;AAEzE,KAAK,2BAA2B,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAAC;AAE/F;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,yEAAyE;IACzE,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,uDAAuD;IACvD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,yEAAyE;IACzE,yBAAyB,CAAC,EAAE,2BAA2B,CAAC;IACxD,wFAAwF;IACxF,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,sCAAsC;IACtC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,yCAAyC;IACzC,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AAkFD;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAarC;AA+PD;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,4BAAiC,GAAG,OAAO,CAAC,MAAM,CAAC,CA4EnH"}
|
package/dist/commands/inspect.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { mkdir, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { dirname, resolve } from 'node:path';
|
|
1
4
|
import { pathToFileURL } from 'node:url';
|
|
2
|
-
import
|
|
5
|
+
import * as clack from '@clack/prompts';
|
|
3
6
|
import { FluoFactory, PLATFORM_SHELL } from '@fluojs/runtime';
|
|
4
7
|
import { renderAliasList, renderHelpTable } from '../help.js';
|
|
8
|
+
import { CliPromptCancelledError, isCliPromptCancelledError } from '../prompt-cancel.js';
|
|
5
9
|
|
|
6
10
|
/**
|
|
7
11
|
* Runtime options for the inspect command when used programmatically.
|
|
@@ -13,12 +17,20 @@ const INSPECT_OPTION_HELP = [{
|
|
|
13
17
|
option: '--json'
|
|
14
18
|
}, {
|
|
15
19
|
aliases: [],
|
|
16
|
-
description: 'Emit
|
|
20
|
+
description: 'Emit a Mermaid graph through the optional @fluojs/studio rendering contract.',
|
|
17
21
|
option: '--mermaid'
|
|
18
22
|
}, {
|
|
19
23
|
aliases: [],
|
|
20
24
|
description: 'Bootstrap the application context and emit versioned timing diagnostics.',
|
|
21
25
|
option: '--timing'
|
|
26
|
+
}, {
|
|
27
|
+
aliases: [],
|
|
28
|
+
description: 'Emit a CI-friendly JSON report with summary, snapshot, diagnostics, and timing.',
|
|
29
|
+
option: '--report'
|
|
30
|
+
}, {
|
|
31
|
+
aliases: [],
|
|
32
|
+
description: 'Write the selected inspect payload to a file instead of stdout.',
|
|
33
|
+
option: '--output <path>'
|
|
22
34
|
}, {
|
|
23
35
|
aliases: [],
|
|
24
36
|
description: 'Select the exported module symbol name (default: AppModule).',
|
|
@@ -28,6 +40,8 @@ const INSPECT_OPTION_HELP = [{
|
|
|
28
40
|
description: 'Show help for the inspect command.',
|
|
29
41
|
option: '--help'
|
|
30
42
|
}];
|
|
43
|
+
const STUDIO_CONTRACT_ENTRYPOINT = '@fluojs/studio/contracts';
|
|
44
|
+
const STUDIO_MISSING_MESSAGE = ['Mermaid graph rendering is owned by @fluojs/studio, but @fluojs/studio is not resolvable from this project.', 'Install @fluojs/studio explicitly (for example: pnpm add -D @fluojs/studio) and rerun fluo inspect --mermaid.'].join('\n');
|
|
31
45
|
function isHelpFlag(value) {
|
|
32
46
|
return value === '--help' || value === '-h';
|
|
33
47
|
}
|
|
@@ -54,6 +68,8 @@ function parseInspectArgs(argv) {
|
|
|
54
68
|
let exportName = 'AppModule';
|
|
55
69
|
let json = false;
|
|
56
70
|
let mermaid = false;
|
|
71
|
+
let outputPath;
|
|
72
|
+
let report = false;
|
|
57
73
|
let timing = false;
|
|
58
74
|
for (let index = 0; index < argv.length; index += 1) {
|
|
59
75
|
const option = argv[index];
|
|
@@ -72,6 +88,19 @@ function parseInspectArgs(argv) {
|
|
|
72
88
|
timing = true;
|
|
73
89
|
continue;
|
|
74
90
|
}
|
|
91
|
+
if (option === '--report') {
|
|
92
|
+
report = true;
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
if (option === '--output') {
|
|
96
|
+
const next = argv[index + 1];
|
|
97
|
+
if (!next || next.startsWith('-')) {
|
|
98
|
+
throw new Error('Expected --output to have a file path value.');
|
|
99
|
+
}
|
|
100
|
+
outputPath = next;
|
|
101
|
+
index += 1;
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
75
104
|
if (option === '--export') {
|
|
76
105
|
const next = argv[index + 1];
|
|
77
106
|
if (!next || next.startsWith('-')) {
|
|
@@ -92,18 +121,23 @@ function parseInspectArgs(argv) {
|
|
|
92
121
|
if (!modulePath) {
|
|
93
122
|
throw new Error(inspectUsage());
|
|
94
123
|
}
|
|
95
|
-
if (!json && !mermaid && !timing) {
|
|
124
|
+
if (!json && !mermaid && !timing && !report) {
|
|
96
125
|
json = true;
|
|
97
126
|
}
|
|
98
|
-
const selectedModes = [json, mermaid,
|
|
127
|
+
const selectedModes = [json, mermaid, report].filter(Boolean).length;
|
|
99
128
|
if (selectedModes > 1) {
|
|
100
|
-
throw new Error('Choose only one inspect output mode: --json, --mermaid, or --
|
|
129
|
+
throw new Error('Choose only one inspect output mode: --json, --mermaid, or --report.');
|
|
130
|
+
}
|
|
131
|
+
if (mermaid && timing) {
|
|
132
|
+
throw new Error('Use --timing only with JSON inspect output or --report. Mermaid rendering remains delegated to @fluojs/studio.');
|
|
101
133
|
}
|
|
102
134
|
return {
|
|
103
135
|
exportName,
|
|
104
136
|
json,
|
|
105
137
|
mermaid,
|
|
106
138
|
modulePath,
|
|
139
|
+
outputPath,
|
|
140
|
+
report,
|
|
107
141
|
timing
|
|
108
142
|
};
|
|
109
143
|
}
|
|
@@ -124,33 +158,111 @@ function stringifyTiming(timing) {
|
|
|
124
158
|
function stringifySnapshot(snapshot) {
|
|
125
159
|
return JSON.stringify(snapshot, null, 2);
|
|
126
160
|
}
|
|
127
|
-
function
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
161
|
+
function createEmptyTimingDiagnostics() {
|
|
162
|
+
return {
|
|
163
|
+
phases: [],
|
|
164
|
+
totalMs: 0,
|
|
165
|
+
version: 1
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
function createInspectReport(snapshot, timing) {
|
|
169
|
+
const resolvedTiming = timing ?? createEmptyTimingDiagnostics();
|
|
170
|
+
const errorCount = snapshot.diagnostics.filter(diagnostic => diagnostic.severity === 'error').length;
|
|
171
|
+
const warningCount = snapshot.diagnostics.filter(diagnostic => diagnostic.severity === 'warning').length;
|
|
172
|
+
return {
|
|
173
|
+
generatedAt: snapshot.generatedAt,
|
|
174
|
+
snapshot,
|
|
175
|
+
summary: {
|
|
176
|
+
componentCount: snapshot.components.length,
|
|
177
|
+
diagnosticCount: snapshot.diagnostics.length,
|
|
178
|
+
errorCount,
|
|
179
|
+
healthStatus: snapshot.health.status,
|
|
180
|
+
readinessStatus: snapshot.readiness.status,
|
|
181
|
+
timingTotalMs: resolvedTiming.totalMs,
|
|
182
|
+
warningCount
|
|
183
|
+
},
|
|
184
|
+
timing: resolvedTiming,
|
|
185
|
+
version: 1
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function stringifySnapshotWithTiming(snapshot, timing) {
|
|
189
|
+
return JSON.stringify({
|
|
190
|
+
snapshot,
|
|
191
|
+
timing: timing ?? createEmptyTimingDiagnostics()
|
|
192
|
+
}, null, 2);
|
|
193
|
+
}
|
|
194
|
+
async function emitInspectPayload(payload, parsed, cwd, stdout) {
|
|
195
|
+
if (!parsed.outputPath) {
|
|
196
|
+
stdout.write(`${payload}\n`);
|
|
197
|
+
return;
|
|
139
198
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
199
|
+
const outputPath = resolve(cwd, parsed.outputPath);
|
|
200
|
+
await mkdir(dirname(outputPath), {
|
|
201
|
+
recursive: true
|
|
202
|
+
});
|
|
203
|
+
await writeFile(outputPath, `${payload}\n`, 'utf8');
|
|
204
|
+
}
|
|
205
|
+
function createInspectPrompter() {
|
|
206
|
+
return {
|
|
207
|
+
async confirm(message, defaultValue) {
|
|
208
|
+
const result = await clack.confirm({
|
|
209
|
+
initialValue: defaultValue,
|
|
210
|
+
message
|
|
211
|
+
});
|
|
212
|
+
if (clack.isCancel(result)) {
|
|
213
|
+
clack.cancel('Operation cancelled.');
|
|
214
|
+
throw new CliPromptCancelledError();
|
|
215
|
+
}
|
|
216
|
+
return result;
|
|
144
217
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
function shouldPromptForStudio(runtime) {
|
|
221
|
+
if (runtime.prompt !== undefined) {
|
|
222
|
+
return runtime.interactive ?? true;
|
|
223
|
+
}
|
|
224
|
+
if (runtime.ci === true) {
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
return runtime.stdout === undefined && runtime.stderr === undefined && (runtime.interactive ?? true) && Boolean(runtime.stdin?.isTTY ?? process.stdin.isTTY);
|
|
228
|
+
}
|
|
229
|
+
async function loadStudioMermaidRenderer(cwd) {
|
|
230
|
+
const resolvers = [createRequire(resolve(cwd, 'package.json')), createRequire(import.meta.url)];
|
|
231
|
+
for (const resolver of resolvers) {
|
|
232
|
+
try {
|
|
233
|
+
const resolvedEntrypoint = resolver.resolve(STUDIO_CONTRACT_ENTRYPOINT);
|
|
234
|
+
const importedContract = await import(pathToFileURL(resolvedEntrypoint).href);
|
|
235
|
+
if (typeof importedContract.renderMermaid !== 'function') {
|
|
236
|
+
throw new Error(`${STUDIO_CONTRACT_ENTRYPOINT} does not export renderMermaid(snapshot).`);
|
|
237
|
+
}
|
|
238
|
+
return importedContract.renderMermaid;
|
|
239
|
+
} catch (error) {
|
|
240
|
+
const code = typeof error === 'object' && error !== null && 'code' in error ? error.code : undefined;
|
|
241
|
+
if (code !== 'MODULE_NOT_FOUND' && code !== 'ERR_MODULE_NOT_FOUND') {
|
|
242
|
+
throw error;
|
|
149
243
|
}
|
|
150
|
-
lines.push(` ${from} --> ${to}`);
|
|
151
244
|
}
|
|
152
245
|
}
|
|
153
|
-
return
|
|
246
|
+
return undefined;
|
|
247
|
+
}
|
|
248
|
+
async function resolveStudioMermaidRenderer(cwd, runtime) {
|
|
249
|
+
const renderer = await (runtime.loadStudioMermaidRenderer ?? loadStudioMermaidRenderer)(cwd);
|
|
250
|
+
if (renderer) {
|
|
251
|
+
return renderer;
|
|
252
|
+
}
|
|
253
|
+
if (!shouldPromptForStudio(runtime)) {
|
|
254
|
+
throw new Error(STUDIO_MISSING_MESSAGE);
|
|
255
|
+
}
|
|
256
|
+
const prompt = runtime.prompt ?? createInspectPrompter();
|
|
257
|
+
try {
|
|
258
|
+
const approvedInstall = await prompt.confirm('Install @fluojs/studio before rendering Mermaid output?', false);
|
|
259
|
+
if (!approvedInstall) {
|
|
260
|
+
throw new Error(`${STUDIO_MISSING_MESSAGE}\nInstallation declined; no package-manager command was run.`);
|
|
261
|
+
}
|
|
262
|
+
throw new Error(`${STUDIO_MISSING_MESSAGE}\nAutomatic installation is not run by fluo inspect. Install @fluojs/studio explicitly, then rerun the command.`);
|
|
263
|
+
} finally {
|
|
264
|
+
prompt.close?.();
|
|
265
|
+
}
|
|
154
266
|
}
|
|
155
267
|
|
|
156
268
|
/**
|
|
@@ -173,7 +285,7 @@ export async function runInspectCommand(argv, runtime = {}) {
|
|
|
173
285
|
const modulePath = resolve(cwd, parsed.modulePath);
|
|
174
286
|
const importedModule = await import(pathToFileURL(modulePath).href);
|
|
175
287
|
const rootModule = resolveRootModule(importedModule[parsed.exportName], parsed.exportName);
|
|
176
|
-
if (parsed.timing) {
|
|
288
|
+
if (parsed.timing && !parsed.json && !parsed.report) {
|
|
177
289
|
const context = await FluoFactory.createApplicationContext(rootModule, {
|
|
178
290
|
diagnostics: {
|
|
179
291
|
timing: true
|
|
@@ -186,13 +298,16 @@ export async function runInspectCommand(argv, runtime = {}) {
|
|
|
186
298
|
}
|
|
187
299
|
});
|
|
188
300
|
try {
|
|
189
|
-
|
|
301
|
+
await emitInspectPayload(stringifyTiming(context.bootstrapTiming), parsed, cwd, stdout);
|
|
190
302
|
} finally {
|
|
191
303
|
await context.close();
|
|
192
304
|
}
|
|
193
305
|
return 0;
|
|
194
306
|
}
|
|
195
307
|
const context = await FluoFactory.createApplicationContext(rootModule, {
|
|
308
|
+
diagnostics: parsed.timing || parsed.report ? {
|
|
309
|
+
timing: true
|
|
310
|
+
} : undefined,
|
|
196
311
|
logger: {
|
|
197
312
|
debug() {},
|
|
198
313
|
error() {},
|
|
@@ -204,16 +319,23 @@ export async function runInspectCommand(argv, runtime = {}) {
|
|
|
204
319
|
const platformShell = await context.get(PLATFORM_SHELL);
|
|
205
320
|
const snapshot = await platformShell.snapshot();
|
|
206
321
|
if (parsed.json) {
|
|
207
|
-
|
|
322
|
+
await emitInspectPayload(parsed.timing ? stringifySnapshotWithTiming(snapshot, context.bootstrapTiming) : stringifySnapshot(snapshot), parsed, cwd, stdout);
|
|
323
|
+
}
|
|
324
|
+
if (parsed.report) {
|
|
325
|
+
await emitInspectPayload(JSON.stringify(createInspectReport(snapshot, context.bootstrapTiming), null, 2), parsed, cwd, stdout);
|
|
208
326
|
}
|
|
209
327
|
if (parsed.mermaid) {
|
|
210
|
-
|
|
328
|
+
const renderMermaid = await resolveStudioMermaidRenderer(cwd, runtime);
|
|
329
|
+
await emitInspectPayload(renderMermaid(snapshot), parsed, cwd, stdout);
|
|
211
330
|
}
|
|
212
331
|
} finally {
|
|
213
332
|
await context.close();
|
|
214
333
|
}
|
|
215
334
|
return 0;
|
|
216
335
|
} catch (error) {
|
|
336
|
+
if (isCliPromptCancelledError(error)) {
|
|
337
|
+
return 0;
|
|
338
|
+
}
|
|
217
339
|
const message = error instanceof Error ? error.message : String(error);
|
|
218
340
|
stderr.write(`${message}\n`);
|
|
219
341
|
return 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../src/commands/migrate.ts"],"names":[],"mappings":"AAaA,KAAK,SAAS,GAAG;IACf,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,qDAAqD;IACrD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,yCAAyC;IACzC,MAAM,CAAC,EAAE,SAAS,CAAC;CACpB;AA4KD;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAgBrC;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,4BAAiC,GAAG,OAAO,CAAC,MAAM,CAAC,CAwEnH"}
|
package/dist/commands/migrate.js
CHANGED
|
@@ -10,6 +10,10 @@ const MIGRATE_OPTION_HELP = [{
|
|
|
10
10
|
aliases: ['-a'],
|
|
11
11
|
description: 'Apply file changes. Dry-run is the default mode.',
|
|
12
12
|
option: '--apply'
|
|
13
|
+
}, {
|
|
14
|
+
aliases: [],
|
|
15
|
+
description: 'Emit a machine-readable JSON migration report to stdout. Errors still go to stderr.',
|
|
16
|
+
option: '--json'
|
|
13
17
|
}, {
|
|
14
18
|
aliases: [],
|
|
15
19
|
description: `Run only selected transforms. Available: ${MIGRATION_TRANSFORMS.join(', ')}.`,
|
|
@@ -40,6 +44,7 @@ function parseTransformList(rawValue, optionName) {
|
|
|
40
44
|
function parseArgs(argv) {
|
|
41
45
|
let pathArgument;
|
|
42
46
|
let apply = false;
|
|
47
|
+
let json = false;
|
|
43
48
|
let onlyTransforms;
|
|
44
49
|
let skipTransforms = [];
|
|
45
50
|
for (let index = 0; index < argv.length; index += 1) {
|
|
@@ -48,6 +53,13 @@ function parseArgs(argv) {
|
|
|
48
53
|
apply = true;
|
|
49
54
|
continue;
|
|
50
55
|
}
|
|
56
|
+
if (arg === '--json') {
|
|
57
|
+
if (json) {
|
|
58
|
+
throw new Error('Duplicate --json option.');
|
|
59
|
+
}
|
|
60
|
+
json = true;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
51
63
|
if (arg === '--only' || arg === '--skip') {
|
|
52
64
|
const rawValue = argv[index + 1];
|
|
53
65
|
if (!rawValue || rawValue.startsWith('-')) {
|
|
@@ -85,10 +97,36 @@ function parseArgs(argv) {
|
|
|
85
97
|
}
|
|
86
98
|
return {
|
|
87
99
|
apply,
|
|
100
|
+
json,
|
|
88
101
|
path: pathArgument,
|
|
89
102
|
transforms: enabled
|
|
90
103
|
};
|
|
91
104
|
}
|
|
105
|
+
function renderJsonReport(report, transforms) {
|
|
106
|
+
return `${JSON.stringify({
|
|
107
|
+
command: 'migrate',
|
|
108
|
+
mode: report.apply ? 'apply' : 'dry-run',
|
|
109
|
+
apply: report.apply,
|
|
110
|
+
dryRun: !report.apply,
|
|
111
|
+
transforms,
|
|
112
|
+
scannedFiles: report.scannedFiles,
|
|
113
|
+
changedFiles: report.changedFiles,
|
|
114
|
+
warningCount: report.warningCount,
|
|
115
|
+
files: report.fileResults.map(fileResult => ({
|
|
116
|
+
filePath: fileResult.filePath,
|
|
117
|
+
changed: fileResult.changed,
|
|
118
|
+
appliedTransforms: fileResult.appliedTransforms,
|
|
119
|
+
warningCount: fileResult.warnings.length,
|
|
120
|
+
warnings: fileResult.warnings.map(warning => ({
|
|
121
|
+
category: warning.category,
|
|
122
|
+
categoryLabel: getWarningCategoryLabel(warning.category),
|
|
123
|
+
filePath: warning.filePath,
|
|
124
|
+
line: warning.line,
|
|
125
|
+
message: warning.message
|
|
126
|
+
}))
|
|
127
|
+
}))
|
|
128
|
+
}, null, 2)}\n`;
|
|
129
|
+
}
|
|
92
130
|
|
|
93
131
|
/**
|
|
94
132
|
* Returns usage information for the migrate command.
|
|
@@ -131,6 +169,10 @@ export async function runMigrateCommand(argv, runtime = {}) {
|
|
|
131
169
|
enabledTransforms: parsed.transforms,
|
|
132
170
|
targetPath
|
|
133
171
|
});
|
|
172
|
+
if (parsed.json) {
|
|
173
|
+
stdout.write(renderJsonReport(report, transforms));
|
|
174
|
+
return 0;
|
|
175
|
+
}
|
|
134
176
|
stdout.write(`Mode: ${parsed.apply ? 'apply' : 'dry-run'}\n`);
|
|
135
177
|
stdout.write(`Enabled transforms: ${renderTransformList(transforms)}\n`);
|
|
136
178
|
stdout.write(`Scanned files: ${report.scannedFiles}\n`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"new.d.ts","sourceRoot":"","sources":["../../src/commands/new.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"new.d.ts","sourceRoot":"","sources":["../../src/commands/new.ts"],"names":[],"mappings":"AAOA,OAAO,EAA2B,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAWnF,OAAO,KAAK,EAAoB,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAE3E,KAAK,SAAS,GAAG;IACf,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC,CAAC;AAuBF;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;IACjE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC5B,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA0UD;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,MAAM,CA0BjC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,wBAA6B,GAAG,OAAO,CAAC,MAAM,CAAC,CA4G3G"}
|
package/dist/commands/new.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
2
|
import { spinner as clackSpinner, log as clackLog } from '@clack/prompts';
|
|
3
3
|
import { renderAliasList, renderHelpTable } from '../help.js';
|
|
4
|
+
import { isCliPromptCancelledError } from '../prompt-cancel.js';
|
|
4
5
|
import { installDependencies } from '../new/install.js';
|
|
5
6
|
import { collectBootstrapAnswers } from '../new/prompt.js';
|
|
7
|
+
import { resolveBootstrapPlan } from '../new/resolver.js';
|
|
6
8
|
import { scaffoldBootstrapApp } from '../new/scaffold.js';
|
|
7
9
|
import { SUPPORTED_BOOTSTRAP_PLATFORMS, SUPPORTED_BOOTSTRAP_RUNTIMES, SUPPORTED_BOOTSTRAP_SHAPES, SUPPORTED_BOOTSTRAP_TOOLING_PRESETS, SUPPORTED_BOOTSTRAP_TOPOLOGY_MODES, SUPPORTED_BOOTSTRAP_TRANSPORTS } from '../new/starter-profiles.js';
|
|
8
10
|
function shouldUseInteractiveShell(runtime) {
|
|
@@ -79,6 +81,10 @@ const NEW_OPTION_HELP = [{
|
|
|
79
81
|
aliases: [],
|
|
80
82
|
description: 'Skip git repository initialization in the generated starter.',
|
|
81
83
|
option: '--no-git'
|
|
84
|
+
}, {
|
|
85
|
+
aliases: [],
|
|
86
|
+
description: 'Print the resolved scaffold plan without writing files, installing dependencies, or initializing git.',
|
|
87
|
+
option: '--print-plan'
|
|
82
88
|
}, {
|
|
83
89
|
aliases: ['-h'],
|
|
84
90
|
description: 'Show help for the new command.',
|
|
@@ -163,7 +169,7 @@ function parseArgs(argv) {
|
|
|
163
169
|
}
|
|
164
170
|
parsed.platform = readOptionValue(argv, index, '--platform');
|
|
165
171
|
if (!SUPPORTED_PLATFORMS.has(parsed.platform)) {
|
|
166
|
-
throw new Error(
|
|
172
|
+
throw new Error(`Invalid --platform value "${parsed.platform}". Use one of: bun, cloudflare-workers, deno, fastify, express, nodejs, none.`);
|
|
167
173
|
}
|
|
168
174
|
index += 1;
|
|
169
175
|
break;
|
|
@@ -204,6 +210,9 @@ function parseArgs(argv) {
|
|
|
204
210
|
case '--force':
|
|
205
211
|
parsed.force = true;
|
|
206
212
|
break;
|
|
213
|
+
case '--print-plan':
|
|
214
|
+
parsed.printPlan = true;
|
|
215
|
+
break;
|
|
207
216
|
case '--install':
|
|
208
217
|
parsed.installDependencies = setBooleanSelection(parsed.installDependencies, true, '--install', '--no-install');
|
|
209
218
|
break;
|
|
@@ -232,6 +241,13 @@ function parseArgs(argv) {
|
|
|
232
241
|
}
|
|
233
242
|
return parsed;
|
|
234
243
|
}
|
|
244
|
+
function renderDependencyList(dependencies) {
|
|
245
|
+
return dependencies.length > 0 ? dependencies.join(', ') : '(none)';
|
|
246
|
+
}
|
|
247
|
+
function renderScaffoldPlanPreview(answers, resolvedTargetDirectory) {
|
|
248
|
+
const bootstrapPlan = resolveBootstrapPlan(answers);
|
|
249
|
+
return ['fluo new scaffold plan', '', `Project name: ${answers.projectName}`, `Target directory: ${answers.targetDirectory}`, `Resolved target: ${resolvedTargetDirectory}`, `Shape: ${answers.shape}`, `Runtime: ${answers.runtime}`, `Platform: ${answers.platform}`, `Transport: ${answers.transport}`, `Tooling preset: ${answers.tooling}`, `Topology: ${answers.topology.mode}${answers.topology.deferred ? ' (deferred)' : ''}`, `Starter recipe: ${bootstrapPlan.profile.id}`, `Emitter: ${bootstrapPlan.emitter.type}`, `Package manager: ${answers.packageManager}`, `Install dependencies: ${answers.installDependencies ? 'yes' : 'no'}`, `Initialize git: ${answers.initializeGit ? 'yes' : 'no'}`, '', 'Dependencies:', ` runtime: ${renderDependencyList(bootstrapPlan.dependencies.dependencies)}`, ` dev: ${renderDependencyList(bootstrapPlan.dependencies.devDependencies)}`, '', 'Side effects: none. Preview mode does not create files, install dependencies, or initialize git.'].join('\n');
|
|
250
|
+
}
|
|
235
251
|
|
|
236
252
|
/**
|
|
237
253
|
* Renders CLI help text for `fluo new`.
|
|
@@ -287,11 +303,16 @@ export async function runNewCommand(argv, runtime = {}) {
|
|
|
287
303
|
}
|
|
288
304
|
const answers = await collectBootstrapAnswers(partialAnswers, runtime.cwd ?? process.cwd(), runtime.userAgent, {
|
|
289
305
|
interactive: runtime.interactive,
|
|
306
|
+
completionMessage: parsed.printPlan ? 'Scaffold plan resolved. No files were written.' : undefined,
|
|
290
307
|
prompt: runtime.prompt,
|
|
291
308
|
stdin: runtime.stdin,
|
|
292
309
|
stdout
|
|
293
310
|
});
|
|
294
311
|
const targetDirectory = resolve(runtime.cwd ?? process.cwd(), answers.targetDirectory);
|
|
312
|
+
if (parsed.printPlan) {
|
|
313
|
+
stdout.write(`${renderScaffoldPlanPreview(answers, targetDirectory)}\n`);
|
|
314
|
+
return 0;
|
|
315
|
+
}
|
|
295
316
|
const options = {
|
|
296
317
|
...answers,
|
|
297
318
|
dependencySource: runtime.dependencySource,
|
|
@@ -346,6 +367,9 @@ export async function runNewCommand(argv, runtime = {}) {
|
|
|
346
367
|
stdout.write(`Next steps:\n cd ${answers.targetDirectory}\n ${answers.packageManager === 'npm' ? 'npm run dev' : answers.packageManager === 'bun' ? 'bun run dev' : `${answers.packageManager} dev`}\n`);
|
|
347
368
|
return 0;
|
|
348
369
|
} catch (error) {
|
|
370
|
+
if (isCliPromptCancelledError(error)) {
|
|
371
|
+
return 0;
|
|
372
|
+
}
|
|
349
373
|
const message = error instanceof Error ? error.message : String(error);
|
|
350
374
|
stderr.write(`${message}\n`);
|
|
351
375
|
return 1;
|
|
@@ -3,11 +3,17 @@ export interface GeneratedFile {
|
|
|
3
3
|
content: string;
|
|
4
4
|
path: string;
|
|
5
5
|
}
|
|
6
|
-
/** Optional generation flags that influence overwrite behavior and sibling-aware templates. */
|
|
6
|
+
/** Optional generation flags that influence overwrite behavior, target placement, plan previews, and sibling-aware templates. */
|
|
7
7
|
export interface GenerateOptions {
|
|
8
|
+
/** Preview planned writes and module updates without mutating the workspace. */
|
|
9
|
+
dryRun?: boolean;
|
|
8
10
|
force?: boolean;
|
|
9
11
|
hasRepo?: boolean;
|
|
10
12
|
hasService?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Feature or slice directory that should receive feature-local files such as request DTOs.
|
|
15
|
+
*/
|
|
16
|
+
targetFeature?: string;
|
|
11
17
|
}
|
|
12
18
|
/**
|
|
13
19
|
* Produces the in-memory files for one schematic/resource pair.
|
|
@@ -15,7 +21,15 @@ export interface GenerateOptions {
|
|
|
15
21
|
export type GeneratorFactory = (name: string, options?: GenerateOptions) => GeneratedFile[];
|
|
16
22
|
/** Registry shape used by generator manifests to bind a factory to CLI metadata. */
|
|
17
23
|
export interface GeneratorRegistration {
|
|
24
|
+
collectionId?: string;
|
|
18
25
|
factory: GeneratorFactory;
|
|
19
26
|
description?: string;
|
|
20
27
|
}
|
|
28
|
+
/** Describes a supported option for generator metadata, help output, and docs alignment tests. */
|
|
29
|
+
export interface GeneratorOptionSchema {
|
|
30
|
+
aliases: readonly string[];
|
|
31
|
+
description: string;
|
|
32
|
+
name: string;
|
|
33
|
+
value: 'boolean' | 'path';
|
|
34
|
+
}
|
|
21
35
|
//# sourceMappingURL=generator-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator-types.d.ts","sourceRoot":"","sources":["../src/generator-types.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED
|
|
1
|
+
{"version":3,"file":"generator-types.d.ts","sourceRoot":"","sources":["../src/generator-types.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,iIAAiI;AACjI,MAAM,WAAW,eAAe;IAC9B,gFAAgF;IAChF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,eAAe,KAAK,aAAa,EAAE,CAAC;AAE5F,oFAAoF;AACpF,MAAM,WAAW,qBAAqB;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,gBAAgB,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,kGAAkG;AAClG,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC;CAC3B"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import type { GenerateOptions, GeneratedFile } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generate controller files.
|
|
4
|
+
*
|
|
5
|
+
* @param name The name.
|
|
6
|
+
* @param options The options.
|
|
7
|
+
* @returns The generate controller files result.
|
|
8
|
+
*/
|
|
2
9
|
export declare function generateControllerFiles(name: string, options?: GenerateOptions): GeneratedFile[];
|
|
3
10
|
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/generators/controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKlE,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,aAAa,EAAE,CAkBpG"}
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/generators/controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAKlE;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,aAAa,EAAE,CAkBpG"}
|