create-nuclo 0.1.1 → 0.3.35

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 (531) hide show
  1. package/README.md +5 -6
  2. package/package.json +3 -3
  3. package/src/create-nuclo.mjs +49 -169
  4. package/templates/basic/index.html +2 -14
  5. package/templates/basic/package.json +3 -3
  6. package/templates/basic/public/favicon.ico +0 -0
  7. package/templates/basic/public/nuclo-logo.svg +1 -24
  8. package/templates/basic/src/app.ts +33 -27
  9. package/templates/basic/src/main.ts +2 -3
  10. package/templates/basic/src/styles.ts +124 -72
  11. package/templates/basic/node_modules/.package-lock.json +0 -348
  12. package/templates/basic/node_modules/.vite/deps/_metadata.json +0 -15
  13. package/templates/basic/node_modules/.vite/deps/nuclo.js +0 -1665
  14. package/templates/basic/node_modules/.vite/deps/nuclo.js.map +0 -1
  15. package/templates/basic/node_modules/.vite/deps/package.json +0 -3
  16. package/templates/basic/node_modules/@oxc-project/types/LICENSE +0 -22
  17. package/templates/basic/node_modules/@oxc-project/types/README.md +0 -3
  18. package/templates/basic/node_modules/@oxc-project/types/package.json +0 -26
  19. package/templates/basic/node_modules/@oxc-project/types/types.d.ts +0 -1912
  20. package/templates/basic/node_modules/@rolldown/binding-darwin-arm64/README.md +0 -3
  21. package/templates/basic/node_modules/@rolldown/binding-darwin-arm64/package.json +0 -37
  22. package/templates/basic/node_modules/@rolldown/binding-darwin-arm64/rolldown-binding.darwin-arm64.node +0 -0
  23. package/templates/basic/node_modules/@rolldown/pluginutils/LICENSE +0 -21
  24. package/templates/basic/node_modules/@rolldown/pluginutils/README.md +0 -145
  25. package/templates/basic/node_modules/@rolldown/pluginutils/dist/filter/index.d.mts +0 -194
  26. package/templates/basic/node_modules/@rolldown/pluginutils/dist/filter/index.mjs +0 -2
  27. package/templates/basic/node_modules/@rolldown/pluginutils/dist/filter-B_mD-HGz.mjs +0 -323
  28. package/templates/basic/node_modules/@rolldown/pluginutils/dist/index.d.mts +0 -2
  29. package/templates/basic/node_modules/@rolldown/pluginutils/dist/index.mjs +0 -2
  30. package/templates/basic/node_modules/@rolldown/pluginutils/package.json +0 -40
  31. package/templates/basic/node_modules/detect-libc/LICENSE +0 -201
  32. package/templates/basic/node_modules/detect-libc/README.md +0 -163
  33. package/templates/basic/node_modules/detect-libc/index.d.ts +0 -14
  34. package/templates/basic/node_modules/detect-libc/lib/detect-libc.js +0 -313
  35. package/templates/basic/node_modules/detect-libc/lib/elf.js +0 -39
  36. package/templates/basic/node_modules/detect-libc/lib/filesystem.js +0 -51
  37. package/templates/basic/node_modules/detect-libc/lib/process.js +0 -24
  38. package/templates/basic/node_modules/detect-libc/package.json +0 -44
  39. package/templates/basic/node_modules/fdir/LICENSE +0 -7
  40. package/templates/basic/node_modules/fdir/README.md +0 -91
  41. package/templates/basic/node_modules/fdir/dist/index.cjs +0 -588
  42. package/templates/basic/node_modules/fdir/dist/index.d.cts +0 -155
  43. package/templates/basic/node_modules/fdir/dist/index.d.mts +0 -155
  44. package/templates/basic/node_modules/fdir/dist/index.mjs +0 -570
  45. package/templates/basic/node_modules/fdir/package.json +0 -103
  46. package/templates/basic/node_modules/lightningcss/LICENSE +0 -373
  47. package/templates/basic/node_modules/lightningcss/README.md +0 -105
  48. package/templates/basic/node_modules/lightningcss/node/ast.d.ts +0 -9892
  49. package/templates/basic/node_modules/lightningcss/node/ast.js.flow +0 -10539
  50. package/templates/basic/node_modules/lightningcss/node/browserslistToTargets.js +0 -48
  51. package/templates/basic/node_modules/lightningcss/node/composeVisitors.js +0 -450
  52. package/templates/basic/node_modules/lightningcss/node/flags.js +0 -28
  53. package/templates/basic/node_modules/lightningcss/node/index.d.ts +0 -494
  54. package/templates/basic/node_modules/lightningcss/node/index.js +0 -59
  55. package/templates/basic/node_modules/lightningcss/node/index.js.flow +0 -843
  56. package/templates/basic/node_modules/lightningcss/node/index.mjs +0 -4
  57. package/templates/basic/node_modules/lightningcss/node/targets.d.ts +0 -40
  58. package/templates/basic/node_modules/lightningcss/node/targets.js.flow +0 -39
  59. package/templates/basic/node_modules/lightningcss/package.json +0 -110
  60. package/templates/basic/node_modules/lightningcss-darwin-arm64/LICENSE +0 -373
  61. package/templates/basic/node_modules/lightningcss-darwin-arm64/README.md +0 -1
  62. package/templates/basic/node_modules/lightningcss-darwin-arm64/lightningcss.darwin-arm64.node +0 -0
  63. package/templates/basic/node_modules/lightningcss-darwin-arm64/package.json +0 -34
  64. package/templates/basic/node_modules/nanoid/LICENSE +0 -20
  65. package/templates/basic/node_modules/nanoid/README.md +0 -36
  66. package/templates/basic/node_modules/nanoid/async/index.browser.cjs +0 -42
  67. package/templates/basic/node_modules/nanoid/async/index.browser.js +0 -42
  68. package/templates/basic/node_modules/nanoid/async/index.cjs +0 -44
  69. package/templates/basic/node_modules/nanoid/async/index.d.ts +0 -56
  70. package/templates/basic/node_modules/nanoid/async/index.js +0 -44
  71. package/templates/basic/node_modules/nanoid/async/index.native.js +0 -35
  72. package/templates/basic/node_modules/nanoid/async/package.json +0 -12
  73. package/templates/basic/node_modules/nanoid/bin/nanoid.cjs +0 -55
  74. package/templates/basic/node_modules/nanoid/index.browser.cjs +0 -44
  75. package/templates/basic/node_modules/nanoid/index.browser.js +0 -44
  76. package/templates/basic/node_modules/nanoid/index.cjs +0 -57
  77. package/templates/basic/node_modules/nanoid/index.d.cts +0 -91
  78. package/templates/basic/node_modules/nanoid/index.d.ts +0 -91
  79. package/templates/basic/node_modules/nanoid/index.js +0 -62
  80. package/templates/basic/node_modules/nanoid/nanoid.js +0 -1
  81. package/templates/basic/node_modules/nanoid/non-secure/index.cjs +0 -24
  82. package/templates/basic/node_modules/nanoid/non-secure/index.d.ts +0 -33
  83. package/templates/basic/node_modules/nanoid/non-secure/index.js +0 -24
  84. package/templates/basic/node_modules/nanoid/non-secure/package.json +0 -6
  85. package/templates/basic/node_modules/nanoid/package.json +0 -89
  86. package/templates/basic/node_modules/nanoid/url-alphabet/index.cjs +0 -4
  87. package/templates/basic/node_modules/nanoid/url-alphabet/index.js +0 -4
  88. package/templates/basic/node_modules/nanoid/url-alphabet/package.json +0 -6
  89. package/templates/basic/node_modules/nuclo/LICENSE.md +0 -45
  90. package/templates/basic/node_modules/nuclo/README.md +0 -727
  91. package/templates/basic/node_modules/nuclo/dist/bootstrap.d.ts +0 -5
  92. package/templates/basic/node_modules/nuclo/dist/bootstrap.d.ts.map +0 -1
  93. package/templates/basic/node_modules/nuclo/dist/element/attributes.d.ts +0 -3
  94. package/templates/basic/node_modules/nuclo/dist/element/attributes.d.ts.map +0 -1
  95. package/templates/basic/node_modules/nuclo/dist/element/class-name.d.ts +0 -6
  96. package/templates/basic/node_modules/nuclo/dist/element/class-name.d.ts.map +0 -1
  97. package/templates/basic/node_modules/nuclo/dist/element/events.d.ts +0 -35
  98. package/templates/basic/node_modules/nuclo/dist/element/events.d.ts.map +0 -1
  99. package/templates/basic/node_modules/nuclo/dist/element/factory.d.ts +0 -32
  100. package/templates/basic/node_modules/nuclo/dist/element/factory.d.ts.map +0 -1
  101. package/templates/basic/node_modules/nuclo/dist/element/inline-style.d.ts +0 -9
  102. package/templates/basic/node_modules/nuclo/dist/element/inline-style.d.ts.map +0 -1
  103. package/templates/basic/node_modules/nuclo/dist/element/modifiers.d.ts +0 -11
  104. package/templates/basic/node_modules/nuclo/dist/element/modifiers.d.ts.map +0 -1
  105. package/templates/basic/node_modules/nuclo/dist/element/tags.d.ts +0 -5
  106. package/templates/basic/node_modules/nuclo/dist/element/tags.d.ts.map +0 -1
  107. package/templates/basic/node_modules/nuclo/dist/hydration.d.ts +0 -73
  108. package/templates/basic/node_modules/nuclo/dist/hydration.d.ts.map +0 -1
  109. package/templates/basic/node_modules/nuclo/dist/index.d.ts +0 -17
  110. package/templates/basic/node_modules/nuclo/dist/index.d.ts.map +0 -1
  111. package/templates/basic/node_modules/nuclo/dist/list/index.d.ts +0 -7
  112. package/templates/basic/node_modules/nuclo/dist/list/index.d.ts.map +0 -1
  113. package/templates/basic/node_modules/nuclo/dist/list/runtime.d.ts +0 -6
  114. package/templates/basic/node_modules/nuclo/dist/list/runtime.d.ts.map +0 -1
  115. package/templates/basic/node_modules/nuclo/dist/list/types.d.ts +0 -18
  116. package/templates/basic/node_modules/nuclo/dist/list/types.d.ts.map +0 -1
  117. package/templates/basic/node_modules/nuclo/dist/nuclo.cjs +0 -2
  118. package/templates/basic/node_modules/nuclo/dist/nuclo.cjs.map +0 -1
  119. package/templates/basic/node_modules/nuclo/dist/nuclo.mjs +0 -2
  120. package/templates/basic/node_modules/nuclo/dist/nuclo.mjs.map +0 -1
  121. package/templates/basic/node_modules/nuclo/dist/nuclo.umd.js +0 -2
  122. package/templates/basic/node_modules/nuclo/dist/nuclo.umd.js.map +0 -1
  123. package/templates/basic/node_modules/nuclo/dist/polyfill/Document.d.ts +0 -19
  124. package/templates/basic/node_modules/nuclo/dist/polyfill/Document.d.ts.map +0 -1
  125. package/templates/basic/node_modules/nuclo/dist/polyfill/Element.d.ts +0 -48
  126. package/templates/basic/node_modules/nuclo/dist/polyfill/Element.d.ts.map +0 -1
  127. package/templates/basic/node_modules/nuclo/dist/polyfill/Event.d.ts +0 -43
  128. package/templates/basic/node_modules/nuclo/dist/polyfill/Event.d.ts.map +0 -1
  129. package/templates/basic/node_modules/nuclo/dist/polyfill/Node.d.ts +0 -13
  130. package/templates/basic/node_modules/nuclo/dist/polyfill/Node.d.ts.map +0 -1
  131. package/templates/basic/node_modules/nuclo/dist/polyfill/Text.d.ts +0 -11
  132. package/templates/basic/node_modules/nuclo/dist/polyfill/Text.d.ts.map +0 -1
  133. package/templates/basic/node_modules/nuclo/dist/polyfill/index.d.ts +0 -24
  134. package/templates/basic/node_modules/nuclo/dist/polyfill/index.d.ts.map +0 -1
  135. package/templates/basic/node_modules/nuclo/dist/polyfill/nuclo.polyfill.cjs +0 -2
  136. package/templates/basic/node_modules/nuclo/dist/polyfill/nuclo.polyfill.cjs.map +0 -1
  137. package/templates/basic/node_modules/nuclo/dist/polyfill/nuclo.polyfill.mjs +0 -2
  138. package/templates/basic/node_modules/nuclo/dist/polyfill/nuclo.polyfill.mjs.map +0 -1
  139. package/templates/basic/node_modules/nuclo/dist/render.d.ts +0 -33
  140. package/templates/basic/node_modules/nuclo/dist/render.d.ts.map +0 -1
  141. package/templates/basic/node_modules/nuclo/dist/shared/conditions.d.ts +0 -4
  142. package/templates/basic/node_modules/nuclo/dist/shared/conditions.d.ts.map +0 -1
  143. package/templates/basic/node_modules/nuclo/dist/shared/dom.d.ts +0 -69
  144. package/templates/basic/node_modules/nuclo/dist/shared/dom.d.ts.map +0 -1
  145. package/templates/basic/node_modules/nuclo/dist/shared/environment.d.ts +0 -5
  146. package/templates/basic/node_modules/nuclo/dist/shared/environment.d.ts.map +0 -1
  147. package/templates/basic/node_modules/nuclo/dist/shared/errors.d.ts +0 -2
  148. package/templates/basic/node_modules/nuclo/dist/shared/errors.d.ts.map +0 -1
  149. package/templates/basic/node_modules/nuclo/dist/shared/renderables.d.ts +0 -4
  150. package/templates/basic/node_modules/nuclo/dist/shared/renderables.d.ts.map +0 -1
  151. package/templates/basic/node_modules/nuclo/dist/shared/strings.d.ts +0 -19
  152. package/templates/basic/node_modules/nuclo/dist/shared/strings.d.ts.map +0 -1
  153. package/templates/basic/node_modules/nuclo/dist/shared/type-guards.d.ts +0 -16
  154. package/templates/basic/node_modules/nuclo/dist/shared/type-guards.d.ts.map +0 -1
  155. package/templates/basic/node_modules/nuclo/dist/ssr/index.d.ts +0 -19
  156. package/templates/basic/node_modules/nuclo/dist/ssr/index.d.ts.map +0 -1
  157. package/templates/basic/node_modules/nuclo/dist/ssr/nuclo.ssr.cjs +0 -2
  158. package/templates/basic/node_modules/nuclo/dist/ssr/nuclo.ssr.cjs.map +0 -1
  159. package/templates/basic/node_modules/nuclo/dist/ssr/nuclo.ssr.mjs +0 -2
  160. package/templates/basic/node_modules/nuclo/dist/ssr/nuclo.ssr.mjs.map +0 -1
  161. package/templates/basic/node_modules/nuclo/dist/ssr/render-to-string.d.ts +0 -41
  162. package/templates/basic/node_modules/nuclo/dist/ssr/render-to-string.d.ts.map +0 -1
  163. package/templates/basic/node_modules/nuclo/dist/style/css.d.ts +0 -19
  164. package/templates/basic/node_modules/nuclo/dist/style/css.d.ts.map +0 -1
  165. package/templates/basic/node_modules/nuclo/dist/style/engine.d.ts +0 -34
  166. package/templates/basic/node_modules/nuclo/dist/style/engine.d.ts.map +0 -1
  167. package/templates/basic/node_modules/nuclo/dist/style/index.d.ts +0 -3
  168. package/templates/basic/node_modules/nuclo/dist/style/index.d.ts.map +0 -1
  169. package/templates/basic/node_modules/nuclo/dist/update/conditional.d.ts +0 -3
  170. package/templates/basic/node_modules/nuclo/dist/update/conditional.d.ts.map +0 -1
  171. package/templates/basic/node_modules/nuclo/dist/update/reactive-attributes.d.ts +0 -45
  172. package/templates/basic/node_modules/nuclo/dist/update/reactive-attributes.d.ts.map +0 -1
  173. package/templates/basic/node_modules/nuclo/dist/update/reactive-text.d.ts +0 -38
  174. package/templates/basic/node_modules/nuclo/dist/update/reactive-text.d.ts.map +0 -1
  175. package/templates/basic/node_modules/nuclo/dist/update/registry.d.ts +0 -97
  176. package/templates/basic/node_modules/nuclo/dist/update/registry.d.ts.map +0 -1
  177. package/templates/basic/node_modules/nuclo/dist/update/scope.d.ts +0 -7
  178. package/templates/basic/node_modules/nuclo/dist/update/scope.d.ts.map +0 -1
  179. package/templates/basic/node_modules/nuclo/dist/update/update.d.ts +0 -4
  180. package/templates/basic/node_modules/nuclo/dist/update/update.d.ts.map +0 -1
  181. package/templates/basic/node_modules/nuclo/dist/when/builder.d.ts +0 -16
  182. package/templates/basic/node_modules/nuclo/dist/when/builder.d.ts.map +0 -1
  183. package/templates/basic/node_modules/nuclo/dist/when/index.d.ts +0 -44
  184. package/templates/basic/node_modules/nuclo/dist/when/index.d.ts.map +0 -1
  185. package/templates/basic/node_modules/nuclo/dist/when/runtime.d.ts +0 -59
  186. package/templates/basic/node_modules/nuclo/dist/when/runtime.d.ts.map +0 -1
  187. package/templates/basic/node_modules/nuclo/package.json +0 -88
  188. package/templates/basic/node_modules/nuclo/types/core/base.d.ts +0 -113
  189. package/templates/basic/node_modules/nuclo/types/features/list.d.ts +0 -38
  190. package/templates/basic/node_modules/nuclo/types/features/on.d.ts +0 -59
  191. package/templates/basic/node_modules/nuclo/types/features/render.d.ts +0 -49
  192. package/templates/basic/node_modules/nuclo/types/features/scope.d.ts +0 -6
  193. package/templates/basic/node_modules/nuclo/types/features/style.d.ts +0 -77
  194. package/templates/basic/node_modules/nuclo/types/features/update.d.ts +0 -6
  195. package/templates/basic/node_modules/nuclo/types/features/when.d.ts +0 -18
  196. package/templates/basic/node_modules/nuclo/types/html/tags.d.ts +0 -119
  197. package/templates/basic/node_modules/nuclo/types/index.d.ts +0 -137
  198. package/templates/basic/node_modules/nuclo/types/polyfill.d.ts +0 -131
  199. package/templates/basic/node_modules/nuclo/types/ssr.d.ts +0 -45
  200. package/templates/basic/node_modules/nuclo/types/style.d.ts +0 -404
  201. package/templates/basic/node_modules/nuclo/types/svg/base.d.ts +0 -118
  202. package/templates/basic/node_modules/nuclo/types/svg/tags.d.ts +0 -68
  203. package/templates/basic/node_modules/picocolors/LICENSE +0 -15
  204. package/templates/basic/node_modules/picocolors/README.md +0 -21
  205. package/templates/basic/node_modules/picocolors/package.json +0 -25
  206. package/templates/basic/node_modules/picocolors/picocolors.browser.js +0 -4
  207. package/templates/basic/node_modules/picocolors/picocolors.d.ts +0 -5
  208. package/templates/basic/node_modules/picocolors/picocolors.js +0 -75
  209. package/templates/basic/node_modules/picocolors/types.d.ts +0 -51
  210. package/templates/basic/node_modules/picomatch/LICENSE +0 -21
  211. package/templates/basic/node_modules/picomatch/README.md +0 -743
  212. package/templates/basic/node_modules/picomatch/index.js +0 -17
  213. package/templates/basic/node_modules/picomatch/lib/constants.js +0 -184
  214. package/templates/basic/node_modules/picomatch/lib/parse.js +0 -1416
  215. package/templates/basic/node_modules/picomatch/lib/picomatch.js +0 -361
  216. package/templates/basic/node_modules/picomatch/lib/scan.js +0 -391
  217. package/templates/basic/node_modules/picomatch/lib/utils.js +0 -72
  218. package/templates/basic/node_modules/picomatch/package.json +0 -83
  219. package/templates/basic/node_modules/picomatch/posix.js +0 -3
  220. package/templates/basic/node_modules/postcss/LICENSE +0 -20
  221. package/templates/basic/node_modules/postcss/README.md +0 -25
  222. package/templates/basic/node_modules/postcss/lib/at-rule.d.ts +0 -139
  223. package/templates/basic/node_modules/postcss/lib/at-rule.js +0 -25
  224. package/templates/basic/node_modules/postcss/lib/comment.d.ts +0 -67
  225. package/templates/basic/node_modules/postcss/lib/comment.js +0 -13
  226. package/templates/basic/node_modules/postcss/lib/container.d.ts +0 -478
  227. package/templates/basic/node_modules/postcss/lib/container.js +0 -447
  228. package/templates/basic/node_modules/postcss/lib/css-syntax-error.d.ts +0 -247
  229. package/templates/basic/node_modules/postcss/lib/css-syntax-error.js +0 -133
  230. package/templates/basic/node_modules/postcss/lib/declaration.d.ts +0 -150
  231. package/templates/basic/node_modules/postcss/lib/declaration.js +0 -24
  232. package/templates/basic/node_modules/postcss/lib/document.d.ts +0 -68
  233. package/templates/basic/node_modules/postcss/lib/document.js +0 -33
  234. package/templates/basic/node_modules/postcss/lib/fromJSON.d.ts +0 -9
  235. package/templates/basic/node_modules/postcss/lib/fromJSON.js +0 -68
  236. package/templates/basic/node_modules/postcss/lib/input.d.ts +0 -226
  237. package/templates/basic/node_modules/postcss/lib/input.js +0 -276
  238. package/templates/basic/node_modules/postcss/lib/lazy-result.d.ts +0 -189
  239. package/templates/basic/node_modules/postcss/lib/lazy-result.js +0 -563
  240. package/templates/basic/node_modules/postcss/lib/list.d.ts +0 -60
  241. package/templates/basic/node_modules/postcss/lib/list.js +0 -58
  242. package/templates/basic/node_modules/postcss/lib/map-generator.js +0 -376
  243. package/templates/basic/node_modules/postcss/lib/no-work-result.d.ts +0 -45
  244. package/templates/basic/node_modules/postcss/lib/no-work-result.js +0 -137
  245. package/templates/basic/node_modules/postcss/lib/node.d.ts +0 -555
  246. package/templates/basic/node_modules/postcss/lib/node.js +0 -456
  247. package/templates/basic/node_modules/postcss/lib/parse.d.ts +0 -9
  248. package/templates/basic/node_modules/postcss/lib/parse.js +0 -42
  249. package/templates/basic/node_modules/postcss/lib/parser.js +0 -618
  250. package/templates/basic/node_modules/postcss/lib/postcss.d.mts +0 -66
  251. package/templates/basic/node_modules/postcss/lib/postcss.d.ts +0 -461
  252. package/templates/basic/node_modules/postcss/lib/postcss.js +0 -101
  253. package/templates/basic/node_modules/postcss/lib/postcss.mjs +0 -30
  254. package/templates/basic/node_modules/postcss/lib/previous-map.d.ts +0 -80
  255. package/templates/basic/node_modules/postcss/lib/previous-map.js +0 -161
  256. package/templates/basic/node_modules/postcss/lib/processor.d.ts +0 -114
  257. package/templates/basic/node_modules/postcss/lib/processor.js +0 -67
  258. package/templates/basic/node_modules/postcss/lib/result.d.ts +0 -204
  259. package/templates/basic/node_modules/postcss/lib/result.js +0 -42
  260. package/templates/basic/node_modules/postcss/lib/root.d.ts +0 -86
  261. package/templates/basic/node_modules/postcss/lib/root.js +0 -61
  262. package/templates/basic/node_modules/postcss/lib/rule.d.ts +0 -126
  263. package/templates/basic/node_modules/postcss/lib/rule.js +0 -27
  264. package/templates/basic/node_modules/postcss/lib/stringifier.d.ts +0 -45
  265. package/templates/basic/node_modules/postcss/lib/stringifier.js +0 -374
  266. package/templates/basic/node_modules/postcss/lib/stringify.d.ts +0 -9
  267. package/templates/basic/node_modules/postcss/lib/stringify.js +0 -11
  268. package/templates/basic/node_modules/postcss/lib/symbols.js +0 -5
  269. package/templates/basic/node_modules/postcss/lib/terminal-highlight.js +0 -70
  270. package/templates/basic/node_modules/postcss/lib/tokenize.js +0 -270
  271. package/templates/basic/node_modules/postcss/lib/warn-once.js +0 -13
  272. package/templates/basic/node_modules/postcss/lib/warning.d.ts +0 -146
  273. package/templates/basic/node_modules/postcss/lib/warning.js +0 -37
  274. package/templates/basic/node_modules/postcss/package.json +0 -88
  275. package/templates/basic/node_modules/rolldown/LICENSE +0 -25
  276. package/templates/basic/node_modules/rolldown/README.md +0 -11
  277. package/templates/basic/node_modules/rolldown/bin/cli.mjs +0 -2
  278. package/templates/basic/node_modules/rolldown/dist/cli.d.mts +0 -1
  279. package/templates/basic/node_modules/rolldown/dist/cli.mjs +0 -1202
  280. package/templates/basic/node_modules/rolldown/dist/config.d.mts +0 -14
  281. package/templates/basic/node_modules/rolldown/dist/config.mjs +0 -4
  282. package/templates/basic/node_modules/rolldown/dist/experimental-index.d.mts +0 -280
  283. package/templates/basic/node_modules/rolldown/dist/experimental-index.mjs +0 -331
  284. package/templates/basic/node_modules/rolldown/dist/experimental-runtime-types.d.ts +0 -107
  285. package/templates/basic/node_modules/rolldown/dist/filter-index.d.mts +0 -195
  286. package/templates/basic/node_modules/rolldown/dist/filter-index.mjs +0 -380
  287. package/templates/basic/node_modules/rolldown/dist/get-log-filter.d.mts +0 -3
  288. package/templates/basic/node_modules/rolldown/dist/get-log-filter.mjs +0 -68
  289. package/templates/basic/node_modules/rolldown/dist/index.d.mts +0 -4
  290. package/templates/basic/node_modules/rolldown/dist/index.mjs +0 -50
  291. package/templates/basic/node_modules/rolldown/dist/parallel-plugin-worker.d.mts +0 -1
  292. package/templates/basic/node_modules/rolldown/dist/parallel-plugin-worker.mjs +0 -29
  293. package/templates/basic/node_modules/rolldown/dist/parallel-plugin.d.mts +0 -13
  294. package/templates/basic/node_modules/rolldown/dist/parallel-plugin.mjs +0 -6
  295. package/templates/basic/node_modules/rolldown/dist/parse-ast-index.d.mts +0 -32
  296. package/templates/basic/node_modules/rolldown/dist/parse-ast-index.mjs +0 -60
  297. package/templates/basic/node_modules/rolldown/dist/plugins-index.d.mts +0 -33
  298. package/templates/basic/node_modules/rolldown/dist/plugins-index.mjs +0 -40
  299. package/templates/basic/node_modules/rolldown/dist/shared/binding-B1q9aYT-.d.mts +0 -1947
  300. package/templates/basic/node_modules/rolldown/dist/shared/binding-BmkJW3Wy.mjs +0 -588
  301. package/templates/basic/node_modules/rolldown/dist/shared/bindingify-input-options-BsDhfYrS.mjs +0 -2240
  302. package/templates/basic/node_modules/rolldown/dist/shared/constructors-2i1T9YcF.d.mts +0 -36
  303. package/templates/basic/node_modules/rolldown/dist/shared/constructors-CE6zZSUt.mjs +0 -65
  304. package/templates/basic/node_modules/rolldown/dist/shared/define-config-BBz954-q.d.mts +0 -3901
  305. package/templates/basic/node_modules/rolldown/dist/shared/define-config-Demdg3_4.mjs +0 -6
  306. package/templates/basic/node_modules/rolldown/dist/shared/error-BlQ0-ek7.mjs +0 -85
  307. package/templates/basic/node_modules/rolldown/dist/shared/get-log-filter-BpNVNJ5-.d.mts +0 -35
  308. package/templates/basic/node_modules/rolldown/dist/shared/load-config-FRmAU9xl.mjs +0 -120
  309. package/templates/basic/node_modules/rolldown/dist/shared/logging-BSNejiLS.d.mts +0 -50
  310. package/templates/basic/node_modules/rolldown/dist/shared/logs-aMKUxRpj.mjs +0 -180
  311. package/templates/basic/node_modules/rolldown/dist/shared/misc-CoQm4NHO.mjs +0 -21
  312. package/templates/basic/node_modules/rolldown/dist/shared/normalize-string-or-regex-BYkbbGqQ.mjs +0 -68
  313. package/templates/basic/node_modules/rolldown/dist/shared/parse-DVMnkavl.mjs +0 -74
  314. package/templates/basic/node_modules/rolldown/dist/shared/prompt-B1Yc1NPt.mjs +0 -847
  315. package/templates/basic/node_modules/rolldown/dist/shared/resolve-tsconfig-CdIAR1Eb.mjs +0 -124
  316. package/templates/basic/node_modules/rolldown/dist/shared/rolldown-build-aV0QeeTW.mjs +0 -3264
  317. package/templates/basic/node_modules/rolldown/dist/shared/rolldown-tbHvKzVl.mjs +0 -40
  318. package/templates/basic/node_modules/rolldown/dist/shared/transform-CEmFsvJW.d.mts +0 -149
  319. package/templates/basic/node_modules/rolldown/dist/shared/watch-DIhJ-T1s.mjs +0 -374
  320. package/templates/basic/node_modules/rolldown/dist/utils-index.d.mts +0 -376
  321. package/templates/basic/node_modules/rolldown/dist/utils-index.mjs +0 -2414
  322. package/templates/basic/node_modules/rolldown/package.json +0 -153
  323. package/templates/basic/node_modules/source-map-js/LICENSE +0 -28
  324. package/templates/basic/node_modules/source-map-js/README.md +0 -765
  325. package/templates/basic/node_modules/source-map-js/lib/array-set.js +0 -121
  326. package/templates/basic/node_modules/source-map-js/lib/base64-vlq.js +0 -140
  327. package/templates/basic/node_modules/source-map-js/lib/base64.js +0 -67
  328. package/templates/basic/node_modules/source-map-js/lib/binary-search.js +0 -111
  329. package/templates/basic/node_modules/source-map-js/lib/mapping-list.js +0 -79
  330. package/templates/basic/node_modules/source-map-js/lib/quick-sort.js +0 -132
  331. package/templates/basic/node_modules/source-map-js/lib/source-map-consumer.d.ts +0 -1
  332. package/templates/basic/node_modules/source-map-js/lib/source-map-consumer.js +0 -1188
  333. package/templates/basic/node_modules/source-map-js/lib/source-map-generator.d.ts +0 -1
  334. package/templates/basic/node_modules/source-map-js/lib/source-map-generator.js +0 -444
  335. package/templates/basic/node_modules/source-map-js/lib/source-node.d.ts +0 -1
  336. package/templates/basic/node_modules/source-map-js/lib/source-node.js +0 -413
  337. package/templates/basic/node_modules/source-map-js/lib/util.js +0 -594
  338. package/templates/basic/node_modules/source-map-js/package.json +0 -71
  339. package/templates/basic/node_modules/source-map-js/source-map.d.ts +0 -104
  340. package/templates/basic/node_modules/source-map-js/source-map.js +0 -8
  341. package/templates/basic/node_modules/tinyglobby/LICENSE +0 -21
  342. package/templates/basic/node_modules/tinyglobby/README.md +0 -25
  343. package/templates/basic/node_modules/tinyglobby/dist/index.cjs +0 -335
  344. package/templates/basic/node_modules/tinyglobby/dist/index.d.cts +0 -148
  345. package/templates/basic/node_modules/tinyglobby/dist/index.d.mts +0 -148
  346. package/templates/basic/node_modules/tinyglobby/dist/index.mjs +0 -307
  347. package/templates/basic/node_modules/tinyglobby/package.json +0 -70
  348. package/templates/basic/node_modules/typescript/LICENSE.txt +0 -55
  349. package/templates/basic/node_modules/typescript/README.md +0 -50
  350. package/templates/basic/node_modules/typescript/SECURITY.md +0 -39
  351. package/templates/basic/node_modules/typescript/ThirdPartyNoticeText.txt +0 -193
  352. package/templates/basic/node_modules/typescript/bin/tsc +0 -2
  353. package/templates/basic/node_modules/typescript/bin/tsserver +0 -2
  354. package/templates/basic/node_modules/typescript/lib/_tsc.js +0 -134465
  355. package/templates/basic/node_modules/typescript/lib/_tsserver.js +0 -659
  356. package/templates/basic/node_modules/typescript/lib/_typingsInstaller.js +0 -222
  357. package/templates/basic/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +0 -2129
  358. package/templates/basic/node_modules/typescript/lib/de/diagnosticMessages.generated.json +0 -2125
  359. package/templates/basic/node_modules/typescript/lib/es/diagnosticMessages.generated.json +0 -2129
  360. package/templates/basic/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +0 -2129
  361. package/templates/basic/node_modules/typescript/lib/it/diagnosticMessages.generated.json +0 -2125
  362. package/templates/basic/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +0 -2129
  363. package/templates/basic/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +0 -2129
  364. package/templates/basic/node_modules/typescript/lib/lib.d.ts +0 -20
  365. package/templates/basic/node_modules/typescript/lib/lib.decorators.d.ts +0 -382
  366. package/templates/basic/node_modules/typescript/lib/lib.decorators.legacy.d.ts +0 -20
  367. package/templates/basic/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +0 -18
  368. package/templates/basic/node_modules/typescript/lib/lib.dom.d.ts +0 -45125
  369. package/templates/basic/node_modules/typescript/lib/lib.dom.iterable.d.ts +0 -18
  370. package/templates/basic/node_modules/typescript/lib/lib.es2015.collection.d.ts +0 -150
  371. package/templates/basic/node_modules/typescript/lib/lib.es2015.core.d.ts +0 -595
  372. package/templates/basic/node_modules/typescript/lib/lib.es2015.d.ts +0 -26
  373. package/templates/basic/node_modules/typescript/lib/lib.es2015.generator.d.ts +0 -75
  374. package/templates/basic/node_modules/typescript/lib/lib.es2015.iterable.d.ts +0 -603
  375. package/templates/basic/node_modules/typescript/lib/lib.es2015.promise.d.ts +0 -79
  376. package/templates/basic/node_modules/typescript/lib/lib.es2015.proxy.d.ts +0 -126
  377. package/templates/basic/node_modules/typescript/lib/lib.es2015.reflect.d.ts +0 -142
  378. package/templates/basic/node_modules/typescript/lib/lib.es2015.symbol.d.ts +0 -44
  379. package/templates/basic/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -324
  380. package/templates/basic/node_modules/typescript/lib/lib.es2016.array.include.d.ts +0 -114
  381. package/templates/basic/node_modules/typescript/lib/lib.es2016.d.ts +0 -19
  382. package/templates/basic/node_modules/typescript/lib/lib.es2016.full.d.ts +0 -21
  383. package/templates/basic/node_modules/typescript/lib/lib.es2016.intl.d.ts +0 -29
  384. package/templates/basic/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +0 -19
  385. package/templates/basic/node_modules/typescript/lib/lib.es2017.d.ts +0 -24
  386. package/templates/basic/node_modules/typescript/lib/lib.es2017.date.d.ts +0 -29
  387. package/templates/basic/node_modules/typescript/lib/lib.es2017.full.d.ts +0 -21
  388. package/templates/basic/node_modules/typescript/lib/lib.es2017.intl.d.ts +0 -42
  389. package/templates/basic/node_modules/typescript/lib/lib.es2017.object.d.ts +0 -47
  390. package/templates/basic/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +0 -133
  391. package/templates/basic/node_modules/typescript/lib/lib.es2017.string.d.ts +0 -43
  392. package/templates/basic/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +0 -51
  393. package/templates/basic/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -75
  394. package/templates/basic/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +0 -51
  395. package/templates/basic/node_modules/typescript/lib/lib.es2018.d.ts +0 -22
  396. package/templates/basic/node_modules/typescript/lib/lib.es2018.full.d.ts +0 -22
  397. package/templates/basic/node_modules/typescript/lib/lib.es2018.intl.d.ts +0 -81
  398. package/templates/basic/node_modules/typescript/lib/lib.es2018.promise.d.ts +0 -28
  399. package/templates/basic/node_modules/typescript/lib/lib.es2018.regexp.d.ts +0 -35
  400. package/templates/basic/node_modules/typescript/lib/lib.es2019.array.d.ts +0 -77
  401. package/templates/basic/node_modules/typescript/lib/lib.es2019.d.ts +0 -22
  402. package/templates/basic/node_modules/typescript/lib/lib.es2019.full.d.ts +0 -22
  403. package/templates/basic/node_modules/typescript/lib/lib.es2019.intl.d.ts +0 -21
  404. package/templates/basic/node_modules/typescript/lib/lib.es2019.object.d.ts +0 -31
  405. package/templates/basic/node_modules/typescript/lib/lib.es2019.string.d.ts +0 -35
  406. package/templates/basic/node_modules/typescript/lib/lib.es2019.symbol.d.ts +0 -22
  407. package/templates/basic/node_modules/typescript/lib/lib.es2020.bigint.d.ts +0 -763
  408. package/templates/basic/node_modules/typescript/lib/lib.es2020.d.ts +0 -25
  409. package/templates/basic/node_modules/typescript/lib/lib.es2020.date.d.ts +0 -40
  410. package/templates/basic/node_modules/typescript/lib/lib.es2020.full.d.ts +0 -22
  411. package/templates/basic/node_modules/typescript/lib/lib.es2020.intl.d.ts +0 -472
  412. package/templates/basic/node_modules/typescript/lib/lib.es2020.number.d.ts +0 -26
  413. package/templates/basic/node_modules/typescript/lib/lib.es2020.promise.d.ts +0 -45
  414. package/templates/basic/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +0 -97
  415. package/templates/basic/node_modules/typescript/lib/lib.es2020.string.d.ts +0 -42
  416. package/templates/basic/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -39
  417. package/templates/basic/node_modules/typescript/lib/lib.es2021.d.ts +0 -21
  418. package/templates/basic/node_modules/typescript/lib/lib.es2021.full.d.ts +0 -22
  419. package/templates/basic/node_modules/typescript/lib/lib.es2021.intl.d.ts +0 -164
  420. package/templates/basic/node_modules/typescript/lib/lib.es2021.promise.d.ts +0 -46
  421. package/templates/basic/node_modules/typescript/lib/lib.es2021.string.d.ts +0 -31
  422. package/templates/basic/node_modules/typescript/lib/lib.es2021.weakref.d.ts +0 -76
  423. package/templates/basic/node_modules/typescript/lib/lib.es2022.array.d.ts +0 -119
  424. package/templates/basic/node_modules/typescript/lib/lib.es2022.d.ts +0 -23
  425. package/templates/basic/node_modules/typescript/lib/lib.es2022.error.d.ts +0 -73
  426. package/templates/basic/node_modules/typescript/lib/lib.es2022.full.d.ts +0 -22
  427. package/templates/basic/node_modules/typescript/lib/lib.es2022.intl.d.ts +0 -143
  428. package/templates/basic/node_modules/typescript/lib/lib.es2022.object.d.ts +0 -24
  429. package/templates/basic/node_modules/typescript/lib/lib.es2022.regexp.d.ts +0 -37
  430. package/templates/basic/node_modules/typescript/lib/lib.es2022.string.d.ts +0 -23
  431. package/templates/basic/node_modules/typescript/lib/lib.es2023.array.d.ts +0 -922
  432. package/templates/basic/node_modules/typescript/lib/lib.es2023.collection.d.ts +0 -19
  433. package/templates/basic/node_modules/typescript/lib/lib.es2023.d.ts +0 -20
  434. package/templates/basic/node_modules/typescript/lib/lib.es2023.full.d.ts +0 -22
  435. package/templates/basic/node_modules/typescript/lib/lib.es2023.intl.d.ts +0 -62
  436. package/templates/basic/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +0 -63
  437. package/templates/basic/node_modules/typescript/lib/lib.es2024.collection.d.ts +0 -27
  438. package/templates/basic/node_modules/typescript/lib/lib.es2024.d.ts +0 -24
  439. package/templates/basic/node_modules/typescript/lib/lib.es2024.full.d.ts +0 -22
  440. package/templates/basic/node_modules/typescript/lib/lib.es2024.object.d.ts +0 -27
  441. package/templates/basic/node_modules/typescript/lib/lib.es2024.promise.d.ts +0 -33
  442. package/templates/basic/node_modules/typescript/lib/lib.es2024.regexp.d.ts +0 -23
  443. package/templates/basic/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +0 -66
  444. package/templates/basic/node_modules/typescript/lib/lib.es2024.string.d.ts +0 -27
  445. package/templates/basic/node_modules/typescript/lib/lib.es2025.collection.d.ts +0 -94
  446. package/templates/basic/node_modules/typescript/lib/lib.es2025.d.ts +0 -23
  447. package/templates/basic/node_modules/typescript/lib/lib.es2025.float16.d.ts +0 -443
  448. package/templates/basic/node_modules/typescript/lib/lib.es2025.full.d.ts +0 -22
  449. package/templates/basic/node_modules/typescript/lib/lib.es2025.intl.d.ts +0 -200
  450. package/templates/basic/node_modules/typescript/lib/lib.es2025.iterator.d.ts +0 -146
  451. package/templates/basic/node_modules/typescript/lib/lib.es2025.promise.d.ts +0 -32
  452. package/templates/basic/node_modules/typescript/lib/lib.es2025.regexp.d.ts +0 -30
  453. package/templates/basic/node_modules/typescript/lib/lib.es5.d.ts +0 -4599
  454. package/templates/basic/node_modules/typescript/lib/lib.es6.d.ts +0 -21
  455. package/templates/basic/node_modules/typescript/lib/lib.esnext.array.d.ts +0 -33
  456. package/templates/basic/node_modules/typescript/lib/lib.esnext.collection.d.ts +0 -47
  457. package/templates/basic/node_modules/typescript/lib/lib.esnext.d.ts +0 -27
  458. package/templates/basic/node_modules/typescript/lib/lib.esnext.date.d.ts +0 -21
  459. package/templates/basic/node_modules/typescript/lib/lib.esnext.decorators.d.ts +0 -26
  460. package/templates/basic/node_modules/typescript/lib/lib.esnext.disposable.d.ts +0 -191
  461. package/templates/basic/node_modules/typescript/lib/lib.esnext.error.d.ts +0 -22
  462. package/templates/basic/node_modules/typescript/lib/lib.esnext.full.d.ts +0 -22
  463. package/templates/basic/node_modules/typescript/lib/lib.esnext.intl.d.ts +0 -107
  464. package/templates/basic/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +0 -23
  465. package/templates/basic/node_modules/typescript/lib/lib.esnext.temporal.d.ts +0 -485
  466. package/templates/basic/node_modules/typescript/lib/lib.esnext.typedarrays.d.ts +0 -90
  467. package/templates/basic/node_modules/typescript/lib/lib.scripthost.d.ts +0 -320
  468. package/templates/basic/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +0 -18
  469. package/templates/basic/node_modules/typescript/lib/lib.webworker.d.ts +0 -15606
  470. package/templates/basic/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +0 -21
  471. package/templates/basic/node_modules/typescript/lib/lib.webworker.iterable.d.ts +0 -18
  472. package/templates/basic/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +0 -2129
  473. package/templates/basic/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +0 -2129
  474. package/templates/basic/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +0 -2125
  475. package/templates/basic/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +0 -2129
  476. package/templates/basic/node_modules/typescript/lib/tsc.js +0 -8
  477. package/templates/basic/node_modules/typescript/lib/tsserver.js +0 -8
  478. package/templates/basic/node_modules/typescript/lib/tsserverlibrary.d.ts +0 -17
  479. package/templates/basic/node_modules/typescript/lib/tsserverlibrary.js +0 -21
  480. package/templates/basic/node_modules/typescript/lib/typesMap.json +0 -497
  481. package/templates/basic/node_modules/typescript/lib/typescript.d.ts +0 -11448
  482. package/templates/basic/node_modules/typescript/lib/typescript.js +0 -201039
  483. package/templates/basic/node_modules/typescript/lib/typingsInstaller.js +0 -8
  484. package/templates/basic/node_modules/typescript/lib/watchGuard.js +0 -53
  485. package/templates/basic/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -2129
  486. package/templates/basic/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -2125
  487. package/templates/basic/node_modules/typescript/package.json +0 -118
  488. package/templates/basic/node_modules/vite/LICENSE.md +0 -2287
  489. package/templates/basic/node_modules/vite/README.md +0 -20
  490. package/templates/basic/node_modules/vite/bin/openChrome.js +0 -68
  491. package/templates/basic/node_modules/vite/bin/vite.js +0 -79
  492. package/templates/basic/node_modules/vite/client.d.ts +0 -285
  493. package/templates/basic/node_modules/vite/dist/client/client.mjs +0 -1269
  494. package/templates/basic/node_modules/vite/dist/client/env.mjs +0 -18
  495. package/templates/basic/node_modules/vite/dist/node/chunks/build.js +0 -5371
  496. package/templates/basic/node_modules/vite/dist/node/chunks/dist.js +0 -6784
  497. package/templates/basic/node_modules/vite/dist/node/chunks/lib.js +0 -371
  498. package/templates/basic/node_modules/vite/dist/node/chunks/logger.js +0 -364
  499. package/templates/basic/node_modules/vite/dist/node/chunks/moduleRunnerTransport.d.ts +0 -96
  500. package/templates/basic/node_modules/vite/dist/node/chunks/node.js +0 -35836
  501. package/templates/basic/node_modules/vite/dist/node/chunks/postcss-import.js +0 -467
  502. package/templates/basic/node_modules/vite/dist/node/cli.js +0 -836
  503. package/templates/basic/node_modules/vite/dist/node/index.d.ts +0 -4011
  504. package/templates/basic/node_modules/vite/dist/node/index.js +0 -3
  505. package/templates/basic/node_modules/vite/dist/node/internal.d.ts +0 -2
  506. package/templates/basic/node_modules/vite/dist/node/internal.js +0 -2
  507. package/templates/basic/node_modules/vite/dist/node/module-runner.d.ts +0 -314
  508. package/templates/basic/node_modules/vite/dist/node/module-runner.js +0 -1274
  509. package/templates/basic/node_modules/vite/misc/false.js +0 -1
  510. package/templates/basic/node_modules/vite/misc/true.js +0 -1
  511. package/templates/basic/node_modules/vite/package.json +0 -194
  512. package/templates/basic/node_modules/vite/types/customEvent.d.ts +0 -79
  513. package/templates/basic/node_modules/vite/types/hmrPayload.d.ts +0 -80
  514. package/templates/basic/node_modules/vite/types/hot.d.ts +0 -39
  515. package/templates/basic/node_modules/vite/types/import-meta.d.ts +0 -5
  516. package/templates/basic/node_modules/vite/types/importGlob.d.ts +0 -131
  517. package/templates/basic/node_modules/vite/types/importMeta.d.ts +0 -30
  518. package/templates/basic/node_modules/vite/types/internal/cssPreprocessorOptions.d.ts +0 -44
  519. package/templates/basic/node_modules/vite/types/internal/esbuildOptions.d.ts +0 -28
  520. package/templates/basic/node_modules/vite/types/internal/lightningcssOptions.d.ts +0 -18
  521. package/templates/basic/node_modules/vite/types/internal/rollupTypeCompat.d.ts +0 -24
  522. package/templates/basic/node_modules/vite/types/internal/terserOptions.d.ts +0 -11
  523. package/templates/basic/node_modules/vite/types/metadata.d.ts +0 -47
  524. package/templates/basic/package-lock.json +0 -926
  525. package/templates/basic/public/apple-touch-icon.png +0 -0
  526. package/templates/basic/public/favicon-16x16.png +0 -0
  527. package/templates/basic/public/favicon-32x32.png +0 -0
  528. package/templates/basic/public/icon-192.png +0 -0
  529. package/templates/basic/public/icon-512.png +0 -0
  530. package/templates/basic/public/site.webmanifest +0 -23
  531. package/templates/basic/vite.config.ts +0 -3
@@ -1,3264 +0,0 @@
1
- import { n as __toESM, t as require_binding } from "./binding-BmkJW3Wy.mjs";
2
- import { i as logInputHookInOutputPlugin, n as error } from "./logs-aMKUxRpj.mjs";
3
- import { n as BuiltinPlugin } from "./normalize-string-or-regex-BYkbbGqQ.mjs";
4
- import { a as transformModuleInfo, c as __decorate, d as PlainObjectLike, f as MinimalPluginContextImpl, h as LOG_LEVEL_DEBUG, i as PluginContextData, l as transformAssetSource, m as normalizeLog, o as transformToRollupOutput, p as normalizeHook, s as transformRenderedChunk, t as bindingifyInputOptions, u as lazyProp, v as LOG_LEVEL_WARN, x as VERSION, y as logLevelPriority } from "./bindingify-input-options-BsDhfYrS.mjs";
5
- import { i as unimplemented } from "./misc-CoQm4NHO.mjs";
6
- import { i as unwrapBindingResult } from "./error-BlQ0-ek7.mjs";
7
- import { Worker } from "node:worker_threads";
8
- import path, { sep } from "node:path";
9
- import { formatWithOptions, styleText } from "node:util";
10
- import g$1 from "node:process";
11
- import * as tty from "node:tty";
12
- import os from "node:os";
13
- //#region src/log/logger.ts
14
- var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
15
- function getLogger(plugins, onLog, logLevel, watchMode) {
16
- const minimalPriority = logLevelPriority[logLevel];
17
- const logger = (level, log, skipped = /* @__PURE__ */ new Set()) => {
18
- if (logLevelPriority[level] < minimalPriority) return;
19
- for (const plugin of getSortedPlugins("onLog", plugins)) {
20
- if (skipped.has(plugin)) continue;
21
- const { onLog: pluginOnLog } = plugin;
22
- if (pluginOnLog) {
23
- const getLogHandler = (level) => {
24
- if (logLevelPriority[level] < minimalPriority) return () => {};
25
- return (log) => logger(level, normalizeLog(log), new Set(skipped).add(plugin));
26
- };
27
- if (("handler" in pluginOnLog ? pluginOnLog.handler : pluginOnLog).call({
28
- debug: getLogHandler("debug"),
29
- error: (log) => error(normalizeLog(log)),
30
- info: getLogHandler("info"),
31
- meta: {
32
- rollupVersion: "4.23.0",
33
- rolldownVersion: VERSION,
34
- watchMode
35
- },
36
- warn: getLogHandler("warn"),
37
- pluginName: plugin.name || "unknown"
38
- }, level, log) === false) return;
39
- }
40
- }
41
- onLog(level, log);
42
- };
43
- return logger;
44
- }
45
- const getOnLog = (config, logLevel, printLog = defaultPrintLog) => {
46
- const { onwarn, onLog } = config;
47
- const defaultOnLog = getDefaultOnLog(printLog, onwarn);
48
- if (onLog) {
49
- const minimalPriority = logLevelPriority[logLevel];
50
- return (level, log) => onLog(level, addLogToString(log), (level, handledLog) => {
51
- if (level === "error") return error(normalizeLog(handledLog));
52
- if (logLevelPriority[level] >= minimalPriority) defaultOnLog(level, normalizeLog(handledLog));
53
- });
54
- }
55
- return defaultOnLog;
56
- };
57
- const getDefaultOnLog = (printLog, onwarn) => onwarn ? (level, log) => {
58
- if (level === "warn") onwarn(addLogToString(log), (warning) => printLog(LOG_LEVEL_WARN, normalizeLog(warning)));
59
- else printLog(level, log);
60
- } : printLog;
61
- const addLogToString = (log) => {
62
- Object.defineProperty(log, "toString", {
63
- value: () => getExtendedLogMessage(log),
64
- writable: true
65
- });
66
- return log;
67
- };
68
- const defaultPrintLog = (level, log) => {
69
- const message = getExtendedLogMessage(log);
70
- switch (level) {
71
- case LOG_LEVEL_WARN: return console.warn(message);
72
- case LOG_LEVEL_DEBUG: return console.debug(message);
73
- default: return console.info(message);
74
- }
75
- };
76
- const getExtendedLogMessage = (log) => {
77
- let prefix = "";
78
- if (log.plugin) prefix += `(${log.plugin} plugin) `;
79
- if (log.loc) prefix += `${relativeId(log.loc.file)} (${log.loc.line}:${log.loc.column}) `;
80
- return prefix + log.message;
81
- };
82
- function relativeId(id) {
83
- if (!path.isAbsolute(id)) return id;
84
- return path.relative(path.resolve(), id);
85
- }
86
- //#endregion
87
- //#region src/constants/plugin.ts
88
- const ENUMERATED_INPUT_PLUGIN_HOOK_NAMES = [
89
- "options",
90
- "buildStart",
91
- "resolveId",
92
- "load",
93
- "transform",
94
- "moduleParsed",
95
- "buildEnd",
96
- "onLog",
97
- "resolveDynamicImport",
98
- "closeBundle",
99
- "closeWatcher",
100
- "watchChange"
101
- ];
102
- const ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES = [
103
- "augmentChunkHash",
104
- "outputOptions",
105
- "renderChunk",
106
- "renderStart",
107
- "renderError",
108
- "writeBundle",
109
- "generateBundle"
110
- ];
111
- const ENUMERATED_PLUGIN_HOOK_NAMES = [
112
- ...ENUMERATED_INPUT_PLUGIN_HOOK_NAMES,
113
- ...ENUMERATED_OUTPUT_PLUGIN_HOOK_NAMES,
114
- "footer",
115
- "banner",
116
- "intro",
117
- "outro"
118
- ];
119
- ENUMERATED_PLUGIN_HOOK_NAMES[0], ENUMERATED_PLUGIN_HOOK_NAMES[0], ENUMERATED_PLUGIN_HOOK_NAMES[1], ENUMERATED_PLUGIN_HOOK_NAMES[1], ENUMERATED_PLUGIN_HOOK_NAMES[2], ENUMERATED_PLUGIN_HOOK_NAMES[2], ENUMERATED_PLUGIN_HOOK_NAMES[3], ENUMERATED_PLUGIN_HOOK_NAMES[3], ENUMERATED_PLUGIN_HOOK_NAMES[4], ENUMERATED_PLUGIN_HOOK_NAMES[4], ENUMERATED_PLUGIN_HOOK_NAMES[5], ENUMERATED_PLUGIN_HOOK_NAMES[5], ENUMERATED_PLUGIN_HOOK_NAMES[6], ENUMERATED_PLUGIN_HOOK_NAMES[6], ENUMERATED_PLUGIN_HOOK_NAMES[7], ENUMERATED_PLUGIN_HOOK_NAMES[7], ENUMERATED_PLUGIN_HOOK_NAMES[8], ENUMERATED_PLUGIN_HOOK_NAMES[8], ENUMERATED_PLUGIN_HOOK_NAMES[9], ENUMERATED_PLUGIN_HOOK_NAMES[9], ENUMERATED_PLUGIN_HOOK_NAMES[10], ENUMERATED_PLUGIN_HOOK_NAMES[10], ENUMERATED_PLUGIN_HOOK_NAMES[11], ENUMERATED_PLUGIN_HOOK_NAMES[11], ENUMERATED_PLUGIN_HOOK_NAMES[12], ENUMERATED_PLUGIN_HOOK_NAMES[12], ENUMERATED_PLUGIN_HOOK_NAMES[13], ENUMERATED_PLUGIN_HOOK_NAMES[13], ENUMERATED_PLUGIN_HOOK_NAMES[14], ENUMERATED_PLUGIN_HOOK_NAMES[14], ENUMERATED_PLUGIN_HOOK_NAMES[15], ENUMERATED_PLUGIN_HOOK_NAMES[15], ENUMERATED_PLUGIN_HOOK_NAMES[16], ENUMERATED_PLUGIN_HOOK_NAMES[16], ENUMERATED_PLUGIN_HOOK_NAMES[17], ENUMERATED_PLUGIN_HOOK_NAMES[17], ENUMERATED_PLUGIN_HOOK_NAMES[18], ENUMERATED_PLUGIN_HOOK_NAMES[18], ENUMERATED_PLUGIN_HOOK_NAMES[19], ENUMERATED_PLUGIN_HOOK_NAMES[19], ENUMERATED_PLUGIN_HOOK_NAMES[20], ENUMERATED_PLUGIN_HOOK_NAMES[20], ENUMERATED_PLUGIN_HOOK_NAMES[21], ENUMERATED_PLUGIN_HOOK_NAMES[21], ENUMERATED_PLUGIN_HOOK_NAMES[22], ENUMERATED_PLUGIN_HOOK_NAMES[22];
120
- //#endregion
121
- //#region src/utils/async-flatten.ts
122
- async function asyncFlatten(array) {
123
- do
124
- array = (await Promise.all(array)).flat(Infinity);
125
- while (array.some((v) => v?.then));
126
- return array;
127
- }
128
- //#endregion
129
- //#region src/utils/normalize-plugin-option.ts
130
- const normalizePluginOption = async (plugins) => (await asyncFlatten([plugins])).filter(Boolean);
131
- function checkOutputPluginOption(plugins, onLog) {
132
- for (const plugin of plugins) for (const hook of ENUMERATED_INPUT_PLUGIN_HOOK_NAMES) if (hook in plugin) {
133
- delete plugin[hook];
134
- onLog(LOG_LEVEL_WARN, logInputHookInOutputPlugin(plugin.name, hook));
135
- }
136
- return plugins;
137
- }
138
- function normalizePlugins(plugins, anonymousPrefix) {
139
- for (const [index, plugin] of plugins.entries()) {
140
- if ("_parallel" in plugin) continue;
141
- if (plugin instanceof BuiltinPlugin) continue;
142
- if (!plugin.name) plugin.name = `${anonymousPrefix}${index + 1}`;
143
- }
144
- return plugins;
145
- }
146
- const ANONYMOUS_PLUGIN_PREFIX = "at position ";
147
- const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = "at output position ";
148
- //#endregion
149
- //#region src/plugin/plugin-driver.ts
150
- var PluginDriver = class {
151
- static async callOptionsHook(inputOptions, watchMode = false) {
152
- const logLevel = inputOptions.logLevel || "info";
153
- const plugins = getSortedPlugins("options", getObjectPlugins(await normalizePluginOption(inputOptions.plugins)));
154
- const logger = getLogger(plugins, getOnLog(inputOptions, logLevel), logLevel, watchMode);
155
- for (const plugin of plugins) {
156
- const name = plugin.name || "unknown";
157
- const options = plugin.options;
158
- if (options) {
159
- const { handler } = normalizeHook(options);
160
- const result = await handler.call(new MinimalPluginContextImpl(logger, logLevel, name, watchMode, "onLog"), inputOptions);
161
- if (result) inputOptions = result;
162
- }
163
- }
164
- return inputOptions;
165
- }
166
- static callOutputOptionsHook(rawPlugins, outputOptions, onLog, logLevel, watchMode) {
167
- const sortedPlugins = getSortedPlugins("outputOptions", getObjectPlugins(rawPlugins));
168
- for (const plugin of sortedPlugins) {
169
- const name = plugin.name || "unknown";
170
- const options = plugin.outputOptions;
171
- if (options) {
172
- const { handler } = normalizeHook(options);
173
- const result = handler.call(new MinimalPluginContextImpl(onLog, logLevel, name, watchMode), outputOptions);
174
- if (result) outputOptions = result;
175
- }
176
- }
177
- return outputOptions;
178
- }
179
- };
180
- function getObjectPlugins(plugins) {
181
- return plugins.filter((plugin) => {
182
- if (!plugin) return;
183
- if ("_parallel" in plugin) return;
184
- if (plugin instanceof BuiltinPlugin) return;
185
- return plugin;
186
- });
187
- }
188
- function getSortedPlugins(hookName, plugins) {
189
- const pre = [];
190
- const normal = [];
191
- const post = [];
192
- for (const plugin of plugins) {
193
- const hook = plugin[hookName];
194
- if (hook) {
195
- if (typeof hook === "object") {
196
- if (hook.order === "pre") {
197
- pre.push(plugin);
198
- continue;
199
- }
200
- if (hook.order === "post") {
201
- post.push(plugin);
202
- continue;
203
- }
204
- }
205
- normal.push(plugin);
206
- }
207
- }
208
- return [
209
- ...pre,
210
- ...normal,
211
- ...post
212
- ];
213
- }
214
- const DEFAULT_CONFIG = {
215
- lang: void 0,
216
- message: void 0,
217
- abortEarly: void 0,
218
- abortPipeEarly: void 0
219
- };
220
- /**
221
- * Returns the global configuration.
222
- *
223
- * @param config The config to merge.
224
- *
225
- * @returns The configuration.
226
- */
227
- /* @__NO_SIDE_EFFECTS__ */
228
- function getGlobalConfig(config$1) {
229
- if (!config$1 && true) return DEFAULT_CONFIG;
230
- return {
231
- lang: config$1?.lang ?? void 0,
232
- message: config$1?.message,
233
- abortEarly: config$1?.abortEarly ?? void 0,
234
- abortPipeEarly: config$1?.abortPipeEarly ?? void 0
235
- };
236
- }
237
- /**
238
- * Stringifies an unknown input to a literal or type string.
239
- *
240
- * @param input The unknown input.
241
- *
242
- * @returns A literal or type string.
243
- *
244
- * @internal
245
- */
246
- /* @__NO_SIDE_EFFECTS__ */
247
- function _stringify(input) {
248
- const type = typeof input;
249
- if (type === "string") return `"${input}"`;
250
- if (type === "number" || type === "bigint" || type === "boolean") return `${input}`;
251
- if (type === "object" || type === "function") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null";
252
- return type;
253
- }
254
- /**
255
- * Adds an issue to the dataset.
256
- *
257
- * @param context The issue context.
258
- * @param label The issue label.
259
- * @param dataset The input dataset.
260
- * @param config The configuration.
261
- * @param other The optional props.
262
- *
263
- * @internal
264
- */
265
- function _addIssue(context, label, dataset, config$1, other) {
266
- const input = other && "input" in other ? other.input : dataset.value;
267
- const expected = other?.expected ?? context.expects ?? null;
268
- const received = other?.received ?? /* @__PURE__ */ _stringify(input);
269
- const issue = {
270
- kind: context.kind,
271
- type: context.type,
272
- input,
273
- expected,
274
- received,
275
- message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`,
276
- requirement: context.requirement,
277
- path: other?.path,
278
- issues: other?.issues,
279
- lang: config$1.lang,
280
- abortEarly: config$1.abortEarly,
281
- abortPipeEarly: config$1.abortPipeEarly
282
- };
283
- const isSchema = context.kind === "schema";
284
- const message$1 = other?.message ?? context.message ?? (context.reference, issue.lang, void 0) ?? (isSchema ? (issue.lang, void 0) : null) ?? config$1.message ?? (issue.lang, void 0);
285
- if (message$1 !== void 0) issue.message = typeof message$1 === "function" ? message$1(issue) : message$1;
286
- if (isSchema) dataset.typed = false;
287
- if (dataset.issues) dataset.issues.push(issue);
288
- else dataset.issues = [issue];
289
- }
290
- const _standardCache = /* @__PURE__ */ new WeakMap();
291
- /**
292
- * Returns the Standard Schema properties.
293
- *
294
- * @param context The schema context.
295
- *
296
- * @returns The Standard Schema properties.
297
- */
298
- /* @__NO_SIDE_EFFECTS__ */
299
- function _getStandardProps(context) {
300
- let cached = _standardCache.get(context);
301
- if (!cached) {
302
- cached = {
303
- version: 1,
304
- vendor: "valibot",
305
- validate(value$1) {
306
- return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig());
307
- }
308
- };
309
- _standardCache.set(context, cached);
310
- }
311
- return cached;
312
- }
313
- /**
314
- * Disallows inherited object properties and prevents object prototype
315
- * pollution by disallowing certain keys.
316
- *
317
- * @param object The object to check.
318
- * @param key The key to check.
319
- *
320
- * @returns Whether the key is allowed.
321
- *
322
- * @internal
323
- */
324
- /* @__NO_SIDE_EFFECTS__ */
325
- function _isValidObjectKey(object$1, key) {
326
- return Object.prototype.hasOwnProperty.call(object$1, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor";
327
- }
328
- /**
329
- * Joins multiple `expects` values with the given separator.
330
- *
331
- * @param values The `expects` values.
332
- * @param separator The separator.
333
- *
334
- * @returns The joined `expects` property.
335
- *
336
- * @internal
337
- */
338
- /* @__NO_SIDE_EFFECTS__ */
339
- function _joinExpects(values$1, separator) {
340
- const list = [...new Set(values$1)];
341
- if (list.length > 1) return `(${list.join(` ${separator} `)})`;
342
- return list[0] ?? "never";
343
- }
344
- /**
345
- * A Valibot error with useful information.
346
- */
347
- var ValiError = class extends Error {
348
- /**
349
- * Creates a Valibot error with useful information.
350
- *
351
- * @param issues The error issues.
352
- */
353
- constructor(issues) {
354
- super(issues[0].message);
355
- this.name = "ValiError";
356
- this.issues = issues;
357
- }
358
- };
359
- /* @__NO_SIDE_EFFECTS__ */
360
- function args(schema) {
361
- return {
362
- kind: "transformation",
363
- type: "args",
364
- reference: args,
365
- async: false,
366
- schema,
367
- "~run"(dataset, config$1) {
368
- const func = dataset.value;
369
- dataset.value = (...args_) => {
370
- const argsDataset = this.schema["~run"]({ value: args_ }, config$1);
371
- if (argsDataset.issues) throw new ValiError(argsDataset.issues);
372
- return func(...argsDataset.value);
373
- };
374
- return dataset;
375
- }
376
- };
377
- }
378
- /**
379
- * Creates an await transformation action.
380
- *
381
- * @returns An await action.
382
- */
383
- /* @__NO_SIDE_EFFECTS__ */
384
- function awaitAsync() {
385
- return {
386
- kind: "transformation",
387
- type: "await",
388
- reference: awaitAsync,
389
- async: true,
390
- async "~run"(dataset) {
391
- dataset.value = await dataset.value;
392
- return dataset;
393
- }
394
- };
395
- }
396
- /**
397
- * Creates a description metadata action.
398
- *
399
- * @param description_ The description text.
400
- *
401
- * @returns A description action.
402
- */
403
- /* @__NO_SIDE_EFFECTS__ */
404
- function description(description_) {
405
- return {
406
- kind: "metadata",
407
- type: "description",
408
- reference: description,
409
- description: description_
410
- };
411
- }
412
- /* @__NO_SIDE_EFFECTS__ */
413
- function returns(schema) {
414
- return {
415
- kind: "transformation",
416
- type: "returns",
417
- reference: returns,
418
- async: false,
419
- schema,
420
- "~run"(dataset, config$1) {
421
- const func = dataset.value;
422
- dataset.value = (...args_) => {
423
- const returnsDataset = this.schema["~run"]({ value: func(...args_) }, config$1);
424
- if (returnsDataset.issues) throw new ValiError(returnsDataset.issues);
425
- return returnsDataset.value;
426
- };
427
- return dataset;
428
- }
429
- };
430
- }
431
- /* @__NO_SIDE_EFFECTS__ */
432
- function returnsAsync(schema) {
433
- return {
434
- kind: "transformation",
435
- type: "returns",
436
- reference: returnsAsync,
437
- async: false,
438
- schema,
439
- "~run"(dataset, config$1) {
440
- const func = dataset.value;
441
- dataset.value = async (...args_) => {
442
- const returnsDataset = await this.schema["~run"]({ value: await func(...args_) }, config$1);
443
- if (returnsDataset.issues) throw new ValiError(returnsDataset.issues);
444
- return returnsDataset.value;
445
- };
446
- return dataset;
447
- }
448
- };
449
- }
450
- const ABORT_EARLY_CONFIG = { abortEarly: true };
451
- /**
452
- * Returns the fallback value of the schema.
453
- *
454
- * @param schema The schema to get it from.
455
- * @param dataset The output dataset if available.
456
- * @param config The config if available.
457
- *
458
- * @returns The fallback value.
459
- */
460
- /* @__NO_SIDE_EFFECTS__ */
461
- function getFallback(schema, dataset, config$1) {
462
- return typeof schema.fallback === "function" ? schema.fallback(dataset, config$1) : schema.fallback;
463
- }
464
- /**
465
- * Returns the default value of the schema.
466
- *
467
- * @param schema The schema to get it from.
468
- * @param dataset The input dataset if available.
469
- * @param config The config if available.
470
- *
471
- * @returns The default value.
472
- */
473
- /* @__NO_SIDE_EFFECTS__ */
474
- function getDefault(schema, dataset, config$1) {
475
- return typeof schema.default === "function" ? schema.default(dataset, config$1) : schema.default;
476
- }
477
- /**
478
- * Checks if the input matches the schema. By using a type predicate, this
479
- * function can be used as a type guard.
480
- *
481
- * @param schema The schema to be used.
482
- * @param input The input to be tested.
483
- *
484
- * @returns Whether the input matches the schema.
485
- */
486
- /* @__NO_SIDE_EFFECTS__ */
487
- function is(schema, input) {
488
- return !schema["~run"]({ value: input }, ABORT_EARLY_CONFIG).issues;
489
- }
490
- /**
491
- * Creates an any schema.
492
- *
493
- * Hint: This schema function exists only for completeness and is not
494
- * recommended in practice. Instead, `unknown` should be used to accept
495
- * unknown data.
496
- *
497
- * @returns An any schema.
498
- */
499
- /* @__NO_SIDE_EFFECTS__ */
500
- function any() {
501
- return {
502
- kind: "schema",
503
- type: "any",
504
- reference: any,
505
- expects: "any",
506
- async: false,
507
- get "~standard"() {
508
- return /* @__PURE__ */ _getStandardProps(this);
509
- },
510
- "~run"(dataset) {
511
- dataset.typed = true;
512
- return dataset;
513
- }
514
- };
515
- }
516
- /* @__NO_SIDE_EFFECTS__ */
517
- function array(item, message$1) {
518
- return {
519
- kind: "schema",
520
- type: "array",
521
- reference: array,
522
- expects: "Array",
523
- async: false,
524
- item,
525
- message: message$1,
526
- get "~standard"() {
527
- return /* @__PURE__ */ _getStandardProps(this);
528
- },
529
- "~run"(dataset, config$1) {
530
- const input = dataset.value;
531
- if (Array.isArray(input)) {
532
- dataset.typed = true;
533
- dataset.value = [];
534
- for (let key = 0; key < input.length; key++) {
535
- const value$1 = input[key];
536
- const itemDataset = this.item["~run"]({ value: value$1 }, config$1);
537
- if (itemDataset.issues) {
538
- const pathItem = {
539
- type: "array",
540
- origin: "value",
541
- input,
542
- key,
543
- value: value$1
544
- };
545
- for (const issue of itemDataset.issues) {
546
- if (issue.path) issue.path.unshift(pathItem);
547
- else issue.path = [pathItem];
548
- dataset.issues?.push(issue);
549
- }
550
- if (!dataset.issues) dataset.issues = itemDataset.issues;
551
- if (config$1.abortEarly) {
552
- dataset.typed = false;
553
- break;
554
- }
555
- }
556
- if (!itemDataset.typed) dataset.typed = false;
557
- dataset.value.push(itemDataset.value);
558
- }
559
- } else _addIssue(this, "type", dataset, config$1);
560
- return dataset;
561
- }
562
- };
563
- }
564
- /* @__NO_SIDE_EFFECTS__ */
565
- function boolean(message$1) {
566
- return {
567
- kind: "schema",
568
- type: "boolean",
569
- reference: boolean,
570
- expects: "boolean",
571
- async: false,
572
- message: message$1,
573
- get "~standard"() {
574
- return /* @__PURE__ */ _getStandardProps(this);
575
- },
576
- "~run"(dataset, config$1) {
577
- if (typeof dataset.value === "boolean") dataset.typed = true;
578
- else _addIssue(this, "type", dataset, config$1);
579
- return dataset;
580
- }
581
- };
582
- }
583
- /* @__NO_SIDE_EFFECTS__ */
584
- function custom(check$1, message$1) {
585
- return {
586
- kind: "schema",
587
- type: "custom",
588
- reference: custom,
589
- expects: "unknown",
590
- async: false,
591
- check: check$1,
592
- message: message$1,
593
- get "~standard"() {
594
- return /* @__PURE__ */ _getStandardProps(this);
595
- },
596
- "~run"(dataset, config$1) {
597
- if (this.check(dataset.value)) dataset.typed = true;
598
- else _addIssue(this, "type", dataset, config$1);
599
- return dataset;
600
- }
601
- };
602
- }
603
- /* @__NO_SIDE_EFFECTS__ */
604
- function function_(message$1) {
605
- return {
606
- kind: "schema",
607
- type: "function",
608
- reference: function_,
609
- expects: "Function",
610
- async: false,
611
- message: message$1,
612
- get "~standard"() {
613
- return /* @__PURE__ */ _getStandardProps(this);
614
- },
615
- "~run"(dataset, config$1) {
616
- if (typeof dataset.value === "function") dataset.typed = true;
617
- else _addIssue(this, "type", dataset, config$1);
618
- return dataset;
619
- }
620
- };
621
- }
622
- /* @__NO_SIDE_EFFECTS__ */
623
- function instance(class_, message$1) {
624
- return {
625
- kind: "schema",
626
- type: "instance",
627
- reference: instance,
628
- expects: class_.name,
629
- async: false,
630
- class: class_,
631
- message: message$1,
632
- get "~standard"() {
633
- return /* @__PURE__ */ _getStandardProps(this);
634
- },
635
- "~run"(dataset, config$1) {
636
- if (dataset.value instanceof this.class) dataset.typed = true;
637
- else _addIssue(this, "type", dataset, config$1);
638
- return dataset;
639
- }
640
- };
641
- }
642
- /* @__NO_SIDE_EFFECTS__ */
643
- function literal(literal_, message$1) {
644
- return {
645
- kind: "schema",
646
- type: "literal",
647
- reference: literal,
648
- expects: /* @__PURE__ */ _stringify(literal_),
649
- async: false,
650
- literal: literal_,
651
- message: message$1,
652
- get "~standard"() {
653
- return /* @__PURE__ */ _getStandardProps(this);
654
- },
655
- "~run"(dataset, config$1) {
656
- if (dataset.value === this.literal) dataset.typed = true;
657
- else _addIssue(this, "type", dataset, config$1);
658
- return dataset;
659
- }
660
- };
661
- }
662
- /* @__NO_SIDE_EFFECTS__ */
663
- function never(message$1) {
664
- return {
665
- kind: "schema",
666
- type: "never",
667
- reference: never,
668
- expects: "never",
669
- async: false,
670
- message: message$1,
671
- get "~standard"() {
672
- return /* @__PURE__ */ _getStandardProps(this);
673
- },
674
- "~run"(dataset, config$1) {
675
- _addIssue(this, "type", dataset, config$1);
676
- return dataset;
677
- }
678
- };
679
- }
680
- /* @__NO_SIDE_EFFECTS__ */
681
- function nullish(wrapped, default_) {
682
- return {
683
- kind: "schema",
684
- type: "nullish",
685
- reference: nullish,
686
- expects: `(${wrapped.expects} | null | undefined)`,
687
- async: false,
688
- wrapped,
689
- default: default_,
690
- get "~standard"() {
691
- return /* @__PURE__ */ _getStandardProps(this);
692
- },
693
- "~run"(dataset, config$1) {
694
- if (dataset.value === null || dataset.value === void 0) {
695
- if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
696
- if (dataset.value === null || dataset.value === void 0) {
697
- dataset.typed = true;
698
- return dataset;
699
- }
700
- }
701
- return this.wrapped["~run"](dataset, config$1);
702
- }
703
- };
704
- }
705
- /* @__NO_SIDE_EFFECTS__ */
706
- function number(message$1) {
707
- return {
708
- kind: "schema",
709
- type: "number",
710
- reference: number,
711
- expects: "number",
712
- async: false,
713
- message: message$1,
714
- get "~standard"() {
715
- return /* @__PURE__ */ _getStandardProps(this);
716
- },
717
- "~run"(dataset, config$1) {
718
- if (typeof dataset.value === "number" && !isNaN(dataset.value)) dataset.typed = true;
719
- else _addIssue(this, "type", dataset, config$1);
720
- return dataset;
721
- }
722
- };
723
- }
724
- /* @__NO_SIDE_EFFECTS__ */
725
- function object(entries$1, message$1) {
726
- return {
727
- kind: "schema",
728
- type: "object",
729
- reference: object,
730
- expects: "Object",
731
- async: false,
732
- entries: entries$1,
733
- message: message$1,
734
- get "~standard"() {
735
- return /* @__PURE__ */ _getStandardProps(this);
736
- },
737
- "~run"(dataset, config$1) {
738
- const input = dataset.value;
739
- if (input && typeof input === "object") {
740
- dataset.typed = true;
741
- dataset.value = {};
742
- for (const key in this.entries) {
743
- const valueSchema = this.entries[key];
744
- if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
745
- const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
746
- const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
747
- if (valueDataset.issues) {
748
- const pathItem = {
749
- type: "object",
750
- origin: "value",
751
- input,
752
- key,
753
- value: value$1
754
- };
755
- for (const issue of valueDataset.issues) {
756
- if (issue.path) issue.path.unshift(pathItem);
757
- else issue.path = [pathItem];
758
- dataset.issues?.push(issue);
759
- }
760
- if (!dataset.issues) dataset.issues = valueDataset.issues;
761
- if (config$1.abortEarly) {
762
- dataset.typed = false;
763
- break;
764
- }
765
- }
766
- if (!valueDataset.typed) dataset.typed = false;
767
- dataset.value[key] = valueDataset.value;
768
- } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
769
- else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
770
- _addIssue(this, "key", dataset, config$1, {
771
- input: void 0,
772
- expected: `"${key}"`,
773
- path: [{
774
- type: "object",
775
- origin: "key",
776
- input,
777
- key,
778
- value: input[key]
779
- }]
780
- });
781
- if (config$1.abortEarly) break;
782
- }
783
- }
784
- } else _addIssue(this, "type", dataset, config$1);
785
- return dataset;
786
- }
787
- };
788
- }
789
- /* @__NO_SIDE_EFFECTS__ */
790
- function optional(wrapped, default_) {
791
- return {
792
- kind: "schema",
793
- type: "optional",
794
- reference: optional,
795
- expects: `(${wrapped.expects} | undefined)`,
796
- async: false,
797
- wrapped,
798
- default: default_,
799
- get "~standard"() {
800
- return /* @__PURE__ */ _getStandardProps(this);
801
- },
802
- "~run"(dataset, config$1) {
803
- if (dataset.value === void 0) {
804
- if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1);
805
- if (dataset.value === void 0) {
806
- dataset.typed = true;
807
- return dataset;
808
- }
809
- }
810
- return this.wrapped["~run"](dataset, config$1);
811
- }
812
- };
813
- }
814
- /* @__NO_SIDE_EFFECTS__ */
815
- function picklist(options, message$1) {
816
- return {
817
- kind: "schema",
818
- type: "picklist",
819
- reference: picklist,
820
- expects: /* @__PURE__ */ _joinExpects(options.map(_stringify), "|"),
821
- async: false,
822
- options,
823
- message: message$1,
824
- get "~standard"() {
825
- return /* @__PURE__ */ _getStandardProps(this);
826
- },
827
- "~run"(dataset, config$1) {
828
- if (this.options.includes(dataset.value)) dataset.typed = true;
829
- else _addIssue(this, "type", dataset, config$1);
830
- return dataset;
831
- }
832
- };
833
- }
834
- /* @__NO_SIDE_EFFECTS__ */
835
- function promise(message$1) {
836
- return {
837
- kind: "schema",
838
- type: "promise",
839
- reference: promise,
840
- expects: "Promise",
841
- async: false,
842
- message: message$1,
843
- get "~standard"() {
844
- return /* @__PURE__ */ _getStandardProps(this);
845
- },
846
- "~run"(dataset, config$1) {
847
- if (dataset.value instanceof Promise) dataset.typed = true;
848
- else _addIssue(this, "type", dataset, config$1);
849
- return dataset;
850
- }
851
- };
852
- }
853
- /* @__NO_SIDE_EFFECTS__ */
854
- function record(key, value$1, message$1) {
855
- return {
856
- kind: "schema",
857
- type: "record",
858
- reference: record,
859
- expects: "Object",
860
- async: false,
861
- key,
862
- value: value$1,
863
- message: message$1,
864
- get "~standard"() {
865
- return /* @__PURE__ */ _getStandardProps(this);
866
- },
867
- "~run"(dataset, config$1) {
868
- const input = dataset.value;
869
- if (input && typeof input === "object") {
870
- dataset.typed = true;
871
- dataset.value = {};
872
- for (const entryKey in input) if (/* @__PURE__ */ _isValidObjectKey(input, entryKey)) {
873
- const entryValue = input[entryKey];
874
- const keyDataset = this.key["~run"]({ value: entryKey }, config$1);
875
- if (keyDataset.issues) {
876
- const pathItem = {
877
- type: "object",
878
- origin: "key",
879
- input,
880
- key: entryKey,
881
- value: entryValue
882
- };
883
- for (const issue of keyDataset.issues) {
884
- issue.path = [pathItem];
885
- dataset.issues?.push(issue);
886
- }
887
- if (!dataset.issues) dataset.issues = keyDataset.issues;
888
- if (config$1.abortEarly) {
889
- dataset.typed = false;
890
- break;
891
- }
892
- }
893
- const valueDataset = this.value["~run"]({ value: entryValue }, config$1);
894
- if (valueDataset.issues) {
895
- const pathItem = {
896
- type: "object",
897
- origin: "value",
898
- input,
899
- key: entryKey,
900
- value: entryValue
901
- };
902
- for (const issue of valueDataset.issues) {
903
- if (issue.path) issue.path.unshift(pathItem);
904
- else issue.path = [pathItem];
905
- dataset.issues?.push(issue);
906
- }
907
- if (!dataset.issues) dataset.issues = valueDataset.issues;
908
- if (config$1.abortEarly) {
909
- dataset.typed = false;
910
- break;
911
- }
912
- }
913
- if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false;
914
- if (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value;
915
- }
916
- } else _addIssue(this, "type", dataset, config$1);
917
- return dataset;
918
- }
919
- };
920
- }
921
- /* @__NO_SIDE_EFFECTS__ */
922
- function strictObject(entries$1, message$1) {
923
- return {
924
- kind: "schema",
925
- type: "strict_object",
926
- reference: strictObject,
927
- expects: "Object",
928
- async: false,
929
- entries: entries$1,
930
- message: message$1,
931
- get "~standard"() {
932
- return /* @__PURE__ */ _getStandardProps(this);
933
- },
934
- "~run"(dataset, config$1) {
935
- const input = dataset.value;
936
- if (input && typeof input === "object") {
937
- dataset.typed = true;
938
- dataset.value = {};
939
- for (const key in this.entries) {
940
- const valueSchema = this.entries[key];
941
- if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) {
942
- const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema);
943
- const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1);
944
- if (valueDataset.issues) {
945
- const pathItem = {
946
- type: "object",
947
- origin: "value",
948
- input,
949
- key,
950
- value: value$1
951
- };
952
- for (const issue of valueDataset.issues) {
953
- if (issue.path) issue.path.unshift(pathItem);
954
- else issue.path = [pathItem];
955
- dataset.issues?.push(issue);
956
- }
957
- if (!dataset.issues) dataset.issues = valueDataset.issues;
958
- if (config$1.abortEarly) {
959
- dataset.typed = false;
960
- break;
961
- }
962
- }
963
- if (!valueDataset.typed) dataset.typed = false;
964
- dataset.value[key] = valueDataset.value;
965
- } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema);
966
- else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") {
967
- _addIssue(this, "key", dataset, config$1, {
968
- input: void 0,
969
- expected: `"${key}"`,
970
- path: [{
971
- type: "object",
972
- origin: "key",
973
- input,
974
- key,
975
- value: input[key]
976
- }]
977
- });
978
- if (config$1.abortEarly) break;
979
- }
980
- }
981
- if (!dataset.issues || !config$1.abortEarly) {
982
- for (const key in input) if (!(key in this.entries)) {
983
- _addIssue(this, "key", dataset, config$1, {
984
- input: key,
985
- expected: "never",
986
- path: [{
987
- type: "object",
988
- origin: "key",
989
- input,
990
- key,
991
- value: input[key]
992
- }]
993
- });
994
- break;
995
- }
996
- }
997
- } else _addIssue(this, "type", dataset, config$1);
998
- return dataset;
999
- }
1000
- };
1001
- }
1002
- /* @__NO_SIDE_EFFECTS__ */
1003
- function string(message$1) {
1004
- return {
1005
- kind: "schema",
1006
- type: "string",
1007
- reference: string,
1008
- expects: "string",
1009
- async: false,
1010
- message: message$1,
1011
- get "~standard"() {
1012
- return /* @__PURE__ */ _getStandardProps(this);
1013
- },
1014
- "~run"(dataset, config$1) {
1015
- if (typeof dataset.value === "string") dataset.typed = true;
1016
- else _addIssue(this, "type", dataset, config$1);
1017
- return dataset;
1018
- }
1019
- };
1020
- }
1021
- /* @__NO_SIDE_EFFECTS__ */
1022
- function tuple(items, message$1) {
1023
- return {
1024
- kind: "schema",
1025
- type: "tuple",
1026
- reference: tuple,
1027
- expects: "Array",
1028
- async: false,
1029
- items,
1030
- message: message$1,
1031
- get "~standard"() {
1032
- return /* @__PURE__ */ _getStandardProps(this);
1033
- },
1034
- "~run"(dataset, config$1) {
1035
- const input = dataset.value;
1036
- if (Array.isArray(input)) {
1037
- dataset.typed = true;
1038
- dataset.value = [];
1039
- for (let key = 0; key < this.items.length; key++) {
1040
- const value$1 = input[key];
1041
- const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1);
1042
- if (itemDataset.issues) {
1043
- const pathItem = {
1044
- type: "array",
1045
- origin: "value",
1046
- input,
1047
- key,
1048
- value: value$1
1049
- };
1050
- for (const issue of itemDataset.issues) {
1051
- if (issue.path) issue.path.unshift(pathItem);
1052
- else issue.path = [pathItem];
1053
- dataset.issues?.push(issue);
1054
- }
1055
- if (!dataset.issues) dataset.issues = itemDataset.issues;
1056
- if (config$1.abortEarly) {
1057
- dataset.typed = false;
1058
- break;
1059
- }
1060
- }
1061
- if (!itemDataset.typed) dataset.typed = false;
1062
- dataset.value.push(itemDataset.value);
1063
- }
1064
- } else _addIssue(this, "type", dataset, config$1);
1065
- return dataset;
1066
- }
1067
- };
1068
- }
1069
- /* @__NO_SIDE_EFFECTS__ */
1070
- function undefined_(message$1) {
1071
- return {
1072
- kind: "schema",
1073
- type: "undefined",
1074
- reference: undefined_,
1075
- expects: "undefined",
1076
- async: false,
1077
- message: message$1,
1078
- get "~standard"() {
1079
- return /* @__PURE__ */ _getStandardProps(this);
1080
- },
1081
- "~run"(dataset, config$1) {
1082
- if (dataset.value === void 0) dataset.typed = true;
1083
- else _addIssue(this, "type", dataset, config$1);
1084
- return dataset;
1085
- }
1086
- };
1087
- }
1088
- /**
1089
- * Returns the sub issues of the provided datasets for the union issue.
1090
- *
1091
- * @param datasets The datasets.
1092
- *
1093
- * @returns The sub issues.
1094
- *
1095
- * @internal
1096
- */
1097
- /* @__NO_SIDE_EFFECTS__ */
1098
- function _subIssues(datasets) {
1099
- let issues;
1100
- if (datasets) for (const dataset of datasets) if (issues) for (const issue of dataset.issues) issues.push(issue);
1101
- else issues = dataset.issues;
1102
- return issues;
1103
- }
1104
- /* @__NO_SIDE_EFFECTS__ */
1105
- function union(options, message$1) {
1106
- return {
1107
- kind: "schema",
1108
- type: "union",
1109
- reference: union,
1110
- expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"),
1111
- async: false,
1112
- options,
1113
- message: message$1,
1114
- get "~standard"() {
1115
- return /* @__PURE__ */ _getStandardProps(this);
1116
- },
1117
- "~run"(dataset, config$1) {
1118
- let validDataset;
1119
- let typedDatasets;
1120
- let untypedDatasets;
1121
- for (const schema of this.options) {
1122
- const optionDataset = schema["~run"]({ value: dataset.value }, config$1);
1123
- if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);
1124
- else typedDatasets = [optionDataset];
1125
- else {
1126
- validDataset = optionDataset;
1127
- break;
1128
- }
1129
- else if (untypedDatasets) untypedDatasets.push(optionDataset);
1130
- else untypedDatasets = [optionDataset];
1131
- }
1132
- if (validDataset) return validDataset;
1133
- if (typedDatasets) {
1134
- if (typedDatasets.length === 1) return typedDatasets[0];
1135
- _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });
1136
- dataset.typed = true;
1137
- } else if (untypedDatasets?.length === 1) return untypedDatasets[0];
1138
- else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });
1139
- return dataset;
1140
- }
1141
- };
1142
- }
1143
- /* @__NO_SIDE_EFFECTS__ */
1144
- function unionAsync(options, message$1) {
1145
- return {
1146
- kind: "schema",
1147
- type: "union",
1148
- reference: unionAsync,
1149
- expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"),
1150
- async: true,
1151
- options,
1152
- message: message$1,
1153
- get "~standard"() {
1154
- return /* @__PURE__ */ _getStandardProps(this);
1155
- },
1156
- async "~run"(dataset, config$1) {
1157
- let validDataset;
1158
- let typedDatasets;
1159
- let untypedDatasets;
1160
- for (const schema of this.options) {
1161
- const optionDataset = await schema["~run"]({ value: dataset.value }, config$1);
1162
- if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset);
1163
- else typedDatasets = [optionDataset];
1164
- else {
1165
- validDataset = optionDataset;
1166
- break;
1167
- }
1168
- else if (untypedDatasets) untypedDatasets.push(optionDataset);
1169
- else untypedDatasets = [optionDataset];
1170
- }
1171
- if (validDataset) return validDataset;
1172
- if (typedDatasets) {
1173
- if (typedDatasets.length === 1) return typedDatasets[0];
1174
- _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) });
1175
- dataset.typed = true;
1176
- } else if (untypedDatasets?.length === 1) return untypedDatasets[0];
1177
- else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) });
1178
- return dataset;
1179
- }
1180
- };
1181
- }
1182
- /* @__NO_SIDE_EFFECTS__ */
1183
- function void_(message$1) {
1184
- return {
1185
- kind: "schema",
1186
- type: "void",
1187
- reference: void_,
1188
- expects: "void",
1189
- async: false,
1190
- message: message$1,
1191
- get "~standard"() {
1192
- return /* @__PURE__ */ _getStandardProps(this);
1193
- },
1194
- "~run"(dataset, config$1) {
1195
- if (dataset.value === void 0) dataset.typed = true;
1196
- else _addIssue(this, "type", dataset, config$1);
1197
- return dataset;
1198
- }
1199
- };
1200
- }
1201
- /* @__NO_SIDE_EFFECTS__ */
1202
- function keyof(schema, message$1) {
1203
- return /* @__PURE__ */ picklist(Object.keys(schema.entries), message$1);
1204
- }
1205
- /**
1206
- * Creates a modified copy of an object schema that does not contain the
1207
- * selected entries.
1208
- *
1209
- * @param schema The schema to omit from.
1210
- * @param keys The selected entries.
1211
- *
1212
- * @returns An object schema.
1213
- */
1214
- /* @__NO_SIDE_EFFECTS__ */
1215
- function omit(schema, keys) {
1216
- const entries$1 = { ...schema.entries };
1217
- for (const key of keys) delete entries$1[key];
1218
- return {
1219
- ...schema,
1220
- entries: entries$1,
1221
- get "~standard"() {
1222
- return /* @__PURE__ */ _getStandardProps(this);
1223
- }
1224
- };
1225
- }
1226
- /* @__NO_SIDE_EFFECTS__ */
1227
- function partial(schema, keys) {
1228
- const entries$1 = {};
1229
- for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optional(schema.entries[key]) : schema.entries[key];
1230
- return {
1231
- ...schema,
1232
- entries: entries$1,
1233
- get "~standard"() {
1234
- return /* @__PURE__ */ _getStandardProps(this);
1235
- }
1236
- };
1237
- }
1238
- /* @__NO_SIDE_EFFECTS__ */
1239
- function pipe(...pipe$1) {
1240
- return {
1241
- ...pipe$1[0],
1242
- pipe: pipe$1,
1243
- get "~standard"() {
1244
- return /* @__PURE__ */ _getStandardProps(this);
1245
- },
1246
- "~run"(dataset, config$1) {
1247
- for (const item of pipe$1) if (item.kind !== "metadata") {
1248
- if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
1249
- dataset.typed = false;
1250
- break;
1251
- }
1252
- if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item["~run"](dataset, config$1);
1253
- }
1254
- return dataset;
1255
- }
1256
- };
1257
- }
1258
- /* @__NO_SIDE_EFFECTS__ */
1259
- function pipeAsync(...pipe$1) {
1260
- return {
1261
- ...pipe$1[0],
1262
- pipe: pipe$1,
1263
- async: true,
1264
- get "~standard"() {
1265
- return /* @__PURE__ */ _getStandardProps(this);
1266
- },
1267
- async "~run"(dataset, config$1) {
1268
- for (const item of pipe$1) if (item.kind !== "metadata") {
1269
- if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) {
1270
- dataset.typed = false;
1271
- break;
1272
- }
1273
- if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = await item["~run"](dataset, config$1);
1274
- }
1275
- return dataset;
1276
- }
1277
- };
1278
- }
1279
- /**
1280
- * Parses an unknown input based on a schema.
1281
- *
1282
- * @param schema The schema to be used.
1283
- * @param input The input to be parsed.
1284
- * @param config The parse configuration.
1285
- *
1286
- * @returns The parse result.
1287
- */
1288
- /* @__NO_SIDE_EFFECTS__ */
1289
- function safeParse(schema, input, config$1) {
1290
- const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1));
1291
- return {
1292
- typed: dataset.typed,
1293
- success: !dataset.issues,
1294
- output: dataset.value,
1295
- issues: dataset.issues
1296
- };
1297
- }
1298
- //#endregion
1299
- //#region src/utils/flatten-valibot-schema.ts
1300
- function unwrapSchema(schema) {
1301
- if (!schema) return schema;
1302
- if (schema.type === "optional" && schema.wrapped) return unwrapSchema(schema.wrapped);
1303
- if (schema.type === "nullable" && schema.wrapped) return unwrapSchema(schema.wrapped);
1304
- if (schema.type === "nullish" && schema.wrapped) return unwrapSchema(schema.wrapped);
1305
- return schema;
1306
- }
1307
- function getValibotSchemaType(schema) {
1308
- if (!schema) return "any";
1309
- if (schema.type) switch (schema.type) {
1310
- case "string": return "string";
1311
- case "number": return "number";
1312
- case "boolean": return "boolean";
1313
- case "array": return "array";
1314
- case "object":
1315
- case "strict_object":
1316
- case "loose_object": return "object";
1317
- case "union": return "union";
1318
- case "literal": return typeof schema.literal;
1319
- case "record": return "object";
1320
- case "optional": return getValibotSchemaType(schema.wrapped);
1321
- case "nullable": return getValibotSchemaType(schema.wrapped);
1322
- case "nullish": return getValibotSchemaType(schema.wrapped);
1323
- case "never": return "never";
1324
- case "any": return "any";
1325
- case "custom": return "any";
1326
- case "function": return "never";
1327
- case "instance": return "object";
1328
- default: return "any";
1329
- }
1330
- return "any";
1331
- }
1332
- function getValibotDescription(schema) {
1333
- if (!schema) return void 0;
1334
- if (schema.pipe && Array.isArray(schema.pipe)) {
1335
- for (const action of schema.pipe) if (action.type === "description" && action.description) return action.description;
1336
- }
1337
- if (schema.type === "optional" && schema.wrapped) return getValibotDescription(schema.wrapped);
1338
- }
1339
- function flattenValibotSchema(schema, result = {}, prefix = "") {
1340
- if (!schema || typeof schema !== "object") return result;
1341
- if (schema.type === "strict_object" || schema.type === "object" || schema.type === "loose_object") {
1342
- if (schema.entries && typeof schema.entries === "object") for (const [key, value] of Object.entries(schema.entries)) {
1343
- const fullKey = prefix ? `${prefix}.${key}` : key;
1344
- const valueSchema = value;
1345
- const type = getValibotSchemaType(valueSchema);
1346
- const description = getValibotDescription(valueSchema);
1347
- if (type === "object") {
1348
- const unwrappedSchema = unwrapSchema(valueSchema);
1349
- if (unwrappedSchema && unwrappedSchema.entries) flattenValibotSchema(unwrappedSchema, result, fullKey);
1350
- else result[fullKey] = {
1351
- type,
1352
- description
1353
- };
1354
- } else result[fullKey] = {
1355
- type,
1356
- description
1357
- };
1358
- }
1359
- }
1360
- return result;
1361
- }
1362
- //#endregion
1363
- //#region src/utils/style-text.ts
1364
- /**
1365
- * Cross-platform styleText utility that works in both Node.js and browser environments
1366
- * In Node.js, it uses the native `styleText` from `node:util`
1367
- * In browser, it provides empty styling functions for compatibility
1368
- */
1369
- function styleText$1(...args) {
1370
- return styleText(...args);
1371
- }
1372
- //#endregion
1373
- //#region src/utils/validator.ts
1374
- const StringOrRegExpSchema = /* @__PURE__ */ union([/* @__PURE__ */ string(), /* @__PURE__ */ instance(RegExp)]);
1375
- function vFunction() {
1376
- return /* @__PURE__ */ function_();
1377
- }
1378
- const LogLevelSchema = /* @__PURE__ */ union([
1379
- /* @__PURE__ */ literal("debug"),
1380
- /* @__PURE__ */ literal("info"),
1381
- /* @__PURE__ */ literal("warn")
1382
- ]);
1383
- const LogLevelOptionSchema = /* @__PURE__ */ union([LogLevelSchema, /* @__PURE__ */ literal("silent")]);
1384
- const LogLevelWithErrorSchema = /* @__PURE__ */ union([LogLevelSchema, /* @__PURE__ */ literal("error")]);
1385
- const RollupLogSchema = /* @__PURE__ */ any();
1386
- const RollupLogWithStringSchema = /* @__PURE__ */ union([RollupLogSchema, /* @__PURE__ */ string()]);
1387
- const InputOptionSchema = /* @__PURE__ */ union([
1388
- /* @__PURE__ */ string(),
1389
- /* @__PURE__ */ array(/* @__PURE__ */ string()),
1390
- /* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ string())
1391
- ]);
1392
- const ExternalOptionFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([
1393
- /* @__PURE__ */ string(),
1394
- /* @__PURE__ */ optional(/* @__PURE__ */ string()),
1395
- /* @__PURE__ */ boolean()
1396
- ])), /* @__PURE__ */ returns(/* @__PURE__ */ nullish(/* @__PURE__ */ boolean())));
1397
- const ExternalOptionSchema = /* @__PURE__ */ union([
1398
- StringOrRegExpSchema,
1399
- /* @__PURE__ */ array(StringOrRegExpSchema),
1400
- ExternalOptionFunctionSchema
1401
- ]);
1402
- const ModuleTypesSchema = /* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ union([
1403
- /* @__PURE__ */ literal("asset"),
1404
- /* @__PURE__ */ literal("base64"),
1405
- /* @__PURE__ */ literal("binary"),
1406
- /* @__PURE__ */ literal("copy"),
1407
- /* @__PURE__ */ literal("css"),
1408
- /* @__PURE__ */ literal("dataurl"),
1409
- /* @__PURE__ */ literal("empty"),
1410
- /* @__PURE__ */ literal("js"),
1411
- /* @__PURE__ */ literal("json"),
1412
- /* @__PURE__ */ literal("jsx"),
1413
- /* @__PURE__ */ literal("text"),
1414
- /* @__PURE__ */ literal("ts"),
1415
- /* @__PURE__ */ literal("tsx")
1416
- ]));
1417
- const TransformOptionsSchema = /* @__PURE__ */ object({
1418
- assumptions: /* @__PURE__ */ optional(/* @__PURE__ */ object({
1419
- ignoreFunctionLength: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1420
- noDocumentAll: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1421
- objectRestNoSymbols: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1422
- pureGetters: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1423
- setPublicClassFields: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
1424
- })),
1425
- typescript: /* @__PURE__ */ optional(/* @__PURE__ */ object({
1426
- jsxPragma: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
1427
- jsxPragmaFrag: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
1428
- onlyRemoveTypeImports: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1429
- allowNamespaces: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1430
- allowDeclareFields: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1431
- removeClassFieldsWithoutInitializer: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1432
- optimizeConstEnums: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1433
- optimizeEnums: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1434
- declaration: /* @__PURE__ */ optional(/* @__PURE__ */ object({
1435
- stripInternal: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1436
- sourcemap: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
1437
- })),
1438
- rewriteImportExtensions: /* @__PURE__ */ optional(/* @__PURE__ */ union([
1439
- /* @__PURE__ */ literal("rewrite"),
1440
- /* @__PURE__ */ literal("remove"),
1441
- /* @__PURE__ */ boolean()
1442
- ]))
1443
- })),
1444
- helpers: /* @__PURE__ */ optional(/* @__PURE__ */ object({ mode: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ literal("Runtime"), /* @__PURE__ */ literal("External")])) })),
1445
- decorator: /* @__PURE__ */ optional(/* @__PURE__ */ object({
1446
- legacy: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1447
- emitDecoratorMetadata: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1448
- strictNullChecks: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
1449
- })),
1450
- jsx: /* @__PURE__ */ optional(/* @__PURE__ */ union([
1451
- /* @__PURE__ */ literal(false),
1452
- /* @__PURE__ */ literal("preserve"),
1453
- /* @__PURE__ */ literal("react"),
1454
- /* @__PURE__ */ literal("react-jsx"),
1455
- /* @__PURE__ */ strictObject({
1456
- runtime: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ literal("classic"), /* @__PURE__ */ literal("automatic")])), /* @__PURE__ */ description("Which runtime to use")),
1457
- development: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Development specific information")),
1458
- throwIfNamespace: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Toggles whether to throw an error when a tag name uses an XML namespace")),
1459
- pure: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Mark JSX elements and top-level React method calls as pure for tree shaking.")),
1460
- importSource: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Import the factory of element and fragment if mode is classic")),
1461
- pragma: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Jsx element transformation")),
1462
- pragmaFrag: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Jsx fragment transformation")),
1463
- refresh: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ any()])), /* @__PURE__ */ description("Enable react fast refresh"))
1464
- })
1465
- ])),
1466
- target: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), /* @__PURE__ */ array(/* @__PURE__ */ string())])), /* @__PURE__ */ description("The JavaScript target environment")),
1467
- define: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ string())), /* @__PURE__ */ description("Define global variables (syntax: key:value,key2:value2)")),
1468
- inject: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ union([/* @__PURE__ */ string(), /* @__PURE__ */ tuple([/* @__PURE__ */ string(), /* @__PURE__ */ string()])]))), /* @__PURE__ */ description("Inject import statements on demand")),
1469
- dropLabels: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())), /* @__PURE__ */ description("Remove labeled statements with these label names")),
1470
- plugins: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ object({
1471
- styledComponents: /* @__PURE__ */ optional(/* @__PURE__ */ any()),
1472
- taggedTemplateEscape: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
1473
- })), /* @__PURE__ */ description("Third-party plugins to use"))
1474
- });
1475
- const WatcherFileWatcherOptionsSchema = /* @__PURE__ */ strictObject({
1476
- usePolling: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Use polling-based file watching instead of native OS events")),
1477
- pollInterval: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Poll interval in milliseconds (only used when usePolling is true)")),
1478
- compareContentsForPolling: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Compare file contents for poll-based watchers (only used when usePolling is true)")),
1479
- useDebounce: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Use debounced event delivery at the filesystem level")),
1480
- debounceDelay: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Debounce delay in milliseconds (only used when useDebounce is true)")),
1481
- debounceTickRate: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Tick rate in milliseconds for debouncer (only used when useDebounce is true)"))
1482
- });
1483
- const WatcherOptionsSchema = /* @__PURE__ */ strictObject({
1484
- chokidar: /* @__PURE__ */ optional(/* @__PURE__ */ never(`The "watch.chokidar" option is deprecated, please use "watch.watcher" instead of it`)),
1485
- exclude: /* @__PURE__ */ optional(/* @__PURE__ */ union([StringOrRegExpSchema, /* @__PURE__ */ array(StringOrRegExpSchema)])),
1486
- include: /* @__PURE__ */ optional(/* @__PURE__ */ union([StringOrRegExpSchema, /* @__PURE__ */ array(StringOrRegExpSchema)])),
1487
- watcher: /* @__PURE__ */ optional(WatcherFileWatcherOptionsSchema),
1488
- notify: /* @__PURE__ */ optional(WatcherFileWatcherOptionsSchema),
1489
- skipWrite: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Skip the bundle.write() step")),
1490
- buildDelay: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Throttle watch rebuilds")),
1491
- clearScreen: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to clear the screen when a rebuild is triggered")),
1492
- onInvalidate: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(vFunction()), /* @__PURE__ */ description("An optional function that will be called immediately every time a module changes that is part of the build."))
1493
- });
1494
- const ChecksOptionsSchema = /* @__PURE__ */ strictObject({
1495
- circularDependency: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when detecting circular dependency")),
1496
- eval: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when detecting uses of direct `eval`s")),
1497
- missingGlobalName: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when the `output.globals` option is missing when needed")),
1498
- missingNameOptionForIifeExport: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when the `output.name` option is missing when needed")),
1499
- invalidAnnotation: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a `#__PURE__` / `@__PURE__` annotation has no effect due to its position")),
1500
- mixedExports: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when the way to export values is ambiguous")),
1501
- unresolvedEntry: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when an entrypoint cannot be resolved")),
1502
- unresolvedImport: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when an import cannot be resolved")),
1503
- filenameConflict: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when files generated have the same name with different contents")),
1504
- commonJsVariableInEsm: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a CommonJS variable is used in an ES module")),
1505
- importIsUndefined: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when an imported variable is not exported")),
1506
- emptyImportMeta: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when `import.meta` is not supported with the output format and is replaced with an empty object (`{}`)")),
1507
- toleratedTransform: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when detecting tolerated transform")),
1508
- cannotCallNamespace: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a namespace is called as a function")),
1509
- configurationFieldConflict: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a config value is overridden by another config value with a higher priority")),
1510
- preferBuiltinFeature: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a plugin that is covered by a built-in feature is used")),
1511
- couldNotCleanDirectory: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when Rolldown could not clean the output directory")),
1512
- pluginTimings: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when plugins take significant time during the build process")),
1513
- duplicateShebang: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when both the code and postBanner contain shebang")),
1514
- unsupportedTsconfigOption: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a tsconfig option or combination of options is not supported")),
1515
- ineffectiveDynamicImport: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a module is dynamically imported but also statically imported, making the dynamic import ineffective for code splitting")),
1516
- largeBarrelModules: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit info logs when a barrel module has a very large number of re-exports (more than 5000)")),
1517
- sourcemapBroken: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to emit warnings when a plugin transforms code without generating a sourcemap"))
1518
- });
1519
- const MinifyOptionsSchema = /* @__PURE__ */ strictObject({
1520
- compress: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
1521
- target: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), /* @__PURE__ */ array(/* @__PURE__ */ string())])),
1522
- dropConsole: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1523
- dropDebugger: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1524
- keepNames: /* @__PURE__ */ optional(/* @__PURE__ */ strictObject({
1525
- function: /* @__PURE__ */ boolean(),
1526
- class: /* @__PURE__ */ boolean()
1527
- })),
1528
- unused: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ literal("keep_assign")])),
1529
- joinVars: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1530
- sequences: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1531
- dropLabels: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
1532
- maxIterations: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
1533
- treeshake: /* @__PURE__ */ optional(/* @__PURE__ */ strictObject({
1534
- annotations: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1535
- manualPureFunctions: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
1536
- propertyReadSideEffects: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ literal("always")])),
1537
- propertyWriteSideEffects: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1538
- unknownGlobalSideEffects: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1539
- invalidImportSideEffects: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
1540
- }))
1541
- })])),
1542
- mangle: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
1543
- toplevel: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1544
- keepNames: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
1545
- function: /* @__PURE__ */ boolean(),
1546
- class: /* @__PURE__ */ boolean()
1547
- })])),
1548
- debug: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
1549
- })])),
1550
- codegen: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
1551
- removeWhitespace: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1552
- legalComments: /* @__PURE__ */ optional(/* @__PURE__ */ union([
1553
- /* @__PURE__ */ literal("none"),
1554
- /* @__PURE__ */ literal("inline"),
1555
- /* @__PURE__ */ literal("eof"),
1556
- /* @__PURE__ */ literal("external"),
1557
- /* @__PURE__ */ strictObject({ linked: /* @__PURE__ */ string() })
1558
- ]))
1559
- })]))
1560
- });
1561
- const ResolveOptionsSchema = /* @__PURE__ */ strictObject({
1562
- alias: /* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ union([
1563
- /* @__PURE__ */ literal(false),
1564
- /* @__PURE__ */ string(),
1565
- /* @__PURE__ */ array(/* @__PURE__ */ string())
1566
- ]))),
1567
- aliasFields: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ array(/* @__PURE__ */ string()))),
1568
- conditionNames: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
1569
- extensionAlias: /* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ array(/* @__PURE__ */ string()))),
1570
- exportsFields: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ array(/* @__PURE__ */ string()))),
1571
- extensions: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
1572
- mainFields: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
1573
- mainFiles: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
1574
- modules: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())),
1575
- symlinks: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1576
- tsconfigFilename: /* @__PURE__ */ optional(/* @__PURE__ */ string())
1577
- });
1578
- const TreeshakingOptionsSchema = /* @__PURE__ */ strictObject({
1579
- moduleSideEffects: /* @__PURE__ */ optional(/* @__PURE__ */ any()),
1580
- annotations: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1581
- manualPureFunctions: /* @__PURE__ */ optional(/* @__PURE__ */ custom((input) => /* @__PURE__ */ is(/* @__PURE__ */ array(/* @__PURE__ */ string()), input), "string array")),
1582
- unknownGlobalSideEffects: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1583
- invalidImportSideEffects: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1584
- commonjs: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1585
- propertyReadSideEffects: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ literal(false), /* @__PURE__ */ literal("always")])),
1586
- propertyWriteSideEffects: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ literal(false), /* @__PURE__ */ literal("always")]))
1587
- });
1588
- const OptimizationOptionsSchema = /* @__PURE__ */ strictObject({
1589
- inlineConst: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
1590
- mode: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ literal("all"), /* @__PURE__ */ literal("smart")])),
1591
- pass: /* @__PURE__ */ optional(/* @__PURE__ */ number())
1592
- })])), /* @__PURE__ */ description("Enable crossmodule constant inlining")),
1593
- pifeForModuleWrappers: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Use PIFE pattern for module wrappers"))
1594
- });
1595
- const LogOrStringHandlerSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([LogLevelWithErrorSchema, RollupLogWithStringSchema])));
1596
- const OnLogSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([
1597
- LogLevelSchema,
1598
- RollupLogSchema,
1599
- LogOrStringHandlerSchema
1600
- ])));
1601
- const OnwarnSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([RollupLogSchema, /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ union([RollupLogWithStringSchema, /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ returns(RollupLogWithStringSchema))])])))])));
1602
- const DevModeSchema = /* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
1603
- port: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
1604
- host: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
1605
- implement: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
1606
- lazy: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
1607
- })]);
1608
- const InputOptionsSchema = /* @__PURE__ */ strictObject({
1609
- input: /* @__PURE__ */ optional(InputOptionSchema),
1610
- plugins: /* @__PURE__ */ optional(/* @__PURE__ */ custom(() => true)),
1611
- external: /* @__PURE__ */ optional(ExternalOptionSchema),
1612
- makeAbsoluteExternalsRelative: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ literal("ifRelativeSource")])),
1613
- resolve: /* @__PURE__ */ optional(ResolveOptionsSchema),
1614
- cwd: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Current working directory")),
1615
- platform: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([
1616
- /* @__PURE__ */ literal("browser"),
1617
- /* @__PURE__ */ literal("neutral"),
1618
- /* @__PURE__ */ literal("node")
1619
- ])), /* @__PURE__ */ description(`Platform for which the code should be generated (node, ${styleText$1("underline", "browser")}, neutral)`)),
1620
- shimMissingExports: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Create shim variables for missing exports")),
1621
- treeshake: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), TreeshakingOptionsSchema])),
1622
- optimization: /* @__PURE__ */ optional(OptimizationOptionsSchema),
1623
- logLevel: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(LogLevelOptionSchema), /* @__PURE__ */ description(`Log level (${styleText$1("dim", "silent")}, ${styleText$1(["underline", "gray"], "info")}, debug, ${styleText$1("yellow", "warn")})`)),
1624
- onLog: /* @__PURE__ */ optional(OnLogSchema),
1625
- onwarn: /* @__PURE__ */ optional(OnwarnSchema),
1626
- moduleTypes: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(ModuleTypesSchema), /* @__PURE__ */ description("Module types for customized extensions")),
1627
- experimental: /* @__PURE__ */ optional(/* @__PURE__ */ strictObject({
1628
- viteMode: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1629
- resolveNewUrlToAsset: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1630
- devMode: /* @__PURE__ */ optional(DevModeSchema),
1631
- chunkModulesOrder: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ literal("module-id"), /* @__PURE__ */ literal("exec-order")])),
1632
- attachDebugInfo: /* @__PURE__ */ optional(/* @__PURE__ */ union([
1633
- /* @__PURE__ */ literal("none"),
1634
- /* @__PURE__ */ literal("simple"),
1635
- /* @__PURE__ */ literal("full")
1636
- ])),
1637
- chunkImportMap: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ object({
1638
- baseUrl: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
1639
- fileName: /* @__PURE__ */ optional(/* @__PURE__ */ string())
1640
- })])),
1641
- onDemandWrapping: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1642
- incrementalBuild: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1643
- nativeMagicString: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1644
- chunkOptimization: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
1645
- mergeCommonChunks: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1646
- avoidRedundantChunkLoads: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
1647
- })])),
1648
- lazyBarrel: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
1649
- })),
1650
- transform: /* @__PURE__ */ optional(TransformOptionsSchema),
1651
- watch: /* @__PURE__ */ optional(/* @__PURE__ */ union([WatcherOptionsSchema, /* @__PURE__ */ literal(false)])),
1652
- checks: /* @__PURE__ */ optional(ChecksOptionsSchema),
1653
- devtools: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ object({ sessionId: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Used to name the build.")) })), /* @__PURE__ */ description("Enable debug mode. Emit debug information to disk. This might slow down the build process significantly.")),
1654
- preserveEntrySignatures: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([
1655
- /* @__PURE__ */ literal("strict"),
1656
- /* @__PURE__ */ literal("allow-extension"),
1657
- /* @__PURE__ */ literal("exports-only"),
1658
- /* @__PURE__ */ literal(false)
1659
- ]))),
1660
- context: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("The value of `this` at the top level of each module.")),
1661
- tsconfig: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ string()])), /* @__PURE__ */ description("Path to the tsconfig.json file."))
1662
- });
1663
- const InputCliOverrideSchema = /* @__PURE__ */ strictObject({
1664
- input: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())), /* @__PURE__ */ description("Entry file")),
1665
- external: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string())), /* @__PURE__ */ description("Comma-separated list of module ids to exclude from the bundle `<module-id>,...`")),
1666
- treeshake: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("enable treeshaking")),
1667
- makeAbsoluteExternalsRelative: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Prevent normalization of external imports")),
1668
- preserveEntrySignatures: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ literal(false)), /* @__PURE__ */ description("Avoid facade chunks for entry points")),
1669
- context: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("The entity top-level `this` represents."))
1670
- });
1671
- const InputCliOptionsSchema = /* @__PURE__ */ omit(/* @__PURE__ */ strictObject({
1672
- ...InputOptionsSchema.entries,
1673
- ...InputCliOverrideSchema.entries
1674
- }), [
1675
- "plugins",
1676
- "onwarn",
1677
- "onLog",
1678
- "resolve",
1679
- "experimental",
1680
- "watch"
1681
- ]);
1682
- const ModuleFormatSchema = /* @__PURE__ */ union([
1683
- /* @__PURE__ */ literal("es"),
1684
- /* @__PURE__ */ literal("cjs"),
1685
- /* @__PURE__ */ literal("esm"),
1686
- /* @__PURE__ */ literal("module"),
1687
- /* @__PURE__ */ literal("commonjs"),
1688
- /* @__PURE__ */ literal("iife"),
1689
- /* @__PURE__ */ literal("umd")
1690
- ]);
1691
- const AddonFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ custom(() => true)])), /* @__PURE__ */ returnsAsync(/* @__PURE__ */ unionAsync([/* @__PURE__ */ string(), /* @__PURE__ */ pipeAsync(/* @__PURE__ */ promise(), /* @__PURE__ */ awaitAsync(), /* @__PURE__ */ string())])));
1692
- const ChunkFileNamesFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ custom(() => true)])), /* @__PURE__ */ returns(/* @__PURE__ */ string()));
1693
- const ChunkFileNamesSchema = /* @__PURE__ */ union([/* @__PURE__ */ string(), ChunkFileNamesFunctionSchema]);
1694
- const AssetFileNamesFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ custom(() => true)])), /* @__PURE__ */ returns(/* @__PURE__ */ string()));
1695
- const AssetFileNamesSchema = /* @__PURE__ */ union([/* @__PURE__ */ string(), AssetFileNamesFunctionSchema]);
1696
- const SanitizeFileNameFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ string()])), /* @__PURE__ */ returns(/* @__PURE__ */ string()));
1697
- const SanitizeFileNameSchema = /* @__PURE__ */ union([/* @__PURE__ */ boolean(), SanitizeFileNameFunctionSchema]);
1698
- const GlobalsFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ string()])), /* @__PURE__ */ returns(/* @__PURE__ */ string()));
1699
- const PathsFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ string()])), /* @__PURE__ */ returns(/* @__PURE__ */ string()));
1700
- const ManualChunksFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ string(), /* @__PURE__ */ object({})])), /* @__PURE__ */ returns(/* @__PURE__ */ nullish(/* @__PURE__ */ string())));
1701
- const AdvancedChunksNameFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ string(), /* @__PURE__ */ object({})])), /* @__PURE__ */ returns(/* @__PURE__ */ nullish(/* @__PURE__ */ string())));
1702
- const AdvancedChunksTestFunctionSchema = /* @__PURE__ */ pipe(vFunction(), /* @__PURE__ */ args(/* @__PURE__ */ tuple([/* @__PURE__ */ string()])), /* @__PURE__ */ returns(/* @__PURE__ */ union([
1703
- /* @__PURE__ */ boolean(),
1704
- /* @__PURE__ */ void_(),
1705
- /* @__PURE__ */ undefined_()
1706
- ])));
1707
- const AdvancedChunksSchema = /* @__PURE__ */ strictObject({
1708
- includeDependenciesRecursively: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1709
- minSize: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
1710
- maxSize: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
1711
- minModuleSize: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
1712
- maxModuleSize: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
1713
- minShareCount: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
1714
- groups: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ strictObject({
1715
- name: /* @__PURE__ */ union([/* @__PURE__ */ string(), AdvancedChunksNameFunctionSchema]),
1716
- test: /* @__PURE__ */ optional(/* @__PURE__ */ union([StringOrRegExpSchema, AdvancedChunksTestFunctionSchema])),
1717
- priority: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
1718
- minSize: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
1719
- minShareCount: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
1720
- maxSize: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
1721
- minModuleSize: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
1722
- maxModuleSize: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
1723
- entriesAware: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1724
- entriesAwareMergeThreshold: /* @__PURE__ */ optional(/* @__PURE__ */ number()),
1725
- includeDependenciesRecursively: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1726
- tags: /* @__PURE__ */ optional(/* @__PURE__ */ array(/* @__PURE__ */ string()))
1727
- })))
1728
- });
1729
- const GeneratedCodeOptionsSchema = /* @__PURE__ */ strictObject({
1730
- symbols: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to use Symbol.toStringTag for namespace objects")),
1731
- preset: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ literal("es5"), /* @__PURE__ */ literal("es2015")])),
1732
- profilerNames: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Whether to add readable names to internal variables for profiling purposes"))
1733
- });
1734
- const OutputOptionsSchema = /* @__PURE__ */ strictObject({
1735
- dir: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Output directory, defaults to `dist` if `file` is not set")),
1736
- file: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Single output file")),
1737
- exports: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([
1738
- /* @__PURE__ */ literal("auto"),
1739
- /* @__PURE__ */ literal("named"),
1740
- /* @__PURE__ */ literal("default"),
1741
- /* @__PURE__ */ literal("none")
1742
- ])), /* @__PURE__ */ description(`Specify a export mode (${styleText$1("underline", "auto")}, named, default, none)`)),
1743
- hashCharacters: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([
1744
- /* @__PURE__ */ literal("base64"),
1745
- /* @__PURE__ */ literal("base36"),
1746
- /* @__PURE__ */ literal("hex")
1747
- ])), /* @__PURE__ */ description("Use the specified character set for file hashes")),
1748
- format: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(ModuleFormatSchema), /* @__PURE__ */ description(`Output format of the generated bundle (supports ${styleText$1("underline", "esm")}, cjs, and iife)`)),
1749
- sourcemap: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([
1750
- /* @__PURE__ */ boolean(),
1751
- /* @__PURE__ */ literal("inline"),
1752
- /* @__PURE__ */ literal("hidden")
1753
- ])), /* @__PURE__ */ description(`Generate sourcemap (\`-s inline\` for inline, or \`-s\` for \`.map\` file)`)),
1754
- sourcemapBaseUrl: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Base URL used to prefix sourcemap paths")),
1755
- sourcemapDebugIds: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Inject sourcemap debug IDs")),
1756
- sourcemapExcludeSources: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Exclude source content from sourcemaps")),
1757
- sourcemapIgnoreList: /* @__PURE__ */ optional(/* @__PURE__ */ union([
1758
- /* @__PURE__ */ boolean(),
1759
- /* @__PURE__ */ custom(() => true),
1760
- StringOrRegExpSchema
1761
- ])),
1762
- sourcemapPathTransform: /* @__PURE__ */ optional(/* @__PURE__ */ custom(() => true)),
1763
- banner: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), AddonFunctionSchema])),
1764
- footer: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), AddonFunctionSchema])),
1765
- postBanner: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), AddonFunctionSchema])),
1766
- postFooter: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), AddonFunctionSchema])),
1767
- intro: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), AddonFunctionSchema])),
1768
- outro: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), AddonFunctionSchema])),
1769
- extend: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Extend global variable defined by name in IIFE / UMD formats")),
1770
- esModule: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ literal("if-default-prop")])),
1771
- assetFileNames: /* @__PURE__ */ optional(AssetFileNamesSchema),
1772
- entryFileNames: /* @__PURE__ */ optional(ChunkFileNamesSchema),
1773
- chunkFileNames: /* @__PURE__ */ optional(ChunkFileNamesSchema),
1774
- sanitizeFileName: /* @__PURE__ */ optional(SanitizeFileNameSchema),
1775
- minify: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([
1776
- /* @__PURE__ */ boolean(),
1777
- /* @__PURE__ */ literal("dce-only"),
1778
- MinifyOptionsSchema
1779
- ])), /* @__PURE__ */ description("Minify the bundled file")),
1780
- name: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Name for UMD / IIFE format outputs")),
1781
- globals: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ string()), GlobalsFunctionSchema])), /* @__PURE__ */ description("Global variable of UMD / IIFE dependencies (syntax: `key:value`)")),
1782
- paths: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ string()), PathsFunctionSchema])), /* @__PURE__ */ description("Maps external module IDs to paths")),
1783
- generatedCode: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ partial(GeneratedCodeOptionsSchema)), /* @__PURE__ */ description("Generated code options")),
1784
- externalLiveBindings: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("external live bindings")),
1785
- inlineDynamicImports: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Inline dynamic imports")),
1786
- dynamicImportInCjs: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Dynamic import in CJS output")),
1787
- manualChunks: /* @__PURE__ */ optional(ManualChunksFunctionSchema),
1788
- codeSplitting: /* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), AdvancedChunksSchema])),
1789
- advancedChunks: /* @__PURE__ */ optional(AdvancedChunksSchema),
1790
- legalComments: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ literal("none"), /* @__PURE__ */ literal("inline")])), /* @__PURE__ */ description("Control legal comments in the output")),
1791
- comments: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
1792
- legal: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1793
- annotation: /* @__PURE__ */ optional(/* @__PURE__ */ boolean()),
1794
- jsdoc: /* @__PURE__ */ optional(/* @__PURE__ */ boolean())
1795
- })])), /* @__PURE__ */ description("Control comments in the output")),
1796
- plugins: /* @__PURE__ */ optional(/* @__PURE__ */ custom(() => true)),
1797
- polyfillRequire: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Disable require polyfill injection")),
1798
- hoistTransitiveImports: /* @__PURE__ */ optional(/* @__PURE__ */ literal(false)),
1799
- preserveModules: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Preserve module structure")),
1800
- preserveModulesRoot: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Put preserved modules under this path at root level")),
1801
- virtualDirname: /* @__PURE__ */ optional(/* @__PURE__ */ string()),
1802
- minifyInternalExports: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Minify internal exports")),
1803
- topLevelVar: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Rewrite top-level declarations to use `var`.")),
1804
- cleanDir: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Clean output directory before emitting output")),
1805
- keepNames: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Keep function and class names after bundling")),
1806
- strictExecutionOrder: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Lets modules be executed in the order they are declared.")),
1807
- strict: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ literal("auto")])), /* @__PURE__ */ description("Whether to always output `\"use strict\"` directive in non-ES module outputs."))
1808
- });
1809
- const getAddonDescription = (placement, wrapper) => {
1810
- return `Code to insert the ${styleText$1("bold", placement)} of the bundled file (${styleText$1("bold", wrapper)} the wrapper function)`;
1811
- };
1812
- const OutputCliOverrideSchema = /* @__PURE__ */ strictObject({
1813
- assetFileNames: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Name pattern for asset files")),
1814
- entryFileNames: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Name pattern for emitted entry chunks")),
1815
- chunkFileNames: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("Name pattern for emitted secondary chunks")),
1816
- sanitizeFileName: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Sanitize file name")),
1817
- banner: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description(getAddonDescription("top", "outside"))),
1818
- footer: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description(getAddonDescription("bottom", "outside"))),
1819
- postBanner: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("A string to prepend to the top of each chunk. Applied after the `renderChunk` hook and minification")),
1820
- postFooter: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description("A string to append to the bottom of each chunk. Applied after the `renderChunk` hook and minification")),
1821
- intro: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description(getAddonDescription("top", "inside"))),
1822
- outro: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ string()), /* @__PURE__ */ description(getAddonDescription("bottom", "inside"))),
1823
- esModule: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Always generate `__esModule` marks in non-ESM formats, defaults to `if-default-prop` (use `--no-esModule` to always disable)")),
1824
- globals: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ record(/* @__PURE__ */ string(), /* @__PURE__ */ string())), /* @__PURE__ */ description("Global variable of UMD / IIFE dependencies (syntax: `key:value`)")),
1825
- codeSplitting: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ boolean(), /* @__PURE__ */ strictObject({
1826
- minSize: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum size of the chunk")),
1827
- minShareCount: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum share count of the chunk"))
1828
- })])), /* @__PURE__ */ description("Code splitting options (true, false, or object)")),
1829
- advancedChunks: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ strictObject({
1830
- minSize: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum size of the chunk")),
1831
- minShareCount: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ number()), /* @__PURE__ */ description("Minimum share count of the chunk"))
1832
- })), /* @__PURE__ */ description("Deprecated: use codeSplitting instead")),
1833
- minify: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Minify the bundled file"))
1834
- });
1835
- const OutputCliOptionsSchema = /* @__PURE__ */ omit(/* @__PURE__ */ strictObject({
1836
- ...OutputOptionsSchema.entries,
1837
- ...OutputCliOverrideSchema.entries
1838
- }), [
1839
- "sourcemapIgnoreList",
1840
- "sourcemapPathTransform",
1841
- "plugins",
1842
- "hoistTransitiveImports"
1843
- ]);
1844
- const CliOptionsSchema = /* @__PURE__ */ strictObject({
1845
- config: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), /* @__PURE__ */ boolean()])), /* @__PURE__ */ description("Path to the config file (default: `rolldown.config.js`)")),
1846
- help: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Show help")),
1847
- environment: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ union([/* @__PURE__ */ string(), /* @__PURE__ */ array(/* @__PURE__ */ string())])), /* @__PURE__ */ description("Pass additional settings to the config file via process.ENV.")),
1848
- version: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Show version number")),
1849
- watch: /* @__PURE__ */ pipe(/* @__PURE__ */ optional(/* @__PURE__ */ boolean()), /* @__PURE__ */ description("Watch files in bundle and rebuild on changes")),
1850
- ...InputCliOptionsSchema.entries,
1851
- ...OutputCliOptionsSchema.entries
1852
- });
1853
- function validateCliOptions(options) {
1854
- let parsed = /* @__PURE__ */ safeParse(CliOptionsSchema, options);
1855
- return [parsed.output, parsed.issues?.map((issue) => {
1856
- return `Invalid value for option ${issue.path?.map((pathItem) => pathItem.key).join(" ")}: ${issue.message}`;
1857
- })];
1858
- }
1859
- const inputHelperMsgRecord = {
1860
- output: { ignored: true },
1861
- "resolve.tsconfigFilename": { issueMsg: "It is deprecated. Please use the top-level `tsconfig` option instead." }
1862
- };
1863
- const outputHelperMsgRecord = {};
1864
- function validateOption(key, options) {
1865
- if (typeof options !== "object") throw new Error(`Invalid ${key} options. Expected an Object but received ${JSON.stringify(options)}.`);
1866
- if (globalThis.process?.env?.ROLLUP_TEST) return;
1867
- let parsed = /* @__PURE__ */ safeParse(key === "input" ? InputOptionsSchema : OutputOptionsSchema, options);
1868
- if (!parsed.success) {
1869
- const errors = parsed.issues.map((issue) => {
1870
- let issueMsg = issue.message;
1871
- const issuePaths = issue.path.map((path) => path.key);
1872
- if (issue.type === "union") {
1873
- const subIssue = issue.issues?.find((i) => !(i.type !== issue.received && i.input === issue.input));
1874
- if (subIssue) {
1875
- if (subIssue.path) issuePaths.push(subIssue.path.map((path) => path.key));
1876
- issueMsg = subIssue.message;
1877
- }
1878
- }
1879
- const stringPath = issuePaths.join(".");
1880
- const helper = key === "input" ? inputHelperMsgRecord[stringPath] : outputHelperMsgRecord[stringPath];
1881
- if (helper && helper.ignored) return "";
1882
- return `- For the "${stringPath}". ${helper?.issueMsg || issueMsg + "."} ${helper?.help ? `\n Help: ${helper.help}` : ""}`;
1883
- }).filter(Boolean);
1884
- if (errors.length) console.warn(`\x1b[33mWarning: Invalid ${key} options (${errors.length} issue${errors.length === 1 ? "" : "s"} found)\n${errors.join("\n")}\x1b[0m`);
1885
- }
1886
- }
1887
- function getInputCliKeys() {
1888
- return (/* @__PURE__ */ keyof(InputCliOptionsSchema)).options;
1889
- }
1890
- function getOutputCliKeys() {
1891
- return (/* @__PURE__ */ keyof(OutputCliOptionsSchema)).options;
1892
- }
1893
- function getCliSchemaInfo() {
1894
- return flattenValibotSchema(CliOptionsSchema);
1895
- }
1896
- //#endregion
1897
- //#region src/types/rolldown-output-impl.ts
1898
- var RolldownOutputImpl = class extends PlainObjectLike {
1899
- bindingOutputs;
1900
- constructor(bindingOutputs) {
1901
- super();
1902
- this.bindingOutputs = bindingOutputs;
1903
- }
1904
- get output() {
1905
- return transformToRollupOutput(this.bindingOutputs).output;
1906
- }
1907
- __rolldown_external_memory_handle__(keepDataAlive) {
1908
- const results = this.output.map((item) => item.__rolldown_external_memory_handle__(keepDataAlive));
1909
- if (!results.every((r) => r.freed)) {
1910
- const reasons = results.filter((r) => !r.freed).map((r) => r.reason).filter(Boolean);
1911
- return {
1912
- freed: false,
1913
- reason: `Failed to free ${reasons.length} item(s): ${reasons.join("; ")}`
1914
- };
1915
- }
1916
- return { freed: true };
1917
- }
1918
- };
1919
- __decorate([lazyProp], RolldownOutputImpl.prototype, "output", null);
1920
- //#endregion
1921
- //#region src/types/chunking-context.ts
1922
- var ChunkingContextImpl = class {
1923
- context;
1924
- pluginContextData;
1925
- constructor(context, pluginContextData) {
1926
- this.context = context;
1927
- this.pluginContextData = pluginContextData;
1928
- }
1929
- getModuleInfo(moduleId) {
1930
- const bindingInfo = this.context.getModuleInfo(moduleId);
1931
- if (bindingInfo) return transformModuleInfo(bindingInfo, this.pluginContextData.getModuleOption(moduleId));
1932
- return null;
1933
- }
1934
- };
1935
- //#endregion
1936
- //#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs
1937
- const LogLevels = {
1938
- silent: Number.NEGATIVE_INFINITY,
1939
- fatal: 0,
1940
- error: 0,
1941
- warn: 1,
1942
- log: 2,
1943
- info: 3,
1944
- success: 3,
1945
- fail: 3,
1946
- ready: 3,
1947
- start: 3,
1948
- box: 3,
1949
- debug: 4,
1950
- trace: 5,
1951
- verbose: Number.POSITIVE_INFINITY
1952
- };
1953
- const LogTypes = {
1954
- silent: { level: -1 },
1955
- fatal: { level: LogLevels.fatal },
1956
- error: { level: LogLevels.error },
1957
- warn: { level: LogLevels.warn },
1958
- log: { level: LogLevels.log },
1959
- info: { level: LogLevels.info },
1960
- success: { level: LogLevels.success },
1961
- fail: { level: LogLevels.fail },
1962
- ready: { level: LogLevels.info },
1963
- start: { level: LogLevels.info },
1964
- box: { level: LogLevels.info },
1965
- debug: { level: LogLevels.debug },
1966
- trace: { level: LogLevels.trace },
1967
- verbose: { level: LogLevels.verbose }
1968
- };
1969
- function isPlainObject$1(value) {
1970
- if (value === null || typeof value !== "object") return false;
1971
- const prototype = Object.getPrototypeOf(value);
1972
- if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) return false;
1973
- if (Symbol.iterator in value) return false;
1974
- if (Symbol.toStringTag in value) return Object.prototype.toString.call(value) === "[object Module]";
1975
- return true;
1976
- }
1977
- function _defu(baseObject, defaults, namespace = ".", merger) {
1978
- if (!isPlainObject$1(defaults)) return _defu(baseObject, {}, namespace, merger);
1979
- const object = Object.assign({}, defaults);
1980
- for (const key in baseObject) {
1981
- if (key === "__proto__" || key === "constructor") continue;
1982
- const value = baseObject[key];
1983
- if (value === null || value === void 0) continue;
1984
- if (merger && merger(object, key, value, namespace)) continue;
1985
- if (Array.isArray(value) && Array.isArray(object[key])) object[key] = [...value, ...object[key]];
1986
- else if (isPlainObject$1(value) && isPlainObject$1(object[key])) object[key] = _defu(value, object[key], (namespace ? `${namespace}.` : "") + key.toString(), merger);
1987
- else object[key] = value;
1988
- }
1989
- return object;
1990
- }
1991
- function createDefu(merger) {
1992
- return (...arguments_) => arguments_.reduce((p, c) => _defu(p, c, "", merger), {});
1993
- }
1994
- const defu = createDefu();
1995
- function isPlainObject(obj) {
1996
- return Object.prototype.toString.call(obj) === "[object Object]";
1997
- }
1998
- function isLogObj(arg) {
1999
- if (!isPlainObject(arg)) return false;
2000
- if (!arg.message && !arg.args) return false;
2001
- if (arg.stack) return false;
2002
- return true;
2003
- }
2004
- let paused = false;
2005
- const queue = [];
2006
- var Consola = class Consola {
2007
- options;
2008
- _lastLog;
2009
- _mockFn;
2010
- /**
2011
- * Creates an instance of Consola with specified options or defaults.
2012
- *
2013
- * @param {Partial<ConsolaOptions>} [options={}] - Configuration options for the Consola instance.
2014
- */
2015
- constructor(options = {}) {
2016
- const types = options.types || LogTypes;
2017
- this.options = defu({
2018
- ...options,
2019
- defaults: { ...options.defaults },
2020
- level: _normalizeLogLevel(options.level, types),
2021
- reporters: [...options.reporters || []]
2022
- }, {
2023
- types: LogTypes,
2024
- throttle: 1e3,
2025
- throttleMin: 5,
2026
- formatOptions: {
2027
- date: true,
2028
- colors: false,
2029
- compact: true
2030
- }
2031
- });
2032
- for (const type in types) {
2033
- const defaults = {
2034
- type,
2035
- ...this.options.defaults,
2036
- ...types[type]
2037
- };
2038
- this[type] = this._wrapLogFn(defaults);
2039
- this[type].raw = this._wrapLogFn(defaults, true);
2040
- }
2041
- if (this.options.mockFn) this.mockTypes();
2042
- this._lastLog = {};
2043
- }
2044
- /**
2045
- * Gets the current log level of the Consola instance.
2046
- *
2047
- * @returns {number} The current log level.
2048
- */
2049
- get level() {
2050
- return this.options.level;
2051
- }
2052
- /**
2053
- * Sets the minimum log level that will be output by the instance.
2054
- *
2055
- * @param {number} level - The new log level to set.
2056
- */
2057
- set level(level) {
2058
- this.options.level = _normalizeLogLevel(level, this.options.types, this.options.level);
2059
- }
2060
- /**
2061
- * Displays a prompt to the user and returns the response.
2062
- * Throw an error if `prompt` is not supported by the current configuration.
2063
- *
2064
- * @template T
2065
- * @param {string} message - The message to display in the prompt.
2066
- * @param {T} [opts] - Optional options for the prompt. See {@link PromptOptions}.
2067
- * @returns {promise<T>} A promise that infer with the prompt options. See {@link PromptOptions}.
2068
- */
2069
- prompt(message, opts) {
2070
- if (!this.options.prompt) throw new Error("prompt is not supported!");
2071
- return this.options.prompt(message, opts);
2072
- }
2073
- /**
2074
- * Creates a new instance of Consola, inheriting options from the current instance, with possible overrides.
2075
- *
2076
- * @param {Partial<ConsolaOptions>} options - Optional overrides for the new instance. See {@link ConsolaOptions}.
2077
- * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
2078
- */
2079
- create(options) {
2080
- const instance = new Consola({
2081
- ...this.options,
2082
- ...options
2083
- });
2084
- if (this._mockFn) instance.mockTypes(this._mockFn);
2085
- return instance;
2086
- }
2087
- /**
2088
- * Creates a new Consola instance with the specified default log object properties.
2089
- *
2090
- * @param {InputLogObject} defaults - Default properties to include in any log from the new instance. See {@link InputLogObject}.
2091
- * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
2092
- */
2093
- withDefaults(defaults) {
2094
- return this.create({
2095
- ...this.options,
2096
- defaults: {
2097
- ...this.options.defaults,
2098
- ...defaults
2099
- }
2100
- });
2101
- }
2102
- /**
2103
- * Creates a new Consola instance with a specified tag, which will be included in every log.
2104
- *
2105
- * @param {string} tag - The tag to include in each log of the new instance.
2106
- * @returns {ConsolaInstance} A new Consola instance. See {@link ConsolaInstance}.
2107
- */
2108
- withTag(tag) {
2109
- return this.withDefaults({ tag: this.options.defaults.tag ? this.options.defaults.tag + ":" + tag : tag });
2110
- }
2111
- /**
2112
- * Adds a custom reporter to the Consola instance.
2113
- * Reporters will be called for each log message, depending on their implementation and log level.
2114
- *
2115
- * @param {ConsolaReporter} reporter - The reporter to add. See {@link ConsolaReporter}.
2116
- * @returns {Consola} The current Consola instance.
2117
- */
2118
- addReporter(reporter) {
2119
- this.options.reporters.push(reporter);
2120
- return this;
2121
- }
2122
- /**
2123
- * Removes a custom reporter from the Consola instance.
2124
- * If no reporter is specified, all reporters will be removed.
2125
- *
2126
- * @param {ConsolaReporter} reporter - The reporter to remove. See {@link ConsolaReporter}.
2127
- * @returns {Consola} The current Consola instance.
2128
- */
2129
- removeReporter(reporter) {
2130
- if (reporter) {
2131
- const i = this.options.reporters.indexOf(reporter);
2132
- if (i !== -1) return this.options.reporters.splice(i, 1);
2133
- } else this.options.reporters.splice(0);
2134
- return this;
2135
- }
2136
- /**
2137
- * Replaces all reporters of the Consola instance with the specified array of reporters.
2138
- *
2139
- * @param {ConsolaReporter[]} reporters - The new reporters to set. See {@link ConsolaReporter}.
2140
- * @returns {Consola} The current Consola instance.
2141
- */
2142
- setReporters(reporters) {
2143
- this.options.reporters = Array.isArray(reporters) ? reporters : [reporters];
2144
- return this;
2145
- }
2146
- wrapAll() {
2147
- this.wrapConsole();
2148
- this.wrapStd();
2149
- }
2150
- restoreAll() {
2151
- this.restoreConsole();
2152
- this.restoreStd();
2153
- }
2154
- /**
2155
- * Overrides console methods with Consola logging methods for consistent logging.
2156
- */
2157
- wrapConsole() {
2158
- for (const type in this.options.types) {
2159
- if (!console["__" + type]) console["__" + type] = console[type];
2160
- console[type] = this[type].raw;
2161
- }
2162
- }
2163
- /**
2164
- * Restores the original console methods, removing Consola overrides.
2165
- */
2166
- restoreConsole() {
2167
- for (const type in this.options.types) if (console["__" + type]) {
2168
- console[type] = console["__" + type];
2169
- delete console["__" + type];
2170
- }
2171
- }
2172
- /**
2173
- * Overrides standard output and error streams to redirect them through Consola.
2174
- */
2175
- wrapStd() {
2176
- this._wrapStream(this.options.stdout, "log");
2177
- this._wrapStream(this.options.stderr, "log");
2178
- }
2179
- _wrapStream(stream, type) {
2180
- if (!stream) return;
2181
- if (!stream.__write) stream.__write = stream.write;
2182
- stream.write = (data) => {
2183
- this[type].raw(String(data).trim());
2184
- };
2185
- }
2186
- /**
2187
- * Restores the original standard output and error streams, removing the Consola redirection.
2188
- */
2189
- restoreStd() {
2190
- this._restoreStream(this.options.stdout);
2191
- this._restoreStream(this.options.stderr);
2192
- }
2193
- _restoreStream(stream) {
2194
- if (!stream) return;
2195
- if (stream.__write) {
2196
- stream.write = stream.__write;
2197
- delete stream.__write;
2198
- }
2199
- }
2200
- /**
2201
- * Pauses logging, queues incoming logs until resumed.
2202
- */
2203
- pauseLogs() {
2204
- paused = true;
2205
- }
2206
- /**
2207
- * Resumes logging, processing any queued logs.
2208
- */
2209
- resumeLogs() {
2210
- paused = false;
2211
- const _queue = queue.splice(0);
2212
- for (const item of _queue) item[0]._logFn(item[1], item[2]);
2213
- }
2214
- /**
2215
- * Replaces logging methods with mocks if a mock function is provided.
2216
- *
2217
- * @param {ConsolaOptions["mockFn"]} mockFn - The function to use for mocking logging methods. See {@link ConsolaOptions["mockFn"]}.
2218
- */
2219
- mockTypes(mockFn) {
2220
- const _mockFn = mockFn || this.options.mockFn;
2221
- this._mockFn = _mockFn;
2222
- if (typeof _mockFn !== "function") return;
2223
- for (const type in this.options.types) {
2224
- this[type] = _mockFn(type, this.options.types[type]) || this[type];
2225
- this[type].raw = this[type];
2226
- }
2227
- }
2228
- _wrapLogFn(defaults, isRaw) {
2229
- return (...args) => {
2230
- if (paused) {
2231
- queue.push([
2232
- this,
2233
- defaults,
2234
- args,
2235
- isRaw
2236
- ]);
2237
- return;
2238
- }
2239
- return this._logFn(defaults, args, isRaw);
2240
- };
2241
- }
2242
- _logFn(defaults, args, isRaw) {
2243
- if ((defaults.level || 0) > this.level) return false;
2244
- const logObj = {
2245
- date: /* @__PURE__ */ new Date(),
2246
- args: [],
2247
- ...defaults,
2248
- level: _normalizeLogLevel(defaults.level, this.options.types)
2249
- };
2250
- if (!isRaw && args.length === 1 && isLogObj(args[0])) Object.assign(logObj, args[0]);
2251
- else logObj.args = [...args];
2252
- if (logObj.message) {
2253
- logObj.args.unshift(logObj.message);
2254
- delete logObj.message;
2255
- }
2256
- if (logObj.additional) {
2257
- if (!Array.isArray(logObj.additional)) logObj.additional = logObj.additional.split("\n");
2258
- logObj.args.push("\n" + logObj.additional.join("\n"));
2259
- delete logObj.additional;
2260
- }
2261
- logObj.type = typeof logObj.type === "string" ? logObj.type.toLowerCase() : "log";
2262
- logObj.tag = typeof logObj.tag === "string" ? logObj.tag : "";
2263
- const resolveLog = (newLog = false) => {
2264
- const repeated = (this._lastLog.count || 0) - this.options.throttleMin;
2265
- if (this._lastLog.object && repeated > 0) {
2266
- const args2 = [...this._lastLog.object.args];
2267
- if (repeated > 1) args2.push(`(repeated ${repeated} times)`);
2268
- this._log({
2269
- ...this._lastLog.object,
2270
- args: args2
2271
- });
2272
- this._lastLog.count = 1;
2273
- }
2274
- if (newLog) {
2275
- this._lastLog.object = logObj;
2276
- this._log(logObj);
2277
- }
2278
- };
2279
- clearTimeout(this._lastLog.timeout);
2280
- const diffTime = this._lastLog.time && logObj.date ? logObj.date.getTime() - this._lastLog.time.getTime() : 0;
2281
- this._lastLog.time = logObj.date;
2282
- if (diffTime < this.options.throttle) try {
2283
- const serializedLog = JSON.stringify([
2284
- logObj.type,
2285
- logObj.tag,
2286
- logObj.args
2287
- ]);
2288
- const isSameLog = this._lastLog.serialized === serializedLog;
2289
- this._lastLog.serialized = serializedLog;
2290
- if (isSameLog) {
2291
- this._lastLog.count = (this._lastLog.count || 0) + 1;
2292
- if (this._lastLog.count > this.options.throttleMin) {
2293
- this._lastLog.timeout = setTimeout(resolveLog, this.options.throttle);
2294
- return;
2295
- }
2296
- }
2297
- } catch {}
2298
- resolveLog(true);
2299
- }
2300
- _log(logObj) {
2301
- for (const reporter of this.options.reporters) reporter.log(logObj, { options: this.options });
2302
- }
2303
- };
2304
- function _normalizeLogLevel(input, types = {}, defaultLevel = 3) {
2305
- if (input === void 0) return defaultLevel;
2306
- if (typeof input === "number") return input;
2307
- if (types[input] && types[input].level !== void 0) return types[input].level;
2308
- return defaultLevel;
2309
- }
2310
- Consola.prototype.add = Consola.prototype.addReporter;
2311
- Consola.prototype.remove = Consola.prototype.removeReporter;
2312
- Consola.prototype.clear = Consola.prototype.removeReporter;
2313
- Consola.prototype.withScope = Consola.prototype.withTag;
2314
- Consola.prototype.mock = Consola.prototype.mockTypes;
2315
- Consola.prototype.pause = Consola.prototype.pauseLogs;
2316
- Consola.prototype.resume = Consola.prototype.resumeLogs;
2317
- function createConsola$1(options = {}) {
2318
- return new Consola(options);
2319
- }
2320
- //#endregion
2321
- //#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs
2322
- function parseStack(stack, message) {
2323
- const cwd = process.cwd() + sep;
2324
- return stack.split("\n").splice(message.split("\n").length).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
2325
- }
2326
- function writeStream(data, stream) {
2327
- return (stream.__write || stream.write).call(stream, data);
2328
- }
2329
- const bracket = (x) => x ? `[${x}]` : "";
2330
- var BasicReporter = class {
2331
- formatStack(stack, message, opts) {
2332
- const indent = " ".repeat((opts?.errorLevel || 0) + 1);
2333
- return indent + parseStack(stack, message).join(`
2334
- ${indent}`);
2335
- }
2336
- formatError(err, opts) {
2337
- const message = err.message ?? formatWithOptions(opts, err);
2338
- const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
2339
- const level = opts?.errorLevel || 0;
2340
- const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
2341
- const causedError = err.cause ? "\n\n" + this.formatError(err.cause, {
2342
- ...opts,
2343
- errorLevel: level + 1
2344
- }) : "";
2345
- return causedPrefix + message + "\n" + stack + causedError;
2346
- }
2347
- formatArgs(args, opts) {
2348
- return formatWithOptions(opts, ...args.map((arg) => {
2349
- if (arg && typeof arg.stack === "string") return this.formatError(arg, opts);
2350
- return arg;
2351
- }));
2352
- }
2353
- formatDate(date, opts) {
2354
- return opts.date ? date.toLocaleTimeString() : "";
2355
- }
2356
- filterAndJoin(arr) {
2357
- return arr.filter(Boolean).join(" ");
2358
- }
2359
- formatLogObj(logObj, opts) {
2360
- const message = this.formatArgs(logObj.args, opts);
2361
- if (logObj.type === "box") return "\n" + [
2362
- bracket(logObj.tag),
2363
- logObj.title && logObj.title,
2364
- ...message.split("\n")
2365
- ].filter(Boolean).map((l) => " > " + l).join("\n") + "\n";
2366
- return this.filterAndJoin([
2367
- bracket(logObj.type),
2368
- bracket(logObj.tag),
2369
- message
2370
- ]);
2371
- }
2372
- log(logObj, ctx) {
2373
- return writeStream(this.formatLogObj(logObj, {
2374
- columns: ctx.options.stdout.columns || 0,
2375
- ...ctx.options.formatOptions
2376
- }) + "\n", logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout);
2377
- }
2378
- };
2379
- //#endregion
2380
- //#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs
2381
- const { env = {}, argv = [], platform = "" } = typeof process === "undefined" ? {} : process;
2382
- const isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
2383
- const isForced = "FORCE_COLOR" in env || argv.includes("--color");
2384
- const isWindows = platform === "win32";
2385
- const isDumbTerminal = env.TERM === "dumb";
2386
- const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
2387
- const isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
2388
- const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
2389
- function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
2390
- return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
2391
- }
2392
- function clearBleed(index, string, open, close, replace) {
2393
- return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
2394
- }
2395
- function filterEmpty(open, close, replace = open, at = open.length + 1) {
2396
- return (string) => string || !(string === "" || string === void 0) ? clearBleed(("" + string).indexOf(close, at), string, open, close, replace) : "";
2397
- }
2398
- function init(open, close, replace) {
2399
- return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
2400
- }
2401
- const colorDefs = {
2402
- reset: init(0, 0),
2403
- bold: init(1, 22, "\x1B[22m\x1B[1m"),
2404
- dim: init(2, 22, "\x1B[22m\x1B[2m"),
2405
- italic: init(3, 23),
2406
- underline: init(4, 24),
2407
- inverse: init(7, 27),
2408
- hidden: init(8, 28),
2409
- strikethrough: init(9, 29),
2410
- black: init(30, 39),
2411
- red: init(31, 39),
2412
- green: init(32, 39),
2413
- yellow: init(33, 39),
2414
- blue: init(34, 39),
2415
- magenta: init(35, 39),
2416
- cyan: init(36, 39),
2417
- white: init(37, 39),
2418
- gray: init(90, 39),
2419
- bgBlack: init(40, 49),
2420
- bgRed: init(41, 49),
2421
- bgGreen: init(42, 49),
2422
- bgYellow: init(43, 49),
2423
- bgBlue: init(44, 49),
2424
- bgMagenta: init(45, 49),
2425
- bgCyan: init(46, 49),
2426
- bgWhite: init(47, 49),
2427
- blackBright: init(90, 39),
2428
- redBright: init(91, 39),
2429
- greenBright: init(92, 39),
2430
- yellowBright: init(93, 39),
2431
- blueBright: init(94, 39),
2432
- magentaBright: init(95, 39),
2433
- cyanBright: init(96, 39),
2434
- whiteBright: init(97, 39),
2435
- bgBlackBright: init(100, 49),
2436
- bgRedBright: init(101, 49),
2437
- bgGreenBright: init(102, 49),
2438
- bgYellowBright: init(103, 49),
2439
- bgBlueBright: init(104, 49),
2440
- bgMagentaBright: init(105, 49),
2441
- bgCyanBright: init(106, 49),
2442
- bgWhiteBright: init(107, 49)
2443
- };
2444
- function createColors(useColor = isColorSupported) {
2445
- return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
2446
- }
2447
- const colors = createColors();
2448
- function getColor$1(color, fallback = "reset") {
2449
- return colors[color] || colors[fallback];
2450
- }
2451
- const ansiRegex$1 = [String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`, String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");
2452
- function stripAnsi$1(text) {
2453
- return text.replace(new RegExp(ansiRegex$1, "g"), "");
2454
- }
2455
- const boxStylePresets = {
2456
- solid: {
2457
- tl: "┌",
2458
- tr: "┐",
2459
- bl: "└",
2460
- br: "┘",
2461
- h: "─",
2462
- v: "│"
2463
- },
2464
- double: {
2465
- tl: "╔",
2466
- tr: "╗",
2467
- bl: "╚",
2468
- br: "╝",
2469
- h: "═",
2470
- v: "║"
2471
- },
2472
- doubleSingle: {
2473
- tl: "╓",
2474
- tr: "╖",
2475
- bl: "╙",
2476
- br: "╜",
2477
- h: "─",
2478
- v: "║"
2479
- },
2480
- doubleSingleRounded: {
2481
- tl: "╭",
2482
- tr: "╮",
2483
- bl: "╰",
2484
- br: "╯",
2485
- h: "─",
2486
- v: "║"
2487
- },
2488
- singleThick: {
2489
- tl: "┏",
2490
- tr: "┓",
2491
- bl: "┗",
2492
- br: "┛",
2493
- h: "━",
2494
- v: "┃"
2495
- },
2496
- singleDouble: {
2497
- tl: "╒",
2498
- tr: "╕",
2499
- bl: "╘",
2500
- br: "╛",
2501
- h: "═",
2502
- v: "│"
2503
- },
2504
- singleDoubleRounded: {
2505
- tl: "╭",
2506
- tr: "╮",
2507
- bl: "╰",
2508
- br: "╯",
2509
- h: "═",
2510
- v: "│"
2511
- },
2512
- rounded: {
2513
- tl: "╭",
2514
- tr: "╮",
2515
- bl: "╰",
2516
- br: "╯",
2517
- h: "─",
2518
- v: "│"
2519
- }
2520
- };
2521
- const defaultStyle = {
2522
- borderColor: "white",
2523
- borderStyle: "rounded",
2524
- valign: "center",
2525
- padding: 2,
2526
- marginLeft: 1,
2527
- marginTop: 1,
2528
- marginBottom: 1
2529
- };
2530
- function box(text, _opts = {}) {
2531
- const opts = {
2532
- ..._opts,
2533
- style: {
2534
- ...defaultStyle,
2535
- ..._opts.style
2536
- }
2537
- };
2538
- const textLines = text.split("\n");
2539
- const boxLines = [];
2540
- const _color = getColor$1(opts.style.borderColor);
2541
- const borderStyle = { ...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle };
2542
- if (_color) for (const key in borderStyle) borderStyle[key] = _color(borderStyle[key]);
2543
- const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
2544
- const height = textLines.length + paddingOffset;
2545
- const width = Math.max(...textLines.map((line) => stripAnsi$1(line).length), opts.title ? stripAnsi$1(opts.title).length : 0) + paddingOffset;
2546
- const widthOffset = width + paddingOffset;
2547
- const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
2548
- if (opts.style.marginTop > 0) boxLines.push("".repeat(opts.style.marginTop));
2549
- if (opts.title) {
2550
- const title = _color ? _color(opts.title) : opts.title;
2551
- const left = borderStyle.h.repeat(Math.floor((width - stripAnsi$1(opts.title).length) / 2));
2552
- const right = borderStyle.h.repeat(width - stripAnsi$1(opts.title).length - stripAnsi$1(left).length + paddingOffset);
2553
- boxLines.push(`${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`);
2554
- } else boxLines.push(`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`);
2555
- const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
2556
- for (let i = 0; i < height; i++) if (i < valignOffset || i >= valignOffset + textLines.length) boxLines.push(`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`);
2557
- else {
2558
- const line = textLines[i - valignOffset];
2559
- const left = " ".repeat(paddingOffset);
2560
- const right = " ".repeat(width - stripAnsi$1(line).length);
2561
- boxLines.push(`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`);
2562
- }
2563
- boxLines.push(`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`);
2564
- if (opts.style.marginBottom > 0) boxLines.push("".repeat(opts.style.marginBottom));
2565
- return boxLines.join("\n");
2566
- }
2567
- //#endregion
2568
- //#region ../../node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs
2569
- const r = Object.create(null), i = (e) => globalThis.process?.env || import.meta.env || globalThis.Deno?.env.toObject() || globalThis.__env__ || (e ? r : globalThis), o = new Proxy(r, {
2570
- get(e, s) {
2571
- return i()[s] ?? r[s];
2572
- },
2573
- has(e, s) {
2574
- return s in i() || s in r;
2575
- },
2576
- set(e, s, E) {
2577
- const B = i(true);
2578
- return B[s] = E, true;
2579
- },
2580
- deleteProperty(e, s) {
2581
- if (!s) return false;
2582
- const E = i(true);
2583
- return delete E[s], true;
2584
- },
2585
- ownKeys() {
2586
- const e = i(true);
2587
- return Object.keys(e);
2588
- }
2589
- }), t = typeof process < "u" && process.env && process.env.NODE_ENV || "", f = [
2590
- ["APPVEYOR"],
2591
- [
2592
- "AWS_AMPLIFY",
2593
- "AWS_APP_ID",
2594
- { ci: true }
2595
- ],
2596
- ["AZURE_PIPELINES", "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],
2597
- ["AZURE_STATIC", "INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],
2598
- ["APPCIRCLE", "AC_APPCIRCLE"],
2599
- ["BAMBOO", "bamboo_planKey"],
2600
- ["BITBUCKET", "BITBUCKET_COMMIT"],
2601
- ["BITRISE", "BITRISE_IO"],
2602
- ["BUDDY", "BUDDY_WORKSPACE_ID"],
2603
- ["BUILDKITE"],
2604
- ["CIRCLE", "CIRCLECI"],
2605
- ["CIRRUS", "CIRRUS_CI"],
2606
- [
2607
- "CLOUDFLARE_PAGES",
2608
- "CF_PAGES",
2609
- { ci: true }
2610
- ],
2611
- ["CODEBUILD", "CODEBUILD_BUILD_ARN"],
2612
- ["CODEFRESH", "CF_BUILD_ID"],
2613
- ["DRONE"],
2614
- ["DRONE", "DRONE_BUILD_EVENT"],
2615
- ["DSARI"],
2616
- ["GITHUB_ACTIONS"],
2617
- ["GITLAB", "GITLAB_CI"],
2618
- ["GITLAB", "CI_MERGE_REQUEST_ID"],
2619
- ["GOCD", "GO_PIPELINE_LABEL"],
2620
- ["LAYERCI"],
2621
- ["HUDSON", "HUDSON_URL"],
2622
- ["JENKINS", "JENKINS_URL"],
2623
- ["MAGNUM"],
2624
- ["NETLIFY"],
2625
- [
2626
- "NETLIFY",
2627
- "NETLIFY_LOCAL",
2628
- { ci: false }
2629
- ],
2630
- ["NEVERCODE"],
2631
- ["RENDER"],
2632
- ["SAIL", "SAILCI"],
2633
- ["SEMAPHORE"],
2634
- ["SCREWDRIVER"],
2635
- ["SHIPPABLE"],
2636
- ["SOLANO", "TDDIUM"],
2637
- ["STRIDER"],
2638
- ["TEAMCITY", "TEAMCITY_VERSION"],
2639
- ["TRAVIS"],
2640
- ["VERCEL", "NOW_BUILDER"],
2641
- [
2642
- "VERCEL",
2643
- "VERCEL",
2644
- { ci: false }
2645
- ],
2646
- [
2647
- "VERCEL",
2648
- "VERCEL_ENV",
2649
- { ci: false }
2650
- ],
2651
- ["APPCENTER", "APPCENTER_BUILD_ID"],
2652
- [
2653
- "CODESANDBOX",
2654
- "CODESANDBOX_SSE",
2655
- { ci: false }
2656
- ],
2657
- [
2658
- "CODESANDBOX",
2659
- "CODESANDBOX_HOST",
2660
- { ci: false }
2661
- ],
2662
- ["STACKBLITZ"],
2663
- ["STORMKIT"],
2664
- ["CLEAVR"],
2665
- ["ZEABUR"],
2666
- [
2667
- "CODESPHERE",
2668
- "CODESPHERE_APP_ID",
2669
- { ci: true }
2670
- ],
2671
- ["RAILWAY", "RAILWAY_PROJECT_ID"],
2672
- ["RAILWAY", "RAILWAY_SERVICE_ID"],
2673
- ["DENO-DEPLOY", "DENO_DEPLOYMENT_ID"],
2674
- [
2675
- "FIREBASE_APP_HOSTING",
2676
- "FIREBASE_APP_HOSTING",
2677
- { ci: true }
2678
- ]
2679
- ];
2680
- function b() {
2681
- if (globalThis.process?.env) for (const e of f) {
2682
- const s = e[1] || e[0];
2683
- if (globalThis.process?.env[s]) return {
2684
- name: e[0].toLowerCase(),
2685
- ...e[2]
2686
- };
2687
- }
2688
- return globalThis.process?.env?.SHELL === "/bin/jsh" && globalThis.process?.versions?.webcontainer ? {
2689
- name: "stackblitz",
2690
- ci: false
2691
- } : {
2692
- name: "",
2693
- ci: false
2694
- };
2695
- }
2696
- const l = b();
2697
- l.name;
2698
- function n(e) {
2699
- return e ? e !== "false" : false;
2700
- }
2701
- const I = globalThis.process?.platform || "", T = n(o.CI) || l.ci !== false, a = n(globalThis.process?.stdout && globalThis.process?.stdout.isTTY), g = n(o.DEBUG), R = t === "test" || n(o.TEST);
2702
- o.MINIMAL;
2703
- const A = /^win/i.test(I);
2704
- !n(o.NO_COLOR) && (n(o.FORCE_COLOR) || (a || A) && o.TERM);
2705
- const C = (globalThis.process?.versions?.node || "").replace(/^v/, "") || null;
2706
- Number(C?.split(".")[0]);
2707
- const y = globalThis.process || Object.create(null), _ = { versions: {} };
2708
- new Proxy(y, { get(e, s) {
2709
- if (s === "env") return o;
2710
- if (s in e) return e[s];
2711
- if (s in _) return _[s];
2712
- } });
2713
- const c = globalThis.process?.release?.name === "node", O = !!globalThis.Bun || !!globalThis.process?.versions?.bun, D = !!globalThis.Deno, L = !!globalThis.fastly, S = !!globalThis.Netlify, u = !!globalThis.EdgeRuntime, N = globalThis.navigator?.userAgent === "Cloudflare-Workers", F = [
2714
- [S, "netlify"],
2715
- [u, "edge-light"],
2716
- [N, "workerd"],
2717
- [L, "fastly"],
2718
- [D, "deno"],
2719
- [O, "bun"],
2720
- [c, "node"]
2721
- ];
2722
- function G() {
2723
- const e = F.find((s) => s[0]);
2724
- if (e) return { name: e[1] };
2725
- }
2726
- G()?.name;
2727
- function ansiRegex({ onlyFirst = false } = {}) {
2728
- const pattern = [`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))`, "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
2729
- return new RegExp(pattern, onlyFirst ? void 0 : "g");
2730
- }
2731
- const regex = ansiRegex();
2732
- function stripAnsi(string) {
2733
- if (typeof string !== "string") throw new TypeError(`Expected a \`string\`, got \`${typeof string}\``);
2734
- return string.replace(regex, "");
2735
- }
2736
- function isAmbiguous(x) {
2737
- return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
2738
- }
2739
- function isFullWidth(x) {
2740
- return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
2741
- }
2742
- function isWide(x) {
2743
- return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9776 && x <= 9783 || x >= 9800 && x <= 9811 || x === 9855 || x >= 9866 && x <= 9871 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12773 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101631 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x >= 119552 && x <= 119638 || x >= 119648 && x <= 119670 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129673 || x >= 129679 && x <= 129734 || x >= 129742 && x <= 129756 || x >= 129759 && x <= 129769 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
2744
- }
2745
- function validate(codePoint) {
2746
- if (!Number.isSafeInteger(codePoint)) throw new TypeError(`Expected a code point, got \`${typeof codePoint}\`.`);
2747
- }
2748
- function eastAsianWidth(codePoint, { ambiguousAsWide = false } = {}) {
2749
- validate(codePoint);
2750
- if (isFullWidth(codePoint) || isWide(codePoint) || ambiguousAsWide && isAmbiguous(codePoint)) return 2;
2751
- return 1;
2752
- }
2753
- const emojiRegex = () => {
2754
- return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
2755
- };
2756
- const segmenter = globalThis.Intl?.Segmenter ? new Intl.Segmenter() : { segment: (str) => str.split("") };
2757
- const defaultIgnorableCodePointRegex = /^\p{Default_Ignorable_Code_Point}$/u;
2758
- function stringWidth$1(string, options = {}) {
2759
- if (typeof string !== "string" || string.length === 0) return 0;
2760
- const { ambiguousIsNarrow = true, countAnsiEscapeCodes = false } = options;
2761
- if (!countAnsiEscapeCodes) string = stripAnsi(string);
2762
- if (string.length === 0) return 0;
2763
- let width = 0;
2764
- const eastAsianWidthOptions = { ambiguousAsWide: !ambiguousIsNarrow };
2765
- for (const { segment: character } of segmenter.segment(string)) {
2766
- const codePoint = character.codePointAt(0);
2767
- if (codePoint <= 31 || codePoint >= 127 && codePoint <= 159) continue;
2768
- if (codePoint >= 8203 && codePoint <= 8207 || codePoint === 65279) continue;
2769
- if (codePoint >= 768 && codePoint <= 879 || codePoint >= 6832 && codePoint <= 6911 || codePoint >= 7616 && codePoint <= 7679 || codePoint >= 8400 && codePoint <= 8447 || codePoint >= 65056 && codePoint <= 65071) continue;
2770
- if (codePoint >= 55296 && codePoint <= 57343) continue;
2771
- if (codePoint >= 65024 && codePoint <= 65039) continue;
2772
- if (defaultIgnorableCodePointRegex.test(character)) continue;
2773
- if (emojiRegex().test(character)) {
2774
- width += 2;
2775
- continue;
2776
- }
2777
- width += eastAsianWidth(codePoint, eastAsianWidthOptions);
2778
- }
2779
- return width;
2780
- }
2781
- function isUnicodeSupported() {
2782
- const { env } = g$1;
2783
- const { TERM, TERM_PROGRAM } = env;
2784
- if (g$1.platform !== "win32") return TERM !== "linux";
2785
- return Boolean(env.WT_SESSION) || Boolean(env.TERMINUS_SUBLIME) || env.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
2786
- }
2787
- const TYPE_COLOR_MAP = {
2788
- info: "cyan",
2789
- fail: "red",
2790
- success: "green",
2791
- ready: "green",
2792
- start: "magenta"
2793
- };
2794
- const LEVEL_COLOR_MAP = {
2795
- 0: "red",
2796
- 1: "yellow"
2797
- };
2798
- const unicode = isUnicodeSupported();
2799
- const s = (c, fallback) => unicode ? c : fallback;
2800
- const TYPE_ICONS = {
2801
- error: s("✖", "×"),
2802
- fatal: s("✖", "×"),
2803
- ready: s("✔", "√"),
2804
- warn: s("⚠", "‼"),
2805
- info: s("ℹ", "i"),
2806
- success: s("✔", "√"),
2807
- debug: s("⚙", "D"),
2808
- trace: s("→", "→"),
2809
- fail: s("✖", "×"),
2810
- start: s("◐", "o"),
2811
- log: ""
2812
- };
2813
- function stringWidth(str) {
2814
- if (!(typeof Intl === "object") || !Intl.Segmenter) return stripAnsi$1(str).length;
2815
- return stringWidth$1(str);
2816
- }
2817
- var FancyReporter = class extends BasicReporter {
2818
- formatStack(stack, message, opts) {
2819
- const indent = " ".repeat((opts?.errorLevel || 0) + 1);
2820
- return `
2821
- ${indent}` + parseStack(stack, message).map((line) => " " + line.replace(/^at +/, (m) => colors.gray(m)).replace(/\((.+)\)/, (_, m) => `(${colors.cyan(m)})`)).join(`
2822
- ${indent}`);
2823
- }
2824
- formatType(logObj, isBadge, opts) {
2825
- const typeColor = TYPE_COLOR_MAP[logObj.type] || LEVEL_COLOR_MAP[logObj.level] || "gray";
2826
- if (isBadge) return getBgColor(typeColor)(colors.black(` ${logObj.type.toUpperCase()} `));
2827
- const _type = typeof TYPE_ICONS[logObj.type] === "string" ? TYPE_ICONS[logObj.type] : logObj.icon || logObj.type;
2828
- return _type ? getColor(typeColor)(_type) : "";
2829
- }
2830
- formatLogObj(logObj, opts) {
2831
- const [message, ...additional] = this.formatArgs(logObj.args, opts).split("\n");
2832
- if (logObj.type === "box") return box(characterFormat(message + (additional.length > 0 ? "\n" + additional.join("\n") : "")), {
2833
- title: logObj.title ? characterFormat(logObj.title) : void 0,
2834
- style: logObj.style
2835
- });
2836
- const date = this.formatDate(logObj.date, opts);
2837
- const coloredDate = date && colors.gray(date);
2838
- const isBadge = logObj.badge ?? logObj.level < 2;
2839
- const type = this.formatType(logObj, isBadge, opts);
2840
- const tag = logObj.tag ? colors.gray(logObj.tag) : "";
2841
- let line;
2842
- const left = this.filterAndJoin([type, characterFormat(message)]);
2843
- const right = this.filterAndJoin(opts.columns ? [tag, coloredDate] : [tag]);
2844
- const space = (opts.columns || 0) - stringWidth(left) - stringWidth(right) - 2;
2845
- line = space > 0 && (opts.columns || 0) >= 80 ? left + " ".repeat(space) + right : (right ? `${colors.gray(`[${right}]`)} ` : "") + left;
2846
- line += characterFormat(additional.length > 0 ? "\n" + additional.join("\n") : "");
2847
- if (logObj.type === "trace") {
2848
- const _err = /* @__PURE__ */ new Error("Trace: " + logObj.message);
2849
- line += this.formatStack(_err.stack || "", _err.message);
2850
- }
2851
- return isBadge ? "\n" + line + "\n" : line;
2852
- }
2853
- };
2854
- function characterFormat(str) {
2855
- return str.replace(/`([^`]+)`/gm, (_, m) => colors.cyan(m)).replace(/\s+_([^_]+)_\s+/gm, (_, m) => ` ${colors.underline(m)} `);
2856
- }
2857
- function getColor(color = "white") {
2858
- return colors[color] || colors.white;
2859
- }
2860
- function getBgColor(color = "bgWhite") {
2861
- return colors[`bg${color[0].toUpperCase()}${color.slice(1)}`] || colors.bgWhite;
2862
- }
2863
- function createConsola(options = {}) {
2864
- let level = _getDefaultLogLevel();
2865
- if (process.env.CONSOLA_LEVEL) level = Number.parseInt(process.env.CONSOLA_LEVEL) ?? level;
2866
- return createConsola$1({
2867
- level,
2868
- defaults: { level },
2869
- stdout: process.stdout,
2870
- stderr: process.stderr,
2871
- prompt: (...args) => import("./prompt-B1Yc1NPt.mjs").then((m) => m.prompt(...args)),
2872
- reporters: options.reporters || [options.fancy ?? !(T || R) ? new FancyReporter() : new BasicReporter()],
2873
- ...options
2874
- });
2875
- }
2876
- function _getDefaultLogLevel() {
2877
- if (g) return LogLevels.debug;
2878
- if (R) return LogLevels.warn;
2879
- return LogLevels.info;
2880
- }
2881
- createConsola();
2882
- //#endregion
2883
- //#region src/cli/logger.ts
2884
- /**
2885
- * Console logger
2886
- */
2887
- const logger = process.env.ROLLDOWN_TEST ? createTestingLogger() : createConsola({ formatOptions: { date: false } });
2888
- function createTestingLogger() {
2889
- const types = [
2890
- "silent",
2891
- "fatal",
2892
- "error",
2893
- "warn",
2894
- "log",
2895
- "info",
2896
- "success",
2897
- "fail",
2898
- "ready",
2899
- "start",
2900
- "box",
2901
- "debug",
2902
- "trace",
2903
- "verbose"
2904
- ];
2905
- const ret = Object.create(null);
2906
- for (const type of types) ret[type] = (...args) => console.log(...args);
2907
- return ret;
2908
- }
2909
- //#endregion
2910
- //#region src/utils/bindingify-output-options.ts
2911
- function bindingifyOutputOptions(outputOptions, pluginContextData) {
2912
- const { dir, format, exports, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapExcludeSources, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, banner, footer, postBanner, postFooter, intro, outro, esModule, globals, paths, generatedCode, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, comments, preserveModulesRoot, manualChunks, topLevelVar, cleanDir, strictExecutionOrder } = outputOptions;
2913
- if (legalComments != null) logger.warn("`legalComments` option is deprecated, please use `comments.legal` instead.");
2914
- const { inlineDynamicImports, advancedChunks } = bindingifyCodeSplitting(outputOptions.codeSplitting, outputOptions.inlineDynamicImports, outputOptions.advancedChunks, manualChunks, pluginContextData);
2915
- return {
2916
- dir,
2917
- file: file == null ? void 0 : file,
2918
- format: bindingifyFormat(format),
2919
- exports,
2920
- hashCharacters,
2921
- sourcemap: bindingifySourcemap(sourcemap),
2922
- sourcemapBaseUrl,
2923
- sourcemapDebugIds,
2924
- sourcemapExcludeSources,
2925
- sourcemapIgnoreList: sourcemapIgnoreList ?? /node_modules/,
2926
- sourcemapPathTransform,
2927
- banner: bindingifyAddon(banner),
2928
- footer: bindingifyAddon(footer),
2929
- postBanner: bindingifyAddon(postBanner),
2930
- postFooter: bindingifyAddon(postFooter),
2931
- intro: bindingifyAddon(intro),
2932
- outro: bindingifyAddon(outro),
2933
- extend: outputOptions.extend,
2934
- globals,
2935
- paths,
2936
- generatedCode,
2937
- esModule,
2938
- name,
2939
- assetFileNames: bindingifyAssetFilenames(assetFileNames),
2940
- entryFileNames,
2941
- chunkFileNames,
2942
- plugins: [],
2943
- minify: outputOptions.minify,
2944
- externalLiveBindings: outputOptions.externalLiveBindings,
2945
- inlineDynamicImports,
2946
- dynamicImportInCjs: outputOptions.dynamicImportInCjs,
2947
- manualCodeSplitting: advancedChunks,
2948
- polyfillRequire: outputOptions.polyfillRequire,
2949
- sanitizeFileName,
2950
- preserveModules,
2951
- virtualDirname,
2952
- legalComments,
2953
- comments: bindingifyComments(comments),
2954
- preserveModulesRoot,
2955
- topLevelVar,
2956
- minifyInternalExports: outputOptions.minifyInternalExports,
2957
- cleanDir,
2958
- strictExecutionOrder,
2959
- strict: outputOptions.strict
2960
- };
2961
- }
2962
- function bindingifyAddon(configAddon) {
2963
- if (configAddon == null || configAddon === "") return;
2964
- if (typeof configAddon === "function") return async (chunk) => configAddon(transformRenderedChunk(chunk));
2965
- return configAddon;
2966
- }
2967
- function bindingifyFormat(format) {
2968
- switch (format) {
2969
- case void 0:
2970
- case "es":
2971
- case "esm":
2972
- case "module": return "es";
2973
- case "cjs":
2974
- case "commonjs": return "cjs";
2975
- case "iife": return "iife";
2976
- case "umd": return "umd";
2977
- default: unimplemented(`output.format: ${format}`);
2978
- }
2979
- }
2980
- function bindingifySourcemap(sourcemap) {
2981
- switch (sourcemap) {
2982
- case true: return "file";
2983
- case "inline": return "inline";
2984
- case false:
2985
- case void 0: return;
2986
- case "hidden": return "hidden";
2987
- default: throw new Error(`unknown sourcemap: ${sourcemap}`);
2988
- }
2989
- }
2990
- function bindingifyAssetFilenames(assetFileNames) {
2991
- if (typeof assetFileNames === "function") return (asset) => {
2992
- return assetFileNames({
2993
- name: asset.name,
2994
- names: asset.names,
2995
- originalFileName: asset.originalFileName,
2996
- originalFileNames: asset.originalFileNames,
2997
- source: transformAssetSource(asset.source),
2998
- type: "asset"
2999
- });
3000
- };
3001
- return assetFileNames;
3002
- }
3003
- function bindingifyComments(comments) {
3004
- if (comments == null) return;
3005
- if (typeof comments === "boolean") return comments;
3006
- return comments;
3007
- }
3008
- function bindingifyCodeSplitting(codeSplitting, inlineDynamicImportsOption, advancedChunks, manualChunks, pluginContextData) {
3009
- let inlineDynamicImports;
3010
- let effectiveChunksOption;
3011
- if (codeSplitting === false) {
3012
- if (inlineDynamicImportsOption != null) logger.warn("`inlineDynamicImports` option is ignored because `codeSplitting: false` is set.");
3013
- if (manualChunks != null) throw new Error("Invalid configuration: \"output.manualChunks\" cannot be used when \"output.codeSplitting\" is set to false.");
3014
- if (advancedChunks != null) logger.warn("`advancedChunks` option is ignored because `codeSplitting` is set to `false`.");
3015
- return {
3016
- inlineDynamicImports: true,
3017
- advancedChunks: void 0
3018
- };
3019
- } else if (codeSplitting === true) {
3020
- if (inlineDynamicImportsOption != null) logger.warn("`inlineDynamicImports` option is ignored because `codeSplitting: true` is set.");
3021
- } else if (codeSplitting == null) {
3022
- if (inlineDynamicImportsOption != null) {
3023
- logger.warn("`inlineDynamicImports` option is deprecated, please use `codeSplitting: false` instead.");
3024
- inlineDynamicImports = inlineDynamicImportsOption;
3025
- }
3026
- } else {
3027
- effectiveChunksOption = codeSplitting;
3028
- if (inlineDynamicImportsOption != null) logger.warn("`inlineDynamicImports` option is ignored because the `codeSplitting` option is specified.");
3029
- }
3030
- if (inlineDynamicImports === true && manualChunks != null) throw new Error("Invalid value \"true\" for option \"output.inlineDynamicImports\" - this option is not supported for \"output.manualChunks\".");
3031
- if (effectiveChunksOption == null) {
3032
- if (advancedChunks != null) {
3033
- logger.warn("`advancedChunks` option is deprecated, please use `codeSplitting` instead.");
3034
- effectiveChunksOption = advancedChunks;
3035
- }
3036
- } else if (advancedChunks != null) logger.warn("`advancedChunks` option is ignored because the `codeSplitting` option is specified.");
3037
- if (manualChunks != null && effectiveChunksOption != null) logger.warn("`manualChunks` option is ignored because the `codeSplitting` option is specified.");
3038
- else if (manualChunks != null) effectiveChunksOption = { groups: [{ name(moduleId, ctx) {
3039
- return manualChunks(moduleId, { getModuleInfo: (id) => ctx.getModuleInfo(id) });
3040
- } }] };
3041
- if (inlineDynamicImports === true && effectiveChunksOption != null) {
3042
- logger.warn("`advancedChunks` option is ignored because `inlineDynamicImports: true` disables code splitting.");
3043
- effectiveChunksOption = void 0;
3044
- }
3045
- let advancedChunksResult;
3046
- if (effectiveChunksOption != null) {
3047
- const { groups, ...restOptions } = effectiveChunksOption;
3048
- advancedChunksResult = {
3049
- ...restOptions,
3050
- groups: groups?.map((group) => {
3051
- const { name, ...restGroup } = group;
3052
- return {
3053
- ...restGroup,
3054
- name: typeof name === "function" ? (id, ctx) => name(id, new ChunkingContextImpl(ctx, pluginContextData)) : name
3055
- };
3056
- })
3057
- };
3058
- }
3059
- return {
3060
- inlineDynamicImports,
3061
- advancedChunks: advancedChunksResult
3062
- };
3063
- }
3064
- //#endregion
3065
- //#region src/utils/initialize-parallel-plugins.ts
3066
- async function initializeParallelPlugins(plugins) {
3067
- const pluginInfos = [];
3068
- for (const [index, plugin] of plugins.entries()) if ("_parallel" in plugin) {
3069
- const { fileUrl, options } = plugin._parallel;
3070
- pluginInfos.push({
3071
- index,
3072
- fileUrl,
3073
- options
3074
- });
3075
- }
3076
- if (pluginInfos.length <= 0) return;
3077
- const count = availableParallelism();
3078
- const parallelJsPluginRegistry = new import_binding.ParallelJsPluginRegistry(count);
3079
- const registryId = parallelJsPluginRegistry.id;
3080
- const workers = await initializeWorkers(registryId, count, pluginInfos);
3081
- const stopWorkers = async () => {
3082
- await Promise.all(workers.map((worker) => worker.terminate()));
3083
- };
3084
- return {
3085
- registry: parallelJsPluginRegistry,
3086
- stopWorkers
3087
- };
3088
- }
3089
- function initializeWorkers(registryId, count, pluginInfos) {
3090
- return Promise.all(Array.from({ length: count }, (_, i) => initializeWorker(registryId, pluginInfos, i)));
3091
- }
3092
- async function initializeWorker(registryId, pluginInfos, threadNumber) {
3093
- const urlString = import.meta.resolve("#parallel-plugin-worker");
3094
- const workerData = {
3095
- registryId,
3096
- pluginInfos,
3097
- threadNumber
3098
- };
3099
- let worker;
3100
- try {
3101
- worker = new Worker(new URL(urlString), { workerData });
3102
- worker.unref();
3103
- await new Promise((resolve, reject) => {
3104
- worker.once("message", async (message) => {
3105
- if (message.type === "error") reject(message.error);
3106
- else resolve();
3107
- });
3108
- });
3109
- return worker;
3110
- } catch (e) {
3111
- worker?.terminate();
3112
- throw e;
3113
- }
3114
- }
3115
- const availableParallelism = () => {
3116
- let availableParallelism = 1;
3117
- try {
3118
- availableParallelism = os.availableParallelism();
3119
- } catch {
3120
- const cpus = os.cpus();
3121
- if (Array.isArray(cpus) && cpus.length > 0) availableParallelism = cpus.length;
3122
- }
3123
- return Math.min(availableParallelism, 8);
3124
- };
3125
- //#endregion
3126
- //#region src/utils/create-bundler-option.ts
3127
- async function createBundlerOptions(inputOptions, outputOptions, watchMode) {
3128
- const inputPlugins = await normalizePluginOption(inputOptions.plugins);
3129
- const outputPlugins = await normalizePluginOption(outputOptions.plugins);
3130
- const logLevel = inputOptions.logLevel || "info";
3131
- const onLog = getLogger(getObjectPlugins(inputPlugins), getOnLog(inputOptions, logLevel), logLevel, watchMode);
3132
- outputOptions = PluginDriver.callOutputOptionsHook([...inputPlugins, ...outputPlugins], outputOptions, onLog, logLevel, watchMode);
3133
- const hookOutputPlugins = await normalizePluginOption(outputOptions.plugins);
3134
- const normalizedInputPlugins = normalizePlugins(inputPlugins, ANONYMOUS_PLUGIN_PREFIX);
3135
- const normalizedOutputPlugins = normalizePlugins(hookOutputPlugins, ANONYMOUS_OUTPUT_PLUGIN_PREFIX);
3136
- let plugins = [...normalizedInputPlugins, ...checkOutputPluginOption(normalizedOutputPlugins, onLog)];
3137
- const parallelPluginInitResult = await initializeParallelPlugins(plugins);
3138
- if (inputOptions.experimental?.strictExecutionOrder !== void 0) console.warn("`experimental.strictExecutionOrder` has been stabilized and moved to `output.strictExecutionOrder`. Please update your configuration.");
3139
- try {
3140
- const pluginContextData = new PluginContextData(onLog, outputOptions, normalizedInputPlugins, normalizedOutputPlugins);
3141
- return {
3142
- bundlerOptions: {
3143
- inputOptions: bindingifyInputOptions(plugins, inputOptions, outputOptions, pluginContextData, normalizedOutputPlugins, onLog, logLevel, watchMode),
3144
- outputOptions: bindingifyOutputOptions(outputOptions, pluginContextData),
3145
- parallelPluginsRegistry: parallelPluginInitResult?.registry
3146
- },
3147
- inputOptions,
3148
- onLog,
3149
- stopWorkers: parallelPluginInitResult?.stopWorkers
3150
- };
3151
- } catch (e) {
3152
- await parallelPluginInitResult?.stopWorkers();
3153
- throw e;
3154
- }
3155
- }
3156
- //#endregion
3157
- //#region src/api/rolldown/rolldown-build.ts
3158
- Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
3159
- /**
3160
- * The bundle object returned by {@linkcode rolldown} function.
3161
- *
3162
- * @category Programmatic APIs
3163
- */
3164
- var RolldownBuild = class RolldownBuild {
3165
- #inputOptions;
3166
- #bundler;
3167
- #stopWorkers;
3168
- /** @internal */
3169
- static asyncRuntimeShutdown = false;
3170
- /** @hidden should not be used directly */
3171
- constructor(inputOptions) {
3172
- this.#inputOptions = inputOptions;
3173
- this.#bundler = new import_binding.BindingBundler();
3174
- }
3175
- /**
3176
- * Whether the bundle has been closed.
3177
- *
3178
- * If the bundle is closed, calling other methods will throw an error.
3179
- */
3180
- get closed() {
3181
- return this.#bundler.closed;
3182
- }
3183
- /**
3184
- * Generate bundles in-memory.
3185
- *
3186
- * If you directly want to write bundles to disk, use the {@linkcode write} method instead.
3187
- *
3188
- * @param outputOptions The output options.
3189
- * @returns The generated bundle.
3190
- * @throws {@linkcode BundleError} When an error occurs during the build.
3191
- */
3192
- async generate(outputOptions = {}) {
3193
- return this.#build(false, outputOptions);
3194
- }
3195
- /**
3196
- * Generate and write bundles to disk.
3197
- *
3198
- * If you want to generate bundles in-memory, use the {@linkcode generate} method instead.
3199
- *
3200
- * @param outputOptions The output options.
3201
- * @returns The generated bundle.
3202
- * @throws {@linkcode BundleError} When an error occurs during the build.
3203
- */
3204
- async write(outputOptions = {}) {
3205
- return this.#build(true, outputOptions);
3206
- }
3207
- /**
3208
- * Close the bundle and free resources.
3209
- *
3210
- * This method should be called even if the {@linkcode generate} method
3211
- * or the {@linkcode write} method threw an error. It should be called
3212
- * even if neither of the methods are called.
3213
- *
3214
- * This method is called automatically when using `using` syntax.
3215
- *
3216
- * @example
3217
- * ```js
3218
- * import { rolldown } from 'rolldown';
3219
- *
3220
- * {
3221
- * using bundle = await rolldown({ input: 'src/main.js' });
3222
- * const output = await bundle.generate({ format: 'esm' });
3223
- * console.log(output);
3224
- * // bundle.close() is called automatically here
3225
- * }
3226
- * ```
3227
- */
3228
- async close() {
3229
- await this.#stopWorkers?.();
3230
- await this.#bundler.close();
3231
- (0, import_binding.shutdownAsyncRuntime)();
3232
- RolldownBuild.asyncRuntimeShutdown = true;
3233
- this.#stopWorkers = void 0;
3234
- }
3235
- /** @hidden documented in close method */
3236
- async [Symbol.asyncDispose]() {
3237
- await this.close();
3238
- }
3239
- /**
3240
- * @experimental
3241
- * @hidden not ready for public usage yet
3242
- */
3243
- get watchFiles() {
3244
- return Promise.resolve(this.#bundler.getWatchFiles());
3245
- }
3246
- async #build(isWrite, outputOptions) {
3247
- validateOption("output", outputOptions);
3248
- await this.#stopWorkers?.();
3249
- const option = await createBundlerOptions(this.#inputOptions, outputOptions, false);
3250
- if (RolldownBuild.asyncRuntimeShutdown) (0, import_binding.startAsyncRuntime)();
3251
- try {
3252
- this.#stopWorkers = option.stopWorkers;
3253
- let output;
3254
- if (isWrite) output = await this.#bundler.write(option.bundlerOptions);
3255
- else output = await this.#bundler.generate(option.bundlerOptions);
3256
- return new RolldownOutputImpl(unwrapBindingResult(output));
3257
- } catch (e) {
3258
- await option.stopWorkers?.();
3259
- throw e;
3260
- }
3261
- }
3262
- };
3263
- //#endregion
3264
- export { getInputCliKeys as a, validateOption as c, getCliSchemaInfo as i, styleText$1 as l, createBundlerOptions as n, getOutputCliKeys as o, logger as r, validateCliOptions as s, RolldownBuild as t, PluginDriver as u };