create-fluxstack 1.7.3 β†’ 1.7.5

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/.env.example CHANGED
@@ -11,9 +11,12 @@ HOST=localhost
11
11
  FRONTEND_PORT=5173
12
12
  VITE_API_URL=http://localhost:3000
13
13
  VITE_APP_NAME=FluxStack
14
- VITE_APP_VERSION=1.0.0
14
+ VITE_APP_VERSION=1.7.3
15
15
  VITE_NODE_ENV=development
16
16
 
17
+ # FluxStack Framework Version
18
+ FLUXSTACK_APP_VERSION=1.7.3
19
+
17
20
  # Backend Configuration
18
21
  BACKEND_PORT=3001
19
22
 
@@ -4,6 +4,7 @@
4
4
  */
5
5
 
6
6
  import { defineConfig, config } from '@/core/utils/config-schema'
7
+ import { FLUXSTACK_VERSION } from '@/core/utils/version'
7
8
 
8
9
  /**
9
10
  * App configuration schema
@@ -15,7 +16,7 @@ const appConfigSchema = {
15
16
  version: {
16
17
  type: 'string' as const,
17
18
  env: 'APP_VERSION',
18
- default: '1.0.0',
19
+ default: FLUXSTACK_VERSION,
19
20
  validate: (value: string) => /^\d+\.\d+\.\d+$/.test(value) || 'Version must be semver format (e.g., 1.0.0)'
20
21
  },
21
22
 
@@ -4,6 +4,7 @@
4
4
  */
5
5
 
6
6
  import { defineConfig, config } from '@/core/utils/config-schema'
7
+ import { FLUXSTACK_VERSION } from '@/core/utils/version'
7
8
 
8
9
  const serverConfigSchema = {
9
10
  // Server basics
@@ -29,7 +30,7 @@ const serverConfigSchema = {
29
30
 
30
31
  // App info
31
32
  appName: config.string('FLUXSTACK_APP_NAME', 'FluxStack'),
32
- appVersion: config.string('FLUXSTACK_APP_VERSION', '1.0.0'),
33
+ appVersion: config.string('FLUXSTACK_APP_VERSION', FLUXSTACK_VERSION),
33
34
 
34
35
  // Features
35
36
  enableSwagger: config.boolean('ENABLE_SWAGGER', true),
@@ -4,6 +4,7 @@ import type { FluxStackConfig } from "../config"
4
4
  import type { BuildResult, BuildManifest } from "../types/build"
5
5
  import { Bundler } from "./bundler"
6
6
  import { Optimizer } from "./optimizer"
7
+ import { FLUXSTACK_VERSION } from "../utils/version"
7
8
 
8
9
  export class FluxStackBuilder {
9
10
  private config: FluxStackConfig
@@ -12,7 +13,7 @@ export class FluxStackBuilder {
12
13
 
13
14
  constructor(config: FluxStackConfig) {
14
15
  this.config = config
15
-
16
+
16
17
  // Initialize bundler with configuration
17
18
  this.bundler = new Bundler({
18
19
  target: config.build.target,
@@ -20,7 +21,7 @@ export class FluxStackBuilder {
20
21
  sourceMaps: config.build.sourceMaps,
21
22
  external: config.build.external
22
23
  })
23
-
24
+
24
25
  // Initialize optimizer with configuration
25
26
  this.optimizer = new Optimizer({
26
27
  treeshake: config.build.treeshake,
@@ -46,10 +47,10 @@ export class FluxStackBuilder {
46
47
 
47
48
  async createDockerFiles() {
48
49
  console.log("🐳 Creating Docker files...")
49
-
50
+
50
51
  const distDir = this.config.build.outDir
51
52
  console.log(`πŸ“ Output directory: ${distDir}`)
52
-
53
+
53
54
  // Ensure dist directory exists
54
55
  if (!existsSync(distDir)) {
55
56
  console.log(`πŸ“ Creating directory: ${distDir}`)
@@ -58,7 +59,7 @@ export class FluxStackBuilder {
58
59
  } else {
59
60
  console.log(`βœ… Directory already exists`)
60
61
  }
61
-
62
+
62
63
  // Dockerfile optimizado para produΓ§Γ£o
63
64
  const dockerfile = `# FluxStack Production Docker Image
64
65
  FROM oven/bun:1.1-alpine AS production
@@ -165,17 +166,17 @@ coverage
165
166
  console.error(`❌ Error writing Docker files:`, error)
166
167
  throw error
167
168
  }
168
-
169
+
169
170
  // Copiar .env ou criar um de exemplo
170
171
  const envPath = join(process.cwd(), '.env')
171
172
  const envExamplePath = join(process.cwd(), '.env.example')
172
173
  const distEnvPath = join(distDir, ".env")
173
-
174
+
174
175
  console.log(`πŸ” Checking for .env files...`)
175
176
  console.log(` - .env path: ${envPath}`)
176
177
  console.log(` - .env.example path: ${envExamplePath}`)
177
178
  console.log(` - target path: ${distEnvPath}`)
178
-
179
+
179
180
  if (existsSync(envPath)) {
180
181
  console.log(`πŸ“„ Copying .env file and setting production mode...`)
181
182
  // Read .env content
@@ -196,22 +197,22 @@ coverage
196
197
  const defaultEnv = `NODE_ENV=production
197
198
  PORT=3000
198
199
  FLUXSTACK_APP_NAME=fluxstack-app
199
- FLUXSTACK_APP_VERSION=1.0.0
200
+ FLUXSTACK_APP_VERSION=${FLUXSTACK_VERSION}
200
201
  LOG_LEVEL=info
201
202
  MONITORING_ENABLED=true
202
203
  `
203
204
  writeFileSync(distEnvPath, defaultEnv)
204
205
  console.log("πŸ“„ Default environment file created for production")
205
206
  }
206
-
207
+
207
208
  // Copy package.json for Docker build
208
209
  const packageJsonPath = join(process.cwd(), 'package.json')
209
210
  const distPackageJsonPath = join(distDir, 'package.json')
210
-
211
+
211
212
  console.log(`πŸ“¦ Copying package.json...`)
212
213
  console.log(` - source: ${packageJsonPath}`)
213
214
  console.log(` - target: ${distPackageJsonPath}`)
214
-
215
+
215
216
  if (existsSync(packageJsonPath)) {
216
217
  copyFileSync(packageJsonPath, distPackageJsonPath)
217
218
  console.log("πŸ“¦ Package.json copied successfully")
@@ -228,41 +229,44 @@ MONITORING_ENABLED=true
228
229
  }
229
230
  writeFileSync(distPackageJsonPath, JSON.stringify(minimalPackageJson, null, 2))
230
231
  }
231
-
232
+
232
233
  console.log("βœ… Docker files created in dist/")
233
234
  }
234
235
 
235
236
 
236
237
  async build(): Promise<BuildResult> {
237
238
  console.log("⚑ FluxStack Framework - Building...")
238
-
239
+
239
240
  const startTime = Date.now()
240
-
241
+
241
242
  try {
242
243
  // Pre-build checks (version sync, etc.)
243
244
  await this.runPreBuildChecks()
244
-
245
+
245
246
  // Validate configuration
246
247
  await this.validateConfig()
247
-
248
+
248
249
  // Clean output directory if requested
249
250
  if (this.config.build.clean) {
250
251
  await this.clean()
251
252
  }
252
-
253
+
253
254
  // Build client and server
254
255
  const clientResult = await this.buildClient()
255
256
  const serverResult = await this.buildServer()
256
-
257
+
257
258
  // Check if builds were successful
258
259
  if (!clientResult.success || !serverResult.success) {
260
+ const errorMessage = clientResult.error || serverResult.error || "Build failed"
259
261
  return {
260
262
  success: false,
261
263
  duration: Date.now() - startTime,
262
- error: clientResult.error || serverResult.error || "Build failed",
263
264
  outputFiles: [],
264
265
  warnings: [],
265
- errors: [],
266
+ errors: [{
267
+ message: errorMessage,
268
+ code: 'BUILD_FAILED'
269
+ }],
266
270
  stats: {
267
271
  totalSize: 0,
268
272
  gzippedSize: 0,
@@ -273,25 +277,25 @@ MONITORING_ENABLED=true
273
277
  }
274
278
  }
275
279
  }
276
-
280
+
277
281
  // Optimize build if enabled
278
282
  let optimizationResult
279
283
  if (this.config.build.optimize) {
280
284
  optimizationResult = await this.optimizer.optimize(this.config.build.outDir)
281
285
  }
282
-
286
+
283
287
  // Create Docker files
284
288
  await this.createDockerFiles()
285
-
289
+
286
290
  // Generate build manifest
287
291
  const manifest = await this.generateManifest(clientResult, serverResult, optimizationResult)
288
-
292
+
289
293
  const duration = Date.now() - startTime
290
-
294
+
291
295
  console.log("πŸŽ‰ Build completed successfully!")
292
296
  console.log(`⏱️ Build time: ${duration}ms`)
293
297
  console.log("🐳 Ready for Docker deployment from dist/ directory")
294
-
298
+
295
299
  return {
296
300
  success: true,
297
301
  duration,
@@ -307,20 +311,23 @@ MONITORING_ENABLED=true
307
311
  dependencies: []
308
312
  }
309
313
  }
310
-
314
+
311
315
  } catch (error) {
312
316
  const duration = Date.now() - startTime
313
317
  const errorMessage = error instanceof Error ? error.message : "Unknown build error"
314
-
318
+
315
319
  console.error("❌ Build failed:", errorMessage)
316
-
320
+
317
321
  return {
318
322
  success: false,
319
323
  duration,
320
- error: errorMessage,
321
324
  outputFiles: [],
322
325
  warnings: [],
323
- errors: [],
326
+ errors: [{
327
+ message: errorMessage,
328
+ code: 'BUILD_EXCEPTION',
329
+ stack: error instanceof Error ? error.stack : undefined
330
+ }],
324
331
  stats: {
325
332
  totalSize: 0,
326
333
  gzippedSize: 0,
@@ -349,7 +356,7 @@ MONITORING_ENABLED=true
349
356
  if (!this.config.build.outDir) {
350
357
  throw new Error("Build output directory not specified")
351
358
  }
352
-
359
+
353
360
  if (!this.config.build.target) {
354
361
  throw new Error("Build target not specified")
355
362
  }
@@ -361,8 +368,8 @@ MONITORING_ENABLED=true
361
368
  }
362
369
 
363
370
  private async generateManifest(
364
- clientResult: any,
365
- serverResult: any,
371
+ clientResult: any,
372
+ serverResult: any,
366
373
  optimizationResult?: any
367
374
  ): Promise<BuildManifest> {
368
375
  return {
@@ -61,6 +61,8 @@ export interface AlertThreshold {
61
61
  message?: string
62
62
  }
63
63
 
64
+ type Plugin = FluxStack.Plugin
65
+
64
66
  export const monitoringPlugin: Plugin = {
65
67
  name: "monitoring",
66
68
  version: "1.0.0",
@@ -2,6 +2,8 @@ import { join, extname } from "path"
2
2
  import { existsSync, statSync } from "fs"
3
3
  import type { FluxStack, PluginContext } from "../../types"
4
4
 
5
+ type Plugin = FluxStack.Plugin
6
+
5
7
  export const staticPlugin: Plugin = {
6
8
  name: "static",
7
9
  version: "1.0.0",
@@ -1,6 +1,8 @@
1
1
  import { swagger } from '@elysiajs/swagger'
2
2
  import type { FluxStack, PluginContext } from '../../types'
3
3
 
4
+ type Plugin = FluxStack.Plugin
5
+
4
6
  export const swaggerPlugin: Plugin = {
5
7
  name: 'swagger',
6
8
  version: '1.0.0',
@@ -83,7 +85,7 @@ export const swaggerPlugin: Plugin = {
83
85
  path: '/swagger',
84
86
  title: 'FluxStack API',
85
87
  description: 'Modern full-stack TypeScript framework with type-safe API endpoints',
86
- version: '1.0.0',
88
+ version: '1.7.4',
87
89
  tags: [
88
90
  {
89
91
  name: 'Health',
@@ -130,7 +132,7 @@ export const swaggerPlugin: Plugin = {
130
132
  documentation: {
131
133
  info: {
132
134
  title: config.title || context.config.app?.name || 'FluxStack API',
133
- version: config.version || context.config.app?.version || '1.0.0',
135
+ version: config.version || context.config.app?.version || '1.7.4',
134
136
  description: config.description || context.config.app?.description || 'Modern full-stack TypeScript framework with type-safe API endpoints'
135
137
  },
136
138
  tags: config.tags,
@@ -1,11 +1,14 @@
1
1
  import type { FluxStack, PluginContext, RequestContext } from "../../types"
2
2
  import { createServer, type ViteDevServer } from 'vite'
3
+ import { FLUXSTACK_VERSION } from "../../../utils/version"
4
+
5
+ type Plugin = FluxStack.Plugin
3
6
 
4
7
  let viteServer: ViteDevServer | null = null
5
8
 
6
9
  export const vitePlugin: Plugin = {
7
10
  name: "vite",
8
- version: "1.0.0",
11
+ version: FLUXSTACK_VERSION,
9
12
  description: "Enhanced Vite integration plugin for FluxStack with improved error handling and monitoring",
10
13
  author: "FluxStack Team",
11
14
  priority: 800, // Should run early to setup proxying
@@ -7,6 +7,8 @@ import type { FluxStack, PluginConfigSchema, PluginValidationResult } from "./ty
7
7
  import type { FluxStackConfig } from "../config/schema"
8
8
  import type { Logger } from "../utils/logger/index"
9
9
 
10
+ type Plugin = FluxStack.Plugin
11
+
10
12
  export interface PluginConfigManager {
11
13
  validatePluginConfig(plugin: Plugin, config: any): PluginValidationResult
12
14
  mergePluginConfig(plugin: Plugin, userConfig: any): any
@@ -9,6 +9,8 @@ import { readdir, readFile } from "fs/promises"
9
9
  import { join, resolve } from "path"
10
10
  import { existsSync } from "fs"
11
11
 
12
+ type Plugin = FluxStack.Plugin
13
+
12
14
  export interface PluginDiscoveryConfig {
13
15
  logger?: Logger
14
16
  baseDir?: string
@@ -28,6 +28,8 @@ export interface PluginExecutionStep {
28
28
  canExecuteInParallel: boolean
29
29
  }
30
30
 
31
+ type Plugin = FluxStack.Plugin
32
+
31
33
  export class PluginExecutor {
32
34
  private logger: Logger
33
35
 
@@ -27,7 +27,6 @@ export type {
27
27
  BuildContext
28
28
  } from './types'
29
29
 
30
- export type { FluxStack }
31
30
  export type Plugin = FluxStack.Plugin
32
31
 
33
32
  // Plugin registry
@@ -200,5 +199,6 @@ import type {
200
199
  PluginPriority,
201
200
  RequestContext,
202
201
  ResponseContext,
203
- ErrorContext
202
+ ErrorContext,
203
+ FluxStack
204
204
  } from './types'
@@ -9,7 +9,7 @@ export const swaggerPlugin: Plugin = {
9
9
  documentation: {
10
10
  info: {
11
11
  title: 'FluxStack API',
12
- version: '1.0.0',
12
+ version: '1.7.4',
13
13
  description: 'Modern full-stack TypeScript framework with type-safe API endpoints'
14
14
  },
15
15
  tags: [
@@ -17,7 +17,7 @@ export const createStandaloneServer = (userConfig: any = {}) => {
17
17
  },
18
18
  middleware: []
19
19
  },
20
- app: { name: 'FluxStack Backend', version: '1.0.0' },
20
+ app: { name: 'FluxStack Backend', version: '1.7.4' },
21
21
  client: { port: 5173, proxy: { target: 'http://localhost:3000' }, build: { sourceMaps: true, minify: false, target: 'es2020', outDir: 'dist' } },
22
22
  ...userConfig
23
23
  })
@@ -287,6 +287,9 @@ export default defineConfig({
287
287
 
288
288
  await Bun.write(join(this.targetDir, "vite.config.ts"), viteConfig)
289
289
 
290
+ // Get FluxStack version dynamically
291
+ const { FLUXSTACK_VERSION } = await import("../utils/version")
292
+
290
293
  // Environment file
291
294
  const envContent = `# FluxStack Environment Variables
292
295
 
@@ -300,6 +303,12 @@ HOST=localhost
300
303
  # Frontend Configuration
301
304
  FRONTEND_PORT=5173
302
305
  VITE_API_URL=http://localhost:3000
306
+ VITE_APP_NAME=FluxStack
307
+ VITE_APP_VERSION=${FLUXSTACK_VERSION}
308
+ VITE_NODE_ENV=development
309
+
310
+ # FluxStack Framework Version
311
+ FLUXSTACK_APP_VERSION=${FLUXSTACK_VERSION}
303
312
 
304
313
  # Backend Configuration
305
314
  BACKEND_PORT=3001
package/core/utils/env.ts CHANGED
@@ -220,7 +220,10 @@ export const env = {
220
220
 
221
221
  // App
222
222
  get FLUXSTACK_APP_NAME() { return this.get('FLUXSTACK_APP_NAME', 'FluxStack') },
223
- get FLUXSTACK_APP_VERSION() { return this.get('FLUXSTACK_APP_VERSION', '1.0.0') },
223
+ get FLUXSTACK_APP_VERSION() {
224
+ const { FLUXSTACK_VERSION } = require('./version')
225
+ return this.get('FLUXSTACK_APP_VERSION', FLUXSTACK_VERSION)
226
+ },
224
227
 
225
228
  // Features
226
229
  get ENABLE_MONITORING() { return this.get('ENABLE_MONITORING', false) },
@@ -3,4 +3,4 @@
3
3
  * Single source of truth for version number
4
4
  * Auto-synced with package.json
5
5
  */
6
- export const FLUXSTACK_VERSION = '1.7.3'
6
+ export const FLUXSTACK_VERSION = '1.7.5'
@@ -21,7 +21,7 @@ ${chalk.gray(`FluxStack v${FLUXSTACK_VERSION} - Creates full-stack TypeScript ap
21
21
  program
22
22
  .name('create-fluxstack')
23
23
  .description('⚑ Create FluxStack apps with zero configuration')
24
- .version('1.0.0')
24
+ .version(FLUXSTACK_VERSION)
25
25
  .argument('[project-name]', 'Name of the project to create')
26
26
  .option('--no-install', 'Skip dependency installation')
27
27
  .option('--no-git', 'Skip git initialization')
@@ -137,7 +137,7 @@ import type { FluxStackPlugin, PluginContext } from '@/core/types/plugin'
137
137
 
138
138
  export class MyPlugin implements FluxStackPlugin {
139
139
  name = 'my-plugin'
140
- version = '1.0.0'
140
+ version = FLUXSTACK_VERSION
141
141
 
142
142
  // Intercept every request
143
143
  async onRequest(context: PluginContext, request: Request): Promise<void> {
@@ -7,6 +7,7 @@
7
7
  import type { FluxStackConfig } from './core/config/schema'
8
8
  import { defineConfig, config as configHelpers } from './core/utils/config-schema'
9
9
  import { env, helpers } from './core/utils/env'
10
+ import { FLUXSTACK_VERSION } from './core/utils/version'
10
11
 
11
12
  console.log(`πŸ”§ Loading FluxStack config for ${env.NODE_ENV} environment`)
12
13
 
@@ -19,7 +20,7 @@ console.log(`πŸ”§ Loading FluxStack config for ${env.NODE_ENV} environment`)
19
20
  */
20
21
  const appConfigSchema = {
21
22
  name: configHelpers.string('FLUXSTACK_APP_NAME', 'FluxStack', true),
22
- version: configHelpers.string('FLUXSTACK_APP_VERSION', '1.0.0', true),
23
+ version: configHelpers.string('FLUXSTACK_APP_VERSION', FLUXSTACK_VERSION, true),
23
24
  description: configHelpers.string('FLUXSTACK_APP_DESCRIPTION', 'A FluxStack application')
24
25
  } as const
25
26
 
@@ -259,7 +260,7 @@ export const config: FluxStackConfig = {
259
260
  },
260
261
  swagger: {
261
262
  title: env.get('SWAGGER_TITLE', 'FluxStack API'),
262
- version: env.get('SWAGGER_VERSION', '1.0.0'),
263
+ version: env.get('SWAGGER_VERSION', FLUXSTACK_VERSION),
263
264
  description: env.get('SWAGGER_DESCRIPTION', 'API documentation for FluxStack application')
264
265
  },
265
266
  staticFiles: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fluxstack",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
4
4
  "description": "⚑ Revolutionary full-stack TypeScript framework with Declarative Config System, Elysia + React + Bun",
5
5
  "keywords": [
6
6
  "framework",
@@ -28,7 +28,6 @@
28
28
  "dev:frontend": "bun run core/cli/index.ts frontend",
29
29
  "dev:backend": "bun run core/cli/index.ts backend",
30
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
-
32
31
  "sync-version": "bun run core/utils/sync-version.ts",
33
32
  "build": "cross-env NODE_ENV=production bun run core/cli/index.ts build",
34
33
  "build:frontend": "vite build --config vite.config.ts --emptyOutDir",
@@ -115,4 +114,4 @@
115
114
  "bun": ">=1.2.0"
116
115
  },
117
116
  "preferredPackageManager": "bun"
118
- }
117
+ }