nuclie 1.0.9 → 1.0.10

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 (654) hide show
  1. package/README.md +6 -13
  2. package/dist/ai/analyzer.d.ts +0 -10
  3. package/dist/ai/analyzer.js +0 -27
  4. package/dist/ai/client.js +0 -4
  5. package/dist/ai/cloud/api.js +4 -4
  6. package/dist/ai/cloud/modelSync.js +1 -13
  7. package/dist/ai/cloud/telemetry.js +0 -1
  8. package/dist/ai/config.js +1 -1
  9. package/dist/ai/core/errorMemory.js +2 -7
  10. package/dist/ai/dashboard/cli.js +0 -2
  11. package/dist/ai/healer/applier.js +1 -9
  12. package/dist/ai/healer/cli.js +0 -2
  13. package/dist/ai/healer/collector.js +0 -1
  14. package/dist/ai/healer/fixer.js +1 -3
  15. package/dist/ai/healer/llm.js +0 -1
  16. package/dist/ai/healer/parser.js +0 -9
  17. package/dist/ai/learning/evolver.js +0 -5
  18. package/dist/ai/llm/fixGenerator.js +0 -6
  19. package/dist/ai/llm/ollama.js +2 -0
  20. package/dist/ai/local/fixStore.js +2 -5
  21. package/dist/ai/optimizer/analyzer.js +1 -2
  22. package/dist/ai/optimizer/engine.js +0 -3
  23. package/dist/ai/optimizer/llm.js +0 -3
  24. package/dist/ai/optimizer/profiler.js +3 -5
  25. package/dist/ai/optimizer/rules.js +0 -4
  26. package/dist/ai/reporter/assembler.js +1 -1
  27. package/dist/ai/reporter/generator.js +0 -3
  28. package/dist/ai/reporter/narrator.js +0 -1
  29. package/dist/ai/schema.js +1 -1
  30. package/dist/ai/telemetry.js +0 -4
  31. package/dist/audit/a11y.js +0 -9
  32. package/dist/audit/best-practices.js +0 -5
  33. package/dist/audit/build-integration.d.ts +0 -22
  34. package/dist/audit/build-integration.js +1 -30
  35. package/dist/audit/core.d.ts +0 -40
  36. package/dist/audit/core.js +2 -69
  37. package/dist/audit/index.js +1 -5
  38. package/dist/audit/perf.js +0 -5
  39. package/dist/audit/seo.js +0 -5
  40. package/dist/build/bundler.js +1 -3
  41. package/dist/build/index.d.ts +0 -12
  42. package/dist/build/index.js +0 -12
  43. package/dist/build/pipeline.d.ts +3 -11
  44. package/dist/build/pipeline.js +109 -22
  45. package/dist/builder/server.d.ts +0 -4
  46. package/dist/builder/server.js +1 -28
  47. package/dist/cache/incremental.d.ts +0 -34
  48. package/dist/cache/incremental.js +0 -40
  49. package/dist/cache/index.js +14 -24
  50. package/dist/cache/rocksdb.js +0 -3
  51. package/dist/cli/css-cli.js +0 -9
  52. package/dist/cli/inspect.js +0 -23
  53. package/dist/cli.js +87 -266
  54. package/dist/commands/analyze.js +1 -8
  55. package/dist/commands/doctor.js +1 -15
  56. package/dist/commands/lib-build.d.ts +17 -0
  57. package/dist/commands/lib-build.js +101 -0
  58. package/dist/commands/preview.d.ts +9 -0
  59. package/dist/commands/preview.js +157 -0
  60. package/dist/commands/ssr.d.ts +0 -6
  61. package/dist/commands/ssr.js +0 -9
  62. package/dist/commands/verify.d.ts +0 -12
  63. package/dist/commands/verify.js +0 -59
  64. package/dist/commands/workspaces.d.ts +1 -0
  65. package/dist/commands/workspaces.js +66 -0
  66. package/dist/config/index.js +22 -5
  67. package/dist/config/live-config.d.ts +1 -0
  68. package/dist/config/live-config.js +18 -7
  69. package/dist/config-loader.d.ts +15 -0
  70. package/dist/config-loader.js +144 -0
  71. package/dist/core/build/globalOptimizer.d.ts +0 -4
  72. package/dist/core/build/globalOptimizer.js +0 -5
  73. package/dist/core/build/incremental.d.ts +0 -7
  74. package/dist/core/build/incremental.js +0 -10
  75. package/dist/core/bundler-rolldown.d.ts +0 -13
  76. package/dist/core/bundler-rolldown.js +4 -26
  77. package/dist/core/cache/lazy-init.d.ts +0 -24
  78. package/dist/core/cache/lazy-init.js +0 -32
  79. package/dist/core/cache-manager.d.ts +0 -22
  80. package/dist/core/cache-manager.js +1 -36
  81. package/dist/core/css/engine.d.ts +0 -18
  82. package/dist/core/css/engine.js +2 -35
  83. package/dist/core/css-framework-detector.d.ts +0 -3
  84. package/dist/core/css-framework-detector.js +1 -40
  85. package/dist/core/detection/files.js +0 -11
  86. package/dist/core/detection/index.d.ts +0 -5
  87. package/dist/core/detection/index.js +0 -19
  88. package/dist/core/detection/resolver.js +7 -36
  89. package/dist/core/detection/scanner.js +7 -18
  90. package/dist/core/detection/types.js +0 -2
  91. package/dist/core/engine/cache.d.ts +2 -1
  92. package/dist/core/engine/cache.js +26 -26
  93. package/dist/core/engine/config.d.ts +0 -5
  94. package/dist/core/engine/config.js +18 -61
  95. package/dist/core/engine/emit.d.ts +0 -5
  96. package/dist/core/engine/emit.js +0 -12
  97. package/dist/core/engine/events.js +0 -2
  98. package/dist/core/engine/execute.d.ts +0 -3
  99. package/dist/core/engine/execute.js +65 -44
  100. package/dist/core/engine/hash.d.ts +0 -7
  101. package/dist/core/engine/hash.js +2 -11
  102. package/dist/core/engine/index.d.ts +1 -20
  103. package/dist/core/engine/index.js +36 -42
  104. package/dist/core/engine/optimize.js +7 -10
  105. package/dist/core/engine/plan.d.ts +0 -5
  106. package/dist/core/engine/plan.js +5 -30
  107. package/dist/core/errors/hero-errors.d.ts +0 -26
  108. package/dist/core/errors/hero-errors.js +0 -41
  109. package/dist/core/framework-detector.d.ts +0 -4
  110. package/dist/core/framework-detector.js +0 -10
  111. package/dist/core/graph/js-graph-analyzer.d.ts +0 -28
  112. package/dist/core/graph/js-graph-analyzer.js +1 -42
  113. package/dist/core/graph/serializer.d.ts +2 -0
  114. package/dist/core/graph/serializer.js +3 -2
  115. package/dist/core/interop/analyze.d.ts +0 -6
  116. package/dist/core/interop/analyze.js +2 -24
  117. package/dist/core/interop/analyze_ast.d.ts +0 -7
  118. package/dist/core/interop/analyze_ast.js +3 -48
  119. package/dist/core/interop/index.d.ts +0 -5
  120. package/dist/core/interop/index.js +2 -12
  121. package/dist/core/interop/resolve.d.ts +0 -6
  122. package/dist/core/interop/resolve.js +0 -16
  123. package/dist/core/interop/types.js +0 -1
  124. package/dist/core/interop/wrapper.d.ts +0 -9
  125. package/dist/core/interop/wrapper.js +0 -28
  126. package/dist/core/parser-bun.d.ts +0 -13
  127. package/dist/core/parser-bun.js +1 -25
  128. package/dist/core/permissions.js +2 -2
  129. package/dist/core/pipeline/framework-pipeline.d.ts +0 -10
  130. package/dist/core/pipeline/framework-pipeline.js +1 -21
  131. package/dist/core/plugins/manager.d.ts +2 -15
  132. package/dist/core/plugins/manager.js +13 -21
  133. package/dist/core/plugins/sandbox_js.js +0 -6
  134. package/dist/core/plugins/sandbox_wasm.d.ts +2 -0
  135. package/dist/core/plugins/sandbox_wasm.js +41 -32
  136. package/dist/core/plugins/types.d.ts +0 -6
  137. package/dist/core/plugins/types.js +0 -1
  138. package/dist/core/plugins/validation.d.ts +0 -4
  139. package/dist/core/plugins/validation.js +1 -11
  140. package/dist/core/sandbox.js +23 -5
  141. package/dist/core/steps/css-optimization.d.ts +0 -40
  142. package/dist/core/steps/css-optimization.js +0 -70
  143. package/dist/core/steps.d.ts +0 -4
  144. package/dist/core/steps.js +0 -6
  145. package/dist/core/transform/batchTransformer.d.ts +0 -3
  146. package/dist/core/transform/batchTransformer.js +1 -6
  147. package/dist/core/transform/transformer.js +5 -23
  148. package/dist/core/universal-transformer.d.ts +0 -42
  149. package/dist/core/universal-transformer.js +71 -127
  150. package/dist/create/index.js +2 -49
  151. package/dist/create/ui.d.ts +0 -9
  152. package/dist/create/ui.js +0 -9
  153. package/dist/create-nuclie/cli.d.ts +0 -5
  154. package/dist/create-nuclie/cli.js +7 -14
  155. package/dist/create-nuclie.js +0 -0
  156. package/dist/dashboard/metrics.d.ts +0 -4
  157. package/dist/dashboard/metrics.js +1 -7
  158. package/dist/dashboard/server/router.d.ts +0 -4
  159. package/dist/dashboard/server/router.js +0 -13
  160. package/dist/dev/configWatcher.js +1 -1
  161. package/dist/dev/devServer.js +128 -248
  162. package/dist/dev/devServer.minimal.d.ts +0 -5
  163. package/dist/dev/devServer.minimal.js +17 -32
  164. package/dist/dev/federation-dev.d.ts +3 -0
  165. package/dist/dev/federation-dev.js +88 -10
  166. package/dist/dev/hmr-engine.js +0 -6
  167. package/dist/dev/hmr-v2.d.ts +0 -13
  168. package/dist/dev/hmr-v2.js +35 -34
  169. package/dist/dev/hmrThrottle.js +0 -6
  170. package/dist/dev/overlay/overlay-client.d.ts +0 -5
  171. package/dist/dev/overlay/overlay-client.js +0 -9
  172. package/dist/dev/overlay/overlay-ui.d.ts +0 -5
  173. package/dist/dev/overlay/overlay-ui.js +0 -10
  174. package/dist/dev/preBundler.d.ts +0 -10
  175. package/dist/dev/preBundler.js +7 -58
  176. package/dist/dev/statusHandler.js +0 -2
  177. package/dist/dev-middleware.d.ts +7 -0
  178. package/dist/dev-middleware.js +117 -0
  179. package/dist/dev-server-manual.d.ts +0 -4
  180. package/dist/dev-server-manual.js +0 -4
  181. package/dist/dev-server.d.ts +0 -7
  182. package/dist/dev-server.js +10 -26
  183. package/dist/env/api.d.ts +0 -12
  184. package/dist/env/api.js +0 -12
  185. package/dist/env.d.ts +12 -0
  186. package/dist/env.js +109 -0
  187. package/dist/federation/index.d.ts +23 -0
  188. package/dist/federation/index.js +405 -0
  189. package/dist/fix/ast-transforms.d.ts +0 -43
  190. package/dist/fix/ast-transforms.js +1 -65
  191. package/dist/hmr/classifier.d.ts +0 -15
  192. package/dist/hmr/classifier.js +0 -30
  193. package/dist/hmr/index.d.ts +0 -3
  194. package/dist/hmr/index.js +0 -3
  195. package/dist/hmr/overlay.d.ts +0 -12
  196. package/dist/hmr/overlay.js +1 -23
  197. package/dist/index.d.ts +12 -27
  198. package/dist/index.js +6 -46
  199. package/dist/init/bootstrap.js +25 -41
  200. package/dist/init/index.js +0 -9
  201. package/dist/marketplace/client.d.ts +9 -15
  202. package/dist/marketplace/client.js +29 -33
  203. package/dist/marketplace/db.d.ts +5 -5
  204. package/dist/marketplace/db.js +36 -9
  205. package/dist/marketplace/plugin-adapter.d.ts +0 -4
  206. package/dist/marketplace/plugin-adapter.js +5 -15
  207. package/dist/marketplace/server.d.ts +25 -16
  208. package/dist/marketplace/server.js +27 -23
  209. package/dist/meta-frameworks/base-router.d.ts +0 -43
  210. package/dist/meta-frameworks/base-router.js +1 -62
  211. package/dist/meta-frameworks/index.d.ts +0 -3
  212. package/dist/meta-frameworks/index.js +0 -3
  213. package/dist/meta-frameworks/nextjs/router.d.ts +0 -22
  214. package/dist/meta-frameworks/nextjs/router.js +6 -44
  215. package/dist/meta-frameworks/nuxt/router.d.ts +0 -13
  216. package/dist/meta-frameworks/nuxt/router.js +4 -23
  217. package/dist/meta-frameworks/remix/router.d.ts +0 -19
  218. package/dist/meta-frameworks/remix/router.js +1 -28
  219. package/dist/meta-frameworks/ssr/react-renderer.d.ts +0 -12
  220. package/dist/meta-frameworks/ssr/react-renderer.js +0 -15
  221. package/dist/meta-frameworks/ssr/server.d.ts +0 -55
  222. package/dist/meta-frameworks/ssr/server.js +2 -72
  223. package/dist/meta-frameworks/ssr/vue-renderer.d.ts +0 -7
  224. package/dist/meta-frameworks/ssr/vue-renderer.js +0 -11
  225. package/dist/meta-frameworks/types.d.ts +0 -36
  226. package/dist/meta-frameworks/types.js +0 -4
  227. package/dist/migrate/analyzer.d.ts +0 -6
  228. package/dist/migrate/analyzer.js +0 -20
  229. package/dist/migrate/cli.d.ts +0 -5
  230. package/dist/migrate/cli.js +0 -7
  231. package/dist/migrate/generator.d.ts +0 -6
  232. package/dist/migrate/generator.js +0 -22
  233. package/dist/native/cache.d.ts +0 -66
  234. package/dist/native/cache.js +0 -67
  235. package/dist/native/index.js +0 -2
  236. package/dist/native/orchestrator.d.ts +0 -60
  237. package/dist/native/orchestrator.js +0 -62
  238. package/dist/native/wasm.d.ts +0 -16
  239. package/dist/native/wasm.js +0 -18
  240. package/dist/plugins/assets.js +1 -5
  241. package/dist/plugins/compat/adapter.d.ts +0 -22
  242. package/dist/plugins/compat/adapter.js +3 -45
  243. package/dist/plugins/compat/deferred.d.ts +0 -10
  244. package/dist/plugins/compat/deferred.js +0 -14
  245. package/dist/plugins/compat/index.d.ts +1 -6
  246. package/dist/plugins/compat/index.js +4 -9
  247. package/dist/plugins/compat/rollup.d.ts +22 -11
  248. package/dist/plugins/compat/rollup.js +27 -14
  249. package/dist/plugins/compat/tier-a.d.ts +0 -45
  250. package/dist/plugins/compat/tier-a.js +0 -47
  251. package/dist/plugins/compat/tier-b.d.ts +0 -16
  252. package/dist/plugins/compat/tier-b.js +0 -12
  253. package/dist/plugins/compat/tier-c.d.ts +0 -24
  254. package/dist/plugins/compat/tier-c.js +0 -21
  255. package/dist/plugins/compat/webpack.d.ts +0 -4
  256. package/dist/plugins/compat/webpack.js +0 -13
  257. package/dist/plugins/core/linker.d.ts +0 -6
  258. package/dist/plugins/core/linker.js +0 -16
  259. package/dist/plugins/css/bootstrap.d.ts +0 -13
  260. package/dist/plugins/css/bootstrap.js +1 -23
  261. package/dist/plugins/css/bulma.d.ts +0 -13
  262. package/dist/plugins/css/bulma.js +0 -16
  263. package/dist/plugins/css/css-modules.d.ts +0 -10
  264. package/dist/plugins/css/css-modules.js +0 -17
  265. package/dist/plugins/css/css-optimizer.d.ts +0 -16
  266. package/dist/plugins/css/css-optimizer.js +1 -23
  267. package/dist/plugins/css/emotion.d.ts +0 -13
  268. package/dist/plugins/css/emotion.js +0 -18
  269. package/dist/plugins/css/material.d.ts +0 -13
  270. package/dist/plugins/css/material.js +0 -17
  271. package/dist/plugins/css/postcss.js +0 -7
  272. package/dist/plugins/css/sass.js +0 -2
  273. package/dist/plugins/css/styled-components.d.ts +0 -13
  274. package/dist/plugins/css/styled-components.js +1 -17
  275. package/dist/plugins/css/stylus.js +0 -1
  276. package/dist/plugins/css/tailwind.js +0 -16
  277. package/dist/plugins/css-in-js.d.ts +0 -5
  278. package/dist/plugins/css-in-js.js +0 -17
  279. package/dist/plugins/edge.js +0 -5
  280. package/dist/plugins/esbuildAdapter.js +3 -10
  281. package/dist/plugins/federation_next.js +64 -18
  282. package/dist/plugins/framework-plugins.js +1 -7
  283. package/dist/plugins/frameworks/index.d.ts +0 -3
  284. package/dist/plugins/frameworks/index.js +0 -5
  285. package/dist/plugins/frameworks/lit.d.ts +0 -24
  286. package/dist/plugins/frameworks/lit.js +0 -17
  287. package/dist/plugins/frameworks/react.d.ts +0 -25
  288. package/dist/plugins/frameworks/react.js +1 -29
  289. package/dist/plugins/frameworks/solid.d.ts +0 -24
  290. package/dist/plugins/frameworks/solid.js +1 -21
  291. package/dist/plugins/frameworks/svelte.d.ts +0 -28
  292. package/dist/plugins/frameworks/svelte.js +1 -23
  293. package/dist/plugins/frameworks/vue.d.ts +0 -28
  294. package/dist/plugins/frameworks/vue.js +0 -28
  295. package/dist/plugins/governance.d.ts +0 -19
  296. package/dist/plugins/governance.js +2 -25
  297. package/dist/plugins/implementations/analytics.d.ts +0 -4
  298. package/dist/plugins/implementations/analytics.js +0 -5
  299. package/dist/plugins/implementations/apollo.d.ts +0 -4
  300. package/dist/plugins/implementations/apollo.js +0 -5
  301. package/dist/plugins/implementations/audit.d.ts +0 -4
  302. package/dist/plugins/implementations/audit.js +0 -7
  303. package/dist/plugins/implementations/auto-fix.d.ts +0 -4
  304. package/dist/plugins/implementations/auto-fix.js +0 -5
  305. package/dist/plugins/implementations/avif.d.ts +0 -4
  306. package/dist/plugins/implementations/avif.js +0 -6
  307. package/dist/plugins/implementations/babel.d.ts +0 -4
  308. package/dist/plugins/implementations/babel.js +0 -5
  309. package/dist/plugins/implementations/bundle-analyzer.d.ts +0 -4
  310. package/dist/plugins/implementations/bundle-analyzer.js +0 -5
  311. package/dist/plugins/implementations/bundle-size.d.ts +0 -4
  312. package/dist/plugins/implementations/bundle-size.js +0 -5
  313. package/dist/plugins/implementations/checker.d.ts +0 -4
  314. package/dist/plugins/implementations/checker.js +0 -5
  315. package/dist/plugins/implementations/chromatic.d.ts +0 -4
  316. package/dist/plugins/implementations/chromatic.js +0 -5
  317. package/dist/plugins/implementations/cloudflare.d.ts +0 -4
  318. package/dist/plugins/implementations/cloudflare.js +0 -5
  319. package/dist/plugins/implementations/code-split.d.ts +0 -4
  320. package/dist/plugins/implementations/code-split.js +0 -5
  321. package/dist/plugins/implementations/compression.d.ts +0 -4
  322. package/dist/plugins/implementations/compression.js +0 -5
  323. package/dist/plugins/implementations/copy.d.ts +0 -4
  324. package/dist/plugins/implementations/copy.js +0 -5
  325. package/dist/plugins/implementations/critical-css.d.ts +0 -4
  326. package/dist/plugins/implementations/critical-css.js +0 -8
  327. package/dist/plugins/implementations/crypto-sign.d.ts +0 -4
  328. package/dist/plugins/implementations/crypto-sign.js +0 -7
  329. package/dist/plugins/implementations/css-framework.d.ts +0 -4
  330. package/dist/plugins/implementations/css-framework.js +0 -8
  331. package/dist/plugins/implementations/css.d.ts +0 -4
  332. package/dist/plugins/implementations/css.js +0 -8
  333. package/dist/plugins/implementations/cypress.d.ts +0 -4
  334. package/dist/plugins/implementations/cypress.js +0 -5
  335. package/dist/plugins/implementations/determinism.d.ts +0 -4
  336. package/dist/plugins/implementations/determinism.js +0 -5
  337. package/dist/plugins/implementations/edge.d.ts +0 -5
  338. package/dist/plugins/implementations/edge.js +0 -8
  339. package/dist/plugins/implementations/env-validation.d.ts +0 -4
  340. package/dist/plugins/implementations/env-validation.js +0 -7
  341. package/dist/plugins/implementations/eslint.d.ts +0 -4
  342. package/dist/plugins/implementations/eslint.js +0 -5
  343. package/dist/plugins/implementations/federation.d.ts +0 -4
  344. package/dist/plugins/implementations/federation.js +0 -5
  345. package/dist/plugins/implementations/file.d.ts +0 -4
  346. package/dist/plugins/implementations/file.js +0 -6
  347. package/dist/plugins/implementations/font-subset.d.ts +0 -4
  348. package/dist/plugins/implementations/font-subset.js +0 -6
  349. package/dist/plugins/implementations/fonts.d.ts +0 -4
  350. package/dist/plugins/implementations/fonts.js +0 -6
  351. package/dist/plugins/implementations/formatjs.d.ts +0 -4
  352. package/dist/plugins/implementations/formatjs.js +0 -5
  353. package/dist/plugins/implementations/graphql.d.ts +0 -4
  354. package/dist/plugins/implementations/graphql.js +0 -5
  355. package/dist/plugins/implementations/hmr-classify.d.ts +0 -4
  356. package/dist/plugins/implementations/hmr-classify.js +0 -5
  357. package/dist/plugins/implementations/html.d.ts +0 -4
  358. package/dist/plugins/implementations/html.js +0 -5
  359. package/dist/plugins/implementations/i18n.d.ts +0 -4
  360. package/dist/plugins/implementations/i18n.js +0 -5
  361. package/dist/plugins/implementations/icon.d.ts +0 -4
  362. package/dist/plugins/implementations/icon.js +0 -6
  363. package/dist/plugins/implementations/imagemin.d.ts +0 -4
  364. package/dist/plugins/implementations/imagemin.js +0 -6
  365. package/dist/plugins/implementations/inspect.d.ts +0 -4
  366. package/dist/plugins/implementations/inspect.js +0 -5
  367. package/dist/plugins/implementations/jest.d.ts +0 -4
  368. package/dist/plugins/implementations/jest.js +0 -6
  369. package/dist/plugins/implementations/jotai.d.ts +0 -5
  370. package/dist/plugins/implementations/jotai.js +0 -8
  371. package/dist/plugins/implementations/lazy-load.d.ts +0 -4
  372. package/dist/plugins/implementations/lazy-load.js +0 -5
  373. package/dist/plugins/implementations/legacy.d.ts +0 -4
  374. package/dist/plugins/implementations/legacy.js +0 -5
  375. package/dist/plugins/implementations/lighthouse.d.ts +0 -4
  376. package/dist/plugins/implementations/lighthouse.js +0 -5
  377. package/dist/plugins/implementations/manifest.d.ts +0 -4
  378. package/dist/plugins/implementations/manifest.js +0 -5
  379. package/dist/plugins/implementations/markdown.d.ts +0 -4
  380. package/dist/plugins/implementations/markdown.js +0 -5
  381. package/dist/plugins/implementations/md.d.ts +0 -4
  382. package/dist/plugins/implementations/md.js +0 -5
  383. package/dist/plugins/implementations/mdx.d.ts +0 -4
  384. package/dist/plugins/implementations/mdx.js +0 -5
  385. package/dist/plugins/implementations/meta-tags.d.ts +0 -4
  386. package/dist/plugins/implementations/meta-tags.js +0 -5
  387. package/dist/plugins/implementations/mini-css-extract-plugin.d.ts +0 -4
  388. package/dist/plugins/implementations/mini-css-extract-plugin.js +0 -8
  389. package/dist/plugins/implementations/mobx.d.ts +0 -5
  390. package/dist/plugins/implementations/mobx.js +0 -8
  391. package/dist/plugins/implementations/mock.d.ts +0 -4
  392. package/dist/plugins/implementations/mock.js +0 -5
  393. package/dist/plugins/implementations/msw.d.ts +0 -4
  394. package/dist/plugins/implementations/msw.js +0 -6
  395. package/dist/plugins/implementations/nanostores.d.ts +0 -4
  396. package/dist/plugins/implementations/nanostores.js +0 -5
  397. package/dist/plugins/implementations/netlify.d.ts +0 -4
  398. package/dist/plugins/implementations/netlify.js +0 -5
  399. package/dist/plugins/implementations/observability.d.ts +0 -4
  400. package/dist/plugins/implementations/observability.js +0 -5
  401. package/dist/plugins/implementations/og-image.d.ts +0 -4
  402. package/dist/plugins/implementations/og-image.js +0 -5
  403. package/dist/plugins/implementations/pages.d.ts +0 -4
  404. package/dist/plugins/implementations/pages.js +0 -5
  405. package/dist/plugins/implementations/pinia.d.ts +0 -5
  406. package/dist/plugins/implementations/pinia.js +0 -8
  407. package/dist/plugins/implementations/plausible.d.ts +0 -4
  408. package/dist/plugins/implementations/plausible.js +0 -5
  409. package/dist/plugins/implementations/playwright.d.ts +0 -4
  410. package/dist/plugins/implementations/playwright.js +0 -5
  411. package/dist/plugins/implementations/postcss.d.ts +0 -4
  412. package/dist/plugins/implementations/postcss.js +0 -8
  413. package/dist/plugins/implementations/posthog.d.ts +0 -4
  414. package/dist/plugins/implementations/posthog.js +0 -5
  415. package/dist/plugins/implementations/prebundle.d.ts +0 -4
  416. package/dist/plugins/implementations/prebundle.js +0 -5
  417. package/dist/plugins/implementations/prefetch.d.ts +0 -4
  418. package/dist/plugins/implementations/prefetch.js +0 -5
  419. package/dist/plugins/implementations/preload.d.ts +0 -4
  420. package/dist/plugins/implementations/preload.js +0 -5
  421. package/dist/plugins/implementations/prisma.d.ts +0 -4
  422. package/dist/plugins/implementations/prisma.js +0 -5
  423. package/dist/plugins/implementations/pwa.d.ts +0 -4
  424. package/dist/plugins/implementations/pwa.js +0 -5
  425. package/dist/plugins/implementations/qr-code.d.ts +0 -4
  426. package/dist/plugins/implementations/qr-code.js +0 -6
  427. package/dist/plugins/implementations/razorpay.d.ts +0 -4
  428. package/dist/plugins/implementations/razorpay.js +0 -6
  429. package/dist/plugins/implementations/react-i18next.d.ts +0 -4
  430. package/dist/plugins/implementations/react-i18next.js +0 -5
  431. package/dist/plugins/implementations/react-query.d.ts +0 -5
  432. package/dist/plugins/implementations/react-query.js +0 -8
  433. package/dist/plugins/implementations/react.d.ts +0 -5
  434. package/dist/plugins/implementations/react.js +0 -8
  435. package/dist/plugins/implementations/recoil.d.ts +0 -5
  436. package/dist/plugins/implementations/recoil.js +0 -8
  437. package/dist/plugins/implementations/redux.d.ts +0 -5
  438. package/dist/plugins/implementations/redux.js +0 -8
  439. package/dist/plugins/implementations/relay.d.ts +0 -4
  440. package/dist/plugins/implementations/relay.js +0 -5
  441. package/dist/plugins/implementations/repro.d.ts +0 -4
  442. package/dist/plugins/implementations/repro.js +0 -5
  443. package/dist/plugins/implementations/robots.d.ts +0 -4
  444. package/dist/plugins/implementations/robots.js +0 -5
  445. package/dist/plugins/implementations/root-cause.d.ts +0 -4
  446. package/dist/plugins/implementations/root-cause.js +0 -5
  447. package/dist/plugins/implementations/rss.d.ts +0 -4
  448. package/dist/plugins/implementations/rss.js +0 -5
  449. package/dist/plugins/implementations/sass.d.ts +0 -4
  450. package/dist/plugins/implementations/sass.js +0 -8
  451. package/dist/plugins/implementations/sentry.d.ts +0 -4
  452. package/dist/plugins/implementations/sentry.js +0 -5
  453. package/dist/plugins/implementations/sitemap.d.ts +0 -4
  454. package/dist/plugins/implementations/sitemap.js +0 -5
  455. package/dist/plugins/implementations/solid.d.ts +0 -5
  456. package/dist/plugins/implementations/solid.js +0 -8
  457. package/dist/plugins/implementations/sprite.d.ts +0 -4
  458. package/dist/plugins/implementations/sprite.js +0 -6
  459. package/dist/plugins/implementations/ssr.d.ts +0 -5
  460. package/dist/plugins/implementations/ssr.js +0 -8
  461. package/dist/plugins/implementations/storybook.d.ts +0 -4
  462. package/dist/plugins/implementations/storybook.js +0 -5
  463. package/dist/plugins/implementations/stripe.d.ts +0 -4
  464. package/dist/plugins/implementations/stripe.js +0 -6
  465. package/dist/plugins/implementations/style.d.ts +0 -4
  466. package/dist/plugins/implementations/style.js +0 -8
  467. package/dist/plugins/implementations/svelte.d.ts +0 -5
  468. package/dist/plugins/implementations/svelte.js +0 -8
  469. package/dist/plugins/implementations/tailwind.d.ts +0 -4
  470. package/dist/plugins/implementations/tailwind.js +0 -8
  471. package/dist/plugins/implementations/tanstack-query.d.ts +0 -4
  472. package/dist/plugins/implementations/tanstack-query.js +0 -5
  473. package/dist/plugins/implementations/terser.d.ts +0 -4
  474. package/dist/plugins/implementations/terser.js +0 -5
  475. package/dist/plugins/implementations/testing-library-react.d.ts +0 -4
  476. package/dist/plugins/implementations/testing-library-react.js +0 -6
  477. package/dist/plugins/implementations/testing-library.d.ts +0 -4
  478. package/dist/plugins/implementations/testing-library.js +0 -5
  479. package/dist/plugins/implementations/tree-shake.d.ts +0 -4
  480. package/dist/plugins/implementations/tree-shake.js +0 -5
  481. package/dist/plugins/implementations/trpc.d.ts +0 -4
  482. package/dist/plugins/implementations/trpc.js +0 -5
  483. package/dist/plugins/implementations/ts.d.ts +0 -4
  484. package/dist/plugins/implementations/ts.js +0 -5
  485. package/dist/plugins/implementations/typescript.d.ts +0 -4
  486. package/dist/plugins/implementations/typescript.js +0 -5
  487. package/dist/plugins/implementations/unocss.d.ts +0 -4
  488. package/dist/plugins/implementations/unocss.js +0 -8
  489. package/dist/plugins/implementations/upi-payment.d.ts +0 -4
  490. package/dist/plugins/implementations/upi-payment.js +0 -6
  491. package/dist/plugins/implementations/url.d.ts +0 -4
  492. package/dist/plugins/implementations/url.js +0 -6
  493. package/dist/plugins/implementations/vercel.d.ts +0 -4
  494. package/dist/plugins/implementations/vercel.js +0 -5
  495. package/dist/plugins/implementations/visualizer.d.ts +0 -4
  496. package/dist/plugins/implementations/visualizer.js +0 -5
  497. package/dist/plugins/implementations/vite-svg-loader.d.ts +0 -4
  498. package/dist/plugins/implementations/vite-svg-loader.js +0 -6
  499. package/dist/plugins/implementations/vitest.d.ts +0 -4
  500. package/dist/plugins/implementations/vitest.js +0 -5
  501. package/dist/plugins/implementations/vue-i18n-next.d.ts +0 -4
  502. package/dist/plugins/implementations/vue-i18n-next.js +0 -5
  503. package/dist/plugins/implementations/vue-i18n.d.ts +0 -4
  504. package/dist/plugins/implementations/vue-i18n.js +0 -5
  505. package/dist/plugins/implementations/vue-layouts.d.ts +0 -5
  506. package/dist/plugins/implementations/vue-layouts.js +0 -8
  507. package/dist/plugins/implementations/vue.d.ts +0 -5
  508. package/dist/plugins/implementations/vue.js +0 -8
  509. package/dist/plugins/implementations/vuex.d.ts +0 -5
  510. package/dist/plugins/implementations/vuex.js +0 -8
  511. package/dist/plugins/implementations/wasm-sandbox.d.ts +0 -4
  512. package/dist/plugins/implementations/wasm-sandbox.js +0 -7
  513. package/dist/plugins/implementations/webp.d.ts +0 -4
  514. package/dist/plugins/implementations/webp.js +0 -6
  515. package/dist/plugins/implementations/windicss.d.ts +0 -4
  516. package/dist/plugins/implementations/windicss.js +0 -8
  517. package/dist/plugins/implementations/workbox.d.ts +0 -4
  518. package/dist/plugins/implementations/workbox.js +0 -5
  519. package/dist/plugins/implementations/xstate.d.ts +0 -4
  520. package/dist/plugins/implementations/xstate.js +0 -5
  521. package/dist/plugins/implementations/zod.d.ts +0 -4
  522. package/dist/plugins/implementations/zod.js +0 -5
  523. package/dist/plugins/implementations/zustand-devtools.d.ts +0 -4
  524. package/dist/plugins/implementations/zustand-devtools.js +0 -5
  525. package/dist/plugins/implementations/zustand.d.ts +0 -5
  526. package/dist/plugins/implementations/zustand.js +0 -8
  527. package/dist/plugins/index.js +14 -11
  528. package/dist/plugins/js-transform.js +0 -2
  529. package/dist/plugins/json.js +0 -2
  530. package/dist/plugins/ported/adapter.d.ts +0 -39
  531. package/dist/plugins/ported/adapter.js +0 -55
  532. package/dist/plugins/registry.d.ts +0 -27
  533. package/dist/plugins/registry.js +0 -36
  534. package/dist/plugins/reporter.js +0 -5
  535. package/dist/plugins/sandbox.js +2 -14
  536. package/dist/plugins/signer.d.ts +0 -30
  537. package/dist/plugins/signer.js +1 -39
  538. package/dist/plugins/static.js +0 -1
  539. package/dist/plugins/svelte.js +3 -3
  540. package/dist/plugins/verify.js +0 -12
  541. package/dist/plugins/vue.js +1 -11
  542. package/dist/plugins/wasm-runtime.d.ts +0 -6
  543. package/dist/plugins/wasm-runtime.js +3 -10
  544. package/dist/plugins/wasm.js +1 -4
  545. package/dist/polyfills/corejs.d.ts +0 -4
  546. package/dist/polyfills/corejs.js +0 -6
  547. package/dist/presets/core.d.ts +0 -75
  548. package/dist/presets/core.js +0 -58
  549. package/dist/presets/frameworks.d.ts +0 -4
  550. package/dist/presets/frameworks.js +0 -4
  551. package/dist/presets/infrastructure.js +0 -10
  552. package/dist/presets/spa.js +0 -3
  553. package/dist/presets/ssg.js +0 -1
  554. package/dist/presets/ssr.js +1 -5
  555. package/dist/repro/dashboard.d.ts +0 -40
  556. package/dist/repro/dashboard.js +0 -47
  557. package/dist/repro/github.d.ts +0 -10
  558. package/dist/repro/github.js +2 -10
  559. package/dist/resolve/css-precedence.js +0 -9
  560. package/dist/resolve/graph.js +8 -16
  561. package/dist/resolve/utils.d.ts +0 -11
  562. package/dist/resolve/utils.js +0 -28
  563. package/dist/runtime/client.js +41 -50
  564. package/dist/runtime/error-overlay.js +3 -4
  565. package/dist/runtime/federation-fallback.d.ts +2 -30
  566. package/dist/runtime/federation-fallback.js +4 -47
  567. package/dist/runtime/federation_runtime.js +1 -1
  568. package/dist/runtime/hmr-client.d.ts +0 -4
  569. package/dist/runtime/hmr-client.js +0 -10
  570. package/dist/security/anomaly.d.ts +0 -17
  571. package/dist/security/anomaly.js +2 -23
  572. package/dist/server/security-headers.d.ts +0 -18
  573. package/dist/server/security-headers.js +3 -30
  574. package/dist/ssr/adapters/edge.d.ts +0 -7
  575. package/dist/ssr/adapters/edge.js +0 -8
  576. package/dist/ssr/adapters/index.d.ts +0 -5
  577. package/dist/ssr/adapters/index.js +4 -21
  578. package/dist/ssr/app-router.d.ts +0 -15
  579. package/dist/ssr/app-router.js +0 -23
  580. package/dist/ssr/edge/handlers.d.ts +0 -18
  581. package/dist/ssr/edge/handlers.js +0 -18
  582. package/dist/ssr/image.d.ts +0 -13
  583. package/dist/ssr/image.js +0 -18
  584. package/dist/ssr/isr.d.ts +0 -4
  585. package/dist/ssr/isr.js +0 -6
  586. package/dist/ssr/rsc.d.ts +0 -11
  587. package/dist/ssr/rsc.js +0 -14
  588. package/dist/ssr/streaming.d.ts +0 -16
  589. package/dist/ssr/streaming.js +0 -18
  590. package/dist/ssr/universal-engine.d.ts +0 -17
  591. package/dist/ssr/universal-engine.js +0 -31
  592. package/dist/templates/manager.d.ts +0 -9
  593. package/dist/templates/manager.js +1 -19
  594. package/dist/templates/starters/angular-spa.d.ts +0 -4
  595. package/dist/templates/starters/angular-spa.js +0 -4
  596. package/dist/templates/starters/edge.d.ts +0 -4
  597. package/dist/templates/starters/edge.js +0 -4
  598. package/dist/templates/starters/fintech.d.ts +0 -4
  599. package/dist/templates/starters/fintech.js +0 -4
  600. package/dist/templates/starters/monorepo.d.ts +0 -4
  601. package/dist/templates/starters/monorepo.js +0 -6
  602. package/dist/templates/starters/nextjs-app.js +0 -1
  603. package/dist/templates/starters/preact-spa.d.ts +0 -4
  604. package/dist/templates/starters/preact-spa.js +1 -5
  605. package/dist/templates/starters/premium-dashboard.d.ts +0 -4
  606. package/dist/templates/starters/premium-dashboard.js +0 -4
  607. package/dist/templates/starters/react-spa.d.ts +0 -4
  608. package/dist/templates/starters/react-spa.js +0 -4
  609. package/dist/templates/starters/react-ssr.d.ts +0 -4
  610. package/dist/templates/starters/react-ssr.js +0 -4
  611. package/dist/templates/starters/remix-app.js +0 -1
  612. package/dist/templates/starters/solid-spa.d.ts +0 -4
  613. package/dist/templates/starters/solid-spa.js +0 -4
  614. package/dist/templates/starters/svelte-spa.d.ts +0 -4
  615. package/dist/templates/starters/svelte-spa.js +0 -4
  616. package/dist/templates/starters/vue-spa.d.ts +0 -4
  617. package/dist/templates/starters/vue-spa.js +0 -4
  618. package/dist/test/api.d.ts +0 -4
  619. package/dist/test/api.js +1 -10
  620. package/dist/test/coverage.js +2 -10
  621. package/dist/test/determinism.js +0 -3
  622. package/dist/test/regression.js +0 -1
  623. package/dist/test/runner.js +1 -19
  624. package/dist/test-server.js +0 -1
  625. package/dist/ui/types.d.ts +0 -4
  626. package/dist/ui/types.js +0 -4
  627. package/dist/ui/warning-detector.d.ts +0 -31
  628. package/dist/ui/warning-detector.js +3 -51
  629. package/dist/ui/warning-library.d.ts +0 -7
  630. package/dist/ui/warning-library.js +0 -14
  631. package/dist/utils/fetch.d.ts +1 -0
  632. package/dist/utils/fetch.js +21 -0
  633. package/dist/utils/logger.js +0 -7
  634. package/dist/utils/path-normalize.d.ts +0 -18
  635. package/dist/utils/path-normalize.js +0 -21
  636. package/dist/utils/templates.d.ts +5 -5
  637. package/dist/utils/templates.js +33 -19
  638. package/dist/visual/chart-generator.d.ts +0 -7
  639. package/dist/visual/chart-generator.js +0 -9
  640. package/dist/visual/client/renderer.d.ts +0 -12
  641. package/dist/visual/client/renderer.js +2 -26
  642. package/dist/visual/graph-engine.d.ts +0 -13
  643. package/dist/visual/graph-engine.js +2 -27
  644. package/dist/visual/graph-visualizer.d.ts +0 -25
  645. package/dist/visual/graph-visualizer.js +0 -51
  646. package/dist/visual/root-cause.d.ts +0 -34
  647. package/dist/visual/root-cause.js +7 -55
  648. package/package.json +43 -16
  649. package/dist/core/__tests__/permissions.test.d.ts +0 -1
  650. package/dist/core/__tests__/permissions.test.js +0 -16
  651. package/dist/core/__tests__/universal-transformer.test.d.ts +0 -1
  652. package/dist/core/__tests__/universal-transformer.test.js +0 -27
  653. package/dist/dev/__tests__/preBundler.test.d.ts +0 -1
  654. package/dist/dev/__tests__/preBundler.test.js +0 -51
package/README.md CHANGED
@@ -5,18 +5,15 @@
5
5
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
6
  [![Tests](https://img.shields.io/badge/tests-109%2F109-brightgreen)](#test-status)
7
7
  [![Node >=20](https://img.shields.io/badge/node-%3E%3D20-blue)](https://nodejs.org)
8
- [![Website](https://img.shields.io/badge/website-live-brightgreen)](https://avinash-1994.github.io/Nuclie/)
9
8
 
10
- Nuclie is a build tool with built-in HMR, source maps, tree shaking, module federation, and support for 10+ JavaScript frameworks. It ships a native Rust core (SWC + LightningCSS) for fast transforms.
11
-
12
- **[📖 Documentation Website →](https://avinash-1994.github.io/Nuclie/)**
9
+ Nuclie is a modern JavaScript build tool powered by SWC (Rust) and LightningCSS. It delivers fast HMR, native module federation for micro-frontends, automatic tree shaking, and deep multi-framework support (React, Vue, Svelte, Solid, Preact, Qwik) a modern alternative with a Rust-native core.
13
10
 
14
11
  ---
15
12
 
16
13
  ## ✨ Features
17
14
 
18
15
  - ⚡ **Fast Builds** — Parallel pipeline with Rust-native transforms (SWC)
19
- - 🔥 **Hot Module Replacement** — Framework-aware HMR, sub-60ms updates
16
+ - 🔥 **Hot Module Replacement** — Framework-aware HMR with low-latency updates
20
17
  - 🗺️ **Source Maps** — `inline`, `external`, and `hidden` modes
21
18
  - 🌳 **Tree Shaking** — AST-based dead code elimination in production
22
19
  - 📦 **Module Federation** — Micro-frontend support built in
@@ -492,15 +489,11 @@ module.exports = {
492
489
 
493
490
  ## 📖 Documentation
494
491
 
495
- Full documentation and framework guides are available on our website:
496
-
497
- **[https://avinash-1994.github.io/Nuclie/](https://avinash-1994.github.io/Nuclie/)**
492
+ Project documentation and guides are maintained in the repository:
498
493
 
499
- - [Getting Started](https://avinash-1994.github.io/Nuclie/#/docs/getting-started)
500
- - [Framework Guides](https://avinash-1994.github.io/Nuclie/#/guides/react)
501
- - [Module Federation](https://avinash-1994.github.io/Nuclie/#/mfe/overview)
502
- - [Plugin Development](https://avinash-1994.github.io/Nuclie/#/plugins)
503
- - [Changelog](./CHANGELOG.md)
494
+ - [docs/](./docs)
495
+ - [CHANGELOG.md](./CHANGELOG.md)
496
+ - [CONTRIBUTING.md](./CONTRIBUTING.md)
504
497
 
505
498
  ---
506
499
 
@@ -1,7 +1,3 @@
1
- /**
2
- * AI Analyzer - Project analysis and optimization suggestions
3
- * Simple rule-based system (can be upgraded to LLM later)
4
- */
5
1
  export interface ProjectAnalysis {
6
2
  framework: 'react' | 'vue' | 'svelte' | 'vanilla' | 'unknown';
7
3
  typescript: boolean;
@@ -19,11 +15,5 @@ export interface Suggestion {
19
15
  action: string;
20
16
  priority: number;
21
17
  }
22
- /**
23
- * Analyze project structure and detect framework
24
- */
25
18
  export declare function analyzeProject(root: string): Promise<ProjectAnalysis>;
26
- /**
27
- * Generate optimization suggestions based on project analysis
28
- */
29
19
  export declare function generateSuggestions(analysis: ProjectAnalysis): Promise<Suggestion[]>;
@@ -1,12 +1,5 @@
1
- /**
2
- * AI Analyzer - Project analysis and optimization suggestions
3
- * Simple rule-based system (can be upgraded to LLM later)
4
- */
5
1
  import fs from 'fs/promises';
6
2
  import path from 'path';
7
- /**
8
- * Analyze project structure and detect framework
9
- */
10
3
  export async function analyzeProject(root) {
11
4
  const analysis = {
12
5
  framework: 'unknown',
@@ -18,12 +11,10 @@ export async function analyzeProject(root) {
18
11
  entryPoints: []
19
12
  };
20
13
  try {
21
- // Check for package.json
22
14
  const packagePath = path.join(root, 'package.json');
23
15
  try {
24
16
  const packageData = await fs.readFile(packagePath, 'utf-8');
25
17
  const pkg = JSON.parse(packageData);
26
- // Detect framework
27
18
  const deps = { ...pkg.dependencies, ...pkg.devDependencies };
28
19
  analysis.dependencies = Object.keys(deps);
29
20
  if (deps['react'] || deps['react-dom']) {
@@ -38,13 +29,10 @@ export async function analyzeProject(root) {
38
29
  else {
39
30
  analysis.framework = 'vanilla';
40
31
  }
41
- // Detect TypeScript
42
32
  analysis.typescript = !!(deps['typescript'] || deps['@types/node']);
43
33
  }
44
34
  catch (error) {
45
- // No package.json
46
35
  }
47
- // Detect package manager
48
36
  try {
49
37
  await fs.access(path.join(root, 'pnpm-lock.yaml'));
50
38
  analysis.packageManager = 'pnpm';
@@ -58,18 +46,15 @@ export async function analyzeProject(root) {
58
46
  analysis.packageManager = 'npm';
59
47
  }
60
48
  }
61
- // Count files in src/
62
49
  try {
63
50
  const srcPath = path.join(root, 'src');
64
51
  const files = await getFiles(srcPath);
65
52
  analysis.fileCount = files.length;
66
53
  analysis.totalSize = await getTotalSize(files);
67
- // Find entry points
68
54
  const entryFiles = files.filter(f => f.includes('main.') || f.includes('index.') || f.includes('app.'));
69
55
  analysis.entryPoints = entryFiles.map(f => path.relative(root, f));
70
56
  }
71
57
  catch (error) {
72
- // No src directory
73
58
  }
74
59
  }
75
60
  catch (error) {
@@ -77,12 +62,8 @@ export async function analyzeProject(root) {
77
62
  }
78
63
  return analysis;
79
64
  }
80
- /**
81
- * Generate optimization suggestions based on project analysis
82
- */
83
65
  export async function generateSuggestions(analysis) {
84
66
  const suggestions = [];
85
- // Performance suggestions
86
67
  if (analysis.fileCount > 100) {
87
68
  suggestions.push({
88
69
  type: 'performance',
@@ -103,7 +84,6 @@ export async function generateSuggestions(analysis) {
103
84
  priority: 8
104
85
  });
105
86
  }
106
- // Framework-specific suggestions
107
87
  if (analysis.framework === 'react') {
108
88
  suggestions.push({
109
89
  type: 'dx',
@@ -124,7 +104,6 @@ export async function generateSuggestions(analysis) {
124
104
  priority: 7
125
105
  });
126
106
  }
127
- // TypeScript suggestions
128
107
  if (analysis.typescript) {
129
108
  suggestions.push({
130
109
  type: 'best-practice',
@@ -135,7 +114,6 @@ export async function generateSuggestions(analysis) {
135
114
  priority: 6
136
115
  });
137
116
  }
138
- // Development suggestions
139
117
  suggestions.push({
140
118
  type: 'best-practice',
141
119
  icon: '🗺️',
@@ -152,7 +130,6 @@ export async function generateSuggestions(analysis) {
152
130
  action: 'Enable',
153
131
  priority: 7
154
132
  });
155
- // Security suggestions
156
133
  suggestions.push({
157
134
  type: 'security',
158
135
  icon: '🔒',
@@ -161,10 +138,8 @@ export async function generateSuggestions(analysis) {
161
138
  action: 'Review',
162
139
  priority: 8
163
140
  });
164
- // Sort by priority (highest first)
165
141
  return suggestions.sort((a, b) => b.priority - a.priority);
166
142
  }
167
- // ===== Helper Functions =====
168
143
  async function getFiles(dir) {
169
144
  const files = [];
170
145
  try {
@@ -183,7 +158,6 @@ async function getFiles(dir) {
183
158
  }
184
159
  }
185
160
  catch (error) {
186
- // Directory doesn't exist or not accessible
187
161
  }
188
162
  return files;
189
163
  }
@@ -195,7 +169,6 @@ async function getTotalSize(files) {
195
169
  total += stats.size;
196
170
  }
197
171
  catch (error) {
198
- // File not accessible
199
172
  }
200
173
  }
201
174
  return total;
package/dist/ai/client.js CHANGED
@@ -24,8 +24,6 @@ export class AIClient {
24
24
  response = await this.mockLocalInference(prompt);
25
25
  }
26
26
  else {
27
- // Placeholder for real API calls
28
- // await this.callProvider(prompt, systemPrompt);
29
27
  response = `[Mock AI Response] Analysis of: ${prompt.substring(0, 50)}...`;
30
28
  }
31
29
  await this.saveToCache(cacheKey, response);
@@ -57,11 +55,9 @@ export class AIClient {
57
55
  await fs.writeFile(path.join(this.cacheDir, key), content);
58
56
  }
59
57
  catch (e) {
60
- // Ignore cache write errors
61
58
  }
62
59
  }
63
60
  async mockLocalInference(prompt) {
64
- // Simulate latency
65
61
  await new Promise(r => setTimeout(r, 500));
66
62
  return "Local AI: I see you're trying to build something cool. Here is a suggestion...";
67
63
  }
@@ -1,14 +1,13 @@
1
1
  import { log } from '../../utils/logger.js';
2
+ import { getFetch } from '../../utils/fetch.js';
2
3
  export class CloudAPI {
3
4
  constructor(config) {
4
5
  this.config = config;
5
- // Production API endpoint
6
6
  this.baseUrl = process.env.NUCLIE_CLOUD_API || 'https://api.nuclie.build';
7
7
  this.apiKey = config.apiKey || process.env.NUCLIE_API_KEY || '';
8
8
  this.userId = this.getOrCreateUserId();
9
9
  }
10
10
  getOrCreateUserId() {
11
- // Generate anonymous user ID (stored locally)
12
11
  const fs = require('fs');
13
12
  const path = require('path');
14
13
  const configPath = path.join(process.env.HOME || process.env.USERPROFILE || '', '.nuclie', 'user.json');
@@ -19,9 +18,7 @@ export class CloudAPI {
19
18
  }
20
19
  }
21
20
  catch (e) {
22
- // Ignore
23
21
  }
24
- // Create new anonymous ID
25
22
  const userId = 'anon-' + Math.random().toString(36).substring(2, 15);
26
23
  try {
27
24
  const dir = path.dirname(configPath);
@@ -45,6 +42,7 @@ export class CloudAPI {
45
42
  };
46
43
  }
47
44
  try {
45
+ const fetch = await getFetch();
48
46
  const response = await fetch(`${this.baseUrl}/api/v1/learnings`, {
49
47
  method: 'POST',
50
48
  headers: {
@@ -85,6 +83,7 @@ export class CloudAPI {
85
83
  return [];
86
84
  }
87
85
  try {
86
+ const fetch = await getFetch();
88
87
  const response = await fetch(`${this.baseUrl}/api/v1/patterns?limit=${limit}`, {
89
88
  method: 'GET',
90
89
  headers: {
@@ -105,6 +104,7 @@ export class CloudAPI {
105
104
  }
106
105
  async checkHealth() {
107
106
  try {
107
+ const fetch = await getFetch();
108
108
  const response = await fetch(`${this.baseUrl}/health`, {
109
109
  method: 'GET',
110
110
  headers: { 'X-User-Id': this.userId }
@@ -12,27 +12,22 @@ export class ModelSync {
12
12
  }
13
13
  log.info('Syncing with global learning network...', { category: 'ai' });
14
14
  try {
15
- // 1. Check API health
16
15
  const healthy = await this.api.checkHealth();
17
16
  if (!healthy) {
18
17
  log.error('Cloud API is unavailable', { category: 'ai' });
19
18
  return { synced: 0, merged: 0, conflicts: 0 };
20
19
  }
21
- // 2. Download global patterns
22
20
  const globalPatterns = await this.api.downloadPatterns();
23
21
  if (globalPatterns.length === 0) {
24
22
  log.info('No new patterns available', { category: 'ai' });
25
23
  return { synced: 0, merged: 0, conflicts: 0 };
26
24
  }
27
- // 3. Merge with local patterns
28
25
  let merged = 0;
29
26
  let conflicts = 0;
30
27
  for (const pattern of globalPatterns) {
31
28
  try {
32
- // Check if we already have this error
33
29
  const localFixes = this.store.findFixes(pattern.errorSignature);
34
30
  if (localFixes.length === 0) {
35
- // New pattern - add it
36
31
  this.store.saveError({
37
32
  id: pattern.errorSignature,
38
33
  signature: pattern.errorSignature,
@@ -41,7 +36,6 @@ export class ModelSync {
41
36
  timestamp: Date.now()
42
37
  });
43
38
  const fixId = this.store.saveFix(pattern.errorSignature, pattern.fix);
44
- // Simulate success based on global success rate
45
39
  const successCount = Math.floor(pattern.usageCount * pattern.successRate);
46
40
  const failCount = pattern.usageCount - successCount;
47
41
  for (let i = 0; i < successCount; i++) {
@@ -53,10 +47,7 @@ export class ModelSync {
53
47
  merged++;
54
48
  }
55
49
  else {
56
- // Conflict: we have local data
57
- // Strategy: Global wins if success rate > local
58
50
  conflicts++;
59
- // TODO: Implement conflict resolution
60
51
  }
61
52
  }
62
53
  catch (e) {
@@ -82,17 +73,14 @@ export class ModelSync {
82
73
  }
83
74
  log.info('Contributing local patterns to global network...', { category: 'ai' });
84
75
  try {
85
- // Get local stats
86
76
  const stats = this.store.getStats();
87
77
  if (stats.successfulFixes === 0) {
88
78
  log.info('No successful fixes to contribute', { category: 'ai' });
89
79
  return { uploaded: 0, success: true };
90
80
  }
91
- // TODO: Extract and anonymize local learnings
92
- // For now, just report intent
93
81
  log.success(`Ready to contribute ${stats.successfulFixes} successful fixes`, { category: 'ai' });
94
82
  return {
95
- uploaded: 0, // Will be implemented when backend is ready
83
+ uploaded: 0,
96
84
  success: true
97
85
  };
98
86
  }
@@ -1,7 +1,6 @@
1
1
  import crypto from 'crypto';
2
2
  export class TelemetryCollector {
3
3
  static anonymize(error, fix, success, durationMs, projectSize) {
4
- // Hash everything - NO source code, NO file contents, NO config values
5
4
  const errorSignature = crypto
6
5
  .createHash('sha256')
7
6
  .update(error.signature + JSON.stringify(error.context))
package/dist/ai/config.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export const DEFAULT_AI_CONFIG = {
2
2
  enabled: true,
3
3
  provider: 'local',
4
- maxTokens: 50000, // Daily limit
4
+ maxTokens: 50000,
5
5
  privacy: {
6
6
  sendSourceSnippets: false,
7
7
  allowRemoteTelemetry: false
@@ -1,19 +1,14 @@
1
1
  import crypto from 'crypto';
2
2
  export class ErrorMemory {
3
3
  static normalize(rawError, context = {}) {
4
- // 1. Strip volatile data (timestamps, absolute paths, line numbers)
5
- // We want the "shape" of the error, not the specific instance
6
4
  const cleanError = rawError
7
5
  .replace(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z/g, '<TIMESTAMP>')
8
- .replace(/\/[\w\-\.]+(\/[\w\-\.]+)+/g, '<PATH>') // Unix paths
9
- .replace(/[A-Z]:\\[\w\-\.]+(\\[\w\-\.]+)+/g, '<PATH>') // Windows paths
6
+ .replace(/\/[\w\-\.]+(\/[\w\-\.]+)+/g, '<PATH>')
7
+ .replace(/[A-Z]:\\[\w\-\.]+(\\[\w\-\.]+)+/g, '<PATH>')
10
8
  .replace(/\(\d+,\d+\)/g, '(<LINE>,<COL>)')
11
9
  .replace(/line \d+/g, 'line <LINE>');
12
- // 2. Generate Signature
13
10
  const signature = crypto.createHash('sha256').update(cleanError).digest('hex');
14
- // 3. Generate ID (Signature + Context helps, but for now ID = Signature for deduplication)
15
11
  const id = signature;
16
- // 4. Determine Type (Simple heuristic, can be expanded)
17
12
  let type = 'unknown';
18
13
  if (rawError.includes('Module not found') || rawError.includes('Cannot find module'))
19
14
  type = 'missingDep';
@@ -8,14 +8,12 @@ export class DashboardCLI {
8
8
  return;
9
9
  }
10
10
  console.log('\n📊 Build History (Last 10)\n');
11
- // Header
12
11
  console.log('ID'.padEnd(10) +
13
12
  'Date'.padEnd(25) +
14
13
  'Duration'.padEnd(15) +
15
14
  'Status'.padEnd(10) +
16
15
  'Modules');
17
16
  console.log('-'.repeat(70));
18
- // Rows
19
17
  for (const s of sessions) {
20
18
  const date = new Date(s.timestamp).toLocaleString();
21
19
  const duration = (s.duration / 1000).toFixed(2) + 's';
@@ -12,7 +12,6 @@ export class FixApplier {
12
12
  }
13
13
  async apply(fix, fixId) {
14
14
  log.info(`Applying fix: ${fix.description}`, { category: 'ai' });
15
- // 1. Backup
16
15
  const backupFiles = [];
17
16
  if (fix.type === 'FILE_EDIT' && fix.file) {
18
17
  const filePath = path.join(this.root, fix.file);
@@ -20,20 +19,15 @@ export class FixApplier {
20
19
  backupFiles.push(filePath);
21
20
  }
22
21
  try {
23
- // 2. Apply
24
22
  let success = false;
25
23
  if (fix.type === 'SHELL_COMMAND' && fix.command) {
26
24
  await execAsync(fix.command, { cwd: this.root });
27
- success = true; // Command ran without error
25
+ success = true;
28
26
  }
29
27
  else if (fix.type === 'FILE_EDIT' && fix.file && fix.diff) {
30
- // TODO: Real patch application. For now, we assume success if we could write
31
28
  log.warn('File edit application not fully implemented yet', { category: 'ai' });
32
29
  success = false;
33
30
  }
34
- // 3. Verify (Optional: could run build here)
35
- // For Phase 1, we assume if the command/edit succeeded, the fix is "applied".
36
- // Real verification happens on the NEXT build.
37
31
  if (success && fixId) {
38
32
  this.store.recordOutcome(fixId, true);
39
33
  }
@@ -41,7 +35,6 @@ export class FixApplier {
41
35
  }
42
36
  catch (e) {
43
37
  log.error('Failed to apply fix', { error: e });
44
- // 4. Rollback
45
38
  for (const file of backupFiles) {
46
39
  await this.rollback(file);
47
40
  }
@@ -57,7 +50,6 @@ export class FixApplier {
57
50
  await fs.writeFile(`${filePath}.bak`, content);
58
51
  }
59
52
  catch (e) {
60
- // Ignore if file doesn't exist
61
53
  }
62
54
  }
63
55
  async rollback(filePath) {
@@ -11,9 +11,7 @@ export class HealerCLI {
11
11
  static async handle(error) {
12
12
  const parsed = ErrorParser.parse(error.message);
13
13
  log.error(`Build Failed: ${parsed.message}`, { category: 'ai' });
14
- // 1. Static Pattern Fixes
15
14
  let fixes = FixGenerator.generate(parsed);
16
- // 2. LLM Fallback
17
15
  if (fixes.length === 0 || fixes[0].confidence < 0.7) {
18
16
  log.info('No high-confidence local fix. Consulting AI...', { category: 'ai' });
19
17
  const llm = new LLMFixer(DEFAULT_AI_CONFIG);
@@ -12,7 +12,6 @@ export class ErrorCollector {
12
12
  }
13
13
  normalize(raw) {
14
14
  const message = raw.message || raw.toString();
15
- // Simple heuristic normalization
16
15
  if (message.includes('Module not found') || message.includes('Cannot find module')) {
17
16
  return {
18
17
  type: 'MISSING_DEPENDENCY',
@@ -2,7 +2,6 @@ import { CommonPatterns } from '../patterns/common.js';
2
2
  export class FixGenerator {
3
3
  static generate(error) {
4
4
  const fixes = [];
5
- // 1. Check Pattern Library
6
5
  for (const pattern of CommonPatterns) {
7
6
  const match = error.originalError.match(pattern.regex);
8
7
  if (match) {
@@ -11,13 +10,12 @@ export class FixGenerator {
11
10
  }
12
11
  if (fixes.length > 0)
13
12
  return fixes;
14
- // 2. Fallback to Heuristics (Legacy)
15
13
  if (error.type === 'MISSING_DEPENDENCY' && error.context.package) {
16
14
  const pkg = error.context.package;
17
15
  fixes.push({
18
16
  type: 'SHELL_COMMAND',
19
17
  description: `Install missing dependency: ${pkg}`,
20
- command: `npm install ${pkg}`, // TODO: Detect package manager
18
+ command: `npm install ${pkg}`,
21
19
  confidence: 0.95
22
20
  });
23
21
  }
@@ -10,7 +10,6 @@ export class LLMFixer {
10
10
  if (this.config.provider === 'ollama') {
11
11
  return await this.ollama.suggestFix(error);
12
12
  }
13
- // Generic fallback for other cloud providers
14
13
  return [{
15
14
  type: 'MANUAL_INSTRUCTION',
16
15
  description: `Cloud provider ${this.config.provider} not yet fully implemented.`,
@@ -1,8 +1,5 @@
1
1
  export class ErrorParser {
2
2
  static parse(error) {
3
- // 1. Missing Dependency
4
- // "Module not found: Error: Can't resolve 'react'"
5
- // "Error: Cannot find module 'react'"
6
3
  const missingDepMatch = error.match(/Can't resolve '(@?[\w-]+(?:\/[\w-]+)*)'/i) ||
7
4
  error.match(/Cannot find module '(@?[\w-]+(?:\/[\w-]+)*)'/i);
8
5
  if (missingDepMatch) {
@@ -13,9 +10,6 @@ export class ErrorParser {
13
10
  originalError: error
14
11
  };
15
12
  }
16
- // 2. Syntax Error
17
- // "SyntaxError: Unexpected token (10:5)"
18
- // "file.ts(10,5): error TS1005: ')' expected."
19
13
  const syntaxMatch = error.match(/(.*?)\((\d+),(\d+)\): error TS/);
20
14
  if (syntaxMatch) {
21
15
  return {
@@ -29,7 +23,6 @@ export class ErrorParser {
29
23
  originalError: error
30
24
  };
31
25
  }
32
- // 3. React Version Mismatch
33
26
  if (error.includes('Invalid hook call') || error.includes('more than one copy of React')) {
34
27
  return {
35
28
  type: 'CONFIG_ERROR',
@@ -38,7 +31,6 @@ export class ErrorParser {
38
31
  originalError: error
39
32
  };
40
33
  }
41
- // 4. Missing Loader
42
34
  const loaderMatch = error.match(/You may need an appropriate loader to handle this file type/);
43
35
  if (loaderMatch) {
44
36
  return {
@@ -48,7 +40,6 @@ export class ErrorParser {
48
40
  originalError: error
49
41
  };
50
42
  }
51
- // 5. Config Error (Generic heuristic)
52
43
  if (error.toLowerCase().includes('config') || error.toLowerCase().includes('json')) {
53
44
  return {
54
45
  type: 'CONFIG_ERROR',
@@ -6,9 +6,6 @@ export class Evolver {
6
6
  const fixes = this.store.findFixes(errorId);
7
7
  if (fixes.length === 0)
8
8
  return null;
9
- // Simple A/B testing logic:
10
- // 90% time pick best fix
11
- // 10% time pick random fix (exploration)
12
9
  if (Math.random() > 0.1) {
13
10
  return fixes[0];
14
11
  }
@@ -18,7 +15,5 @@ export class Evolver {
18
15
  }
19
16
  }
20
17
  async evolve(errorId, failedFix) {
21
- // If a fix failed, we might want to trigger LLM to generate a variant
22
- // For Phase 2, we just record the failure (handled by FixStore)
23
18
  }
24
19
  }
@@ -4,18 +4,12 @@ export class LLMFixGenerator {
4
4
  }
5
5
  async generateFix(error, profile) {
6
6
  if (!this.config.enabled || this.config.provider === 'local') {
7
- // Local fallback: return empty or generic suggestion
8
7
  return [{
9
8
  type: 'MANUAL_INSTRUCTION',
10
9
  description: 'Complex error detected. Please check online documentation or enable Cloud AI.',
11
10
  confidence: 0.1
12
11
  }];
13
12
  }
14
- // TODO: Implement Cloud Provider Call
15
- // Prompt:
16
- // Error: ${error.signature}
17
- // Context: ${JSON.stringify(error.context)}
18
- // Framework: ${profile.framework}
19
13
  return [];
20
14
  }
21
15
  }
@@ -1,3 +1,4 @@
1
+ import { getFetch } from '../../utils/fetch.js';
1
2
  export class OllamaProvider {
2
3
  constructor(config) {
3
4
  this.endpoint = config.endpoint || 'http://localhost:11434/api/generate';
@@ -6,6 +7,7 @@ export class OllamaProvider {
6
7
  async suggestFix(error) {
7
8
  const prompt = this.generatePrompt(error);
8
9
  try {
10
+ const fetch = await getFetch();
9
11
  const response = await fetch(this.endpoint, {
10
12
  method: 'POST',
11
13
  body: JSON.stringify({
@@ -47,8 +47,6 @@ export class FixStore {
47
47
  return fixId;
48
48
  }
49
49
  findFixes(errorId) {
50
- // Score = (success / (success + fail + 1)) * log(last_used)
51
- // This favors successful fixes, but also gives a slight boost to recently used ones
52
50
  const stmt = this.db.prepare(`
53
51
  SELECT recipe, success_count, fail_count
54
52
  FROM fixes
@@ -65,7 +63,7 @@ export class FixStore {
65
63
  const total = success + fail;
66
64
  if (total === 0)
67
65
  return 0;
68
- return success / total; // Simple ratio for now
66
+ return success / total;
69
67
  }
70
68
  recordOutcome(fixId, success) {
71
69
  const stmt = this.db.prepare(`
@@ -78,13 +76,12 @@ export class FixStore {
78
76
  stmt.run(success ? 1 : 0, success ? 0 : 1, Date.now(), fixId);
79
77
  }
80
78
  generateFixId(errorId, fix) {
81
- // Simple hash of errorId + fix content
82
79
  const content = errorId + JSON.stringify(fix);
83
80
  let hash = 0;
84
81
  for (let i = 0; i < content.length; i++) {
85
82
  const char = content.charCodeAt(i);
86
83
  hash = ((hash << 5) - hash) + char;
87
- hash = hash & hash; // Convert to 32bit integer
84
+ hash = hash & hash;
88
85
  }
89
86
  return Math.abs(hash).toString(16);
90
87
  }
@@ -12,7 +12,6 @@ export class Analyzer {
12
12
  pkg = JSON.parse(content);
13
13
  }
14
14
  catch (e) {
15
- // Ignore missing package.json
16
15
  }
17
16
  return {
18
17
  framework: this.detectFramework(pkg),
@@ -20,7 +19,7 @@ export class Analyzer {
20
19
  packageManager: await this.detectPackageManager(),
21
20
  dependencies: pkg.dependencies || {},
22
21
  devDependencies: pkg.devDependencies || {},
23
- configSummary: {} // TODO: Parse nuclie.config.ts
22
+ configSummary: {}
24
23
  };
25
24
  }
26
25
  detectFramework(pkg) {
@@ -1,7 +1,6 @@
1
1
  export class OptimizerEngine {
2
2
  static suggest(profile) {
3
3
  const suggestions = [];
4
- // Rule 1: Code Splitting for React
5
4
  if (profile.framework === 'react') {
6
5
  suggestions.push({
7
6
  id: 'react-split',
@@ -16,7 +15,6 @@ export class OptimizerEngine {
16
15
  }
17
16
  });
18
17
  }
19
- // Rule 2: CSS Purging (Tailwind)
20
18
  if (profile.devDependencies && profile.devDependencies['tailwindcss']) {
21
19
  suggestions.push({
22
20
  id: 'tailwind-purge',
@@ -31,7 +29,6 @@ export class OptimizerEngine {
31
29
  }
32
30
  });
33
31
  }
34
- // Rule 3: TypeScript Strict Mode
35
32
  if (profile.language === 'typescript') {
36
33
  suggestions.push({
37
34
  id: 'ts-strict',
@@ -4,11 +4,8 @@ export class LLMAdapter {
4
4
  }
5
5
  async refine(profile, suggestions) {
6
6
  if (!this.config.enabled || this.config.provider === 'local') {
7
- // Local mode: just return static suggestions for now
8
- // In a real local LLM setup, we would call the local model here
9
7
  return suggestions;
10
8
  }
11
- // TODO: Implement cloud provider call
12
9
  return suggestions;
13
10
  }
14
11
  }