create-velox-app 0.1.0 → 0.2.0
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.md +2 -0
- package/package.json +1 -1
- package/dist/cli.d.ts +0 -9
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -65
- package/dist/cli.js.map +0 -1
- package/dist/index.d.ts +0 -12
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -263
- package/dist/index.js.map +0 -1
- package/dist/templates.d.ts +0 -29
- package/dist/templates.d.ts.map +0 -1
- package/dist/templates.js +0 -597
- package/dist/templates.js.map +0 -1
package/README.md
CHANGED
package/package.json
CHANGED
package/dist/cli.d.ts
DELETED
package/dist/cli.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;GAKG"}
|
package/dist/cli.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* create-velox-app CLI entry point
|
|
4
|
-
*
|
|
5
|
-
* Executable entry point for the project scaffolder.
|
|
6
|
-
* Handles command-line arguments and initiates the scaffolding process.
|
|
7
|
-
*/
|
|
8
|
-
import { CREATE_VERSION, createVeloxApp } from './index.js';
|
|
9
|
-
// ============================================================================
|
|
10
|
-
// Help & Version
|
|
11
|
-
// ============================================================================
|
|
12
|
-
const HELP_TEXT = `
|
|
13
|
-
create-velox-app v${CREATE_VERSION}
|
|
14
|
-
|
|
15
|
-
Usage:
|
|
16
|
-
npx create-velox-app [project-name]
|
|
17
|
-
pnpm create velox-app [project-name]
|
|
18
|
-
|
|
19
|
-
Options:
|
|
20
|
-
-h, --help Show this help message
|
|
21
|
-
-v, --version Show version number
|
|
22
|
-
|
|
23
|
-
Examples:
|
|
24
|
-
npx create-velox-app my-app
|
|
25
|
-
npx create-velox-app # Interactive mode
|
|
26
|
-
`;
|
|
27
|
-
// ============================================================================
|
|
28
|
-
// Main Entry Point
|
|
29
|
-
// ============================================================================
|
|
30
|
-
/**
|
|
31
|
-
* Parse arguments and run scaffolder
|
|
32
|
-
*/
|
|
33
|
-
async function main() {
|
|
34
|
-
try {
|
|
35
|
-
// Get arguments
|
|
36
|
-
const args = process.argv.slice(2);
|
|
37
|
-
// Handle --help
|
|
38
|
-
if (args.includes('-h') || args.includes('--help')) {
|
|
39
|
-
console.log(HELP_TEXT);
|
|
40
|
-
process.exit(0);
|
|
41
|
-
}
|
|
42
|
-
// Handle --version
|
|
43
|
-
if (args.includes('-v') || args.includes('--version')) {
|
|
44
|
-
console.log(CREATE_VERSION);
|
|
45
|
-
process.exit(0);
|
|
46
|
-
}
|
|
47
|
-
// Get project name (first non-flag argument)
|
|
48
|
-
const projectName = args.find((arg) => !arg.startsWith('-'));
|
|
49
|
-
// Run scaffolder
|
|
50
|
-
await createVeloxApp(projectName);
|
|
51
|
-
}
|
|
52
|
-
catch (error) {
|
|
53
|
-
// Handle unexpected errors
|
|
54
|
-
if (error instanceof Error) {
|
|
55
|
-
console.error(`\nError: ${error.message}`);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
console.error('\nAn unexpected error occurred');
|
|
59
|
-
}
|
|
60
|
-
process.exit(1);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
// Run the CLI
|
|
64
|
-
main();
|
|
65
|
-
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5D,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E,MAAM,SAAS,GAAG;oBACE,cAAc;;;;;;;;;;;;;CAajC,CAAC;AAEF,+E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|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* create-velox-app - Project scaffolding tool
|
|
3
|
-
*
|
|
4
|
-
* CLI tool for bootstrapping new VeloxTS applications with a default template.
|
|
5
|
-
* Provides an interactive setup experience similar to create-next-app.
|
|
6
|
-
*/
|
|
7
|
-
export declare const CREATE_VERSION = "0.1.0";
|
|
8
|
-
/**
|
|
9
|
-
* Main scaffolding function that creates a new VeloxTS project
|
|
10
|
-
*/
|
|
11
|
-
export declare function createVeloxApp(initialProjectName?: string): Promise<void>;
|
|
12
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAmCH,eAAO,MAAM,cAAc,UAAU,CAAC;AAgBtC;;GAEG;AACH,wBAAsB,cAAc,CAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAuC/E"}
|
package/dist/index.js
DELETED
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* create-velox-app - Project scaffolding tool
|
|
3
|
-
*
|
|
4
|
-
* CLI tool for bootstrapping new VeloxTS applications with a default template.
|
|
5
|
-
* Provides an interactive setup experience similar to create-next-app.
|
|
6
|
-
*/
|
|
7
|
-
import { execSync } from 'node:child_process';
|
|
8
|
-
import fs from 'node:fs/promises';
|
|
9
|
-
import path from 'node:path';
|
|
10
|
-
import * as p from '@clack/prompts';
|
|
11
|
-
import pc from 'picocolors';
|
|
12
|
-
import { generateConfigApp, generateConfigIndex, generateDatabaseIndex, generateEnvExample, generateGitignore, generateHealthProcedures, generateIndexHtml, generateIndexTs, generatePackageJson, generatePrismaConfig, generatePrismaSchema, generateProceduresIndex, generateReadme, generateSchemasIndex, generateTsConfig, generateTsupConfig, generateUserProcedures, generateUserSchema, } from './templates.js';
|
|
13
|
-
// ============================================================================
|
|
14
|
-
// Constants
|
|
15
|
-
// ============================================================================
|
|
16
|
-
export const CREATE_VERSION = '0.1.0';
|
|
17
|
-
// ============================================================================
|
|
18
|
-
// Main Scaffolder
|
|
19
|
-
// ============================================================================
|
|
20
|
-
/**
|
|
21
|
-
* Main scaffolding function that creates a new VeloxTS project
|
|
22
|
-
*/
|
|
23
|
-
export async function createVeloxApp(initialProjectName) {
|
|
24
|
-
// Print welcome banner
|
|
25
|
-
console.log('');
|
|
26
|
-
p.intro(pc.cyan(pc.bold('create-velox-app')));
|
|
27
|
-
try {
|
|
28
|
-
// Collect project configuration
|
|
29
|
-
const config = await promptProjectConfig(initialProjectName);
|
|
30
|
-
// Validate project directory doesn't exist
|
|
31
|
-
await validateProjectDirectory(config.directory);
|
|
32
|
-
// Create project structure
|
|
33
|
-
await createProjectStructure(config);
|
|
34
|
-
// Install dependencies
|
|
35
|
-
await installDependencies(config);
|
|
36
|
-
// Initialize git
|
|
37
|
-
await initializeGit(config);
|
|
38
|
-
// Print success message
|
|
39
|
-
printSuccessMessage(config);
|
|
40
|
-
p.outro(pc.green('Done! Your VeloxTS app is ready.'));
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
// Handle cancellation
|
|
44
|
-
if (error === Symbol.for('clack.cancel') || error.message === 'canceled') {
|
|
45
|
-
p.cancel('Setup cancelled');
|
|
46
|
-
process.exit(0);
|
|
47
|
-
}
|
|
48
|
-
// Handle other errors
|
|
49
|
-
p.cancel('Setup failed');
|
|
50
|
-
if (error instanceof Error) {
|
|
51
|
-
console.error(pc.red(`\nError: ${error.message}`));
|
|
52
|
-
}
|
|
53
|
-
process.exit(1);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
// ============================================================================
|
|
57
|
-
// Configuration Prompts
|
|
58
|
-
// ============================================================================
|
|
59
|
-
/**
|
|
60
|
-
* Prompt user for project configuration
|
|
61
|
-
*/
|
|
62
|
-
async function promptProjectConfig(initialName) {
|
|
63
|
-
// Project name
|
|
64
|
-
const name = initialName
|
|
65
|
-
? initialName
|
|
66
|
-
: await p.text({
|
|
67
|
-
message: 'What is your project named?',
|
|
68
|
-
placeholder: 'my-velox-app',
|
|
69
|
-
validate: (value) => {
|
|
70
|
-
if (!value)
|
|
71
|
-
return 'Project name is required';
|
|
72
|
-
if (!/^[a-z0-9-]+$/.test(value)) {
|
|
73
|
-
return 'Use lowercase letters, numbers, and hyphens only';
|
|
74
|
-
}
|
|
75
|
-
return undefined;
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
if (p.isCancel(name)) {
|
|
79
|
-
throw new Error('canceled');
|
|
80
|
-
}
|
|
81
|
-
// Validate project name format
|
|
82
|
-
if (typeof name === 'string' && !/^[a-z0-9-]+$/.test(name)) {
|
|
83
|
-
throw new Error('Project name must use lowercase letters, numbers, and hyphens only');
|
|
84
|
-
}
|
|
85
|
-
// Detect package manager
|
|
86
|
-
const packageManager = detectPackageManager();
|
|
87
|
-
return {
|
|
88
|
-
name: name,
|
|
89
|
-
directory: path.resolve(process.cwd(), name),
|
|
90
|
-
packageManager,
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Detect which package manager is being used
|
|
95
|
-
*/
|
|
96
|
-
function detectPackageManager() {
|
|
97
|
-
const userAgent = process.env.npm_config_user_agent || '';
|
|
98
|
-
if (userAgent.includes('pnpm'))
|
|
99
|
-
return 'pnpm';
|
|
100
|
-
if (userAgent.includes('yarn'))
|
|
101
|
-
return 'yarn';
|
|
102
|
-
return 'npm';
|
|
103
|
-
}
|
|
104
|
-
// ============================================================================
|
|
105
|
-
// Project Creation
|
|
106
|
-
// ============================================================================
|
|
107
|
-
/**
|
|
108
|
-
* Validate that project directory doesn't already exist
|
|
109
|
-
*/
|
|
110
|
-
async function validateProjectDirectory(directory) {
|
|
111
|
-
try {
|
|
112
|
-
await fs.access(directory);
|
|
113
|
-
throw new Error(`Directory ${path.basename(directory)} already exists`);
|
|
114
|
-
}
|
|
115
|
-
catch (error) {
|
|
116
|
-
// Directory doesn't exist - this is what we want
|
|
117
|
-
if (error.code !== 'ENOENT') {
|
|
118
|
-
throw error;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Create the complete project structure with all files
|
|
124
|
-
*/
|
|
125
|
-
async function createProjectStructure(config) {
|
|
126
|
-
const spinner = p.spinner();
|
|
127
|
-
spinner.start('Creating project files');
|
|
128
|
-
try {
|
|
129
|
-
// Create directory structure
|
|
130
|
-
await fs.mkdir(config.directory, { recursive: true });
|
|
131
|
-
await fs.mkdir(path.join(config.directory, 'src'), { recursive: true });
|
|
132
|
-
await fs.mkdir(path.join(config.directory, 'src', 'config'), { recursive: true });
|
|
133
|
-
await fs.mkdir(path.join(config.directory, 'src', 'database'), { recursive: true });
|
|
134
|
-
await fs.mkdir(path.join(config.directory, 'src', 'procedures'), { recursive: true });
|
|
135
|
-
await fs.mkdir(path.join(config.directory, 'src', 'schemas'), { recursive: true });
|
|
136
|
-
await fs.mkdir(path.join(config.directory, 'prisma'), { recursive: true });
|
|
137
|
-
await fs.mkdir(path.join(config.directory, 'public'), { recursive: true });
|
|
138
|
-
// Template data
|
|
139
|
-
const template = {
|
|
140
|
-
projectName: config.name,
|
|
141
|
-
packageManager: config.packageManager,
|
|
142
|
-
};
|
|
143
|
-
// Write root files
|
|
144
|
-
await fs.writeFile(path.join(config.directory, 'package.json'), generatePackageJson(template));
|
|
145
|
-
await fs.writeFile(path.join(config.directory, 'tsconfig.json'), generateTsConfig());
|
|
146
|
-
await fs.writeFile(path.join(config.directory, 'tsup.config.ts'), generateTsupConfig());
|
|
147
|
-
await fs.writeFile(path.join(config.directory, '.env.example'), generateEnvExample());
|
|
148
|
-
await fs.writeFile(path.join(config.directory, '.env'), generateEnvExample());
|
|
149
|
-
await fs.writeFile(path.join(config.directory, '.gitignore'), generateGitignore());
|
|
150
|
-
await fs.writeFile(path.join(config.directory, 'README.md'), generateReadme(config.name));
|
|
151
|
-
// Write Prisma files
|
|
152
|
-
await fs.writeFile(path.join(config.directory, 'prisma', 'schema.prisma'), generatePrismaSchema());
|
|
153
|
-
await fs.writeFile(path.join(config.directory, 'prisma.config.ts'), generatePrismaConfig());
|
|
154
|
-
// Write source files
|
|
155
|
-
await fs.writeFile(path.join(config.directory, 'src', 'index.ts'), generateIndexTs());
|
|
156
|
-
// Write config files
|
|
157
|
-
await fs.writeFile(path.join(config.directory, 'src', 'config', 'index.ts'), generateConfigIndex());
|
|
158
|
-
await fs.writeFile(path.join(config.directory, 'src', 'config', 'app.ts'), generateConfigApp());
|
|
159
|
-
// Write database files
|
|
160
|
-
await fs.writeFile(path.join(config.directory, 'src', 'database', 'index.ts'), generateDatabaseIndex());
|
|
161
|
-
// Write procedure files
|
|
162
|
-
await fs.writeFile(path.join(config.directory, 'src', 'procedures', 'index.ts'), generateProceduresIndex());
|
|
163
|
-
await fs.writeFile(path.join(config.directory, 'src', 'procedures', 'health.ts'), generateHealthProcedures());
|
|
164
|
-
await fs.writeFile(path.join(config.directory, 'src', 'procedures', 'users.ts'), generateUserProcedures());
|
|
165
|
-
// Write schema files
|
|
166
|
-
await fs.writeFile(path.join(config.directory, 'src', 'schemas', 'index.ts'), generateSchemasIndex());
|
|
167
|
-
await fs.writeFile(path.join(config.directory, 'src', 'schemas', 'user.ts'), generateUserSchema());
|
|
168
|
-
// Write public files
|
|
169
|
-
await fs.writeFile(path.join(config.directory, 'public', 'index.html'), generateIndexHtml());
|
|
170
|
-
spinner.stop('Project files created');
|
|
171
|
-
}
|
|
172
|
-
catch (error) {
|
|
173
|
-
spinner.stop('Failed to create project files');
|
|
174
|
-
throw error;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
// ============================================================================
|
|
178
|
-
// Dependency Installation
|
|
179
|
-
// ============================================================================
|
|
180
|
-
/**
|
|
181
|
-
* Install project dependencies using the detected package manager
|
|
182
|
-
*/
|
|
183
|
-
async function installDependencies(config) {
|
|
184
|
-
const spinner = p.spinner();
|
|
185
|
-
spinner.start('Installing dependencies');
|
|
186
|
-
try {
|
|
187
|
-
const installCommand = getInstallCommand(config.packageManager);
|
|
188
|
-
execSync(installCommand, {
|
|
189
|
-
cwd: config.directory,
|
|
190
|
-
stdio: 'ignore',
|
|
191
|
-
});
|
|
192
|
-
spinner.stop('Dependencies installed');
|
|
193
|
-
}
|
|
194
|
-
catch (error) {
|
|
195
|
-
spinner.stop('Failed to install dependencies');
|
|
196
|
-
throw error;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Get the install command for the package manager
|
|
201
|
-
*/
|
|
202
|
-
function getInstallCommand(packageManager) {
|
|
203
|
-
switch (packageManager) {
|
|
204
|
-
case 'pnpm':
|
|
205
|
-
return 'pnpm install';
|
|
206
|
-
case 'yarn':
|
|
207
|
-
return 'yarn install';
|
|
208
|
-
default:
|
|
209
|
-
return 'npm install';
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
// ============================================================================
|
|
213
|
-
// Git Initialization
|
|
214
|
-
// ============================================================================
|
|
215
|
-
/**
|
|
216
|
-
* Initialize git repository
|
|
217
|
-
*/
|
|
218
|
-
async function initializeGit(config) {
|
|
219
|
-
const spinner = p.spinner();
|
|
220
|
-
spinner.start('Initializing git repository');
|
|
221
|
-
try {
|
|
222
|
-
execSync('git init', {
|
|
223
|
-
cwd: config.directory,
|
|
224
|
-
stdio: 'ignore',
|
|
225
|
-
});
|
|
226
|
-
execSync('git add .', {
|
|
227
|
-
cwd: config.directory,
|
|
228
|
-
stdio: 'ignore',
|
|
229
|
-
});
|
|
230
|
-
execSync('git commit -m "Initial commit from create-velox-app"', {
|
|
231
|
-
cwd: config.directory,
|
|
232
|
-
stdio: 'ignore',
|
|
233
|
-
});
|
|
234
|
-
spinner.stop('Git repository initialized');
|
|
235
|
-
}
|
|
236
|
-
catch (_error) {
|
|
237
|
-
// Git init is optional - don't fail if it doesn't work
|
|
238
|
-
spinner.stop('Skipped git initialization');
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
// ============================================================================
|
|
242
|
-
// Success Message
|
|
243
|
-
// ============================================================================
|
|
244
|
-
/**
|
|
245
|
-
* Print success message with next steps
|
|
246
|
-
*/
|
|
247
|
-
function printSuccessMessage(config) {
|
|
248
|
-
const cdCommand = `cd ${config.name}`;
|
|
249
|
-
const devCommand = `${config.packageManager} dev`;
|
|
250
|
-
const dbCommand = `${config.packageManager} db:push`;
|
|
251
|
-
console.log('');
|
|
252
|
-
console.log(pc.green(` Success! Created ${pc.bold(config.name)}`));
|
|
253
|
-
console.log('');
|
|
254
|
-
console.log(' Next steps:');
|
|
255
|
-
console.log('');
|
|
256
|
-
console.log(` ${pc.cyan(cdCommand)}`);
|
|
257
|
-
console.log(` ${pc.cyan(dbCommand)}${pc.dim(' # Setup database')}`);
|
|
258
|
-
console.log(` ${pc.cyan(devCommand)}${pc.dim(' # Start dev server')}`);
|
|
259
|
-
console.log('');
|
|
260
|
-
console.log(` Your app will be available at ${pc.cyan('http://localhost:3210')}`);
|
|
261
|
-
console.log('');
|
|
262
|
-
}
|
|
263
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,KAAK,CAAC,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,MAAM,YAAY,CAAC;AAG5B,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,oBAAoB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,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAC7B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC;IACxE,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IAC5E,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,mCAAmC,EAAE,CAAC,IAAI,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;IACnF,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC"}
|
package/dist/templates.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Template Generation Functions
|
|
3
|
-
*
|
|
4
|
-
* Generates all files needed for a new VeloxTS project.
|
|
5
|
-
* Templates are based on the playground app structure.
|
|
6
|
-
*/
|
|
7
|
-
export interface ProjectTemplate {
|
|
8
|
-
projectName: string;
|
|
9
|
-
packageManager: 'npm' | 'pnpm' | 'yarn';
|
|
10
|
-
}
|
|
11
|
-
export declare function generatePackageJson(template: ProjectTemplate): string;
|
|
12
|
-
export declare function generateTsConfig(): string;
|
|
13
|
-
export declare function generateTsupConfig(): string;
|
|
14
|
-
export declare function generateEnvExample(): string;
|
|
15
|
-
export declare function generateGitignore(): string;
|
|
16
|
-
export declare function generatePrismaSchema(): string;
|
|
17
|
-
export declare function generatePrismaConfig(): string;
|
|
18
|
-
export declare function generateIndexTs(): string;
|
|
19
|
-
export declare function generateConfigIndex(): string;
|
|
20
|
-
export declare function generateConfigApp(): string;
|
|
21
|
-
export declare function generateDatabaseIndex(): string;
|
|
22
|
-
export declare function generateProceduresIndex(): string;
|
|
23
|
-
export declare function generateHealthProcedures(): string;
|
|
24
|
-
export declare function generateUserProcedures(): string;
|
|
25
|
-
export declare function generateSchemasIndex(): string;
|
|
26
|
-
export declare function generateUserSchema(): string;
|
|
27
|
-
export declare function generateIndexHtml(): string;
|
|
28
|
-
export declare function generateReadme(projectName: string): string;
|
|
29
|
-
//# sourceMappingURL=templates.d.ts.map
|
package/dist/templates.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;CACzC;AAMD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,eAAe,GAAG,MAAM,CAuCrE;AAMD,wBAAgB,gBAAgB,IAAI,MAAM,CA8BzC;AAMD,wBAAgB,kBAAkB,IAAI,MAAM,CAY3C;AAMD,wBAAgB,kBAAkB,IAAI,MAAM,CAe3C;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAoC1C;AAMD,wBAAgB,oBAAoB,IAAI,MAAM,CA8B7C;AAMD,wBAAgB,oBAAoB,IAAI,MAAM,CAmB7C;AAMD,wBAAgB,eAAe,IAAI,MAAM,CAiFxC;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAO5C;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAyB1C;AAED,wBAAgB,qBAAqB,IAAI,MAAM,CAkB9C;AAED,wBAAgB,uBAAuB,IAAI,MAAM,CAQhD;AAED,wBAAgB,wBAAwB,IAAI,MAAM,CA4BjD;AAED,wBAAgB,sBAAsB,IAAI,MAAM,CA4F/C;AAED,wBAAgB,oBAAoB,IAAI,MAAM,CAO7C;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAyB3C;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CA8B1C;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAyD1D"}
|
package/dist/templates.js
DELETED
|
@@ -1,597 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Template Generation Functions
|
|
3
|
-
*
|
|
4
|
-
* Generates all files needed for a new VeloxTS project.
|
|
5
|
-
* Templates are based on the playground app structure.
|
|
6
|
-
*/
|
|
7
|
-
// ============================================================================
|
|
8
|
-
// Package.json Template
|
|
9
|
-
// ============================================================================
|
|
10
|
-
export function generatePackageJson(template) {
|
|
11
|
-
return JSON.stringify({
|
|
12
|
-
name: template.projectName,
|
|
13
|
-
version: '0.1.0',
|
|
14
|
-
description: 'A VeloxTS application',
|
|
15
|
-
type: 'module',
|
|
16
|
-
main: 'dist/index.js',
|
|
17
|
-
scripts: {
|
|
18
|
-
build: 'tsup',
|
|
19
|
-
start: 'node dist/index.js',
|
|
20
|
-
dev: 'tsx watch src/index.ts',
|
|
21
|
-
'type-check': 'tsc --noEmit',
|
|
22
|
-
clean: 'rm -rf dist tsconfig.tsbuildinfo',
|
|
23
|
-
'db:generate': 'prisma generate',
|
|
24
|
-
'db:push': 'prisma db push',
|
|
25
|
-
'db:studio': 'prisma studio',
|
|
26
|
-
},
|
|
27
|
-
dependencies: {
|
|
28
|
-
'@fastify/static': '^8.3.0',
|
|
29
|
-
'@prisma/adapter-better-sqlite3': '^7.1.0',
|
|
30
|
-
'@prisma/client': '^7.1.0',
|
|
31
|
-
'@veloxts/core': '^0.1.0',
|
|
32
|
-
'@veloxts/orm': '^0.1.0',
|
|
33
|
-
'@veloxts/router': '^0.1.0',
|
|
34
|
-
'@veloxts/validation': '^0.1.0',
|
|
35
|
-
dotenv: '^17.2.3',
|
|
36
|
-
zod: '^3.24.4',
|
|
37
|
-
},
|
|
38
|
-
devDependencies: {
|
|
39
|
-
prisma: '^7.1.0',
|
|
40
|
-
tsup: '^8.5.1',
|
|
41
|
-
tsx: '^4.21.0',
|
|
42
|
-
typescript: '^5.9.3',
|
|
43
|
-
},
|
|
44
|
-
}, null, 2);
|
|
45
|
-
}
|
|
46
|
-
// ============================================================================
|
|
47
|
-
// TypeScript Config
|
|
48
|
-
// ============================================================================
|
|
49
|
-
export function generateTsConfig() {
|
|
50
|
-
return JSON.stringify({
|
|
51
|
-
$schema: 'https://json.schemastore.org/tsconfig',
|
|
52
|
-
compilerOptions: {
|
|
53
|
-
target: 'ES2022',
|
|
54
|
-
module: 'ES2022',
|
|
55
|
-
moduleResolution: 'bundler',
|
|
56
|
-
lib: ['ES2022'],
|
|
57
|
-
strict: true,
|
|
58
|
-
esModuleInterop: true,
|
|
59
|
-
skipLibCheck: true,
|
|
60
|
-
resolveJsonModule: true,
|
|
61
|
-
allowSyntheticDefaultImports: true,
|
|
62
|
-
forceConsistentCasingInFileNames: true,
|
|
63
|
-
isolatedModules: true,
|
|
64
|
-
noUnusedLocals: true,
|
|
65
|
-
noUnusedParameters: true,
|
|
66
|
-
noFallthroughCasesInSwitch: true,
|
|
67
|
-
declaration: false,
|
|
68
|
-
declarationMap: false,
|
|
69
|
-
rootDir: './src',
|
|
70
|
-
outDir: './dist',
|
|
71
|
-
},
|
|
72
|
-
include: ['src/**/*'],
|
|
73
|
-
exclude: ['node_modules', 'dist', '**/*.test.ts', '**/*.spec.ts'],
|
|
74
|
-
}, null, 2);
|
|
75
|
-
}
|
|
76
|
-
// ============================================================================
|
|
77
|
-
// tsup Config
|
|
78
|
-
// ============================================================================
|
|
79
|
-
export function generateTsupConfig() {
|
|
80
|
-
return `import { defineConfig } from 'tsup';
|
|
81
|
-
|
|
82
|
-
export default defineConfig({
|
|
83
|
-
entry: ['src/index.ts'],
|
|
84
|
-
format: ['esm'],
|
|
85
|
-
target: 'node18',
|
|
86
|
-
clean: true,
|
|
87
|
-
dts: false,
|
|
88
|
-
sourcemap: true,
|
|
89
|
-
});
|
|
90
|
-
`;
|
|
91
|
-
}
|
|
92
|
-
// ============================================================================
|
|
93
|
-
// Environment Files
|
|
94
|
-
// ============================================================================
|
|
95
|
-
export function generateEnvExample() {
|
|
96
|
-
return `# Database URL
|
|
97
|
-
# SQLite (local development):
|
|
98
|
-
DATABASE_URL="file:./dev.db"
|
|
99
|
-
# PostgreSQL (production):
|
|
100
|
-
# DATABASE_URL="postgresql://user:password@localhost:5432/myapp"
|
|
101
|
-
|
|
102
|
-
# Server Configuration
|
|
103
|
-
PORT=3000
|
|
104
|
-
HOST=0.0.0.0
|
|
105
|
-
NODE_ENV=development
|
|
106
|
-
|
|
107
|
-
# API Configuration
|
|
108
|
-
API_PREFIX=/api
|
|
109
|
-
`;
|
|
110
|
-
}
|
|
111
|
-
export function generateGitignore() {
|
|
112
|
-
return `# Dependencies
|
|
113
|
-
node_modules/
|
|
114
|
-
|
|
115
|
-
# Build output
|
|
116
|
-
dist/
|
|
117
|
-
*.tsbuildinfo
|
|
118
|
-
|
|
119
|
-
# Environment variables
|
|
120
|
-
.env
|
|
121
|
-
.env.local
|
|
122
|
-
|
|
123
|
-
# Database
|
|
124
|
-
*.db
|
|
125
|
-
*.db-journal
|
|
126
|
-
|
|
127
|
-
# Generated Prisma client
|
|
128
|
-
src/generated/
|
|
129
|
-
|
|
130
|
-
# Logs
|
|
131
|
-
logs/
|
|
132
|
-
*.log
|
|
133
|
-
|
|
134
|
-
# OS
|
|
135
|
-
.DS_Store
|
|
136
|
-
Thumbs.db
|
|
137
|
-
|
|
138
|
-
# IDE
|
|
139
|
-
.vscode/
|
|
140
|
-
.idea/
|
|
141
|
-
*.swp
|
|
142
|
-
*.swo
|
|
143
|
-
|
|
144
|
-
# Turbo
|
|
145
|
-
.turbo/
|
|
146
|
-
`;
|
|
147
|
-
}
|
|
148
|
-
// ============================================================================
|
|
149
|
-
// Prisma Schema
|
|
150
|
-
// ============================================================================
|
|
151
|
-
export function generatePrismaSchema() {
|
|
152
|
-
return `// Prisma Schema
|
|
153
|
-
//
|
|
154
|
-
// This schema defines the database structure.
|
|
155
|
-
// Using SQLite for simplicity - easily swap to PostgreSQL for production.
|
|
156
|
-
|
|
157
|
-
generator client {
|
|
158
|
-
provider = "prisma-client"
|
|
159
|
-
output = "../src/generated/prisma"
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
datasource db {
|
|
163
|
-
provider = "sqlite"
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// ============================================================================
|
|
167
|
-
// User Model
|
|
168
|
-
// ============================================================================
|
|
169
|
-
|
|
170
|
-
/// User model for basic CRUD demonstration
|
|
171
|
-
model User {
|
|
172
|
-
id String @id @default(uuid())
|
|
173
|
-
name String
|
|
174
|
-
email String @unique
|
|
175
|
-
createdAt DateTime @default(now())
|
|
176
|
-
updatedAt DateTime @updatedAt
|
|
177
|
-
|
|
178
|
-
@@map("users")
|
|
179
|
-
}
|
|
180
|
-
`;
|
|
181
|
-
}
|
|
182
|
-
// ============================================================================
|
|
183
|
-
// Prisma Config (Prisma 7.x)
|
|
184
|
-
// ============================================================================
|
|
185
|
-
export function generatePrismaConfig() {
|
|
186
|
-
return `/**
|
|
187
|
-
* Prisma Configuration (Prisma 7.x)
|
|
188
|
-
*
|
|
189
|
-
* Database URL is now configured here instead of schema.prisma.
|
|
190
|
-
* See: https://www.prisma.io/docs/orm/more/upgrade-guides/upgrading-versions/upgrading-to-prisma-7
|
|
191
|
-
*/
|
|
192
|
-
|
|
193
|
-
import 'dotenv/config';
|
|
194
|
-
import { defineConfig } from 'prisma/config';
|
|
195
|
-
|
|
196
|
-
export default defineConfig({
|
|
197
|
-
earlyAccess: true,
|
|
198
|
-
schema: './prisma/schema.prisma',
|
|
199
|
-
datasource: {
|
|
200
|
-
url: process.env.DATABASE_URL!,
|
|
201
|
-
},
|
|
202
|
-
});
|
|
203
|
-
`;
|
|
204
|
-
}
|
|
205
|
-
// ============================================================================
|
|
206
|
-
// Source Files
|
|
207
|
-
// ============================================================================
|
|
208
|
-
export function generateIndexTs() {
|
|
209
|
-
return `/**
|
|
210
|
-
* Application Entry Point
|
|
211
|
-
*/
|
|
212
|
-
|
|
213
|
-
import 'dotenv/config';
|
|
214
|
-
|
|
215
|
-
import fastifyStatic from '@fastify/static';
|
|
216
|
-
import { createVeloxApp, VELOX_VERSION } from '@veloxts/core';
|
|
217
|
-
import { createDatabasePlugin } from '@veloxts/orm';
|
|
218
|
-
import { createRoutesRegistrar, getRouteSummary } from '@veloxts/router';
|
|
219
|
-
import path from 'node:path';
|
|
220
|
-
|
|
221
|
-
import { config } from './config/index.js';
|
|
222
|
-
import { prisma } from './database/index.js';
|
|
223
|
-
import { healthProcedures, userProcedures } from './procedures/index.js';
|
|
224
|
-
|
|
225
|
-
// ============================================================================
|
|
226
|
-
// Application Bootstrap
|
|
227
|
-
// ============================================================================
|
|
228
|
-
|
|
229
|
-
async function createApp() {
|
|
230
|
-
const app = await createVeloxApp({
|
|
231
|
-
port: config.port,
|
|
232
|
-
host: config.host,
|
|
233
|
-
logger: config.logger,
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
// Register database plugin
|
|
237
|
-
await app.use(createDatabasePlugin({ client: prisma }));
|
|
238
|
-
|
|
239
|
-
// Register static file serving for frontend
|
|
240
|
-
await app.server.register(fastifyStatic, {
|
|
241
|
-
root: path.join(process.cwd(), 'public'),
|
|
242
|
-
prefix: '/',
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
// Register REST API routes
|
|
246
|
-
const collections = [userProcedures, healthProcedures];
|
|
247
|
-
app.routes(createRoutesRegistrar(collections, { prefix: config.apiPrefix }));
|
|
248
|
-
|
|
249
|
-
return { app, collections };
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
function printBanner(collections: Parameters<typeof getRouteSummary>[0]) {
|
|
253
|
-
const divider = '═'.repeat(50);
|
|
254
|
-
|
|
255
|
-
console.log(\`\\n\${divider}\`);
|
|
256
|
-
console.log(\` VeloxTS Application v\${VELOX_VERSION}\`);
|
|
257
|
-
console.log(\` Environment: \${config.env}\`);
|
|
258
|
-
console.log(divider);
|
|
259
|
-
|
|
260
|
-
// Print registered routes
|
|
261
|
-
const routes = getRouteSummary(collections);
|
|
262
|
-
console.log('\\n📍 Registered Routes:\\n');
|
|
263
|
-
|
|
264
|
-
for (const route of routes) {
|
|
265
|
-
const method = route.method.padEnd(6);
|
|
266
|
-
const path = route.path.padEnd(25);
|
|
267
|
-
console.log(\` \${method} \${path} → \${route.namespace}.\${route.procedure}\`);
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
console.log(\`\\n\${divider}\`);
|
|
271
|
-
console.log(\` Frontend: http://localhost:\${config.port}\`);
|
|
272
|
-
console.log(\` REST API: http://localhost:\${config.port}\${config.apiPrefix}\`);
|
|
273
|
-
console.log(\`\${divider}\\n\`);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
async function main() {
|
|
277
|
-
try {
|
|
278
|
-
const { app, collections } = await createApp();
|
|
279
|
-
await app.start();
|
|
280
|
-
printBanner(collections);
|
|
281
|
-
} catch (error) {
|
|
282
|
-
console.error('Failed to start application:', error);
|
|
283
|
-
process.exit(1);
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
main();
|
|
288
|
-
`;
|
|
289
|
-
}
|
|
290
|
-
export function generateConfigIndex() {
|
|
291
|
-
return `/**
|
|
292
|
-
* Configuration Exports
|
|
293
|
-
*/
|
|
294
|
-
|
|
295
|
-
export * from './app.js';
|
|
296
|
-
`;
|
|
297
|
-
}
|
|
298
|
-
export function generateConfigApp() {
|
|
299
|
-
return `/**
|
|
300
|
-
* Application Configuration
|
|
301
|
-
*/
|
|
302
|
-
|
|
303
|
-
export interface AppConfig {
|
|
304
|
-
port: number;
|
|
305
|
-
host: string;
|
|
306
|
-
logger: boolean;
|
|
307
|
-
apiPrefix: string;
|
|
308
|
-
env: 'development' | 'production' | 'test';
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
export function createConfig(): AppConfig {
|
|
312
|
-
return {
|
|
313
|
-
port: Number(process.env.PORT) || 3000,
|
|
314
|
-
host: process.env.HOST || '0.0.0.0',
|
|
315
|
-
logger: process.env.LOG_LEVEL !== 'silent',
|
|
316
|
-
apiPrefix: process.env.API_PREFIX || '/api',
|
|
317
|
-
env: (process.env.NODE_ENV as AppConfig['env']) || 'development',
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
export const config = createConfig();
|
|
322
|
-
`;
|
|
323
|
-
}
|
|
324
|
-
export function generateDatabaseIndex() {
|
|
325
|
-
return `/**
|
|
326
|
-
* Database Client (Prisma 7.x)
|
|
327
|
-
*
|
|
328
|
-
* Prisma 7 requires:
|
|
329
|
-
* - Generated client from custom output path
|
|
330
|
-
* - Driver adapter for database connections
|
|
331
|
-
*/
|
|
332
|
-
|
|
333
|
-
import { PrismaClient } from '../generated/prisma/client.js';
|
|
334
|
-
import { PrismaBetterSqlite3 } from '@prisma/adapter-better-sqlite3';
|
|
335
|
-
|
|
336
|
-
// Create SQLite adapter with database URL from environment
|
|
337
|
-
const adapter = new PrismaBetterSqlite3({ url: process.env.DATABASE_URL! });
|
|
338
|
-
|
|
339
|
-
// Export configured Prisma client
|
|
340
|
-
export const prisma = new PrismaClient({ adapter });
|
|
341
|
-
`;
|
|
342
|
-
}
|
|
343
|
-
export function generateProceduresIndex() {
|
|
344
|
-
return `/**
|
|
345
|
-
* Procedure Exports
|
|
346
|
-
*/
|
|
347
|
-
|
|
348
|
-
export * from './health.js';
|
|
349
|
-
export * from './users.js';
|
|
350
|
-
`;
|
|
351
|
-
}
|
|
352
|
-
export function generateHealthProcedures() {
|
|
353
|
-
return `/**
|
|
354
|
-
* Health Check Procedures
|
|
355
|
-
*/
|
|
356
|
-
|
|
357
|
-
import { VELOX_VERSION } from '@veloxts/core';
|
|
358
|
-
import { defineProcedures, procedure } from '@veloxts/router';
|
|
359
|
-
import { z } from 'zod';
|
|
360
|
-
|
|
361
|
-
export const healthProcedures = defineProcedures('health', {
|
|
362
|
-
getHealth: procedure()
|
|
363
|
-
.rest({ method: 'GET', path: '/health' })
|
|
364
|
-
.output(
|
|
365
|
-
z.object({
|
|
366
|
-
status: z.literal('ok'),
|
|
367
|
-
version: z.string(),
|
|
368
|
-
timestamp: z.string().datetime(),
|
|
369
|
-
uptime: z.number(),
|
|
370
|
-
})
|
|
371
|
-
)
|
|
372
|
-
.query(async () => ({
|
|
373
|
-
status: 'ok' as const,
|
|
374
|
-
version: VELOX_VERSION,
|
|
375
|
-
timestamp: new Date().toISOString(),
|
|
376
|
-
uptime: process.uptime(),
|
|
377
|
-
})),
|
|
378
|
-
});
|
|
379
|
-
`;
|
|
380
|
-
}
|
|
381
|
-
export function generateUserProcedures() {
|
|
382
|
-
return `/**
|
|
383
|
-
* User Procedures
|
|
384
|
-
*/
|
|
385
|
-
|
|
386
|
-
import { defineProcedures, procedure } from '@veloxts/router';
|
|
387
|
-
import { paginationInputSchema } from '@veloxts/validation';
|
|
388
|
-
import { z } from 'zod';
|
|
389
|
-
|
|
390
|
-
import { CreateUserInput, UserSchema } from '../schemas/user.js';
|
|
391
|
-
|
|
392
|
-
// Database types
|
|
393
|
-
interface DbUser {
|
|
394
|
-
id: string;
|
|
395
|
-
name: string;
|
|
396
|
-
email: string;
|
|
397
|
-
createdAt: Date;
|
|
398
|
-
updatedAt: Date;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
interface DbClient {
|
|
402
|
-
user: {
|
|
403
|
-
findUnique: (args: { where: { id: string } }) => Promise<DbUser | null>;
|
|
404
|
-
findMany: (args?: { skip?: number; take?: number }) => Promise<DbUser[]>;
|
|
405
|
-
create: (args: { data: { name: string; email: string } }) => Promise<DbUser>;
|
|
406
|
-
count: () => Promise<number>;
|
|
407
|
-
};
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
function getDb(ctx: { db: unknown }): DbClient {
|
|
411
|
-
return ctx.db as DbClient;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
function toUserResponse(dbUser: DbUser) {
|
|
415
|
-
return {
|
|
416
|
-
id: dbUser.id,
|
|
417
|
-
name: dbUser.name,
|
|
418
|
-
email: dbUser.email,
|
|
419
|
-
createdAt: dbUser.createdAt.toISOString(),
|
|
420
|
-
updatedAt: dbUser.updatedAt.toISOString(),
|
|
421
|
-
};
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
export const userProcedures = defineProcedures('users', {
|
|
425
|
-
getUser: procedure()
|
|
426
|
-
.input(z.object({ id: z.string().uuid() }))
|
|
427
|
-
.output(UserSchema.nullable())
|
|
428
|
-
.query(async ({ input, ctx }) => {
|
|
429
|
-
const db = getDb(ctx);
|
|
430
|
-
const user = await db.user.findUnique({ where: { id: input.id } });
|
|
431
|
-
return user ? toUserResponse(user) : null;
|
|
432
|
-
}),
|
|
433
|
-
|
|
434
|
-
listUsers: procedure()
|
|
435
|
-
.input(paginationInputSchema.optional())
|
|
436
|
-
.output(
|
|
437
|
-
z.object({
|
|
438
|
-
data: z.array(UserSchema),
|
|
439
|
-
meta: z.object({
|
|
440
|
-
page: z.number(),
|
|
441
|
-
limit: z.number(),
|
|
442
|
-
total: z.number(),
|
|
443
|
-
}),
|
|
444
|
-
})
|
|
445
|
-
)
|
|
446
|
-
.query(async ({ input, ctx }) => {
|
|
447
|
-
const db = getDb(ctx);
|
|
448
|
-
const page = input?.page ?? 1;
|
|
449
|
-
const limit = input?.limit ?? 10;
|
|
450
|
-
const skip = (page - 1) * limit;
|
|
451
|
-
|
|
452
|
-
const [dbUsers, total] = await Promise.all([
|
|
453
|
-
db.user.findMany({ skip, take: limit }),
|
|
454
|
-
db.user.count(),
|
|
455
|
-
]);
|
|
456
|
-
|
|
457
|
-
return {
|
|
458
|
-
data: dbUsers.map(toUserResponse),
|
|
459
|
-
meta: { page, limit, total },
|
|
460
|
-
};
|
|
461
|
-
}),
|
|
462
|
-
|
|
463
|
-
createUser: procedure()
|
|
464
|
-
.input(CreateUserInput)
|
|
465
|
-
.output(UserSchema)
|
|
466
|
-
.mutation(async ({ input, ctx }) => {
|
|
467
|
-
const db = getDb(ctx);
|
|
468
|
-
const user = await db.user.create({ data: input });
|
|
469
|
-
return toUserResponse(user);
|
|
470
|
-
}),
|
|
471
|
-
});
|
|
472
|
-
`;
|
|
473
|
-
}
|
|
474
|
-
export function generateSchemasIndex() {
|
|
475
|
-
return `/**
|
|
476
|
-
* Schema Exports
|
|
477
|
-
*/
|
|
478
|
-
|
|
479
|
-
export * from './user.js';
|
|
480
|
-
`;
|
|
481
|
-
}
|
|
482
|
-
export function generateUserSchema() {
|
|
483
|
-
return `/**
|
|
484
|
-
* User Schemas
|
|
485
|
-
*/
|
|
486
|
-
|
|
487
|
-
import { createIdSchema, emailSchema } from '@veloxts/validation';
|
|
488
|
-
import { z } from 'zod';
|
|
489
|
-
|
|
490
|
-
export const UserSchema = z.object({
|
|
491
|
-
id: createIdSchema('uuid'),
|
|
492
|
-
name: z.string().min(1).max(100),
|
|
493
|
-
email: emailSchema,
|
|
494
|
-
createdAt: z.coerce.date().transform((d) => d.toISOString()),
|
|
495
|
-
updatedAt: z.coerce.date().transform((d) => d.toISOString()),
|
|
496
|
-
});
|
|
497
|
-
|
|
498
|
-
export type User = z.infer<typeof UserSchema>;
|
|
499
|
-
|
|
500
|
-
export const CreateUserInput = z.object({
|
|
501
|
-
name: z.string().min(1).max(100),
|
|
502
|
-
email: emailSchema,
|
|
503
|
-
});
|
|
504
|
-
|
|
505
|
-
export type CreateUserData = z.infer<typeof CreateUserInput>;
|
|
506
|
-
`;
|
|
507
|
-
}
|
|
508
|
-
export function generateIndexHtml() {
|
|
509
|
-
return `<!DOCTYPE html>
|
|
510
|
-
<html lang="en">
|
|
511
|
-
<head>
|
|
512
|
-
<meta charset="UTF-8">
|
|
513
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
514
|
-
<title>VeloxTS App</title>
|
|
515
|
-
<style>
|
|
516
|
-
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
517
|
-
body { font-family: system-ui, sans-serif; background: #f5f5f5; padding: 20px; }
|
|
518
|
-
.container { max-width: 800px; margin: 0 auto; }
|
|
519
|
-
h1 { margin-bottom: 20px; color: #333; }
|
|
520
|
-
.card { background: white; border-radius: 8px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
|
|
521
|
-
.card h2 { margin-bottom: 15px; color: #555; font-size: 1.1rem; }
|
|
522
|
-
button { background: #007bff; color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; }
|
|
523
|
-
button:hover { background: #0056b3; }
|
|
524
|
-
</style>
|
|
525
|
-
</head>
|
|
526
|
-
<body>
|
|
527
|
-
<div class="container">
|
|
528
|
-
<h1>Welcome to VeloxTS</h1>
|
|
529
|
-
<div class="card">
|
|
530
|
-
<h2>Your app is running!</h2>
|
|
531
|
-
<p>Visit <code>/api/health</code> to check the API status.</p>
|
|
532
|
-
<p>Visit <code>/api/users</code> to see the users endpoint.</p>
|
|
533
|
-
</div>
|
|
534
|
-
</div>
|
|
535
|
-
</body>
|
|
536
|
-
</html>
|
|
537
|
-
`;
|
|
538
|
-
}
|
|
539
|
-
export function generateReadme(projectName) {
|
|
540
|
-
return `# ${projectName}
|
|
541
|
-
|
|
542
|
-
A VeloxTS application - Laravel-inspired TypeScript full-stack framework.
|
|
543
|
-
|
|
544
|
-
## Getting Started
|
|
545
|
-
|
|
546
|
-
### Install Dependencies
|
|
547
|
-
|
|
548
|
-
\`\`\`bash
|
|
549
|
-
pnpm install
|
|
550
|
-
\`\`\`
|
|
551
|
-
|
|
552
|
-
### Setup Database
|
|
553
|
-
|
|
554
|
-
\`\`\`bash
|
|
555
|
-
pnpm db:push
|
|
556
|
-
\`\`\`
|
|
557
|
-
|
|
558
|
-
### Start Development Server
|
|
559
|
-
|
|
560
|
-
\`\`\`bash
|
|
561
|
-
pnpm dev
|
|
562
|
-
\`\`\`
|
|
563
|
-
|
|
564
|
-
The app will start at http://localhost:3210
|
|
565
|
-
|
|
566
|
-
## Project Structure
|
|
567
|
-
|
|
568
|
-
\`\`\`
|
|
569
|
-
src/
|
|
570
|
-
├── config/ # Application configuration
|
|
571
|
-
├── database/ # Database client
|
|
572
|
-
├── procedures/ # API procedures (business logic)
|
|
573
|
-
├── schemas/ # Zod validation schemas
|
|
574
|
-
└── index.ts # Application entry point
|
|
575
|
-
\`\`\`
|
|
576
|
-
|
|
577
|
-
## Available Scripts
|
|
578
|
-
|
|
579
|
-
- \`pnpm dev\` - Start development server with hot reload
|
|
580
|
-
- \`pnpm build\` - Build for production
|
|
581
|
-
- \`pnpm start\` - Start production server
|
|
582
|
-
- \`pnpm db:push\` - Sync database schema
|
|
583
|
-
- \`pnpm db:studio\` - Open Prisma Studio
|
|
584
|
-
|
|
585
|
-
## Learn More
|
|
586
|
-
|
|
587
|
-
- [VeloxTS Documentation](https://veloxts.dev)
|
|
588
|
-
- [TypeScript](https://www.typescriptlang.org/)
|
|
589
|
-
- [Fastify](https://fastify.dev/)
|
|
590
|
-
- [Prisma](https://www.prisma.io/)
|
|
591
|
-
|
|
592
|
-
## License
|
|
593
|
-
|
|
594
|
-
MIT
|
|
595
|
-
`;
|
|
596
|
-
}
|
|
597
|
-
//# sourceMappingURL=templates.js.map
|
package/dist/templates.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,+EAA+E;AAC/E,wBAAwB;AACxB,+EAA+E;AAE/E,MAAM,UAAU,mBAAmB,CAAC,QAAyB;IAC3D,OAAO,IAAI,CAAC,SAAS,CACnB;QACE,IAAI,EAAE,QAAQ,CAAC,WAAW;QAC1B,OAAO,EAAE,OAAO;QAChB,WAAW,EAAE,uBAAuB;QACpC,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,eAAe;QAC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