@noodleseed/one 0.4.0 → 0.5.0

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 (369) hide show
  1. package/dist/agents.d.ts +5 -2
  2. package/dist/agents.d.ts.map +1 -1
  3. package/dist/agents.js +103 -11
  4. package/dist/agents.js.map +1 -1
  5. package/dist/commands/author-loop.d.ts.map +1 -1
  6. package/dist/commands/author-loop.js +23 -1
  7. package/dist/commands/author-loop.js.map +1 -1
  8. package/dist/commands/shared.d.ts.map +1 -1
  9. package/dist/commands/shared.js +2 -1
  10. package/dist/commands/shared.js.map +1 -1
  11. package/dist/config.d.ts +1 -0
  12. package/dist/config.d.ts.map +1 -1
  13. package/dist/config.js.map +1 -1
  14. package/dist/deploy.d.ts.map +1 -1
  15. package/dist/deploy.js +15 -3
  16. package/dist/deploy.js.map +1 -1
  17. package/dist/react-widget-build.d.ts +4 -0
  18. package/dist/react-widget-build.d.ts.map +1 -0
  19. package/dist/react-widget-build.js +176 -0
  20. package/dist/react-widget-build.js.map +1 -0
  21. package/dist/skills-update.d.ts +43 -0
  22. package/dist/skills-update.d.ts.map +1 -0
  23. package/dist/skills-update.js +191 -0
  24. package/dist/skills-update.js.map +1 -0
  25. package/dist/tunnel.d.ts +42 -0
  26. package/dist/tunnel.d.ts.map +1 -0
  27. package/dist/tunnel.js +60 -0
  28. package/dist/tunnel.js.map +1 -0
  29. package/dist/update.d.ts +1 -0
  30. package/dist/update.d.ts.map +1 -1
  31. package/dist/update.js +23 -11
  32. package/dist/update.js.map +1 -1
  33. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.d.ts +10 -0
  34. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.d.ts.map +1 -0
  35. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js +151 -0
  36. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js.map +1 -0
  37. package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.d.ts +2 -0
  38. package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.d.ts.map +1 -0
  39. package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.js +49 -0
  40. package/node_modules/@noodle-borg/agent-kit/dist/curated/error-fixes.js.map +1 -0
  41. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.d.ts +7 -0
  42. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.d.ts.map +1 -0
  43. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js +108 -0
  44. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js.map +1 -0
  45. package/node_modules/@noodle-borg/agent-kit/dist/index.d.ts +29 -1
  46. package/node_modules/@noodle-borg/agent-kit/dist/index.d.ts.map +1 -1
  47. package/node_modules/@noodle-borg/agent-kit/dist/index.js +87 -114
  48. package/node_modules/@noodle-borg/agent-kit/dist/index.js.map +1 -1
  49. package/node_modules/@noodle-borg/agent-kit/dist/skill-content.d.ts +17 -0
  50. package/node_modules/@noodle-borg/agent-kit/dist/skill-content.d.ts.map +1 -0
  51. package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js +360 -0
  52. package/node_modules/@noodle-borg/agent-kit/dist/skill-content.js.map +1 -0
  53. package/node_modules/@noodle-borg/agent-kit/package.json +4 -2
  54. package/node_modules/@noodle-borg/authoring/dist/connectors.d.ts +2 -2
  55. package/node_modules/@noodle-borg/authoring/dist/connectors.d.ts.map +1 -1
  56. package/node_modules/@noodle-borg/authoring/dist/connectors.js +4 -2
  57. package/node_modules/@noodle-borg/authoring/dist/connectors.js.map +1 -1
  58. package/node_modules/@noodle-borg/authoring/dist/customer-auth.d.ts +2 -2
  59. package/node_modules/@noodle-borg/authoring/dist/customer-auth.d.ts.map +1 -1
  60. package/node_modules/@noodle-borg/authoring/dist/customer-auth.js +6 -3
  61. package/node_modules/@noodle-borg/authoring/dist/customer-auth.js.map +1 -1
  62. package/node_modules/@noodle-borg/authoring/dist/react.d.ts.map +1 -1
  63. package/node_modules/@noodle-borg/authoring/dist/react.js +148 -9
  64. package/node_modules/@noodle-borg/authoring/dist/react.js.map +1 -1
  65. package/node_modules/@noodle-borg/authoring/package.json +3 -1
  66. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts +4 -3
  67. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.d.ts.map +1 -1
  68. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js +20 -9
  69. package/node_modules/@noodle-borg/compiler/dist/manifest/schema.js.map +1 -1
  70. package/node_modules/@noodle-borg/compiler/dist/widget-emit.js +2 -0
  71. package/node_modules/@noodle-borg/compiler/dist/widget-emit.js.map +1 -1
  72. package/node_modules/@noodle-borg/connector-defs/dist/auth-variables.d.ts +3 -0
  73. package/node_modules/@noodle-borg/connector-defs/dist/auth-variables.d.ts.map +1 -0
  74. package/node_modules/@noodle-borg/connector-defs/dist/auth-variables.js +21 -0
  75. package/node_modules/@noodle-borg/connector-defs/dist/auth-variables.js.map +1 -0
  76. package/node_modules/@noodle-borg/connector-defs/dist/compile.d.ts.map +1 -1
  77. package/node_modules/@noodle-borg/connector-defs/dist/compile.js +5 -0
  78. package/node_modules/@noodle-borg/connector-defs/dist/compile.js.map +1 -1
  79. package/node_modules/@noodle-borg/connector-defs/dist/schema.d.ts.map +1 -1
  80. package/node_modules/@noodle-borg/connector-defs/dist/schema.js +11 -2
  81. package/node_modules/@noodle-borg/connector-defs/dist/schema.js.map +1 -1
  82. package/node_modules/@noodle-borg/connector-defs/dist/variables.d.ts +1 -0
  83. package/node_modules/@noodle-borg/connector-defs/dist/variables.d.ts.map +1 -1
  84. package/node_modules/@noodle-borg/connector-defs/dist/variables.js +7 -0
  85. package/node_modules/@noodle-borg/connector-defs/dist/variables.js.map +1 -1
  86. package/node_modules/@noodle-borg/protocol/dist/widget/bootstrap.d.ts.map +1 -1
  87. package/node_modules/@noodle-borg/protocol/dist/widget/bootstrap.js +14 -0
  88. package/node_modules/@noodle-borg/protocol/dist/widget/bootstrap.js.map +1 -1
  89. package/node_modules/@noodle-borg/protocol/dist/widget/react-bridge-bootstrap.d.ts +3 -0
  90. package/node_modules/@noodle-borg/protocol/dist/widget/react-bridge-bootstrap.d.ts.map +1 -0
  91. package/node_modules/@noodle-borg/protocol/dist/widget/react-bridge-bootstrap.js +30 -0
  92. package/node_modules/@noodle-borg/protocol/dist/widget/react-bridge-bootstrap.js.map +1 -0
  93. package/node_modules/@noodle-borg/service/dist/credential-broker.d.ts.map +1 -1
  94. package/node_modules/@noodle-borg/service/dist/credential-broker.js +27 -6
  95. package/node_modules/@noodle-borg/service/dist/credential-broker.js.map +1 -1
  96. package/node_modules/@noodle-borg/service/dist/managed-config-expressions.d.ts +6 -0
  97. package/node_modules/@noodle-borg/service/dist/managed-config-expressions.d.ts.map +1 -0
  98. package/node_modules/@noodle-borg/service/dist/managed-config-expressions.js +80 -0
  99. package/node_modules/@noodle-borg/service/dist/managed-config-expressions.js.map +1 -0
  100. package/node_modules/@noodle-borg/service/dist/registry.d.ts.map +1 -1
  101. package/node_modules/@noodle-borg/service/dist/registry.js +5 -1
  102. package/node_modules/@noodle-borg/service/dist/registry.js.map +1 -1
  103. package/node_modules/@noodle-borg/service/dist/serve.d.ts.map +1 -1
  104. package/node_modules/@noodle-borg/service/dist/serve.js +5 -1
  105. package/node_modules/@noodle-borg/service/dist/serve.js.map +1 -1
  106. package/node_modules/@oxc-project/types/LICENSE +22 -0
  107. package/node_modules/@oxc-project/types/README.md +3 -0
  108. package/node_modules/@oxc-project/types/package.json +26 -0
  109. package/node_modules/@oxc-project/types/types.d.ts +1912 -0
  110. package/node_modules/@rolldown/binding-linux-x64-gnu/README.md +3 -0
  111. package/node_modules/@rolldown/binding-linux-x64-gnu/package.json +40 -0
  112. package/node_modules/@rolldown/binding-linux-x64-gnu/rolldown-binding.linux-x64-gnu.node +0 -0
  113. package/node_modules/@rolldown/pluginutils/LICENSE +21 -0
  114. package/node_modules/@rolldown/pluginutils/README.md +145 -0
  115. package/node_modules/@rolldown/pluginutils/dist/filter/index.d.mts +194 -0
  116. package/node_modules/@rolldown/pluginutils/dist/filter/index.mjs +2 -0
  117. package/node_modules/@rolldown/pluginutils/dist/filter-B_mD-HGz.mjs +323 -0
  118. package/node_modules/@rolldown/pluginutils/dist/index.d.mts +2 -0
  119. package/node_modules/@rolldown/pluginutils/dist/index.mjs +2 -0
  120. package/node_modules/@rolldown/pluginutils/package.json +40 -0
  121. package/node_modules/@vitejs/plugin-react/LICENSE +21 -0
  122. package/node_modules/@vitejs/plugin-react/README.md +169 -0
  123. package/node_modules/@vitejs/plugin-react/dist/index.d.ts +48 -0
  124. package/node_modules/@vitejs/plugin-react/dist/index.js +200 -0
  125. package/node_modules/@vitejs/plugin-react/dist/refresh-runtime.js +663 -0
  126. package/node_modules/@vitejs/plugin-react/package.json +87 -0
  127. package/node_modules/@vitejs/plugin-react/types/optionalTypes.d.ts +12 -0
  128. package/node_modules/@vitejs/plugin-react/types/preamble.d.ts +1 -0
  129. package/node_modules/detect-libc/LICENSE +201 -0
  130. package/node_modules/detect-libc/README.md +163 -0
  131. package/node_modules/detect-libc/index.d.ts +14 -0
  132. package/node_modules/detect-libc/lib/detect-libc.js +313 -0
  133. package/node_modules/detect-libc/lib/elf.js +39 -0
  134. package/node_modules/detect-libc/lib/filesystem.js +51 -0
  135. package/node_modules/detect-libc/lib/process.js +24 -0
  136. package/node_modules/detect-libc/package.json +44 -0
  137. package/node_modules/fdir/LICENSE +7 -0
  138. package/node_modules/fdir/README.md +91 -0
  139. package/node_modules/fdir/dist/index.cjs +588 -0
  140. package/node_modules/fdir/dist/index.d.cts +155 -0
  141. package/node_modules/fdir/dist/index.d.mts +155 -0
  142. package/node_modules/fdir/dist/index.mjs +570 -0
  143. package/node_modules/fdir/package.json +103 -0
  144. package/node_modules/lightningcss/LICENSE +373 -0
  145. package/node_modules/lightningcss/README.md +105 -0
  146. package/node_modules/lightningcss/node/ast.d.ts +9892 -0
  147. package/node_modules/lightningcss/node/ast.js.flow +10539 -0
  148. package/node_modules/lightningcss/node/browserslistToTargets.js +48 -0
  149. package/node_modules/lightningcss/node/composeVisitors.js +450 -0
  150. package/node_modules/lightningcss/node/flags.js +28 -0
  151. package/node_modules/lightningcss/node/index.d.ts +494 -0
  152. package/node_modules/lightningcss/node/index.js +59 -0
  153. package/node_modules/lightningcss/node/index.js.flow +843 -0
  154. package/node_modules/lightningcss/node/index.mjs +4 -0
  155. package/node_modules/lightningcss/node/targets.d.ts +40 -0
  156. package/node_modules/lightningcss/node/targets.js.flow +39 -0
  157. package/node_modules/lightningcss/package.json +110 -0
  158. package/node_modules/lightningcss-linux-x64-gnu/LICENSE +373 -0
  159. package/node_modules/lightningcss-linux-x64-gnu/README.md +1 -0
  160. package/node_modules/lightningcss-linux-x64-gnu/lightningcss.linux-x64-gnu.node +0 -0
  161. package/node_modules/lightningcss-linux-x64-gnu/package.json +37 -0
  162. package/node_modules/nanoid/.claude/settings.local.json +14 -0
  163. package/node_modules/nanoid/LICENSE +20 -0
  164. package/node_modules/nanoid/README.md +39 -0
  165. package/node_modules/nanoid/async/index.browser.cjs +69 -0
  166. package/node_modules/nanoid/async/index.browser.js +34 -0
  167. package/node_modules/nanoid/async/index.cjs +71 -0
  168. package/node_modules/nanoid/async/index.d.ts +56 -0
  169. package/node_modules/nanoid/async/index.js +35 -0
  170. package/node_modules/nanoid/async/index.native.js +26 -0
  171. package/node_modules/nanoid/async/package.json +12 -0
  172. package/node_modules/nanoid/bin/nanoid.cjs +55 -0
  173. package/node_modules/nanoid/index.browser.cjs +72 -0
  174. package/node_modules/nanoid/index.browser.js +34 -0
  175. package/node_modules/nanoid/index.cjs +86 -0
  176. package/node_modules/nanoid/index.d.cts +91 -0
  177. package/node_modules/nanoid/index.d.ts +91 -0
  178. package/node_modules/nanoid/index.js +46 -0
  179. package/node_modules/nanoid/nanoid.js +1 -0
  180. package/node_modules/nanoid/non-secure/index.cjs +34 -0
  181. package/node_modules/nanoid/non-secure/index.d.ts +33 -0
  182. package/node_modules/nanoid/non-secure/index.js +21 -0
  183. package/node_modules/nanoid/non-secure/package.json +6 -0
  184. package/node_modules/nanoid/package.json +89 -0
  185. package/node_modules/nanoid/url-alphabet/index.cjs +7 -0
  186. package/node_modules/nanoid/url-alphabet/index.js +3 -0
  187. package/node_modules/nanoid/url-alphabet/package.json +6 -0
  188. package/node_modules/picocolors/LICENSE +15 -0
  189. package/node_modules/picocolors/README.md +21 -0
  190. package/node_modules/picocolors/package.json +25 -0
  191. package/node_modules/picocolors/picocolors.browser.js +4 -0
  192. package/node_modules/picocolors/picocolors.d.ts +5 -0
  193. package/node_modules/picocolors/picocolors.js +75 -0
  194. package/node_modules/picocolors/types.d.ts +51 -0
  195. package/node_modules/picomatch/LICENSE +21 -0
  196. package/node_modules/picomatch/README.md +749 -0
  197. package/node_modules/picomatch/index.js +17 -0
  198. package/node_modules/picomatch/lib/constants.js +184 -0
  199. package/node_modules/picomatch/lib/parse.js +1386 -0
  200. package/node_modules/picomatch/lib/picomatch.js +349 -0
  201. package/node_modules/picomatch/lib/scan.js +391 -0
  202. package/node_modules/picomatch/lib/utils.js +72 -0
  203. package/node_modules/picomatch/package.json +82 -0
  204. package/node_modules/picomatch/posix.js +3 -0
  205. package/node_modules/postcss/LICENSE +20 -0
  206. package/node_modules/postcss/README.md +28 -0
  207. package/node_modules/postcss/lib/at-rule.d.ts +139 -0
  208. package/node_modules/postcss/lib/at-rule.js +25 -0
  209. package/node_modules/postcss/lib/comment.d.ts +67 -0
  210. package/node_modules/postcss/lib/comment.js +13 -0
  211. package/node_modules/postcss/lib/container.d.ts +478 -0
  212. package/node_modules/postcss/lib/container.js +447 -0
  213. package/node_modules/postcss/lib/css-syntax-error.d.ts +247 -0
  214. package/node_modules/postcss/lib/css-syntax-error.js +133 -0
  215. package/node_modules/postcss/lib/declaration.d.ts +150 -0
  216. package/node_modules/postcss/lib/declaration.js +24 -0
  217. package/node_modules/postcss/lib/document.d.ts +68 -0
  218. package/node_modules/postcss/lib/document.js +33 -0
  219. package/node_modules/postcss/lib/fromJSON.d.ts +9 -0
  220. package/node_modules/postcss/lib/fromJSON.js +54 -0
  221. package/node_modules/postcss/lib/input.d.ts +226 -0
  222. package/node_modules/postcss/lib/input.js +273 -0
  223. package/node_modules/postcss/lib/lazy-result.d.ts +189 -0
  224. package/node_modules/postcss/lib/lazy-result.js +563 -0
  225. package/node_modules/postcss/lib/list.d.ts +60 -0
  226. package/node_modules/postcss/lib/list.js +58 -0
  227. package/node_modules/postcss/lib/map-generator.js +376 -0
  228. package/node_modules/postcss/lib/no-work-result.d.ts +45 -0
  229. package/node_modules/postcss/lib/no-work-result.js +137 -0
  230. package/node_modules/postcss/lib/node.d.ts +555 -0
  231. package/node_modules/postcss/lib/node.js +449 -0
  232. package/node_modules/postcss/lib/parse.d.ts +9 -0
  233. package/node_modules/postcss/lib/parse.js +42 -0
  234. package/node_modules/postcss/lib/parser.js +618 -0
  235. package/node_modules/postcss/lib/postcss.d.mts +66 -0
  236. package/node_modules/postcss/lib/postcss.d.ts +461 -0
  237. package/node_modules/postcss/lib/postcss.js +101 -0
  238. package/node_modules/postcss/lib/postcss.mjs +30 -0
  239. package/node_modules/postcss/lib/previous-map.d.ts +80 -0
  240. package/node_modules/postcss/lib/previous-map.js +161 -0
  241. package/node_modules/postcss/lib/processor.d.ts +114 -0
  242. package/node_modules/postcss/lib/processor.js +67 -0
  243. package/node_modules/postcss/lib/result.d.ts +204 -0
  244. package/node_modules/postcss/lib/result.js +42 -0
  245. package/node_modules/postcss/lib/root.d.ts +86 -0
  246. package/node_modules/postcss/lib/root.js +61 -0
  247. package/node_modules/postcss/lib/rule.d.ts +126 -0
  248. package/node_modules/postcss/lib/rule.js +27 -0
  249. package/node_modules/postcss/lib/stringifier.d.ts +45 -0
  250. package/node_modules/postcss/lib/stringifier.js +374 -0
  251. package/node_modules/postcss/lib/stringify.d.ts +9 -0
  252. package/node_modules/postcss/lib/stringify.js +11 -0
  253. package/node_modules/postcss/lib/symbols.js +5 -0
  254. package/node_modules/postcss/lib/terminal-highlight.js +70 -0
  255. package/node_modules/postcss/lib/tokenize.js +270 -0
  256. package/node_modules/postcss/lib/warn-once.js +13 -0
  257. package/node_modules/postcss/lib/warning.d.ts +146 -0
  258. package/node_modules/postcss/lib/warning.js +37 -0
  259. package/node_modules/postcss/package.json +88 -0
  260. package/node_modules/rolldown/LICENSE +25 -0
  261. package/node_modules/rolldown/README.md +11 -0
  262. package/node_modules/rolldown/bin/cli.mjs +2 -0
  263. package/node_modules/rolldown/dist/cli.d.mts +1 -0
  264. package/node_modules/rolldown/dist/cli.mjs +1202 -0
  265. package/node_modules/rolldown/dist/config.d.mts +14 -0
  266. package/node_modules/rolldown/dist/config.mjs +4 -0
  267. package/node_modules/rolldown/dist/experimental-index.d.mts +280 -0
  268. package/node_modules/rolldown/dist/experimental-index.mjs +330 -0
  269. package/node_modules/rolldown/dist/experimental-runtime-types.d.ts +107 -0
  270. package/node_modules/rolldown/dist/filter-index.d.mts +195 -0
  271. package/node_modules/rolldown/dist/filter-index.mjs +380 -0
  272. package/node_modules/rolldown/dist/get-log-filter.d.mts +3 -0
  273. package/node_modules/rolldown/dist/get-log-filter.mjs +68 -0
  274. package/node_modules/rolldown/dist/index.d.mts +4 -0
  275. package/node_modules/rolldown/dist/index.mjs +50 -0
  276. package/node_modules/rolldown/dist/parallel-plugin-worker.d.mts +1 -0
  277. package/node_modules/rolldown/dist/parallel-plugin-worker.mjs +28 -0
  278. package/node_modules/rolldown/dist/parallel-plugin.d.mts +13 -0
  279. package/node_modules/rolldown/dist/parallel-plugin.mjs +6 -0
  280. package/node_modules/rolldown/dist/parse-ast-index.d.mts +32 -0
  281. package/node_modules/rolldown/dist/parse-ast-index.mjs +60 -0
  282. package/node_modules/rolldown/dist/plugins-index.d.mts +33 -0
  283. package/node_modules/rolldown/dist/plugins-index.mjs +40 -0
  284. package/node_modules/rolldown/dist/shared/binding-B1q9aYT-.d.mts +1947 -0
  285. package/node_modules/rolldown/dist/shared/binding-Dh6LYCIB.mjs +589 -0
  286. package/node_modules/rolldown/dist/shared/bindingify-input-options-CzVhGygm.mjs +2240 -0
  287. package/node_modules/rolldown/dist/shared/constructors-688OwP2q.mjs +65 -0
  288. package/node_modules/rolldown/dist/shared/constructors-awZ1VNvg.d.mts +36 -0
  289. package/node_modules/rolldown/dist/shared/define-config-Demdg3_4.mjs +6 -0
  290. package/node_modules/rolldown/dist/shared/define-config-sxBscJ3M.d.mts +3901 -0
  291. package/node_modules/rolldown/dist/shared/error-B68YLzl3.mjs +85 -0
  292. package/node_modules/rolldown/dist/shared/get-log-filter-BpNVNJ5-.d.mts +35 -0
  293. package/node_modules/rolldown/dist/shared/load-config-BvPPEM7l.mjs +120 -0
  294. package/node_modules/rolldown/dist/shared/logging-BSNejiLS.d.mts +50 -0
  295. package/node_modules/rolldown/dist/shared/logs-aMKUxRpj.mjs +180 -0
  296. package/node_modules/rolldown/dist/shared/misc-CoQm4NHO.mjs +21 -0
  297. package/node_modules/rolldown/dist/shared/normalize-string-or-regex-BpXHYeN4.mjs +68 -0
  298. package/node_modules/rolldown/dist/shared/parse-CTgsjpo8.mjs +74 -0
  299. package/node_modules/rolldown/dist/shared/prompt-B1Yc1NPt.mjs +847 -0
  300. package/node_modules/rolldown/dist/shared/resolve-tsconfig-BkhP9bkX.mjs +124 -0
  301. package/node_modules/rolldown/dist/shared/rolldown-Brph2NSU.mjs +40 -0
  302. package/node_modules/rolldown/dist/shared/rolldown-build-DR0wzp0V.mjs +3264 -0
  303. package/node_modules/rolldown/dist/shared/transform-CEmFsvJW.d.mts +149 -0
  304. package/node_modules/rolldown/dist/shared/watch-FrHSqg24.mjs +374 -0
  305. package/node_modules/rolldown/dist/utils-index.d.mts +376 -0
  306. package/node_modules/rolldown/dist/utils-index.mjs +2414 -0
  307. package/node_modules/rolldown/package.json +153 -0
  308. package/node_modules/source-map-js/LICENSE +28 -0
  309. package/node_modules/source-map-js/README.md +765 -0
  310. package/node_modules/source-map-js/lib/array-set.js +121 -0
  311. package/node_modules/source-map-js/lib/base64-vlq.js +140 -0
  312. package/node_modules/source-map-js/lib/base64.js +67 -0
  313. package/node_modules/source-map-js/lib/binary-search.js +111 -0
  314. package/node_modules/source-map-js/lib/mapping-list.js +79 -0
  315. package/node_modules/source-map-js/lib/quick-sort.js +132 -0
  316. package/node_modules/source-map-js/lib/source-map-consumer.d.ts +1 -0
  317. package/node_modules/source-map-js/lib/source-map-consumer.js +1188 -0
  318. package/node_modules/source-map-js/lib/source-map-generator.d.ts +1 -0
  319. package/node_modules/source-map-js/lib/source-map-generator.js +444 -0
  320. package/node_modules/source-map-js/lib/source-node.d.ts +1 -0
  321. package/node_modules/source-map-js/lib/source-node.js +413 -0
  322. package/node_modules/source-map-js/lib/util.js +594 -0
  323. package/node_modules/source-map-js/package.json +71 -0
  324. package/node_modules/source-map-js/source-map.d.ts +104 -0
  325. package/node_modules/source-map-js/source-map.js +8 -0
  326. package/node_modules/tinyglobby/LICENSE +21 -0
  327. package/node_modules/tinyglobby/README.md +25 -0
  328. package/node_modules/tinyglobby/dist/index.cjs +335 -0
  329. package/node_modules/tinyglobby/dist/index.d.cts +148 -0
  330. package/node_modules/tinyglobby/dist/index.d.mts +148 -0
  331. package/node_modules/tinyglobby/dist/index.mjs +307 -0
  332. package/node_modules/tinyglobby/package.json +70 -0
  333. package/node_modules/vite/LICENSE.md +2287 -0
  334. package/node_modules/vite/README.md +20 -0
  335. package/node_modules/vite/bin/openChrome.js +68 -0
  336. package/node_modules/vite/bin/vite.js +79 -0
  337. package/node_modules/vite/client.d.ts +285 -0
  338. package/node_modules/vite/dist/client/client.mjs +1269 -0
  339. package/node_modules/vite/dist/client/env.mjs +18 -0
  340. package/node_modules/vite/dist/node/chunks/build.js +5371 -0
  341. package/node_modules/vite/dist/node/chunks/dist.js +6784 -0
  342. package/node_modules/vite/dist/node/chunks/lib.js +371 -0
  343. package/node_modules/vite/dist/node/chunks/logger.js +364 -0
  344. package/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts +96 -0
  345. package/node_modules/vite/dist/node/chunks/node.js +35770 -0
  346. package/node_modules/vite/dist/node/chunks/postcss-import.js +467 -0
  347. package/node_modules/vite/dist/node/cli.js +836 -0
  348. package/node_modules/vite/dist/node/index.d.ts +4010 -0
  349. package/node_modules/vite/dist/node/index.js +3 -0
  350. package/node_modules/vite/dist/node/internal.d.ts +2 -0
  351. package/node_modules/vite/dist/node/internal.js +2 -0
  352. package/node_modules/vite/dist/node/module-runner.d.ts +314 -0
  353. package/node_modules/vite/dist/node/module-runner.js +1274 -0
  354. package/node_modules/vite/misc/false.js +1 -0
  355. package/node_modules/vite/misc/true.js +1 -0
  356. package/node_modules/vite/package.json +194 -0
  357. package/node_modules/vite/types/customEvent.d.ts +79 -0
  358. package/node_modules/vite/types/hmrPayload.d.ts +80 -0
  359. package/node_modules/vite/types/hot.d.ts +39 -0
  360. package/node_modules/vite/types/import-meta.d.ts +5 -0
  361. package/node_modules/vite/types/importGlob.d.ts +131 -0
  362. package/node_modules/vite/types/importMeta.d.ts +30 -0
  363. package/node_modules/vite/types/internal/cssPreprocessorOptions.d.ts +44 -0
  364. package/node_modules/vite/types/internal/esbuildOptions.d.ts +28 -0
  365. package/node_modules/vite/types/internal/lightningcssOptions.d.ts +18 -0
  366. package/node_modules/vite/types/internal/rollupTypeCompat.d.ts +24 -0
  367. package/node_modules/vite/types/internal/terserOptions.d.ts +11 -0
  368. package/node_modules/vite/types/metadata.d.ts +47 -0
  369. package/package.json +22 -2
@@ -0,0 +1,323 @@
1
+ //#region src/utils.ts
2
+ const postfixRE = /[?#].*$/;
3
+ function cleanUrl(url) {
4
+ return url.replace(postfixRE, "");
5
+ }
6
+ function extractQueryWithoutFragment(url) {
7
+ const questionMarkIndex = url.indexOf("?");
8
+ if (questionMarkIndex === -1) return "";
9
+ const fragmentIndex = url.indexOf("#", questionMarkIndex);
10
+ if (fragmentIndex === -1) return url.substring(questionMarkIndex);
11
+ else return url.substring(questionMarkIndex, fragmentIndex);
12
+ }
13
+ //#endregion
14
+ //#region src/filter/composable-filters.ts
15
+ var And = class {
16
+ kind;
17
+ args;
18
+ constructor(...args) {
19
+ if (args.length === 0) throw new Error("`And` expects at least one operand");
20
+ this.args = args;
21
+ this.kind = "and";
22
+ }
23
+ };
24
+ var Or = class {
25
+ kind;
26
+ args;
27
+ constructor(...args) {
28
+ if (args.length === 0) throw new Error("`Or` expects at least one operand");
29
+ this.args = args;
30
+ this.kind = "or";
31
+ }
32
+ };
33
+ var Not = class {
34
+ kind;
35
+ expr;
36
+ constructor(expr) {
37
+ this.expr = expr;
38
+ this.kind = "not";
39
+ }
40
+ };
41
+ var Id = class {
42
+ kind;
43
+ pattern;
44
+ params;
45
+ constructor(pattern, params) {
46
+ this.pattern = pattern;
47
+ this.kind = "id";
48
+ this.params = params ?? { cleanUrl: false };
49
+ }
50
+ };
51
+ var ImporterId = class {
52
+ kind;
53
+ pattern;
54
+ params;
55
+ constructor(pattern, params) {
56
+ this.pattern = pattern;
57
+ this.kind = "importerId";
58
+ this.params = params ?? { cleanUrl: false };
59
+ }
60
+ };
61
+ var ModuleType = class {
62
+ kind;
63
+ pattern;
64
+ constructor(pattern) {
65
+ this.pattern = pattern;
66
+ this.kind = "moduleType";
67
+ }
68
+ };
69
+ var Code = class {
70
+ kind;
71
+ pattern;
72
+ constructor(expr) {
73
+ this.pattern = expr;
74
+ this.kind = "code";
75
+ }
76
+ };
77
+ var Query = class {
78
+ kind;
79
+ key;
80
+ pattern;
81
+ constructor(key, pattern) {
82
+ this.pattern = pattern;
83
+ this.key = key;
84
+ this.kind = "query";
85
+ }
86
+ };
87
+ var Include = class {
88
+ kind;
89
+ expr;
90
+ constructor(expr) {
91
+ this.expr = expr;
92
+ this.kind = "include";
93
+ }
94
+ };
95
+ var Exclude = class {
96
+ kind;
97
+ expr;
98
+ constructor(expr) {
99
+ this.expr = expr;
100
+ this.kind = "exclude";
101
+ }
102
+ };
103
+ function and(...args) {
104
+ return new And(...args);
105
+ }
106
+ function or(...args) {
107
+ return new Or(...args);
108
+ }
109
+ function not(expr) {
110
+ return new Not(expr);
111
+ }
112
+ function id(pattern, params) {
113
+ return new Id(pattern, params);
114
+ }
115
+ function importerId(pattern, params) {
116
+ return new ImporterId(pattern, params);
117
+ }
118
+ function moduleType(pattern) {
119
+ return new ModuleType(pattern);
120
+ }
121
+ function code(pattern) {
122
+ return new Code(pattern);
123
+ }
124
+ function query(key, pattern) {
125
+ return new Query(key, pattern);
126
+ }
127
+ function include(expr) {
128
+ return new Include(expr);
129
+ }
130
+ function exclude(expr) {
131
+ return new Exclude(expr);
132
+ }
133
+ /**
134
+ * convert a queryObject to FilterExpression like
135
+ * ```js
136
+ * and(query(k1, v1), query(k2, v2))
137
+ * ```
138
+ * @param queryFilterObject The query filter object needs to be matched.
139
+ * @returns a `And` FilterExpression
140
+ */
141
+ function queries(queryFilter) {
142
+ return and(...Object.entries(queryFilter).map(([key, value]) => {
143
+ return new Query(key, value);
144
+ }));
145
+ }
146
+ function interpreter(exprs, code, id, moduleType, importerId) {
147
+ let arr = [];
148
+ if (Array.isArray(exprs)) arr = exprs;
149
+ else arr = [exprs];
150
+ return interpreterImpl(arr, code, id, moduleType, importerId);
151
+ }
152
+ function interpreterImpl(expr, code, id, moduleType, importerId, ctx = {}) {
153
+ let hasInclude = false;
154
+ for (const e of expr) switch (e.kind) {
155
+ case "include":
156
+ hasInclude = true;
157
+ if (exprInterpreter(e.expr, code, id, moduleType, importerId, ctx)) return true;
158
+ break;
159
+ case "exclude":
160
+ if (exprInterpreter(e.expr, code, id, moduleType, importerId, ctx)) return false;
161
+ break;
162
+ }
163
+ return !hasInclude;
164
+ }
165
+ function exprInterpreter(expr, code, id, moduleType, importerId, ctx = {}) {
166
+ switch (expr.kind) {
167
+ case "and": return expr.args.every((e) => exprInterpreter(e, code, id, moduleType, importerId, ctx));
168
+ case "or": return expr.args.some((e) => exprInterpreter(e, code, id, moduleType, importerId, ctx));
169
+ case "not": return !exprInterpreter(expr.expr, code, id, moduleType, importerId, ctx);
170
+ case "id": {
171
+ if (id === void 0) throw new Error("`id` is required for `id` expression");
172
+ let idToMatch = id;
173
+ if (expr.params.cleanUrl) idToMatch = cleanUrl(idToMatch);
174
+ return typeof expr.pattern === "string" ? idToMatch === expr.pattern : expr.pattern.test(idToMatch);
175
+ }
176
+ case "importerId": {
177
+ if (importerId === void 0) return false;
178
+ let importerIdToMatch = importerId;
179
+ if (expr.params.cleanUrl) importerIdToMatch = cleanUrl(importerIdToMatch);
180
+ return typeof expr.pattern === "string" ? importerIdToMatch === expr.pattern : expr.pattern.test(importerIdToMatch);
181
+ }
182
+ case "moduleType":
183
+ if (moduleType === void 0) throw new Error("`moduleType` is required for `moduleType` expression");
184
+ return moduleType === expr.pattern;
185
+ case "code":
186
+ if (code === void 0) throw new Error("`code` is required for `code` expression");
187
+ return typeof expr.pattern === "string" ? code.includes(expr.pattern) : expr.pattern.test(code);
188
+ case "query": {
189
+ if (id === void 0) throw new Error("`id` is required for `Query` expression");
190
+ if (!ctx.urlSearchParamsCache) {
191
+ let queryString = extractQueryWithoutFragment(id);
192
+ ctx.urlSearchParamsCache = new URLSearchParams(queryString);
193
+ }
194
+ let urlParams = ctx.urlSearchParamsCache;
195
+ if (typeof expr.pattern === "boolean") if (expr.pattern) return urlParams.has(expr.key);
196
+ else return !urlParams.has(expr.key);
197
+ else if (typeof expr.pattern === "string") return urlParams.get(expr.key) === expr.pattern;
198
+ else return expr.pattern.test(urlParams.get(expr.key) ?? "");
199
+ }
200
+ default: throw new Error(`Expression ${JSON.stringify(expr)} is not expected.`);
201
+ }
202
+ }
203
+ //#endregion
204
+ //#region src/filter/filter-vite-plugins.ts
205
+ /**
206
+ * Filters out Vite plugins that have `apply: 'serve'` set.
207
+ *
208
+ * Since Rolldown operates in build mode, plugins marked with `apply: 'serve'`
209
+ * are intended only for Vite's dev server and should be excluded from the build process.
210
+ *
211
+ * @param plugins - Array of plugins (can include nested arrays)
212
+ * @returns Filtered array with serve-only plugins removed
213
+ *
214
+ * @example
215
+ * ```ts
216
+ * import { defineConfig } from 'rolldown';
217
+ * import { filterVitePlugins } from '@rolldown/pluginutils';
218
+ * import viteReact from '@vitejs/plugin-react';
219
+ *
220
+ * export default defineConfig({
221
+ * plugins: filterVitePlugins([
222
+ * viteReact(),
223
+ * {
224
+ * name: 'dev-only',
225
+ * apply: 'serve', // This will be filtered out
226
+ * // ...
227
+ * }
228
+ * ])
229
+ * });
230
+ * ```
231
+ */
232
+ function filterVitePlugins(plugins) {
233
+ if (!plugins) return [];
234
+ const pluginArray = Array.isArray(plugins) ? plugins : [plugins];
235
+ const result = [];
236
+ for (const plugin of pluginArray) {
237
+ if (!plugin) continue;
238
+ if (Array.isArray(plugin)) {
239
+ result.push(...filterVitePlugins(plugin));
240
+ continue;
241
+ }
242
+ const pluginWithApply = plugin;
243
+ if ("apply" in pluginWithApply) {
244
+ const applyValue = pluginWithApply.apply;
245
+ if (typeof applyValue === "function") try {
246
+ if (applyValue({}, {
247
+ command: "build",
248
+ mode: "production"
249
+ })) result.push(plugin);
250
+ } catch {
251
+ result.push(plugin);
252
+ }
253
+ else if (applyValue === "serve") continue;
254
+ else result.push(plugin);
255
+ } else result.push(plugin);
256
+ }
257
+ return result;
258
+ }
259
+ //#endregion
260
+ //#region src/filter/simple-filters.ts
261
+ /**
262
+ * Constructs a RegExp that matches the exact string specified.
263
+ *
264
+ * This is useful for plugin hook filters.
265
+ *
266
+ * @param str the string to match.
267
+ * @param flags flags for the RegExp.
268
+ *
269
+ * @example
270
+ * ```ts
271
+ * import { exactRegex } from '@rolldown/pluginutils';
272
+ * const plugin = {
273
+ * name: 'plugin',
274
+ * resolveId: {
275
+ * filter: { id: exactRegex('foo') },
276
+ * handler(id) {} // will only be called for `foo`
277
+ * }
278
+ * }
279
+ * ```
280
+ */
281
+ function exactRegex(str, flags) {
282
+ return new RegExp(`^${escapeRegex(str)}$`, flags);
283
+ }
284
+ /**
285
+ * Constructs a RegExp that matches a value that has the specified prefix.
286
+ *
287
+ * This is useful for plugin hook filters.
288
+ *
289
+ * @param str the string to match.
290
+ * @param flags flags for the RegExp.
291
+ *
292
+ * @example
293
+ * ```ts
294
+ * import { prefixRegex } from '@rolldown/pluginutils';
295
+ * const plugin = {
296
+ * name: 'plugin',
297
+ * resolveId: {
298
+ * filter: { id: prefixRegex('foo') },
299
+ * handler(id) {} // will only be called for IDs starting with `foo`
300
+ * }
301
+ * }
302
+ * ```
303
+ */
304
+ function prefixRegex(str, flags) {
305
+ return new RegExp(`^${escapeRegex(str)}`, flags);
306
+ }
307
+ const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g;
308
+ function escapeRegex(str) {
309
+ return str.replace(escapeRegexRE, "\\$&");
310
+ }
311
+ function makeIdFiltersToMatchWithQuery(input) {
312
+ if (!Array.isArray(input)) return makeIdFilterToMatchWithQuery(input);
313
+ return input.map((i) => makeIdFilterToMatchWithQuery(i));
314
+ }
315
+ function makeIdFilterToMatchWithQuery(input) {
316
+ if (typeof input === "string") return `${input}{?*,}`;
317
+ return makeRegexIdFilterToMatchWithQuery(input);
318
+ }
319
+ function makeRegexIdFilterToMatchWithQuery(input) {
320
+ return new RegExp(input.source.replace(/(?<!\\)\$/g, "(?:\\?.*)?$"), input.flags);
321
+ }
322
+ //#endregion
323
+ export { queries as _, and as a, exprInterpreter as c, include as d, interpreter as f, or as g, not as h, filterVitePlugins as i, id as l, moduleType as m, makeIdFiltersToMatchWithQuery as n, code as o, interpreterImpl as p, prefixRegex as r, exclude as s, exactRegex as t, importerId as u, query as v };
@@ -0,0 +1,2 @@
1
+ import { FilterExpression, FilterExpressionKind, QueryFilterObject, TopLevelFilterExpression, and, code, exactRegex, exclude, exprInterpreter, filterVitePlugins, id, importerId, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query } from "./filter/index.mjs";
2
+ export { FilterExpression, FilterExpressionKind, QueryFilterObject, TopLevelFilterExpression, and, code, exactRegex, exclude, exprInterpreter, filterVitePlugins, id, importerId, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query };
@@ -0,0 +1,2 @@
1
+ import { _ as queries, a as and, c as exprInterpreter, d as include, f as interpreter, g as or, h as not, i as filterVitePlugins, l as id, m as moduleType, n as makeIdFiltersToMatchWithQuery, o as code, p as interpreterImpl, r as prefixRegex, s as exclude, t as exactRegex, u as importerId, v as query } from "./filter-B_mD-HGz.mjs";
2
+ export { and, code, exactRegex, exclude, exprInterpreter, filterVitePlugins, id, importerId, include, interpreter, interpreterImpl, makeIdFiltersToMatchWithQuery, moduleType, not, or, prefixRegex, queries, query };
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@rolldown/pluginutils",
3
+ "version": "1.0.1",
4
+ "description": "Plugin utilities for Rolldown",
5
+ "keywords": [
6
+ "filter",
7
+ "plugin",
8
+ "rolldown"
9
+ ],
10
+ "homepage": "https://github.com/rolldown/plugins/tree/main/packages/pluginutils#readme",
11
+ "bugs": {
12
+ "url": "https://github.com/rolldown/plugins/issues"
13
+ },
14
+ "license": "MIT",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/rolldown/plugins.git",
18
+ "directory": "packages/pluginutils"
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "type": "module",
24
+ "exports": {
25
+ ".": "./dist/index.mjs",
26
+ "./filter": "./dist/filter/index.mjs",
27
+ "./package.json": "./package.json"
28
+ },
29
+ "devDependencies": {
30
+ "@types/picomatch": "^4.0.3",
31
+ "picomatch": "^4.0.4",
32
+ "typescript": "^5.9.3"
33
+ },
34
+ "scripts": {
35
+ "dev": "tsdown --watch",
36
+ "build": "tsdown",
37
+ "test": "vitest --project pluginutils",
38
+ "test:types": "vitest --project pluginutils --typecheck.only"
39
+ }
40
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,169 @@
1
+ # @vitejs/plugin-react [![npm](https://img.shields.io/npm/v/@vitejs/plugin-react.svg)](https://npmjs.com/package/@vitejs/plugin-react)
2
+
3
+ The default Vite plugin for React projects.
4
+
5
+ - enable [Fast Refresh](https://www.npmjs.com/package/react-refresh) in development (requires react >= 16.9)
6
+ - use the [automatic JSX runtime](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html)
7
+ - small installation size
8
+
9
+ ```js
10
+ // vite.config.js
11
+ import { defineConfig } from 'vite'
12
+ import react from '@vitejs/plugin-react'
13
+
14
+ export default defineConfig({
15
+ plugins: [react()],
16
+ })
17
+ ```
18
+
19
+ ## Options
20
+
21
+ ### include
22
+
23
+ Includes `.js`, `.jsx`, `.ts` & `.tsx` by default. This option can be used to add fast refresh to `.mdx` files:
24
+
25
+ ```js
26
+ import { defineConfig } from 'vite'
27
+ import react from '@vitejs/plugin-react'
28
+ import mdx from '@mdx-js/rollup'
29
+
30
+ export default defineConfig({
31
+ plugins: [
32
+ { enforce: 'pre', ...mdx() },
33
+ react({ include: /\.(mdx|js|jsx|ts|tsx)$/ }),
34
+ ],
35
+ })
36
+ ```
37
+
38
+ ### exclude
39
+
40
+ The default value is `/node_modules/`. You may use it to exclude JSX/TSX files that runs in a worker or are not React files.
41
+ Except if explicitly desired, you should keep `node_modules` in the exclude list:
42
+
43
+ ```js
44
+ import { defineConfig } from 'vite'
45
+ import react from '@vitejs/plugin-react'
46
+
47
+ export default defineConfig({
48
+ plugins: [
49
+ react({ exclude: [/\/pdf\//, /\.solid\.tsx$/, /\/node_modules\//] }),
50
+ ],
51
+ })
52
+ ```
53
+
54
+ ### jsxImportSource
55
+
56
+ Control where the JSX factory is imported from. By default, this is inferred from `jsxImportSource` from corresponding a tsconfig file for a transformed file.
57
+
58
+ ```js
59
+ react({ jsxImportSource: '@emotion/react' })
60
+ ```
61
+
62
+ ### jsxRuntime
63
+
64
+ By default, the plugin uses the [automatic JSX runtime](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html). However, if you encounter any issues, you may opt out using the `jsxRuntime` option.
65
+
66
+ ```js
67
+ react({ jsxRuntime: 'classic' })
68
+ ```
69
+
70
+ ### reactRefreshHost
71
+
72
+ The `reactRefreshHost` option is only necessary in a module federation context. It enables HMR to work between a remote & host application. In your remote Vite config, you would add your host origin:
73
+
74
+ ```js
75
+ react({ reactRefreshHost: 'http://localhost:3000' })
76
+ ```
77
+
78
+ Under the hood, this simply updates the React Fash Refresh runtime URL from `/@react-refresh` to `http://localhost:3000/@react-refresh` to ensure there is only one Refresh runtime across the whole application. Note that if you define `base` option in the host application, you need to include it in the option, like: `http://localhost:3000/{base}`.
79
+
80
+ ## React Compiler
81
+
82
+ [React Compiler](https://react.dev/learn/react-compiler) support is available via the exported `reactCompilerPreset` helper, which requires [`@rolldown/plugin-babel`](https://npmx.dev/package/@rolldown/plugin-babel) and [`babel-plugin-react-compiler`](https://npmx.dev/package/babel-plugin-react-compiler) and [`@babel/core`](https://npmx.dev/package/@babel/core) as peer dependencies:
83
+
84
+ ```sh
85
+ npm install -D @rolldown/plugin-babel @babel/core babel-plugin-react-compiler
86
+ ```
87
+
88
+ If you are using TypeScript, you will also need to install [`@types/babel__core`](https://npmx.dev/package/@types/babel__core):
89
+
90
+ ```sh
91
+ npm install -D @types/babel__core
92
+ ```
93
+
94
+ ```js
95
+ // vite.config.js
96
+ import { defineConfig } from 'vite'
97
+ import react, { reactCompilerPreset } from '@vitejs/plugin-react'
98
+ import babel from '@rolldown/plugin-babel'
99
+
100
+ export default defineConfig({
101
+ plugins: [react(), babel({ presets: [reactCompilerPreset()] })],
102
+ })
103
+ ```
104
+
105
+ The `reactCompilerPreset` accepts an optional options object with the following properties:
106
+
107
+ - `compilationMode` — Set to `'annotation'` to only compile components annotated with `"use memo"`.
108
+ - `target` — Set to `'17'` or `'18'` to target older React versions (uses `react-compiler-runtime` instead of `react/compiler-runtime`).
109
+
110
+ Additional options can be found in the [documentation](https://react.dev/reference/react-compiler/configuration).
111
+
112
+ ```js
113
+ babel({
114
+ presets: [reactCompilerPreset({ compilationMode: 'annotation' })],
115
+ })
116
+ ```
117
+
118
+ > [!TIP]
119
+ >
120
+ > `reactCompilerPreset` is only a convenient helper with a preconfigured filter. You can configure override the filters to fit your project structure or code. For example, if you know a large portion of your files are never React/hook-related or won't benefit from the React Compiler, you can aggressively exclude them via `rolldown.filter`:
121
+ >
122
+ > ```js
123
+ > const myPreset = reactCompilerPreset()
124
+ > myPreset.rolldown.filter.id.exclude = ['src/legacy/**', 'src/utils/**']
125
+ >
126
+ > babel({
127
+ > presets: [myPreset],
128
+ > })
129
+ > ```
130
+
131
+ ## `@vitejs/plugin-react/preamble`
132
+
133
+ The package provides `@vitejs/plugin-react/preamble` to initialize HMR runtime from client entrypoint for SSR applications which don't use [`transformIndexHtml` API](https://vite.dev/guide/api-javascript.html#vitedevserver). For example:
134
+
135
+ ```js
136
+ // [entry.client.js]
137
+ import '@vitejs/plugin-react/preamble'
138
+ ```
139
+
140
+ Alternatively, you can manually call `transformIndexHtml` during SSR, which sets up equivalent initialization code. Here's an example for an Express server:
141
+
142
+ ```js
143
+ app.get('/', async (req, res, next) => {
144
+ try {
145
+ let html = fs.readFileSync(path.resolve(root, 'index.html'), 'utf-8')
146
+
147
+ // Transform HTML using Vite plugins.
148
+ html = await viteServer.transformIndexHtml(req.url, html)
149
+
150
+ res.send(html)
151
+ } catch (e) {
152
+ return next(e)
153
+ }
154
+ })
155
+ ```
156
+
157
+ Otherwise, you'll get the following error:
158
+
159
+ ```
160
+ Uncaught Error: @vitejs/plugin-react can't detect preamble. Something is wrong.
161
+ ```
162
+
163
+ ## Consistent components exports
164
+
165
+ For React refresh to work correctly, your file should only export React components. You can find a good explanation in the [Gatsby docs](https://www.gatsbyjs.com/docs/reference/local-development/fast-refresh/#how-it-works).
166
+
167
+ If an incompatible change in exports is found, the module will be invalidated and HMR will propagate. To make it easier to export simple constants alongside your component, the module is only invalidated when their value changes.
168
+
169
+ You can catch mistakes and get more detailed warnings with this [ESLint rule](https://github.com/ArnaudBarre/eslint-plugin-react-refresh), this [Oxlint rule](https://oxc.rs/docs/guide/usage/linter/rules/react/only-export-components.html), or this [Biome rule](https://biomejs.dev/linter/rules/use-component-export-only-modules).
@@ -0,0 +1,48 @@
1
+ import { Plugin } from "vite";
2
+ import { ReactCompilerBabelPluginOptions, RolldownBabelPreset } from "#optionalTypes";
3
+
4
+ //#region src/reactCompilerPreset.d.ts
5
+ declare const reactCompilerPreset: (options?: ReactCompilerBabelPluginOptions) => RolldownBabelPreset;
6
+ //#endregion
7
+ //#region src/index.d.ts
8
+ interface Options {
9
+ /**
10
+ * Can be used to process extra files like `.mdx`
11
+ * @example include: /\.(mdx|js|jsx|ts|tsx)$/
12
+ * @default /\.[tj]sx?$/
13
+ */
14
+ include?: string | RegExp | Array<string | RegExp>;
15
+ /**
16
+ * Can be used to exclude JSX/TSX files that runs in a worker or are not React files.
17
+ * Except if explicitly desired, you should keep node_modules in the exclude list
18
+ * @example exclude: [/\/pdf\//, /\.solid\.tsx$/, /\/node_modules\//]
19
+ * @default /\/node_modules\//
20
+ */
21
+ exclude?: string | RegExp | Array<string | RegExp>;
22
+ /**
23
+ * Control where the JSX factory is imported from.
24
+ * https://oxc.rs/docs/guide/usage/transformer/jsx.html#import-source
25
+ * @default 'react'
26
+ */
27
+ jsxImportSource?: string;
28
+ /**
29
+ * Note: Skipping React import with classic runtime is not supported from v4
30
+ * @default "automatic"
31
+ */
32
+ jsxRuntime?: 'classic' | 'automatic';
33
+ /**
34
+ * React Fast Refresh runtime URL prefix.
35
+ * Useful in a module federation context to enable HMR by specifying
36
+ * the host application URL in the Vite config of a remote application.
37
+ * @example
38
+ * reactRefreshHost: 'http://localhost:3000'
39
+ */
40
+ reactRefreshHost?: string;
41
+ }
42
+ declare function viteReact(opts?: Options): Plugin[];
43
+ declare namespace viteReact {
44
+ var preambleCode: string;
45
+ }
46
+ declare function viteReactForCjs(this: unknown, options: Options): Plugin[];
47
+ //#endregion
48
+ export { Options, viteReact as default, viteReactForCjs as "module.exports", reactCompilerPreset };