@maizzle/framework 6.0.0-9 → 6.0.0-rc.0
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 +10 -0
- package/dist/build.d.mts +19 -0
- package/dist/build.d.mts.map +1 -0
- package/dist/build.mjs +121 -0
- package/dist/build.mjs.map +1 -0
- package/dist/components/Button.vue +141 -0
- package/dist/components/Divider.vue +105 -0
- package/dist/components/NoWidows.vue +123 -0
- package/dist/components/NotOutlook.vue +17 -0
- package/dist/components/Outlook.vue +74 -0
- package/dist/components/Spacer.vue +36 -0
- package/dist/components/Vml.vue +89 -0
- package/dist/components/WithUrl.vue +190 -0
- package/dist/components/utils.d.mts +5 -0
- package/dist/components/utils.d.mts.map +1 -0
- package/dist/components/utils.mjs +9 -0
- package/dist/components/utils.mjs.map +1 -0
- package/dist/components/utils.ts +6 -0
- package/dist/composables/defineConfig.d.mts +14 -0
- package/dist/composables/defineConfig.d.mts.map +1 -0
- package/dist/composables/defineConfig.mjs +34 -0
- package/dist/composables/defineConfig.mjs.map +1 -0
- package/dist/composables/renderContext.d.mts +19 -0
- package/dist/composables/renderContext.d.mts.map +1 -0
- package/dist/composables/renderContext.mjs +6 -0
- package/dist/composables/renderContext.mjs.map +1 -0
- package/dist/composables/useConfig.d.mts +9 -0
- package/dist/composables/useConfig.d.mts.map +1 -0
- package/dist/composables/useConfig.mjs +13 -0
- package/dist/composables/useConfig.mjs.map +1 -0
- package/dist/composables/useDoctype.d.mts +13 -0
- package/dist/composables/useDoctype.d.mts.map +1 -0
- package/dist/composables/useDoctype.mjs +20 -0
- package/dist/composables/useDoctype.mjs.map +1 -0
- package/dist/composables/useEvent.d.mts +17 -0
- package/dist/composables/useEvent.d.mts.map +1 -0
- package/dist/composables/useEvent.mjs +25 -0
- package/dist/composables/useEvent.mjs.map +1 -0
- package/dist/composables/usePlaintext.d.mts +19 -0
- package/dist/composables/usePlaintext.d.mts.map +1 -0
- package/dist/composables/usePlaintext.mjs +22 -0
- package/dist/composables/usePlaintext.mjs.map +1 -0
- package/dist/config/defaults.d.mts +6 -0
- package/dist/config/defaults.d.mts.map +1 -0
- package/dist/config/defaults.mjs +28 -0
- package/dist/config/defaults.mjs.map +1 -0
- package/dist/config/index.d.mts +15 -0
- package/dist/config/index.d.mts.map +1 -0
- package/dist/config/index.mjs +47 -0
- package/dist/config/index.mjs.map +1 -0
- package/dist/events/index.d.mts +91 -0
- package/dist/events/index.d.mts.map +1 -0
- package/dist/events/index.mjs +110 -0
- package/dist/events/index.mjs.map +1 -0
- package/dist/index.d.mts +29 -0
- package/dist/index.mjs +29 -0
- package/dist/plaintext.d.mts +5 -0
- package/dist/plaintext.d.mts.map +1 -0
- package/dist/plaintext.mjs +15 -0
- package/dist/plaintext.mjs.map +1 -0
- package/dist/plugin.d.mts +17 -0
- package/dist/plugin.d.mts.map +1 -0
- package/dist/plugin.mjs +41 -0
- package/dist/plugin.mjs.map +1 -0
- package/dist/plugins/postcss/mergeMediaQueries.d.mts +18 -0
- package/dist/plugins/postcss/mergeMediaQueries.d.mts.map +1 -0
- package/dist/plugins/postcss/mergeMediaQueries.mjs +22 -0
- package/dist/plugins/postcss/mergeMediaQueries.mjs.map +1 -0
- package/dist/plugins/postcss/pruneVars.d.mts +8 -0
- package/dist/plugins/postcss/pruneVars.d.mts.map +1 -0
- package/dist/plugins/postcss/pruneVars.mjs +49 -0
- package/dist/plugins/postcss/pruneVars.mjs.map +1 -0
- package/dist/plugins/postcss/removeDeclarations.d.mts +12 -0
- package/dist/plugins/postcss/removeDeclarations.d.mts.map +1 -0
- package/dist/plugins/postcss/removeDeclarations.mjs +45 -0
- package/dist/plugins/postcss/removeDeclarations.mjs.map +1 -0
- package/dist/plugins/postcss/tailwindCleanup.d.mts +18 -0
- package/dist/plugins/postcss/tailwindCleanup.d.mts.map +1 -0
- package/dist/plugins/postcss/tailwindCleanup.mjs +35 -0
- package/dist/plugins/postcss/tailwindCleanup.mjs.map +1 -0
- package/dist/render/createRenderer.d.mts +34 -0
- package/dist/render/createRenderer.d.mts.map +1 -0
- package/dist/render/createRenderer.mjs +149 -0
- package/dist/render/createRenderer.mjs.map +1 -0
- package/dist/render/index.d.mts +26 -0
- package/dist/render/index.d.mts.map +1 -0
- package/dist/render/index.mjs +40 -0
- package/dist/render/index.mjs.map +1 -0
- package/dist/serve.d.mts +25 -0
- package/dist/serve.d.mts.map +1 -0
- package/dist/serve.mjs +402 -0
- package/dist/serve.mjs.map +1 -0
- package/dist/server/compatibility.d.mts +6 -0
- package/dist/server/compatibility.d.mts.map +1 -0
- package/dist/server/compatibility.mjs +83 -0
- package/dist/server/compatibility.mjs.map +1 -0
- package/dist/server/linter.d.mts +6 -0
- package/dist/server/linter.d.mts.map +1 -0
- package/dist/server/linter.mjs +200 -0
- package/dist/server/linter.mjs.map +1 -0
- package/dist/server/ui/App.vue +360 -0
- package/dist/server/ui/components/ui/button/Button.vue +31 -0
- package/dist/server/ui/components/ui/button/index.ts +38 -0
- package/dist/server/ui/components/ui/command/Command.vue +87 -0
- package/dist/server/ui/components/ui/command/CommandDialog.vue +31 -0
- package/dist/server/ui/components/ui/command/CommandEmpty.vue +27 -0
- package/dist/server/ui/components/ui/command/CommandGroup.vue +45 -0
- package/dist/server/ui/components/ui/command/CommandInput.vue +39 -0
- package/dist/server/ui/components/ui/command/CommandItem.vue +76 -0
- package/dist/server/ui/components/ui/command/CommandList.vue +25 -0
- package/dist/server/ui/components/ui/command/CommandSeparator.vue +21 -0
- package/dist/server/ui/components/ui/command/CommandShortcut.vue +17 -0
- package/dist/server/ui/components/ui/command/index.ts +25 -0
- package/dist/server/ui/components/ui/dialog/Dialog.vue +19 -0
- package/dist/server/ui/components/ui/dialog/DialogClose.vue +15 -0
- package/dist/server/ui/components/ui/dialog/DialogContent.vue +53 -0
- package/dist/server/ui/components/ui/dialog/DialogDescription.vue +23 -0
- package/dist/server/ui/components/ui/dialog/DialogFooter.vue +27 -0
- package/dist/server/ui/components/ui/dialog/DialogHeader.vue +17 -0
- package/dist/server/ui/components/ui/dialog/DialogOverlay.vue +21 -0
- package/dist/server/ui/components/ui/dialog/DialogScrollContent.vue +59 -0
- package/dist/server/ui/components/ui/dialog/DialogTitle.vue +23 -0
- package/dist/server/ui/components/ui/dialog/DialogTrigger.vue +15 -0
- package/dist/server/ui/components/ui/dialog/index.ts +10 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenu.vue +19 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuCheckboxItem.vue +39 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuContent.vue +39 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuGroup.vue +15 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuItem.vue +31 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuLabel.vue +23 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +21 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +40 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSeparator.vue +23 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuShortcut.vue +17 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSub.vue +18 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSubContent.vue +27 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuSubTrigger.vue +31 -0
- package/dist/server/ui/components/ui/dropdown-menu/DropdownMenuTrigger.vue +17 -0
- package/dist/server/ui/components/ui/dropdown-menu/index.ts +16 -0
- package/dist/server/ui/components/ui/empty/Empty.vue +20 -0
- package/dist/server/ui/components/ui/empty/EmptyContent.vue +20 -0
- package/dist/server/ui/components/ui/empty/EmptyDescription.vue +20 -0
- package/dist/server/ui/components/ui/empty/EmptyHeader.vue +20 -0
- package/dist/server/ui/components/ui/empty/EmptyMedia.vue +21 -0
- package/dist/server/ui/components/ui/empty/EmptyTitle.vue +17 -0
- package/dist/server/ui/components/ui/empty/index.ts +26 -0
- package/dist/server/ui/components/ui/input/Input.vue +33 -0
- package/dist/server/ui/components/ui/input/index.ts +1 -0
- package/dist/server/ui/components/ui/kbd/Kbd.vue +20 -0
- package/dist/server/ui/components/ui/kbd/KbdGroup.vue +17 -0
- package/dist/server/ui/components/ui/kbd/index.ts +2 -0
- package/dist/server/ui/components/ui/resizable/ResizableHandle.vue +30 -0
- package/dist/server/ui/components/ui/resizable/ResizablePanel.vue +21 -0
- package/dist/server/ui/components/ui/resizable/ResizablePanelGroup.vue +25 -0
- package/dist/server/ui/components/ui/resizable/index.ts +3 -0
- package/dist/server/ui/components/ui/scroll-area/ScrollArea.vue +33 -0
- package/dist/server/ui/components/ui/scroll-area/ScrollBar.vue +32 -0
- package/dist/server/ui/components/ui/scroll-area/index.ts +2 -0
- package/dist/server/ui/components/ui/separator/Separator.vue +29 -0
- package/dist/server/ui/components/ui/separator/index.ts +1 -0
- package/dist/server/ui/components/ui/sheet/Sheet.vue +19 -0
- package/dist/server/ui/components/ui/sheet/SheetClose.vue +15 -0
- package/dist/server/ui/components/ui/sheet/SheetContent.vue +62 -0
- package/dist/server/ui/components/ui/sheet/SheetDescription.vue +21 -0
- package/dist/server/ui/components/ui/sheet/SheetFooter.vue +16 -0
- package/dist/server/ui/components/ui/sheet/SheetHeader.vue +15 -0
- package/dist/server/ui/components/ui/sheet/SheetOverlay.vue +21 -0
- package/dist/server/ui/components/ui/sheet/SheetTitle.vue +21 -0
- package/dist/server/ui/components/ui/sheet/SheetTrigger.vue +15 -0
- package/dist/server/ui/components/ui/sheet/index.ts +8 -0
- package/dist/server/ui/components/ui/sidebar/Sidebar.vue +96 -0
- package/dist/server/ui/components/ui/sidebar/SidebarContent.vue +18 -0
- package/dist/server/ui/components/ui/sidebar/SidebarFooter.vue +18 -0
- package/dist/server/ui/components/ui/sidebar/SidebarGroup.vue +18 -0
- package/dist/server/ui/components/ui/sidebar/SidebarGroupAction.vue +27 -0
- package/dist/server/ui/components/ui/sidebar/SidebarGroupContent.vue +18 -0
- package/dist/server/ui/components/ui/sidebar/SidebarGroupLabel.vue +25 -0
- package/dist/server/ui/components/ui/sidebar/SidebarHeader.vue +18 -0
- package/dist/server/ui/components/ui/sidebar/SidebarInput.vue +31 -0
- package/dist/server/ui/components/ui/sidebar/SidebarInset.vue +21 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenu.vue +18 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuAction.vue +35 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuBadge.vue +26 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuButton.vue +48 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuButtonChild.vue +36 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuItem.vue +18 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuSkeleton.vue +35 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuSub.vue +22 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuSubButton.vue +36 -0
- package/dist/server/ui/components/ui/sidebar/SidebarMenuSubItem.vue +18 -0
- package/dist/server/ui/components/ui/sidebar/SidebarProvider.vue +82 -0
- package/dist/server/ui/components/ui/sidebar/SidebarRail.vue +33 -0
- package/dist/server/ui/components/ui/sidebar/SidebarSeparator.vue +19 -0
- package/dist/server/ui/components/ui/sidebar/SidebarTrigger.vue +28 -0
- package/dist/server/ui/components/ui/sidebar/index.ts +60 -0
- package/dist/server/ui/components/ui/sidebar/utils.ts +19 -0
- package/dist/server/ui/components/ui/skeleton/Skeleton.vue +17 -0
- package/dist/server/ui/components/ui/skeleton/index.ts +1 -0
- package/dist/server/ui/components/ui/tabs/Tabs.vue +24 -0
- package/dist/server/ui/components/ui/tabs/TabsContent.vue +21 -0
- package/dist/server/ui/components/ui/tabs/TabsList.vue +24 -0
- package/dist/server/ui/components/ui/tabs/TabsTrigger.vue +26 -0
- package/dist/server/ui/components/ui/tabs/index.ts +4 -0
- package/dist/server/ui/components/ui/toggle/Toggle.vue +35 -0
- package/dist/server/ui/components/ui/toggle/index.ts +28 -0
- package/dist/server/ui/components/ui/toggle-group/ToggleGroup.vue +49 -0
- package/dist/server/ui/components/ui/toggle-group/ToggleGroupItem.vue +46 -0
- package/dist/server/ui/components/ui/toggle-group/index.ts +2 -0
- package/dist/server/ui/components/ui/tooltip/Tooltip.vue +19 -0
- package/dist/server/ui/components/ui/tooltip/TooltipContent.vue +34 -0
- package/dist/server/ui/components/ui/tooltip/TooltipProvider.vue +14 -0
- package/dist/server/ui/components/ui/tooltip/TooltipTrigger.vue +15 -0
- package/dist/server/ui/components/ui/tooltip/index.ts +4 -0
- package/dist/server/ui/favicon.svg +1 -0
- package/dist/server/ui/index.html +13 -0
- package/dist/server/ui/lib/utils.ts +7 -0
- package/dist/server/ui/logo-gradient.svg +1 -0
- package/dist/server/ui/logo.svg +1 -0
- package/dist/server/ui/main.css +129 -0
- package/dist/server/ui/main.ts +16 -0
- package/dist/server/ui/mark-gradient.svg +1 -0
- package/dist/server/ui/mark.svg +1 -0
- package/dist/server/ui/pages/Home.vue +39 -0
- package/dist/server/ui/pages/Preview.vue +609 -0
- package/dist/server/ui/stripes.svg +174 -0
- package/dist/transformers/addAttributes.d.mts +32 -0
- package/dist/transformers/addAttributes.d.mts.map +1 -0
- package/dist/transformers/addAttributes.mjs +101 -0
- package/dist/transformers/addAttributes.mjs.map +1 -0
- package/dist/transformers/attributeToStyle.d.mts +25 -0
- package/dist/transformers/attributeToStyle.d.mts.map +1 -0
- package/dist/transformers/attributeToStyle.mjs +80 -0
- package/dist/transformers/attributeToStyle.mjs.map +1 -0
- package/dist/transformers/base.d.mts +8 -0
- package/dist/transformers/base.d.mts.map +1 -0
- package/dist/transformers/base.mjs +160 -0
- package/dist/transformers/base.mjs.map +1 -0
- package/dist/transformers/entities.d.mts +8 -0
- package/dist/transformers/entities.d.mts.map +1 -0
- package/dist/transformers/entities.mjs +38 -0
- package/dist/transformers/entities.mjs.map +1 -0
- package/dist/transformers/format.d.mts +15 -0
- package/dist/transformers/format.d.mts.map +1 -0
- package/dist/transformers/format.mjs +26 -0
- package/dist/transformers/format.mjs.map +1 -0
- package/dist/transformers/index.d.mts +35 -0
- package/dist/transformers/index.d.mts.map +1 -0
- package/dist/transformers/index.mjs +73 -0
- package/dist/transformers/index.mjs.map +1 -0
- package/dist/transformers/inlineCSS.d.mts +30 -0
- package/dist/transformers/inlineCSS.d.mts.map +1 -0
- package/dist/transformers/inlineCSS.mjs +79 -0
- package/dist/transformers/inlineCSS.mjs.map +1 -0
- package/dist/transformers/inlineLink.d.mts +14 -0
- package/dist/transformers/inlineLink.d.mts.map +1 -0
- package/dist/transformers/inlineLink.mjs +76 -0
- package/dist/transformers/inlineLink.mjs.map +1 -0
- package/dist/transformers/minify.d.mts +17 -0
- package/dist/transformers/minify.d.mts.map +1 -0
- package/dist/transformers/minify.mjs +24 -0
- package/dist/transformers/minify.mjs.map +1 -0
- package/dist/transformers/purgeCSS.d.mts +23 -0
- package/dist/transformers/purgeCSS.d.mts.map +1 -0
- package/dist/transformers/purgeCSS.mjs +66 -0
- package/dist/transformers/purgeCSS.mjs.map +1 -0
- package/dist/transformers/removeAttributes.d.mts +31 -0
- package/dist/transformers/removeAttributes.d.mts.map +1 -0
- package/dist/transformers/removeAttributes.mjs +63 -0
- package/dist/transformers/removeAttributes.mjs.map +1 -0
- package/dist/transformers/replaceStrings.d.mts +16 -0
- package/dist/transformers/replaceStrings.d.mts.map +1 -0
- package/dist/transformers/replaceStrings.mjs +19 -0
- package/dist/transformers/replaceStrings.mjs.map +1 -0
- package/dist/transformers/safeClassNames.d.mts +22 -0
- package/dist/transformers/safeClassNames.d.mts.map +1 -0
- package/dist/transformers/safeClassNames.mjs +103 -0
- package/dist/transformers/safeClassNames.mjs.map +1 -0
- package/dist/transformers/shorthandCSS.d.mts +24 -0
- package/dist/transformers/shorthandCSS.d.mts.map +1 -0
- package/dist/transformers/shorthandCSS.mjs +48 -0
- package/dist/transformers/shorthandCSS.mjs.map +1 -0
- package/dist/transformers/tailwindcss.d.mts +20 -0
- package/dist/transformers/tailwindcss.d.mts.map +1 -0
- package/dist/transformers/tailwindcss.mjs +136 -0
- package/dist/transformers/tailwindcss.mjs.map +1 -0
- package/dist/transformers/urlQuery.d.mts +24 -0
- package/dist/transformers/urlQuery.d.mts.map +1 -0
- package/dist/transformers/urlQuery.mjs +65 -0
- package/dist/transformers/urlQuery.mjs.map +1 -0
- package/dist/types/config.d.mts +129 -0
- package/dist/types/config.d.mts.map +1 -0
- package/dist/types/config.mjs +1 -0
- package/dist/types/index.d.mts +2 -0
- package/dist/types/index.mjs +1 -0
- package/dist/utils/ast/index.d.mts +4 -0
- package/dist/utils/ast/index.mjs +5 -0
- package/dist/utils/ast/parser.d.mts +7 -0
- package/dist/utils/ast/parser.d.mts.map +1 -0
- package/dist/utils/ast/parser.mjs +15 -0
- package/dist/utils/ast/parser.mjs.map +1 -0
- package/dist/utils/ast/serializer.d.mts +7 -0
- package/dist/utils/ast/serializer.d.mts.map +1 -0
- package/dist/utils/ast/serializer.mjs +13 -0
- package/dist/utils/ast/serializer.mjs.map +1 -0
- package/dist/utils/ast/walker.d.mts +7 -0
- package/dist/utils/ast/walker.d.mts.map +1 -0
- package/dist/utils/ast/walker.mjs +12 -0
- package/dist/utils/ast/walker.mjs.map +1 -0
- package/dist/utils/url.d.mts +8 -0
- package/dist/utils/url.d.mts.map +1 -0
- package/dist/utils/url.mjs +32 -0
- package/dist/utils/url.mjs.map +1 -0
- package/node_modules/@clack/core/CHANGELOG.md +257 -0
- package/node_modules/@clack/core/LICENSE +9 -0
- package/node_modules/@clack/core/README.md +22 -0
- package/node_modules/@clack/core/dist/index.cjs +15 -0
- package/node_modules/@clack/core/dist/index.cjs.map +1 -0
- package/node_modules/@clack/core/dist/index.d.cts +211 -0
- package/node_modules/@clack/core/dist/index.d.mts +211 -0
- package/node_modules/@clack/core/dist/index.d.ts +211 -0
- package/node_modules/@clack/core/dist/index.mjs +15 -0
- package/node_modules/@clack/core/dist/index.mjs.map +1 -0
- package/node_modules/@clack/core/package.json +62 -0
- package/node_modules/@clack/prompts/CHANGELOG.md +412 -0
- package/node_modules/@clack/prompts/LICENSE +9 -0
- package/node_modules/@clack/prompts/README.md +207 -0
- package/node_modules/@clack/prompts/dist/index.cjs +87 -0
- package/node_modules/@clack/prompts/dist/index.cjs.map +1 -0
- package/node_modules/@clack/prompts/dist/index.d.cts +165 -0
- package/node_modules/@clack/prompts/dist/index.d.mts +165 -0
- package/node_modules/@clack/prompts/dist/index.d.ts +165 -0
- package/node_modules/@clack/prompts/dist/index.mjs +87 -0
- package/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
- package/node_modules/@clack/prompts/package.json +61 -0
- package/node_modules/@maizzle/cli/LICENSE +21 -0
- package/node_modules/@maizzle/cli/README.md +58 -0
- package/node_modules/@maizzle/cli/dist/commands/make/component.d.mts +4 -0
- package/node_modules/@maizzle/cli/dist/commands/make/component.mjs +31 -0
- package/node_modules/@maizzle/cli/dist/commands/make/config.d.mts +4 -0
- package/node_modules/@maizzle/cli/dist/commands/make/config.mjs +21 -0
- package/node_modules/@maizzle/cli/dist/commands/make/layout.d.mts +4 -0
- package/node_modules/@maizzle/cli/dist/commands/make/layout.mjs +31 -0
- package/node_modules/@maizzle/cli/dist/commands/make/scaffold.d.mts +5 -0
- package/node_modules/@maizzle/cli/dist/commands/make/scaffold.mjs +28 -0
- package/node_modules/@maizzle/cli/dist/commands/make/stubs/component.vue +9 -0
- package/node_modules/@maizzle/cli/dist/commands/make/stubs/config.ts +9 -0
- package/node_modules/@maizzle/cli/dist/commands/make/stubs/layout.vue +39 -0
- package/node_modules/@maizzle/cli/dist/commands/make/stubs/template.vue +8 -0
- package/node_modules/@maizzle/cli/dist/commands/make/template.d.mts +4 -0
- package/node_modules/@maizzle/cli/dist/commands/make/template.mjs +31 -0
- package/node_modules/@maizzle/cli/dist/index.d.mts +8 -0
- package/node_modules/@maizzle/cli/dist/index.mjs +42 -0
- package/node_modules/@maizzle/cli/package.json +59 -0
- package/node_modules/citty/LICENSE +36 -0
- package/node_modules/citty/README.md +134 -0
- package/node_modules/citty/dist/index.cjs +475 -0
- package/node_modules/citty/dist/index.d.cts +80 -0
- package/node_modules/citty/dist/index.d.mts +80 -0
- package/node_modules/citty/dist/index.d.ts +80 -0
- package/node_modules/citty/dist/index.mjs +463 -0
- package/node_modules/citty/package.json +49 -0
- package/node_modules/commander/LICENSE +22 -0
- package/node_modules/commander/Readme.md +1149 -0
- package/node_modules/commander/esm.mjs +16 -0
- package/node_modules/commander/index.js +24 -0
- package/node_modules/commander/lib/argument.js +149 -0
- package/node_modules/commander/lib/command.js +2662 -0
- package/node_modules/commander/lib/error.js +39 -0
- package/node_modules/commander/lib/help.js +709 -0
- package/node_modules/commander/lib/option.js +367 -0
- package/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/node_modules/commander/package-support.json +16 -0
- package/node_modules/commander/package.json +82 -0
- package/node_modules/commander/typings/esm.d.mts +3 -0
- package/node_modules/commander/typings/index.d.ts +1045 -0
- package/node_modules/consola/LICENSE +47 -0
- package/node_modules/consola/README.md +352 -0
- package/node_modules/consola/basic.d.ts +1 -0
- package/node_modules/consola/browser.d.ts +1 -0
- package/node_modules/consola/core.d.ts +1 -0
- package/node_modules/consola/dist/basic.cjs +32 -0
- package/node_modules/consola/dist/basic.d.cts +23 -0
- package/node_modules/consola/dist/basic.d.mts +21 -0
- package/node_modules/consola/dist/basic.d.ts +23 -0
- package/node_modules/consola/dist/basic.mjs +24 -0
- package/node_modules/consola/dist/browser.cjs +84 -0
- package/node_modules/consola/dist/browser.d.cts +23 -0
- package/node_modules/consola/dist/browser.d.mts +21 -0
- package/node_modules/consola/dist/browser.d.ts +23 -0
- package/node_modules/consola/dist/browser.mjs +76 -0
- package/node_modules/consola/dist/chunks/prompt.cjs +288 -0
- package/node_modules/consola/dist/chunks/prompt.mjs +280 -0
- package/node_modules/consola/dist/core.cjs +517 -0
- package/node_modules/consola/dist/core.d.cts +459 -0
- package/node_modules/consola/dist/core.d.mts +459 -0
- package/node_modules/consola/dist/core.d.ts +459 -0
- package/node_modules/consola/dist/core.mjs +512 -0
- package/node_modules/consola/dist/index.cjs +663 -0
- package/node_modules/consola/dist/index.d.cts +24 -0
- package/node_modules/consola/dist/index.d.mts +22 -0
- package/node_modules/consola/dist/index.d.ts +24 -0
- package/node_modules/consola/dist/index.mjs +651 -0
- package/node_modules/consola/dist/shared/consola.DCGIlDNP.cjs +75 -0
- package/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +72 -0
- package/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +288 -0
- package/node_modules/consola/dist/shared/consola.DwRq1yyg.cjs +312 -0
- package/node_modules/consola/dist/utils.cjs +64 -0
- package/node_modules/consola/dist/utils.d.cts +286 -0
- package/node_modules/consola/dist/utils.d.mts +286 -0
- package/node_modules/consola/dist/utils.d.ts +286 -0
- package/node_modules/consola/dist/utils.mjs +54 -0
- package/node_modules/consola/lib/index.cjs +10 -0
- package/node_modules/consola/package.json +136 -0
- package/node_modules/consola/utils.d.ts +1 -0
- package/node_modules/create-maizzle/README.md +86 -0
- package/node_modules/create-maizzle/bin/create-maizzle.mjs +4 -0
- package/node_modules/create-maizzle/node_modules/@clack/core/CHANGELOG.md +340 -0
- package/node_modules/create-maizzle/node_modules/@clack/core/LICENSE +9 -0
- package/node_modules/create-maizzle/node_modules/@clack/core/README.md +22 -0
- package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.d.mts +349 -0
- package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs +11 -0
- package/node_modules/create-maizzle/node_modules/@clack/core/dist/index.mjs.map +1 -0
- package/node_modules/create-maizzle/node_modules/@clack/core/package.json +60 -0
- package/node_modules/create-maizzle/node_modules/@clack/prompts/CHANGELOG.md +576 -0
- package/node_modules/create-maizzle/node_modules/@clack/prompts/LICENSE +9 -0
- package/node_modules/create-maizzle/node_modules/@clack/prompts/README.md +270 -0
- package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.d.mts +391 -0
- package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs +137 -0
- package/node_modules/create-maizzle/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
- package/node_modules/create-maizzle/node_modules/@clack/prompts/package.json +65 -0
- package/node_modules/create-maizzle/package.json +47 -0
- package/node_modules/create-maizzle/src/index.js +242 -0
- package/node_modules/defu/LICENSE +21 -0
- package/node_modules/defu/README.md +171 -0
- package/node_modules/defu/dist/defu.cjs +77 -0
- package/node_modules/defu/dist/defu.d.cts +31 -0
- package/node_modules/defu/dist/defu.d.mts +29 -0
- package/node_modules/defu/dist/defu.d.ts +31 -0
- package/node_modules/defu/dist/defu.mjs +69 -0
- package/node_modules/defu/lib/defu.cjs +10 -0
- package/node_modules/defu/lib/defu.d.cts +12 -0
- package/node_modules/defu/package.json +48 -0
- package/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
- package/node_modules/fast-string-truncated-width/dist/index.js +171 -0
- package/node_modules/fast-string-truncated-width/dist/types.d.ts +22 -0
- package/node_modules/fast-string-truncated-width/dist/types.js +2 -0
- package/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
- package/node_modules/fast-string-truncated-width/dist/utils.js +15 -0
- package/node_modules/fast-string-truncated-width/license +21 -0
- package/node_modules/fast-string-truncated-width/package.json +35 -0
- package/node_modules/fast-string-truncated-width/readme.md +60 -0
- package/node_modules/fast-string-width/dist/index.d.ts +4 -0
- package/node_modules/fast-string-width/dist/index.js +14 -0
- package/node_modules/fast-string-width/license +21 -0
- package/node_modules/fast-string-width/package.json +34 -0
- package/node_modules/fast-string-width/readme.md +45 -0
- package/node_modules/fast-wrap-ansi/LICENSE +23 -0
- package/node_modules/fast-wrap-ansi/README.md +26 -0
- package/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
- package/node_modules/fast-wrap-ansi/lib/main.js +216 -0
- package/node_modules/fast-wrap-ansi/lib/main.js.map +1 -0
- package/node_modules/fast-wrap-ansi/package.json +51 -0
- package/node_modules/giget/LICENSE +184 -0
- package/node_modules/giget/README.md +248 -0
- package/node_modules/giget/dist/cli.mjs +112 -0
- package/node_modules/giget/dist/index.d.mts +49 -0
- package/node_modules/giget/dist/index.mjs +22 -0
- package/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +468 -0
- package/node_modules/giget/package.json +62 -0
- package/node_modules/node-fetch-native/LICENSE +114 -0
- package/node_modules/node-fetch-native/README.md +225 -0
- package/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +2 -0
- package/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +2 -0
- package/node_modules/node-fetch-native/dist/index.cjs +1 -0
- package/node_modules/node-fetch-native/dist/index.mjs +1 -0
- package/node_modules/node-fetch-native/dist/native.cjs +1 -0
- package/node_modules/node-fetch-native/dist/native.mjs +1 -0
- package/node_modules/node-fetch-native/dist/node.cjs +19 -0
- package/node_modules/node-fetch-native/dist/node.mjs +19 -0
- package/node_modules/node-fetch-native/dist/polyfill.cjs +1 -0
- package/node_modules/node-fetch-native/dist/polyfill.mjs +1 -0
- package/node_modules/node-fetch-native/dist/proxy-stub.cjs +1 -0
- package/node_modules/node-fetch-native/dist/proxy-stub.mjs +1 -0
- package/node_modules/node-fetch-native/dist/proxy.cjs +58 -0
- package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DfbY2q-x.mjs +1 -0
- package/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +1 -0
- package/node_modules/node-fetch-native/index.d.ts +1 -0
- 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 +11 -0
- package/node_modules/node-fetch-native/lib/index.d.cts +10 -0
- package/node_modules/node-fetch-native/lib/index.d.mts +10 -0
- package/node_modules/node-fetch-native/lib/index.d.ts +10 -0
- package/node_modules/node-fetch-native/lib/native.cjs +11 -0
- package/node_modules/node-fetch-native/lib/polyfill.d.cts +1 -0
- package/node_modules/node-fetch-native/lib/polyfill.d.mts +1 -0
- package/node_modules/node-fetch-native/lib/polyfill.d.ts +1 -0
- package/node_modules/node-fetch-native/lib/proxy.d.ts +32 -0
- package/node_modules/node-fetch-native/node.d.ts +1 -0
- package/node_modules/node-fetch-native/package.json +138 -0
- package/node_modules/node-fetch-native/polyfill.d.ts +1 -0
- package/node_modules/node-fetch-native/proxy.d.ts +1 -0
- package/node_modules/nypm/LICENSE +21 -0
- package/node_modules/nypm/README.md +152 -0
- package/node_modules/nypm/dist/cli.d.mts +1 -0
- package/node_modules/nypm/dist/cli.mjs +460 -0
- package/node_modules/nypm/dist/index.d.mts +209 -0
- package/node_modules/nypm/dist/index.mjs +423 -0
- package/node_modules/nypm/node_modules/citty/LICENSE +21 -0
- package/node_modules/nypm/node_modules/citty/README.md +231 -0
- package/node_modules/nypm/node_modules/citty/dist/THIRD-PARTY-LICENSES.md +33 -0
- package/node_modules/nypm/node_modules/citty/dist/_chunks/libs/scule.mjs +70 -0
- package/node_modules/nypm/node_modules/citty/dist/index.d.mts +112 -0
- package/node_modules/nypm/node_modules/citty/dist/index.mjs +425 -0
- package/node_modules/nypm/node_modules/citty/package.json +42 -0
- package/node_modules/nypm/package.json +54 -0
- package/node_modules/pathe/LICENSE +70 -0
- package/node_modules/pathe/README.md +73 -0
- package/node_modules/pathe/dist/index.cjs +39 -0
- package/node_modules/pathe/dist/index.d.cts +47 -0
- package/node_modules/pathe/dist/index.d.mts +47 -0
- package/node_modules/pathe/dist/index.d.ts +47 -0
- package/node_modules/pathe/dist/index.mjs +19 -0
- package/node_modules/pathe/dist/shared/pathe.BSlhyZSM.cjs +266 -0
- package/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +249 -0
- package/node_modules/pathe/dist/utils.cjs +82 -0
- package/node_modules/pathe/dist/utils.d.cts +32 -0
- package/node_modules/pathe/dist/utils.d.mts +32 -0
- package/node_modules/pathe/dist/utils.d.ts +32 -0
- package/node_modules/pathe/dist/utils.mjs +77 -0
- package/node_modules/pathe/package.json +61 -0
- package/node_modules/pathe/utils.d.ts +1 -0
- package/node_modules/picocolors/LICENSE +15 -0
- package/node_modules/picocolors/README.md +21 -0
- package/node_modules/picocolors/package.json +25 -0
- package/node_modules/picocolors/picocolors.browser.js +4 -0
- package/node_modules/picocolors/picocolors.d.ts +5 -0
- package/node_modules/picocolors/picocolors.js +75 -0
- package/node_modules/picocolors/types.d.ts +51 -0
- package/node_modules/sisteransi/license +21 -0
- package/node_modules/sisteransi/package.json +34 -0
- package/node_modules/sisteransi/readme.md +113 -0
- package/node_modules/sisteransi/src/index.js +58 -0
- package/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
- package/node_modules/tinyexec/LICENSE +21 -0
- package/node_modules/tinyexec/README.md +269 -0
- package/node_modules/tinyexec/dist/LICENSES.txt +83 -0
- package/node_modules/tinyexec/dist/main.d.mts +71 -0
- package/node_modules/tinyexec/dist/main.mjs +642 -0
- package/node_modules/tinyexec/package.json +62 -0
- package/package.json +74 -73
- package/CHANGELOG.md +0 -770
- package/bin/maizzle +0 -5
- package/src/commands/build.js +0 -348
- package/src/commands/serve.js +0 -3
- package/src/generators/plaintext.js +0 -222
- package/src/generators/render.js +0 -129
- package/src/index.js +0 -49
- package/src/posthtml/defaultComponentsConfig.js +0 -19
- package/src/posthtml/defaultConfig.js +0 -14
- package/src/posthtml/index.js +0 -102
- package/src/posthtml/plugins/combineMediaQueries.js +0 -42
- package/src/posthtml/plugins/envAttributes.js +0 -32
- package/src/posthtml/plugins/envTags.js +0 -33
- package/src/posthtml/plugins/expandLinkTag.js +0 -59
- package/src/posthtml/plugins/postcss/compileCss.js +0 -125
- package/src/posthtml/plugins/removeRawStyleAttributes.js +0 -30
- package/src/server/client.js +0 -182
- package/src/server/index.js +0 -464
- package/src/server/routes/hmr.js +0 -26
- package/src/server/routes/index.js +0 -77
- package/src/server/views/404.html +0 -59
- package/src/server/views/error.html +0 -83
- package/src/server/views/index.html +0 -172
- package/src/server/websockets.js +0 -27
- package/src/transformers/addAttributes.js +0 -29
- package/src/transformers/attributeToStyle.js +0 -90
- package/src/transformers/baseUrl.js +0 -154
- package/src/transformers/core.js +0 -32
- package/src/transformers/filters/defaultFilters.js +0 -146
- package/src/transformers/filters/index.js +0 -18
- package/src/transformers/index.js +0 -259
- package/src/transformers/inline.js +0 -306
- package/src/transformers/markdown.js +0 -26
- package/src/transformers/minify.js +0 -27
- package/src/transformers/posthtmlMso.js +0 -14
- package/src/transformers/prettify.js +0 -29
- package/src/transformers/preventWidows.js +0 -37
- package/src/transformers/purge.js +0 -56
- package/src/transformers/removeAttributes.js +0 -55
- package/src/transformers/replaceStrings.js +0 -37
- package/src/transformers/safeClassNames.js +0 -29
- package/src/transformers/shorthandCss.js +0 -20
- package/src/transformers/sixHex.js +0 -30
- package/src/transformers/template.js +0 -26
- package/src/transformers/urlParameters.js +0 -20
- package/src/transformers/useAttributeSizes.js +0 -63
- package/src/utils/getConfigByFilePath.js +0 -143
- package/src/utils/node.js +0 -68
- package/src/utils/string.js +0 -186
- package/types/build.d.ts +0 -166
- package/types/config.d.ts +0 -638
- package/types/css/combineMediaQueries.d.ts +0 -90
- package/types/css/inline.d.ts +0 -218
- package/types/css/purge.d.ts +0 -125
- package/types/events.d.ts +0 -153
- package/types/index.d.ts +0 -232
- package/types/markdown.d.ts +0 -33
- package/types/minify.d.ts +0 -138
- package/types/plaintext.d.ts +0 -56
- package/types/posthtml.d.ts +0 -162
- package/types/render.d.ts +0 -13
- package/types/urlParameters.d.ts +0 -40
- package/types/widowWords.d.ts +0 -38
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { defineCommand, runMain } from "citty";
|
|
4
|
+
import { join, normalize, resolve } from "pathe";
|
|
5
|
+
import { x } from "tinyexec";
|
|
6
|
+
import * as fs from "node:fs";
|
|
7
|
+
import { existsSync } from "node:fs";
|
|
8
|
+
import { readFile } from "node:fs/promises";
|
|
9
|
+
import { join as join$1 } from "node:path";
|
|
10
|
+
var name = "nypm";
|
|
11
|
+
var version = "0.6.4";
|
|
12
|
+
var description = "Unified Package Manager for Node.js";
|
|
13
|
+
const packageManagers = [
|
|
14
|
+
{
|
|
15
|
+
name: "npm",
|
|
16
|
+
command: "npm",
|
|
17
|
+
lockFile: "package-lock.json"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "pnpm",
|
|
21
|
+
command: "pnpm",
|
|
22
|
+
lockFile: "pnpm-lock.yaml",
|
|
23
|
+
files: ["pnpm-workspace.yaml"]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "bun",
|
|
27
|
+
command: "bun",
|
|
28
|
+
lockFile: ["bun.lockb", "bun.lock"]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "yarn",
|
|
32
|
+
command: "yarn",
|
|
33
|
+
lockFile: "yarn.lock",
|
|
34
|
+
files: [".yarnrc.yml"]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "deno",
|
|
38
|
+
command: "deno",
|
|
39
|
+
lockFile: "deno.lock",
|
|
40
|
+
files: ["deno.json"]
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
async function detectPackageManager(cwd, options = {}) {
|
|
44
|
+
const detected = await findup(resolve(cwd || "."), async (path) => {
|
|
45
|
+
if (!options.ignorePackageJSON) {
|
|
46
|
+
const packageJSONPath = join(path, "package.json");
|
|
47
|
+
if (existsSync(packageJSONPath)) {
|
|
48
|
+
const packageJSON = JSON.parse(await readFile(packageJSONPath, "utf8"));
|
|
49
|
+
if (packageJSON?.packageManager) {
|
|
50
|
+
const { name, version = "0.0.0", buildMeta, warnings } = parsePackageManagerField(packageJSON.packageManager);
|
|
51
|
+
if (name) {
|
|
52
|
+
const majorVersion = version.split(".")[0];
|
|
53
|
+
const packageManager = packageManagers.find((pm) => pm.name === name && pm.majorVersion === majorVersion) || packageManagers.find((pm) => pm.name === name);
|
|
54
|
+
return {
|
|
55
|
+
name,
|
|
56
|
+
command: name,
|
|
57
|
+
version,
|
|
58
|
+
majorVersion,
|
|
59
|
+
buildMeta,
|
|
60
|
+
warnings,
|
|
61
|
+
files: packageManager?.files,
|
|
62
|
+
lockFile: packageManager?.lockFile
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (existsSync(join(path, "deno.json"))) return packageManagers.find((pm) => pm.name === "deno");
|
|
68
|
+
}
|
|
69
|
+
if (!options.ignoreLockFile) {
|
|
70
|
+
for (const packageManager of packageManagers) if ([packageManager.lockFile, packageManager.files].flat().filter(Boolean).some((file) => existsSync(resolve(path, file)))) return { ...packageManager };
|
|
71
|
+
}
|
|
72
|
+
}, { includeParentDirs: options.includeParentDirs ?? true });
|
|
73
|
+
if (!detected && !options.ignoreArgv) {
|
|
74
|
+
const scriptArg = process.argv[1];
|
|
75
|
+
if (scriptArg) {
|
|
76
|
+
for (const packageManager of packageManagers) if (new RegExp(`[/\\\\]\\.?${packageManager.command}`).test(scriptArg)) return packageManager;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return detected;
|
|
80
|
+
}
|
|
81
|
+
async function findup(cwd, match, options = {}) {
|
|
82
|
+
const segments = normalize(cwd).split("/");
|
|
83
|
+
while (segments.length > 0) {
|
|
84
|
+
const result = await match(segments.join("/") || "/");
|
|
85
|
+
if (result || !options.includeParentDirs) return result;
|
|
86
|
+
segments.pop();
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
async function readPackageJSON(cwd) {
|
|
90
|
+
return findup(cwd, (p) => {
|
|
91
|
+
const pkgPath = join$1(p, "package.json");
|
|
92
|
+
if (existsSync(pkgPath)) return readFile(pkgPath, "utf8").then((data) => JSON.parse(data));
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function cached(fn) {
|
|
96
|
+
let v;
|
|
97
|
+
return () => {
|
|
98
|
+
if (v === void 0) v = fn().then((r) => {
|
|
99
|
+
v = r;
|
|
100
|
+
return v;
|
|
101
|
+
});
|
|
102
|
+
return v;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const hasCorepack = cached(async () => {
|
|
106
|
+
if (globalThis.process?.versions?.webcontainer) return false;
|
|
107
|
+
try {
|
|
108
|
+
const { exitCode } = await x("corepack", ["--version"]);
|
|
109
|
+
return exitCode === 0;
|
|
110
|
+
} catch {
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
async function executeCommand(command, args, options = {}) {
|
|
115
|
+
const xArgs = command !== "npm" && command !== "bun" && command !== "deno" && options.corepack !== false && await hasCorepack() ? ["corepack", [command, ...args]] : [command, args];
|
|
116
|
+
const { exitCode, stdout, stderr } = await x(xArgs[0], xArgs[1], { nodeOptions: {
|
|
117
|
+
cwd: resolve(options.cwd || process.cwd()),
|
|
118
|
+
env: options.env,
|
|
119
|
+
stdio: options.silent ? "pipe" : "inherit"
|
|
120
|
+
} });
|
|
121
|
+
if (exitCode !== 0) throw new Error(`\`${xArgs.flat().join(" ")}\` failed.${options.silent ? [
|
|
122
|
+
"",
|
|
123
|
+
stdout,
|
|
124
|
+
stderr
|
|
125
|
+
].join("\n") : ""}`);
|
|
126
|
+
}
|
|
127
|
+
const NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG = "No package manager auto-detected.";
|
|
128
|
+
async function resolveOperationOptions(options = {}) {
|
|
129
|
+
const cwd = options.cwd || process.cwd();
|
|
130
|
+
const env = {
|
|
131
|
+
...process.env,
|
|
132
|
+
...options.env
|
|
133
|
+
};
|
|
134
|
+
const packageManager = (typeof options.packageManager === "string" ? packageManagers.find((pm) => pm.name === options.packageManager) : options.packageManager) || await detectPackageManager(options.cwd || process.cwd());
|
|
135
|
+
if (!packageManager) throw new Error(NO_PACKAGE_MANAGER_DETECTED_ERROR_MSG);
|
|
136
|
+
return {
|
|
137
|
+
cwd,
|
|
138
|
+
env,
|
|
139
|
+
silent: options.silent ?? false,
|
|
140
|
+
packageManager,
|
|
141
|
+
dev: options.dev ?? false,
|
|
142
|
+
workspace: options.workspace,
|
|
143
|
+
global: options.global ?? false,
|
|
144
|
+
dry: options.dry ?? false,
|
|
145
|
+
corepack: options.corepack ?? true
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function getWorkspaceArgs(options) {
|
|
149
|
+
if (!options.workspace) return [];
|
|
150
|
+
const workspacePkg = typeof options.workspace === "string" && options.workspace !== "" ? options.workspace : void 0;
|
|
151
|
+
if (options.packageManager.name === "pnpm") return workspacePkg ? ["--filter", workspacePkg] : ["--workspace-root"];
|
|
152
|
+
if (options.packageManager.name === "npm") return workspacePkg ? ["-w", workspacePkg] : ["--workspaces"];
|
|
153
|
+
if (options.packageManager.name === "yarn") if (!options.packageManager.majorVersion || options.packageManager.majorVersion === "1") return workspacePkg ? ["--cwd", workspacePkg] : ["-W"];
|
|
154
|
+
else return workspacePkg ? ["workspace", workspacePkg] : [];
|
|
155
|
+
return [];
|
|
156
|
+
}
|
|
157
|
+
function parsePackageManagerField(packageManager) {
|
|
158
|
+
const [name, _version] = (packageManager || "").split("@");
|
|
159
|
+
const [version, buildMeta] = _version?.split("+") || [];
|
|
160
|
+
if (name && name !== "-" && /^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/.test(name)) return {
|
|
161
|
+
name,
|
|
162
|
+
version,
|
|
163
|
+
buildMeta
|
|
164
|
+
};
|
|
165
|
+
const sanitized = (name || "").replace(/\W+/g, "");
|
|
166
|
+
return {
|
|
167
|
+
name: sanitized,
|
|
168
|
+
version,
|
|
169
|
+
buildMeta,
|
|
170
|
+
warnings: [`Abnormal characters found in \`packageManager\` field, sanitizing from \`${name}\` to \`${sanitized}\``]
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
async function installDependencies(options = {}) {
|
|
174
|
+
const resolvedOptions = await resolveOperationOptions(options);
|
|
175
|
+
const commandArgs = options.frozenLockFile ? {
|
|
176
|
+
npm: ["ci"],
|
|
177
|
+
yarn: ["install", "--immutable"],
|
|
178
|
+
bun: ["install", "--frozen-lockfile"],
|
|
179
|
+
pnpm: ["install", "--frozen-lockfile"],
|
|
180
|
+
deno: ["install", "--frozen"]
|
|
181
|
+
}[resolvedOptions.packageManager.name] : ["install"];
|
|
182
|
+
if (options.ignoreWorkspace && resolvedOptions.packageManager.name === "pnpm") commandArgs.push("--ignore-workspace");
|
|
183
|
+
if (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, commandArgs, {
|
|
184
|
+
cwd: resolvedOptions.cwd,
|
|
185
|
+
silent: resolvedOptions.silent,
|
|
186
|
+
corepack: resolvedOptions.corepack
|
|
187
|
+
});
|
|
188
|
+
return { exec: {
|
|
189
|
+
command: resolvedOptions.packageManager.command,
|
|
190
|
+
args: commandArgs
|
|
191
|
+
} };
|
|
192
|
+
}
|
|
193
|
+
async function addDependency(name, options = {}) {
|
|
194
|
+
const resolvedOptions = await resolveOperationOptions(options);
|
|
195
|
+
const names = Array.isArray(name) ? name : [name];
|
|
196
|
+
if (resolvedOptions.packageManager.name === "deno") {
|
|
197
|
+
for (let i = 0; i < names.length; i++) if (!/^(npm|jsr|file):.+$/.test(names[i] || "")) names[i] = `npm:${names[i]}`;
|
|
198
|
+
}
|
|
199
|
+
if (names.length === 0) return {};
|
|
200
|
+
const args = (resolvedOptions.packageManager.name === "yarn" ? [
|
|
201
|
+
...getWorkspaceArgs(resolvedOptions),
|
|
202
|
+
resolvedOptions.global && resolvedOptions.packageManager.majorVersion === "1" ? "global" : "",
|
|
203
|
+
"add",
|
|
204
|
+
resolvedOptions.dev ? "-D" : "",
|
|
205
|
+
...names
|
|
206
|
+
] : [
|
|
207
|
+
resolvedOptions.packageManager.name === "npm" ? "install" : "add",
|
|
208
|
+
...getWorkspaceArgs(resolvedOptions),
|
|
209
|
+
resolvedOptions.dev ? "-D" : "",
|
|
210
|
+
resolvedOptions.global ? "-g" : "",
|
|
211
|
+
...names
|
|
212
|
+
]).filter(Boolean);
|
|
213
|
+
if (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, args, {
|
|
214
|
+
cwd: resolvedOptions.cwd,
|
|
215
|
+
silent: resolvedOptions.silent,
|
|
216
|
+
corepack: resolvedOptions.corepack
|
|
217
|
+
});
|
|
218
|
+
if (!resolvedOptions.dry && options.installPeerDependencies) {
|
|
219
|
+
const existingPkg = await readPackageJSON(resolvedOptions.cwd);
|
|
220
|
+
const peerDeps = [];
|
|
221
|
+
const peerDevDeps = [];
|
|
222
|
+
const _require = createRequire(join$1(resolvedOptions.cwd, "/_.js"));
|
|
223
|
+
for (const _name of names) {
|
|
224
|
+
const pkgName = _name.match(/^(.[^@]+)/)?.[0];
|
|
225
|
+
const pkg = await readPackageJSON(_require.resolve(pkgName));
|
|
226
|
+
if (!pkg?.peerDependencies || pkg?.name !== pkgName) continue;
|
|
227
|
+
for (const [peerDependency, version] of Object.entries(pkg.peerDependencies)) {
|
|
228
|
+
if (pkg.peerDependenciesMeta?.[peerDependency]?.optional) continue;
|
|
229
|
+
if (existingPkg?.dependencies?.[peerDependency] || existingPkg?.devDependencies?.[peerDependency]) continue;
|
|
230
|
+
(pkg.peerDependenciesMeta?.[peerDependency]?.dev ? peerDevDeps : peerDeps).push(`${peerDependency}@${version}`);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (peerDeps.length > 0) await addDependency(peerDeps, { ...resolvedOptions });
|
|
234
|
+
if (peerDevDeps.length > 0) await addDevDependency(peerDevDeps, { ...resolvedOptions });
|
|
235
|
+
}
|
|
236
|
+
return { exec: {
|
|
237
|
+
command: resolvedOptions.packageManager.command,
|
|
238
|
+
args
|
|
239
|
+
} };
|
|
240
|
+
}
|
|
241
|
+
async function addDevDependency(name, options = {}) {
|
|
242
|
+
return await addDependency(name, {
|
|
243
|
+
...options,
|
|
244
|
+
dev: true
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
async function removeDependency(name, options = {}) {
|
|
248
|
+
const resolvedOptions = await resolveOperationOptions(options);
|
|
249
|
+
const names = Array.isArray(name) ? name : [name];
|
|
250
|
+
if (names.length === 0) return {};
|
|
251
|
+
const args = (resolvedOptions.packageManager.name === "yarn" ? [
|
|
252
|
+
resolvedOptions.global && resolvedOptions.packageManager.majorVersion === "1" ? "global" : "",
|
|
253
|
+
...getWorkspaceArgs(resolvedOptions),
|
|
254
|
+
"remove",
|
|
255
|
+
resolvedOptions.dev ? "-D" : "",
|
|
256
|
+
resolvedOptions.global ? "-g" : "",
|
|
257
|
+
...names
|
|
258
|
+
] : [
|
|
259
|
+
resolvedOptions.packageManager.name === "npm" ? "uninstall" : "remove",
|
|
260
|
+
...getWorkspaceArgs(resolvedOptions),
|
|
261
|
+
resolvedOptions.dev ? "-D" : "",
|
|
262
|
+
resolvedOptions.global ? "-g" : "",
|
|
263
|
+
...names
|
|
264
|
+
]).filter(Boolean);
|
|
265
|
+
if (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, args, {
|
|
266
|
+
cwd: resolvedOptions.cwd,
|
|
267
|
+
silent: resolvedOptions.silent,
|
|
268
|
+
corepack: resolvedOptions.corepack
|
|
269
|
+
});
|
|
270
|
+
return { exec: {
|
|
271
|
+
command: resolvedOptions.packageManager.command,
|
|
272
|
+
args
|
|
273
|
+
} };
|
|
274
|
+
}
|
|
275
|
+
async function dedupeDependencies(options = {}) {
|
|
276
|
+
const resolvedOptions = await resolveOperationOptions(options);
|
|
277
|
+
const isSupported = !["bun", "deno"].includes(resolvedOptions.packageManager.name);
|
|
278
|
+
if (options.recreateLockfile ?? !isSupported) {
|
|
279
|
+
const lockfiles = Array.isArray(resolvedOptions.packageManager.lockFile) ? resolvedOptions.packageManager.lockFile : [resolvedOptions.packageManager.lockFile];
|
|
280
|
+
for (const lockfile of lockfiles) if (lockfile) fs.rmSync(resolve(resolvedOptions.cwd, lockfile), { force: true });
|
|
281
|
+
return await installDependencies(resolvedOptions);
|
|
282
|
+
}
|
|
283
|
+
if (isSupported) {
|
|
284
|
+
const isyarnv1 = resolvedOptions.packageManager.name === "yarn" && resolvedOptions.packageManager.majorVersion === "1";
|
|
285
|
+
if (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, [isyarnv1 ? "install" : "dedupe"], {
|
|
286
|
+
cwd: resolvedOptions.cwd,
|
|
287
|
+
silent: resolvedOptions.silent,
|
|
288
|
+
corepack: resolvedOptions.corepack
|
|
289
|
+
});
|
|
290
|
+
return { exec: {
|
|
291
|
+
command: resolvedOptions.packageManager.command,
|
|
292
|
+
args: [isyarnv1 ? "install" : "dedupe"]
|
|
293
|
+
} };
|
|
294
|
+
}
|
|
295
|
+
throw new Error(`Deduplication is not supported for ${resolvedOptions.packageManager.name}`);
|
|
296
|
+
}
|
|
297
|
+
async function runScript(name, options = {}) {
|
|
298
|
+
const resolvedOptions = await resolveOperationOptions(options);
|
|
299
|
+
const args = [
|
|
300
|
+
resolvedOptions.packageManager.name === "deno" ? "task" : "run",
|
|
301
|
+
name,
|
|
302
|
+
...options.args || []
|
|
303
|
+
];
|
|
304
|
+
if (!resolvedOptions.dry) await executeCommand(resolvedOptions.packageManager.command, args, {
|
|
305
|
+
cwd: resolvedOptions.cwd,
|
|
306
|
+
env: resolvedOptions.env,
|
|
307
|
+
silent: resolvedOptions.silent,
|
|
308
|
+
corepack: resolvedOptions.corepack
|
|
309
|
+
});
|
|
310
|
+
return { exec: {
|
|
311
|
+
command: resolvedOptions.packageManager.command,
|
|
312
|
+
args
|
|
313
|
+
} };
|
|
314
|
+
}
|
|
315
|
+
const operationArgs = {
|
|
316
|
+
cwd: {
|
|
317
|
+
type: "string",
|
|
318
|
+
description: "Current working directory"
|
|
319
|
+
},
|
|
320
|
+
workspace: {
|
|
321
|
+
type: "boolean",
|
|
322
|
+
description: "Add to workspace"
|
|
323
|
+
},
|
|
324
|
+
silent: {
|
|
325
|
+
type: "boolean",
|
|
326
|
+
description: "Run in silent mode"
|
|
327
|
+
},
|
|
328
|
+
corepack: {
|
|
329
|
+
type: "boolean",
|
|
330
|
+
default: true,
|
|
331
|
+
description: "Use corepack"
|
|
332
|
+
},
|
|
333
|
+
dry: {
|
|
334
|
+
type: "boolean",
|
|
335
|
+
description: "Run in dry run mode (does not execute commands)"
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
const install = defineCommand({
|
|
339
|
+
meta: { description: "Install dependencies" },
|
|
340
|
+
args: {
|
|
341
|
+
...operationArgs,
|
|
342
|
+
name: {
|
|
343
|
+
type: "positional",
|
|
344
|
+
description: "Dependency name",
|
|
345
|
+
required: false
|
|
346
|
+
},
|
|
347
|
+
dev: {
|
|
348
|
+
type: "boolean",
|
|
349
|
+
alias: "D",
|
|
350
|
+
description: "Add as dev dependency"
|
|
351
|
+
},
|
|
352
|
+
global: {
|
|
353
|
+
type: "boolean",
|
|
354
|
+
alias: "g",
|
|
355
|
+
description: "Add globally"
|
|
356
|
+
},
|
|
357
|
+
"frozen-lockfile": {
|
|
358
|
+
type: "boolean",
|
|
359
|
+
description: "Install dependencies with frozen lock file"
|
|
360
|
+
},
|
|
361
|
+
"install-peer-dependencies": {
|
|
362
|
+
type: "boolean",
|
|
363
|
+
description: "Also install peer dependencies"
|
|
364
|
+
}
|
|
365
|
+
},
|
|
366
|
+
run: async ({ args }) => {
|
|
367
|
+
handleRes(await (args._.length > 0 ? addDependency(args._, args) : installDependencies(args)), args);
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
const remove = defineCommand({
|
|
371
|
+
meta: { description: "Remove dependencies" },
|
|
372
|
+
args: {
|
|
373
|
+
name: {
|
|
374
|
+
type: "positional",
|
|
375
|
+
description: "Dependency name",
|
|
376
|
+
required: true
|
|
377
|
+
},
|
|
378
|
+
...operationArgs
|
|
379
|
+
},
|
|
380
|
+
run: async ({ args }) => {
|
|
381
|
+
handleRes(await removeDependency(args._, args), args);
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
const detect = defineCommand({
|
|
385
|
+
meta: { description: "Detect the current package manager" },
|
|
386
|
+
args: { cwd: {
|
|
387
|
+
type: "string",
|
|
388
|
+
description: "Current working directory"
|
|
389
|
+
} },
|
|
390
|
+
run: async ({ args }) => {
|
|
391
|
+
const cwd = resolve(args.cwd || ".");
|
|
392
|
+
const packageManager = await detectPackageManager(cwd);
|
|
393
|
+
if (packageManager?.warnings) for (const warning of packageManager.warnings) console.warn(warning);
|
|
394
|
+
if (!packageManager) {
|
|
395
|
+
console.error(`Cannot detect package manager in "${cwd}"`);
|
|
396
|
+
return process.exit(1);
|
|
397
|
+
}
|
|
398
|
+
console.log(`Detected package manager in "${cwd}": "${packageManager.name}@${packageManager.version}"`);
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
const dedupe = defineCommand({
|
|
402
|
+
meta: { description: "Dedupe dependencies" },
|
|
403
|
+
args: {
|
|
404
|
+
cwd: {
|
|
405
|
+
type: "string",
|
|
406
|
+
description: "Current working directory"
|
|
407
|
+
},
|
|
408
|
+
silent: {
|
|
409
|
+
type: "boolean",
|
|
410
|
+
description: "Run in silent mode"
|
|
411
|
+
},
|
|
412
|
+
recreateLockFile: {
|
|
413
|
+
type: "boolean",
|
|
414
|
+
description: "Recreate lock file"
|
|
415
|
+
}
|
|
416
|
+
},
|
|
417
|
+
run: async ({ args }) => {
|
|
418
|
+
handleRes(await dedupeDependencies(args), args);
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
const run = defineCommand({
|
|
422
|
+
meta: { description: "Run script" },
|
|
423
|
+
args: {
|
|
424
|
+
name: {
|
|
425
|
+
type: "positional",
|
|
426
|
+
description: "Script name",
|
|
427
|
+
required: true
|
|
428
|
+
},
|
|
429
|
+
...operationArgs
|
|
430
|
+
},
|
|
431
|
+
run: async ({ args }) => {
|
|
432
|
+
handleRes(await runScript(args.name, {
|
|
433
|
+
...args,
|
|
434
|
+
args: args._.slice(1)
|
|
435
|
+
}), args);
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
runMain(defineCommand({
|
|
439
|
+
meta: {
|
|
440
|
+
name,
|
|
441
|
+
version,
|
|
442
|
+
description
|
|
443
|
+
},
|
|
444
|
+
subCommands: {
|
|
445
|
+
install,
|
|
446
|
+
i: install,
|
|
447
|
+
add: install,
|
|
448
|
+
remove,
|
|
449
|
+
rm: remove,
|
|
450
|
+
uninstall: remove,
|
|
451
|
+
un: remove,
|
|
452
|
+
detect,
|
|
453
|
+
dedupe,
|
|
454
|
+
run
|
|
455
|
+
}
|
|
456
|
+
}));
|
|
457
|
+
function handleRes(result, args) {
|
|
458
|
+
if (args.dry && !args.silent) console.log(`${result.exec?.command} ${result.exec?.args.join(" ")}`);
|
|
459
|
+
}
|
|
460
|
+
export {};
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
//#region src/types.d.ts
|
|
2
|
+
type PackageManagerName = "npm" | "yarn" | "pnpm" | "bun" | "deno";
|
|
3
|
+
type PackageManager = {
|
|
4
|
+
name: PackageManagerName;
|
|
5
|
+
command: string;
|
|
6
|
+
version?: string;
|
|
7
|
+
buildMeta?: string;
|
|
8
|
+
majorVersion?: string;
|
|
9
|
+
lockFile?: string | string[];
|
|
10
|
+
files?: string[];
|
|
11
|
+
};
|
|
12
|
+
type OperationOptions = {
|
|
13
|
+
cwd?: string;
|
|
14
|
+
env?: Record<string, string>;
|
|
15
|
+
silent?: boolean;
|
|
16
|
+
packageManager?: PackageManager | PackageManagerName;
|
|
17
|
+
installPeerDependencies?: boolean;
|
|
18
|
+
dev?: boolean;
|
|
19
|
+
workspace?: boolean | string;
|
|
20
|
+
global?: boolean;
|
|
21
|
+
corepack?: boolean; /** Do not execute actual command */
|
|
22
|
+
dry?: boolean;
|
|
23
|
+
};
|
|
24
|
+
type OperationResult = {
|
|
25
|
+
exec?: {
|
|
26
|
+
command: string;
|
|
27
|
+
args: string[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/package-manager.d.ts
|
|
32
|
+
type DetectPackageManagerOptions = {
|
|
33
|
+
/**
|
|
34
|
+
* Whether to ignore the lock file
|
|
35
|
+
*
|
|
36
|
+
* @default false
|
|
37
|
+
*/
|
|
38
|
+
ignoreLockFile?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Whether to ignore the package.json file
|
|
41
|
+
*
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
ignorePackageJSON?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Whether to include parent directories
|
|
47
|
+
*
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
includeParentDirs?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Weather to ignore argv[1] to detect script
|
|
53
|
+
*/
|
|
54
|
+
ignoreArgv?: boolean;
|
|
55
|
+
};
|
|
56
|
+
declare const packageManagers: PackageManager[];
|
|
57
|
+
/**
|
|
58
|
+
* Detect the package manager used in a directory (and up) by checking various sources:
|
|
59
|
+
*
|
|
60
|
+
* 1. Use `packageManager` field from package.json
|
|
61
|
+
*
|
|
62
|
+
* 2. Known lock files and other files
|
|
63
|
+
*/
|
|
64
|
+
declare function detectPackageManager(cwd: string, options?: DetectPackageManagerOptions): Promise<(PackageManager & {
|
|
65
|
+
warnings?: string[];
|
|
66
|
+
}) | undefined>;
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/api.d.ts
|
|
69
|
+
/**
|
|
70
|
+
* Installs project dependencies.
|
|
71
|
+
*
|
|
72
|
+
* @param options - Options to pass to the API call.
|
|
73
|
+
* @param options.cwd - The directory to run the command in.
|
|
74
|
+
* @param options.silent - Whether to run the command in silent mode.
|
|
75
|
+
* @param options.packageManager - The package manager info to use (auto-detected).
|
|
76
|
+
* @param options.frozenLockFile - Whether to install dependencies with frozen lock file.
|
|
77
|
+
*/
|
|
78
|
+
declare function installDependencies(options?: Pick<OperationOptions, "cwd" | "silent" | "packageManager" | "dry" | "corepack"> & {
|
|
79
|
+
frozenLockFile?: boolean;
|
|
80
|
+
ignoreWorkspace?: boolean;
|
|
81
|
+
}): Promise<OperationResult>;
|
|
82
|
+
/**
|
|
83
|
+
* Adds dependency to the project.
|
|
84
|
+
*
|
|
85
|
+
* @param name - Name of the dependency to add.
|
|
86
|
+
* @param options - Options to pass to the API call.
|
|
87
|
+
* @param options.cwd - The directory to run the command in.
|
|
88
|
+
* @param options.silent - Whether to run the command in silent mode.
|
|
89
|
+
* @param options.packageManager - The package manager info to use (auto-detected).
|
|
90
|
+
* @param options.dev - Whether to add the dependency as dev dependency.
|
|
91
|
+
* @param options.workspace - The name of the workspace to use.
|
|
92
|
+
* @param options.global - Whether to run the command in global mode.
|
|
93
|
+
*/
|
|
94
|
+
declare function addDependency(name: string | string[], options?: OperationOptions): Promise<OperationResult>;
|
|
95
|
+
/**
|
|
96
|
+
* Adds dev dependency to the project.
|
|
97
|
+
*
|
|
98
|
+
* @param name - Name of the dev dependency to add.
|
|
99
|
+
* @param options - Options to pass to the API call.
|
|
100
|
+
* @param options.cwd - The directory to run the command in.
|
|
101
|
+
* @param options.silent - Whether to run the command in silent mode.
|
|
102
|
+
* @param options.packageManager - The package manager info to use (auto-detected).
|
|
103
|
+
* @param options.workspace - The name of the workspace to use.
|
|
104
|
+
* @param options.global - Whether to run the command in global mode.
|
|
105
|
+
*
|
|
106
|
+
*/
|
|
107
|
+
declare function addDevDependency(name: string | string[], options?: Omit<OperationOptions, "dev">): Promise<OperationResult>;
|
|
108
|
+
/**
|
|
109
|
+
* Removes dependency from the project.
|
|
110
|
+
*
|
|
111
|
+
* @param name - Name of the dependency to remove.
|
|
112
|
+
* @param options - Options to pass to the API call.
|
|
113
|
+
* @param options.cwd - The directory to run the command in.
|
|
114
|
+
* @param options.silent - Whether to run the command in silent mode.
|
|
115
|
+
* @param options.packageManager - The package manager info to use (auto-detected).
|
|
116
|
+
* @param options.dev - Whether to remove dev dependency.
|
|
117
|
+
* @param options.workspace - The name of the workspace to use.
|
|
118
|
+
* @param options.global - Whether to run the command in global mode.
|
|
119
|
+
*/
|
|
120
|
+
declare function removeDependency(name: string | string[], options?: OperationOptions): Promise<OperationResult>;
|
|
121
|
+
/**
|
|
122
|
+
* Ensures dependency is installed.
|
|
123
|
+
*
|
|
124
|
+
* @param name - Name of the dependency.
|
|
125
|
+
* @param options - Options to pass to the API call.
|
|
126
|
+
* @param options.cwd - The directory to run the command in.
|
|
127
|
+
* @param options.dev - Whether to install as dev dependency (if not already installed).
|
|
128
|
+
* @param options.workspace - The name of the workspace to install dependency in (if not already installed).
|
|
129
|
+
*/
|
|
130
|
+
declare function ensureDependencyInstalled(name: string, options?: Pick<OperationOptions, "cwd" | "dev" | "workspace">): Promise<true | undefined>;
|
|
131
|
+
/**
|
|
132
|
+
* Dedupe dependencies in the project.
|
|
133
|
+
*
|
|
134
|
+
* @param options - Options to pass to the API call.
|
|
135
|
+
* @param options.cwd - The directory to run the command in.
|
|
136
|
+
* @param options.packageManager - The package manager info to use (auto-detected).
|
|
137
|
+
* @param options.silent - Whether to run the command in silent mode.
|
|
138
|
+
* @param options.recreateLockfile - Whether to recreate the lockfile instead of deduping.
|
|
139
|
+
*/
|
|
140
|
+
declare function dedupeDependencies(options?: Pick<OperationOptions, "cwd" | "silent" | "packageManager" | "dry" | "corepack"> & {
|
|
141
|
+
recreateLockfile?: boolean;
|
|
142
|
+
}): Promise<OperationResult>;
|
|
143
|
+
/**
|
|
144
|
+
* Runs a script defined in the package.json file.
|
|
145
|
+
*
|
|
146
|
+
* @param name - Name of the script to run.
|
|
147
|
+
* @param options - Options to pass to the API call.
|
|
148
|
+
* @param options.cwd - The directory to run the command in.
|
|
149
|
+
* @param options.env - Additional environment variables to set for the script execution.
|
|
150
|
+
* @param options.silent - Whether to run the command in silent mode.
|
|
151
|
+
* @param options.packageManager - The package manager info to use (auto-detected).
|
|
152
|
+
* @param options.args - Additional arguments to pass to the script.
|
|
153
|
+
*/
|
|
154
|
+
declare function runScript(name: string, options?: Pick<OperationOptions, "cwd" | "env" | "silent" | "packageManager" | "dry" | "corepack"> & {
|
|
155
|
+
args?: string[];
|
|
156
|
+
}): Promise<OperationResult>;
|
|
157
|
+
/**
|
|
158
|
+
* Download and execute a package with the package manager.
|
|
159
|
+
*
|
|
160
|
+
* @param name - Name of the package to download and execute.
|
|
161
|
+
* @param options - Options to pass to the API call.
|
|
162
|
+
* @param options.cwd - The directory to run the command in.
|
|
163
|
+
* @param options.env - Additional environment variables to set for the command execution.
|
|
164
|
+
* @param options.silent - Whether to run the command in silent mode.
|
|
165
|
+
* @param options.packageManager - The package manager info to use (auto-detected).
|
|
166
|
+
* @param options.args - The arguments to pass to the command.
|
|
167
|
+
* @param options.short - Whether to use the short version of the command (e.g. pnpx instead of pnpm dlx).
|
|
168
|
+
* @param options.packages - The packages to pass to the command (e.g. npx --package=<package1> --package=<package2> <command>).
|
|
169
|
+
*/
|
|
170
|
+
declare function dlx(name: string, options?: Pick<OperationOptions, "cwd" | "env" | "silent" | "packageManager" | "dry" | "corepack"> & {
|
|
171
|
+
args?: string[];
|
|
172
|
+
short?: boolean;
|
|
173
|
+
packages?: string[];
|
|
174
|
+
}): Promise<OperationResult>;
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/cmd.d.ts
|
|
177
|
+
/**
|
|
178
|
+
* Get the command to install dependencies with the package manager.
|
|
179
|
+
*/
|
|
180
|
+
declare function installDependenciesCommand(packageManager: PackageManagerName, options?: {
|
|
181
|
+
short?: boolean;
|
|
182
|
+
frozenLockFile?: boolean;
|
|
183
|
+
}): string;
|
|
184
|
+
/**
|
|
185
|
+
* Get the command to add a dependency with the package manager.
|
|
186
|
+
*/
|
|
187
|
+
declare function addDependencyCommand(packageManager: PackageManagerName, name: string | string[], options?: {
|
|
188
|
+
dev?: boolean;
|
|
189
|
+
global?: boolean;
|
|
190
|
+
yarnBerry?: boolean;
|
|
191
|
+
workspace?: boolean | string;
|
|
192
|
+
short?: boolean;
|
|
193
|
+
}): string;
|
|
194
|
+
/**
|
|
195
|
+
* Get the command to run a script with the package manager.
|
|
196
|
+
*/
|
|
197
|
+
declare function runScriptCommand(packageManager: PackageManagerName, name: string, options?: {
|
|
198
|
+
args?: string[];
|
|
199
|
+
}): string;
|
|
200
|
+
/**
|
|
201
|
+
* Get the command to download and execute a package with the package manager.
|
|
202
|
+
*/
|
|
203
|
+
declare function dlxCommand(packageManager: PackageManagerName, name: string, options?: {
|
|
204
|
+
args?: string[];
|
|
205
|
+
short?: boolean;
|
|
206
|
+
packages?: string[];
|
|
207
|
+
}): string;
|
|
208
|
+
//#endregion
|
|
209
|
+
export { DetectPackageManagerOptions, OperationOptions, OperationResult, PackageManager, PackageManagerName, addDependency, addDependencyCommand, addDevDependency, dedupeDependencies, detectPackageManager, dlx, dlxCommand, ensureDependencyInstalled, installDependencies, installDependenciesCommand, packageManagers, removeDependency, runScript, runScriptCommand };
|