@noodleseed/one 0.5.0 → 0.6.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 (279) hide show
  1. package/dist/cli.js +5 -0
  2. package/dist/cli.js.map +1 -1
  3. package/dist/commands/shared.d.ts +1 -1
  4. package/dist/commands/shared.d.ts.map +1 -1
  5. package/dist/commands/shared.js +2 -2
  6. package/dist/commands/shared.js.map +1 -1
  7. package/dist/react-widget-build.js +20 -1
  8. package/dist/react-widget-build.js.map +1 -1
  9. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.d.ts.map +1 -1
  10. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js +1 -0
  11. package/node_modules/@noodle-borg/agent-kit/dist/curated/command-groups.js.map +1 -1
  12. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.d.ts.map +1 -1
  13. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js +1 -0
  14. package/node_modules/@noodle-borg/agent-kit/dist/generated/surface.js.map +1 -1
  15. package/node_modules/@noodle-borg/agent-kit/package.json +1 -1
  16. package/package.json +2 -20
  17. package/node_modules/@oxc-project/types/LICENSE +0 -22
  18. package/node_modules/@oxc-project/types/README.md +0 -3
  19. package/node_modules/@oxc-project/types/package.json +0 -26
  20. package/node_modules/@oxc-project/types/types.d.ts +0 -1912
  21. package/node_modules/@rolldown/binding-linux-x64-gnu/README.md +0 -3
  22. package/node_modules/@rolldown/binding-linux-x64-gnu/package.json +0 -40
  23. package/node_modules/@rolldown/binding-linux-x64-gnu/rolldown-binding.linux-x64-gnu.node +0 -0
  24. package/node_modules/@rolldown/pluginutils/LICENSE +0 -21
  25. package/node_modules/@rolldown/pluginutils/README.md +0 -145
  26. package/node_modules/@rolldown/pluginutils/dist/filter/index.d.mts +0 -194
  27. package/node_modules/@rolldown/pluginutils/dist/filter/index.mjs +0 -2
  28. package/node_modules/@rolldown/pluginutils/dist/filter-B_mD-HGz.mjs +0 -323
  29. package/node_modules/@rolldown/pluginutils/dist/index.d.mts +0 -2
  30. package/node_modules/@rolldown/pluginutils/dist/index.mjs +0 -2
  31. package/node_modules/@rolldown/pluginutils/package.json +0 -40
  32. package/node_modules/@vitejs/plugin-react/LICENSE +0 -21
  33. package/node_modules/@vitejs/plugin-react/README.md +0 -169
  34. package/node_modules/@vitejs/plugin-react/dist/index.d.ts +0 -48
  35. package/node_modules/@vitejs/plugin-react/dist/index.js +0 -200
  36. package/node_modules/@vitejs/plugin-react/dist/refresh-runtime.js +0 -663
  37. package/node_modules/@vitejs/plugin-react/package.json +0 -87
  38. package/node_modules/@vitejs/plugin-react/types/optionalTypes.d.ts +0 -12
  39. package/node_modules/@vitejs/plugin-react/types/preamble.d.ts +0 -1
  40. package/node_modules/detect-libc/LICENSE +0 -201
  41. package/node_modules/detect-libc/README.md +0 -163
  42. package/node_modules/detect-libc/index.d.ts +0 -14
  43. package/node_modules/detect-libc/lib/detect-libc.js +0 -313
  44. package/node_modules/detect-libc/lib/elf.js +0 -39
  45. package/node_modules/detect-libc/lib/filesystem.js +0 -51
  46. package/node_modules/detect-libc/lib/process.js +0 -24
  47. package/node_modules/detect-libc/package.json +0 -44
  48. package/node_modules/fdir/LICENSE +0 -7
  49. package/node_modules/fdir/README.md +0 -91
  50. package/node_modules/fdir/dist/index.cjs +0 -588
  51. package/node_modules/fdir/dist/index.d.cts +0 -155
  52. package/node_modules/fdir/dist/index.d.mts +0 -155
  53. package/node_modules/fdir/dist/index.mjs +0 -570
  54. package/node_modules/fdir/package.json +0 -103
  55. package/node_modules/lightningcss/LICENSE +0 -373
  56. package/node_modules/lightningcss/README.md +0 -105
  57. package/node_modules/lightningcss/node/ast.d.ts +0 -9892
  58. package/node_modules/lightningcss/node/ast.js.flow +0 -10539
  59. package/node_modules/lightningcss/node/browserslistToTargets.js +0 -48
  60. package/node_modules/lightningcss/node/composeVisitors.js +0 -450
  61. package/node_modules/lightningcss/node/flags.js +0 -28
  62. package/node_modules/lightningcss/node/index.d.ts +0 -494
  63. package/node_modules/lightningcss/node/index.js +0 -59
  64. package/node_modules/lightningcss/node/index.js.flow +0 -843
  65. package/node_modules/lightningcss/node/index.mjs +0 -4
  66. package/node_modules/lightningcss/node/targets.d.ts +0 -40
  67. package/node_modules/lightningcss/node/targets.js.flow +0 -39
  68. package/node_modules/lightningcss/package.json +0 -110
  69. package/node_modules/lightningcss-linux-x64-gnu/LICENSE +0 -373
  70. package/node_modules/lightningcss-linux-x64-gnu/README.md +0 -1
  71. package/node_modules/lightningcss-linux-x64-gnu/lightningcss.linux-x64-gnu.node +0 -0
  72. package/node_modules/lightningcss-linux-x64-gnu/package.json +0 -37
  73. package/node_modules/nanoid/.claude/settings.local.json +0 -14
  74. package/node_modules/nanoid/LICENSE +0 -20
  75. package/node_modules/nanoid/README.md +0 -39
  76. package/node_modules/nanoid/async/index.browser.cjs +0 -69
  77. package/node_modules/nanoid/async/index.browser.js +0 -34
  78. package/node_modules/nanoid/async/index.cjs +0 -71
  79. package/node_modules/nanoid/async/index.d.ts +0 -56
  80. package/node_modules/nanoid/async/index.js +0 -35
  81. package/node_modules/nanoid/async/index.native.js +0 -26
  82. package/node_modules/nanoid/async/package.json +0 -12
  83. package/node_modules/nanoid/bin/nanoid.cjs +0 -55
  84. package/node_modules/nanoid/index.browser.cjs +0 -72
  85. package/node_modules/nanoid/index.browser.js +0 -34
  86. package/node_modules/nanoid/index.cjs +0 -86
  87. package/node_modules/nanoid/index.d.cts +0 -91
  88. package/node_modules/nanoid/index.d.ts +0 -91
  89. package/node_modules/nanoid/index.js +0 -46
  90. package/node_modules/nanoid/nanoid.js +0 -1
  91. package/node_modules/nanoid/non-secure/index.cjs +0 -34
  92. package/node_modules/nanoid/non-secure/index.d.ts +0 -33
  93. package/node_modules/nanoid/non-secure/index.js +0 -21
  94. package/node_modules/nanoid/non-secure/package.json +0 -6
  95. package/node_modules/nanoid/package.json +0 -89
  96. package/node_modules/nanoid/url-alphabet/index.cjs +0 -7
  97. package/node_modules/nanoid/url-alphabet/index.js +0 -3
  98. package/node_modules/nanoid/url-alphabet/package.json +0 -6
  99. package/node_modules/picocolors/LICENSE +0 -15
  100. package/node_modules/picocolors/README.md +0 -21
  101. package/node_modules/picocolors/package.json +0 -25
  102. package/node_modules/picocolors/picocolors.browser.js +0 -4
  103. package/node_modules/picocolors/picocolors.d.ts +0 -5
  104. package/node_modules/picocolors/picocolors.js +0 -75
  105. package/node_modules/picocolors/types.d.ts +0 -51
  106. package/node_modules/picomatch/LICENSE +0 -21
  107. package/node_modules/picomatch/README.md +0 -749
  108. package/node_modules/picomatch/index.js +0 -17
  109. package/node_modules/picomatch/lib/constants.js +0 -184
  110. package/node_modules/picomatch/lib/parse.js +0 -1386
  111. package/node_modules/picomatch/lib/picomatch.js +0 -349
  112. package/node_modules/picomatch/lib/scan.js +0 -391
  113. package/node_modules/picomatch/lib/utils.js +0 -72
  114. package/node_modules/picomatch/package.json +0 -82
  115. package/node_modules/picomatch/posix.js +0 -3
  116. package/node_modules/postcss/LICENSE +0 -20
  117. package/node_modules/postcss/README.md +0 -28
  118. package/node_modules/postcss/lib/at-rule.d.ts +0 -139
  119. package/node_modules/postcss/lib/at-rule.js +0 -25
  120. package/node_modules/postcss/lib/comment.d.ts +0 -67
  121. package/node_modules/postcss/lib/comment.js +0 -13
  122. package/node_modules/postcss/lib/container.d.ts +0 -478
  123. package/node_modules/postcss/lib/container.js +0 -447
  124. package/node_modules/postcss/lib/css-syntax-error.d.ts +0 -247
  125. package/node_modules/postcss/lib/css-syntax-error.js +0 -133
  126. package/node_modules/postcss/lib/declaration.d.ts +0 -150
  127. package/node_modules/postcss/lib/declaration.js +0 -24
  128. package/node_modules/postcss/lib/document.d.ts +0 -68
  129. package/node_modules/postcss/lib/document.js +0 -33
  130. package/node_modules/postcss/lib/fromJSON.d.ts +0 -9
  131. package/node_modules/postcss/lib/fromJSON.js +0 -54
  132. package/node_modules/postcss/lib/input.d.ts +0 -226
  133. package/node_modules/postcss/lib/input.js +0 -273
  134. package/node_modules/postcss/lib/lazy-result.d.ts +0 -189
  135. package/node_modules/postcss/lib/lazy-result.js +0 -563
  136. package/node_modules/postcss/lib/list.d.ts +0 -60
  137. package/node_modules/postcss/lib/list.js +0 -58
  138. package/node_modules/postcss/lib/map-generator.js +0 -376
  139. package/node_modules/postcss/lib/no-work-result.d.ts +0 -45
  140. package/node_modules/postcss/lib/no-work-result.js +0 -137
  141. package/node_modules/postcss/lib/node.d.ts +0 -555
  142. package/node_modules/postcss/lib/node.js +0 -449
  143. package/node_modules/postcss/lib/parse.d.ts +0 -9
  144. package/node_modules/postcss/lib/parse.js +0 -42
  145. package/node_modules/postcss/lib/parser.js +0 -618
  146. package/node_modules/postcss/lib/postcss.d.mts +0 -66
  147. package/node_modules/postcss/lib/postcss.d.ts +0 -461
  148. package/node_modules/postcss/lib/postcss.js +0 -101
  149. package/node_modules/postcss/lib/postcss.mjs +0 -30
  150. package/node_modules/postcss/lib/previous-map.d.ts +0 -80
  151. package/node_modules/postcss/lib/previous-map.js +0 -161
  152. package/node_modules/postcss/lib/processor.d.ts +0 -114
  153. package/node_modules/postcss/lib/processor.js +0 -67
  154. package/node_modules/postcss/lib/result.d.ts +0 -204
  155. package/node_modules/postcss/lib/result.js +0 -42
  156. package/node_modules/postcss/lib/root.d.ts +0 -86
  157. package/node_modules/postcss/lib/root.js +0 -61
  158. package/node_modules/postcss/lib/rule.d.ts +0 -126
  159. package/node_modules/postcss/lib/rule.js +0 -27
  160. package/node_modules/postcss/lib/stringifier.d.ts +0 -45
  161. package/node_modules/postcss/lib/stringifier.js +0 -374
  162. package/node_modules/postcss/lib/stringify.d.ts +0 -9
  163. package/node_modules/postcss/lib/stringify.js +0 -11
  164. package/node_modules/postcss/lib/symbols.js +0 -5
  165. package/node_modules/postcss/lib/terminal-highlight.js +0 -70
  166. package/node_modules/postcss/lib/tokenize.js +0 -270
  167. package/node_modules/postcss/lib/warn-once.js +0 -13
  168. package/node_modules/postcss/lib/warning.d.ts +0 -146
  169. package/node_modules/postcss/lib/warning.js +0 -37
  170. package/node_modules/postcss/package.json +0 -88
  171. package/node_modules/rolldown/LICENSE +0 -25
  172. package/node_modules/rolldown/README.md +0 -11
  173. package/node_modules/rolldown/bin/cli.mjs +0 -2
  174. package/node_modules/rolldown/dist/cli.d.mts +0 -1
  175. package/node_modules/rolldown/dist/cli.mjs +0 -1202
  176. package/node_modules/rolldown/dist/config.d.mts +0 -14
  177. package/node_modules/rolldown/dist/config.mjs +0 -4
  178. package/node_modules/rolldown/dist/experimental-index.d.mts +0 -280
  179. package/node_modules/rolldown/dist/experimental-index.mjs +0 -330
  180. package/node_modules/rolldown/dist/experimental-runtime-types.d.ts +0 -107
  181. package/node_modules/rolldown/dist/filter-index.d.mts +0 -195
  182. package/node_modules/rolldown/dist/filter-index.mjs +0 -380
  183. package/node_modules/rolldown/dist/get-log-filter.d.mts +0 -3
  184. package/node_modules/rolldown/dist/get-log-filter.mjs +0 -68
  185. package/node_modules/rolldown/dist/index.d.mts +0 -4
  186. package/node_modules/rolldown/dist/index.mjs +0 -50
  187. package/node_modules/rolldown/dist/parallel-plugin-worker.d.mts +0 -1
  188. package/node_modules/rolldown/dist/parallel-plugin-worker.mjs +0 -28
  189. package/node_modules/rolldown/dist/parallel-plugin.d.mts +0 -13
  190. package/node_modules/rolldown/dist/parallel-plugin.mjs +0 -6
  191. package/node_modules/rolldown/dist/parse-ast-index.d.mts +0 -32
  192. package/node_modules/rolldown/dist/parse-ast-index.mjs +0 -60
  193. package/node_modules/rolldown/dist/plugins-index.d.mts +0 -33
  194. package/node_modules/rolldown/dist/plugins-index.mjs +0 -40
  195. package/node_modules/rolldown/dist/shared/binding-B1q9aYT-.d.mts +0 -1947
  196. package/node_modules/rolldown/dist/shared/binding-Dh6LYCIB.mjs +0 -589
  197. package/node_modules/rolldown/dist/shared/bindingify-input-options-CzVhGygm.mjs +0 -2240
  198. package/node_modules/rolldown/dist/shared/constructors-688OwP2q.mjs +0 -65
  199. package/node_modules/rolldown/dist/shared/constructors-awZ1VNvg.d.mts +0 -36
  200. package/node_modules/rolldown/dist/shared/define-config-Demdg3_4.mjs +0 -6
  201. package/node_modules/rolldown/dist/shared/define-config-sxBscJ3M.d.mts +0 -3901
  202. package/node_modules/rolldown/dist/shared/error-B68YLzl3.mjs +0 -85
  203. package/node_modules/rolldown/dist/shared/get-log-filter-BpNVNJ5-.d.mts +0 -35
  204. package/node_modules/rolldown/dist/shared/load-config-BvPPEM7l.mjs +0 -120
  205. package/node_modules/rolldown/dist/shared/logging-BSNejiLS.d.mts +0 -50
  206. package/node_modules/rolldown/dist/shared/logs-aMKUxRpj.mjs +0 -180
  207. package/node_modules/rolldown/dist/shared/misc-CoQm4NHO.mjs +0 -21
  208. package/node_modules/rolldown/dist/shared/normalize-string-or-regex-BpXHYeN4.mjs +0 -68
  209. package/node_modules/rolldown/dist/shared/parse-CTgsjpo8.mjs +0 -74
  210. package/node_modules/rolldown/dist/shared/prompt-B1Yc1NPt.mjs +0 -847
  211. package/node_modules/rolldown/dist/shared/resolve-tsconfig-BkhP9bkX.mjs +0 -124
  212. package/node_modules/rolldown/dist/shared/rolldown-Brph2NSU.mjs +0 -40
  213. package/node_modules/rolldown/dist/shared/rolldown-build-DR0wzp0V.mjs +0 -3264
  214. package/node_modules/rolldown/dist/shared/transform-CEmFsvJW.d.mts +0 -149
  215. package/node_modules/rolldown/dist/shared/watch-FrHSqg24.mjs +0 -374
  216. package/node_modules/rolldown/dist/utils-index.d.mts +0 -376
  217. package/node_modules/rolldown/dist/utils-index.mjs +0 -2414
  218. package/node_modules/rolldown/package.json +0 -153
  219. package/node_modules/source-map-js/LICENSE +0 -28
  220. package/node_modules/source-map-js/README.md +0 -765
  221. package/node_modules/source-map-js/lib/array-set.js +0 -121
  222. package/node_modules/source-map-js/lib/base64-vlq.js +0 -140
  223. package/node_modules/source-map-js/lib/base64.js +0 -67
  224. package/node_modules/source-map-js/lib/binary-search.js +0 -111
  225. package/node_modules/source-map-js/lib/mapping-list.js +0 -79
  226. package/node_modules/source-map-js/lib/quick-sort.js +0 -132
  227. package/node_modules/source-map-js/lib/source-map-consumer.d.ts +0 -1
  228. package/node_modules/source-map-js/lib/source-map-consumer.js +0 -1188
  229. package/node_modules/source-map-js/lib/source-map-generator.d.ts +0 -1
  230. package/node_modules/source-map-js/lib/source-map-generator.js +0 -444
  231. package/node_modules/source-map-js/lib/source-node.d.ts +0 -1
  232. package/node_modules/source-map-js/lib/source-node.js +0 -413
  233. package/node_modules/source-map-js/lib/util.js +0 -594
  234. package/node_modules/source-map-js/package.json +0 -71
  235. package/node_modules/source-map-js/source-map.d.ts +0 -104
  236. package/node_modules/source-map-js/source-map.js +0 -8
  237. package/node_modules/tinyglobby/LICENSE +0 -21
  238. package/node_modules/tinyglobby/README.md +0 -25
  239. package/node_modules/tinyglobby/dist/index.cjs +0 -335
  240. package/node_modules/tinyglobby/dist/index.d.cts +0 -148
  241. package/node_modules/tinyglobby/dist/index.d.mts +0 -148
  242. package/node_modules/tinyglobby/dist/index.mjs +0 -307
  243. package/node_modules/tinyglobby/package.json +0 -70
  244. package/node_modules/vite/LICENSE.md +0 -2287
  245. package/node_modules/vite/README.md +0 -20
  246. package/node_modules/vite/bin/openChrome.js +0 -68
  247. package/node_modules/vite/bin/vite.js +0 -79
  248. package/node_modules/vite/client.d.ts +0 -285
  249. package/node_modules/vite/dist/client/client.mjs +0 -1269
  250. package/node_modules/vite/dist/client/env.mjs +0 -18
  251. package/node_modules/vite/dist/node/chunks/build.js +0 -5371
  252. package/node_modules/vite/dist/node/chunks/dist.js +0 -6784
  253. package/node_modules/vite/dist/node/chunks/lib.js +0 -371
  254. package/node_modules/vite/dist/node/chunks/logger.js +0 -364
  255. package/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts +0 -96
  256. package/node_modules/vite/dist/node/chunks/node.js +0 -35770
  257. package/node_modules/vite/dist/node/chunks/postcss-import.js +0 -467
  258. package/node_modules/vite/dist/node/cli.js +0 -836
  259. package/node_modules/vite/dist/node/index.d.ts +0 -4010
  260. package/node_modules/vite/dist/node/index.js +0 -3
  261. package/node_modules/vite/dist/node/internal.d.ts +0 -2
  262. package/node_modules/vite/dist/node/internal.js +0 -2
  263. package/node_modules/vite/dist/node/module-runner.d.ts +0 -314
  264. package/node_modules/vite/dist/node/module-runner.js +0 -1274
  265. package/node_modules/vite/misc/false.js +0 -1
  266. package/node_modules/vite/misc/true.js +0 -1
  267. package/node_modules/vite/package.json +0 -194
  268. package/node_modules/vite/types/customEvent.d.ts +0 -79
  269. package/node_modules/vite/types/hmrPayload.d.ts +0 -80
  270. package/node_modules/vite/types/hot.d.ts +0 -39
  271. package/node_modules/vite/types/import-meta.d.ts +0 -5
  272. package/node_modules/vite/types/importGlob.d.ts +0 -131
  273. package/node_modules/vite/types/importMeta.d.ts +0 -30
  274. package/node_modules/vite/types/internal/cssPreprocessorOptions.d.ts +0 -44
  275. package/node_modules/vite/types/internal/esbuildOptions.d.ts +0 -28
  276. package/node_modules/vite/types/internal/lightningcssOptions.d.ts +0 -18
  277. package/node_modules/vite/types/internal/rollupTypeCompat.d.ts +0 -24
  278. package/node_modules/vite/types/internal/terserOptions.d.ts +0 -11
  279. package/node_modules/vite/types/metadata.d.ts +0 -47
@@ -1,323 +0,0 @@
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 };
@@ -1,2 +0,0 @@
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 };
@@ -1,2 +0,0 @@
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 };
@@ -1,40 +0,0 @@
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
- }
@@ -1,21 +0,0 @@
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.
@@ -1,169 +0,0 @@
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).
@@ -1,48 +0,0 @@
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 };