create-fluxstack 1.0.1 → 1.0.3

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 (466) hide show
  1. package/.claude/settings.local.json +63 -0
  2. package/.dockerignore +50 -0
  3. package/.env.example +53 -0
  4. package/.gitattributes +2 -0
  5. package/.github/workflows/ci-build-tests.yml +480 -0
  6. package/.github/workflows/dependency-management.yml +324 -0
  7. package/.github/workflows/release-validation.yml +355 -0
  8. package/.kiro/specs/fluxstack-architecture-optimization/design.md +700 -0
  9. package/.kiro/specs/fluxstack-architecture-optimization/requirements.md +127 -0
  10. package/.kiro/specs/fluxstack-architecture-optimization/tasks.md +330 -0
  11. package/CLAUDE.md +200 -0
  12. package/Dockerfile +58 -0
  13. package/Dockerfile.backend +52 -0
  14. package/Dockerfile.frontend +54 -0
  15. package/ENV_TESTING_REPORT.md +292 -0
  16. package/FRAMEWORK_ROADMAP.md +183 -0
  17. package/FRONTEND_TESTS_README.md +287 -0
  18. package/README-Docker.md +85 -0
  19. package/TEST_RESULTS.md +130 -0
  20. package/ai-context/00-QUICK-START.md +86 -0
  21. package/ai-context/README.md +88 -0
  22. package/ai-context/development/eden-treaty-guide.md +362 -0
  23. package/ai-context/development/patterns.md +382 -0
  24. package/ai-context/examples/crud-complete.md +626 -0
  25. package/ai-context/project/architecture.md +399 -0
  26. package/ai-context/project/overview.md +213 -0
  27. package/ai-context/recent-changes/eden-treaty-refactor.md +281 -0
  28. package/ai-context/recent-changes/type-inference-fix.md +223 -0
  29. package/ai-context/reference/environment-vars.md +384 -0
  30. package/ai-context/reference/troubleshooting.md +407 -0
  31. package/bun.lock +21 -11
  32. package/bunfig.toml +16 -0
  33. package/config/fluxstack.config.ts +48 -0
  34. package/create-fluxstack.ts +2 -3
  35. package/create-test-app.ts +156 -0
  36. package/docker-compose.microservices.yml +75 -0
  37. package/docker-compose.simple.yml +57 -0
  38. package/docker-compose.yml +71 -0
  39. package/docs/dynamic-environment-variables.md +380 -0
  40. package/eslint.config.js +23 -0
  41. package/examples/dynamic-env-usage.ts +283 -0
  42. package/examples/hybrid-env-strategy.ts +212 -0
  43. package/examples/simplified-env-usage.ts +251 -0
  44. package/flux-cli.ts +214 -0
  45. package/fluxstack.config.ts +318 -0
  46. package/meu-app-teste/README.md +44 -0
  47. package/meu-app-teste/app/client/README.md +69 -0
  48. package/meu-app-teste/app/client/frontend-only.ts +12 -0
  49. package/meu-app-teste/app/client/index.html +13 -0
  50. package/meu-app-teste/app/client/public/vite.svg +1 -0
  51. package/meu-app-teste/app/client/src/App.css +883 -0
  52. package/meu-app-teste/app/client/src/App.tsx +669 -0
  53. package/meu-app-teste/app/client/src/assets/react.svg +1 -0
  54. package/meu-app-teste/app/client/src/components/TestPage.tsx +453 -0
  55. package/meu-app-teste/app/client/src/index.css +51 -0
  56. package/meu-app-teste/app/client/src/lib/eden-api.ts +110 -0
  57. package/meu-app-teste/app/client/src/main.tsx +10 -0
  58. package/meu-app-teste/app/client/src/vite-env.d.ts +1 -0
  59. package/meu-app-teste/app/client/tsconfig.app.json +43 -0
  60. package/meu-app-teste/app/client/tsconfig.json +7 -0
  61. package/meu-app-teste/app/client/tsconfig.node.json +25 -0
  62. package/meu-app-teste/app/server/app.ts +10 -0
  63. package/meu-app-teste/app/server/backend-only.ts +15 -0
  64. package/meu-app-teste/app/server/controllers/users.controller.ts +69 -0
  65. package/meu-app-teste/app/server/index.ts +104 -0
  66. package/meu-app-teste/app/server/routes/index.ts +25 -0
  67. package/meu-app-teste/app/server/routes/users.routes.ts +121 -0
  68. package/meu-app-teste/app/server/types/index.ts +1 -0
  69. package/meu-app-teste/app/shared/types/index.ts +18 -0
  70. package/meu-app-teste/bun.lock +1053 -0
  71. package/meu-app-teste/core/__tests__/integration.test.ts +227 -0
  72. package/meu-app-teste/core/build/index.ts +186 -0
  73. package/meu-app-teste/core/cli/command-registry.ts +334 -0
  74. package/meu-app-teste/core/cli/index.ts +394 -0
  75. package/meu-app-teste/core/cli/plugin-discovery.ts +200 -0
  76. package/meu-app-teste/core/client/standalone.ts +57 -0
  77. package/meu-app-teste/core/config/__tests__/config-loader.test.ts +591 -0
  78. package/meu-app-teste/core/config/__tests__/config-merger.test.ts +657 -0
  79. package/meu-app-teste/core/config/__tests__/env-converter.test.ts +372 -0
  80. package/meu-app-teste/core/config/__tests__/env-processor.test.ts +431 -0
  81. package/meu-app-teste/core/config/__tests__/env.test.ts +452 -0
  82. package/meu-app-teste/core/config/__tests__/integration.test.ts +418 -0
  83. package/meu-app-teste/core/config/__tests__/loader.test.ts +331 -0
  84. package/meu-app-teste/core/config/__tests__/schema.test.ts +129 -0
  85. package/meu-app-teste/core/config/__tests__/validator.test.ts +318 -0
  86. package/meu-app-teste/core/config/env-dynamic.ts +326 -0
  87. package/meu-app-teste/core/config/env.ts +597 -0
  88. package/meu-app-teste/core/config/index.ts +317 -0
  89. package/meu-app-teste/core/config/loader.ts +546 -0
  90. package/meu-app-teste/core/config/runtime-config.ts +322 -0
  91. package/meu-app-teste/core/config/schema.ts +694 -0
  92. package/meu-app-teste/core/config/validator.ts +540 -0
  93. package/meu-app-teste/core/framework/__tests__/server.test.ts +233 -0
  94. package/meu-app-teste/core/framework/client.ts +132 -0
  95. package/meu-app-teste/core/framework/index.ts +8 -0
  96. package/meu-app-teste/core/framework/server.ts +501 -0
  97. package/meu-app-teste/core/framework/types.ts +63 -0
  98. package/meu-app-teste/core/plugins/__tests__/built-in.test.ts.disabled +366 -0
  99. package/meu-app-teste/core/plugins/__tests__/manager.test.ts +398 -0
  100. package/meu-app-teste/core/plugins/__tests__/monitoring.test.ts +401 -0
  101. package/meu-app-teste/core/plugins/__tests__/registry.test.ts +335 -0
  102. package/meu-app-teste/core/plugins/built-in/index.ts +142 -0
  103. package/meu-app-teste/core/plugins/built-in/logger/index.ts +180 -0
  104. package/meu-app-teste/core/plugins/built-in/monitoring/README.md +193 -0
  105. package/meu-app-teste/core/plugins/built-in/monitoring/index.ts +912 -0
  106. package/meu-app-teste/core/plugins/built-in/static/index.ts +289 -0
  107. package/meu-app-teste/core/plugins/built-in/swagger/index.ts +229 -0
  108. package/meu-app-teste/core/plugins/built-in/vite/index.ts +316 -0
  109. package/meu-app-teste/core/plugins/config.ts +348 -0
  110. package/meu-app-teste/core/plugins/discovery.ts +350 -0
  111. package/meu-app-teste/core/plugins/executor.ts +351 -0
  112. package/meu-app-teste/core/plugins/index.ts +195 -0
  113. package/meu-app-teste/core/plugins/manager.ts +583 -0
  114. package/meu-app-teste/core/plugins/registry.ts +424 -0
  115. package/meu-app-teste/core/plugins/types.ts +254 -0
  116. package/meu-app-teste/core/server/framework.ts +123 -0
  117. package/meu-app-teste/core/server/index.ts +8 -0
  118. package/meu-app-teste/core/server/plugins/database.ts +182 -0
  119. package/meu-app-teste/core/server/plugins/logger.ts +47 -0
  120. package/meu-app-teste/core/server/plugins/swagger.ts +34 -0
  121. package/meu-app-teste/core/server/standalone.ts +91 -0
  122. package/meu-app-teste/core/templates/create-project.ts +455 -0
  123. package/meu-app-teste/core/types/api.ts +169 -0
  124. package/meu-app-teste/core/types/build.ts +174 -0
  125. package/meu-app-teste/core/types/config.ts +68 -0
  126. package/meu-app-teste/core/types/index.ts +127 -0
  127. package/meu-app-teste/core/types/plugin.ts +94 -0
  128. package/meu-app-teste/core/utils/__tests__/errors.test.ts +139 -0
  129. package/meu-app-teste/core/utils/__tests__/helpers.test.ts +297 -0
  130. package/meu-app-teste/core/utils/__tests__/logger.test.ts +141 -0
  131. package/meu-app-teste/core/utils/env-runtime-v2.ts +232 -0
  132. package/meu-app-teste/core/utils/env-runtime.ts +252 -0
  133. package/meu-app-teste/core/utils/errors/codes.ts +115 -0
  134. package/meu-app-teste/core/utils/errors/handlers.ts +63 -0
  135. package/meu-app-teste/core/utils/errors/index.ts +81 -0
  136. package/meu-app-teste/core/utils/helpers.ts +180 -0
  137. package/meu-app-teste/core/utils/index.ts +18 -0
  138. package/meu-app-teste/core/utils/logger/index.ts +161 -0
  139. package/meu-app-teste/core/utils/logger.ts +106 -0
  140. package/meu-app-teste/core/utils/monitoring/index.ts +212 -0
  141. package/meu-app-teste/package.json +92 -0
  142. package/meu-app-teste/tsconfig.json +51 -0
  143. package/meu-app-teste/vite.config.ts +42 -0
  144. package/my-final-test/README.md +44 -0
  145. package/my-final-test/app/client/README.md +69 -0
  146. package/my-final-test/app/client/frontend-only.ts +12 -0
  147. package/my-final-test/app/client/index.html +13 -0
  148. package/my-final-test/app/client/public/vite.svg +1 -0
  149. package/my-final-test/app/client/src/App.css +883 -0
  150. package/my-final-test/app/client/src/App.tsx +669 -0
  151. package/my-final-test/app/client/src/assets/react.svg +1 -0
  152. package/my-final-test/app/client/src/components/TestPage.tsx +453 -0
  153. package/my-final-test/app/client/src/index.css +51 -0
  154. package/my-final-test/app/client/src/lib/eden-api.ts +110 -0
  155. package/my-final-test/app/client/src/main.tsx +10 -0
  156. package/my-final-test/app/client/src/vite-env.d.ts +1 -0
  157. package/my-final-test/app/client/tsconfig.app.json +43 -0
  158. package/my-final-test/app/client/tsconfig.json +7 -0
  159. package/my-final-test/app/client/tsconfig.node.json +25 -0
  160. package/my-final-test/app/server/app.ts +10 -0
  161. package/my-final-test/app/server/backend-only.ts +15 -0
  162. package/my-final-test/app/server/controllers/users.controller.ts +69 -0
  163. package/my-final-test/app/server/index.ts +104 -0
  164. package/my-final-test/app/server/routes/index.ts +25 -0
  165. package/my-final-test/app/server/routes/users.routes.ts +121 -0
  166. package/my-final-test/app/server/types/index.ts +1 -0
  167. package/my-final-test/app/shared/types/index.ts +18 -0
  168. package/my-final-test/bun.lock +993 -0
  169. package/my-final-test/core/__tests__/integration.test.ts +227 -0
  170. package/my-final-test/core/build/index.ts +186 -0
  171. package/my-final-test/core/cli/command-registry.ts +334 -0
  172. package/my-final-test/core/cli/index.ts +394 -0
  173. package/my-final-test/core/cli/plugin-discovery.ts +200 -0
  174. package/my-final-test/core/client/standalone.ts +57 -0
  175. package/my-final-test/core/config/__tests__/config-loader.test.ts +591 -0
  176. package/my-final-test/core/config/__tests__/config-merger.test.ts +657 -0
  177. package/my-final-test/core/config/__tests__/env-converter.test.ts +372 -0
  178. package/my-final-test/core/config/__tests__/env-processor.test.ts +431 -0
  179. package/my-final-test/core/config/__tests__/env.test.ts +452 -0
  180. package/my-final-test/core/config/__tests__/integration.test.ts +418 -0
  181. package/my-final-test/core/config/__tests__/loader.test.ts +331 -0
  182. package/my-final-test/core/config/__tests__/schema.test.ts +129 -0
  183. package/my-final-test/core/config/__tests__/validator.test.ts +318 -0
  184. package/my-final-test/core/config/env-dynamic.ts +326 -0
  185. package/my-final-test/core/config/env.ts +597 -0
  186. package/my-final-test/core/config/index.ts +317 -0
  187. package/my-final-test/core/config/loader.ts +546 -0
  188. package/my-final-test/core/config/runtime-config.ts +322 -0
  189. package/my-final-test/core/config/schema.ts +694 -0
  190. package/my-final-test/core/config/validator.ts +540 -0
  191. package/my-final-test/core/framework/__tests__/server.test.ts +233 -0
  192. package/my-final-test/core/framework/client.ts +132 -0
  193. package/my-final-test/core/framework/index.ts +8 -0
  194. package/my-final-test/core/framework/server.ts +501 -0
  195. package/my-final-test/core/framework/types.ts +63 -0
  196. package/my-final-test/core/plugins/__tests__/built-in.test.ts.disabled +366 -0
  197. package/my-final-test/core/plugins/__tests__/manager.test.ts +398 -0
  198. package/my-final-test/core/plugins/__tests__/monitoring.test.ts +401 -0
  199. package/my-final-test/core/plugins/__tests__/registry.test.ts +335 -0
  200. package/my-final-test/core/plugins/built-in/index.ts +142 -0
  201. package/my-final-test/core/plugins/built-in/logger/index.ts +180 -0
  202. package/my-final-test/core/plugins/built-in/monitoring/README.md +193 -0
  203. package/my-final-test/core/plugins/built-in/monitoring/index.ts +912 -0
  204. package/my-final-test/core/plugins/built-in/static/index.ts +289 -0
  205. package/my-final-test/core/plugins/built-in/swagger/index.ts +229 -0
  206. package/my-final-test/core/plugins/built-in/vite/index.ts +316 -0
  207. package/my-final-test/core/plugins/config.ts +348 -0
  208. package/my-final-test/core/plugins/discovery.ts +350 -0
  209. package/my-final-test/core/plugins/executor.ts +351 -0
  210. package/my-final-test/core/plugins/index.ts +195 -0
  211. package/my-final-test/core/plugins/manager.ts +583 -0
  212. package/my-final-test/core/plugins/registry.ts +424 -0
  213. package/my-final-test/core/plugins/types.ts +254 -0
  214. package/my-final-test/core/server/framework.ts +123 -0
  215. package/my-final-test/core/server/index.ts +8 -0
  216. package/my-final-test/core/server/plugins/database.ts +182 -0
  217. package/my-final-test/core/server/plugins/logger.ts +47 -0
  218. package/my-final-test/core/server/plugins/swagger.ts +34 -0
  219. package/my-final-test/core/server/standalone.ts +91 -0
  220. package/my-final-test/core/templates/create-project.ts +455 -0
  221. package/my-final-test/core/types/api.ts +169 -0
  222. package/my-final-test/core/types/build.ts +174 -0
  223. package/my-final-test/core/types/config.ts +68 -0
  224. package/my-final-test/core/types/index.ts +127 -0
  225. package/my-final-test/core/types/plugin.ts +94 -0
  226. package/my-final-test/core/utils/__tests__/errors.test.ts +139 -0
  227. package/my-final-test/core/utils/__tests__/helpers.test.ts +297 -0
  228. package/my-final-test/core/utils/__tests__/logger.test.ts +141 -0
  229. package/my-final-test/core/utils/env-runtime-v2.ts +232 -0
  230. package/my-final-test/core/utils/env-runtime.ts +252 -0
  231. package/my-final-test/core/utils/errors/codes.ts +115 -0
  232. package/my-final-test/core/utils/errors/handlers.ts +63 -0
  233. package/my-final-test/core/utils/errors/index.ts +81 -0
  234. package/my-final-test/core/utils/helpers.ts +180 -0
  235. package/my-final-test/core/utils/index.ts +18 -0
  236. package/my-final-test/core/utils/logger/index.ts +161 -0
  237. package/my-final-test/core/utils/logger.ts +106 -0
  238. package/my-final-test/core/utils/monitoring/index.ts +212 -0
  239. package/my-final-test/package.json +68 -0
  240. package/my-final-test/tsconfig.json +51 -0
  241. package/my-final-test/vite.config.ts +42 -0
  242. package/nginx-lb.conf +37 -0
  243. package/package-template.json +32 -15
  244. package/package.json +71 -30
  245. package/publish-setup.md +111 -0
  246. package/publish.sh +63 -0
  247. package/run-clean.ts +26 -0
  248. package/run-env-tests.ts +313 -0
  249. package/tailwind.config.js +34 -0
  250. package/teste-corrigido/README.md +44 -0
  251. package/teste-corrigido/app/client/README.md +69 -0
  252. package/teste-corrigido/app/client/frontend-only.ts +12 -0
  253. package/teste-corrigido/app/client/index.html +13 -0
  254. package/teste-corrigido/app/client/public/vite.svg +1 -0
  255. package/teste-corrigido/app/client/src/App.css +883 -0
  256. package/teste-corrigido/app/client/src/App.tsx +669 -0
  257. package/teste-corrigido/app/client/src/assets/react.svg +1 -0
  258. package/teste-corrigido/app/client/src/components/TestPage.tsx +453 -0
  259. package/teste-corrigido/app/client/src/index.css +51 -0
  260. package/teste-corrigido/app/client/src/lib/eden-api.ts +110 -0
  261. package/teste-corrigido/app/client/src/main.tsx +10 -0
  262. package/teste-corrigido/app/client/src/vite-env.d.ts +1 -0
  263. package/teste-corrigido/app/client/tsconfig.app.json +43 -0
  264. package/teste-corrigido/app/client/tsconfig.json +7 -0
  265. package/teste-corrigido/app/client/tsconfig.node.json +25 -0
  266. package/teste-corrigido/app/server/app.ts +10 -0
  267. package/teste-corrigido/app/server/backend-only.ts +15 -0
  268. package/teste-corrigido/app/server/controllers/users.controller.ts +69 -0
  269. package/teste-corrigido/app/server/index.ts +104 -0
  270. package/teste-corrigido/app/server/routes/index.ts +25 -0
  271. package/teste-corrigido/app/server/routes/users.routes.ts +121 -0
  272. package/teste-corrigido/app/server/types/index.ts +1 -0
  273. package/teste-corrigido/app/shared/types/index.ts +18 -0
  274. package/teste-corrigido/bun.lock +1053 -0
  275. package/teste-corrigido/core/__tests__/integration.test.ts +227 -0
  276. package/teste-corrigido/core/build/index.ts +186 -0
  277. package/teste-corrigido/core/cli/command-registry.ts +334 -0
  278. package/teste-corrigido/core/cli/index.ts +394 -0
  279. package/teste-corrigido/core/cli/plugin-discovery.ts +200 -0
  280. package/teste-corrigido/core/client/standalone.ts +57 -0
  281. package/teste-corrigido/core/config/__tests__/config-loader.test.ts +591 -0
  282. package/teste-corrigido/core/config/__tests__/config-merger.test.ts +657 -0
  283. package/teste-corrigido/core/config/__tests__/env-converter.test.ts +372 -0
  284. package/teste-corrigido/core/config/__tests__/env-processor.test.ts +431 -0
  285. package/teste-corrigido/core/config/__tests__/env.test.ts +452 -0
  286. package/teste-corrigido/core/config/__tests__/integration.test.ts +418 -0
  287. package/teste-corrigido/core/config/__tests__/loader.test.ts +331 -0
  288. package/teste-corrigido/core/config/__tests__/schema.test.ts +129 -0
  289. package/teste-corrigido/core/config/__tests__/validator.test.ts +318 -0
  290. package/teste-corrigido/core/config/env-dynamic.ts +326 -0
  291. package/teste-corrigido/core/config/env.ts +597 -0
  292. package/teste-corrigido/core/config/index.ts +317 -0
  293. package/teste-corrigido/core/config/loader.ts +546 -0
  294. package/teste-corrigido/core/config/runtime-config.ts +322 -0
  295. package/teste-corrigido/core/config/schema.ts +694 -0
  296. package/teste-corrigido/core/config/validator.ts +540 -0
  297. package/teste-corrigido/core/framework/__tests__/server.test.ts +233 -0
  298. package/teste-corrigido/core/framework/client.ts +132 -0
  299. package/teste-corrigido/core/framework/index.ts +8 -0
  300. package/teste-corrigido/core/framework/server.ts +501 -0
  301. package/teste-corrigido/core/framework/types.ts +63 -0
  302. package/teste-corrigido/core/plugins/__tests__/built-in.test.ts.disabled +366 -0
  303. package/teste-corrigido/core/plugins/__tests__/manager.test.ts +398 -0
  304. package/teste-corrigido/core/plugins/__tests__/monitoring.test.ts +401 -0
  305. package/teste-corrigido/core/plugins/__tests__/registry.test.ts +335 -0
  306. package/teste-corrigido/core/plugins/built-in/index.ts +142 -0
  307. package/teste-corrigido/core/plugins/built-in/logger/index.ts +180 -0
  308. package/teste-corrigido/core/plugins/built-in/monitoring/README.md +193 -0
  309. package/teste-corrigido/core/plugins/built-in/monitoring/index.ts +912 -0
  310. package/teste-corrigido/core/plugins/built-in/static/index.ts +289 -0
  311. package/teste-corrigido/core/plugins/built-in/swagger/index.ts +229 -0
  312. package/teste-corrigido/core/plugins/built-in/vite/index.ts +316 -0
  313. package/teste-corrigido/core/plugins/config.ts +348 -0
  314. package/teste-corrigido/core/plugins/discovery.ts +350 -0
  315. package/teste-corrigido/core/plugins/executor.ts +351 -0
  316. package/teste-corrigido/core/plugins/index.ts +195 -0
  317. package/teste-corrigido/core/plugins/manager.ts +583 -0
  318. package/teste-corrigido/core/plugins/registry.ts +424 -0
  319. package/teste-corrigido/core/plugins/types.ts +254 -0
  320. package/teste-corrigido/core/server/framework.ts +123 -0
  321. package/teste-corrigido/core/server/index.ts +8 -0
  322. package/teste-corrigido/core/server/plugins/database.ts +182 -0
  323. package/teste-corrigido/core/server/plugins/logger.ts +47 -0
  324. package/teste-corrigido/core/server/plugins/swagger.ts +34 -0
  325. package/teste-corrigido/core/server/standalone.ts +91 -0
  326. package/teste-corrigido/core/templates/create-project.ts +455 -0
  327. package/teste-corrigido/core/types/api.ts +169 -0
  328. package/teste-corrigido/core/types/build.ts +174 -0
  329. package/teste-corrigido/core/types/config.ts +68 -0
  330. package/teste-corrigido/core/types/index.ts +127 -0
  331. package/teste-corrigido/core/types/plugin.ts +94 -0
  332. package/teste-corrigido/core/utils/__tests__/errors.test.ts +139 -0
  333. package/teste-corrigido/core/utils/__tests__/helpers.test.ts +297 -0
  334. package/teste-corrigido/core/utils/__tests__/logger.test.ts +141 -0
  335. package/teste-corrigido/core/utils/env-runtime-v2.ts +232 -0
  336. package/teste-corrigido/core/utils/env-runtime.ts +252 -0
  337. package/teste-corrigido/core/utils/errors/codes.ts +115 -0
  338. package/teste-corrigido/core/utils/errors/handlers.ts +63 -0
  339. package/teste-corrigido/core/utils/errors/index.ts +81 -0
  340. package/teste-corrigido/core/utils/helpers.ts +180 -0
  341. package/teste-corrigido/core/utils/index.ts +18 -0
  342. package/teste-corrigido/core/utils/logger/index.ts +161 -0
  343. package/teste-corrigido/core/utils/logger.ts +106 -0
  344. package/teste-corrigido/core/utils/monitoring/index.ts +212 -0
  345. package/teste-corrigido/package-template.json +51 -0
  346. package/teste-corrigido/package.json +51 -0
  347. package/teste-corrigido/tsconfig.json +51 -0
  348. package/teste-corrigido/vite.config.ts +42 -0
  349. package/teste-final-npm/README.md +44 -0
  350. package/teste-final-npm/app/client/README.md +69 -0
  351. package/teste-final-npm/app/client/frontend-only.ts +12 -0
  352. package/teste-final-npm/app/client/index.html +13 -0
  353. package/teste-final-npm/app/client/public/vite.svg +1 -0
  354. package/teste-final-npm/app/client/src/App.css +883 -0
  355. package/teste-final-npm/app/client/src/App.tsx +669 -0
  356. package/teste-final-npm/app/client/src/assets/react.svg +1 -0
  357. package/teste-final-npm/app/client/src/components/TestPage.tsx +453 -0
  358. package/teste-final-npm/app/client/src/index.css +51 -0
  359. package/teste-final-npm/app/client/src/lib/eden-api.ts +110 -0
  360. package/teste-final-npm/app/client/src/main.tsx +10 -0
  361. package/teste-final-npm/app/client/src/vite-env.d.ts +1 -0
  362. package/teste-final-npm/app/client/tsconfig.app.json +43 -0
  363. package/teste-final-npm/app/client/tsconfig.json +7 -0
  364. package/teste-final-npm/app/client/tsconfig.node.json +25 -0
  365. package/teste-final-npm/app/server/app.ts +10 -0
  366. package/teste-final-npm/app/server/backend-only.ts +15 -0
  367. package/teste-final-npm/app/server/controllers/users.controller.ts +69 -0
  368. package/teste-final-npm/app/server/index.ts +104 -0
  369. package/teste-final-npm/app/server/routes/index.ts +25 -0
  370. package/teste-final-npm/app/server/routes/users.routes.ts +121 -0
  371. package/teste-final-npm/app/server/types/index.ts +1 -0
  372. package/teste-final-npm/app/shared/types/index.ts +18 -0
  373. package/teste-final-npm/bun.lock +1053 -0
  374. package/teste-final-npm/core/__tests__/integration.test.ts +227 -0
  375. package/teste-final-npm/core/build/index.ts +186 -0
  376. package/teste-final-npm/core/cli/command-registry.ts +334 -0
  377. package/teste-final-npm/core/cli/index.ts +394 -0
  378. package/teste-final-npm/core/cli/plugin-discovery.ts +200 -0
  379. package/teste-final-npm/core/client/standalone.ts +57 -0
  380. package/teste-final-npm/core/config/__tests__/config-loader.test.ts +591 -0
  381. package/teste-final-npm/core/config/__tests__/config-merger.test.ts +657 -0
  382. package/teste-final-npm/core/config/__tests__/env-converter.test.ts +372 -0
  383. package/teste-final-npm/core/config/__tests__/env-processor.test.ts +431 -0
  384. package/teste-final-npm/core/config/__tests__/env.test.ts +452 -0
  385. package/teste-final-npm/core/config/__tests__/integration.test.ts +418 -0
  386. package/teste-final-npm/core/config/__tests__/loader.test.ts +331 -0
  387. package/teste-final-npm/core/config/__tests__/schema.test.ts +129 -0
  388. package/teste-final-npm/core/config/__tests__/validator.test.ts +318 -0
  389. package/teste-final-npm/core/config/env-dynamic.ts +326 -0
  390. package/teste-final-npm/core/config/env.ts +597 -0
  391. package/teste-final-npm/core/config/index.ts +317 -0
  392. package/teste-final-npm/core/config/loader.ts +546 -0
  393. package/teste-final-npm/core/config/runtime-config.ts +322 -0
  394. package/teste-final-npm/core/config/schema.ts +694 -0
  395. package/teste-final-npm/core/config/validator.ts +540 -0
  396. package/teste-final-npm/core/framework/__tests__/server.test.ts +233 -0
  397. package/teste-final-npm/core/framework/client.ts +132 -0
  398. package/teste-final-npm/core/framework/index.ts +8 -0
  399. package/teste-final-npm/core/framework/server.ts +501 -0
  400. package/teste-final-npm/core/framework/types.ts +63 -0
  401. package/teste-final-npm/core/plugins/__tests__/built-in.test.ts.disabled +366 -0
  402. package/teste-final-npm/core/plugins/__tests__/manager.test.ts +398 -0
  403. package/teste-final-npm/core/plugins/__tests__/monitoring.test.ts +401 -0
  404. package/teste-final-npm/core/plugins/__tests__/registry.test.ts +335 -0
  405. package/teste-final-npm/core/plugins/built-in/index.ts +142 -0
  406. package/teste-final-npm/core/plugins/built-in/logger/index.ts +180 -0
  407. package/teste-final-npm/core/plugins/built-in/monitoring/README.md +193 -0
  408. package/teste-final-npm/core/plugins/built-in/monitoring/index.ts +912 -0
  409. package/teste-final-npm/core/plugins/built-in/static/index.ts +289 -0
  410. package/teste-final-npm/core/plugins/built-in/swagger/index.ts +229 -0
  411. package/teste-final-npm/core/plugins/built-in/vite/index.ts +316 -0
  412. package/teste-final-npm/core/plugins/config.ts +348 -0
  413. package/teste-final-npm/core/plugins/discovery.ts +350 -0
  414. package/teste-final-npm/core/plugins/executor.ts +351 -0
  415. package/teste-final-npm/core/plugins/index.ts +195 -0
  416. package/teste-final-npm/core/plugins/manager.ts +583 -0
  417. package/teste-final-npm/core/plugins/registry.ts +424 -0
  418. package/teste-final-npm/core/plugins/types.ts +254 -0
  419. package/teste-final-npm/core/server/framework.ts +123 -0
  420. package/teste-final-npm/core/server/index.ts +8 -0
  421. package/teste-final-npm/core/server/plugins/database.ts +182 -0
  422. package/teste-final-npm/core/server/plugins/logger.ts +47 -0
  423. package/teste-final-npm/core/server/plugins/swagger.ts +34 -0
  424. package/teste-final-npm/core/server/standalone.ts +91 -0
  425. package/teste-final-npm/core/templates/create-project.ts +455 -0
  426. package/teste-final-npm/core/types/api.ts +169 -0
  427. package/teste-final-npm/core/types/build.ts +174 -0
  428. package/teste-final-npm/core/types/config.ts +68 -0
  429. package/teste-final-npm/core/types/index.ts +127 -0
  430. package/teste-final-npm/core/types/plugin.ts +94 -0
  431. package/teste-final-npm/core/utils/__tests__/errors.test.ts +139 -0
  432. package/teste-final-npm/core/utils/__tests__/helpers.test.ts +297 -0
  433. package/teste-final-npm/core/utils/__tests__/logger.test.ts +141 -0
  434. package/teste-final-npm/core/utils/env-runtime-v2.ts +232 -0
  435. package/teste-final-npm/core/utils/env-runtime.ts +252 -0
  436. package/teste-final-npm/core/utils/errors/codes.ts +115 -0
  437. package/teste-final-npm/core/utils/errors/handlers.ts +63 -0
  438. package/teste-final-npm/core/utils/errors/index.ts +81 -0
  439. package/teste-final-npm/core/utils/helpers.ts +180 -0
  440. package/teste-final-npm/core/utils/index.ts +18 -0
  441. package/teste-final-npm/core/utils/logger/index.ts +161 -0
  442. package/teste-final-npm/core/utils/logger.ts +106 -0
  443. package/teste-final-npm/core/utils/monitoring/index.ts +212 -0
  444. package/teste-final-npm/package-template.json +51 -0
  445. package/teste-final-npm/package.json +51 -0
  446. package/teste-final-npm/tsconfig.json +51 -0
  447. package/teste-final-npm/vite.config.ts +42 -0
  448. package/tests/__mocks__/api.ts +56 -0
  449. package/tests/fixtures/users.ts +69 -0
  450. package/tests/integration/api/users.routes.test.ts +221 -0
  451. package/tests/setup.ts +29 -0
  452. package/tests/unit/app/client/App-simple.test.tsx +56 -0
  453. package/tests/unit/app/client/App.test.tsx.skip +237 -0
  454. package/tests/unit/app/client/eden-api.test.ts +186 -0
  455. package/tests/unit/app/client/simple.test.tsx +23 -0
  456. package/tests/unit/app/controllers/users.controller.test.ts +150 -0
  457. package/tests/unit/core/create-project.test.ts.skip +95 -0
  458. package/tests/unit/core/framework.test.ts +144 -0
  459. package/tests/unit/core/plugins/logger.test.ts.skip +268 -0
  460. package/tests/unit/core/plugins/vite.test.ts.disabled +188 -0
  461. package/tests/utils/test-helpers.ts +61 -0
  462. package/types/global.d.ts +30 -0
  463. package/types/vitest.d.ts +9 -0
  464. package/vitest.config.ts +50 -0
  465. package/workspace.json +6 -0
  466. package/.env +0 -30
@@ -0,0 +1,407 @@
1
+ # 🚨 Troubleshooting - FluxStack
2
+
3
+ > **Guia completo para resolver problemas comuns no FluxStack**
4
+
5
+ ## ⚡ **Diagnóstico Rápido**
6
+
7
+ ### **🔍 Comandos de Diagnóstico**
8
+ ```bash
9
+ # 1. Verificar APIs
10
+ curl http://localhost:3000/api/health
11
+ curl http://localhost:3000/swagger/json
12
+
13
+ # 2. Verificar TypeScript
14
+ bunx tsc --noEmit
15
+
16
+ # 3. Verificar testes
17
+ bun run test
18
+
19
+ # 4. Verificar build
20
+ bun run build
21
+ ```
22
+
23
+ ### **🌐 URLs Importantes**
24
+ - **Backend**: http://localhost:3000
25
+ - **Frontend**: http://localhost:5173
26
+ - **Swagger**: http://localhost:3000/swagger
27
+ - **Health**: http://localhost:3000/api/health
28
+
29
+ ## 🔧 **Problemas de Desenvolvimento**
30
+
31
+ ### **❌ Erro: "Cannot find module 'vite/module-runner'"**
32
+ ```bash
33
+ # Problema: Vite sendo importado em produção
34
+ # Solução: Verificar env vars e plugins
35
+ export NODE_ENV=development
36
+ bun run dev
37
+ ```
38
+
39
+ ### **❌ Types `unknown` no Eden Treaty**
40
+ ```typescript
41
+ // ❌ Problema
42
+ const { data, error } = await api.users.get()
43
+ // data é 'unknown' em vez de { users: User[] }
44
+
45
+ // ✅ Solução: Verificar response schemas
46
+ export const usersRoutes = new Elysia()
47
+ .get("/", handler, {
48
+ response: t.Object({
49
+ users: t.Array(t.Object({
50
+ id: t.Number(),
51
+ name: t.String(),
52
+ email: t.String()
53
+ }))
54
+ })
55
+ })
56
+ ```
57
+
58
+ ### **❌ Hot Reload Não Funciona**
59
+ ```bash
60
+ # Verificar se Vite já está rodando
61
+ lsof -i :5173 # Mac/Linux
62
+ netstat -ano | findstr :5173 # Windows
63
+
64
+ # Matar processo se necessário
65
+ pkill -f vite # Mac/Linux
66
+ taskkill /F /IM node.exe # Windows
67
+
68
+ # Reiniciar
69
+ bun run dev
70
+ ```
71
+
72
+ ### **❌ Erro de Porta em Uso**
73
+ ```bash
74
+ # Verificar processos na porta
75
+ lsof -i :3000 # Backend
76
+ lsof -i :5173 # Frontend
77
+
78
+ # Matar processo
79
+ kill -9 <PID>
80
+
81
+ # Ou usar porta diferente
82
+ PORT=3001 bun run dev
83
+ ```
84
+
85
+ ### **❌ TypeScript Errors Massivos**
86
+ ```bash
87
+ # 1. Limpar cache
88
+ rm -rf node_modules/.cache
89
+ rm -rf dist/
90
+
91
+ # 2. Reinstalar
92
+ bun install
93
+
94
+ # 3. Verificar versões
95
+ bunx tsc --version
96
+ bun --version
97
+
98
+ # 4. Restart TypeScript server (VS Code)
99
+ Ctrl+Shift+P → "TypeScript: Restart TS Server"
100
+ ```
101
+
102
+ ## 🌐 **Problemas de API**
103
+
104
+ ### **❌ CORS Errors**
105
+ ```javascript
106
+ // ❌ Error: CORS policy blocks request
107
+ // ✅ Normal: API (3000) ≠ Frontend (5173)
108
+
109
+ // Verificar se API está respondendo
110
+ fetch('http://localhost:3000/api/health')
111
+ .then(r => r.json())
112
+ .then(console.log)
113
+
114
+ // Eden Treaty deveria lidar automaticamente
115
+ ```
116
+
117
+ ### **❌ 404 Not Found nas Rotas**
118
+ ```typescript
119
+ // ❌ Problema: Rota não encontrada
120
+ // ✅ Verificar prefix e estrutura
121
+
122
+ // 1. Verificar export das rotas
123
+ export const apiRoutes = new Elysia({ prefix: "/api" })
124
+ .use(usersRoutes) // ← Rota precisa estar registrada
125
+
126
+ // 2. Verificar URL final
127
+ // users routes com prefix "/users"
128
+ // apiRoutes com prefix "/api"
129
+ // URL final: /api/users
130
+ ```
131
+
132
+ ### **❌ Validation Errors**
133
+ ```typescript
134
+ // ❌ Body validation failed
135
+ // ✅ Verificar schema da rota
136
+
137
+ .post("/", handler, {
138
+ body: t.Object({
139
+ name: t.String({ minLength: 2 }), // ← Verificar requisitos
140
+ email: t.String({ format: "email" })
141
+ })
142
+ })
143
+
144
+ // Client request deve corresponder:
145
+ await api.users.post({
146
+ name: "João", // ← String com 2+ chars
147
+ email: "joao@x.com" // ← Email válido
148
+ })
149
+ ```
150
+
151
+ ### **❌ Error Handling Não Funciona**
152
+ ```typescript
153
+ // ❌ Problema: Errors não tratados
154
+ const { data, error } = await api.users.get()
155
+
156
+ // ✅ Sempre verificar error primeiro
157
+ if (error) {
158
+ console.log(`API Error: ${error.status} - ${error.message}`)
159
+ return
160
+ }
161
+
162
+ // Agora data é garantidamente válido
163
+ console.log(data.users)
164
+ ```
165
+
166
+ ## ⚛️ **Problemas de Frontend**
167
+
168
+ ### **❌ React Hook Warnings**
169
+ ```typescript
170
+ // ❌ Warning: Can't perform state update on unmounted component
171
+
172
+ // ✅ Solução: Cleanup no useEffect
173
+ useEffect(() => {
174
+ let mounted = true
175
+
176
+ const loadData = async () => {
177
+ const { data, error } = await api.users.get()
178
+ if (mounted && !error) {
179
+ setUsers(data.users)
180
+ }
181
+ }
182
+
183
+ loadData()
184
+
185
+ return () => { mounted = false } // ← Cleanup
186
+ }, [])
187
+ ```
188
+
189
+ ### **❌ State Updates Não Refletem**
190
+ ```typescript
191
+ // ❌ Problema: State não atualiza após API call
192
+
193
+ // ✅ Verificar se setState está sendo chamado
194
+ const createUser = async (userData) => {
195
+ const { data, error } = await api.users.post(userData)
196
+
197
+ if (!error && data.success) {
198
+ setUsers(prev => [...prev, data.user]) // ← Crucial!
199
+ }
200
+ }
201
+ ```
202
+
203
+ ### **❌ Infinite Re-renders**
204
+ ```typescript
205
+ // ❌ Problema: useEffect sem dependencies
206
+ useEffect(() => {
207
+ loadUsers() // ← Vai chamar infinitamente
208
+ })
209
+
210
+ // ✅ Solução: Dependencies corretas
211
+ useEffect(() => {
212
+ loadUsers()
213
+ }, []) // ← Empty array = run once
214
+
215
+ // ✅ Ou use useCallback
216
+ const loadUsers = useCallback(async () => {
217
+ // ...
218
+ }, [])
219
+
220
+ useEffect(() => {
221
+ loadUsers()
222
+ }, [loadUsers])
223
+ ```
224
+
225
+ ## 🏗️ **Problemas de Build**
226
+
227
+ ### **❌ Build Failures**
228
+ ```bash
229
+ # 1. Verificar imports
230
+ # ❌ Problema comum
231
+ import { api } from '../../lib/eden-api' # Path relativo
232
+ import type { User } from '../../../shared/types' # Muitos ../
233
+
234
+ # ✅ Usar path aliases (tsconfig.json)
235
+ import { api } from '@/lib/eden-api'
236
+ import type { User } from '@/shared/types'
237
+
238
+ # 2. Verificar exports
239
+ # Cada arquivo deve ter export padrão ou nomeado correto
240
+ ```
241
+
242
+ ### **❌ Type Errors na Build**
243
+ ```typescript
244
+ // ❌ Problema: Tipos diferentes dev vs build
245
+ // ✅ Verificar tsconfig.json consistency
246
+
247
+ {
248
+ "compilerOptions": {
249
+ "strict": true,
250
+ "skipLibCheck": false, // ← Importante para libs
251
+ "moduleResolution": "bundler"
252
+ }
253
+ }
254
+ ```
255
+
256
+ ### **❌ Asset Loading Problems**
257
+ ```typescript
258
+ // ❌ Problema: Assets não carregam em prod
259
+ // ✅ Usar public/ folder
260
+
261
+ // ❌ Errado
262
+ import logo from '../assets/logo.png'
263
+
264
+ // ✅ Correto
265
+ <img src="/logo.png" /> // File em public/logo.png
266
+ ```
267
+
268
+ ## 🐳 **Problemas de Docker**
269
+
270
+ ### **❌ Docker Build Falha**
271
+ ```dockerfile
272
+ # ❌ Problema: Node modules não copiados
273
+ # ✅ Verificar .dockerignore
274
+
275
+ # .dockerignore não deve incluir:
276
+ # node_modules/ ← OK, será reinstalado
277
+ # dist/ ← OK, será gerado
278
+ # .env ← Cuidado: env vars podem ser necessárias
279
+ ```
280
+
281
+ ### **❌ Container Não Inicia**
282
+ ```bash
283
+ # Verificar logs
284
+ docker logs <container-id>
285
+
286
+ # Verificar portas
287
+ docker ps
288
+ docker port <container-id>
289
+
290
+ # Verificar conectividade
291
+ curl http://localhost:3000/api/health
292
+ ```
293
+
294
+ ## 🧪 **Problemas de Testing**
295
+
296
+ ### **❌ Tests Falhando**
297
+ ```typescript
298
+ // ❌ Problema: API calls em tests
299
+ // ✅ Mock Eden Treaty
300
+
301
+ // tests/setup.ts
302
+ vi.mock('@/lib/eden-api', () => ({
303
+ api: {
304
+ users: {
305
+ get: vi.fn(),
306
+ post: vi.fn()
307
+ }
308
+ }
309
+ }))
310
+
311
+ // test.ts
312
+ import { api } from '@/lib/eden-api'
313
+
314
+ it('should handle users', () => {
315
+ const mockUsers = [{ id: 1, name: 'Test' }]
316
+ vi.mocked(api.users.get).mockResolvedValue({
317
+ data: { users: mockUsers },
318
+ error: undefined
319
+ })
320
+
321
+ // Test component...
322
+ })
323
+ ```
324
+
325
+ ### **❌ Mock Not Working**
326
+ ```typescript
327
+ // ❌ Problema: Mocks não aplicados
328
+ // ✅ Verificar ordem de imports
329
+
330
+ // ❌ Errado
331
+ import { Component } from './Component'
332
+ import { vi } from 'vitest'
333
+
334
+ // ✅ Correto
335
+ import { vi } from 'vitest'
336
+ vi.mock('./api')
337
+ import { Component } from './Component'
338
+ ```
339
+
340
+ ## 🔧 **Ferramentas de Debug**
341
+
342
+ ### **✅ Browser DevTools**
343
+ ```javascript
344
+ // Network tab
345
+ // - Verificar requests/responses
346
+ // - Status codes
347
+ // - Headers CORS
348
+
349
+ // Console
350
+ // - Eden Treaty debug
351
+ console.log('API call:', await api.users.get())
352
+
353
+ // React DevTools
354
+ // - Component state
355
+ // - Props debugging
356
+ // - Hook values
357
+ ```
358
+
359
+ ### **✅ Bun Debugging**
360
+ ```bash
361
+ # Debug mode
362
+ DEBUG=* bun run dev
363
+
364
+ # Verbose output
365
+ bun run dev --verbose
366
+
367
+ # Memory usage
368
+ bun run --inspect dev
369
+ ```
370
+
371
+ ### **✅ Elysia Debugging**
372
+ ```typescript
373
+ // app/server/index.ts
374
+ app.onError((error) => {
375
+ console.error('Elysia Error:', error)
376
+ return { error: error.message, status: 500 }
377
+ })
378
+
379
+ app.onRequest((request) => {
380
+ console.log(`${request.method} ${request.url}`)
381
+ })
382
+
383
+ app.onResponse((response) => {
384
+ console.log(`Response: ${response.status}`)
385
+ })
386
+ ```
387
+
388
+ ## 📋 **Checklist de Troubleshooting**
389
+
390
+ ### **🔍 Quando algo não funciona:**
391
+ 1. **Verificar URLs** - APIs nas portas certas?
392
+ 2. **Verificar types** - `bunx tsc --noEmit`
393
+ 3. **Verificar console** - Errors no browser/terminal?
394
+ 4. **Verificar schemas** - Response schemas definidos?
395
+ 5. **Verificar imports** - Paths corretos?
396
+ 6. **Reiniciar tudo** - `bun run dev` fresh
397
+
398
+ ### **🆘 Quando tudo falha:**
399
+ 1. **Clean install**: `rm -rf node_modules && bun install`
400
+ 2. **Clear cache**: `rm -rf dist/ .cache/`
401
+ 3. **Restart editor**: Recarregar VS Code
402
+ 4. **Check docs**: Verificar esta documentação
403
+ 5. **Minimal repro**: Isolar o problema
404
+
405
+ ---
406
+
407
+ **🎯 90% dos problemas são resolvidos verificando response schemas, imports corretos e reiniciando o dev server!**
package/bun.lock CHANGED
@@ -8,14 +8,14 @@
8
8
  "@elysiajs/swagger": "^1.3.1",
9
9
  "@types/http-proxy-middleware": "^1.0.0",
10
10
  "@vitejs/plugin-react": "^4.6.0",
11
- "chalk": "^5.6.2",
11
+ "chalk": "^5.3.0",
12
12
  "chokidar": "^4.0.3",
13
- "commander": "^14.0.1",
13
+ "commander": "^12.1.0",
14
14
  "elysia": "^1.4.6",
15
15
  "http-proxy-middleware": "^3.0.5",
16
16
  "lightningcss": "^1.30.1",
17
17
  "lucide-react": "^0.544.0",
18
- "ora": "^9.0.0",
18
+ "ora": "^8.1.0",
19
19
  "react": "^19.1.0",
20
20
  "react-dom": "^19.1.0",
21
21
  "vite": "^7.0.4",
@@ -430,7 +430,7 @@
430
430
 
431
431
  "cli-cursor": ["cli-cursor@5.0.0", "", { "dependencies": { "restore-cursor": "^5.0.0" } }, "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw=="],
432
432
 
433
- "cli-spinners": ["cli-spinners@3.2.1", "", {}, "sha512-Xh+cRh7dzk9n7gYE+M1Lusy3yg5ADy9m6zOHqmcu9kSkWpo7ySWVUS3dXleR3konJOEOdHzsKjWkGed6g2eJuA=="],
433
+ "cli-spinners": ["cli-spinners@2.9.2", "", {}, "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg=="],
434
434
 
435
435
  "cliui": ["cliui@8.0.1", "", { "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" } }, "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ=="],
436
436
 
@@ -438,7 +438,7 @@
438
438
 
439
439
  "color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="],
440
440
 
441
- "commander": ["commander@14.0.1", "", {}, "sha512-2JkV3gUZUVrbNA+1sjBOYLsMZ5cEEl8GTFP2a4AVz5hvasAMCQ1D2l2le/cX+pV4N6ZU17zjUahLpIXRrnWL8A=="],
441
+ "commander": ["commander@12.1.0", "", {}, "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA=="],
442
442
 
443
443
  "concat-map": ["concat-map@0.0.1", "", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="],
444
444
 
@@ -478,7 +478,7 @@
478
478
 
479
479
  "elysia": ["elysia@1.4.6", "", { "dependencies": { "cookie": "^1.0.2", "exact-mirror": "0.2.2", "fast-decode-uri-component": "^1.0.1" }, "optionalDependencies": { "@sinclair/typebox": ">= 0.34.0 < 1", "openapi-types": ">= 12.0.0" }, "peerDependencies": { "file-type": ">= 20.0.0", "typescript": ">= 5.0.0" } }, "sha512-u2CorXLPs5ZXyWP+tQR+bgka/lJA4vNpB8lDE2w/sTmdaIwoPQmHEL4J3ai6OAlluWR1kfG7T9gO3EYT9D8viQ=="],
480
480
 
481
- "emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
481
+ "emoji-regex": ["emoji-regex@10.5.0", "", {}, "sha512-lb49vf1Xzfx080OKA0o6l8DQQpV+6Vg95zyCJX9VB/BqKYlhG7N4wgROUUHRA+ZPUefLnteQOad7z1kT2bV7bg=="],
482
482
 
483
483
  "enhanced-resolve": ["enhanced-resolve@5.18.3", "", { "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.2.0" } }, "sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww=="],
484
484
 
@@ -674,7 +674,7 @@
674
674
 
675
675
  "lodash.merge": ["lodash.merge@4.6.2", "", {}, "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="],
676
676
 
677
- "log-symbols": ["log-symbols@7.0.1", "", { "dependencies": { "is-unicode-supported": "^2.0.0", "yoctocolors": "^2.1.1" } }, "sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg=="],
677
+ "log-symbols": ["log-symbols@6.0.0", "", { "dependencies": { "chalk": "^5.3.0", "is-unicode-supported": "^1.3.0" } }, "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw=="],
678
678
 
679
679
  "loupe": ["loupe@3.2.1", "", {}, "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ=="],
680
680
 
@@ -724,7 +724,7 @@
724
724
 
725
725
  "optionator": ["optionator@0.9.4", "", { "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", "word-wrap": "^1.2.5" } }, "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g=="],
726
726
 
727
- "ora": ["ora@9.0.0", "", { "dependencies": { "chalk": "^5.6.2", "cli-cursor": "^5.0.0", "cli-spinners": "^3.2.0", "is-interactive": "^2.0.0", "is-unicode-supported": "^2.1.0", "log-symbols": "^7.0.1", "stdin-discarder": "^0.2.2", "string-width": "^8.1.0", "strip-ansi": "^7.1.2" } }, "sha512-m0pg2zscbYgWbqRR6ABga5c3sZdEon7bSgjnlXC64kxtxLOyjRcbbUkLj7HFyy/FTD+P2xdBWu8snGhYI0jc4A=="],
727
+ "ora": ["ora@8.2.0", "", { "dependencies": { "chalk": "^5.3.0", "cli-cursor": "^5.0.0", "cli-spinners": "^2.9.2", "is-interactive": "^2.0.0", "is-unicode-supported": "^2.0.0", "log-symbols": "^6.0.0", "stdin-discarder": "^0.2.2", "string-width": "^7.2.0", "strip-ansi": "^7.1.0" } }, "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw=="],
728
728
 
729
729
  "p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="],
730
730
 
@@ -818,7 +818,7 @@
818
818
 
819
819
  "stdin-discarder": ["stdin-discarder@0.2.2", "", {}, "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ=="],
820
820
 
821
- "string-width": ["string-width@8.1.0", "", { "dependencies": { "get-east-asian-width": "^1.3.0", "strip-ansi": "^7.1.0" } }, "sha512-Kxl3KJGb/gxkaUMOjRsQ8IrXiGW75O4E3RPjFIINOVH8AMl2SQ/yWdTzWwF3FevIX9LcMAjJW+GRwAlAbTSXdg=="],
821
+ "string-width": ["string-width@7.2.0", "", { "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" } }, "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ=="],
822
822
 
823
823
  "string-width-cjs": ["string-width@4.2.3", "", { "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", "strip-ansi": "^6.0.1" } }, "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g=="],
824
824
 
@@ -936,8 +936,6 @@
936
936
 
937
937
  "yocto-queue": ["yocto-queue@0.1.0", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="],
938
938
 
939
- "yoctocolors": ["yoctocolors@2.1.2", "", {}, "sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug=="],
940
-
941
939
  "zhead": ["zhead@2.2.4", "", {}, "sha512-8F0OI5dpWIA5IGG5NHUg9staDwz/ZPxZtvGVf01j7vHqSyZ0raHY+78atOVxRqb73AotX22uV1pXt3gYSstGag=="],
942
940
 
943
941
  "zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],
@@ -996,12 +994,16 @@
996
994
 
997
995
  "istanbul-lib-report/supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="],
998
996
 
997
+ "log-symbols/is-unicode-supported": ["is-unicode-supported@1.3.0", "", {}, "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ=="],
998
+
999
999
  "micromatch/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="],
1000
1000
 
1001
1001
  "pretty-format/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
1002
1002
 
1003
1003
  "pretty-format/ansi-styles": ["ansi-styles@5.2.0", "", {}, "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA=="],
1004
1004
 
1005
+ "string-width-cjs/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
1006
+
1005
1007
  "string-width-cjs/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="],
1006
1008
 
1007
1009
  "strip-ansi-cjs/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
@@ -1030,6 +1032,8 @@
1030
1032
 
1031
1033
  "@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.2", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="],
1032
1034
 
1035
+ "cliui/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
1036
+
1033
1037
  "cliui/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
1034
1038
 
1035
1039
  "concurrently/chalk/supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="],
@@ -1042,10 +1046,16 @@
1042
1046
 
1043
1047
  "test-exclude/minimatch/brace-expansion": ["brace-expansion@2.0.2", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="],
1044
1048
 
1049
+ "wrap-ansi-cjs/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
1050
+
1045
1051
  "wrap-ansi-cjs/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
1046
1052
 
1053
+ "wrap-ansi/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
1054
+
1047
1055
  "wrap-ansi/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
1048
1056
 
1057
+ "yargs/string-width/emoji-regex": ["emoji-regex@8.0.0", "", {}, "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A=="],
1058
+
1049
1059
  "yargs/string-width/strip-ansi": ["strip-ansi@6.0.1", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="],
1050
1060
 
1051
1061
  "yargs/string-width/strip-ansi/ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],
package/bunfig.toml ADDED
@@ -0,0 +1,16 @@
1
+ # FluxStack Bun Configuration
2
+ [build]
3
+ target = "bun"
4
+
5
+ [install]
6
+ # Package installation settings
7
+ cache = true
8
+ lockfile = true
9
+
10
+ # Path mapping (alias support)
11
+ [build.alias]
12
+ "@" = "."
13
+ "@/core" = "./core"
14
+ "@/app" = "./app"
15
+ "@/config" = "./config"
16
+ "@/shared" = "./app/shared"
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Backward Compatibility Layer for FluxStack Configuration
3
+ * This file maintains compatibility with existing imports while redirecting to the new system
4
+ * @deprecated Use the configuration from the root fluxstack.config.ts instead
5
+ */
6
+
7
+ import { getConfigSync, createLegacyConfig } from '../core/config'
8
+ import type { FluxStackConfig } from '../core/config'
9
+
10
+ // Load the new configuration
11
+ const newConfig = getConfigSync()
12
+
13
+ // Create legacy configuration format for backward compatibility
14
+ const legacyConfig = createLegacyConfig(newConfig)
15
+
16
+ // Export in the old format
17
+ export const config = legacyConfig
18
+
19
+ // Also export the environment config for backward compatibility
20
+ export const envConfig = {
21
+ NODE_ENV: process.env.NODE_ENV || 'development',
22
+ HOST: newConfig.server.host,
23
+ PORT: newConfig.server.port,
24
+ FRONTEND_PORT: newConfig.client.port,
25
+ BACKEND_PORT: newConfig.server.port,
26
+ VITE_API_URL: newConfig.client.proxy.target,
27
+ API_URL: newConfig.client.proxy.target,
28
+ CORS_ORIGINS: newConfig.server.cors.origins,
29
+ CORS_METHODS: newConfig.server.cors.methods,
30
+ CORS_HEADERS: newConfig.server.cors.headers,
31
+ LOG_LEVEL: newConfig.logging.level,
32
+ BUILD_TARGET: newConfig.build.target,
33
+ BUILD_OUTDIR: newConfig.build.outDir,
34
+ // Add other legacy environment variables as needed
35
+ }
36
+
37
+ // Warn about deprecated usage in development
38
+ if (process.env.NODE_ENV === 'development') {
39
+ console.warn(
40
+ '⚠️ DEPRECATED: Importing from config/fluxstack.config.ts is deprecated.\n' +
41
+ ' Please update your imports to use the new configuration system:\n' +
42
+ ' import { getConfig } from "./core/config"\n' +
43
+ ' or import config from "./fluxstack.config.ts"'
44
+ )
45
+ }
46
+
47
+ // Export types for backward compatibility
48
+ export type { FluxStackConfig }
@@ -53,11 +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 = currentDir // Use current directory (framework root)
56
57
  const filesToCopy = [
57
58
  'core',
58
59
  'app',
59
- 'package.json',
60
- 'package-template.json', // ✅ Template for project package.json
61
60
  'bun.lock', // ✅ CRITICAL: Copy lockfile to maintain working versions
62
61
  'tsconfig.json',
63
62
  'vite.config.ts',
@@ -66,7 +65,7 @@ program
66
65
  ]
67
66
 
68
67
  for (const file of filesToCopy) {
69
- const sourcePath = join(currentDir, file)
68
+ const sourcePath = join(frameworkDir, file)
70
69
  const destPath = join(projectPath, file)
71
70
 
72
71
  if (existsSync(sourcePath)) {