create-fluxstack 1.7.5 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +82 -0
- package/Dockerfile +70 -0
- package/app/server/app.ts +20 -5
- package/app/server/backend-only.ts +15 -12
- package/app/server/index.ts +83 -96
- package/app/server/live/FluxStackConfig.ts +5 -5
- package/app/server/routes/env-test.ts +59 -0
- package/config/app.config.ts +2 -54
- package/config/client.config.ts +95 -0
- package/config/index.ts +57 -22
- package/config/monitoring.config.ts +114 -0
- package/config/plugins.config.ts +59 -0
- package/config/runtime.config.ts +0 -17
- package/config/server.config.ts +50 -30
- package/core/build/bundler.ts +17 -16
- package/core/build/flux-plugins-generator.ts +29 -18
- package/core/build/index.ts +32 -31
- package/core/build/live-components-generator.ts +29 -18
- package/core/build/optimizer.ts +37 -17
- package/core/cli/index.ts +6 -2
- package/core/config/env.ts +4 -0
- package/core/config/runtime-config.ts +10 -8
- package/core/config/schema.ts +24 -2
- package/core/framework/server.ts +1 -0
- package/core/index.ts +31 -23
- package/core/plugins/built-in/static/index.ts +73 -246
- package/core/plugins/built-in/vite/index.ts +377 -377
- package/core/plugins/registry.ts +22 -18
- package/core/server/backend-entry.ts +51 -0
- package/core/types/plugin.ts +6 -0
- package/core/utils/build-logger.ts +324 -0
- package/core/utils/config-schema.ts +2 -6
- package/core/utils/helpers.ts +14 -9
- package/core/utils/regenerate-files.ts +69 -0
- package/core/utils/version.ts +1 -1
- package/fluxstack.config.ts +138 -252
- package/package.json +2 -17
- package/vitest.config.ts +8 -26
- package/config/build.config.ts +0 -24
package/fluxstack.config.ts
CHANGED
|
@@ -1,274 +1,106 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* FluxStack Configuration
|
|
3
|
-
* ✅
|
|
4
|
-
*
|
|
3
|
+
* ✅ Refactored to use modular config system from /config
|
|
4
|
+
*
|
|
5
|
+
* This file composes configs from /config into the FluxStackConfig format
|
|
6
|
+
* required by core/config/schema.ts for backward compatibility
|
|
5
7
|
*/
|
|
6
8
|
|
|
7
9
|
import type { FluxStackConfig } from './core/config/schema'
|
|
8
|
-
import { defineConfig, config as configHelpers } from './core/utils/config-schema'
|
|
9
10
|
import { env, helpers } from './core/utils/env'
|
|
10
|
-
import { FLUXSTACK_VERSION } from './core/utils/version'
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
// Import modular configs
|
|
13
|
+
import { appConfig } from './config/app.config'
|
|
14
|
+
import { serverConfig } from './config/server.config'
|
|
15
|
+
import { clientConfig } from './config/client.config'
|
|
16
|
+
import { databaseConfig } from './config/database.config'
|
|
17
|
+
import { servicesConfig } from './config/services.config'
|
|
18
|
+
import { loggerConfig } from './config/logger.config'
|
|
19
|
+
import { pluginsConfig } from './config/plugins.config'
|
|
20
|
+
import { monitoringConfig } from './config/monitoring.config'
|
|
13
21
|
|
|
14
|
-
|
|
15
|
-
// 📋 DECLARATIVE CONFIG SCHEMAS
|
|
16
|
-
// ============================================================================
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Application Configuration Schema
|
|
20
|
-
*/
|
|
21
|
-
const appConfigSchema = {
|
|
22
|
-
name: configHelpers.string('FLUXSTACK_APP_NAME', 'FluxStack', true),
|
|
23
|
-
version: configHelpers.string('FLUXSTACK_APP_VERSION', FLUXSTACK_VERSION, true),
|
|
24
|
-
description: configHelpers.string('FLUXSTACK_APP_DESCRIPTION', 'A FluxStack application')
|
|
25
|
-
} as const
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* CORS Configuration Schema
|
|
29
|
-
*/
|
|
30
|
-
const corsConfigSchema = {
|
|
31
|
-
origins: configHelpers.array('CORS_ORIGINS', ['http://localhost:3000', 'http://localhost:5173']),
|
|
32
|
-
methods: configHelpers.array('CORS_METHODS', ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS']),
|
|
33
|
-
headers: configHelpers.array('CORS_HEADERS', ['Content-Type', 'Authorization']),
|
|
34
|
-
credentials: configHelpers.boolean('CORS_CREDENTIALS', false),
|
|
35
|
-
maxAge: configHelpers.number('CORS_MAX_AGE', 86400)
|
|
36
|
-
} as const
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Server Configuration Schema
|
|
40
|
-
*/
|
|
41
|
-
const serverConfigSchema = {
|
|
42
|
-
port: configHelpers.number('PORT', 3000, true),
|
|
43
|
-
host: configHelpers.string('HOST', 'localhost', true),
|
|
44
|
-
apiPrefix: configHelpers.string('API_PREFIX', '/api', true)
|
|
45
|
-
} as const
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Client Proxy Configuration Schema
|
|
49
|
-
*/
|
|
50
|
-
const clientProxyConfigSchema = {
|
|
51
|
-
target: {
|
|
52
|
-
type: 'string' as const,
|
|
53
|
-
env: 'PROXY_TARGET',
|
|
54
|
-
default: helpers.getServerUrl(),
|
|
55
|
-
required: false
|
|
56
|
-
},
|
|
57
|
-
changeOrigin: configHelpers.boolean('PROXY_CHANGE_ORIGIN', true)
|
|
58
|
-
} as const
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Client Build Configuration Schema
|
|
62
|
-
*/
|
|
63
|
-
const clientBuildConfigSchema = {
|
|
64
|
-
sourceMaps: configHelpers.boolean('CLIENT_SOURCEMAPS', helpers.isDevelopment()),
|
|
65
|
-
minify: configHelpers.boolean('CLIENT_MINIFY', helpers.isProduction()),
|
|
66
|
-
target: configHelpers.string('CLIENT_TARGET', 'esnext'),
|
|
67
|
-
outDir: configHelpers.string('CLIENT_OUTDIR', 'dist/client')
|
|
68
|
-
} as const
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Client Configuration Schema
|
|
72
|
-
*/
|
|
73
|
-
const clientConfigSchema = {
|
|
74
|
-
port: configHelpers.number('VITE_PORT', 5173, true)
|
|
75
|
-
} as const
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Build Optimization Configuration Schema
|
|
79
|
-
*/
|
|
80
|
-
const buildOptimizationConfigSchema = {
|
|
81
|
-
minify: configHelpers.boolean('BUILD_MINIFY', helpers.isProduction()),
|
|
82
|
-
treeshake: configHelpers.boolean('BUILD_TREESHAKE', helpers.isProduction()),
|
|
83
|
-
compress: configHelpers.boolean('BUILD_COMPRESS', helpers.isProduction()),
|
|
84
|
-
splitChunks: configHelpers.boolean('BUILD_SPLIT_CHUNKS', true),
|
|
85
|
-
bundleAnalyzer: configHelpers.boolean('BUILD_ANALYZER', helpers.isDevelopment())
|
|
86
|
-
} as const
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Build Configuration Schema
|
|
90
|
-
*/
|
|
91
|
-
const buildConfigSchema = {
|
|
92
|
-
target: configHelpers.enum('BUILD_TARGET', ['bun', 'node', 'docker'] as const, 'bun'),
|
|
93
|
-
outDir: configHelpers.string('BUILD_OUTDIR', 'dist'),
|
|
94
|
-
sourceMaps: configHelpers.boolean('BUILD_SOURCEMAPS', !helpers.isProduction()),
|
|
95
|
-
minify: configHelpers.boolean('BUILD_MINIFY', helpers.isProduction()),
|
|
96
|
-
treeshake: configHelpers.boolean('BUILD_TREESHAKE', helpers.isProduction()),
|
|
97
|
-
clean: configHelpers.boolean('BUILD_CLEAN', true)
|
|
98
|
-
} as const
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Plugins Configuration Schema
|
|
102
|
-
*/
|
|
103
|
-
const pluginsConfigSchema = {
|
|
104
|
-
enabled: configHelpers.array('FLUXSTACK_PLUGINS_ENABLED', ['logger', 'swagger', 'vite', 'cors', 'static-files', 'crypto-auth']),
|
|
105
|
-
disabled: configHelpers.array('FLUXSTACK_PLUGINS_DISABLED', [])
|
|
106
|
-
} as const
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Logging Configuration Schema
|
|
110
|
-
*/
|
|
111
|
-
const loggingConfigSchema = {
|
|
112
|
-
level: configHelpers.enum('LOG_LEVEL', ['debug', 'info', 'warn', 'error'] as const, helpers.isDevelopment() ? 'debug' : 'info'),
|
|
113
|
-
format: configHelpers.enum('LOG_FORMAT', ['json', 'pretty'] as const, helpers.isDevelopment() ? 'pretty' : 'json')
|
|
114
|
-
} as const
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Monitoring Metrics Configuration Schema
|
|
118
|
-
*/
|
|
119
|
-
const monitoringMetricsConfigSchema = {
|
|
120
|
-
enabled: configHelpers.boolean('ENABLE_METRICS', false),
|
|
121
|
-
collectInterval: configHelpers.number('METRICS_INTERVAL', 5000),
|
|
122
|
-
httpMetrics: configHelpers.boolean('HTTP_METRICS', true),
|
|
123
|
-
systemMetrics: configHelpers.boolean('SYSTEM_METRICS', true),
|
|
124
|
-
customMetrics: configHelpers.boolean('CUSTOM_METRICS', false)
|
|
125
|
-
} as const
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Monitoring Profiling Configuration Schema
|
|
129
|
-
*/
|
|
130
|
-
const monitoringProfilingConfigSchema = {
|
|
131
|
-
enabled: configHelpers.boolean('PROFILING_ENABLED', false),
|
|
132
|
-
sampleRate: configHelpers.number('PROFILING_SAMPLE_RATE', 0.1),
|
|
133
|
-
memoryProfiling: configHelpers.boolean('MEMORY_PROFILING', false),
|
|
134
|
-
cpuProfiling: configHelpers.boolean('CPU_PROFILING', false)
|
|
135
|
-
} as const
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Monitoring Configuration Schema
|
|
139
|
-
*/
|
|
140
|
-
const monitoringConfigSchema = {
|
|
141
|
-
enabled: configHelpers.boolean('ENABLE_MONITORING', false),
|
|
142
|
-
exporters: configHelpers.array('MONITORING_EXPORTERS', [])
|
|
143
|
-
} as const
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Database Configuration Schema (Optional)
|
|
147
|
-
*/
|
|
148
|
-
const databaseConfigSchema = {
|
|
149
|
-
url: configHelpers.string('DATABASE_URL', ''),
|
|
150
|
-
host: configHelpers.string('DB_HOST', ''),
|
|
151
|
-
port: configHelpers.number('DB_PORT', 5432),
|
|
152
|
-
database: configHelpers.string('DB_NAME', ''),
|
|
153
|
-
user: configHelpers.string('DB_USER', ''),
|
|
154
|
-
password: configHelpers.string('DB_PASSWORD', ''),
|
|
155
|
-
ssl: configHelpers.boolean('DB_SSL', false),
|
|
156
|
-
poolSize: configHelpers.number('DB_POOL_SIZE', 10)
|
|
157
|
-
} as const
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Auth Configuration Schema (Optional)
|
|
161
|
-
*/
|
|
162
|
-
const authConfigSchema = {
|
|
163
|
-
secret: configHelpers.string('JWT_SECRET', ''),
|
|
164
|
-
expiresIn: configHelpers.string('JWT_EXPIRES_IN', '24h'),
|
|
165
|
-
algorithm: configHelpers.string('JWT_ALGORITHM', 'HS256'),
|
|
166
|
-
issuer: configHelpers.string('JWT_ISSUER', '')
|
|
167
|
-
} as const
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Email Configuration Schema (Optional)
|
|
171
|
-
*/
|
|
172
|
-
const emailConfigSchema = {
|
|
173
|
-
host: configHelpers.string('SMTP_HOST', ''),
|
|
174
|
-
port: configHelpers.number('SMTP_PORT', 587),
|
|
175
|
-
user: configHelpers.string('SMTP_USER', ''),
|
|
176
|
-
password: configHelpers.string('SMTP_PASSWORD', ''),
|
|
177
|
-
secure: configHelpers.boolean('SMTP_SECURE', false),
|
|
178
|
-
from: configHelpers.string('SMTP_FROM', '')
|
|
179
|
-
} as const
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Storage Configuration Schema (Optional)
|
|
183
|
-
*/
|
|
184
|
-
const storageConfigSchema = {
|
|
185
|
-
uploadPath: configHelpers.string('UPLOAD_PATH', ''),
|
|
186
|
-
maxFileSize: configHelpers.number('MAX_FILE_SIZE', 10485760), // 10MB
|
|
187
|
-
allowedTypes: configHelpers.array('ALLOWED_FILE_TYPES', []),
|
|
188
|
-
provider: configHelpers.enum('STORAGE_PROVIDER', ['local', 's3', 'gcs'] as const, 'local')
|
|
189
|
-
} as const
|
|
22
|
+
console.log(`🔧 Loading FluxStack config for ${appConfig.env} environment`)
|
|
190
23
|
|
|
191
24
|
// ============================================================================
|
|
192
|
-
//
|
|
193
|
-
// ============================================================================
|
|
194
|
-
|
|
195
|
-
const appConfig = defineConfig(appConfigSchema)
|
|
196
|
-
const corsConfig = defineConfig(corsConfigSchema)
|
|
197
|
-
const serverConfig = defineConfig(serverConfigSchema)
|
|
198
|
-
const clientProxyConfig = defineConfig(clientProxyConfigSchema)
|
|
199
|
-
const clientBuildConfig = defineConfig(clientBuildConfigSchema)
|
|
200
|
-
const clientConfig = defineConfig(clientConfigSchema)
|
|
201
|
-
const buildOptimizationConfig = defineConfig(buildOptimizationConfigSchema)
|
|
202
|
-
const buildConfig = defineConfig(buildConfigSchema)
|
|
203
|
-
const pluginsConfig = defineConfig(pluginsConfigSchema)
|
|
204
|
-
const loggingConfig = defineConfig(loggingConfigSchema)
|
|
205
|
-
const monitoringMetricsConfig = defineConfig(monitoringMetricsConfigSchema)
|
|
206
|
-
const monitoringProfilingConfig = defineConfig(monitoringProfilingConfigSchema)
|
|
207
|
-
const monitoringConfig = defineConfig(monitoringConfigSchema)
|
|
208
|
-
|
|
209
|
-
// Optional configs (only load if env vars are present)
|
|
210
|
-
const databaseConfig = (env.has('DATABASE_URL') || env.has('DATABASE_HOST'))
|
|
211
|
-
? defineConfig(databaseConfigSchema)
|
|
212
|
-
: undefined
|
|
213
|
-
|
|
214
|
-
const authConfig = env.has('JWT_SECRET')
|
|
215
|
-
? defineConfig(authConfigSchema)
|
|
216
|
-
: undefined
|
|
217
|
-
|
|
218
|
-
const emailConfig = env.has('SMTP_HOST')
|
|
219
|
-
? defineConfig(emailConfigSchema)
|
|
220
|
-
: undefined
|
|
221
|
-
|
|
222
|
-
const storageConfig = (env.has('UPLOAD_PATH') || env.has('STORAGE_PROVIDER'))
|
|
223
|
-
? defineConfig(storageConfigSchema)
|
|
224
|
-
: undefined
|
|
225
|
-
|
|
226
|
-
// ============================================================================
|
|
227
|
-
// 🚀 MAIN FLUXSTACK CONFIGURATION
|
|
25
|
+
// 🚀 MAIN FLUXSTACK CONFIGURATION (Composed from /config)
|
|
228
26
|
// ============================================================================
|
|
229
27
|
|
|
230
28
|
export const config: FluxStackConfig = {
|
|
231
29
|
// Application metadata
|
|
232
|
-
app:
|
|
30
|
+
app: {
|
|
31
|
+
name: appConfig.name,
|
|
32
|
+
version: appConfig.version,
|
|
33
|
+
description: appConfig.description
|
|
34
|
+
},
|
|
233
35
|
|
|
234
36
|
// Server configuration
|
|
235
37
|
server: {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
38
|
+
port: serverConfig.server.port,
|
|
39
|
+
host: serverConfig.server.host,
|
|
40
|
+
apiPrefix: serverConfig.server.apiPrefix,
|
|
41
|
+
cors: {
|
|
42
|
+
origins: serverConfig.cors.origins,
|
|
43
|
+
methods: serverConfig.cors.methods,
|
|
44
|
+
headers: serverConfig.cors.headers,
|
|
45
|
+
credentials: serverConfig.cors.credentials,
|
|
46
|
+
maxAge: serverConfig.cors.maxAge
|
|
47
|
+
},
|
|
48
|
+
middleware: [],
|
|
49
|
+
showBanner: serverConfig.server.showBanner
|
|
239
50
|
},
|
|
240
51
|
|
|
241
52
|
// Client configuration
|
|
242
53
|
client: {
|
|
243
|
-
|
|
244
|
-
proxy:
|
|
245
|
-
|
|
54
|
+
port: clientConfig.vite.port,
|
|
55
|
+
proxy: {
|
|
56
|
+
target: clientConfig.proxy.target || helpers.getServerUrl(),
|
|
57
|
+
changeOrigin: clientConfig.proxy.changeOrigin
|
|
58
|
+
},
|
|
59
|
+
build: {
|
|
60
|
+
sourceMaps: clientConfig.build.sourceMaps,
|
|
61
|
+
minify: clientConfig.build.minify,
|
|
62
|
+
target: clientConfig.build.target,
|
|
63
|
+
outDir: clientConfig.build.outDir
|
|
64
|
+
}
|
|
246
65
|
},
|
|
247
66
|
|
|
248
67
|
// Build configuration
|
|
249
68
|
build: {
|
|
250
|
-
|
|
251
|
-
|
|
69
|
+
target: 'bun',
|
|
70
|
+
mode: appConfig.env as 'development' | 'production' | 'test',
|
|
71
|
+
outDir: 'dist',
|
|
72
|
+
optimization: {
|
|
73
|
+
minify: helpers.isProduction(),
|
|
74
|
+
treeshake: helpers.isProduction(),
|
|
75
|
+
compress: helpers.isProduction(),
|
|
76
|
+
splitChunks: true,
|
|
77
|
+
bundleAnalyzer: helpers.isDevelopment()
|
|
78
|
+
},
|
|
79
|
+
sourceMaps: !helpers.isProduction(),
|
|
80
|
+
minify: helpers.isProduction(),
|
|
81
|
+
treeshake: helpers.isProduction(),
|
|
82
|
+
clean: true
|
|
252
83
|
},
|
|
253
84
|
|
|
254
85
|
// Plugin configuration
|
|
255
86
|
plugins: {
|
|
256
|
-
|
|
87
|
+
enabled: pluginsConfig.enabled,
|
|
88
|
+
disabled: pluginsConfig.disabled,
|
|
257
89
|
config: {
|
|
258
90
|
logger: {
|
|
259
91
|
// Logger plugin config handled by logging section
|
|
260
92
|
},
|
|
261
93
|
swagger: {
|
|
262
|
-
title:
|
|
263
|
-
version:
|
|
264
|
-
description:
|
|
94
|
+
title: pluginsConfig.swaggerTitle,
|
|
95
|
+
version: pluginsConfig.swaggerVersion,
|
|
96
|
+
description: pluginsConfig.swaggerDescription
|
|
265
97
|
},
|
|
266
98
|
staticFiles: {
|
|
267
|
-
publicDir:
|
|
268
|
-
uploadsDir:
|
|
269
|
-
cacheMaxAge:
|
|
270
|
-
enableUploads:
|
|
271
|
-
enablePublic:
|
|
99
|
+
publicDir: pluginsConfig.staticPublicDir,
|
|
100
|
+
uploadsDir: pluginsConfig.staticUploadsDir,
|
|
101
|
+
cacheMaxAge: pluginsConfig.staticCacheMaxAge,
|
|
102
|
+
enableUploads: pluginsConfig.staticEnableUploads,
|
|
103
|
+
enablePublic: pluginsConfig.staticEnablePublic
|
|
272
104
|
}
|
|
273
105
|
// ✅ crypto-auth manages its own configuration
|
|
274
106
|
// See: plugins/crypto-auth/config/index.ts
|
|
@@ -277,33 +109,87 @@ export const config: FluxStackConfig = {
|
|
|
277
109
|
|
|
278
110
|
// Logging configuration
|
|
279
111
|
logging: {
|
|
280
|
-
|
|
112
|
+
level: loggerConfig.level,
|
|
113
|
+
format: helpers.isDevelopment() ? 'pretty' : 'json',
|
|
281
114
|
transports: [
|
|
282
115
|
{
|
|
283
116
|
type: 'console' as const,
|
|
284
|
-
level:
|
|
285
|
-
format:
|
|
117
|
+
level: loggerConfig.level,
|
|
118
|
+
format: helpers.isDevelopment() ? 'pretty' : 'json'
|
|
286
119
|
}
|
|
287
120
|
]
|
|
288
121
|
},
|
|
289
122
|
|
|
290
123
|
// Monitoring configuration
|
|
291
124
|
monitoring: {
|
|
292
|
-
|
|
293
|
-
metrics:
|
|
294
|
-
|
|
125
|
+
enabled: monitoringConfig.monitoring.enabled,
|
|
126
|
+
metrics: {
|
|
127
|
+
enabled: monitoringConfig.metrics.enabled,
|
|
128
|
+
collectInterval: monitoringConfig.metrics.collectInterval,
|
|
129
|
+
httpMetrics: monitoringConfig.metrics.httpMetrics,
|
|
130
|
+
systemMetrics: monitoringConfig.metrics.systemMetrics,
|
|
131
|
+
customMetrics: monitoringConfig.metrics.customMetrics
|
|
132
|
+
},
|
|
133
|
+
profiling: {
|
|
134
|
+
enabled: monitoringConfig.profiling.enabled,
|
|
135
|
+
sampleRate: monitoringConfig.profiling.sampleRate,
|
|
136
|
+
memoryProfiling: monitoringConfig.profiling.memoryProfiling,
|
|
137
|
+
cpuProfiling: monitoringConfig.profiling.cpuProfiling
|
|
138
|
+
},
|
|
139
|
+
exporters: monitoringConfig.monitoring.exporters
|
|
295
140
|
},
|
|
296
141
|
|
|
297
|
-
// Optional configurations (only included if
|
|
298
|
-
...(databaseConfig
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
142
|
+
// Optional configurations (only included if configured)
|
|
143
|
+
...(databaseConfig.url || databaseConfig.host
|
|
144
|
+
? {
|
|
145
|
+
database: {
|
|
146
|
+
url: databaseConfig.url,
|
|
147
|
+
host: databaseConfig.host,
|
|
148
|
+
port: databaseConfig.port,
|
|
149
|
+
database: databaseConfig.database,
|
|
150
|
+
user: databaseConfig.user,
|
|
151
|
+
password: databaseConfig.password,
|
|
152
|
+
ssl: databaseConfig.ssl,
|
|
153
|
+
poolSize: databaseConfig.poolMax
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
: {}),
|
|
157
|
+
|
|
158
|
+
...(servicesConfig.jwt.secret
|
|
159
|
+
? {
|
|
160
|
+
auth: {
|
|
161
|
+
secret: servicesConfig.jwt.secret,
|
|
162
|
+
expiresIn: servicesConfig.jwt.expiresIn,
|
|
163
|
+
algorithm: servicesConfig.jwt.algorithm,
|
|
164
|
+
issuer: servicesConfig.jwt.issuer
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
: {}),
|
|
168
|
+
|
|
169
|
+
...(servicesConfig.email.host
|
|
170
|
+
? {
|
|
171
|
+
email: {
|
|
172
|
+
host: servicesConfig.email.host,
|
|
173
|
+
port: servicesConfig.email.port,
|
|
174
|
+
user: servicesConfig.email.user,
|
|
175
|
+
password: servicesConfig.email.password,
|
|
176
|
+
secure: servicesConfig.email.secure,
|
|
177
|
+
from: servicesConfig.email.from
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
: {}),
|
|
181
|
+
|
|
182
|
+
...(servicesConfig.storage.uploadPath
|
|
183
|
+
? {
|
|
184
|
+
storage: {
|
|
185
|
+
uploadPath: servicesConfig.storage.uploadPath,
|
|
186
|
+
maxFileSize: servicesConfig.storage.maxFileSize,
|
|
187
|
+
allowedTypes: servicesConfig.storage.allowedTypes,
|
|
188
|
+
provider: servicesConfig.storage.provider,
|
|
189
|
+
config: {}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
: {}),
|
|
307
193
|
|
|
308
194
|
// Environment-specific overrides
|
|
309
195
|
environments: {
|
|
@@ -465,4 +351,4 @@ export default config
|
|
|
465
351
|
export { config as fluxStackConfig }
|
|
466
352
|
|
|
467
353
|
// Export type for TypeScript users
|
|
468
|
-
export type { FluxStackConfig } from './core/config/schema'
|
|
354
|
+
export type { FluxStackConfig } from './core/config/schema'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-fluxstack",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"description": "⚡ Revolutionary full-stack TypeScript framework with Declarative Config System, Elysia + React + Bun",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"framework",
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"dev": "bun run core/cli/index.ts dev",
|
|
28
28
|
"dev:frontend": "bun run core/cli/index.ts frontend",
|
|
29
29
|
"dev:backend": "bun run core/cli/index.ts backend",
|
|
30
|
-
"dev:coordinated": "concurrently --prefix {name} --names BACKEND,VITE --prefix-colors blue,green --kill-others-on-fail \"bun --watch app/server/index.ts\" \"vite --config vite.config.ts\"",
|
|
31
30
|
"sync-version": "bun run core/utils/sync-version.ts",
|
|
32
31
|
"build": "cross-env NODE_ENV=production bun run core/cli/index.ts build",
|
|
33
32
|
"build:frontend": "vite build --config vite.config.ts --emptyOutDir",
|
|
@@ -35,27 +34,13 @@
|
|
|
35
34
|
"start": "bun run core/cli/index.ts start",
|
|
36
35
|
"start:frontend": "bun run app/client/frontend-only.ts",
|
|
37
36
|
"start:backend": "bun run app/server/backend-only.ts",
|
|
38
|
-
"docker:build": "cd dist && docker build -t fluxstack-app .",
|
|
39
|
-
"docker:run": "cd dist && docker run -p 3000:3000 fluxstack-app",
|
|
40
|
-
"docker:compose": "cd dist && docker-compose up -d",
|
|
41
|
-
"docker:stop": "cd dist && docker-compose down",
|
|
42
37
|
"create": "bun run core/cli/index.ts create",
|
|
43
38
|
"cli": "bun run core/cli/index.ts",
|
|
44
39
|
"make:component": "bun run core/cli/index.ts make:component",
|
|
45
40
|
"make:live": "bun run core/cli/index.ts make:component",
|
|
46
41
|
"test": "vitest",
|
|
47
42
|
"test:ui": "vitest --ui",
|
|
48
|
-
"test:
|
|
49
|
-
"test:coverage": "vitest run --coverage",
|
|
50
|
-
"test:watch": "vitest --watch",
|
|
51
|
-
"test:live": "tsx scripts/test-live-components.ts",
|
|
52
|
-
"test:live:coverage": "tsx scripts/test-live-components.ts --coverage",
|
|
53
|
-
"test:live:watch": "tsx scripts/test-live-components.ts --watch",
|
|
54
|
-
"test:live:verbose": "tsx scripts/test-live-components.ts --verbose",
|
|
55
|
-
"test:config": "bun run core/config/__tests__/run-tests.ts",
|
|
56
|
-
"test:config:coverage": "bun run core/config/__tests__/run-tests.ts coverage",
|
|
57
|
-
"test:config:manual": "bun run core/config/__tests__/manual-test.ts",
|
|
58
|
-
"legacy:dev": "bun --watch app/server/index.ts"
|
|
43
|
+
"test:coverage": "vitest run --coverage"
|
|
59
44
|
},
|
|
60
45
|
"devDependencies": {
|
|
61
46
|
"@eslint/js": "^9.30.1",
|
package/vitest.config.ts
CHANGED
|
@@ -1,42 +1,24 @@
|
|
|
1
|
-
/// <reference types="vitest" />
|
|
2
|
-
/// <reference types="@testing-library/jest-dom" />
|
|
3
1
|
import { defineConfig } from 'vitest/config'
|
|
4
|
-
import
|
|
5
|
-
import { resolve } from 'path'
|
|
2
|
+
import path from 'path'
|
|
6
3
|
|
|
7
4
|
export default defineConfig({
|
|
8
|
-
plugins: [react()],
|
|
9
5
|
test: {
|
|
10
6
|
globals: true,
|
|
11
|
-
environment: '
|
|
12
|
-
|
|
13
|
-
include: [
|
|
14
|
-
'app/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}',
|
|
15
|
-
'core/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'
|
|
16
|
-
],
|
|
17
|
-
exclude: [
|
|
18
|
-
'node_modules',
|
|
19
|
-
'dist',
|
|
20
|
-
'.git',
|
|
21
|
-
'.cache'
|
|
22
|
-
],
|
|
7
|
+
environment: 'node',
|
|
8
|
+
include: ['tests/**/*.test.ts'],
|
|
23
9
|
coverage: {
|
|
24
|
-
provider: 'v8',
|
|
25
10
|
reporter: ['text', 'json', 'html'],
|
|
26
11
|
exclude: [
|
|
27
12
|
'node_modules/',
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'**/coverage/**'
|
|
13
|
+
'tests/',
|
|
14
|
+
'*.config.ts',
|
|
15
|
+
'dist/'
|
|
32
16
|
]
|
|
33
17
|
}
|
|
34
18
|
},
|
|
35
19
|
resolve: {
|
|
36
20
|
alias: {
|
|
37
|
-
'@': resolve(__dirname, '
|
|
38
|
-
'@core': resolve(__dirname, './core'),
|
|
39
|
-
'@server': resolve(__dirname, './app/server')
|
|
21
|
+
'@': path.resolve(__dirname, '.')
|
|
40
22
|
}
|
|
41
23
|
}
|
|
42
|
-
})
|
|
24
|
+
})
|
package/config/build.config.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Build & Client Configuration
|
|
3
|
-
* Declarative build and client config for FluxStack framework
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { defineConfig, config } from '@/core/utils/config-schema'
|
|
7
|
-
|
|
8
|
-
export const buildConfig = defineConfig({
|
|
9
|
-
// Client build settings
|
|
10
|
-
clientBuildDir: config.string('CLIENT_BUILD_DIR', 'dist/client'),
|
|
11
|
-
clientSourceMaps: config.boolean('CLIENT_SOURCEMAPS', false),
|
|
12
|
-
clientMinify: config.boolean('CLIENT_MINIFY', true),
|
|
13
|
-
clientTarget: config.string('CLIENT_TARGET', 'es2020'),
|
|
14
|
-
|
|
15
|
-
// API proxy settings
|
|
16
|
-
apiUrl: config.string('API_URL', 'http://localhost:3000'),
|
|
17
|
-
proxyChangeOrigin: config.boolean('PROXY_CHANGE_ORIGIN', true),
|
|
18
|
-
|
|
19
|
-
// Monitoring
|
|
20
|
-
monitoringEnabled: config.boolean('MONITORING_ENABLED', false)
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
export type BuildConfig = typeof buildConfig
|
|
24
|
-
export default buildConfig
|