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