@maizzle/framework 6.0.0-rc.0 → 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 +29 -9
- 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 +25 -1
- 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 +10 -3
- package/dist/render/createRenderer.d.mts.map +1 -1
- package/dist/render/createRenderer.mjs +147 -10
- package/dist/render/createRenderer.mjs.map +1 -1
- package/dist/render/index.mjs +9 -3
- package/dist/render/index.mjs.map +1 -1
- package/dist/serve.d.mts.map +1 -1
- package/dist/serve.mjs +159 -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 +459 -17
- 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
|
@@ -51,6 +51,7 @@ export class Argument {
|
|
|
51
51
|
variadic: boolean;
|
|
52
52
|
defaultValue?: any;
|
|
53
53
|
defaultValueDescription?: string;
|
|
54
|
+
parseArg?: <T>(value: string, previous: T) => T;
|
|
54
55
|
argChoices?: string[];
|
|
55
56
|
|
|
56
57
|
/**
|
|
@@ -109,6 +110,7 @@ export class Option {
|
|
|
109
110
|
parseArg?: <T>(value: string, previous: T) => T;
|
|
110
111
|
hidden: boolean;
|
|
111
112
|
argChoices?: string[];
|
|
113
|
+
helpGroupHeading?: string;
|
|
112
114
|
|
|
113
115
|
constructor(flags: string, description?: string);
|
|
114
116
|
|
|
@@ -192,6 +194,11 @@ export class Option {
|
|
|
192
194
|
*/
|
|
193
195
|
attributeName(): string;
|
|
194
196
|
|
|
197
|
+
/**
|
|
198
|
+
* Set the help group heading.
|
|
199
|
+
*/
|
|
200
|
+
helpGroup(heading: string): this;
|
|
201
|
+
|
|
195
202
|
/**
|
|
196
203
|
* Return whether a boolean option.
|
|
197
204
|
*
|
|
@@ -313,6 +320,20 @@ export class Help {
|
|
|
313
320
|
helper: Help,
|
|
314
321
|
): string;
|
|
315
322
|
|
|
323
|
+
/**
|
|
324
|
+
* Format a list of items, given a heading and an array of formatted items.
|
|
325
|
+
*/
|
|
326
|
+
formatItemList(heading: string, items: string[], helper: Help): string[];
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Group items by their help group heading.
|
|
330
|
+
*/
|
|
331
|
+
groupItems<T extends Command | Option>(
|
|
332
|
+
unsortedItems: T[],
|
|
333
|
+
visibleItems: T[],
|
|
334
|
+
getGroup: (item: T) => string,
|
|
335
|
+
): Map<string, T[]>;
|
|
336
|
+
|
|
316
337
|
/** Generate the built-in help text. */
|
|
317
338
|
formatHelp(cmd: Command, helper: Help): string;
|
|
318
339
|
}
|
|
@@ -466,7 +487,7 @@ export class Command {
|
|
|
466
487
|
argument<T>(
|
|
467
488
|
flags: string,
|
|
468
489
|
description: string,
|
|
469
|
-
|
|
490
|
+
parseArg: (value: string, previous: T) => T,
|
|
470
491
|
defaultValue?: T,
|
|
471
492
|
): this;
|
|
472
493
|
argument(name: string, description?: string, defaultValue?: unknown): this;
|
|
@@ -968,6 +989,53 @@ export class Command {
|
|
|
968
989
|
*/
|
|
969
990
|
executableDir(): string | null;
|
|
970
991
|
|
|
992
|
+
/**
|
|
993
|
+
* Set the help group heading for this subcommand in parent command's help.
|
|
994
|
+
*
|
|
995
|
+
* @returns `this` command for chaining
|
|
996
|
+
*/
|
|
997
|
+
helpGroup(heading: string): this;
|
|
998
|
+
/**
|
|
999
|
+
* Get the help group heading for this subcommand in parent command's help.
|
|
1000
|
+
*/
|
|
1001
|
+
helpGroup(): string;
|
|
1002
|
+
|
|
1003
|
+
/**
|
|
1004
|
+
* Set the default help group heading for subcommands added to this command.
|
|
1005
|
+
* (This does not override a group set directly on the subcommand using .helpGroup().)
|
|
1006
|
+
*
|
|
1007
|
+
* @example
|
|
1008
|
+
* program.commandsGroup('Development Commands:);
|
|
1009
|
+
* program.command('watch')...
|
|
1010
|
+
* program.command('lint')...
|
|
1011
|
+
* ...
|
|
1012
|
+
*
|
|
1013
|
+
* @returns `this` command for chaining
|
|
1014
|
+
*/
|
|
1015
|
+
commandsGroup(heading: string): this;
|
|
1016
|
+
/**
|
|
1017
|
+
* Get the default help group heading for subcommands added to this command.
|
|
1018
|
+
*/
|
|
1019
|
+
commandsGroup(): string;
|
|
1020
|
+
|
|
1021
|
+
/**
|
|
1022
|
+
* Set the default help group heading for options added to this command.
|
|
1023
|
+
* (This does not override a group set directly on the option using .helpGroup().)
|
|
1024
|
+
*
|
|
1025
|
+
* @example
|
|
1026
|
+
* program
|
|
1027
|
+
* .optionsGroup('Development Options:')
|
|
1028
|
+
* .option('-d, --debug', 'output extra debugging')
|
|
1029
|
+
* .option('-p, --profile', 'output profiling information')
|
|
1030
|
+
*
|
|
1031
|
+
* @returns `this` command for chaining
|
|
1032
|
+
*/
|
|
1033
|
+
optionsGroup(heading: string): this;
|
|
1034
|
+
/**
|
|
1035
|
+
* Get the default help group heading for options added to this command.
|
|
1036
|
+
*/
|
|
1037
|
+
optionsGroup(): string;
|
|
1038
|
+
|
|
971
1039
|
/**
|
|
972
1040
|
* Output help information for this command.
|
|
973
1041
|
*
|
|
@@ -976,7 +1044,7 @@ export class Command {
|
|
|
976
1044
|
*/
|
|
977
1045
|
outputHelp(context?: HelpContext): void;
|
|
978
1046
|
/** @deprecated since v7 */
|
|
979
|
-
outputHelp(cb
|
|
1047
|
+
outputHelp(cb: (str: string) => string): void;
|
|
980
1048
|
|
|
981
1049
|
/**
|
|
982
1050
|
* Return command help documentation.
|
|
@@ -1003,7 +1071,7 @@ export class Command {
|
|
|
1003
1071
|
*/
|
|
1004
1072
|
help(context?: HelpContext): never;
|
|
1005
1073
|
/** @deprecated since v7 */
|
|
1006
|
-
help(cb
|
|
1074
|
+
help(cb: (str: string) => string): never;
|
|
1007
1075
|
|
|
1008
1076
|
/**
|
|
1009
1077
|
* Add additional text to be displayed with the built-in help.
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
3
|
-
"version": "
|
|
2
|
+
"name": "maizzle",
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "CLI tool for the Maizzle Email Framework",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
"access": "public"
|
|
9
|
-
},
|
|
10
7
|
"exports": {
|
|
11
8
|
".": {
|
|
12
9
|
"import": "./dist/index.mjs",
|
|
13
10
|
"types": "./dist/index.d.mts"
|
|
14
11
|
}
|
|
15
12
|
},
|
|
13
|
+
"bin": {
|
|
14
|
+
"maizzle": "./bin/maizzle.mjs"
|
|
15
|
+
},
|
|
16
16
|
"files": [
|
|
17
|
-
"dist"
|
|
17
|
+
"dist",
|
|
18
|
+
"bin"
|
|
18
19
|
],
|
|
19
20
|
"scripts": {
|
|
20
21
|
"build": "tsdown",
|
|
@@ -24,17 +25,18 @@
|
|
|
24
25
|
"release": "npm run build && npx np"
|
|
25
26
|
},
|
|
26
27
|
"dependencies": {
|
|
27
|
-
"@clack/prompts": "^
|
|
28
|
-
"commander": "^
|
|
29
|
-
"
|
|
28
|
+
"@clack/prompts": "^1.2.0",
|
|
29
|
+
"commander": "^14.0.3",
|
|
30
|
+
"giget": "^3.2.0",
|
|
31
|
+
"nypm": "^0.6.5",
|
|
30
32
|
"picocolors": "^1.1.1"
|
|
31
33
|
},
|
|
32
34
|
"devDependencies": {
|
|
33
35
|
"@types/node": "^25.2.3",
|
|
34
|
-
"@vitest/coverage-v8": "^4.1.
|
|
36
|
+
"@vitest/coverage-v8": "^4.1.3",
|
|
35
37
|
"tsdown": "^0.21.7",
|
|
36
38
|
"typescript": "^5.9.3",
|
|
37
|
-
"vitest": "^4.1.
|
|
39
|
+
"vitest": "^4.1.3"
|
|
38
40
|
},
|
|
39
41
|
"repository": {
|
|
40
42
|
"type": "git",
|
|
@@ -25,7 +25,7 @@ const result = await x('ls', ['-l']);
|
|
|
25
25
|
// result.exitCode - the process exit code as a number
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
By default, tinyexec does not throw on non‑zero exit codes. Check `result.exitCode` or pass `{throwOnError: true}`.
|
|
28
|
+
By default, tinyexec does not throw on non‑zero exit codes. Check `result.exitCode` or pass `{throwOnError: true}`.
|
|
29
29
|
|
|
30
30
|
Output is returned exactly as produced; trailing newlines are not trimmed. If you need trimming, do it explicitly:
|
|
31
31
|
|
|
@@ -58,12 +58,24 @@ await x('ls', [], {
|
|
|
58
58
|
The options object can have the following properties:
|
|
59
59
|
|
|
60
60
|
- `signal` - an `AbortSignal` to allow aborting of the execution
|
|
61
|
-
- `timeout` - time in milliseconds at which the process will be
|
|
61
|
+
- `timeout` - time in milliseconds at which the process will be forcibly killed
|
|
62
62
|
- `persist` - if `true`, the process will continue after the host exits
|
|
63
|
-
- `stdin` - another `Result`
|
|
63
|
+
- `stdin` - `string` or another `Result` that will be used as the input to the process
|
|
64
64
|
- `nodeOptions` - any valid options to node's underlying `spawn` function
|
|
65
65
|
- `throwOnError` - if true, non-zero exit codes will throw an error
|
|
66
66
|
|
|
67
|
+
### Passing a string to stdin
|
|
68
|
+
|
|
69
|
+
You can pass a string to `stdin`, which is useful for whitespace-sensitive values and for secrets you shouldn’t be exposed in shell history:
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
const result = await x('gh', ['auth', 'login', '--with-token'], {
|
|
73
|
+
stdin: process.env.GITHUB_TOKEN
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
console.log(result.exitCode);
|
|
77
|
+
```
|
|
78
|
+
|
|
67
79
|
### Piping to another process
|
|
68
80
|
|
|
69
81
|
You can pipe a process to another via the `pipe` method:
|
|
@@ -149,6 +161,40 @@ const result = await x(command, args);
|
|
|
149
161
|
result.stdout; // Hello, World!
|
|
150
162
|
```
|
|
151
163
|
|
|
164
|
+
### Synchronous
|
|
165
|
+
|
|
166
|
+
You can use `xSync` for synchronous (blocking) execution:
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
import {xSync} from 'tinyexec';
|
|
170
|
+
|
|
171
|
+
const result = xSync('ls', ['-l']);
|
|
172
|
+
|
|
173
|
+
// result.stdout - the stdout as a string
|
|
174
|
+
// result.stderr - the stderr as a string
|
|
175
|
+
// result.exitCode - the process exit code as a number
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Like the async API, you can iterate over lines:
|
|
179
|
+
|
|
180
|
+
```ts
|
|
181
|
+
const result = xSync('ls', ['-l']);
|
|
182
|
+
|
|
183
|
+
for (const line of result) {
|
|
184
|
+
// line will be from stdout then stderr
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Since the synchronous API blocks the event loop, there are some features that are supported in the async API that the sync API does not support:
|
|
189
|
+
|
|
190
|
+
- `signal`
|
|
191
|
+
- `persist`
|
|
192
|
+
- `kill()` method
|
|
193
|
+
- `stdin` piping
|
|
194
|
+
- `pipe()` method
|
|
195
|
+
|
|
196
|
+
Other options like `timeout`, `throwOnError`, and `nodeOptions` work the same way.
|
|
197
|
+
|
|
152
198
|
## API
|
|
153
199
|
|
|
154
200
|
Calling `x(command[, args])` returns an awaitable `Result` which has the
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ChildProcess, SpawnOptions } from "node:child_process";
|
|
1
|
+
import { ChildProcess, SpawnOptions, SpawnSyncOptions } from "node:child_process";
|
|
2
2
|
import { Readable } from "node:stream";
|
|
3
3
|
|
|
4
4
|
//#region src/non-zero-exit-error.d.ts
|
|
5
5
|
declare class NonZeroExitError extends Error {
|
|
6
|
-
readonly result:
|
|
7
|
-
readonly output?: Output;
|
|
6
|
+
readonly result: CommonOutputApi;
|
|
7
|
+
readonly output?: Output | undefined;
|
|
8
8
|
get exitCode(): number | undefined;
|
|
9
|
-
constructor(result:
|
|
9
|
+
constructor(result: CommonOutputApi, output?: Output | undefined);
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
12
12
|
//#region src/main.d.ts
|
|
@@ -17,23 +17,32 @@ interface Output {
|
|
|
17
17
|
}
|
|
18
18
|
interface PipeOptions extends Options {}
|
|
19
19
|
type KillSignal = Parameters<ChildProcess['kill']>[0];
|
|
20
|
-
interface
|
|
21
|
-
pipe(command: string, args?: string[], options?: Partial<PipeOptions>): Result;
|
|
22
|
-
process: ChildProcess | undefined;
|
|
23
|
-
kill(signal?: KillSignal): boolean;
|
|
20
|
+
interface CommonOutputApi {
|
|
24
21
|
get pid(): number | undefined;
|
|
25
|
-
get aborted(): boolean;
|
|
26
22
|
get killed(): boolean;
|
|
27
23
|
get exitCode(): number | undefined;
|
|
28
24
|
}
|
|
25
|
+
interface OutputApi extends AsyncIterable<string>, CommonOutputApi {
|
|
26
|
+
process: ChildProcess | undefined;
|
|
27
|
+
get aborted(): boolean;
|
|
28
|
+
pipe(command: string, args?: string[], options?: Partial<PipeOptions>): Result;
|
|
29
|
+
kill(signal?: KillSignal): boolean;
|
|
30
|
+
}
|
|
31
|
+
interface OutputApiSync extends Iterable<string>, CommonOutputApi {}
|
|
29
32
|
type Result = PromiseLike<Output> & OutputApi;
|
|
30
|
-
|
|
33
|
+
type SyncResult = Output & OutputApiSync;
|
|
34
|
+
interface CommonOptions {
|
|
35
|
+
timeout: number;
|
|
36
|
+
throwOnError: boolean;
|
|
37
|
+
}
|
|
38
|
+
interface Options extends CommonOptions {
|
|
31
39
|
signal: AbortSignal;
|
|
32
40
|
nodeOptions: SpawnOptions;
|
|
33
|
-
timeout: number;
|
|
34
41
|
persist: boolean;
|
|
35
|
-
stdin: ExecProcess;
|
|
36
|
-
|
|
42
|
+
stdin: Result | ExecProcess | string;
|
|
43
|
+
}
|
|
44
|
+
interface SyncOptions extends CommonOptions {
|
|
45
|
+
nodeOptions: SpawnSyncOptions;
|
|
37
46
|
}
|
|
38
47
|
interface TinyExec {
|
|
39
48
|
(command: string, args?: string[], options?: Partial<Options>): Result;
|
|
@@ -65,7 +74,9 @@ declare class ExecProcess implements Result {
|
|
|
65
74
|
protected _onError: (err: Error) => void;
|
|
66
75
|
protected _onClose: () => void;
|
|
67
76
|
}
|
|
77
|
+
declare function xSync(command: string, args?: string[], options?: Partial<SyncOptions>): SyncResult;
|
|
68
78
|
declare const x: TinyExec;
|
|
69
79
|
declare const exec: TinyExec;
|
|
80
|
+
declare const execSync: typeof xSync;
|
|
70
81
|
//#endregion
|
|
71
|
-
export { ExecProcess, KillSignal, NonZeroExitError, Options, Output, OutputApi, PipeOptions, Result, TinyExec, exec, x };
|
|
82
|
+
export { CommonOptions, CommonOutputApi, ExecProcess, KillSignal, NonZeroExitError, Options, Output, OutputApi, OutputApiSync, PipeOptions, Result, SyncOptions, SyncResult, TinyExec, exec, execSync, x, xSync };
|