create-fluxstack 1.0.0 → 1.0.2

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.
Files changed (101) hide show
  1. package/create-fluxstack.ts +32 -17
  2. package/package-template.json +51 -0
  3. package/package.json +2 -1
  4. package/.env +0 -30
  5. package/LICENSE +0 -21
  6. package/app/client/README.md +0 -69
  7. package/app/client/frontend-only.ts +0 -12
  8. package/app/client/index.html +0 -13
  9. package/app/client/public/vite.svg +0 -1
  10. package/app/client/src/App.css +0 -883
  11. package/app/client/src/App.tsx +0 -669
  12. package/app/client/src/assets/react.svg +0 -1
  13. package/app/client/src/components/TestPage.tsx +0 -453
  14. package/app/client/src/index.css +0 -51
  15. package/app/client/src/lib/eden-api.ts +0 -110
  16. package/app/client/src/main.tsx +0 -10
  17. package/app/client/src/vite-env.d.ts +0 -1
  18. package/app/client/tsconfig.app.json +0 -43
  19. package/app/client/tsconfig.json +0 -7
  20. package/app/client/tsconfig.node.json +0 -25
  21. package/app/server/app.ts +0 -10
  22. package/app/server/backend-only.ts +0 -15
  23. package/app/server/controllers/users.controller.ts +0 -69
  24. package/app/server/index.ts +0 -104
  25. package/app/server/routes/index.ts +0 -25
  26. package/app/server/routes/users.routes.ts +0 -121
  27. package/app/server/types/index.ts +0 -1
  28. package/app/shared/types/index.ts +0 -18
  29. package/bun.lock +0 -1053
  30. package/core/__tests__/integration.test.ts +0 -227
  31. package/core/build/index.ts +0 -186
  32. package/core/cli/command-registry.ts +0 -334
  33. package/core/cli/index.ts +0 -394
  34. package/core/cli/plugin-discovery.ts +0 -200
  35. package/core/client/standalone.ts +0 -57
  36. package/core/config/__tests__/config-loader.test.ts +0 -591
  37. package/core/config/__tests__/config-merger.test.ts +0 -657
  38. package/core/config/__tests__/env-converter.test.ts +0 -372
  39. package/core/config/__tests__/env-processor.test.ts +0 -431
  40. package/core/config/__tests__/env.test.ts +0 -452
  41. package/core/config/__tests__/integration.test.ts +0 -418
  42. package/core/config/__tests__/loader.test.ts +0 -331
  43. package/core/config/__tests__/schema.test.ts +0 -129
  44. package/core/config/__tests__/validator.test.ts +0 -318
  45. package/core/config/env-dynamic.ts +0 -326
  46. package/core/config/env.ts +0 -597
  47. package/core/config/index.ts +0 -317
  48. package/core/config/loader.ts +0 -546
  49. package/core/config/runtime-config.ts +0 -322
  50. package/core/config/schema.ts +0 -694
  51. package/core/config/validator.ts +0 -540
  52. package/core/framework/__tests__/server.test.ts +0 -233
  53. package/core/framework/client.ts +0 -132
  54. package/core/framework/index.ts +0 -8
  55. package/core/framework/server.ts +0 -501
  56. package/core/framework/types.ts +0 -63
  57. package/core/plugins/__tests__/built-in.test.ts.disabled +0 -366
  58. package/core/plugins/__tests__/manager.test.ts +0 -398
  59. package/core/plugins/__tests__/monitoring.test.ts +0 -401
  60. package/core/plugins/__tests__/registry.test.ts +0 -335
  61. package/core/plugins/built-in/index.ts +0 -142
  62. package/core/plugins/built-in/logger/index.ts +0 -180
  63. package/core/plugins/built-in/monitoring/README.md +0 -193
  64. package/core/plugins/built-in/monitoring/index.ts +0 -912
  65. package/core/plugins/built-in/static/index.ts +0 -289
  66. package/core/plugins/built-in/swagger/index.ts +0 -229
  67. package/core/plugins/built-in/vite/index.ts +0 -316
  68. package/core/plugins/config.ts +0 -348
  69. package/core/plugins/discovery.ts +0 -350
  70. package/core/plugins/executor.ts +0 -351
  71. package/core/plugins/index.ts +0 -195
  72. package/core/plugins/manager.ts +0 -583
  73. package/core/plugins/registry.ts +0 -424
  74. package/core/plugins/types.ts +0 -254
  75. package/core/server/framework.ts +0 -123
  76. package/core/server/index.ts +0 -8
  77. package/core/server/plugins/database.ts +0 -182
  78. package/core/server/plugins/logger.ts +0 -47
  79. package/core/server/plugins/swagger.ts +0 -34
  80. package/core/server/standalone.ts +0 -91
  81. package/core/templates/create-project.ts +0 -455
  82. package/core/types/api.ts +0 -169
  83. package/core/types/build.ts +0 -174
  84. package/core/types/config.ts +0 -68
  85. package/core/types/index.ts +0 -127
  86. package/core/types/plugin.ts +0 -94
  87. package/core/utils/__tests__/errors.test.ts +0 -139
  88. package/core/utils/__tests__/helpers.test.ts +0 -297
  89. package/core/utils/__tests__/logger.test.ts +0 -141
  90. package/core/utils/env-runtime-v2.ts +0 -232
  91. package/core/utils/env-runtime.ts +0 -252
  92. package/core/utils/errors/codes.ts +0 -115
  93. package/core/utils/errors/handlers.ts +0 -63
  94. package/core/utils/errors/index.ts +0 -81
  95. package/core/utils/helpers.ts +0 -180
  96. package/core/utils/index.ts +0 -18
  97. package/core/utils/logger/index.ts +0 -161
  98. package/core/utils/logger.ts +0 -106
  99. package/core/utils/monitoring/index.ts +0 -212
  100. package/tsconfig.json +0 -51
  101. package/vite.config.ts +0 -42
@@ -53,10 +53,10 @@ program
53
53
  mkdirSync(projectPath, { recursive: true })
54
54
 
55
55
  // Copy only essential FluxStack files (not node_modules, not test apps, etc.)
56
+ const frameworkDir = join(currentDir, '../../') // Navigate to framework root
56
57
  const filesToCopy = [
57
58
  'core',
58
59
  'app',
59
- 'package.json',
60
60
  'bun.lock', // ✅ CRITICAL: Copy lockfile to maintain working versions
61
61
  'tsconfig.json',
62
62
  'vite.config.ts',
@@ -65,7 +65,7 @@ program
65
65
  ]
66
66
 
67
67
  for (const file of filesToCopy) {
68
- const sourcePath = join(currentDir, file)
68
+ const sourcePath = join(frameworkDir, file)
69
69
  const destPath = join(projectPath, file)
70
70
 
71
71
  if (existsSync(sourcePath)) {
@@ -73,22 +73,37 @@ program
73
73
  }
74
74
  }
75
75
 
76
- // Customize package.json
76
+ // Create package.json from template
77
77
  const packageJsonPath = join(projectPath, 'package.json')
78
- if (existsSync(packageJsonPath)) {
79
- const packageContent = readFileSync(packageJsonPath, 'utf-8')
80
- const packageJson = JSON.parse(packageContent)
81
-
82
- packageJson.name = projectName
83
- packageJson.description = `${projectName} - FluxStack application`
84
-
85
- // Remove scripts that don't make sense for user projects
86
- delete packageJson.scripts['test:watch']
87
- delete packageJson.scripts['test:coverage']
88
- delete packageJson.scripts['docs:build']
89
- delete packageJson.scripts['docs:serve']
90
-
91
- writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2))
78
+ const templatePath = join(import.meta.dir, 'package-template.json')
79
+
80
+ if (existsSync(templatePath)) {
81
+ const templateContent = readFileSync(templatePath, 'utf-8')
82
+ const packageTemplate = templateContent.replace(/PROJECT_NAME/g, projectName)
83
+ writeFileSync(packageJsonPath, packageTemplate)
84
+ } else {
85
+ // Fallback template if package-template.json doesn't exist
86
+ const fallbackPackageJson = {
87
+ "name": projectName,
88
+ "version": "1.0.0",
89
+ "description": `${projectName} - FluxStack application`,
90
+ "keywords": ["fluxstack", "bun", "typescript", "full-stack", "elysia", "react", "vite"],
91
+ "author": "Your Name",
92
+ "license": "MIT",
93
+ "type": "module",
94
+ "scripts": {
95
+ "dev": "bun core/cli/index.ts dev",
96
+ "dev:clean": "bun run-clean.ts",
97
+ "dev:backend": "bun core/cli/index.ts dev:backend",
98
+ "dev:frontend": "bun core/cli/index.ts dev:frontend",
99
+ "build": "bun core/cli/index.ts build",
100
+ "build:backend": "bun core/cli/index.ts build:backend",
101
+ "build:frontend": "bun core/cli/index.ts build:frontend",
102
+ "start": "NODE_ENV=production bun app/server/index.ts",
103
+ "typecheck": "bunx tsc --noEmit"
104
+ }
105
+ }
106
+ writeFileSync(packageJsonPath, JSON.stringify(fallbackPackageJson, null, 2))
92
107
  }
93
108
 
94
109
  // Customize .env for development mode
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "PROJECT_NAME",
3
+ "version": "1.0.0",
4
+ "description": "PROJECT_NAME - FluxStack application",
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
+ "dependencies": {
26
+ "@types/react": "^19.1.2",
27
+ "@types/react-dom": "^19.1.5",
28
+ "@vitejs/plugin-react": "^4.3.6",
29
+ "elysia": "^1.4.6",
30
+ "react": "^19.1.0",
31
+ "react-dom": "^19.1.0",
32
+ "tailwindcss": "^4.1.0",
33
+ "typescript": "^5.9.2",
34
+ "vite": "^7.0.4",
35
+ "vitest": "^2.2.0"
36
+ },
37
+ "devDependencies": {
38
+ "@eden-treaty/elysia": "^1.1.5",
39
+ "@swagger-ui/dist": "^5.19.2",
40
+ "@types/bun": "latest",
41
+ "@vitest/coverage-v8": "^2.2.0",
42
+ "@vitest/ui": "^2.2.0",
43
+ "happy-dom": "^16.7.0"
44
+ },
45
+ "engines": {
46
+ "bun": ">=1.2.0",
47
+ "node": ">=20.0.0"
48
+ },
49
+ "preferredPackageManager": "bun",
50
+ "trustedDependencies": ["esbuild"]
51
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fluxstack",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "⚡ Create FluxStack apps with zero configuration - powered by Bun",
5
5
  "keywords": ["fluxstack", "create-app", "bun", "typescript", "full-stack", "framework", "elysia", "react", "vite"],
6
6
  "author": "Marcos",
@@ -16,6 +16,7 @@
16
16
  },
17
17
  "files": [
18
18
  "create-fluxstack.ts",
19
+ "package-template.json",
19
20
  "core/**/*",
20
21
  "app/**/*",
21
22
  "README.md",
package/.env DELETED
@@ -1,30 +0,0 @@
1
- # FluxStack Environment Variables
2
-
3
- # Development Mode
4
- #NODE_ENV=development
5
- NODE_ENV=production
6
- # Server Configuration
7
- PORT=3000
8
- HOST=localhost
9
-
10
- # Frontend Configuration
11
- FRONTEND_PORT=5173
12
- VITE_API_URL=http://localhost:3000
13
- VITE_APP_NAME=FluxStack
14
- VITE_APP_VERSION=1.4.0
15
- VITE_NODE_ENV=development
16
-
17
- # Backend Configuration
18
- BACKEND_PORT=3001
19
-
20
- # CORS Configuration
21
- CORS_ORIGINS=http://localhost:3000,http://localhost:5173
22
- CORS_METHODS=GET,POST,PUT,DELETE,OPTIONS
23
- CORS_HEADERS=Content-Type,Authorization
24
-
25
- # Logging
26
- LOG_LEVEL=info
27
-
28
- # Build Configuration
29
- BUILD_TARGET=bun
30
- BUILD_OUTDIR=dist
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Marcos Brendon De Paula
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,69 +0,0 @@
1
- # React + TypeScript + Vite
2
-
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
-
5
- Currently, two official plugins are available:
6
-
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
-
10
- ## Expanding the ESLint configuration
11
-
12
- If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
13
-
14
- ```js
15
- export default tseslint.config([
16
- globalIgnores(['dist']),
17
- {
18
- files: ['**/*.{ts,tsx}'],
19
- extends: [
20
- // Other configs...
21
-
22
- // Remove tseslint.configs.recommended and replace with this
23
- ...tseslint.configs.recommendedTypeChecked,
24
- // Alternatively, use this for stricter rules
25
- ...tseslint.configs.strictTypeChecked,
26
- // Optionally, add this for stylistic rules
27
- ...tseslint.configs.stylisticTypeChecked,
28
-
29
- // Other configs...
30
- ],
31
- languageOptions: {
32
- parserOptions: {
33
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
34
- tsconfigRootDir: import.meta.dirname,
35
- },
36
- // other options...
37
- },
38
- },
39
- ])
40
- ```
41
-
42
- You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
43
-
44
- ```js
45
- // eslint.config.js
46
- import reactX from 'eslint-plugin-react-x'
47
- import reactDom from 'eslint-plugin-react-dom'
48
-
49
- export default tseslint.config([
50
- globalIgnores(['dist']),
51
- {
52
- files: ['**/*.{ts,tsx}'],
53
- extends: [
54
- // Other configs...
55
- // Enable lint rules for React
56
- reactX.configs['recommended-typescript'],
57
- // Enable lint rules for React DOM
58
- reactDom.configs.recommended,
59
- ],
60
- languageOptions: {
61
- parserOptions: {
62
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
63
- tsconfigRootDir: import.meta.dirname,
64
- },
65
- // other options...
66
- },
67
- },
68
- ])
69
- ```
@@ -1,12 +0,0 @@
1
- // Frontend standalone entry point
2
- import { startFrontendOnly } from "../../core/client/standalone"
3
-
4
- // Configuração para frontend standalone
5
- const frontendConfig = {
6
- clientPath: "app/client",
7
- vitePort: (globalThis as any).process?.env?.FRONTEND_PORT || 5173,
8
- apiUrl: (globalThis as any).process?.env?.API_URL || "http://localhost:3001"
9
- }
10
-
11
- // Iniciar apenas o frontend
12
- startFrontendOnly(frontendConfig)
@@ -1,13 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
- <title>Vite + React + TS</title>
8
- </head>
9
- <body>
10
- <div id="root"></div>
11
- <script type="module" src="/src/main.tsx"></script>
12
- </body>
13
- </html>
@@ -1 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>