create-fluxstack 1.7.0 → 1.7.4

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
@@ -196,7 +197,7 @@ 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
  `
@@ -239,6 +240,9 @@ MONITORING_ENABLED=true
239
240
  const startTime = Date.now()
240
241
 
241
242
  try {
243
+ // Pre-build checks (version sync, etc.)
244
+ await this.runPreBuildChecks()
245
+
242
246
  // Validate configuration
243
247
  await this.validateConfig()
244
248
 
@@ -330,6 +334,17 @@ MONITORING_ENABLED=true
330
334
  }
331
335
  }
332
336
 
337
+ private async runPreBuildChecks(): Promise<void> {
338
+ try {
339
+ // Import and run version sync silently
340
+ const { syncVersion } = await import("../utils/sync-version")
341
+ syncVersion(true) // Pass true for silent mode
342
+ } catch (error) {
343
+ // Silently handle pre-build check failures
344
+ // Don't fail the build for pre-build check failures
345
+ }
346
+ }
347
+
333
348
  private async validateConfig(): Promise<void> {
334
349
  // Validate build configuration
335
350
  if (!this.config.build.outDir) {
@@ -83,7 +83,7 @@ export const swaggerPlugin: Plugin = {
83
83
  path: '/swagger',
84
84
  title: 'FluxStack API',
85
85
  description: 'Modern full-stack TypeScript framework with type-safe API endpoints',
86
- version: '1.0.0',
86
+ version: '1.7.4',
87
87
  tags: [
88
88
  {
89
89
  name: 'Health',
@@ -130,7 +130,7 @@ export const swaggerPlugin: Plugin = {
130
130
  documentation: {
131
131
  info: {
132
132
  title: config.title || context.config.app?.name || 'FluxStack API',
133
- version: config.version || context.config.app?.version || '1.0.0',
133
+ version: config.version || context.config.app?.version || '1.7.4',
134
134
  description: config.description || context.config.app?.description || 'Modern full-stack TypeScript framework with type-safe API endpoints'
135
135
  },
136
136
  tags: config.tags,
@@ -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
  })
@@ -144,6 +144,7 @@ export class ProjectCreator {
144
144
  dev: "bun run core/cli/index.ts dev",
145
145
  "dev:frontend": "bun run core/cli/index.ts frontend",
146
146
  "dev:backend": "bun run core/cli/index.ts backend",
147
+ "sync-version": "bun run core/utils/sync-version.ts",
147
148
  build: "bun run core/cli/index.ts build",
148
149
  "build:frontend": "bun run core/cli/index.ts build:frontend",
149
150
  "build:backend": "bun run core/cli/index.ts build:backend",
@@ -286,6 +287,9 @@ export default defineConfig({
286
287
 
287
288
  await Bun.write(join(this.targetDir, "vite.config.ts"), viteConfig)
288
289
 
290
+ // Get FluxStack version dynamically
291
+ const { FLUXSTACK_VERSION } = await import("../utils/version")
292
+
289
293
  // Environment file
290
294
  const envContent = `# FluxStack Environment Variables
291
295
 
@@ -299,6 +303,12 @@ HOST=localhost
299
303
  # Frontend Configuration
300
304
  FRONTEND_PORT=5173
301
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}
302
312
 
303
313
  # Backend Configuration
304
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) },
@@ -26,7 +26,7 @@ function getPackageVersion(): string {
26
26
  /**
27
27
  * Update version.ts with the version from package.json
28
28
  */
29
- function updateVersionFile(version: string): void {
29
+ function updateVersionFile(version: string, silent = false): void {
30
30
  const versionPath = join(process.cwd(), 'core/utils/version.ts')
31
31
  const versionContent = `/**
32
32
  * FluxStack Framework Version
@@ -36,19 +36,25 @@ function updateVersionFile(version: string): void {
36
36
  export const FLUXSTACK_VERSION = '${version}'
37
37
  `
38
38
  writeFileSync(versionPath, versionContent)
39
- console.log(`✅ Updated version.ts to v${version}`)
39
+ if (!silent) {
40
+ console.log(`✅ Updated version.ts to v${version}`)
41
+ }
40
42
  }
41
43
 
42
44
  /**
43
45
  * Main sync function
44
46
  */
45
- function syncVersion(): void {
47
+ function syncVersion(silent = false): void {
46
48
  try {
47
49
  const packageVersion = getPackageVersion()
48
- updateVersionFile(packageVersion)
49
- console.log(`🔄 Version synchronized: v${packageVersion}`)
50
+ updateVersionFile(packageVersion, silent)
51
+ if (!silent) {
52
+ console.log(`🔄 Version synchronized: v${packageVersion}`)
53
+ }
50
54
  } catch (error) {
51
- console.error('❌ Failed to sync version:', error)
55
+ if (!silent) {
56
+ console.error('❌ Failed to sync version:', error)
57
+ }
52
58
  process.exit(1)
53
59
  }
54
60
  }
@@ -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.0'
6
+ export const FLUXSTACK_VERSION = '1.7.4'
@@ -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.0",
3
+ "version": "1.7.4",
4
4
  "description": "⚡ Revolutionary full-stack TypeScript framework with Declarative Config System, Elysia + React + Bun",
5
5
  "keywords": [
6
6
  "framework",
@@ -28,10 +28,8 @@
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
- "prebuild": "bun run scripts/prebuild.ts",
34
- "build": "bun run prebuild && cross-env NODE_ENV=production bun run core/cli/index.ts build",
32
+ "build": "cross-env NODE_ENV=production bun run core/cli/index.ts build",
35
33
  "build:frontend": "vite build --config vite.config.ts --emptyOutDir",
36
34
  "build:backend": "bun run core/cli/index.ts build:backend",
37
35
  "start": "bun run core/cli/index.ts start",
@@ -116,4 +114,4 @@
116
114
  "bun": ">=1.2.0"
117
115
  },
118
116
  "preferredPackageManager": "bun"
119
- }
117
+ }