create-velox-app 0.6.29 → 0.6.51
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/CHANGELOG.md +132 -0
- package/GUIDE.md +230 -0
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +14 -5
- package/dist/templates/auth.d.ts +0 -1
- package/dist/templates/auth.js +10 -1
- package/dist/templates/compiler.d.ts +0 -1
- package/dist/templates/compiler.js +0 -1
- package/dist/templates/index.d.ts +0 -1
- package/dist/templates/index.js +30 -2
- package/dist/templates/placeholders.d.ts +6 -1
- package/dist/templates/placeholders.js +55 -1
- package/dist/templates/rsc-auth.d.ts +12 -0
- package/dist/templates/rsc-auth.js +208 -0
- package/dist/templates/rsc.d.ts +0 -1
- package/dist/templates/rsc.js +40 -2
- package/dist/templates/shared/css-generator.d.ts +26 -0
- package/dist/templates/shared/css-generator.js +553 -0
- package/dist/templates/shared/index.d.ts +3 -1
- package/dist/templates/shared/index.js +3 -1
- package/dist/templates/shared/root.d.ts +0 -1
- package/dist/templates/shared/root.js +11 -2
- package/dist/templates/shared/rsc-styles.d.ts +54 -0
- package/dist/templates/shared/rsc-styles.js +68 -0
- package/dist/templates/shared/theme.d.ts +133 -0
- package/dist/templates/shared/theme.js +141 -0
- package/dist/templates/shared/web-base.d.ts +0 -1
- package/dist/templates/shared/web-base.js +0 -1
- package/dist/templates/shared/web-styles.d.ts +0 -1
- package/dist/templates/shared/web-styles.js +0 -1
- package/dist/templates/shared.d.ts +0 -1
- package/dist/templates/shared.js +0 -1
- package/dist/templates/spa.d.ts +0 -1
- package/dist/templates/spa.js +10 -1
- package/dist/templates/trpc.d.ts +0 -1
- package/dist/templates/trpc.js +10 -1
- package/dist/templates/types.d.ts +2 -2
- package/dist/templates/types.js +6 -1
- package/package.json +6 -3
- package/src/templates/source/api/config/database.ts +13 -32
- package/src/templates/source/api/docker-compose.yml +21 -0
- package/src/templates/source/root/CLAUDE.auth.md +6 -0
- package/src/templates/source/root/CLAUDE.default.md +6 -0
- package/src/templates/source/root/package.json +6 -6
- package/src/templates/source/rsc/CLAUDE.md +56 -2
- package/src/templates/source/rsc/app/actions/posts.ts +1 -1
- package/src/templates/source/rsc/app/actions/users.ts +111 -20
- package/src/templates/source/rsc/app/layouts/dashboard.tsx +21 -16
- package/src/templates/source/rsc/app/layouts/marketing.tsx +34 -0
- package/src/templates/source/rsc/app/layouts/minimal-content.tsx +21 -0
- package/src/templates/source/rsc/app/layouts/minimal.tsx +86 -5
- package/src/templates/source/rsc/app/layouts/root.tsx +148 -44
- package/src/templates/source/rsc/docker-compose.yml +21 -0
- package/src/templates/source/rsc/package.json +3 -3
- package/src/templates/source/rsc/src/api/database.ts +13 -32
- package/src/templates/source/rsc/src/api/handler.ts +1 -1
- package/src/templates/source/rsc/src/entry.client.tsx +65 -18
- package/src/templates/source/rsc-auth/CLAUDE.md +230 -0
- package/src/templates/source/rsc-auth/app/actions/auth.ts +112 -0
- package/src/templates/source/rsc-auth/app/actions/users.ts +289 -0
- package/src/templates/source/rsc-auth/app/layouts/dashboard.tsx +132 -0
- package/src/templates/source/rsc-auth/app/layouts/marketing.tsx +59 -0
- package/src/templates/source/rsc-auth/app/layouts/minimal-content.tsx +21 -0
- package/src/templates/source/rsc-auth/app/layouts/minimal.tsx +111 -0
- package/src/templates/source/rsc-auth/app/layouts/root.tsx +355 -0
- package/src/templates/source/rsc-auth/app/pages/_not-found.tsx +15 -0
- package/src/templates/source/rsc-auth/app/pages/auth/login.tsx +198 -0
- package/src/templates/source/rsc-auth/app/pages/auth/register.tsx +225 -0
- package/src/templates/source/rsc-auth/app/pages/dashboard/index.tsx +267 -0
- package/src/templates/source/rsc-auth/app/pages/index.tsx +83 -0
- package/src/templates/source/rsc-auth/app/pages/users.tsx +47 -0
- package/src/templates/source/rsc-auth/app.config.ts +12 -0
- package/src/templates/source/rsc-auth/docker-compose.yml +21 -0
- package/src/templates/source/rsc-auth/env.example +11 -0
- package/src/templates/source/rsc-auth/gitignore +34 -0
- package/src/templates/source/rsc-auth/package.json +44 -0
- package/src/templates/source/rsc-auth/prisma/schema.prisma +23 -0
- package/src/templates/source/rsc-auth/prisma.config.ts +22 -0
- package/src/templates/source/rsc-auth/public/favicon.svg +4 -0
- package/src/templates/source/rsc-auth/src/api/database.ts +129 -0
- package/src/templates/source/rsc-auth/src/api/handler.ts +85 -0
- package/src/templates/source/rsc-auth/src/api/procedures/auth.ts +262 -0
- package/src/templates/source/rsc-auth/src/api/procedures/health.ts +48 -0
- package/src/templates/source/rsc-auth/src/api/procedures/users.ts +87 -0
- package/src/templates/source/rsc-auth/src/api/schemas/auth.ts +79 -0
- package/src/templates/source/rsc-auth/src/api/schemas/user.ts +38 -0
- package/src/templates/source/rsc-auth/src/api/utils/auth.ts +157 -0
- package/src/templates/source/rsc-auth/src/entry.client.tsx +63 -0
- package/src/templates/source/rsc-auth/src/entry.server.tsx +262 -0
- package/src/templates/source/rsc-auth/tsconfig.json +24 -0
- package/src/templates/source/shared/scripts/check-client-imports.sh +75 -0
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/templates/auth.d.ts.map +0 -1
- package/dist/templates/auth.js.map +0 -1
- package/dist/templates/compiler.d.ts.map +0 -1
- package/dist/templates/compiler.js.map +0 -1
- package/dist/templates/default.d.ts +0 -12
- package/dist/templates/default.d.ts.map +0 -1
- package/dist/templates/default.js +0 -85
- package/dist/templates/default.js.map +0 -1
- package/dist/templates/fullstack.d.ts +0 -15
- package/dist/templates/fullstack.d.ts.map +0 -1
- package/dist/templates/fullstack.js +0 -110
- package/dist/templates/fullstack.js.map +0 -1
- package/dist/templates/index.d.ts.map +0 -1
- package/dist/templates/index.js.map +0 -1
- package/dist/templates/placeholders.d.ts.map +0 -1
- package/dist/templates/placeholders.js.map +0 -1
- package/dist/templates/rsc.d.ts.map +0 -1
- package/dist/templates/rsc.js.map +0 -1
- package/dist/templates/shared/index.d.ts.map +0 -1
- package/dist/templates/shared/index.js.map +0 -1
- package/dist/templates/shared/root.d.ts.map +0 -1
- package/dist/templates/shared/root.js.map +0 -1
- package/dist/templates/shared/web-base.d.ts.map +0 -1
- package/dist/templates/shared/web-base.js.map +0 -1
- package/dist/templates/shared/web-styles.d.ts.map +0 -1
- package/dist/templates/shared/web-styles.js.map +0 -1
- package/dist/templates/shared.d.ts.map +0 -1
- package/dist/templates/shared.js.map +0 -1
- package/dist/templates/source/api/config/app.d.ts +0 -13
- package/dist/templates/source/api/config/app.d.ts.map +0 -1
- package/dist/templates/source/api/config/app.js +0 -14
- package/dist/templates/source/api/config/app.js.map +0 -1
- package/dist/templates/source/api/config/auth.d.ts +0 -34
- package/dist/templates/source/api/config/auth.d.ts.map +0 -1
- package/dist/templates/source/api/config/auth.js +0 -165
- package/dist/templates/source/api/config/auth.js.map +0 -1
- package/dist/templates/source/api/config/index.auth.d.ts +0 -6
- package/dist/templates/source/api/config/index.auth.d.ts.map +0 -1
- package/dist/templates/source/api/config/index.auth.js +0 -6
- package/dist/templates/source/api/config/index.auth.js.map +0 -1
- package/dist/templates/source/api/config/index.default.d.ts +0 -5
- package/dist/templates/source/api/config/index.default.d.ts.map +0 -1
- package/dist/templates/source/api/config/index.default.js +0 -5
- package/dist/templates/source/api/config/index.default.js.map +0 -1
- package/dist/templates/source/api/database/index.d.ts +0 -9
- package/dist/templates/source/api/database/index.d.ts.map +0 -1
- package/dist/templates/source/api/database/index.js +0 -18
- package/dist/templates/source/api/database/index.js.map +0 -1
- package/dist/templates/source/api/index.auth.d.ts +0 -5
- package/dist/templates/source/api/index.auth.d.ts.map +0 -1
- package/dist/templates/source/api/index.auth.js +0 -59
- package/dist/templates/source/api/index.auth.js.map +0 -1
- package/dist/templates/source/api/index.default.d.ts +0 -5
- package/dist/templates/source/api/index.default.d.ts.map +0 -1
- package/dist/templates/source/api/index.default.js +0 -56
- package/dist/templates/source/api/index.default.js.map +0 -1
- package/dist/templates/source/api/prisma.config.d.ts +0 -9
- package/dist/templates/source/api/prisma.config.d.ts.map +0 -1
- package/dist/templates/source/api/prisma.config.js +0 -15
- package/dist/templates/source/api/prisma.config.js.map +0 -1
- package/dist/templates/source/api/procedures/auth.d.ts +0 -14
- package/dist/templates/source/api/procedures/auth.d.ts.map +0 -1
- package/dist/templates/source/api/procedures/auth.js +0 -221
- package/dist/templates/source/api/procedures/auth.js.map +0 -1
- package/dist/templates/source/api/procedures/health.d.ts +0 -5
- package/dist/templates/source/api/procedures/health.d.ts.map +0 -1
- package/dist/templates/source/api/procedures/health.js +0 -21
- package/dist/templates/source/api/procedures/health.js.map +0 -1
- package/dist/templates/source/api/procedures/index.auth.d.ts +0 -7
- package/dist/templates/source/api/procedures/index.auth.d.ts.map +0 -1
- package/dist/templates/source/api/procedures/index.auth.js +0 -7
- package/dist/templates/source/api/procedures/index.auth.js.map +0 -1
- package/dist/templates/source/api/procedures/index.default.d.ts +0 -6
- package/dist/templates/source/api/procedures/index.default.d.ts.map +0 -1
- package/dist/templates/source/api/procedures/index.default.js +0 -6
- package/dist/templates/source/api/procedures/index.default.js.map +0 -1
- package/dist/templates/source/api/procedures/users.auth.d.ts +0 -7
- package/dist/templates/source/api/procedures/users.auth.d.ts.map +0 -1
- package/dist/templates/source/api/procedures/users.auth.js +0 -111
- package/dist/templates/source/api/procedures/users.auth.js.map +0 -1
- package/dist/templates/source/api/procedures/users.default.d.ts +0 -5
- package/dist/templates/source/api/procedures/users.default.d.ts.map +0 -1
- package/dist/templates/source/api/procedures/users.default.js +0 -86
- package/dist/templates/source/api/procedures/users.default.js.map +0 -1
- package/dist/templates/source/api/schemas/index.d.ts +0 -5
- package/dist/templates/source/api/schemas/index.d.ts.map +0 -1
- package/dist/templates/source/api/schemas/index.js +0 -5
- package/dist/templates/source/api/schemas/index.js.map +0 -1
- package/dist/templates/source/api/schemas/user.d.ts +0 -11
- package/dist/templates/source/api/schemas/user.d.ts.map +0 -1
- package/dist/templates/source/api/schemas/user.js +0 -20
- package/dist/templates/source/api/schemas/user.js.map +0 -1
- package/dist/templates/source/api/tsup.config.d.ts +0 -3
- package/dist/templates/source/api/tsup.config.d.ts.map +0 -1
- package/dist/templates/source/api/tsup.config.js +0 -10
- package/dist/templates/source/api/tsup.config.js.map +0 -1
- package/dist/templates/source/web/main.d.ts +0 -9
- package/dist/templates/source/web/main.d.ts.map +0 -1
- package/dist/templates/source/web/main.js +0 -27
- package/dist/templates/source/web/main.js.map +0 -1
- package/dist/templates/source/web/routes/__root.d.ts +0 -2
- package/dist/templates/source/web/routes/__root.d.ts.map +0 -1
- package/dist/templates/source/web/routes/__root.js +0 -28
- package/dist/templates/source/web/routes/__root.js.map +0 -1
- package/dist/templates/source/web/routes/about.d.ts +0 -2
- package/dist/templates/source/web/routes/about.d.ts.map +0 -1
- package/dist/templates/source/web/routes/about.js +0 -33
- package/dist/templates/source/web/routes/about.js.map +0 -1
- package/dist/templates/source/web/routes/index.auth.d.ts +0 -2
- package/dist/templates/source/web/routes/index.auth.d.ts.map +0 -1
- package/dist/templates/source/web/routes/index.auth.js +0 -159
- package/dist/templates/source/web/routes/index.auth.js.map +0 -1
- package/dist/templates/source/web/routes/index.default.d.ts +0 -2
- package/dist/templates/source/web/routes/index.default.d.ts.map +0 -1
- package/dist/templates/source/web/routes/index.default.js +0 -60
- package/dist/templates/source/web/routes/index.default.js.map +0 -1
- package/dist/templates/source/web/vite.config.d.ts +0 -3
- package/dist/templates/source/web/vite.config.d.ts.map +0 -1
- package/dist/templates/source/web/vite.config.js +0 -22
- package/dist/templates/source/web/vite.config.js.map +0 -1
- package/dist/templates/spa.d.ts.map +0 -1
- package/dist/templates/spa.js.map +0 -1
- package/dist/templates/trpc.d.ts.map +0 -1
- package/dist/templates/trpc.js.map +0 -1
- package/dist/templates/types.d.ts.map +0 -1
- package/dist/templates/types.js.map +0 -1
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RSC Auth Template (React Server Components + Authentication)
|
|
3
|
+
*
|
|
4
|
+
* Full-stack application with:
|
|
5
|
+
* - React Server Components (RSC) with Vinxi
|
|
6
|
+
* - JWT Authentication via @veloxts/auth
|
|
7
|
+
* - Validated server actions with security features
|
|
8
|
+
* - File-based routing with auth pages
|
|
9
|
+
* - Embedded Fastify API at /api/*
|
|
10
|
+
*/
|
|
11
|
+
import fs from 'node:fs';
|
|
12
|
+
import path from 'node:path';
|
|
13
|
+
import { fileURLToPath } from 'node:url';
|
|
14
|
+
import { compileTemplate } from './compiler.js';
|
|
15
|
+
import { applyDatabaseDependencies, RSC_CONFIG } from './placeholders.js';
|
|
16
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
17
|
+
const __dirname = path.dirname(__filename);
|
|
18
|
+
/**
|
|
19
|
+
* Read shared script from templates/source/shared/scripts/
|
|
20
|
+
*/
|
|
21
|
+
function readSharedScript(scriptName) {
|
|
22
|
+
// Try dist path first (production), then src path (development)
|
|
23
|
+
const distPath = path.join(__dirname, '..', '..', 'src', 'templates', 'source', 'shared', 'scripts', scriptName);
|
|
24
|
+
const srcPath = path.join(__dirname, 'source', 'shared', 'scripts', scriptName);
|
|
25
|
+
for (const scriptPath of [distPath, srcPath]) {
|
|
26
|
+
if (fs.existsSync(scriptPath)) {
|
|
27
|
+
return fs.readFileSync(scriptPath, 'utf-8');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
throw new Error(`Shared script not found: ${scriptName}. Checked:\n - ${distPath}\n - ${srcPath}`);
|
|
31
|
+
}
|
|
32
|
+
// ============================================================================
|
|
33
|
+
// Template Compilation
|
|
34
|
+
// ============================================================================
|
|
35
|
+
function generatePackageJson(config) {
|
|
36
|
+
const content = compileTemplate('rsc-auth/package.json', config);
|
|
37
|
+
return applyDatabaseDependencies(content, config);
|
|
38
|
+
}
|
|
39
|
+
function generateAppConfig() {
|
|
40
|
+
return compileTemplate('rsc-auth/app.config.ts', RSC_CONFIG);
|
|
41
|
+
}
|
|
42
|
+
function generateTsConfig() {
|
|
43
|
+
return compileTemplate('rsc-auth/tsconfig.json', RSC_CONFIG);
|
|
44
|
+
}
|
|
45
|
+
function generateEnvExample(config) {
|
|
46
|
+
return compileTemplate('rsc-auth/env.example', config);
|
|
47
|
+
}
|
|
48
|
+
function generateGitignore() {
|
|
49
|
+
return compileTemplate('rsc-auth/gitignore', RSC_CONFIG);
|
|
50
|
+
}
|
|
51
|
+
function generateClaudeMd(config) {
|
|
52
|
+
return compileTemplate('rsc-auth/CLAUDE.md', config);
|
|
53
|
+
}
|
|
54
|
+
// Prisma
|
|
55
|
+
function generatePrismaSchema(config) {
|
|
56
|
+
return compileTemplate('rsc-auth/prisma/schema.prisma', config);
|
|
57
|
+
}
|
|
58
|
+
function generatePrismaConfig() {
|
|
59
|
+
return compileTemplate('rsc-auth/prisma.config.ts', RSC_CONFIG);
|
|
60
|
+
}
|
|
61
|
+
// App layer (RSC) - Pages
|
|
62
|
+
function generateHomePage() {
|
|
63
|
+
return compileTemplate('rsc-auth/app/pages/index.tsx', RSC_CONFIG);
|
|
64
|
+
}
|
|
65
|
+
function generateUsersPage() {
|
|
66
|
+
return compileTemplate('rsc-auth/app/pages/users.tsx', RSC_CONFIG);
|
|
67
|
+
}
|
|
68
|
+
function generateNotFoundPage() {
|
|
69
|
+
return compileTemplate('rsc-auth/app/pages/_not-found.tsx', RSC_CONFIG);
|
|
70
|
+
}
|
|
71
|
+
// Auth pages
|
|
72
|
+
function generateLoginPage() {
|
|
73
|
+
return compileTemplate('rsc-auth/app/pages/auth/login.tsx', RSC_CONFIG);
|
|
74
|
+
}
|
|
75
|
+
function generateRegisterPage() {
|
|
76
|
+
return compileTemplate('rsc-auth/app/pages/auth/register.tsx', RSC_CONFIG);
|
|
77
|
+
}
|
|
78
|
+
// Dashboard pages
|
|
79
|
+
function generateDashboardPage() {
|
|
80
|
+
return compileTemplate('rsc-auth/app/pages/dashboard/index.tsx', RSC_CONFIG);
|
|
81
|
+
}
|
|
82
|
+
// Layouts
|
|
83
|
+
function generateRootLayout() {
|
|
84
|
+
return compileTemplate('rsc-auth/app/layouts/root.tsx', RSC_CONFIG);
|
|
85
|
+
}
|
|
86
|
+
function generateMarketingLayout() {
|
|
87
|
+
return compileTemplate('rsc-auth/app/layouts/marketing.tsx', RSC_CONFIG);
|
|
88
|
+
}
|
|
89
|
+
function generateMinimalLayout() {
|
|
90
|
+
return compileTemplate('rsc-auth/app/layouts/minimal.tsx', RSC_CONFIG);
|
|
91
|
+
}
|
|
92
|
+
function generateMinimalContentLayout() {
|
|
93
|
+
return compileTemplate('rsc-auth/app/layouts/minimal-content.tsx', RSC_CONFIG);
|
|
94
|
+
}
|
|
95
|
+
function generateDashboardLayout() {
|
|
96
|
+
return compileTemplate('rsc-auth/app/layouts/dashboard.tsx', RSC_CONFIG);
|
|
97
|
+
}
|
|
98
|
+
// Actions
|
|
99
|
+
function generateUserActions() {
|
|
100
|
+
return compileTemplate('rsc-auth/app/actions/users.ts', RSC_CONFIG);
|
|
101
|
+
}
|
|
102
|
+
function generateAuthActions() {
|
|
103
|
+
return compileTemplate('rsc-auth/app/actions/auth.ts', RSC_CONFIG);
|
|
104
|
+
}
|
|
105
|
+
// Source layer - Entry points
|
|
106
|
+
function generateEntryClient() {
|
|
107
|
+
return compileTemplate('rsc-auth/src/entry.client.tsx', RSC_CONFIG);
|
|
108
|
+
}
|
|
109
|
+
function generateEntryServer() {
|
|
110
|
+
return compileTemplate('rsc-auth/src/entry.server.tsx', RSC_CONFIG);
|
|
111
|
+
}
|
|
112
|
+
// Source layer - API
|
|
113
|
+
function generateApiHandler() {
|
|
114
|
+
return compileTemplate('rsc-auth/src/api/handler.ts', RSC_CONFIG);
|
|
115
|
+
}
|
|
116
|
+
function generateDatabase(config) {
|
|
117
|
+
return compileTemplate('rsc-auth/src/api/database.ts', config);
|
|
118
|
+
}
|
|
119
|
+
function generateHealthProcedures() {
|
|
120
|
+
return compileTemplate('rsc-auth/src/api/procedures/health.ts', RSC_CONFIG);
|
|
121
|
+
}
|
|
122
|
+
function generateUserProcedures() {
|
|
123
|
+
return compileTemplate('rsc-auth/src/api/procedures/users.ts', RSC_CONFIG);
|
|
124
|
+
}
|
|
125
|
+
function generateAuthProcedures() {
|
|
126
|
+
return compileTemplate('rsc-auth/src/api/procedures/auth.ts', RSC_CONFIG);
|
|
127
|
+
}
|
|
128
|
+
// Schemas
|
|
129
|
+
function generateUserSchemas() {
|
|
130
|
+
return compileTemplate('rsc-auth/src/api/schemas/user.ts', RSC_CONFIG);
|
|
131
|
+
}
|
|
132
|
+
function generateAuthSchemas() {
|
|
133
|
+
return compileTemplate('rsc-auth/src/api/schemas/auth.ts', RSC_CONFIG);
|
|
134
|
+
}
|
|
135
|
+
// Utils
|
|
136
|
+
function generateAuthUtils() {
|
|
137
|
+
return compileTemplate('rsc-auth/src/api/utils/auth.ts', RSC_CONFIG);
|
|
138
|
+
}
|
|
139
|
+
// Public assets
|
|
140
|
+
function generateFavicon() {
|
|
141
|
+
return compileTemplate('rsc-auth/public/favicon.svg', RSC_CONFIG);
|
|
142
|
+
}
|
|
143
|
+
function generateDockerCompose(config) {
|
|
144
|
+
return compileTemplate('rsc-auth/docker-compose.yml', config);
|
|
145
|
+
}
|
|
146
|
+
// ============================================================================
|
|
147
|
+
// RSC Auth Template Generator
|
|
148
|
+
// ============================================================================
|
|
149
|
+
export function generateRscAuthTemplate(config) {
|
|
150
|
+
const files = [
|
|
151
|
+
// Root configuration
|
|
152
|
+
{ path: 'package.json', content: generatePackageJson(config) },
|
|
153
|
+
{ path: 'app.config.ts', content: generateAppConfig() },
|
|
154
|
+
{ path: 'tsconfig.json', content: generateTsConfig() },
|
|
155
|
+
{ path: '.env.example', content: generateEnvExample(config) },
|
|
156
|
+
{ path: '.env', content: generateEnvExample(config) },
|
|
157
|
+
{ path: '.gitignore', content: generateGitignore() },
|
|
158
|
+
{ path: 'CLAUDE.md', content: generateClaudeMd(config) },
|
|
159
|
+
// Prisma
|
|
160
|
+
{ path: 'prisma/schema.prisma', content: generatePrismaSchema(config) },
|
|
161
|
+
{ path: 'prisma.config.ts', content: generatePrismaConfig() },
|
|
162
|
+
// App layer - Pages
|
|
163
|
+
{ path: 'app/pages/index.tsx', content: generateHomePage() },
|
|
164
|
+
{ path: 'app/pages/users.tsx', content: generateUsersPage() },
|
|
165
|
+
{ path: 'app/pages/_not-found.tsx', content: generateNotFoundPage() },
|
|
166
|
+
// App layer - Auth pages
|
|
167
|
+
{ path: 'app/pages/auth/login.tsx', content: generateLoginPage() },
|
|
168
|
+
{ path: 'app/pages/auth/register.tsx', content: generateRegisterPage() },
|
|
169
|
+
// App layer - Dashboard
|
|
170
|
+
{ path: 'app/pages/dashboard/index.tsx', content: generateDashboardPage() },
|
|
171
|
+
// App layer - Layouts
|
|
172
|
+
{ path: 'app/layouts/root.tsx', content: generateRootLayout() },
|
|
173
|
+
{ path: 'app/layouts/marketing.tsx', content: generateMarketingLayout() },
|
|
174
|
+
{ path: 'app/layouts/minimal.tsx', content: generateMinimalLayout() },
|
|
175
|
+
{ path: 'app/layouts/minimal-content.tsx', content: generateMinimalContentLayout() },
|
|
176
|
+
{ path: 'app/layouts/dashboard.tsx', content: generateDashboardLayout() },
|
|
177
|
+
// App layer - Actions
|
|
178
|
+
{ path: 'app/actions/users.ts', content: generateUserActions() },
|
|
179
|
+
{ path: 'app/actions/auth.ts', content: generateAuthActions() },
|
|
180
|
+
// Source layer - Entry points
|
|
181
|
+
{ path: 'src/entry.client.tsx', content: generateEntryClient() },
|
|
182
|
+
{ path: 'src/entry.server.tsx', content: generateEntryServer() },
|
|
183
|
+
// Source layer - API
|
|
184
|
+
{ path: 'src/api/handler.ts', content: generateApiHandler() },
|
|
185
|
+
{ path: 'src/api/database.ts', content: generateDatabase(config) },
|
|
186
|
+
{ path: 'src/api/procedures/health.ts', content: generateHealthProcedures() },
|
|
187
|
+
{ path: 'src/api/procedures/users.ts', content: generateUserProcedures() },
|
|
188
|
+
{ path: 'src/api/procedures/auth.ts', content: generateAuthProcedures() },
|
|
189
|
+
{ path: 'src/api/schemas/user.ts', content: generateUserSchemas() },
|
|
190
|
+
{ path: 'src/api/schemas/auth.ts', content: generateAuthSchemas() },
|
|
191
|
+
{ path: 'src/api/utils/auth.ts', content: generateAuthUtils() },
|
|
192
|
+
// Public assets
|
|
193
|
+
{ path: 'public/favicon.svg', content: generateFavicon() },
|
|
194
|
+
// Scripts
|
|
195
|
+
{
|
|
196
|
+
path: 'scripts/check-client-imports.sh',
|
|
197
|
+
content: readSharedScript('check-client-imports.sh'),
|
|
198
|
+
},
|
|
199
|
+
];
|
|
200
|
+
// Add docker-compose for PostgreSQL
|
|
201
|
+
if (config.database === 'postgresql') {
|
|
202
|
+
files.push({
|
|
203
|
+
path: 'docker-compose.yml',
|
|
204
|
+
content: generateDockerCompose(config),
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
return files;
|
|
208
|
+
}
|
package/dist/templates/rsc.d.ts
CHANGED
package/dist/templates/rsc.js
CHANGED
|
@@ -10,8 +10,27 @@
|
|
|
10
10
|
*
|
|
11
11
|
* This is a single-package structure (not a monorepo workspace).
|
|
12
12
|
*/
|
|
13
|
+
import fs from 'node:fs';
|
|
14
|
+
import path from 'node:path';
|
|
15
|
+
import { fileURLToPath } from 'node:url';
|
|
13
16
|
import { compileTemplate } from './compiler.js';
|
|
14
17
|
import { applyDatabaseDependencies, RSC_CONFIG } from './placeholders.js';
|
|
18
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
19
|
+
const __dirname = path.dirname(__filename);
|
|
20
|
+
/**
|
|
21
|
+
* Read shared script from templates/source/shared/scripts/
|
|
22
|
+
*/
|
|
23
|
+
function readSharedScript(scriptName) {
|
|
24
|
+
// Try dist path first (production), then src path (development)
|
|
25
|
+
const distPath = path.join(__dirname, '..', '..', 'src', 'templates', 'source', 'shared', 'scripts', scriptName);
|
|
26
|
+
const srcPath = path.join(__dirname, 'source', 'shared', 'scripts', scriptName);
|
|
27
|
+
for (const scriptPath of [distPath, srcPath]) {
|
|
28
|
+
if (fs.existsSync(scriptPath)) {
|
|
29
|
+
return fs.readFileSync(scriptPath, 'utf-8');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
throw new Error(`Shared script not found: ${scriptName}. Checked:\n - ${distPath}\n - ${srcPath}`);
|
|
33
|
+
}
|
|
15
34
|
// ============================================================================
|
|
16
35
|
// Template Compilation
|
|
17
36
|
// ============================================================================
|
|
@@ -60,6 +79,9 @@ function generateMarketingLayout() {
|
|
|
60
79
|
function generateMinimalLayout() {
|
|
61
80
|
return compileTemplate('rsc/app/layouts/minimal.tsx', RSC_CONFIG);
|
|
62
81
|
}
|
|
82
|
+
function generateMinimalContentLayout() {
|
|
83
|
+
return compileTemplate('rsc/app/layouts/minimal-content.tsx', RSC_CONFIG);
|
|
84
|
+
}
|
|
63
85
|
function generateAboutPage() {
|
|
64
86
|
return compileTemplate('rsc/app/pages/(marketing)/about.tsx', RSC_CONFIG);
|
|
65
87
|
}
|
|
@@ -134,11 +156,14 @@ function generatePostSchemas() {
|
|
|
134
156
|
function generateFavicon() {
|
|
135
157
|
return compileTemplate('rsc/public/favicon.svg', RSC_CONFIG);
|
|
136
158
|
}
|
|
159
|
+
function generateDockerCompose(config) {
|
|
160
|
+
return compileTemplate('rsc/docker-compose.yml', config);
|
|
161
|
+
}
|
|
137
162
|
// ============================================================================
|
|
138
163
|
// RSC Template Generator
|
|
139
164
|
// ============================================================================
|
|
140
165
|
export function generateRscTemplate(config) {
|
|
141
|
-
|
|
166
|
+
const files = [
|
|
142
167
|
// Root configuration files
|
|
143
168
|
{ path: 'package.json', content: generatePackageJson(config) },
|
|
144
169
|
{ path: 'app.config.ts', content: generateAppConfig() },
|
|
@@ -170,6 +195,7 @@ export function generateRscTemplate(config) {
|
|
|
170
195
|
{ path: 'app/layouts/root.tsx', content: generateRootLayout() },
|
|
171
196
|
{ path: 'app/layouts/marketing.tsx', content: generateMarketingLayout() },
|
|
172
197
|
{ path: 'app/layouts/minimal.tsx', content: generateMinimalLayout() },
|
|
198
|
+
{ path: 'app/layouts/minimal-content.tsx', content: generateMinimalContentLayout() },
|
|
173
199
|
{ path: 'app/layouts/dashboard.tsx', content: generateDashboardLayout() },
|
|
174
200
|
{ path: 'app/pages/users/_layout.tsx', content: generateUsersLayout() },
|
|
175
201
|
// App layer (RSC) - Server actions
|
|
@@ -188,6 +214,18 @@ export function generateRscTemplate(config) {
|
|
|
188
214
|
{ path: 'src/api/schemas/post.ts', content: generatePostSchemas() },
|
|
189
215
|
// Public assets
|
|
190
216
|
{ path: 'public/favicon.svg', content: generateFavicon() },
|
|
217
|
+
// Scripts
|
|
218
|
+
{
|
|
219
|
+
path: 'scripts/check-client-imports.sh',
|
|
220
|
+
content: readSharedScript('check-client-imports.sh'),
|
|
221
|
+
},
|
|
191
222
|
];
|
|
223
|
+
// Add docker-compose for PostgreSQL
|
|
224
|
+
if (config.database === 'postgresql') {
|
|
225
|
+
files.push({
|
|
226
|
+
path: 'docker-compose.yml',
|
|
227
|
+
content: generateDockerCompose(config),
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
return files;
|
|
192
231
|
}
|
|
193
|
-
//# sourceMappingURL=rsc.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSS Generator Functions
|
|
3
|
+
*
|
|
4
|
+
* Generates CSS strings from the theme design system.
|
|
5
|
+
* These functions provide consistent dark mode styling across all RSC templates.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Global CSS reset and base styles for dark mode
|
|
9
|
+
*/
|
|
10
|
+
export declare function generateGlobalReset(): string;
|
|
11
|
+
/**
|
|
12
|
+
* Root layout styles - Navigation, footer, and main content area
|
|
13
|
+
*/
|
|
14
|
+
export declare function generateRscRootStyles(): string;
|
|
15
|
+
/**
|
|
16
|
+
* Dashboard layout styles - Sidebar navigation
|
|
17
|
+
*/
|
|
18
|
+
export declare function generateRscDashboardStyles(): string;
|
|
19
|
+
/**
|
|
20
|
+
* Minimal layout styles - For auth pages, centered content
|
|
21
|
+
*/
|
|
22
|
+
export declare function generateRscMinimalStyles(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Marketing layout styles - Banner/badge
|
|
25
|
+
*/
|
|
26
|
+
export declare function generateRscMarketingStyles(): string;
|