@maizzle/framework 6.0.0-rc.1 → 6.0.0-rc.10
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/bin/maizzle.mjs +1 -1
- package/dist/_virtual/_rolldown/runtime.mjs +32 -0
- package/dist/build.mjs +6 -3
- package/dist/build.mjs.map +1 -1
- package/dist/components/Body.vue +111 -0
- package/dist/components/Button.vue +68 -14
- package/dist/components/CodeBlock.vue +68 -0
- package/dist/components/CodeInline.vue +49 -0
- package/dist/components/Column.vue +86 -0
- package/dist/components/Container.vue +48 -0
- package/dist/components/Divider.vue +28 -0
- package/dist/components/Head.vue +30 -0
- package/dist/components/Heading.vue +28 -0
- package/dist/components/Html.vue +104 -0
- package/dist/components/Image.vue +70 -0
- package/dist/components/Layout.vue +93 -0
- package/dist/components/Link.vue +26 -0
- package/dist/components/Markdown.vue +89 -0
- package/dist/components/Outlook.vue +36 -0
- package/dist/components/Overlap.vue +80 -0
- package/dist/components/Preheader.vue +20 -0
- package/dist/components/Row.vue +91 -0
- package/dist/components/Section.vue +83 -0
- package/dist/components/Spacer.vue +50 -7
- package/dist/components/Text.vue +29 -0
- package/dist/components/Vml.vue +165 -13
- package/dist/composables/renderContext.d.mts +5 -0
- package/dist/composables/renderContext.d.mts.map +1 -1
- package/dist/composables/renderContext.mjs.map +1 -1
- package/dist/composables/usePreviewText.d.mts +24 -0
- package/dist/composables/usePreviewText.d.mts.map +1 -0
- package/dist/composables/usePreviewText.mjs +29 -0
- package/dist/composables/usePreviewText.mjs.map +1 -0
- package/dist/config/index.mjs +7 -0
- package/dist/config/index.mjs.map +1 -1
- package/dist/index.d.mts +4 -2
- package/dist/index.mjs +3 -1
- package/dist/node_modules/picomatch/index.mjs +13 -0
- package/dist/node_modules/picomatch/index.mjs.map +1 -0
- package/dist/node_modules/picomatch/lib/constants.mjs +174 -0
- package/dist/node_modules/picomatch/lib/constants.mjs.map +1 -0
- package/dist/node_modules/picomatch/lib/parse.mjs +1067 -0
- package/dist/node_modules/picomatch/lib/parse.mjs.map +1 -0
- package/dist/node_modules/picomatch/lib/picomatch.mjs +304 -0
- package/dist/node_modules/picomatch/lib/picomatch.mjs.map +1 -0
- package/dist/node_modules/picomatch/lib/scan.mjs +296 -0
- package/dist/node_modules/picomatch/lib/scan.mjs.map +1 -0
- package/dist/node_modules/picomatch/lib/utils.mjs +53 -0
- package/dist/node_modules/picomatch/lib/utils.mjs.map +1 -0
- package/dist/plugin.d.mts.map +1 -1
- package/dist/plugin.mjs +24 -7
- package/dist/plugin.mjs.map +1 -1
- package/dist/plugins/postcss/tailwindCleanup.d.mts.map +1 -1
- package/dist/plugins/postcss/tailwindCleanup.mjs +44 -13
- package/dist/plugins/postcss/tailwindCleanup.mjs.map +1 -1
- package/dist/render/createRenderer.d.mts +8 -3
- package/dist/render/createRenderer.d.mts.map +1 -1
- package/dist/render/createRenderer.mjs +146 -10
- package/dist/render/createRenderer.mjs.map +1 -1
- package/dist/render/index.mjs +6 -3
- package/dist/render/index.mjs.map +1 -1
- package/dist/serve.d.mts.map +1 -1
- package/dist/serve.mjs +157 -63
- package/dist/serve.mjs.map +1 -1
- package/dist/server/compatibility.d.mts +1 -2
- package/dist/server/compatibility.d.mts.map +1 -1
- package/dist/server/compatibility.mjs +30 -16
- package/dist/server/compatibility.mjs.map +1 -1
- package/dist/server/email.d.mts +17 -0
- package/dist/server/email.d.mts.map +1 -0
- package/dist/server/email.mjs +41 -0
- package/dist/server/email.mjs.map +1 -0
- package/dist/server/linter.d.mts +1 -2
- package/dist/server/linter.d.mts.map +1 -1
- package/dist/server/linter.mjs +60 -71
- package/dist/server/linter.mjs.map +1 -1
- package/dist/server/ui/App.vue +205 -69
- package/dist/server/ui/components/ui/checkbox/Checkbox.vue +35 -0
- package/dist/server/ui/components/ui/checkbox/index.ts +1 -0
- package/dist/server/ui/components/ui/command/CommandDialog.vue +1 -1
- package/dist/server/ui/components/ui/command/CommandInput.vue +19 -1
- package/dist/server/ui/components/ui/command/CommandItem.vue +1 -1
- package/dist/server/ui/components/ui/command/CommandList.vue +1 -1
- package/dist/server/ui/components/ui/command/CommandShortcut.vue +1 -1
- package/dist/server/ui/components/ui/dialog/DialogOverlay.vue +9 -1
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuItem.vue +1 -1
- package/dist/server/ui/components/ui/scroll-area/ScrollBar.vue +1 -1
- package/dist/server/ui/components/ui/sheet/SheetContent.vue +1 -1
- package/dist/server/ui/components/ui/sheet/SheetOverlay.vue +9 -1
- package/dist/server/ui/components/ui/sidebar/Sidebar.vue +8 -1
- package/dist/server/ui/components/ui/sidebar/SidebarProvider.vue +1 -1
- package/dist/server/ui/components/ui/sidebar/SidebarTrigger.vue +5 -4
- package/dist/server/ui/components/ui/tags-input/TagsInput.vue +26 -0
- package/dist/server/ui/components/ui/tags-input/TagsInputInput.vue +17 -0
- package/dist/server/ui/components/ui/tags-input/TagsInputItem.vue +19 -0
- package/dist/server/ui/components/ui/tags-input/TagsInputItemDelete.vue +22 -0
- package/dist/server/ui/components/ui/tags-input/TagsInputItemText.vue +17 -0
- package/dist/server/ui/components/ui/tags-input/index.ts +5 -0
- package/dist/server/ui/components/ui/toggle/index.ts +3 -3
- package/dist/server/ui/components/ui/toggle-group/ToggleGroup.vue +1 -1
- package/dist/server/ui/components/ui/toggle-group/ToggleGroupItem.vue +2 -2
- package/dist/server/ui/main.css +20 -20
- package/dist/server/ui/pages/Home.vue +12 -5
- package/dist/server/ui/pages/Preview.vue +506 -216
- package/dist/transformers/entities.d.mts.map +1 -1
- package/dist/transformers/entities.mjs +3 -0
- package/dist/transformers/entities.mjs.map +1 -1
- package/dist/transformers/filters/defaults.d.mts +6 -0
- package/dist/transformers/filters/defaults.d.mts.map +1 -0
- package/dist/transformers/filters/defaults.mjs +78 -0
- package/dist/transformers/filters/defaults.mjs.map +1 -0
- package/dist/transformers/filters/index.d.mts +22 -0
- package/dist/transformers/filters/index.d.mts.map +1 -0
- package/dist/transformers/filters/index.mjs +67 -0
- package/dist/transformers/filters/index.mjs.map +1 -0
- package/dist/transformers/index.d.mts +11 -9
- package/dist/transformers/index.d.mts.map +1 -1
- package/dist/transformers/index.mjs +19 -11
- package/dist/transformers/index.mjs.map +1 -1
- package/dist/transformers/inlineCSS.d.mts +1 -14
- package/dist/transformers/inlineCSS.d.mts.map +1 -1
- package/dist/transformers/inlineCSS.mjs +25 -34
- package/dist/transformers/inlineCSS.mjs.map +1 -1
- package/dist/transformers/purgeCSS.d.mts.map +1 -1
- package/dist/transformers/purgeCSS.mjs +67 -1
- package/dist/transformers/purgeCSS.mjs.map +1 -1
- package/dist/transformers/sixHex.d.mts +16 -0
- package/dist/transformers/sixHex.d.mts.map +1 -0
- package/dist/transformers/sixHex.mjs +30 -0
- package/dist/transformers/sixHex.mjs.map +1 -0
- package/dist/transformers/tailwindcss.d.mts +6 -2
- package/dist/transformers/tailwindcss.d.mts.map +1 -1
- package/dist/transformers/tailwindcss.mjs +52 -28
- package/dist/transformers/tailwindcss.mjs.map +1 -1
- package/dist/types/config.d.mts +446 -21
- package/dist/types/config.d.mts.map +1 -1
- package/dist/types/index.d.mts +2 -2
- package/dist/utils/ast/serializer.d.mts +3 -2
- package/dist/utils/ast/serializer.d.mts.map +1 -1
- package/dist/utils/ast/serializer.mjs +24 -0
- package/dist/utils/ast/serializer.mjs.map +1 -1
- package/dist/utils/detect.d.mts +5 -0
- package/dist/utils/detect.d.mts.map +1 -0
- package/dist/utils/detect.mjs +11 -0
- package/dist/utils/detect.mjs.map +1 -0
- package/node_modules/@clack/core/CHANGELOG.md +87 -4
- package/node_modules/@clack/core/README.md +1 -1
- package/node_modules/@clack/core/dist/index.d.mts +186 -48
- package/node_modules/@clack/core/dist/index.mjs +10 -14
- package/node_modules/@clack/core/dist/index.mjs.map +1 -1
- package/node_modules/@clack/core/package.json +7 -9
- package/node_modules/@clack/prompts/CHANGELOG.md +171 -7
- package/node_modules/@clack/prompts/README.md +66 -3
- package/node_modules/@clack/prompts/dist/index.d.mts +302 -76
- package/node_modules/@clack/prompts/dist/index.mjs +134 -84
- package/node_modules/@clack/prompts/dist/index.mjs.map +1 -1
- package/node_modules/@clack/prompts/package.json +14 -10
- package/node_modules/citty/LICENSE +0 -15
- package/node_modules/citty/README.md +166 -69
- package/node_modules/citty/dist/index.d.mts +88 -56
- package/node_modules/citty/dist/index.mjs +399 -437
- package/node_modules/citty/package.json +28 -35
- package/node_modules/giget/README.md +59 -11
- package/node_modules/giget/dist/THIRD-PARTY-LICENSES.md +205 -0
- package/node_modules/giget/dist/_chunks/giget.mjs +508 -0
- package/node_modules/giget/dist/_chunks/libs/citty.mjs +269 -0
- package/node_modules/giget/dist/_chunks/libs/nypm.d.mts +1 -0
- package/node_modules/giget/dist/_chunks/libs/nypm.mjs +669 -0
- package/node_modules/giget/dist/_chunks/libs/tar.mjs +2931 -0
- package/node_modules/giget/dist/_chunks/rolldown-runtime.mjs +14 -0
- package/node_modules/giget/dist/cli.d.mts +1 -0
- package/node_modules/giget/dist/cli.mjs +89 -111
- package/node_modules/giget/dist/index.d.mts +46 -35
- package/node_modules/giget/dist/index.mjs +2 -22
- package/node_modules/giget/package.json +32 -45
- package/node_modules/maizzle/README.md +140 -0
- package/node_modules/maizzle/bin/maizzle.mjs +5 -0
- package/node_modules/maizzle/dist/commands/new.d.mts +7 -0
- package/node_modules/maizzle/dist/commands/new.mjs +278 -0
- package/node_modules/{@maizzle/cli → maizzle}/dist/index.d.mts +1 -1
- package/node_modules/maizzle/dist/index.mjs +44 -0
- package/node_modules/{commander → maizzle/node_modules/commander}/Readme.md +94 -67
- package/node_modules/{commander → maizzle/node_modules/commander}/lib/argument.js +5 -4
- package/node_modules/{commander → maizzle/node_modules/commander}/lib/command.js +154 -39
- package/node_modules/{commander → maizzle/node_modules/commander}/lib/help.js +77 -39
- package/node_modules/{commander → maizzle/node_modules/commander}/lib/option.js +16 -3
- package/node_modules/{commander → maizzle/node_modules/commander}/package-support.json +4 -1
- package/node_modules/{commander → maizzle/node_modules/commander}/package.json +8 -8
- package/node_modules/{commander → maizzle/node_modules/commander}/typings/index.d.ts +71 -3
- package/node_modules/{@maizzle/cli → maizzle}/package.json +13 -11
- package/node_modules/tinyexec/README.md +49 -3
- package/node_modules/tinyexec/dist/main.d.mts +25 -14
- package/node_modules/tinyexec/dist/main.mjs +148 -100
- package/node_modules/tinyexec/package.json +9 -8
- package/package.json +9 -4
- package/dist/server/ui/components/ui/resizable/ResizableHandle.vue +0 -30
- package/dist/server/ui/components/ui/resizable/ResizablePanel.vue +0 -21
- package/dist/server/ui/components/ui/resizable/ResizablePanelGroup.vue +0 -25
- package/dist/server/ui/components/ui/resizable/index.ts +0 -3
- package/node_modules/@clack/core/dist/index.cjs +0 -15
- package/node_modules/@clack/core/dist/index.cjs.map +0 -1
- package/node_modules/@clack/core/dist/index.d.cts +0 -211
- package/node_modules/@clack/core/dist/index.d.ts +0 -211
- package/node_modules/@clack/prompts/dist/index.cjs +0 -87
- package/node_modules/@clack/prompts/dist/index.cjs.map +0 -1
- package/node_modules/@clack/prompts/dist/index.d.cts +0 -165
- package/node_modules/@clack/prompts/dist/index.d.ts +0 -165
- package/node_modules/@maizzle/cli/README.md +0 -58
- package/node_modules/@maizzle/cli/dist/index.mjs +0 -42
- package/node_modules/citty/dist/index.cjs +0 -475
- package/node_modules/citty/dist/index.d.cts +0 -80
- package/node_modules/citty/dist/index.d.ts +0 -80
- package/node_modules/consola/LICENSE +0 -47
- package/node_modules/consola/README.md +0 -352
- package/node_modules/consola/basic.d.ts +0 -1
- package/node_modules/consola/browser.d.ts +0 -1
- package/node_modules/consola/core.d.ts +0 -1
- package/node_modules/consola/dist/basic.cjs +0 -32
- package/node_modules/consola/dist/basic.d.cts +0 -23
- package/node_modules/consola/dist/basic.d.mts +0 -21
- package/node_modules/consola/dist/basic.d.ts +0 -23
- package/node_modules/consola/dist/basic.mjs +0 -24
- package/node_modules/consola/dist/browser.cjs +0 -84
- package/node_modules/consola/dist/browser.d.cts +0 -23
- package/node_modules/consola/dist/browser.d.mts +0 -21
- package/node_modules/consola/dist/browser.d.ts +0 -23
- package/node_modules/consola/dist/browser.mjs +0 -76
- package/node_modules/consola/dist/chunks/prompt.cjs +0 -288
- package/node_modules/consola/dist/chunks/prompt.mjs +0 -280
- package/node_modules/consola/dist/core.cjs +0 -517
- package/node_modules/consola/dist/core.d.cts +0 -459
- package/node_modules/consola/dist/core.d.mts +0 -459
- package/node_modules/consola/dist/core.d.ts +0 -459
- package/node_modules/consola/dist/core.mjs +0 -512
- package/node_modules/consola/dist/index.cjs +0 -663
- package/node_modules/consola/dist/index.d.cts +0 -24
- package/node_modules/consola/dist/index.d.mts +0 -22
- package/node_modules/consola/dist/index.d.ts +0 -24
- package/node_modules/consola/dist/index.mjs +0 -651
- package/node_modules/consola/dist/shared/consola.DCGIlDNP.cjs +0 -75
- package/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +0 -72
- package/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +0 -288
- package/node_modules/consola/dist/shared/consola.DwRq1yyg.cjs +0 -312
- package/node_modules/consola/dist/utils.cjs +0 -64
- package/node_modules/consola/dist/utils.d.cts +0 -286
- package/node_modules/consola/dist/utils.d.mts +0 -286
- package/node_modules/consola/dist/utils.d.ts +0 -286
- package/node_modules/consola/dist/utils.mjs +0 -54
- package/node_modules/consola/lib/index.cjs +0 -10
- package/node_modules/consola/package.json +0 -136
- package/node_modules/consola/utils.d.ts +0 -1
- package/node_modules/create-maizzle/README.md +0 -86
- package/node_modules/create-maizzle/bin/create-maizzle.mjs +0 -4
- package/node_modules/create-maizzle/node_modules/@clack/core/CHANGELOG.md +0 -340
- package/node_modules/create-maizzle/node_modules/@clack/core/LICENSE +0 -9
- package/node_modules/create-maizzle/node_modules/@clack/core/README.md +0 -22
- package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.d.mts +0 -349
- package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs +0 -11
- package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs.map +0 -1
- package/node_modules/create-maizzle/node_modules/@clack/core/package.json +0 -60
- package/node_modules/create-maizzle/node_modules/@clack/prompts/CHANGELOG.md +0 -576
- package/node_modules/create-maizzle/node_modules/@clack/prompts/LICENSE +0 -9
- package/node_modules/create-maizzle/node_modules/@clack/prompts/README.md +0 -270
- package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.d.mts +0 -391
- package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs +0 -137
- package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs.map +0 -1
- package/node_modules/create-maizzle/node_modules/@clack/prompts/package.json +0 -65
- package/node_modules/create-maizzle/package.json +0 -47
- package/node_modules/create-maizzle/src/index.js +0 -242
- package/node_modules/defu/LICENSE +0 -21
- package/node_modules/defu/README.md +0 -171
- package/node_modules/defu/dist/defu.cjs +0 -77
- package/node_modules/defu/dist/defu.d.cts +0 -31
- package/node_modules/defu/dist/defu.d.mts +0 -29
- package/node_modules/defu/dist/defu.d.ts +0 -31
- package/node_modules/defu/dist/defu.mjs +0 -69
- package/node_modules/defu/lib/defu.cjs +0 -10
- package/node_modules/defu/lib/defu.d.cts +0 -12
- package/node_modules/defu/package.json +0 -48
- package/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +0 -468
- package/node_modules/node-fetch-native/LICENSE +0 -114
- package/node_modules/node-fetch-native/README.md +0 -225
- package/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +0 -2
- package/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +0 -2
- package/node_modules/node-fetch-native/dist/index.cjs +0 -1
- package/node_modules/node-fetch-native/dist/index.mjs +0 -1
- package/node_modules/node-fetch-native/dist/native.cjs +0 -1
- package/node_modules/node-fetch-native/dist/native.mjs +0 -1
- package/node_modules/node-fetch-native/dist/node.cjs +0 -19
- package/node_modules/node-fetch-native/dist/node.mjs +0 -19
- package/node_modules/node-fetch-native/dist/polyfill.cjs +0 -1
- package/node_modules/node-fetch-native/dist/polyfill.mjs +0 -1
- package/node_modules/node-fetch-native/dist/proxy-stub.cjs +0 -1
- package/node_modules/node-fetch-native/dist/proxy-stub.mjs +0 -1
- package/node_modules/node-fetch-native/dist/proxy.cjs +0 -58
- package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +0 -1
- package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +0 -1
- package/node_modules/node-fetch-native/index.d.ts +0 -1
- package/node_modules/node-fetch-native/lib/empty.cjs +0 -0
- package/node_modules/node-fetch-native/lib/empty.mjs +0 -0
- package/node_modules/node-fetch-native/lib/index.cjs +0 -11
- package/node_modules/node-fetch-native/lib/index.d.cts +0 -10
- package/node_modules/node-fetch-native/lib/index.d.mts +0 -10
- package/node_modules/node-fetch-native/lib/index.d.ts +0 -10
- package/node_modules/node-fetch-native/lib/native.cjs +0 -11
- package/node_modules/node-fetch-native/lib/polyfill.d.cts +0 -1
- package/node_modules/node-fetch-native/lib/polyfill.d.mts +0 -1
- package/node_modules/node-fetch-native/lib/polyfill.d.ts +0 -1
- package/node_modules/node-fetch-native/lib/proxy.d.ts +0 -32
- package/node_modules/node-fetch-native/node.d.ts +0 -1
- package/node_modules/node-fetch-native/package.json +0 -138
- package/node_modules/node-fetch-native/polyfill.d.ts +0 -1
- package/node_modules/node-fetch-native/proxy.d.ts +0 -1
- package/node_modules/nypm/node_modules/citty/LICENSE +0 -21
- package/node_modules/nypm/node_modules/citty/README.md +0 -231
- package/node_modules/nypm/node_modules/citty/dist/index.d.mts +0 -112
- package/node_modules/nypm/node_modules/citty/dist/index.mjs +0 -425
- package/node_modules/nypm/node_modules/citty/package.json +0 -42
- /package/node_modules/{nypm/node_modules/citty → citty}/dist/THIRD-PARTY-LICENSES.md +0 -0
- /package/node_modules/{nypm/node_modules/citty → citty}/dist/_chunks/libs/scule.mjs +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/LICENSE +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/component.d.mts +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/component.mjs +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/config.d.mts +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/config.mjs +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/layout.d.mts +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/layout.mjs +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/scaffold.d.mts +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/scaffold.mjs +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/component.vue +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/config.ts +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/layout.vue +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/stubs/template.vue +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/template.d.mts +0 -0
- /package/node_modules/{@maizzle/cli → maizzle}/dist/commands/make/template.mjs +0 -0
- /package/node_modules/{commander → maizzle/node_modules/commander}/LICENSE +0 -0
- /package/node_modules/{commander → maizzle/node_modules/commander}/esm.mjs +0 -0
- /package/node_modules/{commander → maizzle/node_modules/commander}/index.js +0 -0
- /package/node_modules/{commander → maizzle/node_modules/commander}/lib/error.js +0 -0
- /package/node_modules/{commander → maizzle/node_modules/commander}/lib/suggestSimilar.js +0 -0
- /package/node_modules/{commander → maizzle/node_modules/commander}/typings/esm.d.mts +0 -0
|
@@ -0,0 +1,669 @@
|
|
|
1
|
+
import { t as e } from "../rolldown-runtime.mjs";
|
|
2
|
+
import { createRequire as t } from "node:module";
|
|
3
|
+
import { existsSync as n } from "node:fs";
|
|
4
|
+
import { readFile as r } from "node:fs/promises";
|
|
5
|
+
import { PassThrough as i } from "node:stream";
|
|
6
|
+
import { spawn as a } from "node:child_process";
|
|
7
|
+
import { delimiter as o, dirname as s, normalize as c, resolve as l } from "node:path";
|
|
8
|
+
import { cwd as u } from "node:process";
|
|
9
|
+
import d from "node:readline";
|
|
10
|
+
const f = /^[A-Za-z]:\//;
|
|
11
|
+
function p(e = ``) {
|
|
12
|
+
return e && e.replace(/\\/g, `/`).replace(f, (e) => e.toUpperCase());
|
|
13
|
+
}
|
|
14
|
+
const ee = /^[/\\]{2}/, te = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, m = /^[A-Za-z]:$/, h = /^\/([A-Za-z]:)?$/, g = function(e) {
|
|
15
|
+
if (e.length === 0) return `.`;
|
|
16
|
+
e = p(e);
|
|
17
|
+
let t = e.match(ee), n = x(e), r = e[e.length - 1] === `/`;
|
|
18
|
+
return e = b(e, !n), e.length === 0 ? n ? `/` : r ? `./` : `.` : (r && (e += `/`), m.test(e) && (e += `/`), t ? n ? `//${e}` : `//./${e}` : n && !x(e) ? `/${e}` : e);
|
|
19
|
+
}, _ = function(...e) {
|
|
20
|
+
let t = ``;
|
|
21
|
+
for (let n of e) if (n) if (t.length > 0) {
|
|
22
|
+
let e = t[t.length - 1] === `/`, r = n[0] === `/`;
|
|
23
|
+
e && r ? t += n.slice(1) : t += e || r ? n : `/${n}`;
|
|
24
|
+
} else t += n;
|
|
25
|
+
return g(t);
|
|
26
|
+
};
|
|
27
|
+
function v() {
|
|
28
|
+
return typeof process < `u` && typeof process.cwd == `function` ? process.cwd().replace(/\\/g, `/`) : `/`;
|
|
29
|
+
}
|
|
30
|
+
const y = function(...e) {
|
|
31
|
+
e = e.map((e) => p(e));
|
|
32
|
+
let t = ``, n = !1;
|
|
33
|
+
for (let r = e.length - 1; r >= -1 && !n; r--) {
|
|
34
|
+
let i = r >= 0 ? e[r] : v();
|
|
35
|
+
!i || i.length === 0 || (t = `${i}/${t}`, n = x(i));
|
|
36
|
+
}
|
|
37
|
+
return t = b(t, !n), n && !x(t) ? `/${t}` : t.length > 0 ? t : `.`;
|
|
38
|
+
};
|
|
39
|
+
function b(e, t) {
|
|
40
|
+
let n = ``, r = 0, i = -1, a = 0, o = null;
|
|
41
|
+
for (let s = 0; s <= e.length; ++s) {
|
|
42
|
+
if (s < e.length) o = e[s];
|
|
43
|
+
else if (o === `/`) break;
|
|
44
|
+
else o = `/`;
|
|
45
|
+
if (o === `/`) {
|
|
46
|
+
if (!(i === s - 1 || a === 1)) if (a === 2) {
|
|
47
|
+
if (n.length < 2 || r !== 2 || n[n.length - 1] !== `.` || n[n.length - 2] !== `.`) {
|
|
48
|
+
if (n.length > 2) {
|
|
49
|
+
let e = n.lastIndexOf(`/`);
|
|
50
|
+
e === -1 ? (n = ``, r = 0) : (n = n.slice(0, e), r = n.length - 1 - n.lastIndexOf(`/`)), i = s, a = 0;
|
|
51
|
+
continue;
|
|
52
|
+
} else if (n.length > 0) {
|
|
53
|
+
n = ``, r = 0, i = s, a = 0;
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
t && (n += n.length > 0 ? `/..` : `..`, r = 2);
|
|
58
|
+
} else n.length > 0 ? n += `/${e.slice(i + 1, s)}` : n = e.slice(i + 1, s), r = s - i - 1;
|
|
59
|
+
i = s, a = 0;
|
|
60
|
+
} else o === `.` && a !== -1 ? ++a : a = -1;
|
|
61
|
+
}
|
|
62
|
+
return n;
|
|
63
|
+
}
|
|
64
|
+
const x = function(e) {
|
|
65
|
+
return te.test(e);
|
|
66
|
+
}, S = function(e, t) {
|
|
67
|
+
let n = y(e).replace(h, `$1`).split(`/`), r = y(t).replace(h, `$1`).split(`/`);
|
|
68
|
+
if (r[0][1] === `:` && n[0][1] === `:` && n[0] !== r[0]) return r.join(`/`);
|
|
69
|
+
let i = [...n];
|
|
70
|
+
for (let e of i) {
|
|
71
|
+
if (r[0] !== e) break;
|
|
72
|
+
n.shift(), r.shift();
|
|
73
|
+
}
|
|
74
|
+
return [...n.map(() => `..`), ...r].join(`/`);
|
|
75
|
+
}, C = function(e) {
|
|
76
|
+
let t = p(e).replace(/\/$/, ``).split(`/`).slice(0, -1);
|
|
77
|
+
return t.length === 1 && m.test(t[0]) && (t[0] += `/`), t.join(`/`) || (x(e) ? `/` : `.`);
|
|
78
|
+
}, ne = function(e, t) {
|
|
79
|
+
let n = p(e).split(`/`), r = ``;
|
|
80
|
+
for (let e = n.length - 1; e >= 0; e--) {
|
|
81
|
+
let t = n[e];
|
|
82
|
+
if (t) {
|
|
83
|
+
r = t;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return t && r.endsWith(t) ? r.slice(0, -t.length) : r;
|
|
88
|
+
};
|
|
89
|
+
globalThis.process?.platform;
|
|
90
|
+
var w = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), T = t(import.meta.url);
|
|
91
|
+
const re = /^path$/i, E = {
|
|
92
|
+
key: `PATH`,
|
|
93
|
+
value: ``
|
|
94
|
+
};
|
|
95
|
+
function D(e) {
|
|
96
|
+
for (let t in e) {
|
|
97
|
+
if (!Object.prototype.hasOwnProperty.call(e, t) || !re.test(t)) continue;
|
|
98
|
+
let n = e[t];
|
|
99
|
+
return n ? {
|
|
100
|
+
key: t,
|
|
101
|
+
value: n
|
|
102
|
+
} : E;
|
|
103
|
+
}
|
|
104
|
+
return E;
|
|
105
|
+
}
|
|
106
|
+
function O(e, t) {
|
|
107
|
+
let n = t.value.split(o), r = [], i = e, a;
|
|
108
|
+
do
|
|
109
|
+
r.push(l(i, `node_modules`, `.bin`)), a = i, i = s(i);
|
|
110
|
+
while (i !== a);
|
|
111
|
+
let c = r.concat(n).join(o);
|
|
112
|
+
return {
|
|
113
|
+
key: t.key,
|
|
114
|
+
value: c
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function k(e, t) {
|
|
118
|
+
let n = {
|
|
119
|
+
...process.env,
|
|
120
|
+
...t
|
|
121
|
+
}, r = O(e, D(n));
|
|
122
|
+
return n[r.key] = r.value, n;
|
|
123
|
+
}
|
|
124
|
+
const A = (e) => {
|
|
125
|
+
let t = e.length, n = new i(), r = () => {
|
|
126
|
+
--t === 0 && n.emit(`end`);
|
|
127
|
+
};
|
|
128
|
+
for (let t of e) t.pipe(n, { end: !1 }), t.on(`end`, r);
|
|
129
|
+
return n;
|
|
130
|
+
};
|
|
131
|
+
var j = w(((e, t) => {
|
|
132
|
+
t.exports = a, a.sync = o;
|
|
133
|
+
var n = T(`fs`);
|
|
134
|
+
function r(e, t) {
|
|
135
|
+
var n = t.pathExt === void 0 ? process.env.PATHEXT : t.pathExt;
|
|
136
|
+
if (!n || (n = n.split(`;`), n.indexOf(``) !== -1)) return !0;
|
|
137
|
+
for (var r = 0; r < n.length; r++) {
|
|
138
|
+
var i = n[r].toLowerCase();
|
|
139
|
+
if (i && e.substr(-i.length).toLowerCase() === i) return !0;
|
|
140
|
+
}
|
|
141
|
+
return !1;
|
|
142
|
+
}
|
|
143
|
+
function i(e, t, n) {
|
|
144
|
+
return !e.isSymbolicLink() && !e.isFile() ? !1 : r(t, n);
|
|
145
|
+
}
|
|
146
|
+
function a(e, t, r) {
|
|
147
|
+
n.stat(e, function(n, a) {
|
|
148
|
+
r(n, n ? !1 : i(a, e, t));
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function o(e, t) {
|
|
152
|
+
return i(n.statSync(e), e, t);
|
|
153
|
+
}
|
|
154
|
+
})), M = w(((e, t) => {
|
|
155
|
+
t.exports = r, r.sync = i;
|
|
156
|
+
var n = T(`fs`);
|
|
157
|
+
function r(e, t, r) {
|
|
158
|
+
n.stat(e, function(e, n) {
|
|
159
|
+
r(e, e ? !1 : a(n, t));
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
function i(e, t) {
|
|
163
|
+
return a(n.statSync(e), t);
|
|
164
|
+
}
|
|
165
|
+
function a(e, t) {
|
|
166
|
+
return e.isFile() && o(e, t);
|
|
167
|
+
}
|
|
168
|
+
function o(e, t) {
|
|
169
|
+
var n = e.mode, r = e.uid, i = e.gid, a = t.uid === void 0 ? process.getuid && process.getuid() : t.uid, o = t.gid === void 0 ? process.getgid && process.getgid() : t.gid, s = 64, c = 8, l = 1, u = s | c;
|
|
170
|
+
return n & l || n & c && i === o || n & s && r === a || n & u && a === 0;
|
|
171
|
+
}
|
|
172
|
+
})), N = w(((e, t) => {
|
|
173
|
+
T(`fs`);
|
|
174
|
+
var n = process.platform === `win32` || global.TESTING_WINDOWS ? j() : M();
|
|
175
|
+
t.exports = r, r.sync = i;
|
|
176
|
+
function r(e, t, i) {
|
|
177
|
+
if (typeof t == `function` && (i = t, t = {}), !i) {
|
|
178
|
+
if (typeof Promise != `function`) throw TypeError(`callback not provided`);
|
|
179
|
+
return new Promise(function(n, i) {
|
|
180
|
+
r(e, t || {}, function(e, t) {
|
|
181
|
+
e ? i(e) : n(t);
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
n(e, t || {}, function(e, n) {
|
|
186
|
+
e && (e.code === `EACCES` || t && t.ignoreErrors) && (e = null, n = !1), i(e, n);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function i(e, t) {
|
|
190
|
+
try {
|
|
191
|
+
return n.sync(e, t || {});
|
|
192
|
+
} catch (e) {
|
|
193
|
+
if (t && t.ignoreErrors || e.code === `EACCES`) return !1;
|
|
194
|
+
throw e;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
})), P = w(((e, t) => {
|
|
198
|
+
let n = process.platform === `win32` || process.env.OSTYPE === `cygwin` || process.env.OSTYPE === `msys`, r = T(`path`), i = n ? `;` : `:`, a = N(), o = (e) => Object.assign(Error(`not found: ${e}`), { code: `ENOENT` }), s = (e, t) => {
|
|
199
|
+
let r = t.colon || i, a = e.match(/\//) || n && e.match(/\\/) ? [``] : [...n ? [process.cwd()] : [], ...(t.path || process.env.PATH || ``).split(r)], o = n ? t.pathExt || process.env.PATHEXT || `.EXE;.CMD;.BAT;.COM` : ``, s = n ? o.split(r) : [``];
|
|
200
|
+
return n && e.indexOf(`.`) !== -1 && s[0] !== `` && s.unshift(``), {
|
|
201
|
+
pathEnv: a,
|
|
202
|
+
pathExt: s,
|
|
203
|
+
pathExtExe: o
|
|
204
|
+
};
|
|
205
|
+
}, c = (e, t, n) => {
|
|
206
|
+
typeof t == `function` && (n = t, t = {}), t ||= {};
|
|
207
|
+
let { pathEnv: i, pathExt: c, pathExtExe: l } = s(e, t), u = [], d = (n) => new Promise((a, s) => {
|
|
208
|
+
if (n === i.length) return t.all && u.length ? a(u) : s(o(e));
|
|
209
|
+
let c = i[n], l = /^".*"$/.test(c) ? c.slice(1, -1) : c, d = r.join(l, e);
|
|
210
|
+
a(f(!l && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d, n, 0));
|
|
211
|
+
}), f = (e, n, r) => new Promise((i, o) => {
|
|
212
|
+
if (r === c.length) return i(d(n + 1));
|
|
213
|
+
let s = c[r];
|
|
214
|
+
a(e + s, { pathExt: l }, (a, o) => {
|
|
215
|
+
if (!a && o) if (t.all) u.push(e + s);
|
|
216
|
+
else return i(e + s);
|
|
217
|
+
return i(f(e, n, r + 1));
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
return n ? d(0).then((e) => n(null, e), n) : d(0);
|
|
221
|
+
};
|
|
222
|
+
t.exports = c, c.sync = (e, t) => {
|
|
223
|
+
t ||= {};
|
|
224
|
+
let { pathEnv: n, pathExt: i, pathExtExe: c } = s(e, t), l = [];
|
|
225
|
+
for (let o = 0; o < n.length; o++) {
|
|
226
|
+
let s = n[o], u = /^".*"$/.test(s) ? s.slice(1, -1) : s, d = r.join(u, e), f = !u && /^\.[\\\/]/.test(e) ? e.slice(0, 2) + d : d;
|
|
227
|
+
for (let e = 0; e < i.length; e++) {
|
|
228
|
+
let n = f + i[e];
|
|
229
|
+
try {
|
|
230
|
+
if (a.sync(n, { pathExt: c })) if (t.all) l.push(n);
|
|
231
|
+
else return n;
|
|
232
|
+
} catch {}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (t.all && l.length) return l;
|
|
236
|
+
if (t.nothrow) return null;
|
|
237
|
+
throw o(e);
|
|
238
|
+
};
|
|
239
|
+
})), F = w(((e, t) => {
|
|
240
|
+
let n = (e = {}) => {
|
|
241
|
+
let t = e.env || process.env;
|
|
242
|
+
return (e.platform || process.platform) === `win32` ? Object.keys(t).reverse().find((e) => e.toUpperCase() === `PATH`) || `Path` : `PATH`;
|
|
243
|
+
};
|
|
244
|
+
t.exports = n, t.exports.default = n;
|
|
245
|
+
})), I = w(((e, t) => {
|
|
246
|
+
let n = T(`path`), r = P(), i = F();
|
|
247
|
+
function a(e, t) {
|
|
248
|
+
let a = e.options.env || process.env, o = process.cwd(), s = e.options.cwd != null, c = s && process.chdir !== void 0 && !process.chdir.disabled;
|
|
249
|
+
if (c) try {
|
|
250
|
+
process.chdir(e.options.cwd);
|
|
251
|
+
} catch {}
|
|
252
|
+
let l;
|
|
253
|
+
try {
|
|
254
|
+
l = r.sync(e.command, {
|
|
255
|
+
path: a[i({ env: a })],
|
|
256
|
+
pathExt: t ? n.delimiter : void 0
|
|
257
|
+
});
|
|
258
|
+
} catch {} finally {
|
|
259
|
+
c && process.chdir(o);
|
|
260
|
+
}
|
|
261
|
+
return l &&= n.resolve(s ? e.options.cwd : ``, l), l;
|
|
262
|
+
}
|
|
263
|
+
function o(e) {
|
|
264
|
+
return a(e) || a(e, !0);
|
|
265
|
+
}
|
|
266
|
+
t.exports = o;
|
|
267
|
+
})), L = w(((e, t) => {
|
|
268
|
+
let n = /([()\][%!^"`<>&|;, *?])/g;
|
|
269
|
+
function r(e) {
|
|
270
|
+
return e = e.replace(n, `^$1`), e;
|
|
271
|
+
}
|
|
272
|
+
function i(e, t) {
|
|
273
|
+
return e = `${e}`, e = e.replace(/(?=(\\+?)?)\1"/g, `$1$1\\"`), e = e.replace(/(?=(\\+?)?)\1$/, `$1$1`), e = `"${e}"`, e = e.replace(n, `^$1`), t && (e = e.replace(n, `^$1`)), e;
|
|
274
|
+
}
|
|
275
|
+
t.exports.command = r, t.exports.argument = i;
|
|
276
|
+
})), R = w(((e, t) => {
|
|
277
|
+
t.exports = /^#!(.*)/;
|
|
278
|
+
})), z = w(((e, t) => {
|
|
279
|
+
let n = R();
|
|
280
|
+
t.exports = (e = ``) => {
|
|
281
|
+
let t = e.match(n);
|
|
282
|
+
if (!t) return null;
|
|
283
|
+
let [r, i] = t[0].replace(/#! ?/, ``).split(` `), a = r.split(`/`).pop();
|
|
284
|
+
return a === `env` ? i : i ? `${a} ${i}` : a;
|
|
285
|
+
};
|
|
286
|
+
})), B = w(((e, t) => {
|
|
287
|
+
let n = T(`fs`), r = z();
|
|
288
|
+
function i(e) {
|
|
289
|
+
let t = Buffer.alloc(150), i;
|
|
290
|
+
try {
|
|
291
|
+
i = n.openSync(e, `r`), n.readSync(i, t, 0, 150, 0), n.closeSync(i);
|
|
292
|
+
} catch {}
|
|
293
|
+
return r(t.toString());
|
|
294
|
+
}
|
|
295
|
+
t.exports = i;
|
|
296
|
+
})), V = w(((e, t) => {
|
|
297
|
+
let n = T(`path`), r = I(), i = L(), a = B(), o = process.platform === `win32`, s = /\.(?:com|exe)$/i, c = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
|
|
298
|
+
function l(e) {
|
|
299
|
+
e.file = r(e);
|
|
300
|
+
let t = e.file && a(e.file);
|
|
301
|
+
return t ? (e.args.unshift(e.file), e.command = t, r(e)) : e.file;
|
|
302
|
+
}
|
|
303
|
+
function u(e) {
|
|
304
|
+
if (!o) return e;
|
|
305
|
+
let t = l(e), r = !s.test(t);
|
|
306
|
+
if (e.options.forceShell || r) {
|
|
307
|
+
let r = c.test(t);
|
|
308
|
+
e.command = n.normalize(e.command), e.command = i.command(e.command), e.args = e.args.map((e) => i.argument(e, r)), e.args = [
|
|
309
|
+
`/d`,
|
|
310
|
+
`/s`,
|
|
311
|
+
`/c`,
|
|
312
|
+
`"${[e.command].concat(e.args).join(` `)}"`
|
|
313
|
+
], e.command = process.env.comspec || `cmd.exe`, e.options.windowsVerbatimArguments = !0;
|
|
314
|
+
}
|
|
315
|
+
return e;
|
|
316
|
+
}
|
|
317
|
+
function d(e, t, n) {
|
|
318
|
+
t && !Array.isArray(t) && (n = t, t = null), t = t ? t.slice(0) : [], n = Object.assign({}, n);
|
|
319
|
+
let r = {
|
|
320
|
+
command: e,
|
|
321
|
+
args: t,
|
|
322
|
+
options: n,
|
|
323
|
+
file: void 0,
|
|
324
|
+
original: {
|
|
325
|
+
command: e,
|
|
326
|
+
args: t
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
return n.shell ? r : u(r);
|
|
330
|
+
}
|
|
331
|
+
t.exports = d;
|
|
332
|
+
})), ie = w(((e, t) => {
|
|
333
|
+
let n = process.platform === `win32`;
|
|
334
|
+
function r(e, t) {
|
|
335
|
+
return Object.assign(Error(`${t} ${e.command} ENOENT`), {
|
|
336
|
+
code: `ENOENT`,
|
|
337
|
+
errno: `ENOENT`,
|
|
338
|
+
syscall: `${t} ${e.command}`,
|
|
339
|
+
path: e.command,
|
|
340
|
+
spawnargs: e.args
|
|
341
|
+
});
|
|
342
|
+
}
|
|
343
|
+
function i(e, t) {
|
|
344
|
+
if (!n) return;
|
|
345
|
+
let r = e.emit;
|
|
346
|
+
e.emit = function(n, i) {
|
|
347
|
+
if (n === `exit`) {
|
|
348
|
+
let n = a(i, t);
|
|
349
|
+
if (n) return r.call(e, `error`, n);
|
|
350
|
+
}
|
|
351
|
+
return r.apply(e, arguments);
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
function a(e, t) {
|
|
355
|
+
return n && e === 1 && !t.file ? r(t.original, `spawn`) : null;
|
|
356
|
+
}
|
|
357
|
+
function o(e, t) {
|
|
358
|
+
return n && e === 1 && !t.file ? r(t.original, `spawnSync`) : null;
|
|
359
|
+
}
|
|
360
|
+
t.exports = {
|
|
361
|
+
hookChildProcess: i,
|
|
362
|
+
verifyENOENT: a,
|
|
363
|
+
verifyENOENTSync: o,
|
|
364
|
+
notFoundError: r
|
|
365
|
+
};
|
|
366
|
+
})), H = w(((e, t) => {
|
|
367
|
+
let n = T(`child_process`), r = V(), i = ie();
|
|
368
|
+
function a(e, t, a) {
|
|
369
|
+
let o = r(e, t, a), s = n.spawn(o.command, o.args, o.options);
|
|
370
|
+
return i.hookChildProcess(s, o), s;
|
|
371
|
+
}
|
|
372
|
+
function o(e, t, a) {
|
|
373
|
+
let o = r(e, t, a), s = n.spawnSync(o.command, o.args, o.options);
|
|
374
|
+
return s.error = s.error || i.verifyENOENTSync(s.status, o), s;
|
|
375
|
+
}
|
|
376
|
+
t.exports = a, t.exports.spawn = a, t.exports.sync = o, t.exports._parse = r, t.exports._enoent = i;
|
|
377
|
+
}))(), U = class extends Error {
|
|
378
|
+
result;
|
|
379
|
+
output;
|
|
380
|
+
get exitCode() {
|
|
381
|
+
if (this.result.exitCode !== null) return this.result.exitCode;
|
|
382
|
+
}
|
|
383
|
+
constructor(e, t) {
|
|
384
|
+
super(`Process exited with non-zero status (${e.exitCode})`), this.result = e, this.output = t;
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
const W = {
|
|
388
|
+
timeout: void 0,
|
|
389
|
+
persist: !1
|
|
390
|
+
}, G = { windowsHide: !0 };
|
|
391
|
+
function K(e, t) {
|
|
392
|
+
return {
|
|
393
|
+
command: c(e),
|
|
394
|
+
args: t ?? []
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
function q(e) {
|
|
398
|
+
let t = new AbortController();
|
|
399
|
+
for (let n of e) {
|
|
400
|
+
if (n.aborted) return t.abort(), n;
|
|
401
|
+
n.addEventListener(`abort`, () => {
|
|
402
|
+
t.abort(n.reason);
|
|
403
|
+
}, { signal: t.signal });
|
|
404
|
+
}
|
|
405
|
+
return t.signal;
|
|
406
|
+
}
|
|
407
|
+
async function J(e) {
|
|
408
|
+
let t = ``;
|
|
409
|
+
for await (let n of e) t += n.toString();
|
|
410
|
+
return t;
|
|
411
|
+
}
|
|
412
|
+
var Y = class {
|
|
413
|
+
_process;
|
|
414
|
+
_aborted = !1;
|
|
415
|
+
_options;
|
|
416
|
+
_command;
|
|
417
|
+
_args;
|
|
418
|
+
_resolveClose;
|
|
419
|
+
_processClosed;
|
|
420
|
+
_thrownError;
|
|
421
|
+
get process() {
|
|
422
|
+
return this._process;
|
|
423
|
+
}
|
|
424
|
+
get pid() {
|
|
425
|
+
return this._process?.pid;
|
|
426
|
+
}
|
|
427
|
+
get exitCode() {
|
|
428
|
+
if (this._process && this._process.exitCode !== null) return this._process.exitCode;
|
|
429
|
+
}
|
|
430
|
+
constructor(e, t, n) {
|
|
431
|
+
this._options = {
|
|
432
|
+
...W,
|
|
433
|
+
...n
|
|
434
|
+
}, this._command = e, this._args = t ?? [], this._processClosed = new Promise((e) => {
|
|
435
|
+
this._resolveClose = e;
|
|
436
|
+
});
|
|
437
|
+
}
|
|
438
|
+
kill(e) {
|
|
439
|
+
return this._process?.kill(e) === !0;
|
|
440
|
+
}
|
|
441
|
+
get aborted() {
|
|
442
|
+
return this._aborted;
|
|
443
|
+
}
|
|
444
|
+
get killed() {
|
|
445
|
+
return this._process?.killed === !0;
|
|
446
|
+
}
|
|
447
|
+
pipe(e, t, n) {
|
|
448
|
+
return ae(e, t, {
|
|
449
|
+
...n,
|
|
450
|
+
stdin: this
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
async *[Symbol.asyncIterator]() {
|
|
454
|
+
let e = this._process;
|
|
455
|
+
if (!e) return;
|
|
456
|
+
let t = [];
|
|
457
|
+
this._streamErr && t.push(this._streamErr), this._streamOut && t.push(this._streamOut);
|
|
458
|
+
let n = A(t), r = d.createInterface({ input: n });
|
|
459
|
+
for await (let e of r) yield e.toString();
|
|
460
|
+
if (await this._processClosed, e.removeAllListeners(), this._thrownError) throw this._thrownError;
|
|
461
|
+
if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new U(this);
|
|
462
|
+
}
|
|
463
|
+
async _waitForOutput() {
|
|
464
|
+
let e = this._process;
|
|
465
|
+
if (!e) throw Error(`No process was started`);
|
|
466
|
+
let [t, n] = await Promise.all([this._streamOut ? J(this._streamOut) : ``, this._streamErr ? J(this._streamErr) : ``]);
|
|
467
|
+
if (await this._processClosed, this._options?.stdin && await this._options.stdin, e.removeAllListeners(), this._thrownError) throw this._thrownError;
|
|
468
|
+
let r = {
|
|
469
|
+
stderr: n,
|
|
470
|
+
stdout: t,
|
|
471
|
+
exitCode: this.exitCode
|
|
472
|
+
};
|
|
473
|
+
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new U(this, r);
|
|
474
|
+
return r;
|
|
475
|
+
}
|
|
476
|
+
then(e, t) {
|
|
477
|
+
return this._waitForOutput().then(e, t);
|
|
478
|
+
}
|
|
479
|
+
_streamOut;
|
|
480
|
+
_streamErr;
|
|
481
|
+
spawn() {
|
|
482
|
+
let e = u(), t = this._options, n = {
|
|
483
|
+
...G,
|
|
484
|
+
...t.nodeOptions
|
|
485
|
+
}, r = [];
|
|
486
|
+
this._resetState(), t.timeout !== void 0 && r.push(AbortSignal.timeout(t.timeout)), t.signal !== void 0 && r.push(t.signal), t.persist === !0 && (n.detached = !0), r.length > 0 && (n.signal = q(r)), n.env = k(e, n.env);
|
|
487
|
+
let { command: i, args: o } = K(this._command, this._args), s = (0, H._parse)(i, o, n), c = a(s.command, s.args, s.options);
|
|
488
|
+
if (c.stderr && (this._streamErr = c.stderr), c.stdout && (this._streamOut = c.stdout), this._process = c, c.once(`error`, this._onError), c.once(`close`, this._onClose), t.stdin !== void 0 && c.stdin && t.stdin.process) {
|
|
489
|
+
let { stdout: e } = t.stdin.process;
|
|
490
|
+
e && e.pipe(c.stdin);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
_resetState() {
|
|
494
|
+
this._aborted = !1, this._processClosed = new Promise((e) => {
|
|
495
|
+
this._resolveClose = e;
|
|
496
|
+
}), this._thrownError = void 0;
|
|
497
|
+
}
|
|
498
|
+
_onError = (e) => {
|
|
499
|
+
if (e.name === `AbortError` && (!(e.cause instanceof Error) || e.cause.name !== `TimeoutError`)) {
|
|
500
|
+
this._aborted = !0;
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
this._thrownError = e;
|
|
504
|
+
};
|
|
505
|
+
_onClose = () => {
|
|
506
|
+
this._resolveClose && this._resolveClose();
|
|
507
|
+
};
|
|
508
|
+
};
|
|
509
|
+
const X = (e, t, n) => {
|
|
510
|
+
let r = new Y(e, t, n);
|
|
511
|
+
return r.spawn(), r;
|
|
512
|
+
}, ae = X;
|
|
513
|
+
var oe = e({
|
|
514
|
+
detectPackageManager: () => $,
|
|
515
|
+
installDependencies: () => fe,
|
|
516
|
+
packageManagers: () => Q
|
|
517
|
+
});
|
|
518
|
+
async function se(e, t, n = {}) {
|
|
519
|
+
let r = g(e).split(`/`);
|
|
520
|
+
for (; r.length > 0;) {
|
|
521
|
+
let e = await t(r.join(`/`) || `/`);
|
|
522
|
+
if (e || !n.includeParentDirs) return e;
|
|
523
|
+
r.pop();
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
function ce(e) {
|
|
527
|
+
let t;
|
|
528
|
+
return () => (t === void 0 && (t = e().then((e) => (t = e, t))), t);
|
|
529
|
+
}
|
|
530
|
+
const Z = ce(async () => {
|
|
531
|
+
if (globalThis.process?.versions?.webcontainer) return !1;
|
|
532
|
+
try {
|
|
533
|
+
let { exitCode: e } = await X(`corepack`, [`--version`]);
|
|
534
|
+
return e === 0;
|
|
535
|
+
} catch {
|
|
536
|
+
return !1;
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
async function le(e, t, n = {}) {
|
|
540
|
+
let r = e !== `npm` && e !== `bun` && e !== `deno` && n.corepack !== !1 && await Z() ? [`corepack`, [e, ...t]] : [e, t], { exitCode: i, stdout: a, stderr: o } = await X(r[0], r[1], { nodeOptions: {
|
|
541
|
+
cwd: y(n.cwd || process.cwd()),
|
|
542
|
+
env: n.env,
|
|
543
|
+
stdio: n.silent ? `pipe` : `inherit`
|
|
544
|
+
} });
|
|
545
|
+
if (i !== 0) throw Error(`\`${r.flat().join(` `)}\` failed.${n.silent ? [
|
|
546
|
+
``,
|
|
547
|
+
a,
|
|
548
|
+
o
|
|
549
|
+
].join(`
|
|
550
|
+
`) : ``}`);
|
|
551
|
+
}
|
|
552
|
+
async function ue(e = {}) {
|
|
553
|
+
let t = e.cwd || process.cwd(), n = {
|
|
554
|
+
...process.env,
|
|
555
|
+
...e.env
|
|
556
|
+
}, r = (typeof e.packageManager == `string` ? Q.find((t) => t.name === e.packageManager) : e.packageManager) || await $(e.cwd || process.cwd());
|
|
557
|
+
if (!r) throw Error(`No package manager auto-detected.`);
|
|
558
|
+
return {
|
|
559
|
+
cwd: t,
|
|
560
|
+
env: n,
|
|
561
|
+
silent: e.silent ?? !1,
|
|
562
|
+
packageManager: r,
|
|
563
|
+
dev: e.dev ?? !1,
|
|
564
|
+
workspace: e.workspace,
|
|
565
|
+
global: e.global ?? !1,
|
|
566
|
+
dry: e.dry ?? !1,
|
|
567
|
+
corepack: e.corepack ?? !0
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
function de(e) {
|
|
571
|
+
let [t, n] = (e || ``).split(`@`), [r, i] = n?.split(`+`) || [];
|
|
572
|
+
if (t && t !== `-` && /^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(t)) return {
|
|
573
|
+
name: t,
|
|
574
|
+
version: r,
|
|
575
|
+
buildMeta: i
|
|
576
|
+
};
|
|
577
|
+
let a = (t || ``).replace(/\W+/g, ``);
|
|
578
|
+
return {
|
|
579
|
+
name: a,
|
|
580
|
+
version: r,
|
|
581
|
+
buildMeta: i,
|
|
582
|
+
warnings: [`Abnormal characters found in \`packageManager\` field, sanitizing from \`${t}\` to \`${a}\``]
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
const Q = [
|
|
586
|
+
{
|
|
587
|
+
name: `npm`,
|
|
588
|
+
command: `npm`,
|
|
589
|
+
lockFile: `package-lock.json`
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
name: `pnpm`,
|
|
593
|
+
command: `pnpm`,
|
|
594
|
+
lockFile: `pnpm-lock.yaml`,
|
|
595
|
+
files: [`pnpm-workspace.yaml`]
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
name: `bun`,
|
|
599
|
+
command: `bun`,
|
|
600
|
+
lockFile: [`bun.lockb`, `bun.lock`]
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
name: `yarn`,
|
|
604
|
+
command: `yarn`,
|
|
605
|
+
lockFile: `yarn.lock`,
|
|
606
|
+
files: [`.yarnrc.yml`]
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
name: `deno`,
|
|
610
|
+
command: `deno`,
|
|
611
|
+
lockFile: `deno.lock`,
|
|
612
|
+
files: [`deno.json`]
|
|
613
|
+
}
|
|
614
|
+
];
|
|
615
|
+
async function $(e, t = {}) {
|
|
616
|
+
let i = await se(y(e || `.`), async (e) => {
|
|
617
|
+
if (!t.ignorePackageJSON) {
|
|
618
|
+
let t = _(e, `package.json`);
|
|
619
|
+
if (n(t)) {
|
|
620
|
+
let e = JSON.parse(await r(t, `utf8`));
|
|
621
|
+
if (e?.packageManager) {
|
|
622
|
+
let { name: t, version: n = `0.0.0`, buildMeta: r, warnings: i } = de(e.packageManager);
|
|
623
|
+
if (t) {
|
|
624
|
+
let e = n.split(`.`)[0], a = Q.find((n) => n.name === t && n.majorVersion === e) || Q.find((e) => e.name === t);
|
|
625
|
+
return {
|
|
626
|
+
name: t,
|
|
627
|
+
command: t,
|
|
628
|
+
version: n,
|
|
629
|
+
majorVersion: e,
|
|
630
|
+
buildMeta: r,
|
|
631
|
+
warnings: i,
|
|
632
|
+
files: a?.files,
|
|
633
|
+
lockFile: a?.lockFile
|
|
634
|
+
};
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
if (n(_(e, `deno.json`))) return Q.find((e) => e.name === `deno`);
|
|
639
|
+
}
|
|
640
|
+
if (!t.ignoreLockFile) {
|
|
641
|
+
for (let t of Q) if ([t.lockFile, t.files].flat().filter(Boolean).some((t) => n(y(e, t)))) return { ...t };
|
|
642
|
+
}
|
|
643
|
+
}, { includeParentDirs: t.includeParentDirs ?? !0 });
|
|
644
|
+
if (!i && !t.ignoreArgv) {
|
|
645
|
+
let e = process.argv[1];
|
|
646
|
+
if (e) {
|
|
647
|
+
for (let t of Q) if (RegExp(`[/\\\\]\\.?${t.command}`).test(e)) return t;
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
return i;
|
|
651
|
+
}
|
|
652
|
+
async function fe(e = {}) {
|
|
653
|
+
let t = await ue(e), n = e.frozenLockFile ? {
|
|
654
|
+
npm: [`ci`],
|
|
655
|
+
yarn: [`install`, `--immutable`],
|
|
656
|
+
bun: [`install`, `--frozen-lockfile`],
|
|
657
|
+
pnpm: [`install`, `--frozen-lockfile`],
|
|
658
|
+
deno: [`install`, `--frozen`]
|
|
659
|
+
}[t.packageManager.name] : [`install`];
|
|
660
|
+
return e.ignoreWorkspace && t.packageManager.name === `pnpm` && n.push(`--ignore-workspace`), t.dry || await le(t.packageManager.command, n, {
|
|
661
|
+
cwd: t.cwd,
|
|
662
|
+
silent: t.silent,
|
|
663
|
+
corepack: t.corepack
|
|
664
|
+
}), { exec: {
|
|
665
|
+
command: t.packageManager.command,
|
|
666
|
+
args: n
|
|
667
|
+
} };
|
|
668
|
+
}
|
|
669
|
+
export { y as a, S as i, ne as n, C as r, oe as t };
|