@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
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const node_util = require('node:util');
|
|
4
|
-
const node_path = require('node:path');
|
|
5
|
-
|
|
6
|
-
function parseStack(stack, message) {
|
|
7
|
-
const cwd = process.cwd() + node_path.sep;
|
|
8
|
-
const lines = stack.split("\n").splice(message.split("\n").length).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
|
|
9
|
-
return lines;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function writeStream(data, stream) {
|
|
13
|
-
const write = stream.__write || stream.write;
|
|
14
|
-
return write.call(stream, data);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const bracket = (x) => x ? `[${x}]` : "";
|
|
18
|
-
class BasicReporter {
|
|
19
|
-
formatStack(stack, message, opts) {
|
|
20
|
-
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
21
|
-
return indent + parseStack(stack, message).join(`
|
|
22
|
-
${indent}`);
|
|
23
|
-
}
|
|
24
|
-
formatError(err, opts) {
|
|
25
|
-
const message = err.message ?? node_util.formatWithOptions(opts, err);
|
|
26
|
-
const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
|
|
27
|
-
const level = opts?.errorLevel || 0;
|
|
28
|
-
const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
|
|
29
|
-
const causedError = err.cause ? "\n\n" + this.formatError(err.cause, { ...opts, errorLevel: level + 1 }) : "";
|
|
30
|
-
return causedPrefix + message + "\n" + stack + causedError;
|
|
31
|
-
}
|
|
32
|
-
formatArgs(args, opts) {
|
|
33
|
-
const _args = args.map((arg) => {
|
|
34
|
-
if (arg && typeof arg.stack === "string") {
|
|
35
|
-
return this.formatError(arg, opts);
|
|
36
|
-
}
|
|
37
|
-
return arg;
|
|
38
|
-
});
|
|
39
|
-
return node_util.formatWithOptions(opts, ..._args);
|
|
40
|
-
}
|
|
41
|
-
formatDate(date, opts) {
|
|
42
|
-
return opts.date ? date.toLocaleTimeString() : "";
|
|
43
|
-
}
|
|
44
|
-
filterAndJoin(arr) {
|
|
45
|
-
return arr.filter(Boolean).join(" ");
|
|
46
|
-
}
|
|
47
|
-
formatLogObj(logObj, opts) {
|
|
48
|
-
const message = this.formatArgs(logObj.args, opts);
|
|
49
|
-
if (logObj.type === "box") {
|
|
50
|
-
return "\n" + [
|
|
51
|
-
bracket(logObj.tag),
|
|
52
|
-
logObj.title && logObj.title,
|
|
53
|
-
...message.split("\n")
|
|
54
|
-
].filter(Boolean).map((l) => " > " + l).join("\n") + "\n";
|
|
55
|
-
}
|
|
56
|
-
return this.filterAndJoin([
|
|
57
|
-
bracket(logObj.type),
|
|
58
|
-
bracket(logObj.tag),
|
|
59
|
-
message
|
|
60
|
-
]);
|
|
61
|
-
}
|
|
62
|
-
log(logObj, ctx) {
|
|
63
|
-
const line = this.formatLogObj(logObj, {
|
|
64
|
-
columns: ctx.options.stdout.columns || 0,
|
|
65
|
-
...ctx.options.formatOptions
|
|
66
|
-
});
|
|
67
|
-
return writeStream(
|
|
68
|
-
line + "\n",
|
|
69
|
-
logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
exports.BasicReporter = BasicReporter;
|
|
75
|
-
exports.parseStack = parseStack;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { formatWithOptions } from 'node:util';
|
|
2
|
-
import { sep } from 'node:path';
|
|
3
|
-
|
|
4
|
-
function parseStack(stack, message) {
|
|
5
|
-
const cwd = process.cwd() + sep;
|
|
6
|
-
const lines = stack.split("\n").splice(message.split("\n").length).map((l) => l.trim().replace("file://", "").replace(cwd, ""));
|
|
7
|
-
return lines;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function writeStream(data, stream) {
|
|
11
|
-
const write = stream.__write || stream.write;
|
|
12
|
-
return write.call(stream, data);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const bracket = (x) => x ? `[${x}]` : "";
|
|
16
|
-
class BasicReporter {
|
|
17
|
-
formatStack(stack, message, opts) {
|
|
18
|
-
const indent = " ".repeat((opts?.errorLevel || 0) + 1);
|
|
19
|
-
return indent + parseStack(stack, message).join(`
|
|
20
|
-
${indent}`);
|
|
21
|
-
}
|
|
22
|
-
formatError(err, opts) {
|
|
23
|
-
const message = err.message ?? formatWithOptions(opts, err);
|
|
24
|
-
const stack = err.stack ? this.formatStack(err.stack, message, opts) : "";
|
|
25
|
-
const level = opts?.errorLevel || 0;
|
|
26
|
-
const causedPrefix = level > 0 ? `${" ".repeat(level)}[cause]: ` : "";
|
|
27
|
-
const causedError = err.cause ? "\n\n" + this.formatError(err.cause, { ...opts, errorLevel: level + 1 }) : "";
|
|
28
|
-
return causedPrefix + message + "\n" + stack + causedError;
|
|
29
|
-
}
|
|
30
|
-
formatArgs(args, opts) {
|
|
31
|
-
const _args = args.map((arg) => {
|
|
32
|
-
if (arg && typeof arg.stack === "string") {
|
|
33
|
-
return this.formatError(arg, opts);
|
|
34
|
-
}
|
|
35
|
-
return arg;
|
|
36
|
-
});
|
|
37
|
-
return formatWithOptions(opts, ..._args);
|
|
38
|
-
}
|
|
39
|
-
formatDate(date, opts) {
|
|
40
|
-
return opts.date ? date.toLocaleTimeString() : "";
|
|
41
|
-
}
|
|
42
|
-
filterAndJoin(arr) {
|
|
43
|
-
return arr.filter(Boolean).join(" ");
|
|
44
|
-
}
|
|
45
|
-
formatLogObj(logObj, opts) {
|
|
46
|
-
const message = this.formatArgs(logObj.args, opts);
|
|
47
|
-
if (logObj.type === "box") {
|
|
48
|
-
return "\n" + [
|
|
49
|
-
bracket(logObj.tag),
|
|
50
|
-
logObj.title && logObj.title,
|
|
51
|
-
...message.split("\n")
|
|
52
|
-
].filter(Boolean).map((l) => " > " + l).join("\n") + "\n";
|
|
53
|
-
}
|
|
54
|
-
return this.filterAndJoin([
|
|
55
|
-
bracket(logObj.type),
|
|
56
|
-
bracket(logObj.tag),
|
|
57
|
-
message
|
|
58
|
-
]);
|
|
59
|
-
}
|
|
60
|
-
log(logObj, ctx) {
|
|
61
|
-
const line = this.formatLogObj(logObj, {
|
|
62
|
-
columns: ctx.options.stdout.columns || 0,
|
|
63
|
-
...ctx.options.formatOptions
|
|
64
|
-
});
|
|
65
|
-
return writeStream(
|
|
66
|
-
line + "\n",
|
|
67
|
-
logObj.level < 2 ? ctx.options.stderr || process.stderr : ctx.options.stdout || process.stdout
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export { BasicReporter as B, parseStack as p };
|
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import * as tty from 'node:tty';
|
|
2
|
-
|
|
3
|
-
const {
|
|
4
|
-
env = {},
|
|
5
|
-
argv = [],
|
|
6
|
-
platform = ""
|
|
7
|
-
} = typeof process === "undefined" ? {} : process;
|
|
8
|
-
const isDisabled = "NO_COLOR" in env || argv.includes("--no-color");
|
|
9
|
-
const isForced = "FORCE_COLOR" in env || argv.includes("--color");
|
|
10
|
-
const isWindows = platform === "win32";
|
|
11
|
-
const isDumbTerminal = env.TERM === "dumb";
|
|
12
|
-
const isCompatibleTerminal = tty && tty.isatty && tty.isatty(1) && env.TERM && !isDumbTerminal;
|
|
13
|
-
const isCI = "CI" in env && ("GITHUB_ACTIONS" in env || "GITLAB_CI" in env || "CIRCLECI" in env);
|
|
14
|
-
const isColorSupported = !isDisabled && (isForced || isWindows && !isDumbTerminal || isCompatibleTerminal || isCI);
|
|
15
|
-
function replaceClose(index, string, close, replace, head = string.slice(0, Math.max(0, index)) + replace, tail = string.slice(Math.max(0, index + close.length)), next = tail.indexOf(close)) {
|
|
16
|
-
return head + (next < 0 ? tail : replaceClose(next, tail, close, replace));
|
|
17
|
-
}
|
|
18
|
-
function clearBleed(index, string, open, close, replace) {
|
|
19
|
-
return index < 0 ? open + string + close : open + replaceClose(index, string, close, replace) + close;
|
|
20
|
-
}
|
|
21
|
-
function filterEmpty(open, close, replace = open, at = open.length + 1) {
|
|
22
|
-
return (string) => string || !(string === "" || string === void 0) ? clearBleed(
|
|
23
|
-
("" + string).indexOf(close, at),
|
|
24
|
-
string,
|
|
25
|
-
open,
|
|
26
|
-
close,
|
|
27
|
-
replace
|
|
28
|
-
) : "";
|
|
29
|
-
}
|
|
30
|
-
function init(open, close, replace) {
|
|
31
|
-
return filterEmpty(`\x1B[${open}m`, `\x1B[${close}m`, replace);
|
|
32
|
-
}
|
|
33
|
-
const colorDefs = {
|
|
34
|
-
reset: init(0, 0),
|
|
35
|
-
bold: init(1, 22, "\x1B[22m\x1B[1m"),
|
|
36
|
-
dim: init(2, 22, "\x1B[22m\x1B[2m"),
|
|
37
|
-
italic: init(3, 23),
|
|
38
|
-
underline: init(4, 24),
|
|
39
|
-
inverse: init(7, 27),
|
|
40
|
-
hidden: init(8, 28),
|
|
41
|
-
strikethrough: init(9, 29),
|
|
42
|
-
black: init(30, 39),
|
|
43
|
-
red: init(31, 39),
|
|
44
|
-
green: init(32, 39),
|
|
45
|
-
yellow: init(33, 39),
|
|
46
|
-
blue: init(34, 39),
|
|
47
|
-
magenta: init(35, 39),
|
|
48
|
-
cyan: init(36, 39),
|
|
49
|
-
white: init(37, 39),
|
|
50
|
-
gray: init(90, 39),
|
|
51
|
-
bgBlack: init(40, 49),
|
|
52
|
-
bgRed: init(41, 49),
|
|
53
|
-
bgGreen: init(42, 49),
|
|
54
|
-
bgYellow: init(43, 49),
|
|
55
|
-
bgBlue: init(44, 49),
|
|
56
|
-
bgMagenta: init(45, 49),
|
|
57
|
-
bgCyan: init(46, 49),
|
|
58
|
-
bgWhite: init(47, 49),
|
|
59
|
-
blackBright: init(90, 39),
|
|
60
|
-
redBright: init(91, 39),
|
|
61
|
-
greenBright: init(92, 39),
|
|
62
|
-
yellowBright: init(93, 39),
|
|
63
|
-
blueBright: init(94, 39),
|
|
64
|
-
magentaBright: init(95, 39),
|
|
65
|
-
cyanBright: init(96, 39),
|
|
66
|
-
whiteBright: init(97, 39),
|
|
67
|
-
bgBlackBright: init(100, 49),
|
|
68
|
-
bgRedBright: init(101, 49),
|
|
69
|
-
bgGreenBright: init(102, 49),
|
|
70
|
-
bgYellowBright: init(103, 49),
|
|
71
|
-
bgBlueBright: init(104, 49),
|
|
72
|
-
bgMagentaBright: init(105, 49),
|
|
73
|
-
bgCyanBright: init(106, 49),
|
|
74
|
-
bgWhiteBright: init(107, 49)
|
|
75
|
-
};
|
|
76
|
-
function createColors(useColor = isColorSupported) {
|
|
77
|
-
return useColor ? colorDefs : Object.fromEntries(Object.keys(colorDefs).map((key) => [key, String]));
|
|
78
|
-
}
|
|
79
|
-
const colors = createColors();
|
|
80
|
-
function getColor(color, fallback = "reset") {
|
|
81
|
-
return colors[color] || colors[fallback];
|
|
82
|
-
}
|
|
83
|
-
function colorize(color, text) {
|
|
84
|
-
return getColor(color)(text);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const ansiRegex = [
|
|
88
|
-
String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,
|
|
89
|
-
String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`
|
|
90
|
-
].join("|");
|
|
91
|
-
function stripAnsi(text) {
|
|
92
|
-
return text.replace(new RegExp(ansiRegex, "g"), "");
|
|
93
|
-
}
|
|
94
|
-
function centerAlign(str, len, space = " ") {
|
|
95
|
-
const free = len - str.length;
|
|
96
|
-
if (free <= 0) {
|
|
97
|
-
return str;
|
|
98
|
-
}
|
|
99
|
-
const freeLeft = Math.floor(free / 2);
|
|
100
|
-
let _str = "";
|
|
101
|
-
for (let i = 0; i < len; i++) {
|
|
102
|
-
_str += i < freeLeft || i >= freeLeft + str.length ? space : str[i - freeLeft];
|
|
103
|
-
}
|
|
104
|
-
return _str;
|
|
105
|
-
}
|
|
106
|
-
function rightAlign(str, len, space = " ") {
|
|
107
|
-
const free = len - str.length;
|
|
108
|
-
if (free <= 0) {
|
|
109
|
-
return str;
|
|
110
|
-
}
|
|
111
|
-
let _str = "";
|
|
112
|
-
for (let i = 0; i < len; i++) {
|
|
113
|
-
_str += i < free ? space : str[i - free];
|
|
114
|
-
}
|
|
115
|
-
return _str;
|
|
116
|
-
}
|
|
117
|
-
function leftAlign(str, len, space = " ") {
|
|
118
|
-
let _str = "";
|
|
119
|
-
for (let i = 0; i < len; i++) {
|
|
120
|
-
_str += i < str.length ? str[i] : space;
|
|
121
|
-
}
|
|
122
|
-
return _str;
|
|
123
|
-
}
|
|
124
|
-
function align(alignment, str, len, space = " ") {
|
|
125
|
-
switch (alignment) {
|
|
126
|
-
case "left": {
|
|
127
|
-
return leftAlign(str, len, space);
|
|
128
|
-
}
|
|
129
|
-
case "right": {
|
|
130
|
-
return rightAlign(str, len, space);
|
|
131
|
-
}
|
|
132
|
-
case "center": {
|
|
133
|
-
return centerAlign(str, len, space);
|
|
134
|
-
}
|
|
135
|
-
default: {
|
|
136
|
-
return str;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const boxStylePresets = {
|
|
142
|
-
solid: {
|
|
143
|
-
tl: "\u250C",
|
|
144
|
-
tr: "\u2510",
|
|
145
|
-
bl: "\u2514",
|
|
146
|
-
br: "\u2518",
|
|
147
|
-
h: "\u2500",
|
|
148
|
-
v: "\u2502"
|
|
149
|
-
},
|
|
150
|
-
double: {
|
|
151
|
-
tl: "\u2554",
|
|
152
|
-
tr: "\u2557",
|
|
153
|
-
bl: "\u255A",
|
|
154
|
-
br: "\u255D",
|
|
155
|
-
h: "\u2550",
|
|
156
|
-
v: "\u2551"
|
|
157
|
-
},
|
|
158
|
-
doubleSingle: {
|
|
159
|
-
tl: "\u2553",
|
|
160
|
-
tr: "\u2556",
|
|
161
|
-
bl: "\u2559",
|
|
162
|
-
br: "\u255C",
|
|
163
|
-
h: "\u2500",
|
|
164
|
-
v: "\u2551"
|
|
165
|
-
},
|
|
166
|
-
doubleSingleRounded: {
|
|
167
|
-
tl: "\u256D",
|
|
168
|
-
tr: "\u256E",
|
|
169
|
-
bl: "\u2570",
|
|
170
|
-
br: "\u256F",
|
|
171
|
-
h: "\u2500",
|
|
172
|
-
v: "\u2551"
|
|
173
|
-
},
|
|
174
|
-
singleThick: {
|
|
175
|
-
tl: "\u250F",
|
|
176
|
-
tr: "\u2513",
|
|
177
|
-
bl: "\u2517",
|
|
178
|
-
br: "\u251B",
|
|
179
|
-
h: "\u2501",
|
|
180
|
-
v: "\u2503"
|
|
181
|
-
},
|
|
182
|
-
singleDouble: {
|
|
183
|
-
tl: "\u2552",
|
|
184
|
-
tr: "\u2555",
|
|
185
|
-
bl: "\u2558",
|
|
186
|
-
br: "\u255B",
|
|
187
|
-
h: "\u2550",
|
|
188
|
-
v: "\u2502"
|
|
189
|
-
},
|
|
190
|
-
singleDoubleRounded: {
|
|
191
|
-
tl: "\u256D",
|
|
192
|
-
tr: "\u256E",
|
|
193
|
-
bl: "\u2570",
|
|
194
|
-
br: "\u256F",
|
|
195
|
-
h: "\u2550",
|
|
196
|
-
v: "\u2502"
|
|
197
|
-
},
|
|
198
|
-
rounded: {
|
|
199
|
-
tl: "\u256D",
|
|
200
|
-
tr: "\u256E",
|
|
201
|
-
bl: "\u2570",
|
|
202
|
-
br: "\u256F",
|
|
203
|
-
h: "\u2500",
|
|
204
|
-
v: "\u2502"
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
const defaultStyle = {
|
|
208
|
-
borderColor: "white",
|
|
209
|
-
borderStyle: "rounded",
|
|
210
|
-
valign: "center",
|
|
211
|
-
padding: 2,
|
|
212
|
-
marginLeft: 1,
|
|
213
|
-
marginTop: 1,
|
|
214
|
-
marginBottom: 1
|
|
215
|
-
};
|
|
216
|
-
function box(text, _opts = {}) {
|
|
217
|
-
const opts = {
|
|
218
|
-
..._opts,
|
|
219
|
-
style: {
|
|
220
|
-
...defaultStyle,
|
|
221
|
-
..._opts.style
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
const textLines = text.split("\n");
|
|
225
|
-
const boxLines = [];
|
|
226
|
-
const _color = getColor(opts.style.borderColor);
|
|
227
|
-
const borderStyle = {
|
|
228
|
-
...typeof opts.style.borderStyle === "string" ? boxStylePresets[opts.style.borderStyle] || boxStylePresets.solid : opts.style.borderStyle
|
|
229
|
-
};
|
|
230
|
-
if (_color) {
|
|
231
|
-
for (const key in borderStyle) {
|
|
232
|
-
borderStyle[key] = _color(
|
|
233
|
-
borderStyle[key]
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
const paddingOffset = opts.style.padding % 2 === 0 ? opts.style.padding : opts.style.padding + 1;
|
|
238
|
-
const height = textLines.length + paddingOffset;
|
|
239
|
-
const width = Math.max(
|
|
240
|
-
...textLines.map((line) => stripAnsi(line).length),
|
|
241
|
-
opts.title ? stripAnsi(opts.title).length : 0
|
|
242
|
-
) + paddingOffset;
|
|
243
|
-
const widthOffset = width + paddingOffset;
|
|
244
|
-
const leftSpace = opts.style.marginLeft > 0 ? " ".repeat(opts.style.marginLeft) : "";
|
|
245
|
-
if (opts.style.marginTop > 0) {
|
|
246
|
-
boxLines.push("".repeat(opts.style.marginTop));
|
|
247
|
-
}
|
|
248
|
-
if (opts.title) {
|
|
249
|
-
const title = _color ? _color(opts.title) : opts.title;
|
|
250
|
-
const left = borderStyle.h.repeat(
|
|
251
|
-
Math.floor((width - stripAnsi(opts.title).length) / 2)
|
|
252
|
-
);
|
|
253
|
-
const right = borderStyle.h.repeat(
|
|
254
|
-
width - stripAnsi(opts.title).length - stripAnsi(left).length + paddingOffset
|
|
255
|
-
);
|
|
256
|
-
boxLines.push(
|
|
257
|
-
`${leftSpace}${borderStyle.tl}${left}${title}${right}${borderStyle.tr}`
|
|
258
|
-
);
|
|
259
|
-
} else {
|
|
260
|
-
boxLines.push(
|
|
261
|
-
`${leftSpace}${borderStyle.tl}${borderStyle.h.repeat(widthOffset)}${borderStyle.tr}`
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
const valignOffset = opts.style.valign === "center" ? Math.floor((height - textLines.length) / 2) : opts.style.valign === "top" ? height - textLines.length - paddingOffset : height - textLines.length;
|
|
265
|
-
for (let i = 0; i < height; i++) {
|
|
266
|
-
if (i < valignOffset || i >= valignOffset + textLines.length) {
|
|
267
|
-
boxLines.push(
|
|
268
|
-
`${leftSpace}${borderStyle.v}${" ".repeat(widthOffset)}${borderStyle.v}`
|
|
269
|
-
);
|
|
270
|
-
} else {
|
|
271
|
-
const line = textLines[i - valignOffset];
|
|
272
|
-
const left = " ".repeat(paddingOffset);
|
|
273
|
-
const right = " ".repeat(width - stripAnsi(line).length);
|
|
274
|
-
boxLines.push(
|
|
275
|
-
`${leftSpace}${borderStyle.v}${left}${line}${right}${borderStyle.v}`
|
|
276
|
-
);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
boxLines.push(
|
|
280
|
-
`${leftSpace}${borderStyle.bl}${borderStyle.h.repeat(widthOffset)}${borderStyle.br}`
|
|
281
|
-
);
|
|
282
|
-
if (opts.style.marginBottom > 0) {
|
|
283
|
-
boxLines.push("".repeat(opts.style.marginBottom));
|
|
284
|
-
}
|
|
285
|
-
return boxLines.join("\n");
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
export { centerAlign as a, align as b, colorize as c, box as d, colors as e, getColor as g, leftAlign as l, rightAlign as r, stripAnsi as s };
|