@veloxts/cli 0.4.12 → 0.4.13
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 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/dev.d.ts +4 -1
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +29 -15
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/make.d.ts +17 -0
- package/dist/commands/make.d.ts.map +1 -0
- package/dist/commands/make.js +219 -0
- package/dist/commands/make.js.map +1 -0
- package/dist/dev/error-parser.d.ts +67 -0
- package/dist/dev/error-parser.d.ts.map +1 -0
- package/dist/dev/error-parser.js +384 -0
- package/dist/dev/error-parser.js.map +1 -0
- package/dist/dev/hmr-runner.d.ts +67 -9
- package/dist/dev/hmr-runner.d.ts.map +1 -1
- package/dist/dev/hmr-runner.js +305 -57
- package/dist/dev/hmr-runner.js.map +1 -1
- package/dist/dev/index.d.ts +6 -0
- package/dist/dev/index.d.ts.map +1 -1
- package/dist/dev/index.js +8 -0
- package/dist/dev/index.js.map +1 -1
- package/dist/dev/reload-reporter.d.ts +197 -0
- package/dist/dev/reload-reporter.d.ts.map +1 -0
- package/dist/dev/reload-reporter.js +370 -0
- package/dist/dev/reload-reporter.js.map +1 -0
- package/dist/dev/timing-tracker.d.ts +130 -0
- package/dist/dev/timing-tracker.d.ts.map +1 -0
- package/dist/dev/timing-tracker.js +175 -0
- package/dist/dev/timing-tracker.js.map +1 -0
- package/dist/generators/generators/factory.d.ts +5 -5
- package/dist/generators/generators/factory.js +8 -8
- package/dist/generators/generators/migration.d.ts +7 -7
- package/dist/generators/generators/migration.js +12 -12
- package/dist/generators/generators/model.d.ts +7 -7
- package/dist/generators/generators/model.js +12 -12
- package/dist/generators/generators/procedure.d.ts +6 -6
- package/dist/generators/generators/procedure.js +12 -12
- package/dist/generators/generators/seeder.d.ts +5 -5
- package/dist/generators/generators/seeder.js +9 -9
- package/dist/generators/generators/seeder.js.map +1 -1
- package/dist/generators/types.d.ts +1 -1
- package/dist/generators/types.d.ts.map +1 -1
- package/dist/migrations/commands/run.js +1 -1
- package/dist/migrations/commands/run.js.map +1 -1
- package/dist/migrations/commands/status.js +1 -1
- package/dist/migrations/commands/status.js.map +1 -1
- package/dist/migrations/errors.js +1 -1
- package/dist/migrations/errors.js.map +1 -1
- package/dist/seeding/commands/seed.js +2 -2
- package/dist/seeding/commands/seed.js.map +1 -1
- package/dist/seeding/errors.js +1 -1
- package/dist/seeding/errors.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Timing Tracker - Measures reload and startup timing
|
|
3
|
+
*
|
|
4
|
+
* Provides high-resolution timing for development reload events.
|
|
5
|
+
* Uses process.hrtime.bigint() for nanosecond precision, then converts
|
|
6
|
+
* to milliseconds for human-readable output.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const tracker = createTimingTracker();
|
|
11
|
+
*
|
|
12
|
+
* tracker.start('startup');
|
|
13
|
+
* await bootApplication();
|
|
14
|
+
* const duration = tracker.end('startup');
|
|
15
|
+
* console.log(`Started in ${duration}ms`);
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Represents a timing measurement with start and optional end time
|
|
20
|
+
*/
|
|
21
|
+
export interface TimingMeasurement {
|
|
22
|
+
/** Start time in nanoseconds (from process.hrtime.bigint) */
|
|
23
|
+
readonly startTime: bigint;
|
|
24
|
+
/** End time in nanoseconds (set when measurement completes) */
|
|
25
|
+
readonly endTime?: bigint;
|
|
26
|
+
/** Calculated duration in milliseconds */
|
|
27
|
+
readonly durationMs?: number;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Well-known timing labels used throughout the HMR system
|
|
31
|
+
*/
|
|
32
|
+
export type TimingLabel = 'startup' | 'restart' | 'hot-update' | 'shutdown' | 'file-change' | string;
|
|
33
|
+
/**
|
|
34
|
+
* Tracks timing for reload operations with high precision.
|
|
35
|
+
*
|
|
36
|
+
* Design decisions:
|
|
37
|
+
* - Uses bigint for nanosecond precision (avoids floating point issues)
|
|
38
|
+
* - Converts to milliseconds only at output (human-readable)
|
|
39
|
+
* - Stores measurements for later retrieval (debugging, verbose mode)
|
|
40
|
+
* - Thread-safe for single-threaded Node.js (no race conditions)
|
|
41
|
+
*/
|
|
42
|
+
export declare class TimingTracker {
|
|
43
|
+
private readonly measurements;
|
|
44
|
+
/**
|
|
45
|
+
* Start timing an operation.
|
|
46
|
+
*
|
|
47
|
+
* If a measurement with the same label already exists, it will be overwritten.
|
|
48
|
+
* This is intentional - allows restarting a timer without explicit clear.
|
|
49
|
+
*
|
|
50
|
+
* @param label - Identifier for this timing operation
|
|
51
|
+
*/
|
|
52
|
+
start(label: TimingLabel): void;
|
|
53
|
+
/**
|
|
54
|
+
* End timing an operation and return duration in milliseconds.
|
|
55
|
+
*
|
|
56
|
+
* @param label - Identifier for the timing operation to end
|
|
57
|
+
* @returns Duration in milliseconds (rounded to nearest integer), or 0 if not started
|
|
58
|
+
*/
|
|
59
|
+
end(label: TimingLabel): number;
|
|
60
|
+
/**
|
|
61
|
+
* Get the duration of a completed measurement without ending it.
|
|
62
|
+
*
|
|
63
|
+
* Useful for checking timing of operations that are still in progress
|
|
64
|
+
* or retrieving past measurements.
|
|
65
|
+
*
|
|
66
|
+
* @param label - Identifier for the timing operation
|
|
67
|
+
* @returns Duration in milliseconds if completed, elapsed time if in progress, null if not found
|
|
68
|
+
*/
|
|
69
|
+
getDuration(label: TimingLabel): number | null;
|
|
70
|
+
/**
|
|
71
|
+
* Check if a timing operation is currently in progress (started but not ended).
|
|
72
|
+
*
|
|
73
|
+
* @param label - Identifier for the timing operation
|
|
74
|
+
* @returns true if timing is in progress
|
|
75
|
+
*/
|
|
76
|
+
isInProgress(label: TimingLabel): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Check if a timing operation has been completed.
|
|
79
|
+
*
|
|
80
|
+
* @param label - Identifier for the timing operation
|
|
81
|
+
* @returns true if timing is complete
|
|
82
|
+
*/
|
|
83
|
+
isComplete(label: TimingLabel): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Get all measurements (for debugging and verbose output).
|
|
86
|
+
*
|
|
87
|
+
* @returns Read-only map of all measurements
|
|
88
|
+
*/
|
|
89
|
+
getAllMeasurements(): ReadonlyMap<string, TimingMeasurement>;
|
|
90
|
+
/**
|
|
91
|
+
* Clear all measurements.
|
|
92
|
+
*
|
|
93
|
+
* Useful when starting a new session or after a full restart.
|
|
94
|
+
*/
|
|
95
|
+
clear(): void;
|
|
96
|
+
/**
|
|
97
|
+
* Clear a specific measurement.
|
|
98
|
+
*
|
|
99
|
+
* @param label - Identifier for the timing operation to clear
|
|
100
|
+
*/
|
|
101
|
+
clearLabel(label: TimingLabel): void;
|
|
102
|
+
/**
|
|
103
|
+
* Get a summary of timing statistics (for verbose mode).
|
|
104
|
+
*
|
|
105
|
+
* @returns Object with timing statistics
|
|
106
|
+
*/
|
|
107
|
+
getSummary(): TimingSummary;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Summary of timing statistics
|
|
111
|
+
*/
|
|
112
|
+
export interface TimingSummary {
|
|
113
|
+
/** Total number of measurements (completed + in progress) */
|
|
114
|
+
readonly totalMeasurements: number;
|
|
115
|
+
/** Number of completed measurements */
|
|
116
|
+
readonly completedMeasurements: number;
|
|
117
|
+
/** Number of measurements still in progress */
|
|
118
|
+
readonly inProgressMeasurements: number;
|
|
119
|
+
/** Sum of all completed measurement durations in milliseconds */
|
|
120
|
+
readonly totalDurationMs: number;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Create a new TimingTracker instance.
|
|
124
|
+
*
|
|
125
|
+
* Factory function for consistent instantiation pattern across the codebase.
|
|
126
|
+
*
|
|
127
|
+
* @returns New TimingTracker instance
|
|
128
|
+
*/
|
|
129
|
+
export declare function createTimingTracker(): TimingTracker;
|
|
130
|
+
//# sourceMappingURL=timing-tracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timing-tracker.d.ts","sourceRoot":"","sources":["../../src/dev/timing-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAMH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,0CAA0C;IAC1C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,SAAS,GACT,YAAY,GACZ,UAAU,GACV,aAAa,GACb,MAAM,CAAC;AAMX;;;;;;;;GAQG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAwC;IAErE;;;;;;;OAOG;IACH,KAAK,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAM/B;;;;;OAKG;IACH,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM;IAuB/B;;;;;;;;OAQG;IACH,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI;IAkB9C;;;;;OAKG;IACH,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;IAKzC;;;;;OAKG;IACH,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO;IAKvC;;;;OAIG;IACH,kBAAkB,IAAI,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC;IAI5D;;;;OAIG;IACH,KAAK,IAAI,IAAI;IAIb;;;;OAIG;IACH,UAAU,CAAC,KAAK,EAAE,WAAW,GAAG,IAAI;IAIpC;;;;OAIG;IACH,UAAU,IAAI,aAAa;CAqB5B;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,6DAA6D;IAC7D,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,uCAAuC;IACvC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IACvC,+CAA+C;IAC/C,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACxC,iEAAiE;IACjE,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAMD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,IAAI,aAAa,CAEnD"}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Timing Tracker - Measures reload and startup timing
|
|
3
|
+
*
|
|
4
|
+
* Provides high-resolution timing for development reload events.
|
|
5
|
+
* Uses process.hrtime.bigint() for nanosecond precision, then converts
|
|
6
|
+
* to milliseconds for human-readable output.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const tracker = createTimingTracker();
|
|
11
|
+
*
|
|
12
|
+
* tracker.start('startup');
|
|
13
|
+
* await bootApplication();
|
|
14
|
+
* const duration = tracker.end('startup');
|
|
15
|
+
* console.log(`Started in ${duration}ms`);
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// TimingTracker Class
|
|
20
|
+
// ============================================================================
|
|
21
|
+
/**
|
|
22
|
+
* Tracks timing for reload operations with high precision.
|
|
23
|
+
*
|
|
24
|
+
* Design decisions:
|
|
25
|
+
* - Uses bigint for nanosecond precision (avoids floating point issues)
|
|
26
|
+
* - Converts to milliseconds only at output (human-readable)
|
|
27
|
+
* - Stores measurements for later retrieval (debugging, verbose mode)
|
|
28
|
+
* - Thread-safe for single-threaded Node.js (no race conditions)
|
|
29
|
+
*/
|
|
30
|
+
export class TimingTracker {
|
|
31
|
+
measurements = new Map();
|
|
32
|
+
/**
|
|
33
|
+
* Start timing an operation.
|
|
34
|
+
*
|
|
35
|
+
* If a measurement with the same label already exists, it will be overwritten.
|
|
36
|
+
* This is intentional - allows restarting a timer without explicit clear.
|
|
37
|
+
*
|
|
38
|
+
* @param label - Identifier for this timing operation
|
|
39
|
+
*/
|
|
40
|
+
start(label) {
|
|
41
|
+
this.measurements.set(label, {
|
|
42
|
+
startTime: process.hrtime.bigint(),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* End timing an operation and return duration in milliseconds.
|
|
47
|
+
*
|
|
48
|
+
* @param label - Identifier for the timing operation to end
|
|
49
|
+
* @returns Duration in milliseconds (rounded to nearest integer), or 0 if not started
|
|
50
|
+
*/
|
|
51
|
+
end(label) {
|
|
52
|
+
const measurement = this.measurements.get(label);
|
|
53
|
+
if (!measurement) {
|
|
54
|
+
// Operation wasn't started - return 0 rather than throw
|
|
55
|
+
// This makes the API forgiving for edge cases (e.g., rapid restarts)
|
|
56
|
+
return 0;
|
|
57
|
+
}
|
|
58
|
+
const endTime = process.hrtime.bigint();
|
|
59
|
+
const durationNs = endTime - measurement.startTime;
|
|
60
|
+
const durationMs = Number(durationNs) / 1_000_000; // Nanoseconds to milliseconds
|
|
61
|
+
// Update measurement with end time and duration
|
|
62
|
+
this.measurements.set(label, {
|
|
63
|
+
...measurement,
|
|
64
|
+
endTime,
|
|
65
|
+
durationMs,
|
|
66
|
+
});
|
|
67
|
+
return Math.round(durationMs);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Get the duration of a completed measurement without ending it.
|
|
71
|
+
*
|
|
72
|
+
* Useful for checking timing of operations that are still in progress
|
|
73
|
+
* or retrieving past measurements.
|
|
74
|
+
*
|
|
75
|
+
* @param label - Identifier for the timing operation
|
|
76
|
+
* @returns Duration in milliseconds if completed, elapsed time if in progress, null if not found
|
|
77
|
+
*/
|
|
78
|
+
getDuration(label) {
|
|
79
|
+
const measurement = this.measurements.get(label);
|
|
80
|
+
if (!measurement) {
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
// If measurement is complete, return stored duration
|
|
84
|
+
if (measurement.durationMs !== undefined) {
|
|
85
|
+
return Math.round(measurement.durationMs);
|
|
86
|
+
}
|
|
87
|
+
// If still in progress, calculate elapsed time
|
|
88
|
+
const currentTime = process.hrtime.bigint();
|
|
89
|
+
const elapsedNs = currentTime - measurement.startTime;
|
|
90
|
+
return Math.round(Number(elapsedNs) / 1_000_000);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Check if a timing operation is currently in progress (started but not ended).
|
|
94
|
+
*
|
|
95
|
+
* @param label - Identifier for the timing operation
|
|
96
|
+
* @returns true if timing is in progress
|
|
97
|
+
*/
|
|
98
|
+
isInProgress(label) {
|
|
99
|
+
const measurement = this.measurements.get(label);
|
|
100
|
+
return measurement !== undefined && measurement.endTime === undefined;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Check if a timing operation has been completed.
|
|
104
|
+
*
|
|
105
|
+
* @param label - Identifier for the timing operation
|
|
106
|
+
* @returns true if timing is complete
|
|
107
|
+
*/
|
|
108
|
+
isComplete(label) {
|
|
109
|
+
const measurement = this.measurements.get(label);
|
|
110
|
+
return measurement !== undefined && measurement.endTime !== undefined;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Get all measurements (for debugging and verbose output).
|
|
114
|
+
*
|
|
115
|
+
* @returns Read-only map of all measurements
|
|
116
|
+
*/
|
|
117
|
+
getAllMeasurements() {
|
|
118
|
+
return this.measurements;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Clear all measurements.
|
|
122
|
+
*
|
|
123
|
+
* Useful when starting a new session or after a full restart.
|
|
124
|
+
*/
|
|
125
|
+
clear() {
|
|
126
|
+
this.measurements.clear();
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Clear a specific measurement.
|
|
130
|
+
*
|
|
131
|
+
* @param label - Identifier for the timing operation to clear
|
|
132
|
+
*/
|
|
133
|
+
clearLabel(label) {
|
|
134
|
+
this.measurements.delete(label);
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Get a summary of timing statistics (for verbose mode).
|
|
138
|
+
*
|
|
139
|
+
* @returns Object with timing statistics
|
|
140
|
+
*/
|
|
141
|
+
getSummary() {
|
|
142
|
+
let totalDuration = 0;
|
|
143
|
+
let completedCount = 0;
|
|
144
|
+
let inProgressCount = 0;
|
|
145
|
+
for (const measurement of this.measurements.values()) {
|
|
146
|
+
if (measurement.durationMs !== undefined) {
|
|
147
|
+
totalDuration += measurement.durationMs;
|
|
148
|
+
completedCount++;
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
inProgressCount++;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return {
|
|
155
|
+
totalMeasurements: this.measurements.size,
|
|
156
|
+
completedMeasurements: completedCount,
|
|
157
|
+
inProgressMeasurements: inProgressCount,
|
|
158
|
+
totalDurationMs: Math.round(totalDuration),
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
// ============================================================================
|
|
163
|
+
// Factory Function
|
|
164
|
+
// ============================================================================
|
|
165
|
+
/**
|
|
166
|
+
* Create a new TimingTracker instance.
|
|
167
|
+
*
|
|
168
|
+
* Factory function for consistent instantiation pattern across the codebase.
|
|
169
|
+
*
|
|
170
|
+
* @returns New TimingTracker instance
|
|
171
|
+
*/
|
|
172
|
+
export function createTimingTracker() {
|
|
173
|
+
return new TimingTracker();
|
|
174
|
+
}
|
|
175
|
+
//# sourceMappingURL=timing-tracker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timing-tracker.js","sourceRoot":"","sources":["../../src/dev/timing-tracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA6BH,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E;;;;;;;;GAQG;AACH,MAAM,OAAO,aAAa;IACP,YAAY,GAAG,IAAI,GAAG,EAA6B,CAAC;IAErE;;;;;;;OAOG;IACH,KAAK,CA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IAAI,CAAC,YAAY,CAAC,IAAI;YACzC,qBAAqB,EAAE,cAAc;YACrC,sBAAsB,EAAE,eAAe;YACvC,eAAe,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC;SAC3C,CAAC;IACJ,CAAC;CACF;AAgBD,+EAA+E;AAC/E,mBAAmB;AACnB,+EAA+E;AAE/E;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,IAAI,aAAa,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Factory Generator
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Scaffolds factory files for VeloxTS applications.
|
|
5
5
|
*
|
|
6
6
|
* Usage:
|
|
7
|
-
* velox
|
|
8
|
-
* velox
|
|
7
|
+
* velox make factory <name> [options]
|
|
8
|
+
* velox m f <name> [options]
|
|
9
9
|
*
|
|
10
10
|
* Examples:
|
|
11
|
-
* velox
|
|
12
|
-
* velox
|
|
11
|
+
* velox make factory user # Creates UserFactory
|
|
12
|
+
* velox m f post # Creates PostFactory
|
|
13
13
|
*/
|
|
14
14
|
import { BaseGenerator } from '../base.js';
|
|
15
15
|
import { type FactoryOptions } from '../templates/factory.js';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Factory Generator
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Scaffolds factory files for VeloxTS applications.
|
|
5
5
|
*
|
|
6
6
|
* Usage:
|
|
7
|
-
* velox
|
|
8
|
-
* velox
|
|
7
|
+
* velox make factory <name> [options]
|
|
8
|
+
* velox m f <name> [options]
|
|
9
9
|
*
|
|
10
10
|
* Examples:
|
|
11
|
-
* velox
|
|
12
|
-
* velox
|
|
11
|
+
* velox make factory user # Creates UserFactory
|
|
12
|
+
* velox m f post # Creates PostFactory
|
|
13
13
|
*/
|
|
14
14
|
import { BaseGenerator } from '../base.js';
|
|
15
15
|
import { factoryTemplate, getFactoryInstructions, getFactoryPath, } from '../templates/factory.js';
|
|
@@ -24,15 +24,15 @@ export class FactoryGenerator extends BaseGenerator {
|
|
|
24
24
|
name: 'factory',
|
|
25
25
|
description: 'Generate a model factory for fake data generation',
|
|
26
26
|
longDescription: `
|
|
27
|
-
|
|
27
|
+
Scaffold a VeloxTS factory file for creating model instances with fake data.
|
|
28
28
|
|
|
29
29
|
Factories are stored in src/database/factories/ and extend BaseFactory.
|
|
30
30
|
They use @faker-js/faker to generate realistic test data and support
|
|
31
31
|
named states for common variations (e.g., admin, verified).
|
|
32
32
|
|
|
33
33
|
Examples:
|
|
34
|
-
velox
|
|
35
|
-
velox
|
|
34
|
+
velox make factory user # Creates UserFactory.ts
|
|
35
|
+
velox m f post # Creates PostFactory.ts
|
|
36
36
|
`,
|
|
37
37
|
aliases: ['f', 'fac'],
|
|
38
38
|
category: 'database',
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Migration Generator
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Scaffolds Prisma migration files with SQL scaffolding.
|
|
5
5
|
*
|
|
6
6
|
* Usage:
|
|
7
|
-
* velox
|
|
8
|
-
* velox
|
|
7
|
+
* velox make migration <name> [options]
|
|
8
|
+
* velox m mig <name> [options]
|
|
9
9
|
*
|
|
10
10
|
* Examples:
|
|
11
|
-
* velox
|
|
12
|
-
* velox
|
|
13
|
-
* velox
|
|
14
|
-
* velox
|
|
11
|
+
* velox make migration create_posts
|
|
12
|
+
* velox make migration add_email_to_users
|
|
13
|
+
* velox make migration remove_name_from_users
|
|
14
|
+
* velox m mig rename_posts_to_articles
|
|
15
15
|
*/
|
|
16
16
|
import { BaseGenerator } from '../base.js';
|
|
17
17
|
import { type MigrationOptions } from '../templates/migration.js';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Migration Generator
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Scaffolds Prisma migration files with SQL scaffolding.
|
|
5
5
|
*
|
|
6
6
|
* Usage:
|
|
7
|
-
* velox
|
|
8
|
-
* velox
|
|
7
|
+
* velox make migration <name> [options]
|
|
8
|
+
* velox m mig <name> [options]
|
|
9
9
|
*
|
|
10
10
|
* Examples:
|
|
11
|
-
* velox
|
|
12
|
-
* velox
|
|
13
|
-
* velox
|
|
14
|
-
* velox
|
|
11
|
+
* velox make migration create_posts
|
|
12
|
+
* velox make migration add_email_to_users
|
|
13
|
+
* velox make migration remove_name_from_users
|
|
14
|
+
* velox m mig rename_posts_to_articles
|
|
15
15
|
*/
|
|
16
16
|
import { BaseGenerator, detectProjectContext } from '../base.js';
|
|
17
17
|
import { generateMigrationFiles, getMigrationInstructions, } from '../templates/migration.js';
|
|
@@ -26,7 +26,7 @@ export class MigrationGenerator extends BaseGenerator {
|
|
|
26
26
|
name: 'migration',
|
|
27
27
|
description: 'Generate a database migration file',
|
|
28
28
|
longDescription: `
|
|
29
|
-
|
|
29
|
+
Scaffold a Prisma-compatible migration file with SQL scaffolding.
|
|
30
30
|
|
|
31
31
|
The migration name determines the SQL template:
|
|
32
32
|
create_<table> → CREATE TABLE scaffold
|
|
@@ -37,10 +37,10 @@ The migration name determines the SQL template:
|
|
|
37
37
|
<anything_else> → Custom migration template
|
|
38
38
|
|
|
39
39
|
Examples:
|
|
40
|
-
velox
|
|
41
|
-
velox
|
|
42
|
-
velox
|
|
43
|
-
velox
|
|
40
|
+
velox make migration create_posts
|
|
41
|
+
velox make migration add_slug_to_posts
|
|
42
|
+
velox make migration remove_legacy_field_from_users
|
|
43
|
+
velox m mig rename_posts_to_articles
|
|
44
44
|
`,
|
|
45
45
|
aliases: ['mig'],
|
|
46
46
|
category: 'database',
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Model Generator
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Scaffolds Prisma model, Zod schema, and optionally procedures.
|
|
5
5
|
*
|
|
6
6
|
* Usage:
|
|
7
|
-
* velox
|
|
8
|
-
* velox
|
|
7
|
+
* velox make model <name> [options]
|
|
8
|
+
* velox m model <name> [options]
|
|
9
9
|
*
|
|
10
10
|
* Examples:
|
|
11
|
-
* velox
|
|
12
|
-
* velox
|
|
13
|
-
* velox
|
|
14
|
-
* velox
|
|
11
|
+
* velox make model Post # Model + schema only
|
|
12
|
+
* velox make model Comment --crud # Model + schema + procedures
|
|
13
|
+
* velox m model Order --crud --paginated # With pagination
|
|
14
|
+
* velox m model Article --soft-delete # With soft delete support
|
|
15
15
|
*/
|
|
16
16
|
import { BaseGenerator } from '../base.js';
|
|
17
17
|
import { type ModelOptions } from '../templates/model.js';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Model Generator
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Scaffolds Prisma model, Zod schema, and optionally procedures.
|
|
5
5
|
*
|
|
6
6
|
* Usage:
|
|
7
|
-
* velox
|
|
8
|
-
* velox
|
|
7
|
+
* velox make model <name> [options]
|
|
8
|
+
* velox m model <name> [options]
|
|
9
9
|
*
|
|
10
10
|
* Examples:
|
|
11
|
-
* velox
|
|
12
|
-
* velox
|
|
13
|
-
* velox
|
|
14
|
-
* velox
|
|
11
|
+
* velox make model Post # Model + schema only
|
|
12
|
+
* velox make model Comment --crud # Model + schema + procedures
|
|
13
|
+
* velox m model Order --crud --paginated # With pagination
|
|
14
|
+
* velox m model Article --soft-delete # With soft delete support
|
|
15
15
|
*/
|
|
16
16
|
import { BaseGenerator } from '../base.js';
|
|
17
17
|
import { generateModelFiles, getModelInstructions } from '../templates/model.js';
|
|
@@ -26,16 +26,16 @@ export class ModelGenerator extends BaseGenerator {
|
|
|
26
26
|
name: 'model',
|
|
27
27
|
description: 'Generate a Prisma model with Zod schema and optional procedures',
|
|
28
28
|
longDescription: `
|
|
29
|
-
|
|
29
|
+
Scaffold a complete model including:
|
|
30
30
|
- Prisma model definition (saved to prisma/models/ for easy copying)
|
|
31
31
|
- Zod validation schemas (input/output)
|
|
32
32
|
- CRUD procedures (with --crud flag)
|
|
33
33
|
|
|
34
34
|
Examples:
|
|
35
|
-
velox
|
|
36
|
-
velox
|
|
37
|
-
velox
|
|
38
|
-
velox
|
|
35
|
+
velox make model Post # Model + schema only
|
|
36
|
+
velox make model Comment --crud # With CRUD procedures
|
|
37
|
+
velox m model Order --crud --paginated # With pagination
|
|
38
|
+
velox m model Article --soft-delete # With soft delete
|
|
39
39
|
`,
|
|
40
40
|
aliases: ['m'],
|
|
41
41
|
category: 'resource',
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Procedure Generator
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Scaffolds procedure files for VeloxTS applications.
|
|
5
5
|
*
|
|
6
6
|
* Usage:
|
|
7
|
-
* velox
|
|
8
|
-
* velox
|
|
7
|
+
* velox make procedure <name> [options]
|
|
8
|
+
* velox m p <name> [options]
|
|
9
9
|
*
|
|
10
10
|
* Examples:
|
|
11
|
-
* velox
|
|
12
|
-
* velox
|
|
13
|
-
* velox
|
|
11
|
+
* velox make procedure users # Simple get procedure
|
|
12
|
+
* velox make procedure posts --crud # Full CRUD procedures
|
|
13
|
+
* velox m p comments --crud --paginated # CRUD with pagination
|
|
14
14
|
*/
|
|
15
15
|
import { BaseGenerator } from '../base.js';
|
|
16
16
|
import { type ProcedureOptions } from '../templates/procedure.js';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Procedure Generator
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Scaffolds procedure files for VeloxTS applications.
|
|
5
5
|
*
|
|
6
6
|
* Usage:
|
|
7
|
-
* velox
|
|
8
|
-
* velox
|
|
7
|
+
* velox make procedure <name> [options]
|
|
8
|
+
* velox m p <name> [options]
|
|
9
9
|
*
|
|
10
10
|
* Examples:
|
|
11
|
-
* velox
|
|
12
|
-
* velox
|
|
13
|
-
* velox
|
|
11
|
+
* velox make procedure users # Simple get procedure
|
|
12
|
+
* velox make procedure posts --crud # Full CRUD procedures
|
|
13
|
+
* velox m p comments --crud --paginated # CRUD with pagination
|
|
14
14
|
*/
|
|
15
15
|
import { BaseGenerator } from '../base.js';
|
|
16
16
|
import { getProcedureInstructions, getProcedurePath, procedureTemplate, } from '../templates/procedure.js';
|
|
@@ -25,15 +25,15 @@ export class ProcedureGenerator extends BaseGenerator {
|
|
|
25
25
|
name: 'procedure',
|
|
26
26
|
description: 'Generate a procedure file for API endpoints',
|
|
27
27
|
longDescription: `
|
|
28
|
-
|
|
28
|
+
Scaffold a VeloxTS procedure file that defines API endpoints.
|
|
29
29
|
|
|
30
|
-
By default,
|
|
31
|
-
Use --crud to
|
|
30
|
+
By default, scaffolds a simple procedure with just a get operation.
|
|
31
|
+
Use --crud to scaffold full CRUD operations (get, list, create, update, patch, delete).
|
|
32
32
|
|
|
33
33
|
Examples:
|
|
34
|
-
velox
|
|
35
|
-
velox
|
|
36
|
-
velox
|
|
34
|
+
velox make procedure users # Simple get procedure
|
|
35
|
+
velox make procedure posts --crud # Full CRUD procedures
|
|
36
|
+
velox m p comments --crud --paginated # CRUD with pagination
|
|
37
37
|
`,
|
|
38
38
|
aliases: ['p', 'proc'],
|
|
39
39
|
category: 'resource',
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Seeder Generator
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Scaffolds seeder files for VeloxTS applications.
|
|
5
5
|
*
|
|
6
6
|
* Usage:
|
|
7
|
-
* velox
|
|
8
|
-
* velox
|
|
7
|
+
* velox make seeder <name> [options]
|
|
8
|
+
* velox m sd <name> [options]
|
|
9
9
|
*
|
|
10
10
|
* Examples:
|
|
11
|
-
* velox
|
|
12
|
-
* velox
|
|
11
|
+
* velox make seeder user # Creates UserSeeder
|
|
12
|
+
* velox make seeder post --factory # Also creates PostFactory
|
|
13
13
|
*/
|
|
14
14
|
import { BaseGenerator } from '../base.js';
|
|
15
15
|
import { type SeederOptions } from '../templates/seeder.js';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Seeder Generator
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Scaffolds seeder files for VeloxTS applications.
|
|
5
5
|
*
|
|
6
6
|
* Usage:
|
|
7
|
-
* velox
|
|
8
|
-
* velox
|
|
7
|
+
* velox make seeder <name> [options]
|
|
8
|
+
* velox m sd <name> [options]
|
|
9
9
|
*
|
|
10
10
|
* Examples:
|
|
11
|
-
* velox
|
|
12
|
-
* velox
|
|
11
|
+
* velox make seeder user # Creates UserSeeder
|
|
12
|
+
* velox make seeder post --factory # Also creates PostFactory
|
|
13
13
|
*/
|
|
14
14
|
import { BaseGenerator } from '../base.js';
|
|
15
15
|
import { factoryTemplate, getFactoryPath } from '../templates/factory.js';
|
|
@@ -25,16 +25,16 @@ export class SeederGenerator extends BaseGenerator {
|
|
|
25
25
|
name: 'seeder',
|
|
26
26
|
description: 'Generate a database seeder file',
|
|
27
27
|
longDescription: `
|
|
28
|
-
|
|
28
|
+
Scaffold a VeloxTS seeder file for populating the database with initial or test data.
|
|
29
29
|
|
|
30
30
|
Seeders are stored in src/database/seeders/ and implement the Seeder interface.
|
|
31
31
|
They can have dependencies on other seeders and are executed in the correct order.
|
|
32
32
|
|
|
33
33
|
Examples:
|
|
34
|
-
velox
|
|
35
|
-
velox
|
|
34
|
+
velox make seeder user # Creates UserSeeder.ts
|
|
35
|
+
velox make seeder post --factory # Creates PostSeeder.ts and PostFactory.ts
|
|
36
36
|
`,
|
|
37
|
-
aliases: ['
|
|
37
|
+
aliases: ['sd', 'seed'],
|
|
38
38
|
category: 'database',
|
|
39
39
|
};
|
|
40
40
|
options = [
|