create-nuclo 0.1.1 → 0.1.2

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 (516) hide show
  1. package/package.json +1 -1
  2. package/templates/basic/package.json +3 -3
  3. package/templates/basic/node_modules/.package-lock.json +0 -348
  4. package/templates/basic/node_modules/.vite/deps/_metadata.json +0 -15
  5. package/templates/basic/node_modules/.vite/deps/nuclo.js +0 -1665
  6. package/templates/basic/node_modules/.vite/deps/nuclo.js.map +0 -1
  7. package/templates/basic/node_modules/.vite/deps/package.json +0 -3
  8. package/templates/basic/node_modules/@oxc-project/types/LICENSE +0 -22
  9. package/templates/basic/node_modules/@oxc-project/types/README.md +0 -3
  10. package/templates/basic/node_modules/@oxc-project/types/package.json +0 -26
  11. package/templates/basic/node_modules/@oxc-project/types/types.d.ts +0 -1912
  12. package/templates/basic/node_modules/@rolldown/binding-darwin-arm64/README.md +0 -3
  13. package/templates/basic/node_modules/@rolldown/binding-darwin-arm64/package.json +0 -37
  14. package/templates/basic/node_modules/@rolldown/binding-darwin-arm64/rolldown-binding.darwin-arm64.node +0 -0
  15. package/templates/basic/node_modules/@rolldown/pluginutils/LICENSE +0 -21
  16. package/templates/basic/node_modules/@rolldown/pluginutils/README.md +0 -145
  17. package/templates/basic/node_modules/@rolldown/pluginutils/dist/filter/index.d.mts +0 -194
  18. package/templates/basic/node_modules/@rolldown/pluginutils/dist/filter/index.mjs +0 -2
  19. package/templates/basic/node_modules/@rolldown/pluginutils/dist/filter-B_mD-HGz.mjs +0 -323
  20. package/templates/basic/node_modules/@rolldown/pluginutils/dist/index.d.mts +0 -2
  21. package/templates/basic/node_modules/@rolldown/pluginutils/dist/index.mjs +0 -2
  22. package/templates/basic/node_modules/@rolldown/pluginutils/package.json +0 -40
  23. package/templates/basic/node_modules/detect-libc/LICENSE +0 -201
  24. package/templates/basic/node_modules/detect-libc/README.md +0 -163
  25. package/templates/basic/node_modules/detect-libc/index.d.ts +0 -14
  26. package/templates/basic/node_modules/detect-libc/lib/detect-libc.js +0 -313
  27. package/templates/basic/node_modules/detect-libc/lib/elf.js +0 -39
  28. package/templates/basic/node_modules/detect-libc/lib/filesystem.js +0 -51
  29. package/templates/basic/node_modules/detect-libc/lib/process.js +0 -24
  30. package/templates/basic/node_modules/detect-libc/package.json +0 -44
  31. package/templates/basic/node_modules/fdir/LICENSE +0 -7
  32. package/templates/basic/node_modules/fdir/README.md +0 -91
  33. package/templates/basic/node_modules/fdir/dist/index.cjs +0 -588
  34. package/templates/basic/node_modules/fdir/dist/index.d.cts +0 -155
  35. package/templates/basic/node_modules/fdir/dist/index.d.mts +0 -155
  36. package/templates/basic/node_modules/fdir/dist/index.mjs +0 -570
  37. package/templates/basic/node_modules/fdir/package.json +0 -103
  38. package/templates/basic/node_modules/lightningcss/LICENSE +0 -373
  39. package/templates/basic/node_modules/lightningcss/README.md +0 -105
  40. package/templates/basic/node_modules/lightningcss/node/ast.d.ts +0 -9892
  41. package/templates/basic/node_modules/lightningcss/node/ast.js.flow +0 -10539
  42. package/templates/basic/node_modules/lightningcss/node/browserslistToTargets.js +0 -48
  43. package/templates/basic/node_modules/lightningcss/node/composeVisitors.js +0 -450
  44. package/templates/basic/node_modules/lightningcss/node/flags.js +0 -28
  45. package/templates/basic/node_modules/lightningcss/node/index.d.ts +0 -494
  46. package/templates/basic/node_modules/lightningcss/node/index.js +0 -59
  47. package/templates/basic/node_modules/lightningcss/node/index.js.flow +0 -843
  48. package/templates/basic/node_modules/lightningcss/node/index.mjs +0 -4
  49. package/templates/basic/node_modules/lightningcss/node/targets.d.ts +0 -40
  50. package/templates/basic/node_modules/lightningcss/node/targets.js.flow +0 -39
  51. package/templates/basic/node_modules/lightningcss/package.json +0 -110
  52. package/templates/basic/node_modules/lightningcss-darwin-arm64/LICENSE +0 -373
  53. package/templates/basic/node_modules/lightningcss-darwin-arm64/README.md +0 -1
  54. package/templates/basic/node_modules/lightningcss-darwin-arm64/lightningcss.darwin-arm64.node +0 -0
  55. package/templates/basic/node_modules/lightningcss-darwin-arm64/package.json +0 -34
  56. package/templates/basic/node_modules/nanoid/LICENSE +0 -20
  57. package/templates/basic/node_modules/nanoid/README.md +0 -36
  58. package/templates/basic/node_modules/nanoid/async/index.browser.cjs +0 -42
  59. package/templates/basic/node_modules/nanoid/async/index.browser.js +0 -42
  60. package/templates/basic/node_modules/nanoid/async/index.cjs +0 -44
  61. package/templates/basic/node_modules/nanoid/async/index.d.ts +0 -56
  62. package/templates/basic/node_modules/nanoid/async/index.js +0 -44
  63. package/templates/basic/node_modules/nanoid/async/index.native.js +0 -35
  64. package/templates/basic/node_modules/nanoid/async/package.json +0 -12
  65. package/templates/basic/node_modules/nanoid/bin/nanoid.cjs +0 -55
  66. package/templates/basic/node_modules/nanoid/index.browser.cjs +0 -44
  67. package/templates/basic/node_modules/nanoid/index.browser.js +0 -44
  68. package/templates/basic/node_modules/nanoid/index.cjs +0 -57
  69. package/templates/basic/node_modules/nanoid/index.d.cts +0 -91
  70. package/templates/basic/node_modules/nanoid/index.d.ts +0 -91
  71. package/templates/basic/node_modules/nanoid/index.js +0 -62
  72. package/templates/basic/node_modules/nanoid/nanoid.js +0 -1
  73. package/templates/basic/node_modules/nanoid/non-secure/index.cjs +0 -24
  74. package/templates/basic/node_modules/nanoid/non-secure/index.d.ts +0 -33
  75. package/templates/basic/node_modules/nanoid/non-secure/index.js +0 -24
  76. package/templates/basic/node_modules/nanoid/non-secure/package.json +0 -6
  77. package/templates/basic/node_modules/nanoid/package.json +0 -89
  78. package/templates/basic/node_modules/nanoid/url-alphabet/index.cjs +0 -4
  79. package/templates/basic/node_modules/nanoid/url-alphabet/index.js +0 -4
  80. package/templates/basic/node_modules/nanoid/url-alphabet/package.json +0 -6
  81. package/templates/basic/node_modules/nuclo/LICENSE.md +0 -45
  82. package/templates/basic/node_modules/nuclo/README.md +0 -727
  83. package/templates/basic/node_modules/nuclo/dist/bootstrap.d.ts +0 -5
  84. package/templates/basic/node_modules/nuclo/dist/bootstrap.d.ts.map +0 -1
  85. package/templates/basic/node_modules/nuclo/dist/element/attributes.d.ts +0 -3
  86. package/templates/basic/node_modules/nuclo/dist/element/attributes.d.ts.map +0 -1
  87. package/templates/basic/node_modules/nuclo/dist/element/class-name.d.ts +0 -6
  88. package/templates/basic/node_modules/nuclo/dist/element/class-name.d.ts.map +0 -1
  89. package/templates/basic/node_modules/nuclo/dist/element/events.d.ts +0 -35
  90. package/templates/basic/node_modules/nuclo/dist/element/events.d.ts.map +0 -1
  91. package/templates/basic/node_modules/nuclo/dist/element/factory.d.ts +0 -32
  92. package/templates/basic/node_modules/nuclo/dist/element/factory.d.ts.map +0 -1
  93. package/templates/basic/node_modules/nuclo/dist/element/inline-style.d.ts +0 -9
  94. package/templates/basic/node_modules/nuclo/dist/element/inline-style.d.ts.map +0 -1
  95. package/templates/basic/node_modules/nuclo/dist/element/modifiers.d.ts +0 -11
  96. package/templates/basic/node_modules/nuclo/dist/element/modifiers.d.ts.map +0 -1
  97. package/templates/basic/node_modules/nuclo/dist/element/tags.d.ts +0 -5
  98. package/templates/basic/node_modules/nuclo/dist/element/tags.d.ts.map +0 -1
  99. package/templates/basic/node_modules/nuclo/dist/hydration.d.ts +0 -73
  100. package/templates/basic/node_modules/nuclo/dist/hydration.d.ts.map +0 -1
  101. package/templates/basic/node_modules/nuclo/dist/index.d.ts +0 -17
  102. package/templates/basic/node_modules/nuclo/dist/index.d.ts.map +0 -1
  103. package/templates/basic/node_modules/nuclo/dist/list/index.d.ts +0 -7
  104. package/templates/basic/node_modules/nuclo/dist/list/index.d.ts.map +0 -1
  105. package/templates/basic/node_modules/nuclo/dist/list/runtime.d.ts +0 -6
  106. package/templates/basic/node_modules/nuclo/dist/list/runtime.d.ts.map +0 -1
  107. package/templates/basic/node_modules/nuclo/dist/list/types.d.ts +0 -18
  108. package/templates/basic/node_modules/nuclo/dist/list/types.d.ts.map +0 -1
  109. package/templates/basic/node_modules/nuclo/dist/nuclo.cjs +0 -2
  110. package/templates/basic/node_modules/nuclo/dist/nuclo.cjs.map +0 -1
  111. package/templates/basic/node_modules/nuclo/dist/nuclo.mjs +0 -2
  112. package/templates/basic/node_modules/nuclo/dist/nuclo.mjs.map +0 -1
  113. package/templates/basic/node_modules/nuclo/dist/nuclo.umd.js +0 -2
  114. package/templates/basic/node_modules/nuclo/dist/nuclo.umd.js.map +0 -1
  115. package/templates/basic/node_modules/nuclo/dist/polyfill/Document.d.ts +0 -19
  116. package/templates/basic/node_modules/nuclo/dist/polyfill/Document.d.ts.map +0 -1
  117. package/templates/basic/node_modules/nuclo/dist/polyfill/Element.d.ts +0 -48
  118. package/templates/basic/node_modules/nuclo/dist/polyfill/Element.d.ts.map +0 -1
  119. package/templates/basic/node_modules/nuclo/dist/polyfill/Event.d.ts +0 -43
  120. package/templates/basic/node_modules/nuclo/dist/polyfill/Event.d.ts.map +0 -1
  121. package/templates/basic/node_modules/nuclo/dist/polyfill/Node.d.ts +0 -13
  122. package/templates/basic/node_modules/nuclo/dist/polyfill/Node.d.ts.map +0 -1
  123. package/templates/basic/node_modules/nuclo/dist/polyfill/Text.d.ts +0 -11
  124. package/templates/basic/node_modules/nuclo/dist/polyfill/Text.d.ts.map +0 -1
  125. package/templates/basic/node_modules/nuclo/dist/polyfill/index.d.ts +0 -24
  126. package/templates/basic/node_modules/nuclo/dist/polyfill/index.d.ts.map +0 -1
  127. package/templates/basic/node_modules/nuclo/dist/polyfill/nuclo.polyfill.cjs +0 -2
  128. package/templates/basic/node_modules/nuclo/dist/polyfill/nuclo.polyfill.cjs.map +0 -1
  129. package/templates/basic/node_modules/nuclo/dist/polyfill/nuclo.polyfill.mjs +0 -2
  130. package/templates/basic/node_modules/nuclo/dist/polyfill/nuclo.polyfill.mjs.map +0 -1
  131. package/templates/basic/node_modules/nuclo/dist/render.d.ts +0 -33
  132. package/templates/basic/node_modules/nuclo/dist/render.d.ts.map +0 -1
  133. package/templates/basic/node_modules/nuclo/dist/shared/conditions.d.ts +0 -4
  134. package/templates/basic/node_modules/nuclo/dist/shared/conditions.d.ts.map +0 -1
  135. package/templates/basic/node_modules/nuclo/dist/shared/dom.d.ts +0 -69
  136. package/templates/basic/node_modules/nuclo/dist/shared/dom.d.ts.map +0 -1
  137. package/templates/basic/node_modules/nuclo/dist/shared/environment.d.ts +0 -5
  138. package/templates/basic/node_modules/nuclo/dist/shared/environment.d.ts.map +0 -1
  139. package/templates/basic/node_modules/nuclo/dist/shared/errors.d.ts +0 -2
  140. package/templates/basic/node_modules/nuclo/dist/shared/errors.d.ts.map +0 -1
  141. package/templates/basic/node_modules/nuclo/dist/shared/renderables.d.ts +0 -4
  142. package/templates/basic/node_modules/nuclo/dist/shared/renderables.d.ts.map +0 -1
  143. package/templates/basic/node_modules/nuclo/dist/shared/strings.d.ts +0 -19
  144. package/templates/basic/node_modules/nuclo/dist/shared/strings.d.ts.map +0 -1
  145. package/templates/basic/node_modules/nuclo/dist/shared/type-guards.d.ts +0 -16
  146. package/templates/basic/node_modules/nuclo/dist/shared/type-guards.d.ts.map +0 -1
  147. package/templates/basic/node_modules/nuclo/dist/ssr/index.d.ts +0 -19
  148. package/templates/basic/node_modules/nuclo/dist/ssr/index.d.ts.map +0 -1
  149. package/templates/basic/node_modules/nuclo/dist/ssr/nuclo.ssr.cjs +0 -2
  150. package/templates/basic/node_modules/nuclo/dist/ssr/nuclo.ssr.cjs.map +0 -1
  151. package/templates/basic/node_modules/nuclo/dist/ssr/nuclo.ssr.mjs +0 -2
  152. package/templates/basic/node_modules/nuclo/dist/ssr/nuclo.ssr.mjs.map +0 -1
  153. package/templates/basic/node_modules/nuclo/dist/ssr/render-to-string.d.ts +0 -41
  154. package/templates/basic/node_modules/nuclo/dist/ssr/render-to-string.d.ts.map +0 -1
  155. package/templates/basic/node_modules/nuclo/dist/style/css.d.ts +0 -19
  156. package/templates/basic/node_modules/nuclo/dist/style/css.d.ts.map +0 -1
  157. package/templates/basic/node_modules/nuclo/dist/style/engine.d.ts +0 -34
  158. package/templates/basic/node_modules/nuclo/dist/style/engine.d.ts.map +0 -1
  159. package/templates/basic/node_modules/nuclo/dist/style/index.d.ts +0 -3
  160. package/templates/basic/node_modules/nuclo/dist/style/index.d.ts.map +0 -1
  161. package/templates/basic/node_modules/nuclo/dist/update/conditional.d.ts +0 -3
  162. package/templates/basic/node_modules/nuclo/dist/update/conditional.d.ts.map +0 -1
  163. package/templates/basic/node_modules/nuclo/dist/update/reactive-attributes.d.ts +0 -45
  164. package/templates/basic/node_modules/nuclo/dist/update/reactive-attributes.d.ts.map +0 -1
  165. package/templates/basic/node_modules/nuclo/dist/update/reactive-text.d.ts +0 -38
  166. package/templates/basic/node_modules/nuclo/dist/update/reactive-text.d.ts.map +0 -1
  167. package/templates/basic/node_modules/nuclo/dist/update/registry.d.ts +0 -97
  168. package/templates/basic/node_modules/nuclo/dist/update/registry.d.ts.map +0 -1
  169. package/templates/basic/node_modules/nuclo/dist/update/scope.d.ts +0 -7
  170. package/templates/basic/node_modules/nuclo/dist/update/scope.d.ts.map +0 -1
  171. package/templates/basic/node_modules/nuclo/dist/update/update.d.ts +0 -4
  172. package/templates/basic/node_modules/nuclo/dist/update/update.d.ts.map +0 -1
  173. package/templates/basic/node_modules/nuclo/dist/when/builder.d.ts +0 -16
  174. package/templates/basic/node_modules/nuclo/dist/when/builder.d.ts.map +0 -1
  175. package/templates/basic/node_modules/nuclo/dist/when/index.d.ts +0 -44
  176. package/templates/basic/node_modules/nuclo/dist/when/index.d.ts.map +0 -1
  177. package/templates/basic/node_modules/nuclo/dist/when/runtime.d.ts +0 -59
  178. package/templates/basic/node_modules/nuclo/dist/when/runtime.d.ts.map +0 -1
  179. package/templates/basic/node_modules/nuclo/package.json +0 -88
  180. package/templates/basic/node_modules/nuclo/types/core/base.d.ts +0 -113
  181. package/templates/basic/node_modules/nuclo/types/features/list.d.ts +0 -38
  182. package/templates/basic/node_modules/nuclo/types/features/on.d.ts +0 -59
  183. package/templates/basic/node_modules/nuclo/types/features/render.d.ts +0 -49
  184. package/templates/basic/node_modules/nuclo/types/features/scope.d.ts +0 -6
  185. package/templates/basic/node_modules/nuclo/types/features/style.d.ts +0 -77
  186. package/templates/basic/node_modules/nuclo/types/features/update.d.ts +0 -6
  187. package/templates/basic/node_modules/nuclo/types/features/when.d.ts +0 -18
  188. package/templates/basic/node_modules/nuclo/types/html/tags.d.ts +0 -119
  189. package/templates/basic/node_modules/nuclo/types/index.d.ts +0 -137
  190. package/templates/basic/node_modules/nuclo/types/polyfill.d.ts +0 -131
  191. package/templates/basic/node_modules/nuclo/types/ssr.d.ts +0 -45
  192. package/templates/basic/node_modules/nuclo/types/style.d.ts +0 -404
  193. package/templates/basic/node_modules/nuclo/types/svg/base.d.ts +0 -118
  194. package/templates/basic/node_modules/nuclo/types/svg/tags.d.ts +0 -68
  195. package/templates/basic/node_modules/picocolors/LICENSE +0 -15
  196. package/templates/basic/node_modules/picocolors/README.md +0 -21
  197. package/templates/basic/node_modules/picocolors/package.json +0 -25
  198. package/templates/basic/node_modules/picocolors/picocolors.browser.js +0 -4
  199. package/templates/basic/node_modules/picocolors/picocolors.d.ts +0 -5
  200. package/templates/basic/node_modules/picocolors/picocolors.js +0 -75
  201. package/templates/basic/node_modules/picocolors/types.d.ts +0 -51
  202. package/templates/basic/node_modules/picomatch/LICENSE +0 -21
  203. package/templates/basic/node_modules/picomatch/README.md +0 -743
  204. package/templates/basic/node_modules/picomatch/index.js +0 -17
  205. package/templates/basic/node_modules/picomatch/lib/constants.js +0 -184
  206. package/templates/basic/node_modules/picomatch/lib/parse.js +0 -1416
  207. package/templates/basic/node_modules/picomatch/lib/picomatch.js +0 -361
  208. package/templates/basic/node_modules/picomatch/lib/scan.js +0 -391
  209. package/templates/basic/node_modules/picomatch/lib/utils.js +0 -72
  210. package/templates/basic/node_modules/picomatch/package.json +0 -83
  211. package/templates/basic/node_modules/picomatch/posix.js +0 -3
  212. package/templates/basic/node_modules/postcss/LICENSE +0 -20
  213. package/templates/basic/node_modules/postcss/README.md +0 -25
  214. package/templates/basic/node_modules/postcss/lib/at-rule.d.ts +0 -139
  215. package/templates/basic/node_modules/postcss/lib/at-rule.js +0 -25
  216. package/templates/basic/node_modules/postcss/lib/comment.d.ts +0 -67
  217. package/templates/basic/node_modules/postcss/lib/comment.js +0 -13
  218. package/templates/basic/node_modules/postcss/lib/container.d.ts +0 -478
  219. package/templates/basic/node_modules/postcss/lib/container.js +0 -447
  220. package/templates/basic/node_modules/postcss/lib/css-syntax-error.d.ts +0 -247
  221. package/templates/basic/node_modules/postcss/lib/css-syntax-error.js +0 -133
  222. package/templates/basic/node_modules/postcss/lib/declaration.d.ts +0 -150
  223. package/templates/basic/node_modules/postcss/lib/declaration.js +0 -24
  224. package/templates/basic/node_modules/postcss/lib/document.d.ts +0 -68
  225. package/templates/basic/node_modules/postcss/lib/document.js +0 -33
  226. package/templates/basic/node_modules/postcss/lib/fromJSON.d.ts +0 -9
  227. package/templates/basic/node_modules/postcss/lib/fromJSON.js +0 -68
  228. package/templates/basic/node_modules/postcss/lib/input.d.ts +0 -226
  229. package/templates/basic/node_modules/postcss/lib/input.js +0 -276
  230. package/templates/basic/node_modules/postcss/lib/lazy-result.d.ts +0 -189
  231. package/templates/basic/node_modules/postcss/lib/lazy-result.js +0 -563
  232. package/templates/basic/node_modules/postcss/lib/list.d.ts +0 -60
  233. package/templates/basic/node_modules/postcss/lib/list.js +0 -58
  234. package/templates/basic/node_modules/postcss/lib/map-generator.js +0 -376
  235. package/templates/basic/node_modules/postcss/lib/no-work-result.d.ts +0 -45
  236. package/templates/basic/node_modules/postcss/lib/no-work-result.js +0 -137
  237. package/templates/basic/node_modules/postcss/lib/node.d.ts +0 -555
  238. package/templates/basic/node_modules/postcss/lib/node.js +0 -456
  239. package/templates/basic/node_modules/postcss/lib/parse.d.ts +0 -9
  240. package/templates/basic/node_modules/postcss/lib/parse.js +0 -42
  241. package/templates/basic/node_modules/postcss/lib/parser.js +0 -618
  242. package/templates/basic/node_modules/postcss/lib/postcss.d.mts +0 -66
  243. package/templates/basic/node_modules/postcss/lib/postcss.d.ts +0 -461
  244. package/templates/basic/node_modules/postcss/lib/postcss.js +0 -101
  245. package/templates/basic/node_modules/postcss/lib/postcss.mjs +0 -30
  246. package/templates/basic/node_modules/postcss/lib/previous-map.d.ts +0 -80
  247. package/templates/basic/node_modules/postcss/lib/previous-map.js +0 -161
  248. package/templates/basic/node_modules/postcss/lib/processor.d.ts +0 -114
  249. package/templates/basic/node_modules/postcss/lib/processor.js +0 -67
  250. package/templates/basic/node_modules/postcss/lib/result.d.ts +0 -204
  251. package/templates/basic/node_modules/postcss/lib/result.js +0 -42
  252. package/templates/basic/node_modules/postcss/lib/root.d.ts +0 -86
  253. package/templates/basic/node_modules/postcss/lib/root.js +0 -61
  254. package/templates/basic/node_modules/postcss/lib/rule.d.ts +0 -126
  255. package/templates/basic/node_modules/postcss/lib/rule.js +0 -27
  256. package/templates/basic/node_modules/postcss/lib/stringifier.d.ts +0 -45
  257. package/templates/basic/node_modules/postcss/lib/stringifier.js +0 -374
  258. package/templates/basic/node_modules/postcss/lib/stringify.d.ts +0 -9
  259. package/templates/basic/node_modules/postcss/lib/stringify.js +0 -11
  260. package/templates/basic/node_modules/postcss/lib/symbols.js +0 -5
  261. package/templates/basic/node_modules/postcss/lib/terminal-highlight.js +0 -70
  262. package/templates/basic/node_modules/postcss/lib/tokenize.js +0 -270
  263. package/templates/basic/node_modules/postcss/lib/warn-once.js +0 -13
  264. package/templates/basic/node_modules/postcss/lib/warning.d.ts +0 -146
  265. package/templates/basic/node_modules/postcss/lib/warning.js +0 -37
  266. package/templates/basic/node_modules/postcss/package.json +0 -88
  267. package/templates/basic/node_modules/rolldown/LICENSE +0 -25
  268. package/templates/basic/node_modules/rolldown/README.md +0 -11
  269. package/templates/basic/node_modules/rolldown/bin/cli.mjs +0 -2
  270. package/templates/basic/node_modules/rolldown/dist/cli.d.mts +0 -1
  271. package/templates/basic/node_modules/rolldown/dist/cli.mjs +0 -1202
  272. package/templates/basic/node_modules/rolldown/dist/config.d.mts +0 -14
  273. package/templates/basic/node_modules/rolldown/dist/config.mjs +0 -4
  274. package/templates/basic/node_modules/rolldown/dist/experimental-index.d.mts +0 -280
  275. package/templates/basic/node_modules/rolldown/dist/experimental-index.mjs +0 -331
  276. package/templates/basic/node_modules/rolldown/dist/experimental-runtime-types.d.ts +0 -107
  277. package/templates/basic/node_modules/rolldown/dist/filter-index.d.mts +0 -195
  278. package/templates/basic/node_modules/rolldown/dist/filter-index.mjs +0 -380
  279. package/templates/basic/node_modules/rolldown/dist/get-log-filter.d.mts +0 -3
  280. package/templates/basic/node_modules/rolldown/dist/get-log-filter.mjs +0 -68
  281. package/templates/basic/node_modules/rolldown/dist/index.d.mts +0 -4
  282. package/templates/basic/node_modules/rolldown/dist/index.mjs +0 -50
  283. package/templates/basic/node_modules/rolldown/dist/parallel-plugin-worker.d.mts +0 -1
  284. package/templates/basic/node_modules/rolldown/dist/parallel-plugin-worker.mjs +0 -29
  285. package/templates/basic/node_modules/rolldown/dist/parallel-plugin.d.mts +0 -13
  286. package/templates/basic/node_modules/rolldown/dist/parallel-plugin.mjs +0 -6
  287. package/templates/basic/node_modules/rolldown/dist/parse-ast-index.d.mts +0 -32
  288. package/templates/basic/node_modules/rolldown/dist/parse-ast-index.mjs +0 -60
  289. package/templates/basic/node_modules/rolldown/dist/plugins-index.d.mts +0 -33
  290. package/templates/basic/node_modules/rolldown/dist/plugins-index.mjs +0 -40
  291. package/templates/basic/node_modules/rolldown/dist/shared/binding-B1q9aYT-.d.mts +0 -1947
  292. package/templates/basic/node_modules/rolldown/dist/shared/binding-BmkJW3Wy.mjs +0 -588
  293. package/templates/basic/node_modules/rolldown/dist/shared/bindingify-input-options-BsDhfYrS.mjs +0 -2240
  294. package/templates/basic/node_modules/rolldown/dist/shared/constructors-2i1T9YcF.d.mts +0 -36
  295. package/templates/basic/node_modules/rolldown/dist/shared/constructors-CE6zZSUt.mjs +0 -65
  296. package/templates/basic/node_modules/rolldown/dist/shared/define-config-BBz954-q.d.mts +0 -3901
  297. package/templates/basic/node_modules/rolldown/dist/shared/define-config-Demdg3_4.mjs +0 -6
  298. package/templates/basic/node_modules/rolldown/dist/shared/error-BlQ0-ek7.mjs +0 -85
  299. package/templates/basic/node_modules/rolldown/dist/shared/get-log-filter-BpNVNJ5-.d.mts +0 -35
  300. package/templates/basic/node_modules/rolldown/dist/shared/load-config-FRmAU9xl.mjs +0 -120
  301. package/templates/basic/node_modules/rolldown/dist/shared/logging-BSNejiLS.d.mts +0 -50
  302. package/templates/basic/node_modules/rolldown/dist/shared/logs-aMKUxRpj.mjs +0 -180
  303. package/templates/basic/node_modules/rolldown/dist/shared/misc-CoQm4NHO.mjs +0 -21
  304. package/templates/basic/node_modules/rolldown/dist/shared/normalize-string-or-regex-BYkbbGqQ.mjs +0 -68
  305. package/templates/basic/node_modules/rolldown/dist/shared/parse-DVMnkavl.mjs +0 -74
  306. package/templates/basic/node_modules/rolldown/dist/shared/prompt-B1Yc1NPt.mjs +0 -847
  307. package/templates/basic/node_modules/rolldown/dist/shared/resolve-tsconfig-CdIAR1Eb.mjs +0 -124
  308. package/templates/basic/node_modules/rolldown/dist/shared/rolldown-build-aV0QeeTW.mjs +0 -3264
  309. package/templates/basic/node_modules/rolldown/dist/shared/rolldown-tbHvKzVl.mjs +0 -40
  310. package/templates/basic/node_modules/rolldown/dist/shared/transform-CEmFsvJW.d.mts +0 -149
  311. package/templates/basic/node_modules/rolldown/dist/shared/watch-DIhJ-T1s.mjs +0 -374
  312. package/templates/basic/node_modules/rolldown/dist/utils-index.d.mts +0 -376
  313. package/templates/basic/node_modules/rolldown/dist/utils-index.mjs +0 -2414
  314. package/templates/basic/node_modules/rolldown/package.json +0 -153
  315. package/templates/basic/node_modules/source-map-js/LICENSE +0 -28
  316. package/templates/basic/node_modules/source-map-js/README.md +0 -765
  317. package/templates/basic/node_modules/source-map-js/lib/array-set.js +0 -121
  318. package/templates/basic/node_modules/source-map-js/lib/base64-vlq.js +0 -140
  319. package/templates/basic/node_modules/source-map-js/lib/base64.js +0 -67
  320. package/templates/basic/node_modules/source-map-js/lib/binary-search.js +0 -111
  321. package/templates/basic/node_modules/source-map-js/lib/mapping-list.js +0 -79
  322. package/templates/basic/node_modules/source-map-js/lib/quick-sort.js +0 -132
  323. package/templates/basic/node_modules/source-map-js/lib/source-map-consumer.d.ts +0 -1
  324. package/templates/basic/node_modules/source-map-js/lib/source-map-consumer.js +0 -1188
  325. package/templates/basic/node_modules/source-map-js/lib/source-map-generator.d.ts +0 -1
  326. package/templates/basic/node_modules/source-map-js/lib/source-map-generator.js +0 -444
  327. package/templates/basic/node_modules/source-map-js/lib/source-node.d.ts +0 -1
  328. package/templates/basic/node_modules/source-map-js/lib/source-node.js +0 -413
  329. package/templates/basic/node_modules/source-map-js/lib/util.js +0 -594
  330. package/templates/basic/node_modules/source-map-js/package.json +0 -71
  331. package/templates/basic/node_modules/source-map-js/source-map.d.ts +0 -104
  332. package/templates/basic/node_modules/source-map-js/source-map.js +0 -8
  333. package/templates/basic/node_modules/tinyglobby/LICENSE +0 -21
  334. package/templates/basic/node_modules/tinyglobby/README.md +0 -25
  335. package/templates/basic/node_modules/tinyglobby/dist/index.cjs +0 -335
  336. package/templates/basic/node_modules/tinyglobby/dist/index.d.cts +0 -148
  337. package/templates/basic/node_modules/tinyglobby/dist/index.d.mts +0 -148
  338. package/templates/basic/node_modules/tinyglobby/dist/index.mjs +0 -307
  339. package/templates/basic/node_modules/tinyglobby/package.json +0 -70
  340. package/templates/basic/node_modules/typescript/LICENSE.txt +0 -55
  341. package/templates/basic/node_modules/typescript/README.md +0 -50
  342. package/templates/basic/node_modules/typescript/SECURITY.md +0 -39
  343. package/templates/basic/node_modules/typescript/ThirdPartyNoticeText.txt +0 -193
  344. package/templates/basic/node_modules/typescript/bin/tsc +0 -2
  345. package/templates/basic/node_modules/typescript/bin/tsserver +0 -2
  346. package/templates/basic/node_modules/typescript/lib/_tsc.js +0 -134465
  347. package/templates/basic/node_modules/typescript/lib/_tsserver.js +0 -659
  348. package/templates/basic/node_modules/typescript/lib/_typingsInstaller.js +0 -222
  349. package/templates/basic/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +0 -2129
  350. package/templates/basic/node_modules/typescript/lib/de/diagnosticMessages.generated.json +0 -2125
  351. package/templates/basic/node_modules/typescript/lib/es/diagnosticMessages.generated.json +0 -2129
  352. package/templates/basic/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +0 -2129
  353. package/templates/basic/node_modules/typescript/lib/it/diagnosticMessages.generated.json +0 -2125
  354. package/templates/basic/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +0 -2129
  355. package/templates/basic/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +0 -2129
  356. package/templates/basic/node_modules/typescript/lib/lib.d.ts +0 -20
  357. package/templates/basic/node_modules/typescript/lib/lib.decorators.d.ts +0 -382
  358. package/templates/basic/node_modules/typescript/lib/lib.decorators.legacy.d.ts +0 -20
  359. package/templates/basic/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +0 -18
  360. package/templates/basic/node_modules/typescript/lib/lib.dom.d.ts +0 -45125
  361. package/templates/basic/node_modules/typescript/lib/lib.dom.iterable.d.ts +0 -18
  362. package/templates/basic/node_modules/typescript/lib/lib.es2015.collection.d.ts +0 -150
  363. package/templates/basic/node_modules/typescript/lib/lib.es2015.core.d.ts +0 -595
  364. package/templates/basic/node_modules/typescript/lib/lib.es2015.d.ts +0 -26
  365. package/templates/basic/node_modules/typescript/lib/lib.es2015.generator.d.ts +0 -75
  366. package/templates/basic/node_modules/typescript/lib/lib.es2015.iterable.d.ts +0 -603
  367. package/templates/basic/node_modules/typescript/lib/lib.es2015.promise.d.ts +0 -79
  368. package/templates/basic/node_modules/typescript/lib/lib.es2015.proxy.d.ts +0 -126
  369. package/templates/basic/node_modules/typescript/lib/lib.es2015.reflect.d.ts +0 -142
  370. package/templates/basic/node_modules/typescript/lib/lib.es2015.symbol.d.ts +0 -44
  371. package/templates/basic/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -324
  372. package/templates/basic/node_modules/typescript/lib/lib.es2016.array.include.d.ts +0 -114
  373. package/templates/basic/node_modules/typescript/lib/lib.es2016.d.ts +0 -19
  374. package/templates/basic/node_modules/typescript/lib/lib.es2016.full.d.ts +0 -21
  375. package/templates/basic/node_modules/typescript/lib/lib.es2016.intl.d.ts +0 -29
  376. package/templates/basic/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +0 -19
  377. package/templates/basic/node_modules/typescript/lib/lib.es2017.d.ts +0 -24
  378. package/templates/basic/node_modules/typescript/lib/lib.es2017.date.d.ts +0 -29
  379. package/templates/basic/node_modules/typescript/lib/lib.es2017.full.d.ts +0 -21
  380. package/templates/basic/node_modules/typescript/lib/lib.es2017.intl.d.ts +0 -42
  381. package/templates/basic/node_modules/typescript/lib/lib.es2017.object.d.ts +0 -47
  382. package/templates/basic/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +0 -133
  383. package/templates/basic/node_modules/typescript/lib/lib.es2017.string.d.ts +0 -43
  384. package/templates/basic/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +0 -51
  385. package/templates/basic/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -75
  386. package/templates/basic/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +0 -51
  387. package/templates/basic/node_modules/typescript/lib/lib.es2018.d.ts +0 -22
  388. package/templates/basic/node_modules/typescript/lib/lib.es2018.full.d.ts +0 -22
  389. package/templates/basic/node_modules/typescript/lib/lib.es2018.intl.d.ts +0 -81
  390. package/templates/basic/node_modules/typescript/lib/lib.es2018.promise.d.ts +0 -28
  391. package/templates/basic/node_modules/typescript/lib/lib.es2018.regexp.d.ts +0 -35
  392. package/templates/basic/node_modules/typescript/lib/lib.es2019.array.d.ts +0 -77
  393. package/templates/basic/node_modules/typescript/lib/lib.es2019.d.ts +0 -22
  394. package/templates/basic/node_modules/typescript/lib/lib.es2019.full.d.ts +0 -22
  395. package/templates/basic/node_modules/typescript/lib/lib.es2019.intl.d.ts +0 -21
  396. package/templates/basic/node_modules/typescript/lib/lib.es2019.object.d.ts +0 -31
  397. package/templates/basic/node_modules/typescript/lib/lib.es2019.string.d.ts +0 -35
  398. package/templates/basic/node_modules/typescript/lib/lib.es2019.symbol.d.ts +0 -22
  399. package/templates/basic/node_modules/typescript/lib/lib.es2020.bigint.d.ts +0 -763
  400. package/templates/basic/node_modules/typescript/lib/lib.es2020.d.ts +0 -25
  401. package/templates/basic/node_modules/typescript/lib/lib.es2020.date.d.ts +0 -40
  402. package/templates/basic/node_modules/typescript/lib/lib.es2020.full.d.ts +0 -22
  403. package/templates/basic/node_modules/typescript/lib/lib.es2020.intl.d.ts +0 -472
  404. package/templates/basic/node_modules/typescript/lib/lib.es2020.number.d.ts +0 -26
  405. package/templates/basic/node_modules/typescript/lib/lib.es2020.promise.d.ts +0 -45
  406. package/templates/basic/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +0 -97
  407. package/templates/basic/node_modules/typescript/lib/lib.es2020.string.d.ts +0 -42
  408. package/templates/basic/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -39
  409. package/templates/basic/node_modules/typescript/lib/lib.es2021.d.ts +0 -21
  410. package/templates/basic/node_modules/typescript/lib/lib.es2021.full.d.ts +0 -22
  411. package/templates/basic/node_modules/typescript/lib/lib.es2021.intl.d.ts +0 -164
  412. package/templates/basic/node_modules/typescript/lib/lib.es2021.promise.d.ts +0 -46
  413. package/templates/basic/node_modules/typescript/lib/lib.es2021.string.d.ts +0 -31
  414. package/templates/basic/node_modules/typescript/lib/lib.es2021.weakref.d.ts +0 -76
  415. package/templates/basic/node_modules/typescript/lib/lib.es2022.array.d.ts +0 -119
  416. package/templates/basic/node_modules/typescript/lib/lib.es2022.d.ts +0 -23
  417. package/templates/basic/node_modules/typescript/lib/lib.es2022.error.d.ts +0 -73
  418. package/templates/basic/node_modules/typescript/lib/lib.es2022.full.d.ts +0 -22
  419. package/templates/basic/node_modules/typescript/lib/lib.es2022.intl.d.ts +0 -143
  420. package/templates/basic/node_modules/typescript/lib/lib.es2022.object.d.ts +0 -24
  421. package/templates/basic/node_modules/typescript/lib/lib.es2022.regexp.d.ts +0 -37
  422. package/templates/basic/node_modules/typescript/lib/lib.es2022.string.d.ts +0 -23
  423. package/templates/basic/node_modules/typescript/lib/lib.es2023.array.d.ts +0 -922
  424. package/templates/basic/node_modules/typescript/lib/lib.es2023.collection.d.ts +0 -19
  425. package/templates/basic/node_modules/typescript/lib/lib.es2023.d.ts +0 -20
  426. package/templates/basic/node_modules/typescript/lib/lib.es2023.full.d.ts +0 -22
  427. package/templates/basic/node_modules/typescript/lib/lib.es2023.intl.d.ts +0 -62
  428. package/templates/basic/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +0 -63
  429. package/templates/basic/node_modules/typescript/lib/lib.es2024.collection.d.ts +0 -27
  430. package/templates/basic/node_modules/typescript/lib/lib.es2024.d.ts +0 -24
  431. package/templates/basic/node_modules/typescript/lib/lib.es2024.full.d.ts +0 -22
  432. package/templates/basic/node_modules/typescript/lib/lib.es2024.object.d.ts +0 -27
  433. package/templates/basic/node_modules/typescript/lib/lib.es2024.promise.d.ts +0 -33
  434. package/templates/basic/node_modules/typescript/lib/lib.es2024.regexp.d.ts +0 -23
  435. package/templates/basic/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +0 -66
  436. package/templates/basic/node_modules/typescript/lib/lib.es2024.string.d.ts +0 -27
  437. package/templates/basic/node_modules/typescript/lib/lib.es2025.collection.d.ts +0 -94
  438. package/templates/basic/node_modules/typescript/lib/lib.es2025.d.ts +0 -23
  439. package/templates/basic/node_modules/typescript/lib/lib.es2025.float16.d.ts +0 -443
  440. package/templates/basic/node_modules/typescript/lib/lib.es2025.full.d.ts +0 -22
  441. package/templates/basic/node_modules/typescript/lib/lib.es2025.intl.d.ts +0 -200
  442. package/templates/basic/node_modules/typescript/lib/lib.es2025.iterator.d.ts +0 -146
  443. package/templates/basic/node_modules/typescript/lib/lib.es2025.promise.d.ts +0 -32
  444. package/templates/basic/node_modules/typescript/lib/lib.es2025.regexp.d.ts +0 -30
  445. package/templates/basic/node_modules/typescript/lib/lib.es5.d.ts +0 -4599
  446. package/templates/basic/node_modules/typescript/lib/lib.es6.d.ts +0 -21
  447. package/templates/basic/node_modules/typescript/lib/lib.esnext.array.d.ts +0 -33
  448. package/templates/basic/node_modules/typescript/lib/lib.esnext.collection.d.ts +0 -47
  449. package/templates/basic/node_modules/typescript/lib/lib.esnext.d.ts +0 -27
  450. package/templates/basic/node_modules/typescript/lib/lib.esnext.date.d.ts +0 -21
  451. package/templates/basic/node_modules/typescript/lib/lib.esnext.decorators.d.ts +0 -26
  452. package/templates/basic/node_modules/typescript/lib/lib.esnext.disposable.d.ts +0 -191
  453. package/templates/basic/node_modules/typescript/lib/lib.esnext.error.d.ts +0 -22
  454. package/templates/basic/node_modules/typescript/lib/lib.esnext.full.d.ts +0 -22
  455. package/templates/basic/node_modules/typescript/lib/lib.esnext.intl.d.ts +0 -107
  456. package/templates/basic/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +0 -23
  457. package/templates/basic/node_modules/typescript/lib/lib.esnext.temporal.d.ts +0 -485
  458. package/templates/basic/node_modules/typescript/lib/lib.esnext.typedarrays.d.ts +0 -90
  459. package/templates/basic/node_modules/typescript/lib/lib.scripthost.d.ts +0 -320
  460. package/templates/basic/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +0 -18
  461. package/templates/basic/node_modules/typescript/lib/lib.webworker.d.ts +0 -15606
  462. package/templates/basic/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +0 -21
  463. package/templates/basic/node_modules/typescript/lib/lib.webworker.iterable.d.ts +0 -18
  464. package/templates/basic/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +0 -2129
  465. package/templates/basic/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +0 -2129
  466. package/templates/basic/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +0 -2125
  467. package/templates/basic/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +0 -2129
  468. package/templates/basic/node_modules/typescript/lib/tsc.js +0 -8
  469. package/templates/basic/node_modules/typescript/lib/tsserver.js +0 -8
  470. package/templates/basic/node_modules/typescript/lib/tsserverlibrary.d.ts +0 -17
  471. package/templates/basic/node_modules/typescript/lib/tsserverlibrary.js +0 -21
  472. package/templates/basic/node_modules/typescript/lib/typesMap.json +0 -497
  473. package/templates/basic/node_modules/typescript/lib/typescript.d.ts +0 -11448
  474. package/templates/basic/node_modules/typescript/lib/typescript.js +0 -201039
  475. package/templates/basic/node_modules/typescript/lib/typingsInstaller.js +0 -8
  476. package/templates/basic/node_modules/typescript/lib/watchGuard.js +0 -53
  477. package/templates/basic/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -2129
  478. package/templates/basic/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -2125
  479. package/templates/basic/node_modules/typescript/package.json +0 -118
  480. package/templates/basic/node_modules/vite/LICENSE.md +0 -2287
  481. package/templates/basic/node_modules/vite/README.md +0 -20
  482. package/templates/basic/node_modules/vite/bin/openChrome.js +0 -68
  483. package/templates/basic/node_modules/vite/bin/vite.js +0 -79
  484. package/templates/basic/node_modules/vite/client.d.ts +0 -285
  485. package/templates/basic/node_modules/vite/dist/client/client.mjs +0 -1269
  486. package/templates/basic/node_modules/vite/dist/client/env.mjs +0 -18
  487. package/templates/basic/node_modules/vite/dist/node/chunks/build.js +0 -5371
  488. package/templates/basic/node_modules/vite/dist/node/chunks/dist.js +0 -6784
  489. package/templates/basic/node_modules/vite/dist/node/chunks/lib.js +0 -371
  490. package/templates/basic/node_modules/vite/dist/node/chunks/logger.js +0 -364
  491. package/templates/basic/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts +0 -96
  492. package/templates/basic/node_modules/vite/dist/node/chunks/node.js +0 -35836
  493. package/templates/basic/node_modules/vite/dist/node/chunks/postcss-import.js +0 -467
  494. package/templates/basic/node_modules/vite/dist/node/cli.js +0 -836
  495. package/templates/basic/node_modules/vite/dist/node/index.d.ts +0 -4011
  496. package/templates/basic/node_modules/vite/dist/node/index.js +0 -3
  497. package/templates/basic/node_modules/vite/dist/node/internal.d.ts +0 -2
  498. package/templates/basic/node_modules/vite/dist/node/internal.js +0 -2
  499. package/templates/basic/node_modules/vite/dist/node/module-runner.d.ts +0 -314
  500. package/templates/basic/node_modules/vite/dist/node/module-runner.js +0 -1274
  501. package/templates/basic/node_modules/vite/misc/false.js +0 -1
  502. package/templates/basic/node_modules/vite/misc/true.js +0 -1
  503. package/templates/basic/node_modules/vite/package.json +0 -194
  504. package/templates/basic/node_modules/vite/types/customEvent.d.ts +0 -79
  505. package/templates/basic/node_modules/vite/types/hmrPayload.d.ts +0 -80
  506. package/templates/basic/node_modules/vite/types/hot.d.ts +0 -39
  507. package/templates/basic/node_modules/vite/types/import-meta.d.ts +0 -5
  508. package/templates/basic/node_modules/vite/types/importGlob.d.ts +0 -131
  509. package/templates/basic/node_modules/vite/types/importMeta.d.ts +0 -30
  510. package/templates/basic/node_modules/vite/types/internal/cssPreprocessorOptions.d.ts +0 -44
  511. package/templates/basic/node_modules/vite/types/internal/esbuildOptions.d.ts +0 -28
  512. package/templates/basic/node_modules/vite/types/internal/lightningcssOptions.d.ts +0 -18
  513. package/templates/basic/node_modules/vite/types/internal/rollupTypeCompat.d.ts +0 -24
  514. package/templates/basic/node_modules/vite/types/internal/terserOptions.d.ts +0 -11
  515. package/templates/basic/node_modules/vite/types/metadata.d.ts +0 -47
  516. package/templates/basic/package-lock.json +0 -926
@@ -1,1274 +0,0 @@
1
- let SOURCEMAPPING_URL = "sourceMa";
2
- SOURCEMAPPING_URL += "ppingURL";
3
- //#endregion
4
- //#region src/shared/utils.ts
5
- const isWindows = typeof process < "u" && process.platform === "win32";
6
- /**
7
- * Undo {@link wrapId}'s `/@id/` and null byte replacements.
8
- */
9
- function unwrapId(id) {
10
- return id.startsWith("/@id/") ? id.slice(5).replace("__x00__", "\0") : id;
11
- }
12
- const windowsSlashRE = /\\/g;
13
- function slash(p) {
14
- return p.replace(windowsSlashRE, "/");
15
- }
16
- const postfixRE = /[?#].*$/;
17
- function cleanUrl(url) {
18
- return url.replace(postfixRE, "");
19
- }
20
- function isPrimitive(value) {
21
- return !value || typeof value != "object" && typeof value != "function";
22
- }
23
- const AsyncFunction = async function() {}.constructor;
24
- let asyncFunctionDeclarationPaddingLineCount;
25
- function getAsyncFunctionDeclarationPaddingLineCount() {
26
- if (asyncFunctionDeclarationPaddingLineCount === void 0) {
27
- let body = "/*code*/", source = new AsyncFunction("a", "b", body).toString();
28
- asyncFunctionDeclarationPaddingLineCount = source.slice(0, source.indexOf(body)).split("\n").length - 1;
29
- }
30
- return asyncFunctionDeclarationPaddingLineCount;
31
- }
32
- function promiseWithResolvers() {
33
- let resolve, reject;
34
- return {
35
- promise: new Promise((_resolve, _reject) => {
36
- resolve = _resolve, reject = _reject;
37
- }),
38
- resolve,
39
- reject
40
- };
41
- }
42
- //#endregion
43
- //#region ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
44
- const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
45
- function normalizeWindowsPath(input = "") {
46
- return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
47
- }
48
- const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
49
- function cwd() {
50
- return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
51
- }
52
- const resolve = function(...arguments_) {
53
- arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
54
- let resolvedPath = "", resolvedAbsolute = !1;
55
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
56
- let path = index >= 0 ? arguments_[index] : cwd();
57
- !path || path.length === 0 || (resolvedPath = `${path}/${resolvedPath}`, resolvedAbsolute = isAbsolute(path));
58
- }
59
- return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
60
- };
61
- function normalizeString(path, allowAboveRoot) {
62
- let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
63
- for (let index = 0; index <= path.length; ++index) {
64
- if (index < path.length) char = path[index];
65
- else if (char === "/") break;
66
- else char = "/";
67
- if (char === "/") {
68
- if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
69
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
70
- if (res.length > 2) {
71
- let lastSlashIndex = res.lastIndexOf("/");
72
- lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
73
- continue;
74
- } else if (res.length > 0) {
75
- res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
76
- continue;
77
- }
78
- }
79
- allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
80
- } else res.length > 0 ? res += `/${path.slice(lastSlash + 1, index)}` : res = path.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
81
- lastSlash = index, dots = 0;
82
- } else char === "." && dots !== -1 ? ++dots : dots = -1;
83
- }
84
- return res;
85
- }
86
- const isAbsolute = function(p) {
87
- return _IS_ABSOLUTE_RE.test(p);
88
- }, dirname = function(p) {
89
- let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
90
- return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute(p) ? "/" : ".");
91
- }, textDecoder = new TextDecoder(), decodeBase64 = typeof Buffer == "function" && typeof Buffer.from == "function" ? (base64) => Buffer.from(base64, "base64").toString("utf-8") : (base64) => textDecoder.decode(Uint8Array.from(atob(base64), (c) => c.charCodeAt(0))), percentRegEx = /%/g, backslashRegEx = /\\/g, newlineRegEx = /\n/g, carriageReturnRegEx = /\r/g, tabRegEx = /\t/g, questionRegex = /\?/g, hashRegex = /#/g;
92
- function encodePathChars(filepath) {
93
- return filepath.includes("%") && (filepath = filepath.replace(percentRegEx, "%25")), !isWindows && filepath.includes("\\") && (filepath = filepath.replace(backslashRegEx, "%5C")), filepath.includes("\n") && (filepath = filepath.replace(newlineRegEx, "%0A")), filepath.includes("\r") && (filepath = filepath.replace(carriageReturnRegEx, "%0D")), filepath.includes(" ") && (filepath = filepath.replace(tabRegEx, "%09")), filepath;
94
- }
95
- const posixDirname = dirname, posixResolve = resolve;
96
- function posixPathToFileHref(posixPath) {
97
- let resolved = posixResolve(posixPath), filePathLast = posixPath.charCodeAt(posixPath.length - 1);
98
- return (filePathLast === 47 || isWindows && filePathLast === 92) && resolved[resolved.length - 1] !== "/" && (resolved += "/"), resolved = encodePathChars(resolved), resolved.includes("?") && (resolved = resolved.replace(questionRegex, "%3F")), resolved.includes("#") && (resolved = resolved.replace(hashRegex, "%23")), new URL(`file://${resolved}`).href;
99
- }
100
- function toWindowsPath(path) {
101
- return path.replace(/\//g, "\\");
102
- }
103
- //#endregion
104
- //#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
105
- var comma = 44, chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", intToChar = /* @__PURE__ */ new Uint8Array(64), charToInt = /* @__PURE__ */ new Uint8Array(128);
106
- for (let i = 0; i < chars.length; i++) {
107
- let c = chars.charCodeAt(i);
108
- intToChar[i] = c, charToInt[c] = i;
109
- }
110
- function decodeInteger(reader, relative) {
111
- let value = 0, shift = 0, integer = 0;
112
- do
113
- integer = charToInt[reader.next()], value |= (integer & 31) << shift, shift += 5;
114
- while (integer & 32);
115
- let shouldNegate = value & 1;
116
- return value >>>= 1, shouldNegate && (value = -2147483648 | -value), relative + value;
117
- }
118
- function hasMoreVlq(reader, max) {
119
- return reader.pos >= max ? !1 : reader.peek() !== comma;
120
- }
121
- var StringReader = class {
122
- constructor(buffer) {
123
- this.pos = 0, this.buffer = buffer;
124
- }
125
- next() {
126
- return this.buffer.charCodeAt(this.pos++);
127
- }
128
- peek() {
129
- return this.buffer.charCodeAt(this.pos);
130
- }
131
- indexOf(char) {
132
- let { buffer, pos } = this, idx = buffer.indexOf(char, pos);
133
- return idx === -1 ? buffer.length : idx;
134
- }
135
- };
136
- function decode(mappings) {
137
- let { length } = mappings, reader = new StringReader(mappings), decoded = [], genColumn = 0, sourcesIndex = 0, sourceLine = 0, sourceColumn = 0, namesIndex = 0;
138
- do {
139
- let semi = reader.indexOf(";"), line = [], sorted = !0, lastCol = 0;
140
- for (genColumn = 0; reader.pos < semi;) {
141
- let seg;
142
- genColumn = decodeInteger(reader, genColumn), genColumn < lastCol && (sorted = !1), lastCol = genColumn, hasMoreVlq(reader, semi) ? (sourcesIndex = decodeInteger(reader, sourcesIndex), sourceLine = decodeInteger(reader, sourceLine), sourceColumn = decodeInteger(reader, sourceColumn), hasMoreVlq(reader, semi) ? (namesIndex = decodeInteger(reader, namesIndex), seg = [
143
- genColumn,
144
- sourcesIndex,
145
- sourceLine,
146
- sourceColumn,
147
- namesIndex
148
- ]) : seg = [
149
- genColumn,
150
- sourcesIndex,
151
- sourceLine,
152
- sourceColumn
153
- ]) : seg = [genColumn], line.push(seg), reader.pos++;
154
- }
155
- sorted || sort(line), decoded.push(line), reader.pos = semi + 1;
156
- } while (reader.pos <= length);
157
- return decoded;
158
- }
159
- function sort(line) {
160
- line.sort(sortComparator);
161
- }
162
- function sortComparator(a, b) {
163
- return a[0] - b[0];
164
- }
165
- //#endregion
166
- //#region ../../node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
167
- var COLUMN = 0, SOURCES_INDEX = 1, SOURCE_LINE = 2, SOURCE_COLUMN = 3, NAMES_INDEX = 4, found = !1;
168
- function binarySearch(haystack, needle, low, high) {
169
- for (; low <= high;) {
170
- let mid = low + (high - low >> 1), cmp = haystack[mid][COLUMN] - needle;
171
- if (cmp === 0) return found = !0, mid;
172
- cmp < 0 ? low = mid + 1 : high = mid - 1;
173
- }
174
- return found = !1, low - 1;
175
- }
176
- function upperBound(haystack, needle, index) {
177
- for (let i = index + 1; i < haystack.length && haystack[i][COLUMN] === needle; index = i++);
178
- return index;
179
- }
180
- function lowerBound(haystack, needle, index) {
181
- for (let i = index - 1; i >= 0 && haystack[i][COLUMN] === needle; index = i--);
182
- return index;
183
- }
184
- function memoizedBinarySearch(haystack, needle, state, key) {
185
- let { lastKey, lastNeedle, lastIndex } = state, low = 0, high = haystack.length - 1;
186
- if (key === lastKey) {
187
- if (needle === lastNeedle) return found = lastIndex !== -1 && haystack[lastIndex][COLUMN] === needle, lastIndex;
188
- needle >= lastNeedle ? low = lastIndex === -1 ? 0 : lastIndex : high = lastIndex;
189
- }
190
- return state.lastKey = key, state.lastNeedle = needle, state.lastIndex = binarySearch(haystack, needle, low, high);
191
- }
192
- var LINE_GTR_ZERO = "`line` must be greater than 0 (lines start at line 1)", COL_GTR_EQ_ZERO = "`column` must be greater than or equal to 0 (columns start at column 0)";
193
- function cast(map) {
194
- return map;
195
- }
196
- function decodedMappings(map) {
197
- var _a;
198
- return (_a = cast(map))._decoded || (_a._decoded = decode(cast(map)._encoded));
199
- }
200
- function originalPositionFor(map, needle) {
201
- let { line, column, bias } = needle;
202
- if (line--, line < 0) throw Error(LINE_GTR_ZERO);
203
- if (column < 0) throw Error(COL_GTR_EQ_ZERO);
204
- let decoded = decodedMappings(map);
205
- if (line >= decoded.length) return OMapping(null, null, null, null);
206
- let segments = decoded[line], index = traceSegmentInternal(segments, cast(map)._decodedMemo, line, column, bias || 1);
207
- if (index === -1) return OMapping(null, null, null, null);
208
- let segment = segments[index];
209
- if (segment.length === 1) return OMapping(null, null, null, null);
210
- let { names, resolvedSources } = map;
211
- return OMapping(resolvedSources[segment[SOURCES_INDEX]], segment[SOURCE_LINE] + 1, segment[SOURCE_COLUMN], segment.length === 5 ? names[segment[NAMES_INDEX]] : null);
212
- }
213
- function OMapping(source, line, column, name) {
214
- return {
215
- source,
216
- line,
217
- column,
218
- name
219
- };
220
- }
221
- function traceSegmentInternal(segments, memo, line, column, bias) {
222
- let index = memoizedBinarySearch(segments, column, memo, line);
223
- return found ? index = (bias === -1 ? upperBound : lowerBound)(segments, column, index) : bias === -1 && index++, index === -1 || index === segments.length ? -1 : index;
224
- }
225
- //#endregion
226
- //#region src/module-runner/sourcemap/decoder.ts
227
- var DecodedMap = class {
228
- map;
229
- _encoded;
230
- _decoded;
231
- _decodedMemo;
232
- url;
233
- file;
234
- version;
235
- names = [];
236
- resolvedSources;
237
- constructor(map, from) {
238
- this.map = map;
239
- let { mappings, names, sources } = map;
240
- this.version = map.version, this.names = names || [], this._encoded = mappings || "", this._decodedMemo = memoizedState(), this.url = from, this.file = from;
241
- let originDir = posixDirname(from);
242
- this.resolvedSources = (sources || []).map((s) => posixResolve(originDir, s || ""));
243
- }
244
- };
245
- function memoizedState() {
246
- return {
247
- lastKey: -1,
248
- lastNeedle: -1,
249
- lastIndex: -1
250
- };
251
- }
252
- function getOriginalPosition(map, needle) {
253
- let result = originalPositionFor(map, needle);
254
- return result.column == null ? null : result;
255
- }
256
- //#endregion
257
- //#region src/module-runner/evaluatedModules.ts
258
- const MODULE_RUNNER_SOURCEMAPPING_REGEXP = RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json;base64,(.+)`);
259
- var EvaluatedModuleNode = class {
260
- id;
261
- url;
262
- importers = /* @__PURE__ */ new Set();
263
- imports = /* @__PURE__ */ new Set();
264
- evaluated = !1;
265
- meta;
266
- promise;
267
- exports;
268
- file;
269
- map;
270
- constructor(id, url) {
271
- this.id = id, this.url = url, this.file = cleanUrl(id);
272
- }
273
- }, EvaluatedModules = class {
274
- idToModuleMap = /* @__PURE__ */ new Map();
275
- fileToModulesMap = /* @__PURE__ */ new Map();
276
- urlToIdModuleMap = /* @__PURE__ */ new Map();
277
- /**
278
- * Returns the module node by the resolved module ID. Usually, module ID is
279
- * the file system path with query and/or hash. It can also be a virtual module.
280
- *
281
- * Module runner graph will have 1 to 1 mapping with the server module graph.
282
- * @param id Resolved module ID
283
- */
284
- getModuleById(id) {
285
- return this.idToModuleMap.get(id);
286
- }
287
- /**
288
- * Returns all modules related to the file system path. Different modules
289
- * might have different query parameters or hash, so it's possible to have
290
- * multiple modules for the same file.
291
- * @param file The file system path of the module
292
- */
293
- getModulesByFile(file) {
294
- return this.fileToModulesMap.get(file);
295
- }
296
- /**
297
- * Returns the module node by the URL that was used in the import statement.
298
- * Unlike module graph on the server, the URL is not resolved and is used as is.
299
- * @param url Server URL that was used in the import statement
300
- */
301
- getModuleByUrl(url) {
302
- return this.urlToIdModuleMap.get(unwrapId(url));
303
- }
304
- /**
305
- * Ensure that module is in the graph. If the module is already in the graph,
306
- * it will return the existing module node. Otherwise, it will create a new
307
- * module node and add it to the graph.
308
- * @param id Resolved module ID
309
- * @param url URL that was used in the import statement
310
- */
311
- ensureModule(id, url) {
312
- if (id = normalizeModuleId(id), this.idToModuleMap.has(id)) {
313
- let moduleNode = this.idToModuleMap.get(id);
314
- return this.urlToIdModuleMap.set(url, moduleNode), moduleNode;
315
- }
316
- let moduleNode = new EvaluatedModuleNode(id, url);
317
- this.idToModuleMap.set(id, moduleNode), this.urlToIdModuleMap.set(url, moduleNode);
318
- let fileModules = this.fileToModulesMap.get(moduleNode.file) || /* @__PURE__ */ new Set();
319
- return fileModules.add(moduleNode), this.fileToModulesMap.set(moduleNode.file, fileModules), moduleNode;
320
- }
321
- invalidateModule(node) {
322
- node.evaluated = !1, node.meta = void 0, node.map = void 0, node.promise = void 0, node.exports = void 0, node.imports.clear();
323
- }
324
- /**
325
- * Extracts the inlined source map from the module code and returns the decoded
326
- * source map. If the source map is not inlined, it will return null.
327
- * @param id Resolved module ID
328
- */
329
- getModuleSourceMapById(id) {
330
- let mod = this.getModuleById(id);
331
- if (!mod) return null;
332
- if (mod.map) return mod.map;
333
- if (!mod.meta || !("code" in mod.meta)) return null;
334
- let pattern = `//# ${SOURCEMAPPING_URL}=data:application/json;base64,`, lastIndex = mod.meta.code.lastIndexOf(pattern);
335
- if (lastIndex === -1) return null;
336
- let mapString = MODULE_RUNNER_SOURCEMAPPING_REGEXP.exec(mod.meta.code.slice(lastIndex))?.[1];
337
- return mapString ? (mod.map = new DecodedMap(JSON.parse(decodeBase64(mapString)), mod.file), mod.map) : null;
338
- }
339
- clear() {
340
- this.idToModuleMap.clear(), this.fileToModulesMap.clear(), this.urlToIdModuleMap.clear();
341
- }
342
- };
343
- const prefixedBuiltins = /* @__PURE__ */ new Set([
344
- "node:sea",
345
- "node:sqlite",
346
- "node:test",
347
- "node:test/reporters"
348
- ]);
349
- function normalizeModuleId(file) {
350
- return prefixedBuiltins.has(file) ? file : slash(file).replace(/^\/@fs\//, isWindows ? "" : "/").replace(/^node:/, "").replace(/^\/+/, "/").replace(/^file:\/+/, isWindows ? "" : "/");
351
- }
352
- //#endregion
353
- //#region src/shared/hmr.ts
354
- var HMRContext = class {
355
- hmrClient;
356
- ownerPath;
357
- newListeners;
358
- constructor(hmrClient, ownerPath) {
359
- this.hmrClient = hmrClient, this.ownerPath = ownerPath, hmrClient.dataMap.has(ownerPath) || hmrClient.dataMap.set(ownerPath, {});
360
- let mod = hmrClient.hotModulesMap.get(ownerPath);
361
- mod && (mod.callbacks = []);
362
- let staleListeners = hmrClient.ctxToListenersMap.get(ownerPath);
363
- if (staleListeners) for (let [event, staleFns] of staleListeners) {
364
- let listeners = hmrClient.customListenersMap.get(event);
365
- listeners && hmrClient.customListenersMap.set(event, listeners.filter((l) => !staleFns.includes(l)));
366
- }
367
- this.newListeners = /* @__PURE__ */ new Map(), hmrClient.ctxToListenersMap.set(ownerPath, this.newListeners);
368
- }
369
- get data() {
370
- return this.hmrClient.dataMap.get(this.ownerPath);
371
- }
372
- accept(deps, callback) {
373
- if (typeof deps == "function" || !deps) this.acceptDeps([this.ownerPath], ([mod]) => deps?.(mod));
374
- else if (typeof deps == "string") this.acceptDeps([deps], ([mod]) => callback?.(mod));
375
- else if (Array.isArray(deps)) this.acceptDeps(deps, callback);
376
- else throw Error("invalid hot.accept() usage.");
377
- }
378
- acceptExports(_, callback) {
379
- this.acceptDeps([this.ownerPath], ([mod]) => callback?.(mod));
380
- }
381
- dispose(cb) {
382
- this.hmrClient.disposeMap.set(this.ownerPath, cb);
383
- }
384
- prune(cb) {
385
- this.hmrClient.pruneMap.set(this.ownerPath, cb);
386
- }
387
- decline() {}
388
- invalidate(message) {
389
- let firstInvalidatedBy = this.hmrClient.currentFirstInvalidatedBy ?? this.ownerPath;
390
- this.hmrClient.notifyListeners("vite:invalidate", {
391
- path: this.ownerPath,
392
- message,
393
- firstInvalidatedBy
394
- }), this.send("vite:invalidate", {
395
- path: this.ownerPath,
396
- message,
397
- firstInvalidatedBy
398
- }), this.hmrClient.logger.debug(`invalidate ${this.ownerPath}${message ? `: ${message}` : ""}`);
399
- }
400
- on(event, cb) {
401
- let addToMap = (map) => {
402
- let existing = map.get(event) || [];
403
- existing.push(cb), map.set(event, existing);
404
- };
405
- addToMap(this.hmrClient.customListenersMap), addToMap(this.newListeners);
406
- }
407
- off(event, cb) {
408
- let removeFromMap = (map) => {
409
- let existing = map.get(event);
410
- if (existing === void 0) return;
411
- let pruned = existing.filter((l) => l !== cb);
412
- if (pruned.length === 0) {
413
- map.delete(event);
414
- return;
415
- }
416
- map.set(event, pruned);
417
- };
418
- removeFromMap(this.hmrClient.customListenersMap), removeFromMap(this.newListeners);
419
- }
420
- send(event, data) {
421
- this.hmrClient.send({
422
- type: "custom",
423
- event,
424
- data
425
- });
426
- }
427
- acceptDeps(deps, callback = () => {}) {
428
- let mod = this.hmrClient.hotModulesMap.get(this.ownerPath) || {
429
- id: this.ownerPath,
430
- callbacks: []
431
- };
432
- mod.callbacks.push({
433
- deps,
434
- fn: callback
435
- }), this.hmrClient.hotModulesMap.set(this.ownerPath, mod);
436
- }
437
- }, HMRClient = class {
438
- logger;
439
- transport;
440
- importUpdatedModule;
441
- hotModulesMap = /* @__PURE__ */ new Map();
442
- disposeMap = /* @__PURE__ */ new Map();
443
- pruneMap = /* @__PURE__ */ new Map();
444
- dataMap = /* @__PURE__ */ new Map();
445
- customListenersMap = /* @__PURE__ */ new Map();
446
- ctxToListenersMap = /* @__PURE__ */ new Map();
447
- currentFirstInvalidatedBy;
448
- constructor(logger, transport, importUpdatedModule) {
449
- this.logger = logger, this.transport = transport, this.importUpdatedModule = importUpdatedModule;
450
- }
451
- async notifyListeners(event, data) {
452
- let cbs = this.customListenersMap.get(event);
453
- cbs && await Promise.allSettled(cbs.map((cb) => cb(data)));
454
- }
455
- send(payload) {
456
- this.transport.send(payload).catch((err) => {
457
- this.logger.error(err);
458
- });
459
- }
460
- clear() {
461
- this.hotModulesMap.clear(), this.disposeMap.clear(), this.pruneMap.clear(), this.dataMap.clear(), this.customListenersMap.clear(), this.ctxToListenersMap.clear();
462
- }
463
- async prunePaths(paths) {
464
- await Promise.all(paths.map((path) => {
465
- let disposer = this.disposeMap.get(path);
466
- if (disposer) return disposer(this.dataMap.get(path));
467
- })), await Promise.all(paths.map((path) => {
468
- let fn = this.pruneMap.get(path);
469
- if (fn) return fn(this.dataMap.get(path));
470
- }));
471
- }
472
- warnFailedUpdate(err, path) {
473
- (!(err instanceof Error) || !err.message.includes("fetch")) && this.logger.error(err), this.logger.error(`Failed to reload ${path}. This could be due to syntax errors or importing non-existent modules. (see errors above)`);
474
- }
475
- updateQueue = [];
476
- pendingUpdateQueue = !1;
477
- /**
478
- * buffer multiple hot updates triggered by the same src change
479
- * so that they are invoked in the same order they were sent.
480
- * (otherwise the order may be inconsistent because of the http request round trip)
481
- */
482
- async queueUpdate(payload) {
483
- if (this.updateQueue.push(this.fetchUpdate(payload)), !this.pendingUpdateQueue) {
484
- this.pendingUpdateQueue = !0, await Promise.resolve(), this.pendingUpdateQueue = !1;
485
- let loading = [...this.updateQueue];
486
- this.updateQueue = [], (await Promise.all(loading)).forEach((fn) => fn && fn());
487
- }
488
- }
489
- async fetchUpdate(update) {
490
- let { path, acceptedPath, firstInvalidatedBy } = update, mod = this.hotModulesMap.get(path);
491
- if (!mod) return;
492
- let fetchedModule, isSelfUpdate = path === acceptedPath, qualifiedCallbacks = mod.callbacks.filter(({ deps }) => deps.includes(acceptedPath));
493
- if (isSelfUpdate || qualifiedCallbacks.length > 0) {
494
- let disposer = this.disposeMap.get(acceptedPath);
495
- disposer && await disposer(this.dataMap.get(acceptedPath));
496
- try {
497
- fetchedModule = await this.importUpdatedModule(update);
498
- } catch (e) {
499
- this.warnFailedUpdate(e, acceptedPath);
500
- }
501
- }
502
- return () => {
503
- try {
504
- this.currentFirstInvalidatedBy = firstInvalidatedBy;
505
- for (let { deps, fn } of qualifiedCallbacks) fn(deps.map((dep) => dep === acceptedPath ? fetchedModule : void 0));
506
- let loggedPath = isSelfUpdate ? path : `${acceptedPath} via ${path}`;
507
- this.logger.debug(`hot updated: ${loggedPath}`);
508
- } finally {
509
- this.currentFirstInvalidatedBy = void 0;
510
- }
511
- };
512
- }
513
- };
514
- //#endregion
515
- //#region src/shared/ssrTransform.ts
516
- /**
517
- * Vite converts `import { } from 'foo'` to `const _ = __vite_ssr_import__('foo')`.
518
- * Top-level imports and dynamic imports work slightly differently in Node.js.
519
- * This function normalizes the differences so it matches prod behaviour.
520
- */
521
- function analyzeImportedModDifference(mod, rawId, moduleType, metadata) {
522
- if (!metadata?.isDynamicImport && metadata?.importedNames?.length) {
523
- let missingBindings = metadata.importedNames.filter((s) => !(s in mod));
524
- if (missingBindings.length) {
525
- let lastBinding = missingBindings[missingBindings.length - 1];
526
- throw SyntaxError(moduleType === "module" ? `[vite] The requested module '${rawId}' does not provide an export named '${lastBinding}'` : `\
527
- [vite] Named export '${lastBinding}' not found. The requested module '${rawId}' is a CommonJS module, which may not support all module.exports as named exports.
528
- CommonJS modules can always be imported via the default export, for example using:
529
-
530
- import pkg from '${rawId}';
531
- const {${missingBindings.join(", ")}} = pkg;
532
- `);
533
- }
534
- }
535
- }
536
- //#endregion
537
- //#region ../../node_modules/.pnpm/nanoid@5.1.16/node_modules/nanoid/non-secure/index.js
538
- let nanoid = (size = 21) => {
539
- let id = "", i = size | 0;
540
- for (; i-- > 0;) id += "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[Math.random() * 64 | 0];
541
- return id;
542
- };
543
- //#endregion
544
- //#region src/shared/moduleRunnerTransport.ts
545
- function reviveInvokeError(e) {
546
- let error = Error(e.message || "Unknown invoke error");
547
- return Object.assign(error, e, { runnerError: /* @__PURE__ */ Error("RunnerError") }), error;
548
- }
549
- const createInvokeableTransport = (transport) => {
550
- if (transport.invoke) return {
551
- ...transport,
552
- async invoke(name, data) {
553
- let result = await transport.invoke({
554
- type: "custom",
555
- event: "vite:invoke",
556
- data: {
557
- id: "send",
558
- name,
559
- data
560
- }
561
- });
562
- if ("error" in result) throw reviveInvokeError(result.error);
563
- return result.result;
564
- }
565
- };
566
- if (!transport.send || !transport.connect) throw Error("transport must implement send and connect when invoke is not implemented");
567
- let rpcPromises = /* @__PURE__ */ new Map();
568
- return {
569
- ...transport,
570
- connect({ onMessage, onDisconnection }) {
571
- return transport.connect({
572
- onMessage(payload) {
573
- if (payload.type === "custom" && payload.event === "vite:invoke") {
574
- let data = payload.data;
575
- if (data.id.startsWith("response:")) {
576
- let invokeId = data.id.slice(9), promise = rpcPromises.get(invokeId);
577
- if (!promise) return;
578
- promise.timeoutId && clearTimeout(promise.timeoutId), rpcPromises.delete(invokeId);
579
- let { error, result } = data.data;
580
- error ? promise.reject(error) : promise.resolve(result);
581
- return;
582
- }
583
- }
584
- onMessage(payload);
585
- },
586
- onDisconnection
587
- });
588
- },
589
- disconnect() {
590
- return rpcPromises.forEach((promise) => {
591
- promise.reject(/* @__PURE__ */ Error(`transport was disconnected, cannot call ${JSON.stringify(promise.name)}`));
592
- }), rpcPromises.clear(), transport.disconnect?.();
593
- },
594
- send(data) {
595
- return transport.send(data);
596
- },
597
- async invoke(name, data) {
598
- let promiseId = nanoid(), wrappedData = {
599
- type: "custom",
600
- event: "vite:invoke",
601
- data: {
602
- name,
603
- id: `send:${promiseId}`,
604
- data
605
- }
606
- }, sendPromise = transport.send(wrappedData), { promise, resolve, reject } = promiseWithResolvers(), timeout = transport.timeout ?? 6e4, timeoutId;
607
- timeout > 0 && (timeoutId = setTimeout(() => {
608
- rpcPromises.delete(promiseId), reject(/* @__PURE__ */ Error(`transport invoke timed out after ${timeout}ms (data: ${JSON.stringify(wrappedData)})`));
609
- }, timeout), timeoutId?.unref?.()), rpcPromises.set(promiseId, {
610
- resolve,
611
- reject,
612
- name,
613
- timeoutId
614
- }), sendPromise && sendPromise.catch((err) => {
615
- clearTimeout(timeoutId), rpcPromises.delete(promiseId), reject(err);
616
- });
617
- try {
618
- return await promise;
619
- } catch (err) {
620
- throw reviveInvokeError(err);
621
- }
622
- }
623
- };
624
- }, normalizeModuleRunnerTransport = (transport) => {
625
- let invokeableTransport = createInvokeableTransport(transport), isConnected = !invokeableTransport.connect, connectingPromise;
626
- return {
627
- ...transport,
628
- ...invokeableTransport.connect ? { async connect(onMessage) {
629
- if (isConnected) return;
630
- if (connectingPromise) {
631
- await connectingPromise;
632
- return;
633
- }
634
- let maybePromise = invokeableTransport.connect({
635
- onMessage: onMessage ?? (() => {}),
636
- onDisconnection() {
637
- isConnected = !1;
638
- }
639
- });
640
- maybePromise && (connectingPromise = maybePromise, await connectingPromise, connectingPromise = void 0), isConnected = !0;
641
- } } : {},
642
- ...invokeableTransport.disconnect ? { async disconnect() {
643
- isConnected && (connectingPromise && await connectingPromise, isConnected = !1, await invokeableTransport.disconnect());
644
- } } : {},
645
- async send(data) {
646
- if (invokeableTransport.send) {
647
- if (!isConnected) if (connectingPromise) await connectingPromise;
648
- else throw new SendBeforeConnectError("send was called before connect");
649
- await invokeableTransport.send(data);
650
- }
651
- },
652
- async invoke(name, data) {
653
- if (!isConnected) if (connectingPromise) await connectingPromise;
654
- else throw new SendBeforeConnectError("invoke was called before connect");
655
- return invokeableTransport.invoke(name, data);
656
- }
657
- };
658
- };
659
- var SendBeforeConnectError = class extends Error {
660
- constructor(message) {
661
- super(message), this.name = "SendBeforeConnectError";
662
- }
663
- };
664
- const createWebSocketModuleRunnerTransport = (options) => {
665
- let pingInterval = options.pingInterval ?? 3e4, ws, pingIntervalId;
666
- return {
667
- async connect({ onMessage, onDisconnection }) {
668
- let socket = options.createConnection();
669
- socket.addEventListener("message", ({ data }) => {
670
- onMessage(JSON.parse(data));
671
- });
672
- let isOpened = socket.readyState === socket.OPEN;
673
- isOpened || await new Promise((resolve, reject) => {
674
- socket.addEventListener("open", () => {
675
- isOpened = !0, resolve();
676
- }, { once: !0 }), socket.addEventListener("close", () => {
677
- if (!isOpened) {
678
- reject(/* @__PURE__ */ Error("WebSocket closed without opened."));
679
- return;
680
- }
681
- onMessage({
682
- type: "custom",
683
- event: "vite:ws:disconnect",
684
- data: { webSocket: socket }
685
- }), onDisconnection();
686
- });
687
- }), onMessage({
688
- type: "custom",
689
- event: "vite:ws:connect",
690
- data: { webSocket: socket }
691
- }), ws = socket, pingIntervalId = setInterval(() => {
692
- socket.readyState === socket.OPEN && socket.send(JSON.stringify({ type: "ping" }));
693
- }, pingInterval);
694
- },
695
- disconnect() {
696
- clearInterval(pingIntervalId), ws?.close();
697
- },
698
- send(data) {
699
- ws.send(JSON.stringify(data));
700
- }
701
- };
702
- };
703
- //#endregion
704
- //#region src/shared/builtin.ts
705
- function createIsBuiltin(builtins) {
706
- let plainBuiltinsSet = new Set(builtins.filter((builtin) => typeof builtin == "string")), regexBuiltins = builtins.filter((builtin) => typeof builtin != "string");
707
- return (id) => plainBuiltinsSet.has(id) || regexBuiltins.some((regexp) => regexp.test(id));
708
- }
709
- //#endregion
710
- //#region src/module-runner/constants.ts
711
- const ssrModuleExportsKey = "__vite_ssr_exports__", ssrImportKey = "__vite_ssr_import__", ssrDynamicImportKey = "__vite_ssr_dynamic_import__", ssrExportAllKey = "__vite_ssr_exportAll__", ssrExportNameKey = "__vite_ssr_exportName__", ssrImportMetaKey = "__vite_ssr_import_meta__", noop = () => {}, silentConsole = {
712
- debug: noop,
713
- error: noop
714
- }, hmrLogger = {
715
- debug: (...msg) => console.log("[vite]", ...msg),
716
- error: (error) => console.log("[vite]", error)
717
- };
718
- //#endregion
719
- //#region src/shared/hmrHandler.ts
720
- function createHMRHandler(handler) {
721
- let queue = new Queue();
722
- return (payload) => queue.enqueue(() => handler(payload));
723
- }
724
- var Queue = class {
725
- queue = [];
726
- pending = !1;
727
- enqueue(promise) {
728
- return new Promise((resolve, reject) => {
729
- this.queue.push({
730
- promise,
731
- resolve,
732
- reject
733
- }), this.dequeue();
734
- });
735
- }
736
- dequeue() {
737
- if (this.pending) return !1;
738
- let item = this.queue.shift();
739
- return item ? (this.pending = !0, item.promise().then(item.resolve).catch(item.reject).finally(() => {
740
- this.pending = !1, this.dequeue();
741
- }), !0) : !1;
742
- }
743
- };
744
- //#endregion
745
- //#region src/module-runner/hmrHandler.ts
746
- function createHMRHandlerForRunner(runner) {
747
- return createHMRHandler(async (payload) => {
748
- let hmrClient = runner.hmrClient;
749
- if (!(!hmrClient || runner.isClosed())) switch (payload.type) {
750
- case "connected":
751
- hmrClient.logger.debug("connected.");
752
- break;
753
- case "update":
754
- await hmrClient.notifyListeners("vite:beforeUpdate", payload), await Promise.all(payload.updates.map(async (update) => {
755
- if (update.type === "js-update") return update.acceptedPath = unwrapId(update.acceptedPath), update.path = unwrapId(update.path), hmrClient.queueUpdate(update);
756
- hmrClient.logger.error("css hmr is not supported in runner mode.");
757
- })), await hmrClient.notifyListeners("vite:afterUpdate", payload);
758
- break;
759
- case "custom":
760
- await hmrClient.notifyListeners(payload.event, payload.data);
761
- break;
762
- case "full-reload": {
763
- let { triggeredBy } = payload, clearEntrypointUrls = triggeredBy ? getModulesEntrypoints(runner, getModulesByFile(runner, slash(triggeredBy))) : findAllEntrypoints(runner);
764
- if (!clearEntrypointUrls.size) break;
765
- hmrClient.logger.debug("program reload"), await hmrClient.notifyListeners("vite:beforeFullReload", payload), runner.evaluatedModules.clear();
766
- for (let url of clearEntrypointUrls) {
767
- if (runner.isClosed()) break;
768
- try {
769
- await runner.import(url);
770
- } catch (err) {
771
- if (runner.isClosed()) break;
772
- err.code !== "ERR_OUTDATED_OPTIMIZED_DEP" && hmrClient.logger.error(`An error happened during full reload\n${err.message}\n${err.stack}`);
773
- }
774
- }
775
- break;
776
- }
777
- case "prune":
778
- await hmrClient.notifyListeners("vite:beforePrune", payload), await hmrClient.prunePaths(payload.paths);
779
- break;
780
- case "error": {
781
- await hmrClient.notifyListeners("vite:error", payload);
782
- let err = payload.err;
783
- hmrClient.logger.error(`Internal Server Error\n${err.message}\n${err.stack}`);
784
- break;
785
- }
786
- case "ping": break;
787
- default: return payload;
788
- }
789
- });
790
- }
791
- function getModulesByFile(runner, file) {
792
- let nodes = runner.evaluatedModules.getModulesByFile(file);
793
- return nodes ? [...nodes].map((node) => node.id) : [];
794
- }
795
- function getModulesEntrypoints(runner, modules, visited = /* @__PURE__ */ new Set(), entrypoints = /* @__PURE__ */ new Set()) {
796
- for (let moduleId of modules) {
797
- if (visited.has(moduleId)) continue;
798
- visited.add(moduleId);
799
- let module = runner.evaluatedModules.getModuleById(moduleId);
800
- if (module) {
801
- if (!module.importers.size) {
802
- entrypoints.add(module.url);
803
- continue;
804
- }
805
- for (let importer of module.importers) getModulesEntrypoints(runner, [importer], visited, entrypoints);
806
- }
807
- }
808
- return entrypoints;
809
- }
810
- function findAllEntrypoints(runner, entrypoints = /* @__PURE__ */ new Set()) {
811
- for (let mod of runner.evaluatedModules.idToModuleMap.values()) mod.importers.size || entrypoints.add(mod.url);
812
- return entrypoints;
813
- }
814
- //#endregion
815
- //#region src/module-runner/sourcemap/interceptor.ts
816
- const sourceMapCache = {}, fileContentsCache = {}, evaluatedModulesCache = /* @__PURE__ */ new Set(), retrieveFileHandlers = /* @__PURE__ */ new Set(), retrieveSourceMapHandlers = /* @__PURE__ */ new Set(), createExecHandlers = (handlers) => ((...args) => {
817
- for (let handler of handlers) {
818
- let result = handler(...args);
819
- if (result) return result;
820
- }
821
- return null;
822
- }), retrieveFileFromHandlers = createExecHandlers(retrieveFileHandlers), retrieveSourceMapFromHandlers = createExecHandlers(retrieveSourceMapHandlers);
823
- let overridden = !1;
824
- const originalPrepare = Error.prepareStackTrace;
825
- function resetInterceptor(runner, options) {
826
- evaluatedModulesCache.delete(runner.evaluatedModules), options.retrieveFile && retrieveFileHandlers.delete(options.retrieveFile), options.retrieveSourceMap && retrieveSourceMapHandlers.delete(options.retrieveSourceMap), evaluatedModulesCache.size === 0 && (Error.prepareStackTrace = originalPrepare, overridden = !1);
827
- }
828
- function interceptStackTrace(runner, options = {}) {
829
- return overridden ||= (Error.prepareStackTrace = prepareStackTrace, !0), evaluatedModulesCache.add(runner.evaluatedModules), options.retrieveFile && retrieveFileHandlers.add(options.retrieveFile), options.retrieveSourceMap && retrieveSourceMapHandlers.add(options.retrieveSourceMap), () => resetInterceptor(runner, options);
830
- }
831
- function supportRelativeURL(file, url) {
832
- if (!file) return url;
833
- let dir = posixDirname(slash(file)), match = /^\w+:\/\/[^/]*/.exec(dir), protocol = match ? match[0] : "", startPath = dir.slice(protocol.length);
834
- return protocol && /^\/\w:/.test(startPath) ? (protocol += "/", protocol + slash(posixResolve(startPath, url))) : protocol + posixResolve(startPath, url);
835
- }
836
- function getRunnerSourceMap(position) {
837
- for (let moduleGraph of evaluatedModulesCache) {
838
- let sourceMap = moduleGraph.getModuleSourceMapById(position.source);
839
- if (sourceMap) return {
840
- url: position.source,
841
- map: sourceMap,
842
- vite: !0
843
- };
844
- }
845
- return null;
846
- }
847
- function retrieveFile(path) {
848
- if (path in fileContentsCache) return fileContentsCache[path];
849
- let content = retrieveFileFromHandlers(path);
850
- return typeof content == "string" ? (fileContentsCache[path] = content, content) : null;
851
- }
852
- function retrieveSourceMapURL(source) {
853
- let fileData = retrieveFile(source);
854
- if (!fileData) return null;
855
- let re = /\/\/[@#]\s*sourceMappingURL=([^\s'"]+)\s*$|\/\*[@#]\s*sourceMappingURL=[^\s*'"]+\s*\*\/\s*$/gm, lastMatch, match;
856
- for (; match = re.exec(fileData);) lastMatch = match;
857
- return lastMatch ? lastMatch[1] : null;
858
- }
859
- const reSourceMap = /^data:application\/json[^,]+base64,/;
860
- function retrieveSourceMap(source) {
861
- let urlAndMap = retrieveSourceMapFromHandlers(source);
862
- if (urlAndMap) return urlAndMap;
863
- let sourceMappingURL = retrieveSourceMapURL(source);
864
- if (!sourceMappingURL) return null;
865
- let sourceMapData;
866
- if (reSourceMap.test(sourceMappingURL)) {
867
- let rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(",") + 1);
868
- sourceMapData = Buffer.from(rawData, "base64").toString(), sourceMappingURL = source;
869
- } else sourceMappingURL = supportRelativeURL(source, sourceMappingURL), sourceMapData = retrieveFile(sourceMappingURL);
870
- return sourceMapData ? {
871
- url: sourceMappingURL,
872
- map: sourceMapData
873
- } : null;
874
- }
875
- function mapSourcePosition(position) {
876
- if (!position.source) return position;
877
- let sourceMap = getRunnerSourceMap(position);
878
- if (sourceMap ||= sourceMapCache[position.source], !sourceMap) {
879
- let urlAndMap = retrieveSourceMap(position.source);
880
- if (urlAndMap && urlAndMap.map) {
881
- let url = urlAndMap.url;
882
- sourceMap = sourceMapCache[position.source] = {
883
- url,
884
- map: new DecodedMap(typeof urlAndMap.map == "string" ? JSON.parse(urlAndMap.map) : urlAndMap.map, url)
885
- };
886
- let contents = sourceMap.map?.map.sourcesContent;
887
- sourceMap.map && contents && sourceMap.map.resolvedSources.forEach((source, i) => {
888
- let content = contents[i];
889
- if (content && source && url) {
890
- let contentUrl = supportRelativeURL(url, source);
891
- fileContentsCache[contentUrl] = content;
892
- }
893
- });
894
- } else sourceMap = sourceMapCache[position.source] = {
895
- url: null,
896
- map: null
897
- };
898
- }
899
- if (sourceMap.map && sourceMap.url) {
900
- let originalPosition = getOriginalPosition(sourceMap.map, position);
901
- if (originalPosition && originalPosition.source != null) return originalPosition.source = supportRelativeURL(sourceMap.url, originalPosition.source), sourceMap.vite && (originalPosition._vite = !0), originalPosition;
902
- }
903
- return position;
904
- }
905
- function mapEvalOrigin(origin) {
906
- let match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin);
907
- if (match) {
908
- let position = mapSourcePosition({
909
- name: null,
910
- source: match[2],
911
- line: +match[3],
912
- column: match[4] - 1
913
- });
914
- return `eval at ${match[1]} (${position.source}:${position.line}:${position.column + 1})`;
915
- }
916
- return match = /^eval at ([^(]+) \((.+)\)$/.exec(origin), match ? `eval at ${match[1]} (${mapEvalOrigin(match[2])})` : origin;
917
- }
918
- function CallSiteToString() {
919
- let fileName, fileLocation = "";
920
- if (this.isNative()) fileLocation = "native";
921
- else {
922
- fileName = this.getScriptNameOrSourceURL(), !fileName && this.isEval() && (fileLocation = this.getEvalOrigin(), fileLocation += ", "), fileName ? fileLocation += fileName : fileLocation += "<anonymous>";
923
- let lineNumber = this.getLineNumber();
924
- if (lineNumber != null) {
925
- fileLocation += `:${lineNumber}`;
926
- let columnNumber = this.getColumnNumber();
927
- columnNumber && (fileLocation += `:${columnNumber}`);
928
- }
929
- }
930
- let line = "", functionName = this.getFunctionName(), addSuffix = !0, isConstructor = this.isConstructor();
931
- if (this.isToplevel() || isConstructor) isConstructor ? line += `new ${functionName || "<anonymous>"}` : functionName ? line += functionName : (line += fileLocation, addSuffix = !1);
932
- else {
933
- let typeName = this.getTypeName();
934
- typeName === "[object Object]" && (typeName = "null");
935
- let methodName = this.getMethodName();
936
- functionName ? (typeName && functionName.indexOf(typeName) !== 0 && (line += `${typeName}.`), line += functionName, methodName && functionName.indexOf(`.${methodName}`) !== functionName.length - methodName.length - 1 && (line += ` [as ${methodName}]`)) : line += `${typeName}.${methodName || "<anonymous>"}`;
937
- }
938
- return addSuffix && (line += ` (${fileLocation})`), line;
939
- }
940
- function cloneCallSite(frame) {
941
- let object = {};
942
- return Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach((name) => {
943
- let key = name;
944
- object[key] = /^(?:is|get)/.test(name) ? function() {
945
- return frame[key].call(frame);
946
- } : frame[key];
947
- }), object.toString = CallSiteToString, object;
948
- }
949
- function wrapCallSite(frame, state) {
950
- if (state === void 0 && (state = {
951
- nextPosition: null,
952
- curPosition: null
953
- }), frame.isNative()) return state.curPosition = null, frame;
954
- let source = frame.getFileName() || frame.getScriptNameOrSourceURL();
955
- if (source) {
956
- let position = mapSourcePosition({
957
- name: null,
958
- source,
959
- line: frame.getLineNumber() ?? 0,
960
- column: (frame.getColumnNumber() ?? 1) - 1
961
- });
962
- state.curPosition = position, frame = cloneCallSite(frame);
963
- let originalFunctionName = frame.getFunctionName;
964
- return frame.getFunctionName = function() {
965
- let name = state.nextPosition == null ? originalFunctionName() : state.nextPosition.name || originalFunctionName();
966
- return name === "eval" && "_vite" in position ? null : name;
967
- }, frame.getFileName = function() {
968
- return position.source ?? null;
969
- }, frame.getLineNumber = function() {
970
- return position.line;
971
- }, frame.getColumnNumber = function() {
972
- return position.column + 1;
973
- }, frame.getScriptNameOrSourceURL = function() {
974
- return position.source;
975
- }, frame;
976
- }
977
- let origin = frame.isEval() && frame.getEvalOrigin();
978
- return origin ? (origin = mapEvalOrigin(origin), frame = cloneCallSite(frame), frame.getEvalOrigin = function() {
979
- return origin || void 0;
980
- }, frame) : frame;
981
- }
982
- function prepareStackTrace(error, stack) {
983
- let errorString = `${error.name || "Error"}: ${error.message || ""}`, state = {
984
- nextPosition: null,
985
- curPosition: null
986
- }, processedStack = [];
987
- for (let i = stack.length - 1; i >= 0; i--) processedStack.push(`\n at ${wrapCallSite(stack[i], state)}`), state.nextPosition = state.curPosition;
988
- return state.curPosition = state.nextPosition = null, errorString + processedStack.reverse().join("");
989
- }
990
- //#endregion
991
- //#region src/module-runner/sourcemap/index.ts
992
- function enableSourceMapSupport(runner) {
993
- if (runner.options.sourcemapInterceptor === "node") {
994
- if (typeof process > "u") throw TypeError("Cannot use \"sourcemapInterceptor: 'node'\" because global \"process\" variable is not available.");
995
- if (typeof process.setSourceMapsEnabled != "function") throw TypeError("Cannot use \"sourcemapInterceptor: 'node'\" because \"process.setSourceMapsEnabled\" function is not available. Please use Node >= 16.6.0.");
996
- let isEnabledAlready = process.sourceMapsEnabled ?? !1;
997
- return process.setSourceMapsEnabled(!0), () => !isEnabledAlready && process.setSourceMapsEnabled(!1);
998
- }
999
- return interceptStackTrace(runner, typeof runner.options.sourcemapInterceptor == "object" ? runner.options.sourcemapInterceptor : void 0);
1000
- }
1001
- //#endregion
1002
- //#region src/module-runner/esmEvaluator.ts
1003
- var ESModulesEvaluator = class {
1004
- startOffset = getAsyncFunctionDeclarationPaddingLineCount() + 1;
1005
- async runInlinedModule(context, code) {
1006
- await new AsyncFunction(ssrModuleExportsKey, ssrImportMetaKey, ssrImportKey, ssrDynamicImportKey, ssrExportAllKey, ssrExportNameKey, "\"use strict\";\n" + code)(context[ssrModuleExportsKey], context[ssrImportMetaKey], context[ssrImportKey], context[ssrDynamicImportKey], context[ssrExportAllKey], context[ssrExportNameKey]), Object.seal(context[ssrModuleExportsKey]);
1007
- }
1008
- runExternalModule(filepath) {
1009
- return import(filepath);
1010
- }
1011
- };
1012
- //#endregion
1013
- //#region src/module-runner/importMetaResolver.ts
1014
- const customizationHookNamespace = "vite-module-runner:import-meta-resolve/v1/", customizationHooksModule = `
1015
-
1016
- export async function resolve(specifier, context, nextResolve) {
1017
- if (specifier.startsWith(${JSON.stringify(customizationHookNamespace)})) {
1018
- const data = specifier.slice(${JSON.stringify(customizationHookNamespace)}.length)
1019
- const [parsedSpecifier, parsedImporter] = JSON.parse(data)
1020
- specifier = parsedSpecifier
1021
- context.parentURL = parsedImporter
1022
- }
1023
- return nextResolve(specifier, context)
1024
- }
1025
-
1026
- `;
1027
- function customizationHookResolve(specifier, context, nextResolve) {
1028
- if (specifier.startsWith(customizationHookNamespace)) {
1029
- let data = specifier.slice(42), [parsedSpecifier, parsedImporter] = JSON.parse(data);
1030
- specifier = parsedSpecifier, context.parentURL = parsedImporter;
1031
- }
1032
- return nextResolve(specifier, context);
1033
- }
1034
- let isHookRegistered = !1;
1035
- function createImportMetaResolver() {
1036
- if (isHookRegistered) return importMetaResolveWithCustomHook;
1037
- let module;
1038
- try {
1039
- module = typeof process < "u" ? process.getBuiltinModule("node:module").Module : void 0;
1040
- } catch {
1041
- return;
1042
- }
1043
- if (module) {
1044
- if (module.registerHooks) return module.registerHooks({ resolve: customizationHookResolve }), isHookRegistered = !0, importMetaResolveWithCustomHook;
1045
- if (module.register) {
1046
- try {
1047
- let hookModuleContent = `data:text/javascript,${encodeURI(customizationHooksModule)}`;
1048
- module.register(hookModuleContent);
1049
- } catch (e) {
1050
- if ("code" in e && e.code === "ERR_NETWORK_IMPORT_DISALLOWED") return;
1051
- throw e;
1052
- }
1053
- return isHookRegistered = !0, importMetaResolveWithCustomHook;
1054
- }
1055
- }
1056
- }
1057
- function importMetaResolveWithCustomHook(specifier, importer) {
1058
- return import.meta.resolve(`${customizationHookNamespace}${JSON.stringify([specifier, importer])}`);
1059
- }
1060
- //#endregion
1061
- //#region src/module-runner/createImportMeta.ts
1062
- const envProxy = new Proxy({}, { get(_, p) {
1063
- throw Error(`[module runner] Dynamic access of "import.meta.env" is not supported. Please, use "import.meta.env.${String(p)}" instead.`);
1064
- } });
1065
- function createDefaultImportMeta(modulePath) {
1066
- let href = posixPathToFileHref(modulePath), filename = modulePath, dirname = posixDirname(modulePath);
1067
- return {
1068
- filename: isWindows ? toWindowsPath(filename) : filename,
1069
- dirname: isWindows ? toWindowsPath(dirname) : dirname,
1070
- url: href,
1071
- env: envProxy,
1072
- resolve(_id, _parent) {
1073
- throw Error("[module runner] \"import.meta.resolve\" is not supported.");
1074
- },
1075
- glob() {
1076
- throw Error("[module runner] \"import.meta.glob\" is statically replaced during file transformation. Make sure to reference it by the full name.");
1077
- }
1078
- };
1079
- }
1080
- /**
1081
- * Create import.meta object for Node.js.
1082
- */
1083
- function createNodeImportMeta(modulePath) {
1084
- let defaultMeta = createDefaultImportMeta(modulePath), href = defaultMeta.url, importMetaResolver = createImportMetaResolver();
1085
- return {
1086
- ...defaultMeta,
1087
- main: !1,
1088
- resolve(id, parent) {
1089
- return (importMetaResolver ?? defaultMeta.resolve)(id, parent ?? href);
1090
- }
1091
- };
1092
- }
1093
- //#endregion
1094
- //#region src/module-runner/runner.ts
1095
- var ModuleRunner = class {
1096
- options;
1097
- evaluator;
1098
- debug;
1099
- evaluatedModules;
1100
- hmrClient;
1101
- transport;
1102
- resetSourceMapSupport;
1103
- concurrentModuleNodePromises = /* @__PURE__ */ new Map();
1104
- isBuiltin;
1105
- builtinsPromise;
1106
- closed = !1;
1107
- constructor(options, evaluator = new ESModulesEvaluator(), debug) {
1108
- if (this.options = options, this.evaluator = evaluator, this.debug = debug, this.evaluatedModules = options.evaluatedModules ?? new EvaluatedModules(), this.transport = normalizeModuleRunnerTransport(options.transport), options.hmr !== !1) {
1109
- let optionsHmr = options.hmr ?? !0, resolvedHmrLogger = optionsHmr === !0 || optionsHmr.logger === void 0 ? hmrLogger : optionsHmr.logger === !1 ? silentConsole : optionsHmr.logger;
1110
- if (this.hmrClient = new HMRClient(resolvedHmrLogger, this.transport, ({ acceptedPath }) => this.import(acceptedPath)), !this.transport.connect) throw Error("HMR is not supported by this runner transport, but `hmr` option was set to true");
1111
- this.transport.connect(createHMRHandlerForRunner(this));
1112
- } else this.transport.connect?.();
1113
- options.sourcemapInterceptor !== !1 && (this.resetSourceMapSupport = enableSourceMapSupport(this));
1114
- }
1115
- /**
1116
- * URL to execute. Accepts file path, server path or id relative to the root.
1117
- */
1118
- async import(url) {
1119
- let fetchedModule = await this.cachedModule(url);
1120
- return await this.cachedRequest(url, fetchedModule);
1121
- }
1122
- /**
1123
- * Clear all caches including HMR listeners.
1124
- */
1125
- clearCache() {
1126
- this.evaluatedModules.clear(), this.hmrClient?.clear();
1127
- }
1128
- /**
1129
- * Clears all caches, removes all HMR listeners, and resets source map support.
1130
- * This method doesn't stop the HMR connection.
1131
- */
1132
- async close() {
1133
- this.resetSourceMapSupport?.(), this.clearCache(), this.hmrClient = void 0, this.closed = !0, await this.transport.disconnect?.();
1134
- }
1135
- /**
1136
- * Returns `true` if the runtime has been closed by calling `close()` method.
1137
- */
1138
- isClosed() {
1139
- return this.closed;
1140
- }
1141
- processImport(exports, fetchResult, metadata) {
1142
- if (!("externalize" in fetchResult)) return exports;
1143
- let { url, type } = fetchResult;
1144
- return type !== "module" && type !== "commonjs" || analyzeImportedModDifference(exports, url, type, metadata), exports;
1145
- }
1146
- isCircularRequest(mod, callstack, visited = /* @__PURE__ */ new Set()) {
1147
- if (visited.has(mod.id)) return !1;
1148
- visited.add(mod.id);
1149
- for (let importedModuleId of mod.imports) {
1150
- if (callstack.includes(importedModuleId)) return !0;
1151
- let importedModule = this.evaluatedModules.getModuleById(importedModuleId);
1152
- if (importedModule?.promise && !importedModule.evaluated && this.isCircularRequest(importedModule, callstack, visited)) return !0;
1153
- }
1154
- return !1;
1155
- }
1156
- async cachedRequest(url, mod, callstack = [], metadata) {
1157
- let meta = mod.meta, moduleId = meta.id, importee = callstack[callstack.length - 1];
1158
- if (importee && mod.importers.add(importee), mod.evaluated && mod.promise) return this.processImport(await mod.promise, meta, metadata);
1159
- if (mod.promise) return mod.exports && (callstack.includes(moduleId) || this.isCircularRequest(mod, callstack)) ? this.processImport(mod.exports, meta, metadata) : this.processImport(await mod.promise, meta, metadata);
1160
- let debugTimer;
1161
- this.debug && (debugTimer = setTimeout(() => {
1162
- this.debug(`[module runner] module ${moduleId} takes over 2s to load.\n${`stack:\n${[...callstack, moduleId].reverse().map((p) => ` - ${p}`).join("\n")}`}`);
1163
- }, 2e3));
1164
- try {
1165
- let promise = this.directRequest(url, mod, callstack);
1166
- return mod.promise = promise, mod.evaluated = !1, this.processImport(await promise, meta, metadata);
1167
- } finally {
1168
- mod.evaluated = !0, debugTimer && clearTimeout(debugTimer);
1169
- }
1170
- }
1171
- async cachedModule(url, importer) {
1172
- let cached = this.concurrentModuleNodePromises.get(url);
1173
- if (cached) this.debug?.("[module runner] using cached module info for", url);
1174
- else {
1175
- let cachedModule = this.evaluatedModules.getModuleByUrl(url);
1176
- cached = this.getModuleInformation(url, importer, cachedModule).finally(() => {
1177
- this.concurrentModuleNodePromises.delete(url);
1178
- }), this.concurrentModuleNodePromises.set(url, cached);
1179
- }
1180
- return cached;
1181
- }
1182
- ensureBuiltins() {
1183
- if (!this.isBuiltin) return this.builtinsPromise ??= (async () => {
1184
- try {
1185
- this.debug?.("[module runner] fetching builtins from server");
1186
- let builtins = (await this.transport.invoke("getBuiltins", [])).map((builtin) => typeof builtin == "object" && builtin && "type" in builtin ? builtin.type === "string" ? builtin.value : new RegExp(builtin.source, builtin.flags) : builtin);
1187
- this.isBuiltin = createIsBuiltin(builtins), this.debug?.("[module runner] builtins loaded:", builtins);
1188
- } finally {
1189
- this.builtinsPromise = void 0;
1190
- }
1191
- })(), this.builtinsPromise;
1192
- }
1193
- async getModuleInformation(url, importer, cachedModule) {
1194
- if (this.closed) throw Error("Vite module runner has been closed.");
1195
- await this.ensureBuiltins(), this.debug?.("[module runner] fetching", url);
1196
- let isCached = !!(typeof cachedModule == "object" && cachedModule.meta), fetchedModule = url.startsWith("data:") || this.isBuiltin?.(url) ? {
1197
- externalize: url,
1198
- type: "builtin"
1199
- } : await this.transport.invoke("fetchModule", [
1200
- url,
1201
- importer,
1202
- {
1203
- cached: isCached,
1204
- startOffset: this.evaluator.startOffset
1205
- }
1206
- ]);
1207
- if ("cache" in fetchedModule) {
1208
- if (!cachedModule || !cachedModule.meta) throw Error(`Module "${url}" was mistakenly invalidated during fetch phase.`);
1209
- return cachedModule;
1210
- }
1211
- let moduleId = "externalize" in fetchedModule ? fetchedModule.externalize : fetchedModule.id, moduleUrl = "url" in fetchedModule ? fetchedModule.url : url, module = this.evaluatedModules.ensureModule(moduleId, moduleUrl);
1212
- return "invalidate" in fetchedModule && fetchedModule.invalidate && this.evaluatedModules.invalidateModule(module), fetchedModule.url = moduleUrl, fetchedModule.id = moduleId, module.meta = fetchedModule, module;
1213
- }
1214
- async directRequest(url, mod, _callstack) {
1215
- let fetchResult = mod.meta, moduleId = fetchResult.id, callstack = [..._callstack, moduleId], request = async (dep, metadata) => {
1216
- let importer = "file" in fetchResult && fetchResult.file || moduleId, depMod = await this.cachedModule(dep, importer);
1217
- return depMod.importers.add(moduleId), mod.imports.add(depMod.id), this.cachedRequest(dep, depMod, callstack, metadata);
1218
- }, dynamicRequest = async (dep) => (dep = String(dep), dep[0] === "." && (dep = posixResolve(posixDirname(url), dep)), request(dep, { isDynamicImport: !0 }));
1219
- if ("externalize" in fetchResult) {
1220
- let { externalize } = fetchResult;
1221
- this.debug?.("[module runner] externalizing", externalize);
1222
- let exports = await this.evaluator.runExternalModule(externalize);
1223
- return mod.exports = exports, exports;
1224
- }
1225
- let { code, file } = fetchResult;
1226
- if (code == null) {
1227
- let importer = callstack[callstack.length - 2];
1228
- throw Error(`[module runner] Failed to load "${url}"${importer ? ` imported from ${importer}` : ""}`);
1229
- }
1230
- let createImportMeta = this.options.createImportMeta ?? createDefaultImportMeta, modulePath = cleanUrl(file || moduleId), href = posixPathToFileHref(modulePath), meta = await createImportMeta(modulePath), exports = Object.create(null);
1231
- Object.defineProperty(exports, Symbol.toStringTag, {
1232
- value: "Module",
1233
- enumerable: !1,
1234
- configurable: !1
1235
- }), mod.exports = exports;
1236
- let hotContext;
1237
- this.hmrClient && Object.defineProperty(meta, "hot", {
1238
- enumerable: !0,
1239
- get: () => {
1240
- if (!this.hmrClient) throw Error("[module runner] HMR client was closed.");
1241
- return this.debug?.("[module runner] creating hmr context for", mod.url), hotContext ||= new HMRContext(this.hmrClient, mod.url), hotContext;
1242
- },
1243
- set: (value) => {
1244
- hotContext = value;
1245
- }
1246
- });
1247
- let context = {
1248
- [ssrImportKey]: request,
1249
- [ssrDynamicImportKey]: dynamicRequest,
1250
- [ssrModuleExportsKey]: exports,
1251
- [ssrExportAllKey]: (obj) => exportAll(exports, obj),
1252
- [ssrExportNameKey]: (name, getter) => Object.defineProperty(exports, name, {
1253
- enumerable: !0,
1254
- configurable: !0,
1255
- get: getter
1256
- }),
1257
- [ssrImportMetaKey]: meta
1258
- };
1259
- return this.debug?.("[module runner] executing", href), await this.evaluator.runInlinedModule(context, code, mod), exports;
1260
- }
1261
- };
1262
- function exportAll(exports, sourceModule) {
1263
- if (exports !== sourceModule && !(isPrimitive(sourceModule) || Array.isArray(sourceModule) || sourceModule instanceof Promise)) {
1264
- for (let key in sourceModule) if (key !== "default" && key !== "__esModule" && !(key in exports)) try {
1265
- Object.defineProperty(exports, key, {
1266
- enumerable: !0,
1267
- configurable: !0,
1268
- get: () => sourceModule[key]
1269
- });
1270
- } catch {}
1271
- }
1272
- }
1273
- //#endregion
1274
- export { ESModulesEvaluator, EvaluatedModules, ModuleRunner, createDefaultImportMeta, createNodeImportMeta, createWebSocketModuleRunnerTransport, normalizeModuleId, ssrDynamicImportKey, ssrExportAllKey, ssrExportNameKey, ssrImportKey, ssrImportMetaKey, ssrModuleExportsKey };