create-fluxstack 1.0.18 → 1.0.20
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/core/plugins/built-in/vite/index.ts +9 -2
- package/core/utils/errors/handlers.ts +12 -0
- package/create-fluxstack.ts +129 -31
- package/package.json +1 -1
- package/package-template.json +0 -67
|
@@ -145,8 +145,15 @@ export const vitePlugin: Plugin = {
|
|
|
145
145
|
},
|
|
146
146
|
|
|
147
147
|
onBeforeRoute: async (requestContext: RequestContext) => {
|
|
148
|
-
// Skip API routes
|
|
149
|
-
if (requestContext.path.startsWith("/api") ||
|
|
148
|
+
// Skip API routes, swagger, and ALL Vite internal routes
|
|
149
|
+
if (requestContext.path.startsWith("/api") ||
|
|
150
|
+
requestContext.path.startsWith("/swagger") ||
|
|
151
|
+
requestContext.path.startsWith("/@") || // All Vite internal routes (/@vite/, /@fs/, /@react-refresh, etc.)
|
|
152
|
+
requestContext.path.startsWith("/__vite") || // Vite HMR and dev routes
|
|
153
|
+
requestContext.path.startsWith("/node_modules") || // Direct node_modules access
|
|
154
|
+
requestContext.path.includes("/.vite/") || // Vite cache and deps
|
|
155
|
+
requestContext.path.endsWith(".js.map") || // Source maps
|
|
156
|
+
requestContext.path.endsWith(".css.map")) { // CSS source maps
|
|
150
157
|
return
|
|
151
158
|
}
|
|
152
159
|
|
|
@@ -157,6 +157,18 @@ export class EnhancedErrorHandler {
|
|
|
157
157
|
return true
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
+
// Skip logging for Vite internal routes (even if NOT_FOUND logging is enabled)
|
|
161
|
+
if (error.code === 'NOT_FOUND' && error.metadata?.path) {
|
|
162
|
+
const path = error.metadata.path
|
|
163
|
+
if (path.startsWith('/@') ||
|
|
164
|
+
path.startsWith('/__vite') ||
|
|
165
|
+
path.includes('/.vite/') ||
|
|
166
|
+
path.endsWith('.js.map') ||
|
|
167
|
+
path.endsWith('.css.map')) {
|
|
168
|
+
return true
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
160
172
|
// Skip logging for rate limit errors to prevent log spam
|
|
161
173
|
if (error.code === 'RATE_LIMIT_EXCEEDED' && !process.env.ENABLE_RATE_LIMIT_LOGS) {
|
|
162
174
|
return true
|
package/create-fluxstack.ts
CHANGED
|
@@ -59,10 +59,10 @@ program
|
|
|
59
59
|
'app',
|
|
60
60
|
'ai-context', // ✅ CRITICAL: Copy AI documentation for users
|
|
61
61
|
'bun.lock', // ✅ CRITICAL: Copy lockfile to maintain working versions
|
|
62
|
+
'package.json', // ✅ Copy real package.json from framework
|
|
62
63
|
'tsconfig.json',
|
|
63
64
|
'vite.config.ts',
|
|
64
65
|
'.env.example', // ✅ Use .env.example as template
|
|
65
|
-
'.gitignore', // ✅ Git ignore file for proper repository setup
|
|
66
66
|
'CLAUDE.md', // ✅ Project instructions for AI assistants
|
|
67
67
|
'README.md'
|
|
68
68
|
]
|
|
@@ -76,37 +76,135 @@ program
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
//
|
|
80
|
-
const
|
|
81
|
-
|
|
79
|
+
// Generate .gitignore using template (instead of copying)
|
|
80
|
+
const gitignoreContent = `# Dependencies
|
|
81
|
+
node_modules/
|
|
82
|
+
.pnp
|
|
83
|
+
.pnp.js
|
|
84
|
+
|
|
85
|
+
# Production builds
|
|
86
|
+
/dist
|
|
87
|
+
/build
|
|
88
|
+
/.next/
|
|
89
|
+
/out/
|
|
90
|
+
|
|
91
|
+
# Environment variables
|
|
92
|
+
.env
|
|
93
|
+
.env.local
|
|
94
|
+
.env.development.local
|
|
95
|
+
.env.test.local
|
|
96
|
+
.env.production.local
|
|
97
|
+
|
|
98
|
+
# Logs
|
|
99
|
+
npm-debug.log*
|
|
100
|
+
yarn-debug.log*
|
|
101
|
+
yarn-error.log*
|
|
102
|
+
lerna-debug.log*
|
|
103
|
+
.pnpm-debug.log*
|
|
104
|
+
|
|
105
|
+
# Runtime data
|
|
106
|
+
pids
|
|
107
|
+
*.pid
|
|
108
|
+
*.seed
|
|
109
|
+
*.pid.lock
|
|
110
|
+
|
|
111
|
+
# Coverage directory used by tools like istanbul
|
|
112
|
+
coverage/
|
|
113
|
+
*.lcov
|
|
114
|
+
|
|
115
|
+
# nyc test coverage
|
|
116
|
+
.nyc_output
|
|
117
|
+
|
|
118
|
+
# Dependency directories
|
|
119
|
+
jspm_packages/
|
|
120
|
+
|
|
121
|
+
# TypeScript cache
|
|
122
|
+
*.tsbuildinfo
|
|
123
|
+
|
|
124
|
+
# Optional npm cache directory
|
|
125
|
+
.npm
|
|
126
|
+
|
|
127
|
+
# Optional eslint cache
|
|
128
|
+
.eslintcache
|
|
129
|
+
|
|
130
|
+
# Optional stylelint cache
|
|
131
|
+
.stylelintcache
|
|
132
|
+
|
|
133
|
+
# Microbundle cache
|
|
134
|
+
.rpt2_cache/
|
|
135
|
+
.rts2_cache_cjs/
|
|
136
|
+
.rts2_cache_es/
|
|
137
|
+
.rts2_cache_umd/
|
|
138
|
+
|
|
139
|
+
# Optional REPL history
|
|
140
|
+
.node_repl_history
|
|
141
|
+
|
|
142
|
+
# Output of 'npm pack'
|
|
143
|
+
*.tgz
|
|
144
|
+
|
|
145
|
+
# Yarn Integrity file
|
|
146
|
+
.yarn-integrity
|
|
147
|
+
|
|
148
|
+
# parcel-bundler cache (https://parceljs.org/)
|
|
149
|
+
.cache
|
|
150
|
+
.parcel-cache
|
|
151
|
+
|
|
152
|
+
# Next.js build output
|
|
153
|
+
.next
|
|
154
|
+
|
|
155
|
+
# Nuxt.js build / generate output
|
|
156
|
+
.nuxt
|
|
157
|
+
dist
|
|
158
|
+
|
|
159
|
+
# Storybook build outputs
|
|
160
|
+
.out
|
|
161
|
+
.storybook-out
|
|
162
|
+
|
|
163
|
+
# Temporary folders
|
|
164
|
+
tmp/
|
|
165
|
+
temp/
|
|
166
|
+
|
|
167
|
+
# Editor directories and files
|
|
168
|
+
.vscode/*
|
|
169
|
+
!.vscode/extensions.json
|
|
170
|
+
.idea
|
|
171
|
+
*.suo
|
|
172
|
+
*.ntvs*
|
|
173
|
+
*.njsproj
|
|
174
|
+
*.sln
|
|
175
|
+
*.sw?
|
|
176
|
+
|
|
177
|
+
# OS generated files
|
|
178
|
+
.DS_Store
|
|
179
|
+
.DS_Store?
|
|
180
|
+
._*
|
|
181
|
+
.Spotlight-V100
|
|
182
|
+
.Trashes
|
|
183
|
+
ehthumbs.db
|
|
184
|
+
Thumbs.db
|
|
185
|
+
|
|
186
|
+
# FluxStack specific
|
|
187
|
+
uploads/
|
|
188
|
+
public/uploads/
|
|
189
|
+
.fluxstack/
|
|
190
|
+
|
|
191
|
+
# Bun
|
|
192
|
+
bun.lockb
|
|
193
|
+
`
|
|
194
|
+
writeFileSync(join(projectPath, '.gitignore'), gitignoreContent)
|
|
82
195
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
"license": "MIT",
|
|
96
|
-
"type": "module",
|
|
97
|
-
"scripts": {
|
|
98
|
-
"dev": "bun core/cli/index.ts dev",
|
|
99
|
-
"dev:clean": "bun run-clean.ts",
|
|
100
|
-
"dev:backend": "bun core/cli/index.ts dev:backend",
|
|
101
|
-
"dev:frontend": "bun core/cli/index.ts dev:frontend",
|
|
102
|
-
"build": "bun core/cli/index.ts build",
|
|
103
|
-
"build:backend": "bun core/cli/index.ts build:backend",
|
|
104
|
-
"build:frontend": "bun core/cli/index.ts build:frontend",
|
|
105
|
-
"start": "NODE_ENV=production bun app/server/index.ts",
|
|
106
|
-
"typecheck": "bunx tsc --noEmit"
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
writeFileSync(packageJsonPath, JSON.stringify(fallbackPackageJson, null, 2))
|
|
196
|
+
// Customize package.json with project name
|
|
197
|
+
const packageJsonPath = join(projectPath, 'package.json')
|
|
198
|
+
if (existsSync(packageJsonPath)) {
|
|
199
|
+
const packageContent = readFileSync(packageJsonPath, 'utf-8')
|
|
200
|
+
const packageJson = JSON.parse(packageContent)
|
|
201
|
+
|
|
202
|
+
// Update project-specific fields
|
|
203
|
+
packageJson.name = projectName
|
|
204
|
+
packageJson.description = `${projectName} - FluxStack application`
|
|
205
|
+
packageJson.version = "1.0.0"
|
|
206
|
+
|
|
207
|
+
writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2))
|
|
110
208
|
}
|
|
111
209
|
|
|
112
210
|
// Create .env from .env.example and set development mode + project name
|
package/package.json
CHANGED
package/package-template.json
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "PROJECT_NAME",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "PROJECT_NAME - Modern full-stack TypeScript application built with FluxStack",
|
|
5
|
-
"keywords": ["fluxstack", "bun", "typescript", "full-stack", "elysia", "react", "vite"],
|
|
6
|
-
"author": "Your Name",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"type": "module",
|
|
9
|
-
"scripts": {
|
|
10
|
-
"dev": "bun core/cli/index.ts dev",
|
|
11
|
-
"dev:clean": "bun run-clean.ts",
|
|
12
|
-
"dev:backend": "bun core/cli/index.ts dev:backend",
|
|
13
|
-
"dev:frontend": "bun core/cli/index.ts dev:frontend",
|
|
14
|
-
"build": "bun core/cli/index.ts build",
|
|
15
|
-
"build:backend": "bun core/cli/index.ts build:backend",
|
|
16
|
-
"build:frontend": "bun core/cli/index.ts build:frontend",
|
|
17
|
-
"start": "NODE_ENV=production bun app/server/index.ts",
|
|
18
|
-
"start:backend": "NODE_ENV=production bun app/server/backend-only.ts",
|
|
19
|
-
"start:frontend": "NODE_ENV=production bun app/client/frontend-only.ts",
|
|
20
|
-
"typecheck": "bunx tsc --noEmit",
|
|
21
|
-
"test": "vitest",
|
|
22
|
-
"test:ui": "vitest --ui",
|
|
23
|
-
"test:coverage": "vitest --coverage"
|
|
24
|
-
},
|
|
25
|
-
"devDependencies": {
|
|
26
|
-
"@eslint/js": "^9.30.1",
|
|
27
|
-
"@tailwindcss/vite": "^4.1.13",
|
|
28
|
-
"@testing-library/jest-dom": "^6.6.4",
|
|
29
|
-
"@testing-library/react": "^16.3.0",
|
|
30
|
-
"@testing-library/user-event": "^14.6.1",
|
|
31
|
-
"@types/bun": "latest",
|
|
32
|
-
"@types/node": "^24.5.2",
|
|
33
|
-
"@types/react": "^19.1.8",
|
|
34
|
-
"@types/react-dom": "^19.1.6",
|
|
35
|
-
"@vitest/coverage-v8": "^3.2.4",
|
|
36
|
-
"@vitest/ui": "^3.2.4",
|
|
37
|
-
"concurrently": "^9.2.0",
|
|
38
|
-
"eslint": "^9.30.1",
|
|
39
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
40
|
-
"eslint-plugin-react-refresh": "^0.4.20",
|
|
41
|
-
"globals": "^16.3.0",
|
|
42
|
-
"jsdom": "^26.1.0",
|
|
43
|
-
"tailwindcss": "^4.1.13",
|
|
44
|
-
"typescript": "^5.8.3",
|
|
45
|
-
"typescript-eslint": "^8.35.1",
|
|
46
|
-
"vitest": "^3.2.4"
|
|
47
|
-
},
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"@elysiajs/eden": "^1.3.2",
|
|
50
|
-
"@elysiajs/swagger": "^1.3.1",
|
|
51
|
-
"@types/http-proxy-middleware": "^1.0.0",
|
|
52
|
-
"@vitejs/plugin-react": "^4.6.0",
|
|
53
|
-
"chokidar": "^4.0.3",
|
|
54
|
-
"elysia": "^1.4.6",
|
|
55
|
-
"http-proxy-middleware": "^3.0.5",
|
|
56
|
-
"lightningcss": "^1.30.1",
|
|
57
|
-
"lucide-react": "^0.544.0",
|
|
58
|
-
"react": "^19.1.0",
|
|
59
|
-
"react-dom": "^19.1.0",
|
|
60
|
-
"vite": "^7.0.4"
|
|
61
|
-
},
|
|
62
|
-
"engines": {
|
|
63
|
-
"bun": ">=1.2.0"
|
|
64
|
-
},
|
|
65
|
-
"preferredPackageManager": "bun",
|
|
66
|
-
"trustedDependencies": ["esbuild"]
|
|
67
|
-
}
|