create-fluxstack 1.7.4 β†’ 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.
@@ -13,7 +13,7 @@ export class FluxStackBuilder {
13
13
 
14
14
  constructor(config: FluxStackConfig) {
15
15
  this.config = config
16
-
16
+
17
17
  // Initialize bundler with configuration
18
18
  this.bundler = new Bundler({
19
19
  target: config.build.target,
@@ -21,7 +21,7 @@ export class FluxStackBuilder {
21
21
  sourceMaps: config.build.sourceMaps,
22
22
  external: config.build.external
23
23
  })
24
-
24
+
25
25
  // Initialize optimizer with configuration
26
26
  this.optimizer = new Optimizer({
27
27
  treeshake: config.build.treeshake,
@@ -47,10 +47,10 @@ export class FluxStackBuilder {
47
47
 
48
48
  async createDockerFiles() {
49
49
  console.log("🐳 Creating Docker files...")
50
-
50
+
51
51
  const distDir = this.config.build.outDir
52
52
  console.log(`πŸ“ Output directory: ${distDir}`)
53
-
53
+
54
54
  // Ensure dist directory exists
55
55
  if (!existsSync(distDir)) {
56
56
  console.log(`πŸ“ Creating directory: ${distDir}`)
@@ -59,7 +59,7 @@ export class FluxStackBuilder {
59
59
  } else {
60
60
  console.log(`βœ… Directory already exists`)
61
61
  }
62
-
62
+
63
63
  // Dockerfile optimizado para produΓ§Γ£o
64
64
  const dockerfile = `# FluxStack Production Docker Image
65
65
  FROM oven/bun:1.1-alpine AS production
@@ -166,17 +166,17 @@ coverage
166
166
  console.error(`❌ Error writing Docker files:`, error)
167
167
  throw error
168
168
  }
169
-
169
+
170
170
  // Copiar .env ou criar um de exemplo
171
171
  const envPath = join(process.cwd(), '.env')
172
172
  const envExamplePath = join(process.cwd(), '.env.example')
173
173
  const distEnvPath = join(distDir, ".env")
174
-
174
+
175
175
  console.log(`πŸ” Checking for .env files...`)
176
176
  console.log(` - .env path: ${envPath}`)
177
177
  console.log(` - .env.example path: ${envExamplePath}`)
178
178
  console.log(` - target path: ${distEnvPath}`)
179
-
179
+
180
180
  if (existsSync(envPath)) {
181
181
  console.log(`πŸ“„ Copying .env file and setting production mode...`)
182
182
  // Read .env content
@@ -204,15 +204,15 @@ MONITORING_ENABLED=true
204
204
  writeFileSync(distEnvPath, defaultEnv)
205
205
  console.log("πŸ“„ Default environment file created for production")
206
206
  }
207
-
207
+
208
208
  // Copy package.json for Docker build
209
209
  const packageJsonPath = join(process.cwd(), 'package.json')
210
210
  const distPackageJsonPath = join(distDir, 'package.json')
211
-
211
+
212
212
  console.log(`πŸ“¦ Copying package.json...`)
213
213
  console.log(` - source: ${packageJsonPath}`)
214
214
  console.log(` - target: ${distPackageJsonPath}`)
215
-
215
+
216
216
  if (existsSync(packageJsonPath)) {
217
217
  copyFileSync(packageJsonPath, distPackageJsonPath)
218
218
  console.log("πŸ“¦ Package.json copied successfully")
@@ -229,41 +229,44 @@ MONITORING_ENABLED=true
229
229
  }
230
230
  writeFileSync(distPackageJsonPath, JSON.stringify(minimalPackageJson, null, 2))
231
231
  }
232
-
232
+
233
233
  console.log("βœ… Docker files created in dist/")
234
234
  }
235
235
 
236
236
 
237
237
  async build(): Promise<BuildResult> {
238
238
  console.log("⚑ FluxStack Framework - Building...")
239
-
239
+
240
240
  const startTime = Date.now()
241
-
241
+
242
242
  try {
243
243
  // Pre-build checks (version sync, etc.)
244
244
  await this.runPreBuildChecks()
245
-
245
+
246
246
  // Validate configuration
247
247
  await this.validateConfig()
248
-
248
+
249
249
  // Clean output directory if requested
250
250
  if (this.config.build.clean) {
251
251
  await this.clean()
252
252
  }
253
-
253
+
254
254
  // Build client and server
255
255
  const clientResult = await this.buildClient()
256
256
  const serverResult = await this.buildServer()
257
-
257
+
258
258
  // Check if builds were successful
259
259
  if (!clientResult.success || !serverResult.success) {
260
+ const errorMessage = clientResult.error || serverResult.error || "Build failed"
260
261
  return {
261
262
  success: false,
262
263
  duration: Date.now() - startTime,
263
- error: clientResult.error || serverResult.error || "Build failed",
264
264
  outputFiles: [],
265
265
  warnings: [],
266
- errors: [],
266
+ errors: [{
267
+ message: errorMessage,
268
+ code: 'BUILD_FAILED'
269
+ }],
267
270
  stats: {
268
271
  totalSize: 0,
269
272
  gzippedSize: 0,
@@ -274,25 +277,25 @@ MONITORING_ENABLED=true
274
277
  }
275
278
  }
276
279
  }
277
-
280
+
278
281
  // Optimize build if enabled
279
282
  let optimizationResult
280
283
  if (this.config.build.optimize) {
281
284
  optimizationResult = await this.optimizer.optimize(this.config.build.outDir)
282
285
  }
283
-
286
+
284
287
  // Create Docker files
285
288
  await this.createDockerFiles()
286
-
289
+
287
290
  // Generate build manifest
288
291
  const manifest = await this.generateManifest(clientResult, serverResult, optimizationResult)
289
-
292
+
290
293
  const duration = Date.now() - startTime
291
-
294
+
292
295
  console.log("πŸŽ‰ Build completed successfully!")
293
296
  console.log(`⏱️ Build time: ${duration}ms`)
294
297
  console.log("🐳 Ready for Docker deployment from dist/ directory")
295
-
298
+
296
299
  return {
297
300
  success: true,
298
301
  duration,
@@ -308,20 +311,23 @@ MONITORING_ENABLED=true
308
311
  dependencies: []
309
312
  }
310
313
  }
311
-
314
+
312
315
  } catch (error) {
313
316
  const duration = Date.now() - startTime
314
317
  const errorMessage = error instanceof Error ? error.message : "Unknown build error"
315
-
318
+
316
319
  console.error("❌ Build failed:", errorMessage)
317
-
320
+
318
321
  return {
319
322
  success: false,
320
323
  duration,
321
- error: errorMessage,
322
324
  outputFiles: [],
323
325
  warnings: [],
324
- errors: [],
326
+ errors: [{
327
+ message: errorMessage,
328
+ code: 'BUILD_EXCEPTION',
329
+ stack: error instanceof Error ? error.stack : undefined
330
+ }],
325
331
  stats: {
326
332
  totalSize: 0,
327
333
  gzippedSize: 0,
@@ -350,7 +356,7 @@ MONITORING_ENABLED=true
350
356
  if (!this.config.build.outDir) {
351
357
  throw new Error("Build output directory not specified")
352
358
  }
353
-
359
+
354
360
  if (!this.config.build.target) {
355
361
  throw new Error("Build target not specified")
356
362
  }
@@ -362,8 +368,8 @@ MONITORING_ENABLED=true
362
368
  }
363
369
 
364
370
  private async generateManifest(
365
- clientResult: any,
366
- serverResult: any,
371
+ clientResult: any,
372
+ serverResult: any,
367
373
  optimizationResult?: any
368
374
  ): Promise<BuildManifest> {
369
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',
@@ -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'
@@ -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.4'
6
+ export const FLUXSTACK_VERSION = '1.7.5'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fluxstack",
3
- "version": "1.7.4",
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",