create-fluxstack 1.0.4 → 1.0.6

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 (406) hide show
  1. package/.claude/settings.local.json +6 -1
  2. package/create-fluxstack.ts +10 -6
  3. package/package.json +1 -1
  4. package/ENV_TESTING_REPORT.md +0 -292
  5. package/FRAMEWORK_ROADMAP.md +0 -183
  6. package/FRONTEND_TESTS_README.md +0 -287
  7. package/TEST_RESULTS.md +0 -130
  8. package/docs/dynamic-environment-variables.md +0 -380
  9. package/examples/dynamic-env-usage.ts +0 -283
  10. package/examples/hybrid-env-strategy.ts +0 -212
  11. package/examples/simplified-env-usage.ts +0 -251
  12. package/meu-app-teste/README.md +0 -44
  13. package/meu-app-teste/app/client/README.md +0 -69
  14. package/meu-app-teste/app/client/frontend-only.ts +0 -12
  15. package/meu-app-teste/app/client/index.html +0 -13
  16. package/meu-app-teste/app/client/public/vite.svg +0 -1
  17. package/meu-app-teste/app/client/src/App.css +0 -883
  18. package/meu-app-teste/app/client/src/App.tsx +0 -669
  19. package/meu-app-teste/app/client/src/assets/react.svg +0 -1
  20. package/meu-app-teste/app/client/src/components/TestPage.tsx +0 -453
  21. package/meu-app-teste/app/client/src/index.css +0 -51
  22. package/meu-app-teste/app/client/src/lib/eden-api.ts +0 -110
  23. package/meu-app-teste/app/client/src/main.tsx +0 -10
  24. package/meu-app-teste/app/client/src/vite-env.d.ts +0 -1
  25. package/meu-app-teste/app/client/tsconfig.app.json +0 -43
  26. package/meu-app-teste/app/client/tsconfig.json +0 -7
  27. package/meu-app-teste/app/client/tsconfig.node.json +0 -25
  28. package/meu-app-teste/app/server/app.ts +0 -10
  29. package/meu-app-teste/app/server/backend-only.ts +0 -15
  30. package/meu-app-teste/app/server/controllers/users.controller.ts +0 -69
  31. package/meu-app-teste/app/server/index.ts +0 -104
  32. package/meu-app-teste/app/server/routes/index.ts +0 -25
  33. package/meu-app-teste/app/server/routes/users.routes.ts +0 -121
  34. package/meu-app-teste/app/server/types/index.ts +0 -1
  35. package/meu-app-teste/app/shared/types/index.ts +0 -18
  36. package/meu-app-teste/bun.lock +0 -1053
  37. package/meu-app-teste/core/__tests__/integration.test.ts +0 -227
  38. package/meu-app-teste/core/build/index.ts +0 -186
  39. package/meu-app-teste/core/cli/command-registry.ts +0 -334
  40. package/meu-app-teste/core/cli/index.ts +0 -394
  41. package/meu-app-teste/core/cli/plugin-discovery.ts +0 -200
  42. package/meu-app-teste/core/client/standalone.ts +0 -57
  43. package/meu-app-teste/core/config/__tests__/config-loader.test.ts +0 -591
  44. package/meu-app-teste/core/config/__tests__/config-merger.test.ts +0 -657
  45. package/meu-app-teste/core/config/__tests__/env-converter.test.ts +0 -372
  46. package/meu-app-teste/core/config/__tests__/env-processor.test.ts +0 -431
  47. package/meu-app-teste/core/config/__tests__/env.test.ts +0 -452
  48. package/meu-app-teste/core/config/__tests__/integration.test.ts +0 -418
  49. package/meu-app-teste/core/config/__tests__/loader.test.ts +0 -331
  50. package/meu-app-teste/core/config/__tests__/schema.test.ts +0 -129
  51. package/meu-app-teste/core/config/__tests__/validator.test.ts +0 -318
  52. package/meu-app-teste/core/config/env-dynamic.ts +0 -326
  53. package/meu-app-teste/core/config/env.ts +0 -597
  54. package/meu-app-teste/core/config/index.ts +0 -317
  55. package/meu-app-teste/core/config/loader.ts +0 -546
  56. package/meu-app-teste/core/config/runtime-config.ts +0 -322
  57. package/meu-app-teste/core/config/schema.ts +0 -694
  58. package/meu-app-teste/core/config/validator.ts +0 -540
  59. package/meu-app-teste/core/framework/__tests__/server.test.ts +0 -233
  60. package/meu-app-teste/core/framework/client.ts +0 -132
  61. package/meu-app-teste/core/framework/index.ts +0 -8
  62. package/meu-app-teste/core/framework/server.ts +0 -501
  63. package/meu-app-teste/core/framework/types.ts +0 -63
  64. package/meu-app-teste/core/plugins/__tests__/built-in.test.ts.disabled +0 -366
  65. package/meu-app-teste/core/plugins/__tests__/manager.test.ts +0 -398
  66. package/meu-app-teste/core/plugins/__tests__/monitoring.test.ts +0 -401
  67. package/meu-app-teste/core/plugins/__tests__/registry.test.ts +0 -335
  68. package/meu-app-teste/core/plugins/built-in/index.ts +0 -142
  69. package/meu-app-teste/core/plugins/built-in/logger/index.ts +0 -180
  70. package/meu-app-teste/core/plugins/built-in/monitoring/README.md +0 -193
  71. package/meu-app-teste/core/plugins/built-in/monitoring/index.ts +0 -912
  72. package/meu-app-teste/core/plugins/built-in/static/index.ts +0 -289
  73. package/meu-app-teste/core/plugins/built-in/swagger/index.ts +0 -229
  74. package/meu-app-teste/core/plugins/built-in/vite/index.ts +0 -316
  75. package/meu-app-teste/core/plugins/config.ts +0 -348
  76. package/meu-app-teste/core/plugins/discovery.ts +0 -350
  77. package/meu-app-teste/core/plugins/executor.ts +0 -351
  78. package/meu-app-teste/core/plugins/index.ts +0 -195
  79. package/meu-app-teste/core/plugins/manager.ts +0 -583
  80. package/meu-app-teste/core/plugins/registry.ts +0 -424
  81. package/meu-app-teste/core/plugins/types.ts +0 -254
  82. package/meu-app-teste/core/server/framework.ts +0 -123
  83. package/meu-app-teste/core/server/index.ts +0 -8
  84. package/meu-app-teste/core/server/plugins/database.ts +0 -182
  85. package/meu-app-teste/core/server/plugins/logger.ts +0 -47
  86. package/meu-app-teste/core/server/plugins/swagger.ts +0 -34
  87. package/meu-app-teste/core/server/standalone.ts +0 -91
  88. package/meu-app-teste/core/templates/create-project.ts +0 -455
  89. package/meu-app-teste/core/types/api.ts +0 -169
  90. package/meu-app-teste/core/types/build.ts +0 -174
  91. package/meu-app-teste/core/types/config.ts +0 -68
  92. package/meu-app-teste/core/types/index.ts +0 -127
  93. package/meu-app-teste/core/types/plugin.ts +0 -94
  94. package/meu-app-teste/core/utils/__tests__/errors.test.ts +0 -139
  95. package/meu-app-teste/core/utils/__tests__/helpers.test.ts +0 -297
  96. package/meu-app-teste/core/utils/__tests__/logger.test.ts +0 -141
  97. package/meu-app-teste/core/utils/env-runtime-v2.ts +0 -232
  98. package/meu-app-teste/core/utils/env-runtime.ts +0 -252
  99. package/meu-app-teste/core/utils/errors/codes.ts +0 -115
  100. package/meu-app-teste/core/utils/errors/handlers.ts +0 -63
  101. package/meu-app-teste/core/utils/errors/index.ts +0 -81
  102. package/meu-app-teste/core/utils/helpers.ts +0 -180
  103. package/meu-app-teste/core/utils/index.ts +0 -18
  104. package/meu-app-teste/core/utils/logger/index.ts +0 -161
  105. package/meu-app-teste/core/utils/logger.ts +0 -106
  106. package/meu-app-teste/core/utils/monitoring/index.ts +0 -212
  107. package/meu-app-teste/package.json +0 -92
  108. package/meu-app-teste/tsconfig.json +0 -51
  109. package/meu-app-teste/vite.config.ts +0 -42
  110. package/my-final-test/README.md +0 -44
  111. package/my-final-test/app/client/README.md +0 -69
  112. package/my-final-test/app/client/frontend-only.ts +0 -12
  113. package/my-final-test/app/client/index.html +0 -13
  114. package/my-final-test/app/client/public/vite.svg +0 -1
  115. package/my-final-test/app/client/src/App.css +0 -883
  116. package/my-final-test/app/client/src/App.tsx +0 -669
  117. package/my-final-test/app/client/src/assets/react.svg +0 -1
  118. package/my-final-test/app/client/src/components/TestPage.tsx +0 -453
  119. package/my-final-test/app/client/src/index.css +0 -51
  120. package/my-final-test/app/client/src/lib/eden-api.ts +0 -110
  121. package/my-final-test/app/client/src/main.tsx +0 -10
  122. package/my-final-test/app/client/src/vite-env.d.ts +0 -1
  123. package/my-final-test/app/client/tsconfig.app.json +0 -43
  124. package/my-final-test/app/client/tsconfig.json +0 -7
  125. package/my-final-test/app/client/tsconfig.node.json +0 -25
  126. package/my-final-test/app/server/app.ts +0 -10
  127. package/my-final-test/app/server/backend-only.ts +0 -15
  128. package/my-final-test/app/server/controllers/users.controller.ts +0 -69
  129. package/my-final-test/app/server/index.ts +0 -104
  130. package/my-final-test/app/server/routes/index.ts +0 -25
  131. package/my-final-test/app/server/routes/users.routes.ts +0 -121
  132. package/my-final-test/app/server/types/index.ts +0 -1
  133. package/my-final-test/app/shared/types/index.ts +0 -18
  134. package/my-final-test/bun.lock +0 -993
  135. package/my-final-test/core/__tests__/integration.test.ts +0 -227
  136. package/my-final-test/core/build/index.ts +0 -186
  137. package/my-final-test/core/cli/command-registry.ts +0 -334
  138. package/my-final-test/core/cli/index.ts +0 -394
  139. package/my-final-test/core/cli/plugin-discovery.ts +0 -200
  140. package/my-final-test/core/client/standalone.ts +0 -57
  141. package/my-final-test/core/config/__tests__/config-loader.test.ts +0 -591
  142. package/my-final-test/core/config/__tests__/config-merger.test.ts +0 -657
  143. package/my-final-test/core/config/__tests__/env-converter.test.ts +0 -372
  144. package/my-final-test/core/config/__tests__/env-processor.test.ts +0 -431
  145. package/my-final-test/core/config/__tests__/env.test.ts +0 -452
  146. package/my-final-test/core/config/__tests__/integration.test.ts +0 -418
  147. package/my-final-test/core/config/__tests__/loader.test.ts +0 -331
  148. package/my-final-test/core/config/__tests__/schema.test.ts +0 -129
  149. package/my-final-test/core/config/__tests__/validator.test.ts +0 -318
  150. package/my-final-test/core/config/env-dynamic.ts +0 -326
  151. package/my-final-test/core/config/env.ts +0 -597
  152. package/my-final-test/core/config/index.ts +0 -317
  153. package/my-final-test/core/config/loader.ts +0 -546
  154. package/my-final-test/core/config/runtime-config.ts +0 -322
  155. package/my-final-test/core/config/schema.ts +0 -694
  156. package/my-final-test/core/config/validator.ts +0 -540
  157. package/my-final-test/core/framework/__tests__/server.test.ts +0 -233
  158. package/my-final-test/core/framework/client.ts +0 -132
  159. package/my-final-test/core/framework/index.ts +0 -8
  160. package/my-final-test/core/framework/server.ts +0 -501
  161. package/my-final-test/core/framework/types.ts +0 -63
  162. package/my-final-test/core/plugins/__tests__/built-in.test.ts.disabled +0 -366
  163. package/my-final-test/core/plugins/__tests__/manager.test.ts +0 -398
  164. package/my-final-test/core/plugins/__tests__/monitoring.test.ts +0 -401
  165. package/my-final-test/core/plugins/__tests__/registry.test.ts +0 -335
  166. package/my-final-test/core/plugins/built-in/index.ts +0 -142
  167. package/my-final-test/core/plugins/built-in/logger/index.ts +0 -180
  168. package/my-final-test/core/plugins/built-in/monitoring/README.md +0 -193
  169. package/my-final-test/core/plugins/built-in/monitoring/index.ts +0 -912
  170. package/my-final-test/core/plugins/built-in/static/index.ts +0 -289
  171. package/my-final-test/core/plugins/built-in/swagger/index.ts +0 -229
  172. package/my-final-test/core/plugins/built-in/vite/index.ts +0 -316
  173. package/my-final-test/core/plugins/config.ts +0 -348
  174. package/my-final-test/core/plugins/discovery.ts +0 -350
  175. package/my-final-test/core/plugins/executor.ts +0 -351
  176. package/my-final-test/core/plugins/index.ts +0 -195
  177. package/my-final-test/core/plugins/manager.ts +0 -583
  178. package/my-final-test/core/plugins/registry.ts +0 -424
  179. package/my-final-test/core/plugins/types.ts +0 -254
  180. package/my-final-test/core/server/framework.ts +0 -123
  181. package/my-final-test/core/server/index.ts +0 -8
  182. package/my-final-test/core/server/plugins/database.ts +0 -182
  183. package/my-final-test/core/server/plugins/logger.ts +0 -47
  184. package/my-final-test/core/server/plugins/swagger.ts +0 -34
  185. package/my-final-test/core/server/standalone.ts +0 -91
  186. package/my-final-test/core/templates/create-project.ts +0 -455
  187. package/my-final-test/core/types/api.ts +0 -169
  188. package/my-final-test/core/types/build.ts +0 -174
  189. package/my-final-test/core/types/config.ts +0 -68
  190. package/my-final-test/core/types/index.ts +0 -127
  191. package/my-final-test/core/types/plugin.ts +0 -94
  192. package/my-final-test/core/utils/__tests__/errors.test.ts +0 -139
  193. package/my-final-test/core/utils/__tests__/helpers.test.ts +0 -297
  194. package/my-final-test/core/utils/__tests__/logger.test.ts +0 -141
  195. package/my-final-test/core/utils/env-runtime-v2.ts +0 -232
  196. package/my-final-test/core/utils/env-runtime.ts +0 -252
  197. package/my-final-test/core/utils/errors/codes.ts +0 -115
  198. package/my-final-test/core/utils/errors/handlers.ts +0 -63
  199. package/my-final-test/core/utils/errors/index.ts +0 -81
  200. package/my-final-test/core/utils/helpers.ts +0 -180
  201. package/my-final-test/core/utils/index.ts +0 -18
  202. package/my-final-test/core/utils/logger/index.ts +0 -161
  203. package/my-final-test/core/utils/logger.ts +0 -106
  204. package/my-final-test/core/utils/monitoring/index.ts +0 -212
  205. package/my-final-test/package.json +0 -68
  206. package/my-final-test/tsconfig.json +0 -51
  207. package/my-final-test/vite.config.ts +0 -42
  208. package/publish-setup.md +0 -111
  209. package/teste-corrigido/README.md +0 -44
  210. package/teste-corrigido/app/client/README.md +0 -69
  211. package/teste-corrigido/app/client/frontend-only.ts +0 -12
  212. package/teste-corrigido/app/client/index.html +0 -13
  213. package/teste-corrigido/app/client/public/vite.svg +0 -1
  214. package/teste-corrigido/app/client/src/App.css +0 -883
  215. package/teste-corrigido/app/client/src/App.tsx +0 -669
  216. package/teste-corrigido/app/client/src/assets/react.svg +0 -1
  217. package/teste-corrigido/app/client/src/components/TestPage.tsx +0 -453
  218. package/teste-corrigido/app/client/src/index.css +0 -51
  219. package/teste-corrigido/app/client/src/lib/eden-api.ts +0 -110
  220. package/teste-corrigido/app/client/src/main.tsx +0 -10
  221. package/teste-corrigido/app/client/src/vite-env.d.ts +0 -1
  222. package/teste-corrigido/app/client/tsconfig.app.json +0 -43
  223. package/teste-corrigido/app/client/tsconfig.json +0 -7
  224. package/teste-corrigido/app/client/tsconfig.node.json +0 -25
  225. package/teste-corrigido/app/server/app.ts +0 -10
  226. package/teste-corrigido/app/server/backend-only.ts +0 -15
  227. package/teste-corrigido/app/server/controllers/users.controller.ts +0 -69
  228. package/teste-corrigido/app/server/index.ts +0 -104
  229. package/teste-corrigido/app/server/routes/index.ts +0 -25
  230. package/teste-corrigido/app/server/routes/users.routes.ts +0 -121
  231. package/teste-corrigido/app/server/types/index.ts +0 -1
  232. package/teste-corrigido/app/shared/types/index.ts +0 -18
  233. package/teste-corrigido/bun.lock +0 -1053
  234. package/teste-corrigido/core/__tests__/integration.test.ts +0 -227
  235. package/teste-corrigido/core/build/index.ts +0 -186
  236. package/teste-corrigido/core/cli/command-registry.ts +0 -334
  237. package/teste-corrigido/core/cli/index.ts +0 -394
  238. package/teste-corrigido/core/cli/plugin-discovery.ts +0 -200
  239. package/teste-corrigido/core/client/standalone.ts +0 -57
  240. package/teste-corrigido/core/config/__tests__/config-loader.test.ts +0 -591
  241. package/teste-corrigido/core/config/__tests__/config-merger.test.ts +0 -657
  242. package/teste-corrigido/core/config/__tests__/env-converter.test.ts +0 -372
  243. package/teste-corrigido/core/config/__tests__/env-processor.test.ts +0 -431
  244. package/teste-corrigido/core/config/__tests__/env.test.ts +0 -452
  245. package/teste-corrigido/core/config/__tests__/integration.test.ts +0 -418
  246. package/teste-corrigido/core/config/__tests__/loader.test.ts +0 -331
  247. package/teste-corrigido/core/config/__tests__/schema.test.ts +0 -129
  248. package/teste-corrigido/core/config/__tests__/validator.test.ts +0 -318
  249. package/teste-corrigido/core/config/env-dynamic.ts +0 -326
  250. package/teste-corrigido/core/config/env.ts +0 -597
  251. package/teste-corrigido/core/config/index.ts +0 -317
  252. package/teste-corrigido/core/config/loader.ts +0 -546
  253. package/teste-corrigido/core/config/runtime-config.ts +0 -322
  254. package/teste-corrigido/core/config/schema.ts +0 -694
  255. package/teste-corrigido/core/config/validator.ts +0 -540
  256. package/teste-corrigido/core/framework/__tests__/server.test.ts +0 -233
  257. package/teste-corrigido/core/framework/client.ts +0 -132
  258. package/teste-corrigido/core/framework/index.ts +0 -8
  259. package/teste-corrigido/core/framework/server.ts +0 -501
  260. package/teste-corrigido/core/framework/types.ts +0 -63
  261. package/teste-corrigido/core/plugins/__tests__/built-in.test.ts.disabled +0 -366
  262. package/teste-corrigido/core/plugins/__tests__/manager.test.ts +0 -398
  263. package/teste-corrigido/core/plugins/__tests__/monitoring.test.ts +0 -401
  264. package/teste-corrigido/core/plugins/__tests__/registry.test.ts +0 -335
  265. package/teste-corrigido/core/plugins/built-in/index.ts +0 -142
  266. package/teste-corrigido/core/plugins/built-in/logger/index.ts +0 -180
  267. package/teste-corrigido/core/plugins/built-in/monitoring/README.md +0 -193
  268. package/teste-corrigido/core/plugins/built-in/monitoring/index.ts +0 -912
  269. package/teste-corrigido/core/plugins/built-in/static/index.ts +0 -289
  270. package/teste-corrigido/core/plugins/built-in/swagger/index.ts +0 -229
  271. package/teste-corrigido/core/plugins/built-in/vite/index.ts +0 -316
  272. package/teste-corrigido/core/plugins/config.ts +0 -348
  273. package/teste-corrigido/core/plugins/discovery.ts +0 -350
  274. package/teste-corrigido/core/plugins/executor.ts +0 -351
  275. package/teste-corrigido/core/plugins/index.ts +0 -195
  276. package/teste-corrigido/core/plugins/manager.ts +0 -583
  277. package/teste-corrigido/core/plugins/registry.ts +0 -424
  278. package/teste-corrigido/core/plugins/types.ts +0 -254
  279. package/teste-corrigido/core/server/framework.ts +0 -123
  280. package/teste-corrigido/core/server/index.ts +0 -8
  281. package/teste-corrigido/core/server/plugins/database.ts +0 -182
  282. package/teste-corrigido/core/server/plugins/logger.ts +0 -47
  283. package/teste-corrigido/core/server/plugins/swagger.ts +0 -34
  284. package/teste-corrigido/core/server/standalone.ts +0 -91
  285. package/teste-corrigido/core/templates/create-project.ts +0 -455
  286. package/teste-corrigido/core/types/api.ts +0 -169
  287. package/teste-corrigido/core/types/build.ts +0 -174
  288. package/teste-corrigido/core/types/config.ts +0 -68
  289. package/teste-corrigido/core/types/index.ts +0 -127
  290. package/teste-corrigido/core/types/plugin.ts +0 -94
  291. package/teste-corrigido/core/utils/__tests__/errors.test.ts +0 -139
  292. package/teste-corrigido/core/utils/__tests__/helpers.test.ts +0 -297
  293. package/teste-corrigido/core/utils/__tests__/logger.test.ts +0 -141
  294. package/teste-corrigido/core/utils/env-runtime-v2.ts +0 -232
  295. package/teste-corrigido/core/utils/env-runtime.ts +0 -252
  296. package/teste-corrigido/core/utils/errors/codes.ts +0 -115
  297. package/teste-corrigido/core/utils/errors/handlers.ts +0 -63
  298. package/teste-corrigido/core/utils/errors/index.ts +0 -81
  299. package/teste-corrigido/core/utils/helpers.ts +0 -180
  300. package/teste-corrigido/core/utils/index.ts +0 -18
  301. package/teste-corrigido/core/utils/logger/index.ts +0 -161
  302. package/teste-corrigido/core/utils/logger.ts +0 -106
  303. package/teste-corrigido/core/utils/monitoring/index.ts +0 -212
  304. package/teste-corrigido/package-template.json +0 -51
  305. package/teste-corrigido/package.json +0 -51
  306. package/teste-corrigido/tsconfig.json +0 -51
  307. package/teste-corrigido/vite.config.ts +0 -42
  308. package/teste-final-npm/README.md +0 -44
  309. package/teste-final-npm/app/client/README.md +0 -69
  310. package/teste-final-npm/app/client/frontend-only.ts +0 -12
  311. package/teste-final-npm/app/client/index.html +0 -13
  312. package/teste-final-npm/app/client/public/vite.svg +0 -1
  313. package/teste-final-npm/app/client/src/App.css +0 -883
  314. package/teste-final-npm/app/client/src/App.tsx +0 -669
  315. package/teste-final-npm/app/client/src/assets/react.svg +0 -1
  316. package/teste-final-npm/app/client/src/components/TestPage.tsx +0 -453
  317. package/teste-final-npm/app/client/src/index.css +0 -51
  318. package/teste-final-npm/app/client/src/lib/eden-api.ts +0 -110
  319. package/teste-final-npm/app/client/src/main.tsx +0 -10
  320. package/teste-final-npm/app/client/src/vite-env.d.ts +0 -1
  321. package/teste-final-npm/app/client/tsconfig.app.json +0 -43
  322. package/teste-final-npm/app/client/tsconfig.json +0 -7
  323. package/teste-final-npm/app/client/tsconfig.node.json +0 -25
  324. package/teste-final-npm/app/server/app.ts +0 -10
  325. package/teste-final-npm/app/server/backend-only.ts +0 -15
  326. package/teste-final-npm/app/server/controllers/users.controller.ts +0 -69
  327. package/teste-final-npm/app/server/index.ts +0 -104
  328. package/teste-final-npm/app/server/routes/index.ts +0 -25
  329. package/teste-final-npm/app/server/routes/users.routes.ts +0 -121
  330. package/teste-final-npm/app/server/types/index.ts +0 -1
  331. package/teste-final-npm/app/shared/types/index.ts +0 -18
  332. package/teste-final-npm/bun.lock +0 -1053
  333. package/teste-final-npm/core/__tests__/integration.test.ts +0 -227
  334. package/teste-final-npm/core/build/index.ts +0 -186
  335. package/teste-final-npm/core/cli/command-registry.ts +0 -334
  336. package/teste-final-npm/core/cli/index.ts +0 -394
  337. package/teste-final-npm/core/cli/plugin-discovery.ts +0 -200
  338. package/teste-final-npm/core/client/standalone.ts +0 -57
  339. package/teste-final-npm/core/config/__tests__/config-loader.test.ts +0 -591
  340. package/teste-final-npm/core/config/__tests__/config-merger.test.ts +0 -657
  341. package/teste-final-npm/core/config/__tests__/env-converter.test.ts +0 -372
  342. package/teste-final-npm/core/config/__tests__/env-processor.test.ts +0 -431
  343. package/teste-final-npm/core/config/__tests__/env.test.ts +0 -452
  344. package/teste-final-npm/core/config/__tests__/integration.test.ts +0 -418
  345. package/teste-final-npm/core/config/__tests__/loader.test.ts +0 -331
  346. package/teste-final-npm/core/config/__tests__/schema.test.ts +0 -129
  347. package/teste-final-npm/core/config/__tests__/validator.test.ts +0 -318
  348. package/teste-final-npm/core/config/env-dynamic.ts +0 -326
  349. package/teste-final-npm/core/config/env.ts +0 -597
  350. package/teste-final-npm/core/config/index.ts +0 -317
  351. package/teste-final-npm/core/config/loader.ts +0 -546
  352. package/teste-final-npm/core/config/runtime-config.ts +0 -322
  353. package/teste-final-npm/core/config/schema.ts +0 -694
  354. package/teste-final-npm/core/config/validator.ts +0 -540
  355. package/teste-final-npm/core/framework/__tests__/server.test.ts +0 -233
  356. package/teste-final-npm/core/framework/client.ts +0 -132
  357. package/teste-final-npm/core/framework/index.ts +0 -8
  358. package/teste-final-npm/core/framework/server.ts +0 -501
  359. package/teste-final-npm/core/framework/types.ts +0 -63
  360. package/teste-final-npm/core/plugins/__tests__/built-in.test.ts.disabled +0 -366
  361. package/teste-final-npm/core/plugins/__tests__/manager.test.ts +0 -398
  362. package/teste-final-npm/core/plugins/__tests__/monitoring.test.ts +0 -401
  363. package/teste-final-npm/core/plugins/__tests__/registry.test.ts +0 -335
  364. package/teste-final-npm/core/plugins/built-in/index.ts +0 -142
  365. package/teste-final-npm/core/plugins/built-in/logger/index.ts +0 -180
  366. package/teste-final-npm/core/plugins/built-in/monitoring/README.md +0 -193
  367. package/teste-final-npm/core/plugins/built-in/monitoring/index.ts +0 -912
  368. package/teste-final-npm/core/plugins/built-in/static/index.ts +0 -289
  369. package/teste-final-npm/core/plugins/built-in/swagger/index.ts +0 -229
  370. package/teste-final-npm/core/plugins/built-in/vite/index.ts +0 -316
  371. package/teste-final-npm/core/plugins/config.ts +0 -348
  372. package/teste-final-npm/core/plugins/discovery.ts +0 -350
  373. package/teste-final-npm/core/plugins/executor.ts +0 -351
  374. package/teste-final-npm/core/plugins/index.ts +0 -195
  375. package/teste-final-npm/core/plugins/manager.ts +0 -583
  376. package/teste-final-npm/core/plugins/registry.ts +0 -424
  377. package/teste-final-npm/core/plugins/types.ts +0 -254
  378. package/teste-final-npm/core/server/framework.ts +0 -123
  379. package/teste-final-npm/core/server/index.ts +0 -8
  380. package/teste-final-npm/core/server/plugins/database.ts +0 -182
  381. package/teste-final-npm/core/server/plugins/logger.ts +0 -47
  382. package/teste-final-npm/core/server/plugins/swagger.ts +0 -34
  383. package/teste-final-npm/core/server/standalone.ts +0 -91
  384. package/teste-final-npm/core/templates/create-project.ts +0 -455
  385. package/teste-final-npm/core/types/api.ts +0 -169
  386. package/teste-final-npm/core/types/build.ts +0 -174
  387. package/teste-final-npm/core/types/config.ts +0 -68
  388. package/teste-final-npm/core/types/index.ts +0 -127
  389. package/teste-final-npm/core/types/plugin.ts +0 -94
  390. package/teste-final-npm/core/utils/__tests__/errors.test.ts +0 -139
  391. package/teste-final-npm/core/utils/__tests__/helpers.test.ts +0 -297
  392. package/teste-final-npm/core/utils/__tests__/logger.test.ts +0 -141
  393. package/teste-final-npm/core/utils/env-runtime-v2.ts +0 -232
  394. package/teste-final-npm/core/utils/env-runtime.ts +0 -252
  395. package/teste-final-npm/core/utils/errors/codes.ts +0 -115
  396. package/teste-final-npm/core/utils/errors/handlers.ts +0 -63
  397. package/teste-final-npm/core/utils/errors/index.ts +0 -81
  398. package/teste-final-npm/core/utils/helpers.ts +0 -180
  399. package/teste-final-npm/core/utils/index.ts +0 -18
  400. package/teste-final-npm/core/utils/logger/index.ts +0 -161
  401. package/teste-final-npm/core/utils/logger.ts +0 -106
  402. package/teste-final-npm/core/utils/monitoring/index.ts +0 -212
  403. package/teste-final-npm/package-template.json +0 -51
  404. package/teste-final-npm/package.json +0 -51
  405. package/teste-final-npm/tsconfig.json +0 -51
  406. package/teste-final-npm/vite.config.ts +0 -42
@@ -1,394 +0,0 @@
1
- #!/usr/bin/env bun
2
-
3
- import { FluxStackBuilder } from "../build"
4
- import { ProjectCreator } from "../templates/create-project"
5
- import { getConfigSync } from "../config"
6
- import { cliRegistry } from "./command-registry"
7
- import { pluginDiscovery } from "./plugin-discovery"
8
-
9
- const command = process.argv[2]
10
- const args = process.argv.slice(3)
11
-
12
- // Register built-in commands
13
- async function registerBuiltInCommands() {
14
- // Help command
15
- cliRegistry.register({
16
- name: 'help',
17
- description: 'Show help information',
18
- category: 'General',
19
- aliases: ['h', '--help', '-h'],
20
- arguments: [
21
- {
22
- name: 'command',
23
- description: 'Command to show help for',
24
- required: false
25
- }
26
- ],
27
- handler: async (args, options, context) => {
28
- if (args[0]) {
29
- const targetCommand = cliRegistry.get(args[0])
30
- if (targetCommand) {
31
- cliRegistry.showCommandHelp(targetCommand)
32
- } else {
33
- console.error(`❌ Unknown command: ${args[0]}`)
34
- cliRegistry.showHelp()
35
- }
36
- } else {
37
- cliRegistry.showHelp()
38
- }
39
- }
40
- })
41
-
42
- // Dev command
43
- cliRegistry.register({
44
- name: 'dev',
45
- description: 'Start full-stack development server',
46
- category: 'Development',
47
- usage: 'flux dev [options]',
48
- examples: [
49
- 'flux dev # Start development server',
50
- 'flux dev --port 4000 # Start on custom port'
51
- ],
52
- options: [
53
- {
54
- name: 'port',
55
- short: 'p',
56
- description: 'Port for backend server',
57
- type: 'number',
58
- default: 3000
59
- },
60
- {
61
- name: 'frontend-port',
62
- description: 'Port for frontend server',
63
- type: 'number',
64
- default: 5173
65
- }
66
- ],
67
- handler: async (args, options, context) => {
68
- console.log("⚡ FluxStack Full-Stack Development")
69
- console.log(`🌐 Frontend: http://localhost:${options['frontend-port']}`)
70
- console.log(`🚀 Backend: http://localhost:${options.port}`)
71
- console.log("🔄 Backend inicia Vite programaticamente - Zero órfãos!")
72
- console.log("📦 Starting backend server...")
73
- console.log()
74
-
75
- const { spawn } = await import("child_process")
76
- const devProcess = spawn("bun", ["--watch", "app/server/index.ts"], {
77
- stdio: "inherit",
78
- cwd: process.cwd(),
79
- env: {
80
- ...process.env,
81
- FRONTEND_PORT: options['frontend-port'].toString(),
82
- BACKEND_PORT: options.port.toString()
83
- }
84
- })
85
-
86
- process.on('SIGINT', () => {
87
- console.log('\n🛑 Shutting down gracefully...')
88
- devProcess.kill('SIGTERM')
89
- setTimeout(() => {
90
- devProcess.kill('SIGKILL')
91
- process.exit(0)
92
- }, 5000)
93
- })
94
-
95
- devProcess.on('close', (code) => {
96
- process.exit(code || 0)
97
- })
98
-
99
- // Keep the CLI running until the child process exits
100
- return new Promise((resolve) => {
101
- devProcess.on('exit', resolve)
102
- })
103
- }
104
- })
105
-
106
- // Build command
107
- cliRegistry.register({
108
- name: 'build',
109
- description: 'Build the application for production',
110
- category: 'Build',
111
- usage: 'flux build [options]',
112
- examples: [
113
- 'flux build # Build both frontend and backend',
114
- 'flux build --frontend-only # Build only frontend',
115
- 'flux build --backend-only # Build only backend'
116
- ],
117
- options: [
118
- {
119
- name: 'frontend-only',
120
- description: 'Build only frontend',
121
- type: 'boolean'
122
- },
123
- {
124
- name: 'backend-only',
125
- description: 'Build only backend',
126
- type: 'boolean'
127
- },
128
- {
129
- name: 'production',
130
- description: 'Build for production (minified)',
131
- type: 'boolean',
132
- default: true
133
- }
134
- ],
135
- handler: async (args, options, context) => {
136
- const config = getConfigSync()
137
- const builder = new FluxStackBuilder(config)
138
-
139
- if (options['frontend-only']) {
140
- await builder.buildClient()
141
- } else if (options['backend-only']) {
142
- await builder.buildServer()
143
- } else {
144
- await builder.build()
145
- }
146
- }
147
- })
148
-
149
- // Create command
150
- cliRegistry.register({
151
- name: 'create',
152
- description: 'Create a new FluxStack project',
153
- category: 'Project',
154
- usage: 'flux create <project-name> [template]',
155
- examples: [
156
- 'flux create my-app # Create basic project',
157
- 'flux create my-app full # Create full-featured project'
158
- ],
159
- arguments: [
160
- {
161
- name: 'project-name',
162
- description: 'Name of the project to create',
163
- required: true,
164
- type: 'string'
165
- },
166
- {
167
- name: 'template',
168
- description: 'Project template to use',
169
- required: false,
170
- type: 'string',
171
- default: 'basic',
172
- choices: ['basic', 'full']
173
- }
174
- ],
175
- handler: async (args, options, context) => {
176
- const [projectName, template] = args
177
-
178
- if (!/^[a-zA-Z0-9-_]+$/.test(projectName)) {
179
- console.error("❌ Project name can only contain letters, numbers, hyphens, and underscores")
180
- return
181
- }
182
-
183
- try {
184
- const creator = new ProjectCreator({
185
- name: projectName,
186
- template: template as 'basic' | 'full' || 'basic'
187
- })
188
-
189
- await creator.create()
190
- } catch (error) {
191
- console.error("❌ Failed to create project:", error instanceof Error ? error.message : String(error))
192
- throw error
193
- }
194
- }
195
- })
196
- }
197
-
198
- // Main CLI logic
199
- async function main() {
200
- // Register built-in commands
201
- await registerBuiltInCommands()
202
-
203
- // Discover and register plugin commands
204
- await pluginDiscovery.discoverAndRegisterCommands()
205
-
206
- // Handle special cases first
207
- if (!command || command === 'help' || command === '--help' || command === '-h') {
208
- await cliRegistry.execute('help', args)
209
- return
210
- }
211
-
212
- // Check if it's a registered command (built-in or plugin)
213
- if (cliRegistry.has(command)) {
214
- const exitCode = await cliRegistry.execute(command, args)
215
- process.exit(exitCode)
216
- return
217
- }
218
-
219
- // Fallback to legacy command handling for backward compatibility
220
- await handleLegacyCommands()
221
- }
222
-
223
- // Legacy command handling for backward compatibility
224
- async function handleLegacyCommands() {
225
- switch (command) {
226
- case "dev":
227
- console.log("⚡ FluxStack Full-Stack Development")
228
- console.log("🌐 Frontend: http://localhost:5173")
229
- console.log("🚀 Backend: http://localhost:3000")
230
- console.log("🔄 Backend inicia Vite programaticamente - Zero órfãos!")
231
- console.log("📦 Starting backend server...")
232
- console.log()
233
-
234
- // Start only backend - it will start Vite programmatically
235
- const { spawn } = await import("child_process")
236
- const devProcess = spawn("bun", ["--watch", "app/server/index.ts"], {
237
- stdio: "inherit",
238
- cwd: process.cwd()
239
- })
240
-
241
- // Handle process cleanup
242
- process.on('SIGINT', () => {
243
- console.log('\n🛑 Shutting down gracefully...')
244
- devProcess.kill('SIGTERM')
245
- setTimeout(() => {
246
- devProcess.kill('SIGKILL')
247
- process.exit(0)
248
- }, 5000)
249
- })
250
-
251
- devProcess.on('close', (code) => {
252
- process.exit(code || 0)
253
- })
254
-
255
- // Keep the CLI running until the child process exits
256
- await new Promise((resolve) => {
257
- devProcess.on('exit', resolve)
258
- })
259
- break
260
-
261
- case "frontend":
262
- console.log("🎨 FluxStack Frontend Development")
263
- console.log("🌐 Frontend: http://localhost:5173")
264
- console.log("📦 Starting Vite dev server...")
265
- console.log()
266
-
267
- const { spawn: spawnFrontend } = await import("child_process")
268
- const frontendProcess = spawnFrontend("vite", ["--config", "vite.config.ts"], {
269
- stdio: "inherit",
270
- cwd: process.cwd()
271
- })
272
-
273
- process.on('SIGINT', () => {
274
- frontendProcess.kill('SIGINT')
275
- process.exit(0)
276
- })
277
- break
278
-
279
- case "backend":
280
- console.log("⚡ FluxStack Backend Development")
281
- console.log("🚀 API Server: http://localhost:3001")
282
- console.log("📦 Starting backend with hot reload...")
283
- console.log()
284
-
285
- // Start backend with Bun watch for hot reload
286
- const { spawn: spawnBackend } = await import("child_process")
287
- const backendProcess = spawnBackend("bun", ["--watch", "app/server/backend-only.ts"], {
288
- stdio: "inherit",
289
- cwd: process.cwd()
290
- })
291
-
292
- // Handle process cleanup
293
- process.on('SIGINT', () => {
294
- backendProcess.kill('SIGINT')
295
- process.exit(0)
296
- })
297
- break
298
-
299
- case "build":
300
- const config = getConfigSync()
301
- const builder = new FluxStackBuilder(config)
302
- await builder.build()
303
- break
304
-
305
- case "build:frontend":
306
- const frontendConfig = getConfigSync()
307
- const frontendBuilder = new FluxStackBuilder(frontendConfig)
308
- await frontendBuilder.buildClient()
309
- break
310
-
311
- case "build:backend":
312
- const backendConfig = getConfigSync()
313
- const backendBuilder = new FluxStackBuilder(backendConfig)
314
- await backendBuilder.buildServer()
315
- break
316
-
317
- case "start":
318
- console.log("🚀 Starting FluxStack production server...")
319
- await import(process.cwd() + "/dist/index.js")
320
- break
321
-
322
- case "create":
323
- const projectName = process.argv[3]
324
- const template = process.argv[4]
325
-
326
- if (!projectName) {
327
- console.error("❌ Please provide a project name: flux create my-app")
328
- console.error()
329
- console.error("Usage:")
330
- console.error(" flux create <project-name> [template]")
331
- console.error()
332
- console.error("Templates:")
333
- console.error(" basic Basic FluxStack project (default)")
334
- console.error(" full Full-featured project with examples")
335
- process.exit(1)
336
- }
337
-
338
- // Validate project name
339
- if (!/^[a-zA-Z0-9-_]+$/.test(projectName)) {
340
- console.error("❌ Project name can only contain letters, numbers, hyphens, and underscores")
341
- process.exit(1)
342
- }
343
-
344
- try {
345
- const creator = new ProjectCreator({
346
- name: projectName,
347
- template: template as 'basic' | 'full' || 'basic'
348
- })
349
-
350
- await creator.create()
351
- } catch (error) {
352
- console.error("❌ Failed to create project:", error instanceof Error ? error.message : String(error))
353
- process.exit(1)
354
- }
355
- break
356
-
357
- default:
358
- console.log(`
359
- ⚡ FluxStack Framework CLI
360
-
361
- Usage:
362
- flux dev Start full-stack development server
363
- flux frontend Start frontend only (Vite dev server)
364
- flux backend Start backend only (API server)
365
- flux build Build both frontend and backend
366
- flux build:frontend Build frontend only
367
- flux build:backend Build backend only
368
- flux start Start production server
369
- flux create Create new project
370
-
371
- Examples:
372
- flux dev # Full-stack development
373
- flux frontend # Frontend only (port 5173)
374
- flux backend # Backend only (port 3001)
375
- flux create my-app # Create new project
376
-
377
- Alternative commands:
378
- fluxstack dev # Same as flux dev
379
- bun run dev:frontend # Direct frontend start
380
- bun run dev:backend # Direct backend start
381
-
382
- Environment Variables:
383
- FRONTEND_PORT=5173 # Frontend port
384
- BACKEND_PORT=3001 # Backend port
385
- API_URL=http://localhost:3001 # API URL for frontend
386
- `)
387
- }
388
- }
389
-
390
- // Run main CLI
391
- main().catch(error => {
392
- console.error('❌ CLI Error:', error instanceof Error ? error.message : String(error))
393
- process.exit(1)
394
- })
@@ -1,200 +0,0 @@
1
- import { existsSync } from 'fs'
2
- import { join } from 'path'
3
- import type { Plugin } from '../plugins/types'
4
- import { cliRegistry } from './command-registry'
5
- import { logger } from '../utils/logger'
6
-
7
- export class CliPluginDiscovery {
8
- private loadedPlugins = new Set<string>()
9
-
10
- async discoverAndRegisterCommands(): Promise<void> {
11
- // 1. Load built-in plugins with CLI commands
12
- await this.loadBuiltInPlugins()
13
-
14
- // 2. Load external plugins from node_modules
15
- await this.loadExternalPlugins()
16
-
17
- // 3. Load local plugins from project
18
- await this.loadLocalPlugins()
19
- }
20
-
21
- private async loadBuiltInPlugins(): Promise<void> {
22
- const builtInPluginsDir = join(__dirname, '../server/plugins')
23
-
24
- if (!existsSync(builtInPluginsDir)) {
25
- return
26
- }
27
-
28
- try {
29
- // For now, we'll manually list built-in plugins that might have CLI commands
30
- const potentialPlugins = [
31
- 'logger',
32
- 'vite',
33
- 'swagger',
34
- 'static',
35
- 'database'
36
- ]
37
-
38
- for (const pluginName of potentialPlugins) {
39
- try {
40
- const pluginPath = join(builtInPluginsDir, `${pluginName}.ts`)
41
- if (existsSync(pluginPath)) {
42
- const pluginModule = await import(pluginPath)
43
- const plugin = pluginModule[`${pluginName}Plugin`] as Plugin
44
-
45
- if (plugin && plugin.commands) {
46
- this.registerPluginCommands(plugin)
47
- }
48
- }
49
- } catch (error) {
50
- logger.debug(`Failed to load built-in plugin ${pluginName}:`, error)
51
- }
52
- }
53
- } catch (error) {
54
- logger.debug('Failed to scan built-in plugins:', error)
55
- }
56
- }
57
-
58
- private async loadExternalPlugins(): Promise<void> {
59
- const nodeModulesDir = join(process.cwd(), 'node_modules')
60
-
61
- if (!existsSync(nodeModulesDir)) {
62
- return
63
- }
64
-
65
- try {
66
- const fs = await import('fs')
67
- const entries = fs.readdirSync(nodeModulesDir, { withFileTypes: true })
68
-
69
- for (const entry of entries) {
70
- if (!entry.isDirectory()) continue
71
-
72
- // Check for FluxStack plugins (convention: fluxstack-plugin-*)
73
- if (entry.name.startsWith('fluxstack-plugin-')) {
74
- await this.loadExternalPlugin(entry.name)
75
- }
76
-
77
- // Check for scoped packages (@fluxstack/plugin-*)
78
- if (entry.name.startsWith('@fluxstack')) {
79
- const scopedDir = join(nodeModulesDir, entry.name)
80
- if (existsSync(scopedDir)) {
81
- const scopedEntries = fs.readdirSync(scopedDir, { withFileTypes: true })
82
- for (const scopedEntry of scopedEntries) {
83
- if (scopedEntry.isDirectory() && scopedEntry.name.startsWith('plugin-')) {
84
- await this.loadExternalPlugin(`${entry.name}/${scopedEntry.name}`)
85
- }
86
- }
87
- }
88
- }
89
- }
90
- } catch (error) {
91
- logger.debug('Failed to scan external plugins:', error)
92
- }
93
- }
94
-
95
- private async loadExternalPlugin(packageName: string): Promise<void> {
96
- try {
97
- const packagePath = join(process.cwd(), 'node_modules', packageName)
98
- const packageJsonPath = join(packagePath, 'package.json')
99
-
100
- if (!existsSync(packageJsonPath)) {
101
- return
102
- }
103
-
104
- const packageJson = JSON.parse(await import('fs').then(fs =>
105
- fs.readFileSync(packageJsonPath, 'utf-8')
106
- ))
107
-
108
- // Check if this is a FluxStack plugin
109
- if (packageJson.fluxstack?.plugin) {
110
- const entryPoint = packageJson.main || 'index.js'
111
- const pluginPath = join(packagePath, entryPoint)
112
-
113
- if (existsSync(pluginPath)) {
114
- const pluginModule = await import(pluginPath)
115
- const plugin = pluginModule.default || pluginModule[packageJson.fluxstack.plugin] as Plugin
116
-
117
- if (plugin && plugin.commands) {
118
- this.registerPluginCommands(plugin)
119
- }
120
- }
121
- }
122
- } catch (error) {
123
- logger.debug(`Failed to load external plugin ${packageName}:`, error)
124
- }
125
- }
126
-
127
- private async loadLocalPlugins(): Promise<void> {
128
- const localPluginsDir = join(process.cwd(), 'plugins')
129
-
130
- if (!existsSync(localPluginsDir)) {
131
- return
132
- }
133
-
134
- try {
135
- const fs = await import('fs')
136
- const entries = fs.readdirSync(localPluginsDir, { withFileTypes: true })
137
-
138
- for (const entry of entries) {
139
- if (entry.isFile() && (entry.name.endsWith('.ts') || entry.name.endsWith('.js'))) {
140
- const pluginPath = join(localPluginsDir, entry.name)
141
-
142
- try {
143
- const pluginModule = await import(pluginPath)
144
- const plugin = pluginModule.default || Object.values(pluginModule).find(
145
- (exp: any) => exp && typeof exp === 'object' && exp.name && exp.commands
146
- ) as Plugin
147
-
148
- if (plugin && plugin.commands) {
149
- this.registerPluginCommands(plugin)
150
- }
151
- } catch (error) {
152
- logger.debug(`Failed to load local plugin ${entry.name}:`, error)
153
- }
154
- }
155
- }
156
- } catch (error) {
157
- logger.debug('Failed to scan local plugins:', error)
158
- }
159
- }
160
-
161
- private registerPluginCommands(plugin: Plugin): void {
162
- if (!plugin.commands || this.loadedPlugins.has(plugin.name)) {
163
- return
164
- }
165
-
166
- try {
167
- for (const command of plugin.commands) {
168
- // Prefix command with plugin name to avoid conflicts
169
- const prefixedCommand = {
170
- ...command,
171
- name: `${plugin.name}:${command.name}`,
172
- category: command.category || `Plugin: ${plugin.name}`,
173
- aliases: command.aliases?.map(alias => `${plugin.name}:${alias}`)
174
- }
175
-
176
- cliRegistry.register(prefixedCommand)
177
-
178
- // Also register without prefix if no conflict exists
179
- if (!cliRegistry.has(command.name)) {
180
- cliRegistry.register({
181
- ...command,
182
- category: command.category || `Plugin: ${plugin.name}`
183
- })
184
- }
185
- }
186
-
187
- this.loadedPlugins.add(plugin.name)
188
- logger.debug(`Registered ${plugin.commands.length} CLI commands from plugin: ${plugin.name}`)
189
-
190
- } catch (error) {
191
- logger.error(`Failed to register CLI commands for plugin ${plugin.name}:`, error)
192
- }
193
- }
194
-
195
- getLoadedPlugins(): string[] {
196
- return Array.from(this.loadedPlugins)
197
- }
198
- }
199
-
200
- export const pluginDiscovery = new CliPluginDiscovery()
@@ -1,57 +0,0 @@
1
- // Standalone frontend development
2
- import { spawn } from "bun"
3
- import { join } from "path"
4
-
5
- export const startFrontendOnly = (config: any = {}) => {
6
- const clientPath = config.clientPath || "app/client"
7
- const port = config.vitePort || process.env.FRONTEND_PORT || 5173
8
- const apiUrl = config.apiUrl || process.env.API_URL || 'http://localhost:3000/api'
9
-
10
- console.log(`⚛️ FluxStack Frontend`)
11
- console.log(`🌐 http://${process.env.HOST || 'localhost'}:${port}`)
12
- console.log(`🔗 API: ${apiUrl}`)
13
- console.log()
14
-
15
- const viteProcess = spawn({
16
- cmd: ["bun", "run", "dev"],
17
- cwd: join(process.cwd(), clientPath),
18
- stdout: "pipe",
19
- stderr: "pipe",
20
- env: {
21
- ...process.env,
22
- VITE_API_URL: apiUrl,
23
- PORT: port.toString(),
24
- HOST: process.env.HOST || 'localhost'
25
- }
26
- })
27
-
28
- if (viteProcess.stdout) {
29
- viteProcess.stdout.pipeTo(new WritableStream({
30
- write(chunk) {
31
- const output = new TextDecoder().decode(chunk)
32
- // Filtrar mensagens desnecessárias do Vite
33
- if (!output.includes("hmr update") && !output.includes("Local:")) {
34
- console.log(output)
35
- }
36
- }
37
- })).catch(() => {}) // Ignore pipe errors
38
- }
39
-
40
- if (viteProcess.stderr) {
41
- viteProcess.stderr.pipeTo(new WritableStream({
42
- write(chunk) {
43
- const error = new TextDecoder().decode(chunk)
44
- console.error(error)
45
- }
46
- })).catch(() => {}) // Ignore pipe errors
47
- }
48
-
49
- // Cleanup ao sair
50
- process.on("SIGINT", () => {
51
- console.log("\n🛑 Stopping frontend...")
52
- viteProcess.kill()
53
- process.exit(0)
54
- })
55
-
56
- return viteProcess
57
- }