@veloxts/cli 0.4.0 → 0.4.1
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/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/generate.d.ts +17 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +219 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/migrate.d.ts +8 -3
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +17 -123
- package/dist/commands/migrate.js.map +1 -1
- package/dist/generators/base.d.ts +76 -0
- package/dist/generators/base.d.ts.map +1 -0
- package/dist/generators/base.js +271 -0
- package/dist/generators/base.js.map +1 -0
- package/dist/generators/generators/index.d.ts +17 -0
- package/dist/generators/generators/index.d.ts.map +1 -0
- package/dist/generators/generators/index.js +43 -0
- package/dist/generators/generators/index.js.map +1 -0
- package/dist/generators/generators/migration.d.ts +43 -0
- package/dist/generators/generators/migration.d.ts.map +1 -0
- package/dist/generators/generators/migration.js +121 -0
- package/dist/generators/generators/migration.js.map +1 -0
- package/dist/generators/generators/model.d.ts +38 -0
- package/dist/generators/generators/model.d.ts.map +1 -0
- package/dist/generators/generators/model.js +108 -0
- package/dist/generators/generators/model.js.map +1 -0
- package/dist/generators/generators/procedure.d.ts +37 -0
- package/dist/generators/generators/procedure.d.ts.map +1 -0
- package/dist/generators/generators/procedure.js +99 -0
- package/dist/generators/generators/procedure.js.map +1 -0
- package/dist/generators/generators/resource.d.ts +29 -0
- package/dist/generators/generators/resource.d.ts.map +1 -0
- package/dist/generators/generators/resource.js +124 -0
- package/dist/generators/generators/resource.js.map +1 -0
- package/dist/generators/generators/schema.d.ts +28 -0
- package/dist/generators/generators/schema.d.ts.map +1 -0
- package/dist/generators/generators/schema.js +83 -0
- package/dist/generators/generators/schema.js.map +1 -0
- package/dist/generators/generators/test.d.ts +28 -0
- package/dist/generators/generators/test.d.ts.map +1 -0
- package/dist/generators/generators/test.js +96 -0
- package/dist/generators/generators/test.js.map +1 -0
- package/dist/generators/index.d.ts +16 -0
- package/dist/generators/index.d.ts.map +1 -0
- package/dist/generators/index.js +16 -0
- package/dist/generators/index.js.map +1 -0
- package/dist/generators/registry.d.ts +97 -0
- package/dist/generators/registry.d.ts.map +1 -0
- package/dist/generators/registry.js +253 -0
- package/dist/generators/registry.js.map +1 -0
- package/dist/generators/templates/migration.d.ts +23 -0
- package/dist/generators/templates/migration.d.ts.map +1 -0
- package/dist/generators/templates/migration.js +389 -0
- package/dist/generators/templates/migration.js.map +1 -0
- package/dist/generators/templates/model.d.ts +37 -0
- package/dist/generators/templates/model.d.ts.map +1 -0
- package/dist/generators/templates/model.js +374 -0
- package/dist/generators/templates/model.js.map +1 -0
- package/dist/generators/templates/procedure.d.ts +25 -0
- package/dist/generators/templates/procedure.d.ts.map +1 -0
- package/dist/generators/templates/procedure.js +274 -0
- package/dist/generators/templates/procedure.js.map +1 -0
- package/dist/generators/templates/resource.d.ts +34 -0
- package/dist/generators/templates/resource.d.ts.map +1 -0
- package/dist/generators/templates/resource.js +550 -0
- package/dist/generators/templates/resource.js.map +1 -0
- package/dist/generators/templates/schema.d.ts +33 -0
- package/dist/generators/templates/schema.d.ts.map +1 -0
- package/dist/generators/templates/schema.js +248 -0
- package/dist/generators/templates/schema.js.map +1 -0
- package/dist/generators/templates/test.d.ts +31 -0
- package/dist/generators/templates/test.d.ts.map +1 -0
- package/dist/generators/templates/test.js +882 -0
- package/dist/generators/templates/test.js.map +1 -0
- package/dist/generators/types.d.ts +211 -0
- package/dist/generators/types.d.ts.map +1 -0
- package/dist/generators/types.js +54 -0
- package/dist/generators/types.js.map +1 -0
- package/dist/generators/utils/filesystem.d.ts +68 -0
- package/dist/generators/utils/filesystem.d.ts.map +1 -0
- package/dist/generators/utils/filesystem.js +217 -0
- package/dist/generators/utils/filesystem.js.map +1 -0
- package/dist/generators/utils/naming.d.ts +122 -0
- package/dist/generators/utils/naming.d.ts.map +1 -0
- package/dist/generators/utils/naming.js +198 -0
- package/dist/generators/utils/naming.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/migrations/commands/fresh.d.ts +11 -0
- package/dist/migrations/commands/fresh.d.ts.map +1 -0
- package/dist/migrations/commands/fresh.js +164 -0
- package/dist/migrations/commands/fresh.js.map +1 -0
- package/dist/migrations/commands/index.d.ts +11 -0
- package/dist/migrations/commands/index.d.ts.map +1 -0
- package/dist/migrations/commands/index.js +11 -0
- package/dist/migrations/commands/index.js.map +1 -0
- package/dist/migrations/commands/reset.d.ts +11 -0
- package/dist/migrations/commands/reset.d.ts.map +1 -0
- package/dist/migrations/commands/reset.js +258 -0
- package/dist/migrations/commands/reset.js.map +1 -0
- package/dist/migrations/commands/rollback.d.ts +11 -0
- package/dist/migrations/commands/rollback.d.ts.map +1 -0
- package/dist/migrations/commands/rollback.js +241 -0
- package/dist/migrations/commands/rollback.js.map +1 -0
- package/dist/migrations/commands/run.d.ts +11 -0
- package/dist/migrations/commands/run.d.ts.map +1 -0
- package/dist/migrations/commands/run.js +183 -0
- package/dist/migrations/commands/run.js.map +1 -0
- package/dist/migrations/commands/status.d.ts +11 -0
- package/dist/migrations/commands/status.d.ts.map +1 -0
- package/dist/migrations/commands/status.js +154 -0
- package/dist/migrations/commands/status.js.map +1 -0
- package/dist/migrations/errors.d.ts +74 -0
- package/dist/migrations/errors.d.ts.map +1 -0
- package/dist/migrations/errors.js +155 -0
- package/dist/migrations/errors.js.map +1 -0
- package/dist/migrations/index.d.ts +13 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +17 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/migrations/loader.d.ts +44 -0
- package/dist/migrations/loader.d.ts.map +1 -0
- package/dist/migrations/loader.js +181 -0
- package/dist/migrations/loader.js.map +1 -0
- package/dist/migrations/prisma-wrapper.d.ts +60 -0
- package/dist/migrations/prisma-wrapper.d.ts.map +1 -0
- package/dist/migrations/prisma-wrapper.js +184 -0
- package/dist/migrations/prisma-wrapper.js.map +1 -0
- package/dist/migrations/rollback-runner.d.ts +40 -0
- package/dist/migrations/rollback-runner.d.ts.map +1 -0
- package/dist/migrations/rollback-runner.js +191 -0
- package/dist/migrations/rollback-runner.js.map +1 -0
- package/dist/migrations/types.d.ts +214 -0
- package/dist/migrations/types.d.ts.map +1 -0
- package/dist/migrations/types.js +19 -0
- package/dist/migrations/types.js.map +1 -0
- package/package.json +29 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.js","sourceRoot":"","sources":["../../../src/generators/templates/test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E;;GAEG;AACH,SAAS,yBAAyB,CAAC,MAIlC;IACC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC;IAExC,OAAO;KACJ,MAAM;;eAEI,MAAM;;;;cAIP,KAAK,oCAAoC,KAAK;;YAEhD,MAAM;;;;QAIV,KAAK;;;;;;;;;;;;;;iBAcI,MAAM;0BACG,KAAK;kBACb,MAAM;;;;;;;mBAOL,KAAK,qCAAqC,MAAM;;;gCAGnC,KAAK,iBAAiB,MAAM;;;;;sCAKtB,MAAM;6BACf,KAAK;;;;;8CAKY,KAAK;mBAChC,KAAK;;;;;;kBAMN,MAAM;kCACU,KAAK;kBACrB,MAAM;;;;;mBAKL,KAAK,mCAAmC,MAAM;;;;;;oBAM7C,MAAM;8BACI,KAAK;;;;;qBAKd,MAAM;;;;;;;mBAOR,KAAK,oCAAoC,MAAM;;;;;;;;;;oBAU9C,MAAM;oCACU,KAAK;sBACnB,MAAM;;;;;;mBAMT,KAAK,yCAAyC,MAAM;mBACpD,KAAK;qBACH,MAAM;;;;;;;;oBAQP,MAAM;0BACA,KAAK;mBACZ,KAAK;;;;;;C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CAAC,KAAK,IAAI,MAAM,KAAK,CAAC;QAC9D,KAAK,OAAO;YACV,OAAO,wBAAwB,MAAM,CAAC,KAAK,IAAI,MAAM,KAAK,CAAC;QAC7D,KAAK,SAAS;YACZ,OAAO,0BAA0B,MAAM,CAAC,KAAK,IAAI,MAAM,KAAK,CAAC;QAC/D;YACE,OAAO,iBAAiB,MAAM,CAAC,KAAK,IAAI,MAAM,KAAK,CAAC;IACxD,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAiC;IACjE,MAAM,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;IAElC,OAAO;QACL;YACE,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,OAAO,CAAC;YAC1C,OAAO;SACR;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAkB,EAAE,OAAoB;IAC1E,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IAEzB,MAAM,UAAU,GACd,IAAI,KAAK,KAAK;QACZ,CAAC,CAAC,eAAe;QACjB,CAAC,CAAC,IAAI,KAAK,aAAa;YACtB,CAAC,CAAC,uBAAuB;YACzB,CAAC,CAAC,WAAW,CAAC;IAEpB,OAAO;;;;;OAKF,UAAU;;;qBAGI,WAAW,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,WAAW,EAAE,EAAE,EAAE,OAAO,CAAC;;;;;;;;;CAS7E,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generator Types
|
|
3
|
+
*
|
|
4
|
+
* Core type definitions for the VeloxTS code generator system.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* All naming variations for an entity.
|
|
8
|
+
* Derived from a single input name (e.g., "User", "BlogPost").
|
|
9
|
+
*/
|
|
10
|
+
export interface EntityNames {
|
|
11
|
+
/** Original input: "User" or "user" */
|
|
12
|
+
readonly raw: string;
|
|
13
|
+
/** PascalCase: "User", "BlogPost" */
|
|
14
|
+
readonly pascal: string;
|
|
15
|
+
/** camelCase: "user", "blogPost" */
|
|
16
|
+
readonly camel: string;
|
|
17
|
+
/** kebab-case: "user", "blog-post" */
|
|
18
|
+
readonly kebab: string;
|
|
19
|
+
/** snake_case: "user", "blog_post" */
|
|
20
|
+
readonly snake: string;
|
|
21
|
+
/** SCREAMING_SNAKE_CASE: "USER", "BLOG_POST" */
|
|
22
|
+
readonly screamingSnake: string;
|
|
23
|
+
/** Singular camelCase: "user", "blogPost" */
|
|
24
|
+
readonly singular: string;
|
|
25
|
+
/** Plural camelCase: "users", "blogPosts" */
|
|
26
|
+
readonly plural: string;
|
|
27
|
+
/** PascalCase plural: "Users", "BlogPosts" */
|
|
28
|
+
readonly pascalPlural: string;
|
|
29
|
+
/** Human readable: "User", "Blog Post" */
|
|
30
|
+
readonly humanReadable: string;
|
|
31
|
+
/** Human readable plural: "Users", "Blog Posts" */
|
|
32
|
+
readonly humanReadablePlural: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Project-level context for template generation
|
|
36
|
+
*/
|
|
37
|
+
export interface ProjectContext {
|
|
38
|
+
/** Project name from package.json */
|
|
39
|
+
readonly name: string;
|
|
40
|
+
/** Whether @veloxts/auth is installed */
|
|
41
|
+
readonly hasAuth: boolean;
|
|
42
|
+
/** Database type from configuration */
|
|
43
|
+
readonly database: 'sqlite' | 'postgresql' | 'mysql';
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Context available to all templates
|
|
47
|
+
*/
|
|
48
|
+
export interface TemplateContext<TOptions = Record<string, unknown>> {
|
|
49
|
+
/** Entity naming variations */
|
|
50
|
+
readonly entity: EntityNames;
|
|
51
|
+
/** Project-level context */
|
|
52
|
+
readonly project: ProjectContext;
|
|
53
|
+
/** Generator-specific options */
|
|
54
|
+
readonly options: TOptions;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A template function that generates file content
|
|
58
|
+
*/
|
|
59
|
+
export type TemplateFunction<TOptions = Record<string, unknown>> = (context: TemplateContext<TOptions>) => string;
|
|
60
|
+
/**
|
|
61
|
+
* A single file to be generated
|
|
62
|
+
*/
|
|
63
|
+
export interface GeneratedFile {
|
|
64
|
+
/** Relative path from project root (e.g., "src/procedures/users.ts") */
|
|
65
|
+
readonly path: string;
|
|
66
|
+
/** File content */
|
|
67
|
+
readonly content: string;
|
|
68
|
+
/** Whether to skip if file exists (default: false, will prompt) */
|
|
69
|
+
readonly skipIfExists?: boolean;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Output from a generator - one or more files to create
|
|
73
|
+
*/
|
|
74
|
+
export interface GeneratorOutput {
|
|
75
|
+
/** Files to generate */
|
|
76
|
+
readonly files: ReadonlyArray<GeneratedFile>;
|
|
77
|
+
/** Instructions to show after generation */
|
|
78
|
+
readonly postInstructions?: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Generator category for grouping in help
|
|
82
|
+
*/
|
|
83
|
+
export type GeneratorCategory = 'resource' | 'database' | 'test' | 'composite';
|
|
84
|
+
/**
|
|
85
|
+
* Generator metadata for CLI registration
|
|
86
|
+
*/
|
|
87
|
+
export interface GeneratorMetadata {
|
|
88
|
+
/** Generator name (used in CLI: velox generate <name>) */
|
|
89
|
+
readonly name: string;
|
|
90
|
+
/** Short description for help text */
|
|
91
|
+
readonly description: string;
|
|
92
|
+
/** Longer description with examples */
|
|
93
|
+
readonly longDescription?: string;
|
|
94
|
+
/** Aliases (e.g., 'p' for 'procedure') */
|
|
95
|
+
readonly aliases?: ReadonlyArray<string>;
|
|
96
|
+
/** Category for grouping in help */
|
|
97
|
+
readonly category: GeneratorCategory;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Option type for generator options
|
|
101
|
+
*/
|
|
102
|
+
export type GeneratorOptionType = 'boolean' | 'string' | 'number' | 'array';
|
|
103
|
+
/**
|
|
104
|
+
* Generator option definition
|
|
105
|
+
*/
|
|
106
|
+
export interface GeneratorOption<T = unknown> {
|
|
107
|
+
/** Option name (used as --name in CLI) */
|
|
108
|
+
readonly name: string;
|
|
109
|
+
/** Short flag (e.g., 'c' for --crud) */
|
|
110
|
+
readonly short?: string;
|
|
111
|
+
/** Commander.js style flag (e.g., '-c, --crud' or '--skip-model') */
|
|
112
|
+
readonly flag?: string;
|
|
113
|
+
/** Description for help text */
|
|
114
|
+
readonly description: string;
|
|
115
|
+
/** Default value */
|
|
116
|
+
readonly default?: T;
|
|
117
|
+
/** Whether this option is required */
|
|
118
|
+
readonly required?: boolean;
|
|
119
|
+
/** Type of the option */
|
|
120
|
+
readonly type: GeneratorOptionType;
|
|
121
|
+
/** Choices for string options */
|
|
122
|
+
readonly choices?: ReadonlyArray<string>;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Strategy for handling file conflicts
|
|
126
|
+
*/
|
|
127
|
+
export type ConflictStrategy = 'prompt' | 'skip' | 'overwrite' | 'error';
|
|
128
|
+
/**
|
|
129
|
+
* Configuration passed from CLI to generator
|
|
130
|
+
*/
|
|
131
|
+
export interface GeneratorConfig<TOptions = Record<string, unknown>> {
|
|
132
|
+
/** Entity name from positional argument */
|
|
133
|
+
readonly entityName: string;
|
|
134
|
+
/** Parsed and validated CLI options */
|
|
135
|
+
readonly options: TOptions;
|
|
136
|
+
/** Conflict handling strategy */
|
|
137
|
+
readonly conflictStrategy: ConflictStrategy;
|
|
138
|
+
/** Dry run mode - don't write files */
|
|
139
|
+
readonly dryRun: boolean;
|
|
140
|
+
/** Force overwrite without prompting */
|
|
141
|
+
readonly force: boolean;
|
|
142
|
+
/** Working directory (project root) */
|
|
143
|
+
readonly cwd: string;
|
|
144
|
+
/** Project context (detected from package.json) */
|
|
145
|
+
readonly project: ProjectContext;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Generator interface - all generators implement this
|
|
149
|
+
*/
|
|
150
|
+
export interface Generator<TOptions = Record<string, unknown>> {
|
|
151
|
+
/** Generator metadata */
|
|
152
|
+
readonly metadata: GeneratorMetadata;
|
|
153
|
+
/** Option definitions */
|
|
154
|
+
readonly options: ReadonlyArray<GeneratorOption>;
|
|
155
|
+
/**
|
|
156
|
+
* Validate the entity name
|
|
157
|
+
* @returns Error message if invalid, undefined if valid
|
|
158
|
+
*/
|
|
159
|
+
validateEntityName(name: string): string | undefined;
|
|
160
|
+
/**
|
|
161
|
+
* Validate and transform raw options to typed options
|
|
162
|
+
* @throws Error if options are invalid
|
|
163
|
+
*/
|
|
164
|
+
validateOptions(raw: Record<string, unknown>): TOptions;
|
|
165
|
+
/**
|
|
166
|
+
* Generate files based on configuration
|
|
167
|
+
*/
|
|
168
|
+
generate(config: GeneratorConfig<TOptions>): Promise<GeneratorOutput>;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Type-erased generator alias for registry storage.
|
|
172
|
+
* Used when storing heterogeneous generators with different option types.
|
|
173
|
+
*
|
|
174
|
+
* The `any` type is intentionally used here because:
|
|
175
|
+
* 1. Generator<T> is invariant in T due to both covariant (validateOptions return)
|
|
176
|
+
* and contravariant (generate config parameter) positions
|
|
177
|
+
* 2. We need to store generators with different TOptions in a single collection
|
|
178
|
+
* 3. Type safety is maintained at the call site through validateOptions()
|
|
179
|
+
*
|
|
180
|
+
* This is a legitimate use of type erasure where the type information is
|
|
181
|
+
* recovered through runtime validation before use.
|
|
182
|
+
*/
|
|
183
|
+
export type AnyGenerator = Generator<any>;
|
|
184
|
+
/**
|
|
185
|
+
* Error codes for generator errors (for AI/tooling integration)
|
|
186
|
+
*/
|
|
187
|
+
export declare enum GeneratorErrorCode {
|
|
188
|
+
NOT_IN_PROJECT = "E2001",
|
|
189
|
+
INVALID_ENTITY_NAME = "E2002",
|
|
190
|
+
FILE_ALREADY_EXISTS = "E2003",
|
|
191
|
+
INVALID_OPTION = "E2004",
|
|
192
|
+
GENERATION_FAILED = "E2005",
|
|
193
|
+
CANCELED = "E2006"
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Structured generator error with code and optional fix suggestion
|
|
197
|
+
*/
|
|
198
|
+
export declare class GeneratorError extends Error {
|
|
199
|
+
readonly code: GeneratorErrorCode;
|
|
200
|
+
readonly fix?: string | undefined;
|
|
201
|
+
constructor(code: GeneratorErrorCode, message: string, fix?: string | undefined);
|
|
202
|
+
/**
|
|
203
|
+
* Format error for display
|
|
204
|
+
*/
|
|
205
|
+
format(): string;
|
|
206
|
+
/**
|
|
207
|
+
* Convert to JSON for --json output
|
|
208
|
+
*/
|
|
209
|
+
toJSON(): Record<string, unknown>;
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/generators/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,uCAAuC;IACvC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,qCAAqC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,oCAAoC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,sCAAsC;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,sCAAsC;IACtC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAEvB,gDAAgD;IAChD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAEhC,6CAA6C;IAC7C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,6CAA6C;IAC7C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,8CAA8C;IAC9C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAE9B,0CAA0C;IAC1C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAE/B,mDAAmD;IACn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,cAAe,SAAQ,KAAK;aAErB,IAAI,EAAE,kBAAkB;aAExB,GAAG,CAAC,EAAE,MAAM;gBAFZ,IAAI,EAAE,kBAAkB,EACxC,OAAO,EAAE,MAAM,EACC,GAAG,CAAC,EAAE,MAAM,YAAA;IAM9B;;OAEG;IACH,MAAM,IAAI,MAAM;IAQhB;;OAEG;IACH,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAOlC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generator Types
|
|
3
|
+
*
|
|
4
|
+
* Core type definitions for the VeloxTS code generator system.
|
|
5
|
+
*/
|
|
6
|
+
// ============================================================================
|
|
7
|
+
// Error Handling
|
|
8
|
+
// ============================================================================
|
|
9
|
+
/**
|
|
10
|
+
* Error codes for generator errors (for AI/tooling integration)
|
|
11
|
+
*/
|
|
12
|
+
export var GeneratorErrorCode;
|
|
13
|
+
(function (GeneratorErrorCode) {
|
|
14
|
+
GeneratorErrorCode["NOT_IN_PROJECT"] = "E2001";
|
|
15
|
+
GeneratorErrorCode["INVALID_ENTITY_NAME"] = "E2002";
|
|
16
|
+
GeneratorErrorCode["FILE_ALREADY_EXISTS"] = "E2003";
|
|
17
|
+
GeneratorErrorCode["INVALID_OPTION"] = "E2004";
|
|
18
|
+
GeneratorErrorCode["GENERATION_FAILED"] = "E2005";
|
|
19
|
+
GeneratorErrorCode["CANCELED"] = "E2006";
|
|
20
|
+
})(GeneratorErrorCode || (GeneratorErrorCode = {}));
|
|
21
|
+
/**
|
|
22
|
+
* Structured generator error with code and optional fix suggestion
|
|
23
|
+
*/
|
|
24
|
+
export class GeneratorError extends Error {
|
|
25
|
+
code;
|
|
26
|
+
fix;
|
|
27
|
+
constructor(code, message, fix) {
|
|
28
|
+
super(message);
|
|
29
|
+
this.code = code;
|
|
30
|
+
this.fix = fix;
|
|
31
|
+
this.name = 'GeneratorError';
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Format error for display
|
|
35
|
+
*/
|
|
36
|
+
format() {
|
|
37
|
+
let output = `GeneratorError[${this.code}]: ${this.message}`;
|
|
38
|
+
if (this.fix) {
|
|
39
|
+
output += `\n\n Fix: ${this.fix}`;
|
|
40
|
+
}
|
|
41
|
+
return output;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Convert to JSON for --json output
|
|
45
|
+
*/
|
|
46
|
+
toJSON() {
|
|
47
|
+
return {
|
|
48
|
+
code: this.code,
|
|
49
|
+
message: this.message,
|
|
50
|
+
fix: this.fix,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/generators/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAuQH,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,CAAN,IAAY,kBAOX;AAPD,WAAY,kBAAkB;IAC5B,8CAAwB,CAAA;IACxB,mDAA6B,CAAA;IAC7B,mDAA6B,CAAA;IAC7B,8CAAwB,CAAA;IACxB,iDAA2B,CAAA;IAC3B,wCAAkB,CAAA;AACpB,CAAC,EAPW,kBAAkB,KAAlB,kBAAkB,QAO7B;AAED;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IAErB;IAEA;IAHlB,YACkB,IAAwB,EACxC,OAAe,EACC,GAAY;QAE5B,KAAK,CAAC,OAAO,CAAC,CAAC;QAJC,SAAI,GAAJ,IAAI,CAAoB;QAExB,QAAG,GAAH,GAAG,CAAS;QAG5B,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,IAAI,MAAM,GAAG,kBAAkB,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;QAC7D,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;YACb,MAAM,IAAI,cAAc,IAAI,CAAC,GAAG,EAAE,CAAC;QACrC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,MAAM;QACJ,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filesystem Utilities for Code Generation
|
|
3
|
+
*
|
|
4
|
+
* Safe file operations with conflict detection, directory creation,
|
|
5
|
+
* and interactive prompting support.
|
|
6
|
+
*/
|
|
7
|
+
import type { ConflictStrategy, GeneratedFile } from '../types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Result of writing a file
|
|
10
|
+
*/
|
|
11
|
+
export interface WriteResult {
|
|
12
|
+
/** Path that was written (or would be written) */
|
|
13
|
+
readonly path: string;
|
|
14
|
+
/** Whether the file was actually written */
|
|
15
|
+
readonly written: boolean;
|
|
16
|
+
/** Whether file already existed */
|
|
17
|
+
readonly existed: boolean;
|
|
18
|
+
/** Action taken: created, overwritten, skipped */
|
|
19
|
+
readonly action: 'created' | 'overwritten' | 'skipped';
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Options for file writing operations
|
|
23
|
+
*/
|
|
24
|
+
export interface WriteOptions {
|
|
25
|
+
/** Conflict handling strategy */
|
|
26
|
+
conflictStrategy: ConflictStrategy;
|
|
27
|
+
/** Dry run mode - don't actually write */
|
|
28
|
+
dryRun: boolean;
|
|
29
|
+
/** Force overwrite without prompting */
|
|
30
|
+
force: boolean;
|
|
31
|
+
/** Base directory for relative paths */
|
|
32
|
+
cwd: string;
|
|
33
|
+
/** Silent mode - suppress output */
|
|
34
|
+
silent?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Write a single file with conflict handling
|
|
38
|
+
*/
|
|
39
|
+
export declare function writeFile(file: GeneratedFile, options: WriteOptions): Promise<WriteResult>;
|
|
40
|
+
/**
|
|
41
|
+
* Write multiple files with conflict handling
|
|
42
|
+
*/
|
|
43
|
+
export declare function writeFiles(files: ReadonlyArray<GeneratedFile>, options: WriteOptions): Promise<ReadonlyArray<WriteResult>>;
|
|
44
|
+
/**
|
|
45
|
+
* Safely read a file, returning undefined if it doesn't exist
|
|
46
|
+
*/
|
|
47
|
+
export declare function readFileSafe(path: string): string | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Check if a file exists
|
|
50
|
+
*/
|
|
51
|
+
export declare function fileExists(path: string): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Ensure a directory exists, creating it if necessary
|
|
54
|
+
*/
|
|
55
|
+
export declare function ensureDir(path: string): void;
|
|
56
|
+
/**
|
|
57
|
+
* Check if a directory exists
|
|
58
|
+
*/
|
|
59
|
+
export declare function dirExists(path: string): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Format write results for display
|
|
62
|
+
*/
|
|
63
|
+
export declare function formatWriteResults(results: ReadonlyArray<WriteResult>, dryRun: boolean): string;
|
|
64
|
+
/**
|
|
65
|
+
* Format write results as JSON for machine consumption
|
|
66
|
+
*/
|
|
67
|
+
export declare function formatWriteResultsJson(results: ReadonlyArray<WriteResult>): string;
|
|
68
|
+
//# sourceMappingURL=filesystem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../../../src/generators/utils/filesystem.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAOnE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,kDAAkD;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,mCAA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,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filesystem Utilities for Code Generation
|
|
3
|
+
*
|
|
4
|
+
* Safe file operations with conflict detection, directory creation,
|
|
5
|
+
* and interactive prompting support.
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
8
|
+
import { dirname, relative } from 'node:path';
|
|
9
|
+
import * as p from '@clack/prompts';
|
|
10
|
+
import pc from 'picocolors';
|
|
11
|
+
import { GeneratorError, GeneratorErrorCode } from '../types.js';
|
|
12
|
+
/**
|
|
13
|
+
* Write a single file with conflict handling
|
|
14
|
+
*/
|
|
15
|
+
export async function writeFile(file, options) {
|
|
16
|
+
const { conflictStrategy, dryRun, force, cwd } = options;
|
|
17
|
+
const fullPath = file.path.startsWith('/') ? file.path : `${cwd}/${file.path}`;
|
|
18
|
+
const relativePath = relative(cwd, fullPath);
|
|
19
|
+
const existed = existsSync(fullPath);
|
|
20
|
+
// Handle dry run
|
|
21
|
+
if (dryRun) {
|
|
22
|
+
return {
|
|
23
|
+
path: relativePath,
|
|
24
|
+
written: false,
|
|
25
|
+
existed,
|
|
26
|
+
action: existed ? 'overwritten' : 'created',
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
// Handle file conflicts
|
|
30
|
+
if (existed && !force) {
|
|
31
|
+
// Skip if file has skipIfExists flag
|
|
32
|
+
if (file.skipIfExists) {
|
|
33
|
+
return {
|
|
34
|
+
path: relativePath,
|
|
35
|
+
written: false,
|
|
36
|
+
existed: true,
|
|
37
|
+
action: 'skipped',
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const action = await resolveConflict(relativePath, conflictStrategy);
|
|
41
|
+
if (action === 'skip') {
|
|
42
|
+
return {
|
|
43
|
+
path: relativePath,
|
|
44
|
+
written: false,
|
|
45
|
+
existed: true,
|
|
46
|
+
action: 'skipped',
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (action === 'error') {
|
|
50
|
+
throw new GeneratorError(GeneratorErrorCode.FILE_ALREADY_EXISTS, `File already exists: ${relativePath}`, `Use --force to overwrite existing files, or rename your entity.`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
// Ensure directory exists
|
|
54
|
+
const dir = dirname(fullPath);
|
|
55
|
+
if (!existsSync(dir)) {
|
|
56
|
+
mkdirSync(dir, { recursive: true });
|
|
57
|
+
}
|
|
58
|
+
// Write the file
|
|
59
|
+
writeFileSync(fullPath, file.content, 'utf-8');
|
|
60
|
+
return {
|
|
61
|
+
path: relativePath,
|
|
62
|
+
written: true,
|
|
63
|
+
existed,
|
|
64
|
+
action: existed ? 'overwritten' : 'created',
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Write multiple files with conflict handling
|
|
69
|
+
*/
|
|
70
|
+
export async function writeFiles(files, options) {
|
|
71
|
+
const results = [];
|
|
72
|
+
for (const file of files) {
|
|
73
|
+
const result = await writeFile(file, options);
|
|
74
|
+
results.push(result);
|
|
75
|
+
}
|
|
76
|
+
return results;
|
|
77
|
+
}
|
|
78
|
+
// ============================================================================
|
|
79
|
+
// Conflict Resolution
|
|
80
|
+
// ============================================================================
|
|
81
|
+
/**
|
|
82
|
+
* Resolve a file conflict based on strategy
|
|
83
|
+
*/
|
|
84
|
+
async function resolveConflict(path, strategy) {
|
|
85
|
+
switch (strategy) {
|
|
86
|
+
case 'overwrite':
|
|
87
|
+
return 'overwrite';
|
|
88
|
+
case 'skip':
|
|
89
|
+
return 'skip';
|
|
90
|
+
case 'error':
|
|
91
|
+
return 'error';
|
|
92
|
+
// case 'prompt':
|
|
93
|
+
default:
|
|
94
|
+
return promptConflictResolution(path);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Interactively prompt user to resolve a conflict
|
|
99
|
+
*/
|
|
100
|
+
async function promptConflictResolution(path) {
|
|
101
|
+
const result = await p.select({
|
|
102
|
+
message: `File ${pc.yellow(path)} already exists. What would you like to do?`,
|
|
103
|
+
options: [
|
|
104
|
+
{ value: 'overwrite', label: 'Overwrite', hint: 'Replace existing file' },
|
|
105
|
+
{ value: 'skip', label: 'Skip', hint: 'Keep existing file' },
|
|
106
|
+
{ value: 'error', label: 'Cancel', hint: 'Abort generation' },
|
|
107
|
+
],
|
|
108
|
+
});
|
|
109
|
+
if (p.isCancel(result)) {
|
|
110
|
+
throw new GeneratorError(GeneratorErrorCode.CANCELED, 'Operation canceled by user');
|
|
111
|
+
}
|
|
112
|
+
return result;
|
|
113
|
+
}
|
|
114
|
+
// ============================================================================
|
|
115
|
+
// File Reading
|
|
116
|
+
// ============================================================================
|
|
117
|
+
/**
|
|
118
|
+
* Safely read a file, returning undefined if it doesn't exist
|
|
119
|
+
*/
|
|
120
|
+
export function readFileSafe(path) {
|
|
121
|
+
if (!existsSync(path)) {
|
|
122
|
+
return undefined;
|
|
123
|
+
}
|
|
124
|
+
return readFileSync(path, 'utf-8');
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Check if a file exists
|
|
128
|
+
*/
|
|
129
|
+
export function fileExists(path) {
|
|
130
|
+
return existsSync(path);
|
|
131
|
+
}
|
|
132
|
+
// ============================================================================
|
|
133
|
+
// Directory Operations
|
|
134
|
+
// ============================================================================
|
|
135
|
+
/**
|
|
136
|
+
* Ensure a directory exists, creating it if necessary
|
|
137
|
+
*/
|
|
138
|
+
export function ensureDir(path) {
|
|
139
|
+
if (!existsSync(path)) {
|
|
140
|
+
mkdirSync(path, { recursive: true });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Check if a directory exists
|
|
145
|
+
*/
|
|
146
|
+
export function dirExists(path) {
|
|
147
|
+
return existsSync(path);
|
|
148
|
+
}
|
|
149
|
+
// ============================================================================
|
|
150
|
+
// Output Formatting
|
|
151
|
+
// ============================================================================
|
|
152
|
+
/**
|
|
153
|
+
* Format write results for display
|
|
154
|
+
*/
|
|
155
|
+
export function formatWriteResults(results, dryRun) {
|
|
156
|
+
const lines = [];
|
|
157
|
+
for (const result of results) {
|
|
158
|
+
const prefix = dryRun ? '[dry-run] ' : '';
|
|
159
|
+
const icon = getActionIcon(result.action);
|
|
160
|
+
const actionText = getActionText(result.action, dryRun);
|
|
161
|
+
lines.push(`${prefix}${icon} ${actionText} ${pc.cyan(result.path)}`);
|
|
162
|
+
}
|
|
163
|
+
return lines.join('\n');
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Get icon for action type
|
|
167
|
+
*/
|
|
168
|
+
function getActionIcon(action) {
|
|
169
|
+
switch (action) {
|
|
170
|
+
case 'created':
|
|
171
|
+
return pc.green('✓');
|
|
172
|
+
case 'overwritten':
|
|
173
|
+
return pc.yellow('↻');
|
|
174
|
+
case 'skipped':
|
|
175
|
+
return pc.dim('○');
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Get text for action type
|
|
180
|
+
*/
|
|
181
|
+
function getActionText(action, dryRun) {
|
|
182
|
+
if (dryRun) {
|
|
183
|
+
switch (action) {
|
|
184
|
+
case 'created':
|
|
185
|
+
return 'Would create';
|
|
186
|
+
case 'overwritten':
|
|
187
|
+
return 'Would overwrite';
|
|
188
|
+
case 'skipped':
|
|
189
|
+
return 'Would skip';
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
switch (action) {
|
|
193
|
+
case 'created':
|
|
194
|
+
return 'Created';
|
|
195
|
+
case 'overwritten':
|
|
196
|
+
return 'Overwrote';
|
|
197
|
+
case 'skipped':
|
|
198
|
+
return 'Skipped';
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
// ============================================================================
|
|
202
|
+
// JSON Output
|
|
203
|
+
// ============================================================================
|
|
204
|
+
/**
|
|
205
|
+
* Format write results as JSON for machine consumption
|
|
206
|
+
*/
|
|
207
|
+
export function formatWriteResultsJson(results) {
|
|
208
|
+
return JSON.stringify({
|
|
209
|
+
success: true,
|
|
210
|
+
files: results.map((r) => ({
|
|
211
|
+
path: r.path,
|
|
212
|
+
action: r.action,
|
|
213
|
+
written: r.written,
|
|
214
|
+
})),
|
|
215
|
+
}, null, 2);
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=filesystem.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filesystem.js","sourceRoot":"","sources":["../../../src/generators/utils/filesystem.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAoCjE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAmB,EAAE,OAAqB;IACxE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;IACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;IAC/E,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;IAErC,iBAAiB;IACjB,IAAI,MAAM,EAAE,CAAC;QACX,OAAO;YACL,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,KAAK;YACd,OAAO;YACP,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS;S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