@rspress/core 2.0.0-rc.0 → 2.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (298) hide show
  1. package/bin/rspress.js +1 -1
  2. package/dist/0~7675.989ee664.js +1791 -0
  3. package/dist/1218.3869bad6.js +2 -0
  4. package/dist/4669.12208c6a.js +2 -0
  5. package/dist/5313.6594aba0.js +63 -0
  6. package/dist/5485.2a0273cf.js +98 -0
  7. package/dist/6289.c67fe0d5.js +5 -0
  8. package/dist/7805.cadab34e.js +4 -0
  9. package/dist/8813.9da1f210.js +2 -0
  10. package/dist/cli/config/index.js +4 -0
  11. package/dist/cli/config/loadConfigFile.js +30 -0
  12. package/dist/cli/index.cb89dbd1.js +3 -0
  13. package/dist/cli/index.js +122 -0
  14. package/dist/eject-theme/components/Banner/index.tsx +3 -4
  15. package/dist/eject-theme/components/Button/index.scss +1 -6
  16. package/dist/eject-theme/components/Callout/index.scss +0 -2
  17. package/dist/eject-theme/components/CodeBlock/index.scss +4 -12
  18. package/dist/eject-theme/components/CodeBlock/index.tsx +6 -1
  19. package/dist/eject-theme/components/CodeButtonGroup/CopyCodeButton.tsx +1 -3
  20. package/dist/eject-theme/components/CodeButtonGroup/index.scss +5 -1
  21. package/dist/eject-theme/components/CodeButtonGroup/index.tsx +1 -3
  22. package/dist/eject-theme/components/DocContent/doc.scss +30 -9
  23. package/dist/eject-theme/components/DocContent/docComponents/table.tsx +10 -4
  24. package/dist/eject-theme/components/DocContent/index.tsx +5 -2
  25. package/dist/eject-theme/components/{DocContent/FallbackHeading.tsx → FallbackHeading/index.tsx} +20 -11
  26. package/dist/eject-theme/components/HoverGroup/index.scss +5 -1
  27. package/dist/eject-theme/components/HoverGroup/index.tsx +5 -1
  28. package/dist/eject-theme/components/Link/index.tsx +43 -9
  29. package/dist/eject-theme/components/Link/useLinkNavigate.ts +32 -16
  30. package/dist/eject-theme/components/Nav/NavMenu.scss +1 -0
  31. package/dist/eject-theme/components/Nav/NavMenu.tsx +2 -3
  32. package/dist/eject-theme/components/Nav/NavTitle.scss +11 -0
  33. package/dist/eject-theme/components/Nav/NavTitle.tsx +1 -0
  34. package/dist/eject-theme/components/Nav/index.scss +0 -8
  35. package/dist/eject-theme/components/NavHamburger/index.tsx +3 -4
  36. package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.scss +14 -0
  37. package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.tsx +2 -3
  38. package/dist/eject-theme/components/Outline/index.scss +0 -1
  39. package/dist/eject-theme/components/Overview/OverviewGroup.tsx +1 -2
  40. package/dist/eject-theme/components/Overview/index.tsx +6 -2
  41. package/dist/eject-theme/components/PackageManagerTabs/index.tsx +12 -0
  42. package/dist/eject-theme/components/PrevNextPage/index.tsx +6 -3
  43. package/dist/eject-theme/components/Root/index.tsx +58 -0
  44. package/dist/eject-theme/components/Search/NoSearchResult.tsx +2 -3
  45. package/dist/eject-theme/components/Search/SearchButton.tsx +3 -4
  46. package/dist/eject-theme/components/Search/SearchPanel.tsx +14 -9
  47. package/dist/eject-theme/components/Search/SuggestItem.tsx +15 -12
  48. package/dist/eject-theme/components/Sidebar/SidebarGroup.tsx +2 -3
  49. package/dist/eject-theme/components/Sidebar/SidebarItem.scss +12 -8
  50. package/dist/eject-theme/components/Sidebar/SidebarItem.tsx +6 -4
  51. package/dist/eject-theme/components/Sidebar/SidebarSectionHeader.scss +1 -1
  52. package/dist/eject-theme/components/SidebarMenu/index.tsx +4 -4
  53. package/dist/eject-theme/components/SocialLinks/index.tsx +2 -3
  54. package/dist/eject-theme/components/SourceCode/index.scss +2 -1
  55. package/dist/eject-theme/components/SourceCode/index.tsx +6 -4
  56. package/dist/eject-theme/components/SwitchAppearance/index.tsx +3 -5
  57. package/dist/eject-theme/components/Tabs/index.scss +19 -22
  58. package/dist/eject-theme/components/Toc/TocItem.scss +8 -4
  59. package/dist/eject-theme/components/Toc/TocItem.tsx +1 -0
  60. package/dist/index.d.ts +6 -6
  61. package/dist/index.js +16 -3134
  62. package/dist/node/PluginDriver.d.ts +1 -1
  63. package/dist/node/PluginDriver.js +143 -0
  64. package/dist/node/auto-nav-sidebar/index.js +44 -0
  65. package/dist/node/auto-nav-sidebar/locales.js +26 -0
  66. package/dist/node/auto-nav-sidebar/normalize.js +228 -0
  67. package/dist/node/auto-nav-sidebar/utils.js +68 -0
  68. package/dist/node/auto-nav-sidebar/walk.js +67 -0
  69. package/dist/node/build.js +31 -0
  70. package/dist/node/constants.d.ts +1 -0
  71. package/dist/node/constants.js +33 -0
  72. package/dist/node/dev.js +32 -0
  73. package/dist/node/eject.js +111 -0
  74. package/dist/node/index.d.ts +5 -5
  75. package/dist/node/initRsbuild.d.ts +2 -2
  76. package/dist/node/initRsbuild.js +338 -0
  77. package/dist/node/last-updated/index.js +28 -0
  78. package/dist/node/logger/hint.d.ts +1 -1
  79. package/dist/node/logger/hint.js +85 -0
  80. package/dist/node/mdx/loader.d.ts +1 -1
  81. package/dist/node/mdx/loader.e1578c62.js +13 -0
  82. package/dist/{loader.js → node/mdx/loader.js} +2 -2
  83. package/dist/node/mdx/options.d.ts +2 -2
  84. package/dist/node/mdx/options.js +100 -0
  85. package/dist/node/mdx/processor.d.ts +2 -2
  86. package/dist/node/mdx/processor.js +71 -0
  87. package/dist/node/mdx/rehypePlugins/codeMeta.js +10 -0
  88. package/dist/node/mdx/rehypePlugins/headerAnchor.js +53 -0
  89. package/dist/node/mdx/rehypePlugins/shiki.js +34 -0
  90. package/dist/node/mdx/rehypePlugins/transformers/add-lang.js +15 -0
  91. package/dist/node/mdx/rehypePlugins/transformers/add-line-numbers.js +22 -0
  92. package/dist/node/mdx/rehypePlugins/transformers/add-title.js +24 -0
  93. package/dist/node/mdx/rehypePlugins/transformers/add-wrap-code.js +22 -0
  94. package/dist/node/mdx/rehypePlugins/transformers/index.d.ts +5 -5
  95. package/dist/node/mdx/rehypePlugins/transformers/index.js +5 -0
  96. package/dist/node/mdx/rehypePlugins/transformers/meta-highlight.js +41 -0
  97. package/dist/node/mdx/remarkPlugins/builtin.js +11 -0
  98. package/dist/node/mdx/remarkPlugins/containerSyntax.js +190 -0
  99. package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +66 -0
  100. package/dist/node/mdx/remarkPlugins/image.js +67 -0
  101. package/dist/node/mdx/remarkPlugins/link.d.ts +1 -1
  102. package/dist/node/mdx/remarkPlugins/link.js +99 -0
  103. package/dist/node/mdx/remarkPlugins/toc.js +50 -0
  104. package/dist/node/mdx/types.d.ts +3 -3
  105. package/dist/node/medium-zoom/index.d.ts +1 -1
  106. package/dist/node/medium-zoom/index.js +14 -0
  107. package/dist/node/route/RoutePage.d.ts +1 -1
  108. package/dist/node/route/RoutePage.js +61 -0
  109. package/dist/node/route/RouteService.d.ts +1 -1
  110. package/dist/node/route/RouteService.js +177 -0
  111. package/dist/node/route/extractPageData.d.ts +1 -1
  112. package/dist/node/route/extractPageData.js +112 -0
  113. package/dist/node/route/normalizeRoutePath.js +54 -0
  114. package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.d.ts +21 -0
  115. package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.js +150 -0
  116. package/dist/node/runtimeModule/globalStyles.d.ts +1 -1
  117. package/dist/node/runtimeModule/globalStyles.js +12 -0
  118. package/dist/node/runtimeModule/globalUIComponents.d.ts +1 -1
  119. package/dist/node/runtimeModule/globalUIComponents.js +25 -0
  120. package/dist/node/runtimeModule/i18n.d.ts +2 -2
  121. package/dist/node/runtimeModule/i18n.js +83 -0
  122. package/dist/node/runtimeModule/pageData/createPageData.d.ts +1 -1
  123. package/dist/node/runtimeModule/pageData/createPageData.js +64 -0
  124. package/dist/node/runtimeModule/pageData/rsbuildPlugin.d.ts +1 -1
  125. package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +51 -0
  126. package/dist/node/runtimeModule/routeList.d.ts +1 -1
  127. package/dist/node/runtimeModule/routeList.js +7 -0
  128. package/dist/node/runtimeModule/searchHooks.d.ts +1 -1
  129. package/dist/node/runtimeModule/searchHooks.js +11 -0
  130. package/dist/node/runtimeModule/siteData/createSiteData.js +34 -0
  131. package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +94 -0
  132. package/dist/node/runtimeModule/siteData/rsbuildPlugin.d.ts +1 -1
  133. package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +24 -0
  134. package/dist/node/runtimeModule/socialLinks.d.ts +1 -1
  135. package/dist/node/runtimeModule/socialLinks.js +8 -0
  136. package/dist/node/runtimeModule/types.d.ts +2 -2
  137. package/dist/node/serve.js +23 -0
  138. package/dist/node/ssg/renderHtmlTemplate.js +33 -0
  139. package/dist/node/ssg/renderPage.js +34 -0
  140. package/dist/node/ssg/renderPageWorker.474f9f73.js +2 -0
  141. package/dist/node/ssg/renderPageWorker.js +15 -0
  142. package/dist/node/ssg/renderPages.d.ts +1 -1
  143. package/dist/node/ssg/renderPages.js +105 -0
  144. package/dist/node/ssg/renderPages.js.LICENSE.txt +4 -0
  145. package/dist/node/ssg/rsbuildPluginCSR.d.ts +1 -1
  146. package/dist/node/ssg/rsbuildPluginCSR.js +27 -0
  147. package/dist/node/ssg/rsbuildPluginSSG.d.ts +1 -1
  148. package/dist/node/ssg/rsbuildPluginSSG.js +72 -0
  149. package/dist/node/ssg/ssgEnv.js +33 -0
  150. package/dist/node/ssg/ssgEnv.js.LICENSE.txt +5 -0
  151. package/dist/node/ssg-md/llms/emitLlmsTxt.d.ts +1 -1
  152. package/dist/node/ssg-md/llms/emitLlmsTxt.js +80 -0
  153. package/dist/node/ssg-md/llms/llmsTxt.d.ts +1 -1
  154. package/dist/node/ssg-md/llms/llmsTxt.js +66 -0
  155. package/dist/node/ssg-md/react/index.d.ts +1 -1
  156. package/dist/node/ssg-md/remarkSplitMdx.js +202 -0
  157. package/dist/node/ssg-md/renderPage.js +31 -0
  158. package/dist/node/ssg-md/renderPages.d.ts +1 -1
  159. package/dist/node/ssg-md/renderPages.js +27 -0
  160. package/dist/node/ssg-md/rsbuildPluginSSGMD.d.ts +1 -1
  161. package/dist/node/ssg-md/rsbuildPluginSSGMD.js +47 -0
  162. package/dist/node/utils/applyReplaceRules.js +6 -0
  163. package/dist/node/utils/checkLanguageParity.js +77 -0
  164. package/dist/node/utils/createHash.js +5 -0
  165. package/dist/node/utils/error.d.ts +9 -0
  166. package/dist/node/utils/error.js +9 -0
  167. package/dist/node/utils/escapeHeadingIds.js +5 -0
  168. package/dist/node/utils/flattenMdxContent.js +74 -0
  169. package/dist/node/utils/fs.js +14 -0
  170. package/dist/node/utils/getImportAstNode.js +63 -0
  171. package/dist/node/utils/getPageKey.js +6 -0
  172. package/dist/node/utils/getSocialIcons.js +32 -0
  173. package/dist/node/utils/index.d.ts +10 -9
  174. package/dist/node/utils/normalizePath.js +10 -0
  175. package/dist/node/utils/reactAlias.d.ts +2 -0
  176. package/dist/node/utils/reactAlias.js +83 -0
  177. package/dist/rslib-runtime.99091bf6.js +18 -0
  178. package/dist/runtime/App.js +2 -2
  179. package/dist/runtime/ClientApp.d.ts +1 -1
  180. package/dist/runtime/ClientApp.js +0 -4
  181. package/dist/runtime/ssrMdServerEntry.js +1 -1
  182. package/dist/runtime/ssrServerEntry.js +2 -1
  183. package/dist/runtime.72d450ac.js +1 -0
  184. package/dist/runtime.js +3 -2
  185. package/dist/shiki-transformers.d.ts +1 -1
  186. package/dist/shiki-transformers.js +6 -120
  187. package/dist/theme/assets/moon.js +9 -26
  188. package/dist/theme/components/Banner/index.d.ts +1 -1
  189. package/dist/theme/components/Banner/index.js +2 -3
  190. package/dist/theme/components/Button/index.css +1 -1
  191. package/dist/theme/components/Callout/index.css +0 -2
  192. package/dist/theme/components/CodeBlock/index.css +4 -15
  193. package/dist/theme/components/CodeBlock/index.js +1 -0
  194. package/dist/theme/components/CodeButtonGroup/CopyCodeButton.js +3 -5
  195. package/dist/theme/components/CodeButtonGroup/index.css +5 -1
  196. package/dist/theme/components/CodeButtonGroup/index.js +3 -5
  197. package/dist/theme/components/DocContent/doc.css +30 -8
  198. package/dist/theme/components/DocContent/docComponents/index.d.ts +3 -3
  199. package/dist/theme/components/DocContent/docComponents/table.d.ts +2 -2
  200. package/dist/theme/components/DocContent/docComponents/table.js +8 -3
  201. package/dist/theme/components/DocContent/index.js +3 -2
  202. package/dist/theme/components/{DocContent/FallbackHeading.js → FallbackHeading/index.js} +19 -11
  203. package/dist/theme/components/HoverGroup/index.css +5 -1
  204. package/dist/theme/components/HoverGroup/index.js +1 -0
  205. package/dist/theme/components/HoverGroup/useHoverGroup.d.ts +1 -1
  206. package/dist/theme/components/Link/index.d.ts +18 -1
  207. package/dist/theme/components/Link/index.js +14 -8
  208. package/dist/theme/components/Link/useLinkNavigate.d.ts +4 -1
  209. package/dist/theme/components/Link/useLinkNavigate.js +23 -17
  210. package/dist/theme/components/Nav/NavMenu.css +1 -0
  211. package/dist/theme/components/Nav/NavMenu.js +2 -3
  212. package/dist/theme/components/Nav/NavTitle.css +12 -0
  213. package/dist/theme/components/Nav/NavTitle.d.ts +1 -0
  214. package/dist/theme/components/Nav/NavTitle.js +1 -0
  215. package/dist/theme/components/Nav/index.css +0 -8
  216. package/dist/theme/components/NavHamburger/index.js +3 -4
  217. package/dist/theme/components/NavScreen/NavScreenMenuItem.css +9 -0
  218. package/dist/theme/components/NavScreen/NavScreenMenuItem.js +2 -3
  219. package/dist/theme/components/Outline/index.css +0 -1
  220. package/dist/theme/components/Overview/OverviewGroup.js +1 -2
  221. package/dist/theme/components/Overview/index.js +1 -2
  222. package/dist/theme/components/PackageManagerTabs/index.d.ts +1 -1
  223. package/dist/theme/components/PackageManagerTabs/index.js +4 -0
  224. package/dist/theme/components/PrevNextPage/index.js +3 -4
  225. package/dist/theme/components/Root/index.d.ts +54 -0
  226. package/dist/theme/components/Root/index.js +7 -0
  227. package/dist/theme/components/Search/NoSearchResult.js +2 -3
  228. package/dist/theme/components/Search/SearchButton.js +3 -4
  229. package/dist/theme/components/Search/SearchPanel.js +13 -16
  230. package/dist/theme/components/Search/SuggestItem.d.ts +1 -1
  231. package/dist/theme/components/Search/SuggestItem.js +7 -11
  232. package/dist/theme/components/Search/logic/Provider.d.ts +1 -1
  233. package/dist/theme/components/Search/logic/providers/LocalProvider.d.ts +2 -2
  234. package/dist/theme/components/Search/logic/search.d.ts +1 -1
  235. package/dist/theme/components/Sidebar/SidebarGroup.js +2 -3
  236. package/dist/theme/components/Sidebar/SidebarItem.css +11 -3
  237. package/dist/theme/components/Sidebar/SidebarItem.js +6 -3
  238. package/dist/theme/components/Sidebar/SidebarSectionHeader.css +1 -1
  239. package/dist/theme/components/SidebarMenu/index.js +3 -5
  240. package/dist/theme/components/SocialLinks/index.js +2 -3
  241. package/dist/theme/components/SourceCode/index.css +5 -0
  242. package/dist/theme/components/SourceCode/index.js +2 -4
  243. package/dist/theme/components/SwitchAppearance/index.js +3 -5
  244. package/dist/theme/components/Tabs/index.css +13 -22
  245. package/dist/theme/components/Toc/TocItem.css +7 -4
  246. package/dist/theme/components/Toc/TocItem.js +1 -0
  247. package/dist/theme/icons.d.ts +25 -0
  248. package/dist/theme/icons.js +47 -0
  249. package/dist/theme/index.d.ts +62 -59
  250. package/dist/theme/index.js +5 -2
  251. package/dist/theme/layout/DocLayout/index.css +2 -2
  252. package/dist/theme/layout/DocLayout/index.js +1 -4
  253. package/dist/theme/layout/Layout/index.d.ts +1 -1
  254. package/dist/theme/layout/Layout/index.js +3 -3
  255. package/dist/theme/logic/useFullTextSearch.d.ts +1 -1
  256. package/dist/theme/logic/useScrollAfterNav.d.ts +5 -0
  257. package/dist/theme/logic/{sideEffects.js → useScrollAfterNav.js} +5 -6
  258. package/dist/theme/logic/useScrollReset.d.ts +5 -0
  259. package/dist/theme/logic/useScrollReset.js +12 -0
  260. package/dist/theme/logic/useSetup.js +2 -0
  261. package/dist/theme/styles/base.css +1 -10
  262. package/dist/theme/styles/index.d.ts +1 -1
  263. package/dist/theme/styles/index.js +1 -1
  264. package/dist/theme/styles/scrollbar.css +1 -0
  265. package/dist/theme/styles/vars/base-vars.css +5 -3
  266. package/dist/theme/styles/vars/home-vars.css +4 -2
  267. package/package.json +19 -20
  268. package/dist/3~101.js +0 -1786
  269. package/dist/3~335.js +0 -26
  270. package/dist/3~395.js +0 -74
  271. package/dist/cli.js +0 -259
  272. package/dist/index.js.LICENSE.txt +0 -10
  273. package/dist/node/auto-nav-sidebar/fixtures/docs/guide/c.d.ts +0 -2
  274. package/dist/node/auto-nav-sidebar/fixtures/docs-locales/en/guide/c.d.ts +0 -2
  275. package/dist/node/auto-nav-sidebar/fixtures/docs-locales/zh/guide/c.d.ts +0 -2
  276. package/dist/node/auto-nav-sidebar/locales.test.d.ts +0 -1
  277. package/dist/node/auto-nav-sidebar/walk.test.d.ts +0 -1
  278. package/dist/node/mdx/rehypePlugins/headerAnchor.test.d.ts +0 -1
  279. package/dist/node/mdx/remarkPlugins/containerSyntax.test.d.ts +0 -1
  280. package/dist/node/mdx/remarkPlugins/fileCodeBlock.test.d.ts +0 -1
  281. package/dist/node/mdx/remarkPlugins/image.test.d.ts +0 -1
  282. package/dist/node/mdx/remarkPlugins/link.test.d.ts +0 -1
  283. package/dist/node/route/RouteService.test.d.ts +0 -1
  284. package/dist/node/route/extractPageData.test.d.ts +0 -1
  285. package/dist/node/route/fixtures/basic/guide/c.d.ts +0 -2
  286. package/dist/node/route/normalizeRoutePath.test.d.ts +0 -1
  287. package/dist/node/runtimeModule/i18n.test.d.ts +0 -1
  288. package/dist/node/ssg-md/remarkSplitMdx.test.d.ts +0 -4
  289. package/dist/node/utils/checkLanguageParity.test.d.ts +0 -1
  290. package/dist/node/utils/detectCustomIcon.d.ts +0 -1
  291. package/dist/node/utils/detectReactVersion.d.ts +0 -3
  292. package/dist/processor.js +0 -4539
  293. package/dist/renderPageWorker.js +0 -196
  294. package/dist/theme/components/Search/logic/util.test.d.ts +0 -1
  295. /package/dist/cli/{config.d.ts → config/index.d.ts} +0 -0
  296. /package/dist/{shiki-transformers.js.LICENSE.txt → node/mdx/rehypePlugins/transformers/meta-highlight.js.LICENSE.txt} +0 -0
  297. /package/dist/theme/components/{DocContent/FallbackHeading.d.ts → FallbackHeading/index.d.ts} +0 -0
  298. /package/dist/theme/logic/{sideEffects.d.ts → useSetup.d.ts} +0 -0
@@ -0,0 +1,1791 @@
1
+ import * as __rspack_external_child_process from "child_process";
2
+ import * as __rspack_external_fs from "fs";
3
+ import * as __rspack_external_stream from "stream";
4
+ import { __webpack_require__ } from "./rslib-runtime.99091bf6.js";
5
+ import { Buffer } from "node:buffer";
6
+ import node_child_process, { ChildProcess } from "node:child_process";
7
+ import { setTimeout as promises_setTimeout } from "node:timers/promises";
8
+ import { debuglog } from "node:util";
9
+ import { node_process } from "./1218.3869bad6.js";
10
+ import { node_path } from "./6289.c67fe0d5.js";
11
+ import { node_url } from "./5485.2a0273cf.js";
12
+ import { node_os, constants } from "./7805.cadab34e.js";
13
+ import { createWriteStream, createReadStream, readFileSync } from "./5313.6594aba0.js";
14
+ __webpack_require__.add({
15
+ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js" (module, __unused_webpack_exports, __webpack_require__) {
16
+ const cp = __webpack_require__("child_process");
17
+ const parse = __webpack_require__("../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js");
18
+ const enoent = __webpack_require__("../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js");
19
+ function spawn(command, args, options) {
20
+ const parsed = parse(command, args, options);
21
+ const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
22
+ enoent.hookChildProcess(spawned, parsed);
23
+ return spawned;
24
+ }
25
+ function spawnSync(command, args, options) {
26
+ const parsed = parse(command, args, options);
27
+ const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
28
+ result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
29
+ return result;
30
+ }
31
+ module.exports = spawn;
32
+ module.exports.spawn = spawn;
33
+ module.exports.sync = spawnSync;
34
+ module.exports._parse = parse;
35
+ module.exports._enoent = enoent;
36
+ },
37
+ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.js" (module) {
38
+ const isWin = 'win32' === process.platform;
39
+ function notFoundError(original, syscall) {
40
+ return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
41
+ code: 'ENOENT',
42
+ errno: 'ENOENT',
43
+ syscall: `${syscall} ${original.command}`,
44
+ path: original.command,
45
+ spawnargs: original.args
46
+ });
47
+ }
48
+ function hookChildProcess(cp, parsed) {
49
+ if (!isWin) return;
50
+ const originalEmit = cp.emit;
51
+ cp.emit = function(name, arg1) {
52
+ if ('exit' === name) {
53
+ const err = verifyENOENT(arg1, parsed);
54
+ if (err) return originalEmit.call(cp, 'error', err);
55
+ }
56
+ return originalEmit.apply(cp, arguments);
57
+ };
58
+ }
59
+ function verifyENOENT(status, parsed) {
60
+ if (isWin && 1 === status && !parsed.file) return notFoundError(parsed.original, 'spawn');
61
+ return null;
62
+ }
63
+ function verifyENOENTSync(status, parsed) {
64
+ if (isWin && 1 === status && !parsed.file) return notFoundError(parsed.original, 'spawnSync');
65
+ return null;
66
+ }
67
+ module.exports = {
68
+ hookChildProcess,
69
+ verifyENOENT,
70
+ verifyENOENTSync,
71
+ notFoundError
72
+ };
73
+ },
74
+ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js" (module, __unused_webpack_exports, __webpack_require__) {
75
+ const path = __webpack_require__("path");
76
+ const resolveCommand = __webpack_require__("../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js");
77
+ const escape = __webpack_require__("../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js");
78
+ const readShebang = __webpack_require__("../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js");
79
+ const isWin = 'win32' === process.platform;
80
+ const isExecutableRegExp = /\.(?:com|exe)$/i;
81
+ const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
82
+ function detectShebang(parsed) {
83
+ parsed.file = resolveCommand(parsed);
84
+ const shebang = parsed.file && readShebang(parsed.file);
85
+ if (shebang) {
86
+ parsed.args.unshift(parsed.file);
87
+ parsed.command = shebang;
88
+ return resolveCommand(parsed);
89
+ }
90
+ return parsed.file;
91
+ }
92
+ function parseNonShell(parsed) {
93
+ if (!isWin) return parsed;
94
+ const commandFile = detectShebang(parsed);
95
+ const needsShell = !isExecutableRegExp.test(commandFile);
96
+ if (parsed.options.forceShell || needsShell) {
97
+ const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
98
+ parsed.command = path.normalize(parsed.command);
99
+ parsed.command = escape.command(parsed.command);
100
+ parsed.args = parsed.args.map((arg)=>escape.argument(arg, needsDoubleEscapeMetaChars));
101
+ const shellCommand = [
102
+ parsed.command
103
+ ].concat(parsed.args).join(' ');
104
+ parsed.args = [
105
+ '/d',
106
+ '/s',
107
+ '/c',
108
+ `"${shellCommand}"`
109
+ ];
110
+ parsed.command = process.env.comspec || 'cmd.exe';
111
+ parsed.options.windowsVerbatimArguments = true;
112
+ }
113
+ return parsed;
114
+ }
115
+ function parse(command, args, options) {
116
+ if (args && !Array.isArray(args)) {
117
+ options = args;
118
+ args = null;
119
+ }
120
+ args = args ? args.slice(0) : [];
121
+ options = Object.assign({}, options);
122
+ const parsed = {
123
+ command,
124
+ args,
125
+ options,
126
+ file: void 0,
127
+ original: {
128
+ command,
129
+ args
130
+ }
131
+ };
132
+ return options.shell ? parsed : parseNonShell(parsed);
133
+ }
134
+ module.exports = parse;
135
+ },
136
+ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js" (module) {
137
+ const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
138
+ function escapeCommand(arg) {
139
+ arg = arg.replace(metaCharsRegExp, '^$1');
140
+ return arg;
141
+ }
142
+ function escapeArgument(arg, doubleEscapeMetaChars) {
143
+ arg = `${arg}`;
144
+ arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
145
+ arg = arg.replace(/(?=(\\+?)?)\1$/, '$1$1');
146
+ arg = `"${arg}"`;
147
+ arg = arg.replace(metaCharsRegExp, '^$1');
148
+ if (doubleEscapeMetaChars) arg = arg.replace(metaCharsRegExp, '^$1');
149
+ return arg;
150
+ }
151
+ module.exports.command = escapeCommand;
152
+ module.exports.argument = escapeArgument;
153
+ },
154
+ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js" (module, __unused_webpack_exports, __webpack_require__) {
155
+ const fs = __webpack_require__("fs");
156
+ const shebangCommand = __webpack_require__("../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js");
157
+ function readShebang(command) {
158
+ const size = 150;
159
+ const buffer = Buffer.alloc(size);
160
+ let fd;
161
+ try {
162
+ fd = fs.openSync(command, 'r');
163
+ fs.readSync(fd, buffer, 0, size, 0);
164
+ fs.closeSync(fd);
165
+ } catch (e) {}
166
+ return shebangCommand(buffer.toString());
167
+ }
168
+ module.exports = readShebang;
169
+ },
170
+ "../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js" (module, __unused_webpack_exports, __webpack_require__) {
171
+ const path = __webpack_require__("path");
172
+ const which = __webpack_require__("../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js");
173
+ const getPathKey = __webpack_require__("../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js");
174
+ function resolveCommandAttempt(parsed, withoutPathExt) {
175
+ const env = parsed.options.env || process.env;
176
+ const cwd = process.cwd();
177
+ const hasCustomCwd = null != parsed.options.cwd;
178
+ const shouldSwitchCwd = hasCustomCwd && void 0 !== process.chdir && !process.chdir.disabled;
179
+ if (shouldSwitchCwd) try {
180
+ process.chdir(parsed.options.cwd);
181
+ } catch (err) {}
182
+ let resolved;
183
+ try {
184
+ resolved = which.sync(parsed.command, {
185
+ path: env[getPathKey({
186
+ env
187
+ })],
188
+ pathExt: withoutPathExt ? path.delimiter : void 0
189
+ });
190
+ } catch (e) {} finally{
191
+ if (shouldSwitchCwd) process.chdir(cwd);
192
+ }
193
+ if (resolved) resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
194
+ return resolved;
195
+ }
196
+ function resolveCommand(parsed) {
197
+ return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
198
+ }
199
+ module.exports = resolveCommand;
200
+ },
201
+ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js" (module, __unused_webpack_exports, __webpack_require__) {
202
+ __webpack_require__("fs");
203
+ var core;
204
+ core = 'win32' === process.platform || global.TESTING_WINDOWS ? __webpack_require__("../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js") : __webpack_require__("../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js");
205
+ module.exports = isexe;
206
+ isexe.sync = sync;
207
+ function isexe(path, options, cb) {
208
+ if ('function' == typeof options) {
209
+ cb = options;
210
+ options = {};
211
+ }
212
+ if (!cb) {
213
+ if ('function' != typeof Promise) throw new TypeError('callback not provided');
214
+ return new Promise(function(resolve, reject) {
215
+ isexe(path, options || {}, function(er, is) {
216
+ if (er) reject(er);
217
+ else resolve(is);
218
+ });
219
+ });
220
+ }
221
+ core(path, options || {}, function(er, is) {
222
+ if (er) {
223
+ if ('EACCES' === er.code || options && options.ignoreErrors) {
224
+ er = null;
225
+ is = false;
226
+ }
227
+ }
228
+ cb(er, is);
229
+ });
230
+ }
231
+ function sync(path, options) {
232
+ try {
233
+ return core.sync(path, options || {});
234
+ } catch (er) {
235
+ if (options && options.ignoreErrors || 'EACCES' === er.code) return false;
236
+ throw er;
237
+ }
238
+ }
239
+ },
240
+ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js" (module, __unused_webpack_exports, __webpack_require__) {
241
+ module.exports = isexe;
242
+ isexe.sync = sync;
243
+ var fs = __webpack_require__("fs");
244
+ function isexe(path, options, cb) {
245
+ fs.stat(path, function(er, stat) {
246
+ cb(er, er ? false : checkStat(stat, options));
247
+ });
248
+ }
249
+ function sync(path, options) {
250
+ return checkStat(fs.statSync(path), options);
251
+ }
252
+ function checkStat(stat, options) {
253
+ return stat.isFile() && checkMode(stat, options);
254
+ }
255
+ function checkMode(stat, options) {
256
+ var mod = stat.mode;
257
+ var uid = stat.uid;
258
+ var gid = stat.gid;
259
+ var myUid = void 0 !== options.uid ? options.uid : process.getuid && process.getuid();
260
+ var myGid = void 0 !== options.gid ? options.gid : process.getgid && process.getgid();
261
+ var u = parseInt('100', 8);
262
+ var g = parseInt('010', 8);
263
+ var o = parseInt('001', 8);
264
+ var ug = u | g;
265
+ var ret = mod & o || mod & g && gid === myGid || mod & u && uid === myUid || mod & ug && 0 === myUid;
266
+ return ret;
267
+ }
268
+ },
269
+ "../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js" (module, __unused_webpack_exports, __webpack_require__) {
270
+ module.exports = isexe;
271
+ isexe.sync = sync;
272
+ var fs = __webpack_require__("fs");
273
+ function checkPathExt(path, options) {
274
+ var pathext = void 0 !== options.pathExt ? options.pathExt : process.env.PATHEXT;
275
+ if (!pathext) return true;
276
+ pathext = pathext.split(';');
277
+ if (-1 !== pathext.indexOf('')) return true;
278
+ for(var i = 0; i < pathext.length; i++){
279
+ var p = pathext[i].toLowerCase();
280
+ if (p && path.substr(-p.length).toLowerCase() === p) return true;
281
+ }
282
+ return false;
283
+ }
284
+ function checkStat(stat, path, options) {
285
+ if (!stat.isSymbolicLink() && !stat.isFile()) return false;
286
+ return checkPathExt(path, options);
287
+ }
288
+ function isexe(path, options, cb) {
289
+ fs.stat(path, function(er, stat) {
290
+ cb(er, er ? false : checkStat(stat, path, options));
291
+ });
292
+ }
293
+ function sync(path, options) {
294
+ return checkStat(fs.statSync(path), path, options);
295
+ }
296
+ },
297
+ "../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js" (module, __unused_webpack_exports, __webpack_require__) {
298
+ const { PassThrough } = __webpack_require__("stream");
299
+ module.exports = function() {
300
+ var sources = [];
301
+ var output = new PassThrough({
302
+ objectMode: true
303
+ });
304
+ output.setMaxListeners(0);
305
+ output.add = add;
306
+ output.isEmpty = isEmpty;
307
+ output.on('unpipe', remove);
308
+ Array.prototype.slice.call(arguments).forEach(add);
309
+ return output;
310
+ function add(source) {
311
+ if (Array.isArray(source)) {
312
+ source.forEach(add);
313
+ return this;
314
+ }
315
+ sources.push(source);
316
+ source.once('end', remove.bind(null, source));
317
+ source.once('error', output.emit.bind(output, 'error'));
318
+ source.pipe(output, {
319
+ end: false
320
+ });
321
+ return this;
322
+ }
323
+ function isEmpty() {
324
+ return 0 == sources.length;
325
+ }
326
+ function remove(source) {
327
+ sources = sources.filter(function(it) {
328
+ return it !== source;
329
+ });
330
+ if (!sources.length && output.readable) output.end();
331
+ }
332
+ };
333
+ },
334
+ "../../node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js" (module) {
335
+ const pathKey = (options = {})=>{
336
+ const environment = options.env || process.env;
337
+ const platform = options.platform || process.platform;
338
+ if ('win32' !== platform) return 'PATH';
339
+ return Object.keys(environment).reverse().find((key)=>'PATH' === key.toUpperCase()) || 'Path';
340
+ };
341
+ module.exports = pathKey;
342
+ module.exports["default"] = pathKey;
343
+ },
344
+ "../../node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.js" (module, __unused_webpack_exports, __webpack_require__) {
345
+ const shebangRegex = __webpack_require__("../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js");
346
+ module.exports = (string = '')=>{
347
+ const match = string.match(shebangRegex);
348
+ if (!match) return null;
349
+ const [path, argument] = match[0].replace(/#! ?/, '').split(' ');
350
+ const binary = path.split('/').pop();
351
+ if ('env' === binary) return argument;
352
+ return argument ? `${binary} ${argument}` : binary;
353
+ };
354
+ },
355
+ "../../node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.js" (module) {
356
+ module.exports = /^#!(.*)/;
357
+ },
358
+ "../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js" (module, __unused_webpack_exports, __webpack_require__) {
359
+ const isWindows = 'win32' === process.platform || 'cygwin' === process.env.OSTYPE || 'msys' === process.env.OSTYPE;
360
+ const path = __webpack_require__("path");
361
+ const COLON = isWindows ? ';' : ':';
362
+ const isexe = __webpack_require__("../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js");
363
+ const getNotFoundError = (cmd)=>Object.assign(new Error(`not found: ${cmd}`), {
364
+ code: 'ENOENT'
365
+ });
366
+ const getPathInfo = (cmd, opt)=>{
367
+ const colon = opt.colon || COLON;
368
+ const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [
369
+ ''
370
+ ] : [
371
+ ...isWindows ? [
372
+ process.cwd()
373
+ ] : [],
374
+ ...(opt.path || process.env.PATH || '').split(colon)
375
+ ];
376
+ const pathExtExe = isWindows ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM' : '';
377
+ const pathExt = isWindows ? pathExtExe.split(colon) : [
378
+ ''
379
+ ];
380
+ if (isWindows) {
381
+ if (-1 !== cmd.indexOf('.') && '' !== pathExt[0]) pathExt.unshift('');
382
+ }
383
+ return {
384
+ pathEnv,
385
+ pathExt,
386
+ pathExtExe
387
+ };
388
+ };
389
+ const which = (cmd, opt, cb)=>{
390
+ if ('function' == typeof opt) {
391
+ cb = opt;
392
+ opt = {};
393
+ }
394
+ if (!opt) opt = {};
395
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
396
+ const found = [];
397
+ const step = (i)=>new Promise((resolve, reject)=>{
398
+ if (i === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
399
+ const ppRaw = pathEnv[i];
400
+ const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
401
+ const pCmd = path.join(pathPart, cmd);
402
+ const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
403
+ resolve(subStep(p, i, 0));
404
+ });
405
+ const subStep = (p, i, ii)=>new Promise((resolve, reject)=>{
406
+ if (ii === pathExt.length) return resolve(step(i + 1));
407
+ const ext = pathExt[ii];
408
+ isexe(p + ext, {
409
+ pathExt: pathExtExe
410
+ }, (er, is)=>{
411
+ if (!er && is) if (!opt.all) return resolve(p + ext);
412
+ else found.push(p + ext);
413
+ return resolve(subStep(p, i, ii + 1));
414
+ });
415
+ });
416
+ return cb ? step(0).then((res)=>cb(null, res), cb) : step(0);
417
+ };
418
+ const whichSync = (cmd, opt)=>{
419
+ opt = opt || {};
420
+ const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
421
+ const found = [];
422
+ for(let i = 0; i < pathEnv.length; i++){
423
+ const ppRaw = pathEnv[i];
424
+ const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
425
+ const pCmd = path.join(pathPart, cmd);
426
+ const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
427
+ for(let j = 0; j < pathExt.length; j++){
428
+ const cur = p + pathExt[j];
429
+ try {
430
+ const is = isexe.sync(cur, {
431
+ pathExt: pathExtExe
432
+ });
433
+ if (is) if (!opt.all) return cur;
434
+ else found.push(cur);
435
+ } catch (ex) {}
436
+ }
437
+ }
438
+ if (opt.all && found.length) return found;
439
+ if (opt.nothrow) return null;
440
+ throw getNotFoundError(cmd);
441
+ };
442
+ module.exports = which;
443
+ which.sync = whichSync;
444
+ },
445
+ child_process (module) {
446
+ module.exports = __rspack_external_child_process;
447
+ },
448
+ fs (module) {
449
+ module.exports = __rspack_external_fs;
450
+ },
451
+ stream (module) {
452
+ module.exports = __rspack_external_stream;
453
+ }
454
+ });
455
+ function stripFinalNewline(input) {
456
+ const LF = 'string' == typeof input ? '\n' : '\n'.charCodeAt();
457
+ const CR = 'string' == typeof input ? '\r' : '\r'.charCodeAt();
458
+ if (input[input.length - 1] === LF) input = input.slice(0, -1);
459
+ if (input[input.length - 1] === CR) input = input.slice(0, -1);
460
+ return input;
461
+ }
462
+ function pathKey(options = {}) {
463
+ const { env = process.env, platform = process.platform } = options;
464
+ if ('win32' !== platform) return 'PATH';
465
+ return Object.keys(env).reverse().find((key)=>'PATH' === key.toUpperCase()) || 'Path';
466
+ }
467
+ function npmRunPath(options = {}) {
468
+ const { cwd = node_process.cwd(), path: path_ = node_process.env[pathKey()], execPath = node_process.execPath } = options;
469
+ let previous;
470
+ const cwdString = cwd instanceof URL ? node_url.fileURLToPath(cwd) : cwd;
471
+ let cwdPath = node_path.resolve(cwdString);
472
+ const result = [];
473
+ while(previous !== cwdPath){
474
+ result.push(node_path.join(cwdPath, 'node_modules/.bin'));
475
+ previous = cwdPath;
476
+ cwdPath = node_path.resolve(cwdPath, '..');
477
+ }
478
+ result.push(node_path.resolve(cwdString, execPath, '..'));
479
+ return [
480
+ ...result,
481
+ path_
482
+ ].join(node_path.delimiter);
483
+ }
484
+ function npmRunPathEnv({ env = node_process.env, ...options } = {}) {
485
+ env = {
486
+ ...env
487
+ };
488
+ const path = pathKey({
489
+ env
490
+ });
491
+ options.path = env[path];
492
+ env[path] = npmRunPath(options);
493
+ return env;
494
+ }
495
+ const copyProperty = (to, from, property, ignoreNonConfigurable)=>{
496
+ if ('length' === property || 'prototype' === property) return;
497
+ if ('arguments' === property || 'caller' === property) return;
498
+ const toDescriptor = Object.getOwnPropertyDescriptor(to, property);
499
+ const fromDescriptor = Object.getOwnPropertyDescriptor(from, property);
500
+ if (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) return;
501
+ Object.defineProperty(to, property, fromDescriptor);
502
+ };
503
+ const canCopyProperty = function(toDescriptor, fromDescriptor) {
504
+ return void 0 === toDescriptor || toDescriptor.configurable || toDescriptor.writable === fromDescriptor.writable && toDescriptor.enumerable === fromDescriptor.enumerable && toDescriptor.configurable === fromDescriptor.configurable && (toDescriptor.writable || toDescriptor.value === fromDescriptor.value);
505
+ };
506
+ const changePrototype = (to, from)=>{
507
+ const fromPrototype = Object.getPrototypeOf(from);
508
+ if (fromPrototype === Object.getPrototypeOf(to)) return;
509
+ Object.setPrototypeOf(to, fromPrototype);
510
+ };
511
+ const wrappedToString = (withName, fromBody)=>`/* Wrapped ${withName}*/\n${fromBody}`;
512
+ const toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString');
513
+ const toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name');
514
+ const changeToString = (to, from, name)=>{
515
+ const withName = '' === name ? '' : `with ${name.trim()}() `;
516
+ const newToString = wrappedToString.bind(null, withName, from.toString());
517
+ Object.defineProperty(newToString, 'name', toStringName);
518
+ Object.defineProperty(to, 'toString', {
519
+ ...toStringDescriptor,
520
+ value: newToString
521
+ });
522
+ };
523
+ function mimicFunction(to, from, { ignoreNonConfigurable = false } = {}) {
524
+ const { name } = to;
525
+ for (const property of Reflect.ownKeys(from))copyProperty(to, from, property, ignoreNonConfigurable);
526
+ changePrototype(to, from);
527
+ changeToString(to, from, name);
528
+ return to;
529
+ }
530
+ const calledFunctions = new WeakMap();
531
+ const onetime_onetime = (function_, options = {})=>{
532
+ if ('function' != typeof function_) throw new TypeError('Expected a function');
533
+ let returnValue;
534
+ let callCount = 0;
535
+ const functionName = function_.displayName || function_.name || '<anonymous>';
536
+ const onetime = function(...arguments_) {
537
+ calledFunctions.set(onetime, ++callCount);
538
+ if (1 === callCount) {
539
+ returnValue = function_.apply(this, arguments_);
540
+ function_ = null;
541
+ } else if (true === options.throw) throw new Error(`Function \`${functionName}\` can only be called once`);
542
+ return returnValue;
543
+ };
544
+ mimicFunction(onetime, function_);
545
+ calledFunctions.set(onetime, callCount);
546
+ return onetime;
547
+ };
548
+ onetime_onetime.callCount = (function_)=>{
549
+ if (!calledFunctions.has(function_)) throw new Error(`The given function \`${function_.name}\` is not wrapped by the \`onetime\` package`);
550
+ return calledFunctions.get(function_);
551
+ };
552
+ const node_modules_onetime = onetime_onetime;
553
+ const SIGNALS = [
554
+ {
555
+ name: "SIGHUP",
556
+ number: 1,
557
+ action: "terminate",
558
+ description: "Terminal closed",
559
+ standard: "posix"
560
+ },
561
+ {
562
+ name: "SIGINT",
563
+ number: 2,
564
+ action: "terminate",
565
+ description: "User interruption with CTRL-C",
566
+ standard: "ansi"
567
+ },
568
+ {
569
+ name: "SIGQUIT",
570
+ number: 3,
571
+ action: "core",
572
+ description: "User interruption with CTRL-\\",
573
+ standard: "posix"
574
+ },
575
+ {
576
+ name: "SIGILL",
577
+ number: 4,
578
+ action: "core",
579
+ description: "Invalid machine instruction",
580
+ standard: "ansi"
581
+ },
582
+ {
583
+ name: "SIGTRAP",
584
+ number: 5,
585
+ action: "core",
586
+ description: "Debugger breakpoint",
587
+ standard: "posix"
588
+ },
589
+ {
590
+ name: "SIGABRT",
591
+ number: 6,
592
+ action: "core",
593
+ description: "Aborted",
594
+ standard: "ansi"
595
+ },
596
+ {
597
+ name: "SIGIOT",
598
+ number: 6,
599
+ action: "core",
600
+ description: "Aborted",
601
+ standard: "bsd"
602
+ },
603
+ {
604
+ name: "SIGBUS",
605
+ number: 7,
606
+ action: "core",
607
+ description: "Bus error due to misaligned, non-existing address or paging error",
608
+ standard: "bsd"
609
+ },
610
+ {
611
+ name: "SIGEMT",
612
+ number: 7,
613
+ action: "terminate",
614
+ description: "Command should be emulated but is not implemented",
615
+ standard: "other"
616
+ },
617
+ {
618
+ name: "SIGFPE",
619
+ number: 8,
620
+ action: "core",
621
+ description: "Floating point arithmetic error",
622
+ standard: "ansi"
623
+ },
624
+ {
625
+ name: "SIGKILL",
626
+ number: 9,
627
+ action: "terminate",
628
+ description: "Forced termination",
629
+ standard: "posix",
630
+ forced: true
631
+ },
632
+ {
633
+ name: "SIGUSR1",
634
+ number: 10,
635
+ action: "terminate",
636
+ description: "Application-specific signal",
637
+ standard: "posix"
638
+ },
639
+ {
640
+ name: "SIGSEGV",
641
+ number: 11,
642
+ action: "core",
643
+ description: "Segmentation fault",
644
+ standard: "ansi"
645
+ },
646
+ {
647
+ name: "SIGUSR2",
648
+ number: 12,
649
+ action: "terminate",
650
+ description: "Application-specific signal",
651
+ standard: "posix"
652
+ },
653
+ {
654
+ name: "SIGPIPE",
655
+ number: 13,
656
+ action: "terminate",
657
+ description: "Broken pipe or socket",
658
+ standard: "posix"
659
+ },
660
+ {
661
+ name: "SIGALRM",
662
+ number: 14,
663
+ action: "terminate",
664
+ description: "Timeout or timer",
665
+ standard: "posix"
666
+ },
667
+ {
668
+ name: "SIGTERM",
669
+ number: 15,
670
+ action: "terminate",
671
+ description: "Termination",
672
+ standard: "ansi"
673
+ },
674
+ {
675
+ name: "SIGSTKFLT",
676
+ number: 16,
677
+ action: "terminate",
678
+ description: "Stack is empty or overflowed",
679
+ standard: "other"
680
+ },
681
+ {
682
+ name: "SIGCHLD",
683
+ number: 17,
684
+ action: "ignore",
685
+ description: "Child process terminated, paused or unpaused",
686
+ standard: "posix"
687
+ },
688
+ {
689
+ name: "SIGCLD",
690
+ number: 17,
691
+ action: "ignore",
692
+ description: "Child process terminated, paused or unpaused",
693
+ standard: "other"
694
+ },
695
+ {
696
+ name: "SIGCONT",
697
+ number: 18,
698
+ action: "unpause",
699
+ description: "Unpaused",
700
+ standard: "posix",
701
+ forced: true
702
+ },
703
+ {
704
+ name: "SIGSTOP",
705
+ number: 19,
706
+ action: "pause",
707
+ description: "Paused",
708
+ standard: "posix",
709
+ forced: true
710
+ },
711
+ {
712
+ name: "SIGTSTP",
713
+ number: 20,
714
+ action: "pause",
715
+ description: "Paused using CTRL-Z or \"suspend\"",
716
+ standard: "posix"
717
+ },
718
+ {
719
+ name: "SIGTTIN",
720
+ number: 21,
721
+ action: "pause",
722
+ description: "Background process cannot read terminal input",
723
+ standard: "posix"
724
+ },
725
+ {
726
+ name: "SIGBREAK",
727
+ number: 21,
728
+ action: "terminate",
729
+ description: "User interruption with CTRL-BREAK",
730
+ standard: "other"
731
+ },
732
+ {
733
+ name: "SIGTTOU",
734
+ number: 22,
735
+ action: "pause",
736
+ description: "Background process cannot write to terminal output",
737
+ standard: "posix"
738
+ },
739
+ {
740
+ name: "SIGURG",
741
+ number: 23,
742
+ action: "ignore",
743
+ description: "Socket received out-of-band data",
744
+ standard: "bsd"
745
+ },
746
+ {
747
+ name: "SIGXCPU",
748
+ number: 24,
749
+ action: "core",
750
+ description: "Process timed out",
751
+ standard: "bsd"
752
+ },
753
+ {
754
+ name: "SIGXFSZ",
755
+ number: 25,
756
+ action: "core",
757
+ description: "File too big",
758
+ standard: "bsd"
759
+ },
760
+ {
761
+ name: "SIGVTALRM",
762
+ number: 26,
763
+ action: "terminate",
764
+ description: "Timeout or timer",
765
+ standard: "bsd"
766
+ },
767
+ {
768
+ name: "SIGPROF",
769
+ number: 27,
770
+ action: "terminate",
771
+ description: "Timeout or timer",
772
+ standard: "bsd"
773
+ },
774
+ {
775
+ name: "SIGWINCH",
776
+ number: 28,
777
+ action: "ignore",
778
+ description: "Terminal window size changed",
779
+ standard: "bsd"
780
+ },
781
+ {
782
+ name: "SIGIO",
783
+ number: 29,
784
+ action: "terminate",
785
+ description: "I/O is available",
786
+ standard: "other"
787
+ },
788
+ {
789
+ name: "SIGPOLL",
790
+ number: 29,
791
+ action: "terminate",
792
+ description: "Watched event",
793
+ standard: "other"
794
+ },
795
+ {
796
+ name: "SIGINFO",
797
+ number: 29,
798
+ action: "ignore",
799
+ description: "Request for process information",
800
+ standard: "other"
801
+ },
802
+ {
803
+ name: "SIGPWR",
804
+ number: 30,
805
+ action: "terminate",
806
+ description: "Device running out of power",
807
+ standard: "systemv"
808
+ },
809
+ {
810
+ name: "SIGSYS",
811
+ number: 31,
812
+ action: "core",
813
+ description: "Invalid system call",
814
+ standard: "other"
815
+ },
816
+ {
817
+ name: "SIGUNUSED",
818
+ number: 31,
819
+ action: "terminate",
820
+ description: "Invalid system call",
821
+ standard: "other"
822
+ }
823
+ ];
824
+ const getRealtimeSignals = ()=>{
825
+ const length = SIGRTMAX - SIGRTMIN + 1;
826
+ return Array.from({
827
+ length
828
+ }, getRealtimeSignal);
829
+ };
830
+ const getRealtimeSignal = (value, index)=>({
831
+ name: `SIGRT${index + 1}`,
832
+ number: SIGRTMIN + index,
833
+ action: "terminate",
834
+ description: "Application-specific signal (realtime)",
835
+ standard: "posix"
836
+ });
837
+ const SIGRTMIN = 34;
838
+ const SIGRTMAX = 64;
839
+ const getSignals = ()=>{
840
+ const realtimeSignals = getRealtimeSignals();
841
+ const signals = [
842
+ ...SIGNALS,
843
+ ...realtimeSignals
844
+ ].map(normalizeSignal);
845
+ return signals;
846
+ };
847
+ const normalizeSignal = ({ name, number: defaultNumber, description, action, forced = false, standard })=>{
848
+ const { signals: { [name]: constantSignal } } = constants;
849
+ const supported = void 0 !== constantSignal;
850
+ const number = supported ? constantSignal : defaultNumber;
851
+ return {
852
+ name,
853
+ number,
854
+ description,
855
+ supported,
856
+ action,
857
+ forced,
858
+ standard
859
+ };
860
+ };
861
+ const getSignalsByName = ()=>{
862
+ const signals = getSignals();
863
+ return Object.fromEntries(signals.map(getSignalByName));
864
+ };
865
+ const getSignalByName = ({ name, number, description, supported, action, forced, standard })=>[
866
+ name,
867
+ {
868
+ name,
869
+ number,
870
+ description,
871
+ supported,
872
+ action,
873
+ forced,
874
+ standard
875
+ }
876
+ ];
877
+ const signalsByName = getSignalsByName();
878
+ const getSignalsByNumber = ()=>{
879
+ const signals = getSignals();
880
+ const length = 65;
881
+ const signalsA = Array.from({
882
+ length
883
+ }, (value, number)=>getSignalByNumber(number, signals));
884
+ return Object.assign({}, ...signalsA);
885
+ };
886
+ const getSignalByNumber = (number, signals)=>{
887
+ const signal = findSignalByNumber(number, signals);
888
+ if (void 0 === signal) return {};
889
+ const { name, description, supported, action, forced, standard } = signal;
890
+ return {
891
+ [number]: {
892
+ name,
893
+ number,
894
+ description,
895
+ supported,
896
+ action,
897
+ forced,
898
+ standard
899
+ }
900
+ };
901
+ };
902
+ const findSignalByNumber = (number, signals)=>{
903
+ const signal = signals.find(({ name })=>constants.signals[name] === number);
904
+ if (void 0 !== signal) return signal;
905
+ return signals.find((signalA)=>signalA.number === number);
906
+ };
907
+ getSignalsByNumber();
908
+ const getErrorPrefix = ({ timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled })=>{
909
+ if (timedOut) return `timed out after ${timeout} milliseconds`;
910
+ if (isCanceled) return 'was canceled';
911
+ if (void 0 !== errorCode) return `failed with ${errorCode}`;
912
+ if (void 0 !== signal) return `was killed with ${signal} (${signalDescription})`;
913
+ if (void 0 !== exitCode) return `failed with exit code ${exitCode}`;
914
+ return 'failed';
915
+ };
916
+ const makeError = ({ stdout, stderr, all, error, signal, exitCode, command, escapedCommand, timedOut, isCanceled, killed, parsed: { options: { timeout, cwd = node_process.cwd() } } })=>{
917
+ exitCode = null === exitCode ? void 0 : exitCode;
918
+ signal = null === signal ? void 0 : signal;
919
+ const signalDescription = void 0 === signal ? void 0 : signalsByName[signal].description;
920
+ const errorCode = error && error.code;
921
+ const prefix = getErrorPrefix({
922
+ timedOut,
923
+ timeout,
924
+ errorCode,
925
+ signal,
926
+ signalDescription,
927
+ exitCode,
928
+ isCanceled
929
+ });
930
+ const execaMessage = `Command ${prefix}: ${command}`;
931
+ const isError = '[object Error]' === Object.prototype.toString.call(error);
932
+ const shortMessage = isError ? `${execaMessage}\n${error.message}` : execaMessage;
933
+ const message = [
934
+ shortMessage,
935
+ stderr,
936
+ stdout
937
+ ].filter(Boolean).join('\n');
938
+ if (isError) {
939
+ error.originalMessage = error.message;
940
+ error.message = message;
941
+ } else error = new Error(message);
942
+ error.shortMessage = shortMessage;
943
+ error.command = command;
944
+ error.escapedCommand = escapedCommand;
945
+ error.exitCode = exitCode;
946
+ error.signal = signal;
947
+ error.signalDescription = signalDescription;
948
+ error.stdout = stdout;
949
+ error.stderr = stderr;
950
+ error.cwd = cwd;
951
+ if (void 0 !== all) error.all = all;
952
+ if ('bufferedData' in error) delete error.bufferedData;
953
+ error.failed = true;
954
+ error.timedOut = Boolean(timedOut);
955
+ error.isCanceled = isCanceled;
956
+ error.killed = killed && !timedOut;
957
+ return error;
958
+ };
959
+ const aliases = [
960
+ 'stdin',
961
+ 'stdout',
962
+ 'stderr'
963
+ ];
964
+ const hasAlias = (options)=>aliases.some((alias)=>void 0 !== options[alias]);
965
+ const normalizeStdio = (options)=>{
966
+ if (!options) return;
967
+ const { stdio } = options;
968
+ if (void 0 === stdio) return aliases.map((alias)=>options[alias]);
969
+ if (hasAlias(options)) throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map((alias)=>`\`${alias}\``).join(', ')}`);
970
+ if ('string' == typeof stdio) return stdio;
971
+ if (!Array.isArray(stdio)) throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
972
+ const length = Math.max(stdio.length, aliases.length);
973
+ return Array.from({
974
+ length
975
+ }, (value, index)=>stdio[index]);
976
+ };
977
+ const signals_signals = [];
978
+ signals_signals.push('SIGHUP', 'SIGINT', 'SIGTERM');
979
+ if ('win32' !== process.platform) signals_signals.push('SIGALRM', 'SIGABRT', 'SIGVTALRM', 'SIGXCPU', 'SIGXFSZ', 'SIGUSR2', 'SIGTRAP', 'SIGSYS', 'SIGQUIT', 'SIGIOT');
980
+ if ('linux' === process.platform) signals_signals.push('SIGIO', 'SIGPOLL', 'SIGPWR', 'SIGSTKFLT');
981
+ const processOk = (process1)=>!!process1 && 'object' == typeof process1 && 'function' == typeof process1.removeListener && 'function' == typeof process1.emit && 'function' == typeof process1.reallyExit && 'function' == typeof process1.listeners && 'function' == typeof process1.kill && 'number' == typeof process1.pid && 'function' == typeof process1.on;
982
+ const kExitEmitter = Symbol.for('signal-exit emitter');
983
+ const global = globalThis;
984
+ const ObjectDefineProperty = Object.defineProperty.bind(Object);
985
+ class Emitter {
986
+ emitted = {
987
+ afterExit: false,
988
+ exit: false
989
+ };
990
+ listeners = {
991
+ afterExit: [],
992
+ exit: []
993
+ };
994
+ count = 0;
995
+ id = Math.random();
996
+ constructor(){
997
+ if (global[kExitEmitter]) return global[kExitEmitter];
998
+ ObjectDefineProperty(global, kExitEmitter, {
999
+ value: this,
1000
+ writable: false,
1001
+ enumerable: false,
1002
+ configurable: false
1003
+ });
1004
+ }
1005
+ on(ev, fn) {
1006
+ this.listeners[ev].push(fn);
1007
+ }
1008
+ removeListener(ev, fn) {
1009
+ const list = this.listeners[ev];
1010
+ const i = list.indexOf(fn);
1011
+ if (-1 === i) return;
1012
+ if (0 === i && 1 === list.length) list.length = 0;
1013
+ else list.splice(i, 1);
1014
+ }
1015
+ emit(ev, code, signal) {
1016
+ if (this.emitted[ev]) return false;
1017
+ this.emitted[ev] = true;
1018
+ let ret = false;
1019
+ for (const fn of this.listeners[ev])ret = true === fn(code, signal) || ret;
1020
+ if ('exit' === ev) ret = this.emit('afterExit', code, signal) || ret;
1021
+ return ret;
1022
+ }
1023
+ }
1024
+ class SignalExitBase {
1025
+ }
1026
+ const signalExitWrap = (handler)=>({
1027
+ onExit (cb, opts) {
1028
+ return handler.onExit(cb, opts);
1029
+ },
1030
+ load () {
1031
+ return handler.load();
1032
+ },
1033
+ unload () {
1034
+ return handler.unload();
1035
+ }
1036
+ });
1037
+ class SignalExitFallback extends SignalExitBase {
1038
+ onExit() {
1039
+ return ()=>{};
1040
+ }
1041
+ load() {}
1042
+ unload() {}
1043
+ }
1044
+ class SignalExit extends SignalExitBase {
1045
+ #hupSig = 'win32' === mjs_process.platform ? 'SIGINT' : 'SIGHUP';
1046
+ #emitter = new Emitter();
1047
+ #process;
1048
+ #originalProcessEmit;
1049
+ #originalProcessReallyExit;
1050
+ #sigListeners = {};
1051
+ #loaded = false;
1052
+ constructor(process1){
1053
+ super();
1054
+ this.#process = process1;
1055
+ this.#sigListeners = {};
1056
+ for (const sig of signals_signals)this.#sigListeners[sig] = ()=>{
1057
+ const listeners = this.#process.listeners(sig);
1058
+ let { count } = this.#emitter;
1059
+ const p = process1;
1060
+ if ('object' == typeof p.__signal_exit_emitter__ && 'number' == typeof p.__signal_exit_emitter__.count) count += p.__signal_exit_emitter__.count;
1061
+ if (listeners.length === count) {
1062
+ this.unload();
1063
+ const ret = this.#emitter.emit('exit', null, sig);
1064
+ const s = 'SIGHUP' === sig ? this.#hupSig : sig;
1065
+ if (!ret) process1.kill(process1.pid, s);
1066
+ }
1067
+ };
1068
+ this.#originalProcessReallyExit = process1.reallyExit;
1069
+ this.#originalProcessEmit = process1.emit;
1070
+ }
1071
+ onExit(cb, opts) {
1072
+ if (!processOk(this.#process)) return ()=>{};
1073
+ if (false === this.#loaded) this.load();
1074
+ const ev = opts?.alwaysLast ? 'afterExit' : 'exit';
1075
+ this.#emitter.on(ev, cb);
1076
+ return ()=>{
1077
+ this.#emitter.removeListener(ev, cb);
1078
+ if (0 === this.#emitter.listeners['exit'].length && 0 === this.#emitter.listeners['afterExit'].length) this.unload();
1079
+ };
1080
+ }
1081
+ load() {
1082
+ if (this.#loaded) return;
1083
+ this.#loaded = true;
1084
+ this.#emitter.count += 1;
1085
+ for (const sig of signals_signals)try {
1086
+ const fn = this.#sigListeners[sig];
1087
+ if (fn) this.#process.on(sig, fn);
1088
+ } catch (_) {}
1089
+ this.#process.emit = (ev, ...a)=>this.#processEmit(ev, ...a);
1090
+ this.#process.reallyExit = (code)=>this.#processReallyExit(code);
1091
+ }
1092
+ unload() {
1093
+ if (!this.#loaded) return;
1094
+ this.#loaded = false;
1095
+ signals_signals.forEach((sig)=>{
1096
+ const listener = this.#sigListeners[sig];
1097
+ if (!listener) throw new Error('Listener not defined for signal: ' + sig);
1098
+ try {
1099
+ this.#process.removeListener(sig, listener);
1100
+ } catch (_) {}
1101
+ });
1102
+ this.#process.emit = this.#originalProcessEmit;
1103
+ this.#process.reallyExit = this.#originalProcessReallyExit;
1104
+ this.#emitter.count -= 1;
1105
+ }
1106
+ #processReallyExit(code) {
1107
+ if (!processOk(this.#process)) return 0;
1108
+ this.#process.exitCode = code || 0;
1109
+ this.#emitter.emit('exit', this.#process.exitCode, null);
1110
+ return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
1111
+ }
1112
+ #processEmit(ev, ...args) {
1113
+ const og = this.#originalProcessEmit;
1114
+ if (!('exit' === ev && processOk(this.#process))) return og.call(this.#process, ev, ...args);
1115
+ {
1116
+ if ('number' == typeof args[0]) this.#process.exitCode = args[0];
1117
+ const ret = og.call(this.#process, ev, ...args);
1118
+ this.#emitter.emit('exit', this.#process.exitCode, null);
1119
+ return ret;
1120
+ }
1121
+ }
1122
+ }
1123
+ const mjs_process = globalThis.process;
1124
+ const { onExit: onExit, load: load, unload: unload } = signalExitWrap(processOk(mjs_process) ? new SignalExit(mjs_process) : new SignalExitFallback());
1125
+ const DEFAULT_FORCE_KILL_TIMEOUT = 5000;
1126
+ const spawnedKill = (kill, signal = 'SIGTERM', options = {})=>{
1127
+ const killResult = kill(signal);
1128
+ setKillTimeout(kill, signal, options, killResult);
1129
+ return killResult;
1130
+ };
1131
+ const setKillTimeout = (kill, signal, options, killResult)=>{
1132
+ if (!shouldForceKill(signal, options, killResult)) return;
1133
+ const timeout = getForceKillAfterTimeout(options);
1134
+ const t = setTimeout(()=>{
1135
+ kill('SIGKILL');
1136
+ }, timeout);
1137
+ if (t.unref) t.unref();
1138
+ };
1139
+ const shouldForceKill = (signal, { forceKillAfterTimeout }, killResult)=>isSigterm(signal) && false !== forceKillAfterTimeout && killResult;
1140
+ const isSigterm = (signal)=>signal === node_os.constants.signals.SIGTERM || 'string' == typeof signal && 'SIGTERM' === signal.toUpperCase();
1141
+ const getForceKillAfterTimeout = ({ forceKillAfterTimeout = true })=>{
1142
+ if (true === forceKillAfterTimeout) return DEFAULT_FORCE_KILL_TIMEOUT;
1143
+ if (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${forceKillAfterTimeout}\` (${typeof forceKillAfterTimeout})`);
1144
+ return forceKillAfterTimeout;
1145
+ };
1146
+ const spawnedCancel = (spawned, context)=>{
1147
+ const killResult = spawned.kill();
1148
+ if (killResult) context.isCanceled = true;
1149
+ };
1150
+ const timeoutKill = (spawned, signal, reject)=>{
1151
+ spawned.kill(signal);
1152
+ reject(Object.assign(new Error('Timed out'), {
1153
+ timedOut: true,
1154
+ signal
1155
+ }));
1156
+ };
1157
+ const setupTimeout = (spawned, { timeout, killSignal = 'SIGTERM' }, spawnedPromise)=>{
1158
+ if (0 === timeout || void 0 === timeout) return spawnedPromise;
1159
+ let timeoutId;
1160
+ const timeoutPromise = new Promise((resolve, reject)=>{
1161
+ timeoutId = setTimeout(()=>{
1162
+ timeoutKill(spawned, killSignal, reject);
1163
+ }, timeout);
1164
+ });
1165
+ const safeSpawnedPromise = spawnedPromise.finally(()=>{
1166
+ clearTimeout(timeoutId);
1167
+ });
1168
+ return Promise.race([
1169
+ timeoutPromise,
1170
+ safeSpawnedPromise
1171
+ ]);
1172
+ };
1173
+ const validateTimeout = ({ timeout })=>{
1174
+ if (void 0 !== timeout && (!Number.isFinite(timeout) || timeout < 0)) throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${timeout}\` (${typeof timeout})`);
1175
+ };
1176
+ const setExitHandler = async (spawned, { cleanup, detached }, timedPromise)=>{
1177
+ if (!cleanup || detached) return timedPromise;
1178
+ const removeExitHandler = onExit(()=>{
1179
+ spawned.kill();
1180
+ });
1181
+ return timedPromise.finally(()=>{
1182
+ removeExitHandler();
1183
+ });
1184
+ };
1185
+ function isStream(stream) {
1186
+ return null !== stream && 'object' == typeof stream && 'function' == typeof stream.pipe;
1187
+ }
1188
+ function isWritableStream(stream) {
1189
+ return isStream(stream) && false !== stream.writable && 'function' == typeof stream._write && 'object' == typeof stream._writableState;
1190
+ }
1191
+ const isExecaChildProcess = (target)=>target instanceof ChildProcess && 'function' == typeof target.then;
1192
+ const pipeToTarget = (spawned, streamName, target)=>{
1193
+ if ('string' == typeof target) {
1194
+ spawned[streamName].pipe(createWriteStream(target));
1195
+ return spawned;
1196
+ }
1197
+ if (isWritableStream(target)) {
1198
+ spawned[streamName].pipe(target);
1199
+ return spawned;
1200
+ }
1201
+ if (!isExecaChildProcess(target)) throw new TypeError('The second argument must be a string, a stream or an Execa child process.');
1202
+ if (!isWritableStream(target.stdin)) throw new TypeError('The target child process\'s stdin must be available.');
1203
+ spawned[streamName].pipe(target.stdin);
1204
+ return target;
1205
+ };
1206
+ const addPipeMethods = (spawned)=>{
1207
+ if (null !== spawned.stdout) spawned.pipeStdout = pipeToTarget.bind(void 0, spawned, 'stdout');
1208
+ if (null !== spawned.stderr) spawned.pipeStderr = pipeToTarget.bind(void 0, spawned, 'stderr');
1209
+ if (void 0 !== spawned.all) spawned.pipeAll = pipeToTarget.bind(void 0, spawned, 'all');
1210
+ };
1211
+ const contents_getStreamContents = async (stream, { init, convertChunk, getSize, truncateChunk, addChunk, getFinalChunk, finalize }, { maxBuffer = 1 / 0 } = {})=>{
1212
+ if (!isAsyncIterable(stream)) throw new Error('The first argument must be a Readable, a ReadableStream, or an async iterable.');
1213
+ const state = init();
1214
+ state.length = 0;
1215
+ try {
1216
+ for await (const chunk of stream){
1217
+ const chunkType = getChunkType(chunk);
1218
+ const convertedChunk = convertChunk[chunkType](chunk, state);
1219
+ appendChunk({
1220
+ convertedChunk,
1221
+ state,
1222
+ getSize,
1223
+ truncateChunk,
1224
+ addChunk,
1225
+ maxBuffer
1226
+ });
1227
+ }
1228
+ appendFinalChunk({
1229
+ state,
1230
+ convertChunk,
1231
+ getSize,
1232
+ truncateChunk,
1233
+ addChunk,
1234
+ getFinalChunk,
1235
+ maxBuffer
1236
+ });
1237
+ return finalize(state);
1238
+ } catch (error) {
1239
+ error.bufferedData = finalize(state);
1240
+ throw error;
1241
+ }
1242
+ };
1243
+ const appendFinalChunk = ({ state, getSize, truncateChunk, addChunk, getFinalChunk, maxBuffer })=>{
1244
+ const convertedChunk = getFinalChunk(state);
1245
+ if (void 0 !== convertedChunk) appendChunk({
1246
+ convertedChunk,
1247
+ state,
1248
+ getSize,
1249
+ truncateChunk,
1250
+ addChunk,
1251
+ maxBuffer
1252
+ });
1253
+ };
1254
+ const appendChunk = ({ convertedChunk, state, getSize, truncateChunk, addChunk, maxBuffer })=>{
1255
+ const chunkSize = getSize(convertedChunk);
1256
+ const newLength = state.length + chunkSize;
1257
+ if (newLength <= maxBuffer) return void addNewChunk(convertedChunk, state, addChunk, newLength);
1258
+ const truncatedChunk = truncateChunk(convertedChunk, maxBuffer - state.length);
1259
+ if (void 0 !== truncatedChunk) addNewChunk(truncatedChunk, state, addChunk, maxBuffer);
1260
+ throw new MaxBufferError();
1261
+ };
1262
+ const addNewChunk = (convertedChunk, state, addChunk, newLength)=>{
1263
+ state.contents = addChunk(convertedChunk, state, newLength);
1264
+ state.length = newLength;
1265
+ };
1266
+ const isAsyncIterable = (stream)=>'object' == typeof stream && null !== stream && 'function' == typeof stream[Symbol.asyncIterator];
1267
+ const getChunkType = (chunk)=>{
1268
+ const typeOfChunk = typeof chunk;
1269
+ if ('string' === typeOfChunk) return 'string';
1270
+ if ('object' !== typeOfChunk || null === chunk) return 'others';
1271
+ if (globalThis.Buffer?.isBuffer(chunk)) return 'buffer';
1272
+ const prototypeName = objectToString.call(chunk);
1273
+ if ('[object ArrayBuffer]' === prototypeName) return 'arrayBuffer';
1274
+ if ('[object DataView]' === prototypeName) return 'dataView';
1275
+ if (Number.isInteger(chunk.byteLength) && Number.isInteger(chunk.byteOffset) && '[object ArrayBuffer]' === objectToString.call(chunk.buffer)) return 'typedArray';
1276
+ return 'others';
1277
+ };
1278
+ const { toString: objectToString } = Object.prototype;
1279
+ class MaxBufferError extends Error {
1280
+ name = 'MaxBufferError';
1281
+ constructor(){
1282
+ super('maxBuffer exceeded');
1283
+ }
1284
+ }
1285
+ const utils_identity = (value)=>value;
1286
+ const utils_noop = ()=>void 0;
1287
+ const utils_getContentsProp = ({ contents })=>contents;
1288
+ const throwObjectStream = (chunk)=>{
1289
+ throw new Error(`Streams in object mode are not supported: ${String(chunk)}`);
1290
+ };
1291
+ const getLengthProp = (convertedChunk)=>convertedChunk.length;
1292
+ async function getStreamAsArrayBuffer(stream, options) {
1293
+ return contents_getStreamContents(stream, arrayBufferMethods, options);
1294
+ }
1295
+ const initArrayBuffer = ()=>({
1296
+ contents: new ArrayBuffer(0)
1297
+ });
1298
+ const useTextEncoder = (chunk)=>textEncoder.encode(chunk);
1299
+ const textEncoder = new TextEncoder();
1300
+ const useUint8Array = (chunk)=>new Uint8Array(chunk);
1301
+ const useUint8ArrayWithOffset = (chunk)=>new Uint8Array(chunk.buffer, chunk.byteOffset, chunk.byteLength);
1302
+ const truncateArrayBufferChunk = (convertedChunk, chunkSize)=>convertedChunk.slice(0, chunkSize);
1303
+ const addArrayBufferChunk = (convertedChunk, { contents, length: previousLength }, length)=>{
1304
+ const newContents = hasArrayBufferResize() ? resizeArrayBuffer(contents, length) : resizeArrayBufferSlow(contents, length);
1305
+ new Uint8Array(newContents).set(convertedChunk, previousLength);
1306
+ return newContents;
1307
+ };
1308
+ const resizeArrayBufferSlow = (contents, length)=>{
1309
+ if (length <= contents.byteLength) return contents;
1310
+ const arrayBuffer = new ArrayBuffer(getNewContentsLength(length));
1311
+ new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
1312
+ return arrayBuffer;
1313
+ };
1314
+ const resizeArrayBuffer = (contents, length)=>{
1315
+ if (length <= contents.maxByteLength) {
1316
+ contents.resize(length);
1317
+ return contents;
1318
+ }
1319
+ const arrayBuffer = new ArrayBuffer(length, {
1320
+ maxByteLength: getNewContentsLength(length)
1321
+ });
1322
+ new Uint8Array(arrayBuffer).set(new Uint8Array(contents), 0);
1323
+ return arrayBuffer;
1324
+ };
1325
+ const getNewContentsLength = (length)=>SCALE_FACTOR ** Math.ceil(Math.log(length) / Math.log(SCALE_FACTOR));
1326
+ const SCALE_FACTOR = 2;
1327
+ const finalizeArrayBuffer = ({ contents, length })=>hasArrayBufferResize() ? contents : contents.slice(0, length);
1328
+ const hasArrayBufferResize = ()=>'resize' in ArrayBuffer.prototype;
1329
+ const arrayBufferMethods = {
1330
+ init: initArrayBuffer,
1331
+ convertChunk: {
1332
+ string: useTextEncoder,
1333
+ buffer: useUint8Array,
1334
+ arrayBuffer: useUint8Array,
1335
+ dataView: useUint8ArrayWithOffset,
1336
+ typedArray: useUint8ArrayWithOffset,
1337
+ others: throwObjectStream
1338
+ },
1339
+ getSize: getLengthProp,
1340
+ truncateChunk: truncateArrayBufferChunk,
1341
+ addChunk: addArrayBufferChunk,
1342
+ getFinalChunk: utils_noop,
1343
+ finalize: finalizeArrayBuffer
1344
+ };
1345
+ async function getStreamAsBuffer(stream, options) {
1346
+ if (!('Buffer' in globalThis)) throw new Error('getStreamAsBuffer() is only supported in Node.js');
1347
+ try {
1348
+ return arrayBufferToNodeBuffer(await getStreamAsArrayBuffer(stream, options));
1349
+ } catch (error) {
1350
+ if (void 0 !== error.bufferedData) error.bufferedData = arrayBufferToNodeBuffer(error.bufferedData);
1351
+ throw error;
1352
+ }
1353
+ }
1354
+ const arrayBufferToNodeBuffer = (arrayBuffer)=>globalThis.Buffer.from(arrayBuffer);
1355
+ async function getStreamAsString(stream, options) {
1356
+ return contents_getStreamContents(stream, stringMethods, options);
1357
+ }
1358
+ const initString = ()=>({
1359
+ contents: '',
1360
+ textDecoder: new TextDecoder()
1361
+ });
1362
+ const useTextDecoder = (chunk, { textDecoder })=>textDecoder.decode(chunk, {
1363
+ stream: true
1364
+ });
1365
+ const addStringChunk = (convertedChunk, { contents })=>contents + convertedChunk;
1366
+ const truncateStringChunk = (convertedChunk, chunkSize)=>convertedChunk.slice(0, chunkSize);
1367
+ const getFinalStringChunk = ({ textDecoder })=>{
1368
+ const finalChunk = textDecoder.decode();
1369
+ return '' === finalChunk ? void 0 : finalChunk;
1370
+ };
1371
+ const stringMethods = {
1372
+ init: initString,
1373
+ convertChunk: {
1374
+ string: utils_identity,
1375
+ buffer: useTextDecoder,
1376
+ arrayBuffer: useTextDecoder,
1377
+ dataView: useTextDecoder,
1378
+ typedArray: useTextDecoder,
1379
+ others: throwObjectStream
1380
+ },
1381
+ getSize: getLengthProp,
1382
+ truncateChunk: truncateStringChunk,
1383
+ addChunk: addStringChunk,
1384
+ getFinalChunk: getFinalStringChunk,
1385
+ finalize: utils_getContentsProp
1386
+ };
1387
+ const merge_stream = __webpack_require__("../../node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.js");
1388
+ const validateInputOptions = (input)=>{
1389
+ if (void 0 !== input) throw new TypeError('The `input` and `inputFile` options cannot be both set.');
1390
+ };
1391
+ const getInputSync = ({ input, inputFile })=>{
1392
+ if ('string' != typeof inputFile) return input;
1393
+ validateInputOptions(input);
1394
+ return readFileSync(inputFile);
1395
+ };
1396
+ const handleInputSync = (options)=>{
1397
+ const input = getInputSync(options);
1398
+ if (isStream(input)) throw new TypeError('The `input` option cannot be a stream in sync mode');
1399
+ return input;
1400
+ };
1401
+ const getInput = ({ input, inputFile })=>{
1402
+ if ('string' != typeof inputFile) return input;
1403
+ validateInputOptions(input);
1404
+ return createReadStream(inputFile);
1405
+ };
1406
+ const handleInput = (spawned, options)=>{
1407
+ const input = getInput(options);
1408
+ if (void 0 === input) return;
1409
+ if (isStream(input)) input.pipe(spawned.stdin);
1410
+ else spawned.stdin.end(input);
1411
+ };
1412
+ const makeAllStream = (spawned, { all })=>{
1413
+ if (!all || !spawned.stdout && !spawned.stderr) return;
1414
+ const mixed = merge_stream();
1415
+ if (spawned.stdout) mixed.add(spawned.stdout);
1416
+ if (spawned.stderr) mixed.add(spawned.stderr);
1417
+ return mixed;
1418
+ };
1419
+ const getBufferedData = async (stream, streamPromise)=>{
1420
+ if (!stream || void 0 === streamPromise) return;
1421
+ await promises_setTimeout(0);
1422
+ stream.destroy();
1423
+ try {
1424
+ return await streamPromise;
1425
+ } catch (error) {
1426
+ return error.bufferedData;
1427
+ }
1428
+ };
1429
+ const getStreamPromise = (stream, { encoding, buffer, maxBuffer })=>{
1430
+ if (!stream || !buffer) return;
1431
+ if ('utf8' === encoding || 'utf-8' === encoding) return getStreamAsString(stream, {
1432
+ maxBuffer
1433
+ });
1434
+ if (null === encoding || 'buffer' === encoding) return getStreamAsBuffer(stream, {
1435
+ maxBuffer
1436
+ });
1437
+ return applyEncoding(stream, maxBuffer, encoding);
1438
+ };
1439
+ const applyEncoding = async (stream, maxBuffer, encoding)=>{
1440
+ const buffer = await getStreamAsBuffer(stream, {
1441
+ maxBuffer
1442
+ });
1443
+ return buffer.toString(encoding);
1444
+ };
1445
+ const getSpawnedResult = async ({ stdout, stderr, all }, { encoding, buffer, maxBuffer }, processDone)=>{
1446
+ const stdoutPromise = getStreamPromise(stdout, {
1447
+ encoding,
1448
+ buffer,
1449
+ maxBuffer
1450
+ });
1451
+ const stderrPromise = getStreamPromise(stderr, {
1452
+ encoding,
1453
+ buffer,
1454
+ maxBuffer
1455
+ });
1456
+ const allPromise = getStreamPromise(all, {
1457
+ encoding,
1458
+ buffer,
1459
+ maxBuffer: 2 * maxBuffer
1460
+ });
1461
+ try {
1462
+ return await Promise.all([
1463
+ processDone,
1464
+ stdoutPromise,
1465
+ stderrPromise,
1466
+ allPromise
1467
+ ]);
1468
+ } catch (error) {
1469
+ return Promise.all([
1470
+ {
1471
+ error,
1472
+ signal: error.signal,
1473
+ timedOut: error.timedOut
1474
+ },
1475
+ getBufferedData(stdout, stdoutPromise),
1476
+ getBufferedData(stderr, stderrPromise),
1477
+ getBufferedData(all, allPromise)
1478
+ ]);
1479
+ }
1480
+ };
1481
+ const nativePromisePrototype = (async ()=>{})().constructor.prototype;
1482
+ const descriptors = [
1483
+ 'then',
1484
+ 'catch',
1485
+ 'finally'
1486
+ ].map((property)=>[
1487
+ property,
1488
+ Reflect.getOwnPropertyDescriptor(nativePromisePrototype, property)
1489
+ ]);
1490
+ const mergePromise = (spawned, promise)=>{
1491
+ for (const [property, descriptor] of descriptors){
1492
+ const value = 'function' == typeof promise ? (...args)=>Reflect.apply(descriptor.value, promise(), args) : descriptor.value.bind(promise);
1493
+ Reflect.defineProperty(spawned, property, {
1494
+ ...descriptor,
1495
+ value
1496
+ });
1497
+ }
1498
+ };
1499
+ const getSpawnedPromise = (spawned)=>new Promise((resolve, reject)=>{
1500
+ spawned.on('exit', (exitCode, signal)=>{
1501
+ resolve({
1502
+ exitCode,
1503
+ signal
1504
+ });
1505
+ });
1506
+ spawned.on('error', (error)=>{
1507
+ reject(error);
1508
+ });
1509
+ if (spawned.stdin) spawned.stdin.on('error', (error)=>{
1510
+ reject(error);
1511
+ });
1512
+ });
1513
+ const normalizeArgs = (file, args = [])=>{
1514
+ if (!Array.isArray(args)) return [
1515
+ file
1516
+ ];
1517
+ return [
1518
+ file,
1519
+ ...args
1520
+ ];
1521
+ };
1522
+ const NO_ESCAPE_REGEXP = /^[\w.-]+$/;
1523
+ const escapeArg = (arg)=>{
1524
+ if ('string' != typeof arg || NO_ESCAPE_REGEXP.test(arg)) return arg;
1525
+ return `"${arg.replaceAll('"', '\\"')}"`;
1526
+ };
1527
+ const joinCommand = (file, args)=>normalizeArgs(file, args).join(' ');
1528
+ const getEscapedCommand = (file, args)=>normalizeArgs(file, args).map((arg)=>escapeArg(arg)).join(' ');
1529
+ const SPACES_REGEXP = / +/g;
1530
+ const parseExpression = (expression)=>{
1531
+ const typeOfExpression = typeof expression;
1532
+ if ('string' === typeOfExpression) return expression;
1533
+ if ('number' === typeOfExpression) return String(expression);
1534
+ if ('object' === typeOfExpression && null !== expression && !(expression instanceof ChildProcess) && 'stdout' in expression) {
1535
+ const typeOfStdout = typeof expression.stdout;
1536
+ if ('string' === typeOfStdout) return expression.stdout;
1537
+ if (Buffer.isBuffer(expression.stdout)) return expression.stdout.toString();
1538
+ throw new TypeError(`Unexpected "${typeOfStdout}" stdout in template expression`);
1539
+ }
1540
+ throw new TypeError(`Unexpected "${typeOfExpression}" in template expression`);
1541
+ };
1542
+ const concatTokens = (tokens, nextTokens, isNew)=>isNew || 0 === tokens.length || 0 === nextTokens.length ? [
1543
+ ...tokens,
1544
+ ...nextTokens
1545
+ ] : [
1546
+ ...tokens.slice(0, -1),
1547
+ `${tokens.at(-1)}${nextTokens[0]}`,
1548
+ ...nextTokens.slice(1)
1549
+ ];
1550
+ const parseTemplate = ({ templates, expressions, tokens, index, template })=>{
1551
+ const templateString = template ?? templates.raw[index];
1552
+ const templateTokens = templateString.split(SPACES_REGEXP).filter(Boolean);
1553
+ const newTokens = concatTokens(tokens, templateTokens, templateString.startsWith(' '));
1554
+ if (index === expressions.length) return newTokens;
1555
+ const expression = expressions[index];
1556
+ const expressionTokens = Array.isArray(expression) ? expression.map((expression)=>parseExpression(expression)) : [
1557
+ parseExpression(expression)
1558
+ ];
1559
+ return concatTokens(newTokens, expressionTokens, templateString.endsWith(' '));
1560
+ };
1561
+ const parseTemplates = (templates, expressions)=>{
1562
+ let tokens = [];
1563
+ for (const [index, template] of templates.entries())tokens = parseTemplate({
1564
+ templates,
1565
+ expressions,
1566
+ tokens,
1567
+ index,
1568
+ template
1569
+ });
1570
+ return tokens;
1571
+ };
1572
+ const verboseDefault = debuglog('execa').enabled;
1573
+ const padField = (field, padding)=>String(field).padStart(padding, '0');
1574
+ const getTimestamp = ()=>{
1575
+ const date = new Date();
1576
+ return `${padField(date.getHours(), 2)}:${padField(date.getMinutes(), 2)}:${padField(date.getSeconds(), 2)}.${padField(date.getMilliseconds(), 3)}`;
1577
+ };
1578
+ const logCommand = (escapedCommand, { verbose })=>{
1579
+ if (!verbose) return;
1580
+ node_process.stderr.write(`[${getTimestamp()}] ${escapedCommand}\n`);
1581
+ };
1582
+ const cross_spawn = __webpack_require__("../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js");
1583
+ const DEFAULT_MAX_BUFFER = 100000000;
1584
+ const getEnv = ({ env: envOption, extendEnv, preferLocal, localDir, execPath })=>{
1585
+ const env = extendEnv ? {
1586
+ ...node_process.env,
1587
+ ...envOption
1588
+ } : envOption;
1589
+ if (preferLocal) return npmRunPathEnv({
1590
+ env,
1591
+ cwd: localDir,
1592
+ execPath
1593
+ });
1594
+ return env;
1595
+ };
1596
+ const handleArguments = (file, args, options = {})=>{
1597
+ const parsed = cross_spawn._parse(file, args, options);
1598
+ file = parsed.command;
1599
+ args = parsed.args;
1600
+ options = parsed.options;
1601
+ options = {
1602
+ maxBuffer: DEFAULT_MAX_BUFFER,
1603
+ buffer: true,
1604
+ stripFinalNewline: true,
1605
+ extendEnv: true,
1606
+ preferLocal: false,
1607
+ localDir: options.cwd || node_process.cwd(),
1608
+ execPath: node_process.execPath,
1609
+ encoding: 'utf8',
1610
+ reject: true,
1611
+ cleanup: true,
1612
+ all: false,
1613
+ windowsHide: true,
1614
+ verbose: verboseDefault,
1615
+ ...options
1616
+ };
1617
+ options.env = getEnv(options);
1618
+ options.stdio = normalizeStdio(options);
1619
+ if ('win32' === node_process.platform && 'cmd' === node_path.basename(file, '.exe')) args.unshift('/q');
1620
+ return {
1621
+ file,
1622
+ args,
1623
+ options,
1624
+ parsed
1625
+ };
1626
+ };
1627
+ const handleOutput = (options, value, error)=>{
1628
+ if ('string' != typeof value && !Buffer.isBuffer(value)) return void 0 === error ? void 0 : '';
1629
+ if (options.stripFinalNewline) return stripFinalNewline(value);
1630
+ return value;
1631
+ };
1632
+ function execa(file, args, options) {
1633
+ const parsed = handleArguments(file, args, options);
1634
+ const command = joinCommand(file, args);
1635
+ const escapedCommand = getEscapedCommand(file, args);
1636
+ logCommand(escapedCommand, parsed.options);
1637
+ validateTimeout(parsed.options);
1638
+ let spawned;
1639
+ try {
1640
+ spawned = node_child_process.spawn(parsed.file, parsed.args, parsed.options);
1641
+ } catch (error) {
1642
+ const dummySpawned = new node_child_process.ChildProcess();
1643
+ const errorPromise = Promise.reject(makeError({
1644
+ error,
1645
+ stdout: '',
1646
+ stderr: '',
1647
+ all: '',
1648
+ command,
1649
+ escapedCommand,
1650
+ parsed,
1651
+ timedOut: false,
1652
+ isCanceled: false,
1653
+ killed: false
1654
+ }));
1655
+ mergePromise(dummySpawned, errorPromise);
1656
+ return dummySpawned;
1657
+ }
1658
+ const spawnedPromise = getSpawnedPromise(spawned);
1659
+ const timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);
1660
+ const processDone = setExitHandler(spawned, parsed.options, timedPromise);
1661
+ const context = {
1662
+ isCanceled: false
1663
+ };
1664
+ spawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));
1665
+ spawned.cancel = spawnedCancel.bind(null, spawned, context);
1666
+ const handlePromise = async ()=>{
1667
+ const [{ error, exitCode, signal, timedOut }, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);
1668
+ const stdout = handleOutput(parsed.options, stdoutResult);
1669
+ const stderr = handleOutput(parsed.options, stderrResult);
1670
+ const all = handleOutput(parsed.options, allResult);
1671
+ if (error || 0 !== exitCode || null !== signal) {
1672
+ const returnedError = makeError({
1673
+ error,
1674
+ exitCode,
1675
+ signal,
1676
+ stdout,
1677
+ stderr,
1678
+ all,
1679
+ command,
1680
+ escapedCommand,
1681
+ parsed,
1682
+ timedOut,
1683
+ isCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : false),
1684
+ killed: spawned.killed
1685
+ });
1686
+ if (!parsed.options.reject) return returnedError;
1687
+ throw returnedError;
1688
+ }
1689
+ return {
1690
+ command,
1691
+ escapedCommand,
1692
+ exitCode: 0,
1693
+ stdout,
1694
+ stderr,
1695
+ all,
1696
+ failed: false,
1697
+ timedOut: false,
1698
+ isCanceled: false,
1699
+ killed: false
1700
+ };
1701
+ };
1702
+ const handlePromiseOnce = node_modules_onetime(handlePromise);
1703
+ handleInput(spawned, parsed.options);
1704
+ spawned.all = makeAllStream(spawned, parsed.options);
1705
+ addPipeMethods(spawned);
1706
+ mergePromise(spawned, handlePromiseOnce);
1707
+ return spawned;
1708
+ }
1709
+ function execaSync(file, args, options) {
1710
+ const parsed = handleArguments(file, args, options);
1711
+ const command = joinCommand(file, args);
1712
+ const escapedCommand = getEscapedCommand(file, args);
1713
+ logCommand(escapedCommand, parsed.options);
1714
+ const input = handleInputSync(parsed.options);
1715
+ let result;
1716
+ try {
1717
+ result = node_child_process.spawnSync(parsed.file, parsed.args, {
1718
+ ...parsed.options,
1719
+ input
1720
+ });
1721
+ } catch (error) {
1722
+ throw makeError({
1723
+ error,
1724
+ stdout: '',
1725
+ stderr: '',
1726
+ all: '',
1727
+ command,
1728
+ escapedCommand,
1729
+ parsed,
1730
+ timedOut: false,
1731
+ isCanceled: false,
1732
+ killed: false
1733
+ });
1734
+ }
1735
+ const stdout = handleOutput(parsed.options, result.stdout, result.error);
1736
+ const stderr = handleOutput(parsed.options, result.stderr, result.error);
1737
+ if (result.error || 0 !== result.status || null !== result.signal) {
1738
+ const error = makeError({
1739
+ stdout,
1740
+ stderr,
1741
+ error: result.error,
1742
+ signal: result.signal,
1743
+ exitCode: result.status,
1744
+ command,
1745
+ escapedCommand,
1746
+ parsed,
1747
+ timedOut: result.error && 'ETIMEDOUT' === result.error.code,
1748
+ isCanceled: false,
1749
+ killed: null !== result.signal
1750
+ });
1751
+ if (!parsed.options.reject) return error;
1752
+ throw error;
1753
+ }
1754
+ return {
1755
+ command,
1756
+ escapedCommand,
1757
+ exitCode: 0,
1758
+ stdout,
1759
+ stderr,
1760
+ failed: false,
1761
+ timedOut: false,
1762
+ isCanceled: false,
1763
+ killed: false
1764
+ };
1765
+ }
1766
+ const normalizeScriptStdin = ({ input, inputFile, stdio })=>void 0 === input && void 0 === inputFile && void 0 === stdio ? {
1767
+ stdin: 'inherit'
1768
+ } : {};
1769
+ const normalizeScriptOptions = (options = {})=>({
1770
+ preferLocal: true,
1771
+ ...normalizeScriptStdin(options),
1772
+ ...options
1773
+ });
1774
+ function create$(options) {
1775
+ function $(templatesOrOptions, ...expressions) {
1776
+ if (!Array.isArray(templatesOrOptions)) return create$({
1777
+ ...options,
1778
+ ...templatesOrOptions
1779
+ });
1780
+ const [file, ...args] = parseTemplates(templatesOrOptions, expressions);
1781
+ return execa(file, args, normalizeScriptOptions(options));
1782
+ }
1783
+ $.sync = (templates, ...expressions)=>{
1784
+ if (!Array.isArray(templates)) throw new TypeError('Please use $(options).sync`command` instead of $.sync(options)`command`.');
1785
+ const [file, ...args] = parseTemplates(templates, expressions);
1786
+ return execaSync(file, args, normalizeScriptOptions(options));
1787
+ };
1788
+ return $;
1789
+ }
1790
+ create$();
1791
+ export { execa };