@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
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { __commonJSMin } from "../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require_constants } from "./constants.mjs";
|
|
3
|
+
import { require_utils } from "./utils.mjs";
|
|
4
|
+
|
|
5
|
+
//#region node_modules/picomatch/lib/scan.js
|
|
6
|
+
var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
7
|
+
const utils = require_utils();
|
|
8
|
+
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants();
|
|
9
|
+
const isPathSeparator = (code) => {
|
|
10
|
+
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
11
|
+
};
|
|
12
|
+
const depth = (token) => {
|
|
13
|
+
if (token.isPrefix !== true) token.depth = token.isGlobstar ? Infinity : 1;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Quickly scans a glob pattern and returns an object with a handful of
|
|
17
|
+
* useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
|
|
18
|
+
* `glob` (the actual pattern), `negated` (true if the path starts with `!` but not
|
|
19
|
+
* with `!(`) and `negatedExtglob` (true if the path starts with `!(`).
|
|
20
|
+
*
|
|
21
|
+
* ```js
|
|
22
|
+
* const pm = require('picomatch');
|
|
23
|
+
* console.log(pm.scan('foo/bar/*.js'));
|
|
24
|
+
* { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
|
|
25
|
+
* ```
|
|
26
|
+
* @param {String} `str`
|
|
27
|
+
* @param {Object} `options`
|
|
28
|
+
* @return {Object} Returns an object with tokens and regex source string.
|
|
29
|
+
* @api public
|
|
30
|
+
*/
|
|
31
|
+
const scan = (input, options) => {
|
|
32
|
+
const opts = options || {};
|
|
33
|
+
const length = input.length - 1;
|
|
34
|
+
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
|
|
35
|
+
const slashes = [];
|
|
36
|
+
const tokens = [];
|
|
37
|
+
const parts = [];
|
|
38
|
+
let str = input;
|
|
39
|
+
let index = -1;
|
|
40
|
+
let start = 0;
|
|
41
|
+
let lastIndex = 0;
|
|
42
|
+
let isBrace = false;
|
|
43
|
+
let isBracket = false;
|
|
44
|
+
let isGlob = false;
|
|
45
|
+
let isExtglob = false;
|
|
46
|
+
let isGlobstar = false;
|
|
47
|
+
let braceEscaped = false;
|
|
48
|
+
let backslashes = false;
|
|
49
|
+
let negated = false;
|
|
50
|
+
let negatedExtglob = false;
|
|
51
|
+
let finished = false;
|
|
52
|
+
let braces = 0;
|
|
53
|
+
let prev;
|
|
54
|
+
let code;
|
|
55
|
+
let token = {
|
|
56
|
+
value: "",
|
|
57
|
+
depth: 0,
|
|
58
|
+
isGlob: false
|
|
59
|
+
};
|
|
60
|
+
const eos = () => index >= length;
|
|
61
|
+
const peek = () => str.charCodeAt(index + 1);
|
|
62
|
+
const advance = () => {
|
|
63
|
+
prev = code;
|
|
64
|
+
return str.charCodeAt(++index);
|
|
65
|
+
};
|
|
66
|
+
while (index < length) {
|
|
67
|
+
code = advance();
|
|
68
|
+
let next;
|
|
69
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
70
|
+
backslashes = token.backslashes = true;
|
|
71
|
+
code = advance();
|
|
72
|
+
if (code === CHAR_LEFT_CURLY_BRACE) braceEscaped = true;
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
|
76
|
+
braces++;
|
|
77
|
+
while (eos() !== true && (code = advance())) {
|
|
78
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
79
|
+
backslashes = token.backslashes = true;
|
|
80
|
+
advance();
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
84
|
+
braces++;
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
88
|
+
isBrace = token.isBrace = true;
|
|
89
|
+
isGlob = token.isGlob = true;
|
|
90
|
+
finished = true;
|
|
91
|
+
if (scanToEnd === true) continue;
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
if (braceEscaped !== true && code === CHAR_COMMA) {
|
|
95
|
+
isBrace = token.isBrace = true;
|
|
96
|
+
isGlob = token.isGlob = true;
|
|
97
|
+
finished = true;
|
|
98
|
+
if (scanToEnd === true) continue;
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
if (code === CHAR_RIGHT_CURLY_BRACE) {
|
|
102
|
+
braces--;
|
|
103
|
+
if (braces === 0) {
|
|
104
|
+
braceEscaped = false;
|
|
105
|
+
isBrace = token.isBrace = true;
|
|
106
|
+
finished = true;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (scanToEnd === true) continue;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
if (code === CHAR_FORWARD_SLASH) {
|
|
115
|
+
slashes.push(index);
|
|
116
|
+
tokens.push(token);
|
|
117
|
+
token = {
|
|
118
|
+
value: "",
|
|
119
|
+
depth: 0,
|
|
120
|
+
isGlob: false
|
|
121
|
+
};
|
|
122
|
+
if (finished === true) continue;
|
|
123
|
+
if (prev === CHAR_DOT && index === start + 1) {
|
|
124
|
+
start += 2;
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
lastIndex = index + 1;
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (opts.noext !== true) {
|
|
131
|
+
if ((code === CHAR_PLUS || code === CHAR_AT || code === CHAR_ASTERISK || code === CHAR_QUESTION_MARK || code === CHAR_EXCLAMATION_MARK) === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
132
|
+
isGlob = token.isGlob = true;
|
|
133
|
+
isExtglob = token.isExtglob = true;
|
|
134
|
+
finished = true;
|
|
135
|
+
if (code === CHAR_EXCLAMATION_MARK && index === start) negatedExtglob = true;
|
|
136
|
+
if (scanToEnd === true) {
|
|
137
|
+
while (eos() !== true && (code = advance())) {
|
|
138
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
139
|
+
backslashes = token.backslashes = true;
|
|
140
|
+
code = advance();
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
144
|
+
isGlob = token.isGlob = true;
|
|
145
|
+
finished = true;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
151
|
+
break;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (code === CHAR_ASTERISK) {
|
|
155
|
+
if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
|
|
156
|
+
isGlob = token.isGlob = true;
|
|
157
|
+
finished = true;
|
|
158
|
+
if (scanToEnd === true) continue;
|
|
159
|
+
break;
|
|
160
|
+
}
|
|
161
|
+
if (code === CHAR_QUESTION_MARK) {
|
|
162
|
+
isGlob = token.isGlob = true;
|
|
163
|
+
finished = true;
|
|
164
|
+
if (scanToEnd === true) continue;
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
168
|
+
while (eos() !== true && (next = advance())) {
|
|
169
|
+
if (next === CHAR_BACKWARD_SLASH) {
|
|
170
|
+
backslashes = token.backslashes = true;
|
|
171
|
+
advance();
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
175
|
+
isBracket = token.isBracket = true;
|
|
176
|
+
isGlob = token.isGlob = true;
|
|
177
|
+
finished = true;
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
if (scanToEnd === true) continue;
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
185
|
+
negated = token.negated = true;
|
|
186
|
+
start++;
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
|
190
|
+
isGlob = token.isGlob = true;
|
|
191
|
+
if (scanToEnd === true) {
|
|
192
|
+
while (eos() !== true && (code = advance())) {
|
|
193
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
194
|
+
backslashes = token.backslashes = true;
|
|
195
|
+
code = advance();
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
199
|
+
finished = true;
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
if (isGlob === true) {
|
|
208
|
+
finished = true;
|
|
209
|
+
if (scanToEnd === true) continue;
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (opts.noext === true) {
|
|
214
|
+
isExtglob = false;
|
|
215
|
+
isGlob = false;
|
|
216
|
+
}
|
|
217
|
+
let base = str;
|
|
218
|
+
let prefix = "";
|
|
219
|
+
let glob = "";
|
|
220
|
+
if (start > 0) {
|
|
221
|
+
prefix = str.slice(0, start);
|
|
222
|
+
str = str.slice(start);
|
|
223
|
+
lastIndex -= start;
|
|
224
|
+
}
|
|
225
|
+
if (base && isGlob === true && lastIndex > 0) {
|
|
226
|
+
base = str.slice(0, lastIndex);
|
|
227
|
+
glob = str.slice(lastIndex);
|
|
228
|
+
} else if (isGlob === true) {
|
|
229
|
+
base = "";
|
|
230
|
+
glob = str;
|
|
231
|
+
} else base = str;
|
|
232
|
+
if (base && base !== "" && base !== "/" && base !== str) {
|
|
233
|
+
if (isPathSeparator(base.charCodeAt(base.length - 1))) base = base.slice(0, -1);
|
|
234
|
+
}
|
|
235
|
+
if (opts.unescape === true) {
|
|
236
|
+
if (glob) glob = utils.removeBackslashes(glob);
|
|
237
|
+
if (base && backslashes === true) base = utils.removeBackslashes(base);
|
|
238
|
+
}
|
|
239
|
+
const state = {
|
|
240
|
+
prefix,
|
|
241
|
+
input,
|
|
242
|
+
start,
|
|
243
|
+
base,
|
|
244
|
+
glob,
|
|
245
|
+
isBrace,
|
|
246
|
+
isBracket,
|
|
247
|
+
isGlob,
|
|
248
|
+
isExtglob,
|
|
249
|
+
isGlobstar,
|
|
250
|
+
negated,
|
|
251
|
+
negatedExtglob
|
|
252
|
+
};
|
|
253
|
+
if (opts.tokens === true) {
|
|
254
|
+
state.maxDepth = 0;
|
|
255
|
+
if (!isPathSeparator(code)) tokens.push(token);
|
|
256
|
+
state.tokens = tokens;
|
|
257
|
+
}
|
|
258
|
+
if (opts.parts === true || opts.tokens === true) {
|
|
259
|
+
let prevIndex;
|
|
260
|
+
for (let idx = 0; idx < slashes.length; idx++) {
|
|
261
|
+
const n = prevIndex ? prevIndex + 1 : start;
|
|
262
|
+
const i = slashes[idx];
|
|
263
|
+
const value = input.slice(n, i);
|
|
264
|
+
if (opts.tokens) {
|
|
265
|
+
if (idx === 0 && start !== 0) {
|
|
266
|
+
tokens[idx].isPrefix = true;
|
|
267
|
+
tokens[idx].value = prefix;
|
|
268
|
+
} else tokens[idx].value = value;
|
|
269
|
+
depth(tokens[idx]);
|
|
270
|
+
state.maxDepth += tokens[idx].depth;
|
|
271
|
+
}
|
|
272
|
+
if (idx !== 0 || value !== "") parts.push(value);
|
|
273
|
+
prevIndex = i;
|
|
274
|
+
}
|
|
275
|
+
if (prevIndex && prevIndex + 1 < input.length) {
|
|
276
|
+
const value = input.slice(prevIndex + 1);
|
|
277
|
+
parts.push(value);
|
|
278
|
+
if (opts.tokens) {
|
|
279
|
+
tokens[tokens.length - 1].value = value;
|
|
280
|
+
depth(tokens[tokens.length - 1]);
|
|
281
|
+
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
state.slashes = slashes;
|
|
285
|
+
state.parts = parts;
|
|
286
|
+
}
|
|
287
|
+
return state;
|
|
288
|
+
};
|
|
289
|
+
module.exports = scan;
|
|
290
|
+
}));
|
|
291
|
+
|
|
292
|
+
//#endregion
|
|
293
|
+
export default require_scan();
|
|
294
|
+
|
|
295
|
+
export { require_scan };
|
|
296
|
+
//# sourceMappingURL=scan.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan.mjs","names":[],"sources":["../../../../node_modules/picomatch/lib/scan.js"],"sourcesContent":["'use strict';\n\nconst utils = require('./utils');\nconst {\n CHAR_ASTERISK, /* * */\n CHAR_AT, /* @ */\n CHAR_BACKWARD_SLASH, /* \\ */\n CHAR_COMMA, /* , */\n CHAR_DOT, /* . */\n CHAR_EXCLAMATION_MARK, /* ! */\n CHAR_FORWARD_SLASH, /* / */\n CHAR_LEFT_CURLY_BRACE, /* { */\n CHAR_LEFT_PARENTHESES, /* ( */\n CHAR_LEFT_SQUARE_BRACKET, /* [ */\n CHAR_PLUS, /* + */\n CHAR_QUESTION_MARK, /* ? */\n CHAR_RIGHT_CURLY_BRACE, /* } */\n CHAR_RIGHT_PARENTHESES, /* ) */\n CHAR_RIGHT_SQUARE_BRACKET /* ] */\n} = require('./constants');\n\nconst isPathSeparator = code => {\n return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;\n};\n\nconst depth = token => {\n if (token.isPrefix !== true) {\n token.depth = token.isGlobstar ? Infinity : 1;\n }\n};\n\n/**\n * Quickly scans a glob pattern and returns an object with a handful of\n * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),\n * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not\n * with `!(`) and `negatedExtglob` (true if the path starts with `!(`).\n *\n * ```js\n * const pm = require('picomatch');\n * console.log(pm.scan('foo/bar/*.js'));\n * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }\n * ```\n * @param {String} `str`\n * @param {Object} `options`\n * @return {Object} Returns an object with tokens and regex source string.\n * @api public\n */\n\nconst scan = (input, options) => {\n const opts = options || {};\n\n const length = input.length - 1;\n const scanToEnd = opts.parts === true || opts.scanToEnd === true;\n const slashes = [];\n const tokens = [];\n const parts = [];\n\n let str = input;\n let index = -1;\n let start = 0;\n let lastIndex = 0;\n let isBrace = false;\n let isBracket = false;\n let isGlob = false;\n let isExtglob = false;\n let isGlobstar = false;\n let braceEscaped = false;\n let backslashes = false;\n let negated = false;\n let negatedExtglob = false;\n let finished = false;\n let braces = 0;\n let prev;\n let code;\n let token = { value: '', depth: 0, isGlob: false };\n\n const eos = () => index >= length;\n const peek = () => str.charCodeAt(index + 1);\n const advance = () => {\n prev = code;\n return str.charCodeAt(++index);\n };\n\n while (index < length) {\n code = advance();\n let next;\n\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n code = advance();\n\n if (code === CHAR_LEFT_CURLY_BRACE) {\n braceEscaped = true;\n }\n continue;\n }\n\n if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {\n braces++;\n\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n advance();\n continue;\n }\n\n if (code === CHAR_LEFT_CURLY_BRACE) {\n braces++;\n continue;\n }\n\n if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {\n isBrace = token.isBrace = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (braceEscaped !== true && code === CHAR_COMMA) {\n isBrace = token.isBrace = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (code === CHAR_RIGHT_CURLY_BRACE) {\n braces--;\n\n if (braces === 0) {\n braceEscaped = false;\n isBrace = token.isBrace = true;\n finished = true;\n break;\n }\n }\n }\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (code === CHAR_FORWARD_SLASH) {\n slashes.push(index);\n tokens.push(token);\n token = { value: '', depth: 0, isGlob: false };\n\n if (finished === true) continue;\n if (prev === CHAR_DOT && index === (start + 1)) {\n start += 2;\n continue;\n }\n\n lastIndex = index + 1;\n continue;\n }\n\n if (opts.noext !== true) {\n const isExtglobChar = code === CHAR_PLUS\n || code === CHAR_AT\n || code === CHAR_ASTERISK\n || code === CHAR_QUESTION_MARK\n || code === CHAR_EXCLAMATION_MARK;\n\n if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {\n isGlob = token.isGlob = true;\n isExtglob = token.isExtglob = true;\n finished = true;\n if (code === CHAR_EXCLAMATION_MARK && index === start) {\n negatedExtglob = true;\n }\n\n if (scanToEnd === true) {\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n code = advance();\n continue;\n }\n\n if (code === CHAR_RIGHT_PARENTHESES) {\n isGlob = token.isGlob = true;\n finished = true;\n break;\n }\n }\n continue;\n }\n break;\n }\n }\n\n if (code === CHAR_ASTERISK) {\n if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n break;\n }\n\n if (code === CHAR_QUESTION_MARK) {\n isGlob = token.isGlob = true;\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n break;\n }\n\n if (code === CHAR_LEFT_SQUARE_BRACKET) {\n while (eos() !== true && (next = advance())) {\n if (next === CHAR_BACKWARD_SLASH) {\n backslashes = token.backslashes = true;\n advance();\n continue;\n }\n\n if (next === CHAR_RIGHT_SQUARE_BRACKET) {\n isBracket = token.isBracket = true;\n isGlob = token.isGlob = true;\n finished = true;\n break;\n }\n }\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n\n if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {\n negated = token.negated = true;\n start++;\n continue;\n }\n\n if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {\n isGlob = token.isGlob = true;\n\n if (scanToEnd === true) {\n while (eos() !== true && (code = advance())) {\n if (code === CHAR_LEFT_PARENTHESES) {\n backslashes = token.backslashes = true;\n code = advance();\n continue;\n }\n\n if (code === CHAR_RIGHT_PARENTHESES) {\n finished = true;\n break;\n }\n }\n continue;\n }\n break;\n }\n\n if (isGlob === true) {\n finished = true;\n\n if (scanToEnd === true) {\n continue;\n }\n\n break;\n }\n }\n\n if (opts.noext === true) {\n isExtglob = false;\n isGlob = false;\n }\n\n let base = str;\n let prefix = '';\n let glob = '';\n\n if (start > 0) {\n prefix = str.slice(0, start);\n str = str.slice(start);\n lastIndex -= start;\n }\n\n if (base && isGlob === true && lastIndex > 0) {\n base = str.slice(0, lastIndex);\n glob = str.slice(lastIndex);\n } else if (isGlob === true) {\n base = '';\n glob = str;\n } else {\n base = str;\n }\n\n if (base && base !== '' && base !== '/' && base !== str) {\n if (isPathSeparator(base.charCodeAt(base.length - 1))) {\n base = base.slice(0, -1);\n }\n }\n\n if (opts.unescape === true) {\n if (glob) glob = utils.removeBackslashes(glob);\n\n if (base && backslashes === true) {\n base = utils.removeBackslashes(base);\n }\n }\n\n const state = {\n prefix,\n input,\n start,\n base,\n glob,\n isBrace,\n isBracket,\n isGlob,\n isExtglob,\n isGlobstar,\n negated,\n negatedExtglob\n };\n\n if (opts.tokens === true) {\n state.maxDepth = 0;\n if (!isPathSeparator(code)) {\n tokens.push(token);\n }\n state.tokens = tokens;\n }\n\n if (opts.parts === true || opts.tokens === true) {\n let prevIndex;\n\n for (let idx = 0; idx < slashes.length; idx++) {\n const n = prevIndex ? prevIndex + 1 : start;\n const i = slashes[idx];\n const value = input.slice(n, i);\n if (opts.tokens) {\n if (idx === 0 && start !== 0) {\n tokens[idx].isPrefix = true;\n tokens[idx].value = prefix;\n } else {\n tokens[idx].value = value;\n }\n depth(tokens[idx]);\n state.maxDepth += tokens[idx].depth;\n }\n if (idx !== 0 || value !== '') {\n parts.push(value);\n }\n prevIndex = i;\n }\n\n if (prevIndex && prevIndex + 1 < input.length) {\n const value = input.slice(prevIndex + 1);\n parts.push(value);\n\n if (opts.tokens) {\n tokens[tokens.length - 1].value = value;\n depth(tokens[tokens.length - 1]);\n state.maxDepth += tokens[tokens.length - 1].depth;\n }\n }\n\n state.slashes = slashes;\n state.parts = parts;\n }\n\n return state;\n};\n\nmodule.exports = scan;\n"],"x_google_ignoreList":[0],"mappings":";;;;;;CAEA,MAAM;CACN,MAAM,EACJ,eACA,SACA,qBACA,YACA,UACA,uBACA,oBACA,uBACA,uBACA,0BACA,WACA,oBACA,wBACA,wBACA;CAGF,MAAM,mBAAkB,SAAQ;AAC9B,SAAO,SAAS,sBAAsB,SAAS;;CAGjD,MAAM,SAAQ,UAAS;AACrB,MAAI,MAAM,aAAa,KACrB,OAAM,QAAQ,MAAM,aAAa,WAAW;;;;;;;;;;;;;;;;;;CAqBhD,MAAM,QAAQ,OAAO,YAAY;EAC/B,MAAM,OAAO,WAAW,EAAE;EAE1B,MAAM,SAAS,MAAM,SAAS;EAC9B,MAAM,YAAY,KAAK,UAAU,QAAQ,KAAK,cAAc;EAC5D,MAAM,UAAU,EAAE;EAClB,MAAM,SAAS,EAAE;EACjB,MAAM,QAAQ,EAAE;EAEhB,IAAI,MAAM;EACV,IAAI,QAAQ;EACZ,IAAI,QAAQ;EACZ,IAAI,YAAY;EAChB,IAAI,UAAU;EACd,IAAI,YAAY;EAChB,IAAI,SAAS;EACb,IAAI,YAAY;EAChB,IAAI,aAAa;EACjB,IAAI,eAAe;EACnB,IAAI,cAAc;EAClB,IAAI,UAAU;EACd,IAAI,iBAAiB;EACrB,IAAI,WAAW;EACf,IAAI,SAAS;EACb,IAAI;EACJ,IAAI;EACJ,IAAI,QAAQ;GAAE,OAAO;GAAI,OAAO;GAAG,QAAQ;GAAO;EAElD,MAAM,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AM,QAAQ,MAAM,MAAM,GAAG,EAAE;AAC/B,QAAI,KAAK,QAAQ;AACf,SAAI,QAAQ,KAAK,UAAU,GAAG;AAC5B,aAAO,KAAK,WAAW;AACvB,aAAO,KAAK,QAAQ;WAEpB,QAAO,KAAK,QAAQ;AAEtB,WAAM,OAAO,KAAK;AAClB,WAAM,YAAY,OAAO,KAAK;;AAEhC,QAAI,QAAQ,KAAK,UAAU,GACzB,OAAM,KAAK,MAAM;AAEnB,gBAAY;;AAGd,OAAI,aAAa,YAAY,IAAI,MAAM,QAAQ;IAC7C,MAAM,QAAQ,MAAM,MAAM,YAAY,EAAE;AACxC,UAAM,KAAK,MAAM;AAEjB,QAAI,KAAK,QAAQ;AACf,YAAO,OAAO,SAAS,GAAG,QAAQ;AAClC,WAAM,OAAO,OAAO,SAAS,GAAG;AAChC,WAAM,YAAY,OAAO,OAAO,SAAS,GAAG;;;AAIhD,SAAM,UAAU;AAChB,SAAM,QAAQ;;AAGhB,SAAO;;AAGT,QAAO,UAAU"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { __commonJSMin, __require } from "../../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require_constants } from "./constants.mjs";
|
|
3
|
+
|
|
4
|
+
//#region node_modules/picomatch/lib/utils.js
|
|
5
|
+
var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
6
|
+
const path = __require("path");
|
|
7
|
+
const win32 = process.platform === "win32";
|
|
8
|
+
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
|
|
9
|
+
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
10
|
+
exports.hasRegexChars = (str) => REGEX_SPECIAL_CHARS.test(str);
|
|
11
|
+
exports.isRegexChar = (str) => str.length === 1 && exports.hasRegexChars(str);
|
|
12
|
+
exports.escapeRegex = (str) => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, "\\$1");
|
|
13
|
+
exports.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
|
|
14
|
+
exports.removeBackslashes = (str) => {
|
|
15
|
+
return str.replace(REGEX_REMOVE_BACKSLASH, (match) => {
|
|
16
|
+
return match === "\\" ? "" : match;
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
exports.supportsLookbehinds = () => {
|
|
20
|
+
const segs = process.version.slice(1).split(".").map(Number);
|
|
21
|
+
if (segs.length === 3 && segs[0] >= 9 || segs[0] === 8 && segs[1] >= 10) return true;
|
|
22
|
+
return false;
|
|
23
|
+
};
|
|
24
|
+
exports.isWindows = (options) => {
|
|
25
|
+
if (options && typeof options.windows === "boolean") return options.windows;
|
|
26
|
+
return win32 === true || path.sep === "\\";
|
|
27
|
+
};
|
|
28
|
+
exports.escapeLast = (input, char, lastIdx) => {
|
|
29
|
+
const idx = input.lastIndexOf(char, lastIdx);
|
|
30
|
+
if (idx === -1) return input;
|
|
31
|
+
if (input[idx - 1] === "\\") return exports.escapeLast(input, char, idx - 1);
|
|
32
|
+
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
33
|
+
};
|
|
34
|
+
exports.removePrefix = (input, state = {}) => {
|
|
35
|
+
let output = input;
|
|
36
|
+
if (output.startsWith("./")) {
|
|
37
|
+
output = output.slice(2);
|
|
38
|
+
state.prefix = "./";
|
|
39
|
+
}
|
|
40
|
+
return output;
|
|
41
|
+
};
|
|
42
|
+
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
43
|
+
let output = `${options.contains ? "" : "^"}(?:${input})${options.contains ? "" : "$"}`;
|
|
44
|
+
if (state.negated === true) output = `(?:^(?!${output}).*$)`;
|
|
45
|
+
return output;
|
|
46
|
+
};
|
|
47
|
+
}));
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export default require_utils();
|
|
51
|
+
|
|
52
|
+
export { require_utils };
|
|
53
|
+
//# sourceMappingURL=utils.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.mjs","names":[],"sources":["../../../../node_modules/picomatch/lib/utils.js"],"sourcesContent":["'use strict';\n\nconst path = require('path');\nconst win32 = process.platform === 'win32';\nconst {\n REGEX_BACKSLASH,\n REGEX_REMOVE_BACKSLASH,\n REGEX_SPECIAL_CHARS,\n REGEX_SPECIAL_CHARS_GLOBAL\n} = require('./constants');\n\nexports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);\nexports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);\nexports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);\nexports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\\\$1');\nexports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');\n\nexports.removeBackslashes = str => {\n return str.replace(REGEX_REMOVE_BACKSLASH, match => {\n return match === '\\\\' ? '' : match;\n });\n};\n\nexports.supportsLookbehinds = () => {\n const segs = process.version.slice(1).split('.').map(Number);\n if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) {\n return true;\n }\n return false;\n};\n\nexports.isWindows = options => {\n if (options && typeof options.windows === 'boolean') {\n return options.windows;\n }\n return win32 === true || path.sep === '\\\\';\n};\n\nexports.escapeLast = (input, char, lastIdx) => {\n const idx = input.lastIndexOf(char, lastIdx);\n if (idx === -1) return input;\n if (input[idx - 1] === '\\\\') return exports.escapeLast(input, char, idx - 1);\n return `${input.slice(0, idx)}\\\\${input.slice(idx)}`;\n};\n\nexports.removePrefix = (input, state = {}) => {\n let output = input;\n if (output.startsWith('./')) {\n output = output.slice(2);\n state.prefix = './';\n }\n return output;\n};\n\nexports.wrapOutput = (input, state = {}, options = {}) => {\n const prepend = options.contains ? '' : '^';\n const append = options.contains ? '' : '$';\n\n let output = `${prepend}(?:${input})${append}`;\n if (state.negated === true) {\n output = `(?:^(?!${output}).*$)`;\n }\n return output;\n};\n"],"x_google_ignoreList":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B,YAAS,OAAO,MAAM,EAAE;AACxB,SAAM,SAAS;;AAEjB,SAAO;;AAGT,SAAQ,cAAc,OAAO,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK;EAIxD,IAAI,SAAS,GAHG,QAAQ,WAAW,KAAK,IAGhB,KAAK,MAAM,GAFpB,QAAQ,WAAW,KAAK;AAGvC,MAAI,MAAM,YAAY,KACpB,UAAS,UAAU,OAAO;AAE5B,SAAO"}
|
package/dist/plugin.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;;;;;AAaA;;;;;;iBAAgB,OAAA,CAAQ,WAAA,GAAc,OAAA,CAAQ,aAAA,IAAiB,MAAA"}
|
package/dist/plugin.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { isLaravel } from "./utils/detect.mjs";
|
|
2
|
+
|
|
1
3
|
//#region src/plugin.ts
|
|
2
4
|
/**
|
|
3
5
|
* Maizzle Vite plugin for use inside an existing Vite project.
|
|
@@ -10,16 +12,31 @@
|
|
|
10
12
|
*/
|
|
11
13
|
function maizzle(configInput) {
|
|
12
14
|
let maizzleServer = null;
|
|
15
|
+
if (isLaravel()) {
|
|
16
|
+
const existing = configInput?.components?.source;
|
|
17
|
+
const laravelComponentDir = "resources/js/components/email";
|
|
18
|
+
if (!existing) configInput = {
|
|
19
|
+
...configInput,
|
|
20
|
+
components: {
|
|
21
|
+
...configInput?.components,
|
|
22
|
+
source: [laravelComponentDir]
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
13
26
|
return [{
|
|
14
27
|
name: "maizzle",
|
|
15
28
|
async configureServer(hostServer) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
if (maizzleServer) {
|
|
30
|
+
await maizzleServer.close();
|
|
31
|
+
maizzleServer = null;
|
|
32
|
+
}
|
|
33
|
+
const { serve } = await import("./serve.mjs");
|
|
34
|
+
maizzleServer = await serve({ config: configInput });
|
|
35
|
+
hostServer.httpServer?.on("close", () => {
|
|
36
|
+
if (maizzleServer) {
|
|
37
|
+
maizzleServer.close();
|
|
38
|
+
maizzleServer = null;
|
|
39
|
+
}
|
|
23
40
|
});
|
|
24
41
|
},
|
|
25
42
|
async closeBundle() {
|
package/dist/plugin.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.mjs","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["import type { Plugin, ViteDevServer } from 'vite'\nimport type { MaizzleConfig } from './types/index.ts'\n\n/**\n * Maizzle Vite plugin for use inside an existing Vite project.\n *\n * - During `vite dev`: starts a separate Maizzle dev server on its own port\n * - During `vite build`: builds email templates alongside the host app\n *\n * Does NOT inject Vue, Tailwind, or any other plugins into the host's pipeline.\n * The host app manages its own stack. Maizzle runs in its own process.\n */\nexport function maizzle(configInput?: Partial<MaizzleConfig>): Plugin[] {\n let maizzleServer: ViteDevServer | null = null\n\n return [{\n name: 'maizzle',\n\n async configureServer(hostServer) {\n const { serve
|
|
1
|
+
{"version":3,"file":"plugin.mjs","names":[],"sources":["../src/plugin.ts"],"sourcesContent":["import type { Plugin, ViteDevServer } from 'vite'\nimport type { MaizzleConfig } from './types/index.ts'\nimport { isLaravel } from './utils/detect.ts'\n\n/**\n * Maizzle Vite plugin for use inside an existing Vite project.\n *\n * - During `vite dev`: starts a separate Maizzle dev server on its own port\n * - During `vite build`: builds email templates alongside the host app\n *\n * Does NOT inject Vue, Tailwind, or any other plugins into the host's pipeline.\n * The host app manages its own stack. Maizzle runs in its own process.\n */\nexport function maizzle(configInput?: Partial<MaizzleConfig>): Plugin[] {\n let maizzleServer: ViteDevServer | null = null\n\n // Auto-configure defaults for Laravel projects\n if (isLaravel()) {\n const existing = configInput?.components?.source\n const laravelComponentDir = 'resources/js/components/email'\n\n if (!existing) {\n configInput = {\n ...configInput,\n components: {\n ...configInput?.components,\n source: [laravelComponentDir],\n },\n }\n }\n }\n\n return [{\n name: 'maizzle',\n\n async configureServer(hostServer) {\n // Close previous Maizzle server if the host restarts\n if (maizzleServer) {\n await maizzleServer.close()\n maizzleServer = null\n }\n\n const { serve } = await import('./serve.ts')\n maizzleServer = await serve({ config: configInput })\n\n // Clean up when the host server closes\n hostServer.httpServer?.on('close', () => {\n if (maizzleServer) {\n maizzleServer.close()\n maizzleServer = null\n }\n })\n },\n\n async closeBundle() {\n if (this.meta.watchMode) return\n\n const { build } = await import('./build.ts')\n await build({ config: configInput })\n },\n\n async buildEnd() {\n if (maizzleServer) {\n await maizzleServer.close()\n maizzleServer = null\n }\n },\n }]\n}\n"],"mappings":";;;;;;;;;;;;AAaA,SAAgB,QAAQ,aAAgD;CACtE,IAAI,gBAAsC;AAG1C,KAAI,WAAW,EAAE;EACf,MAAM,WAAW,aAAa,YAAY;EAC1C,MAAM,sBAAsB;AAE5B,MAAI,CAAC,SACH,eAAc;GACZ,GAAG;GACH,YAAY;IACV,GAAG,aAAa;IAChB,QAAQ,CAAC,oBAAoB;IAC9B;GACF;;AAIL,QAAO,CAAC;EACN,MAAM;EAEN,MAAM,gBAAgB,YAAY;AAEhC,OAAI,eAAe;AACjB,UAAM,cAAc,OAAO;AAC3B,oBAAgB;;GAGlB,MAAM,EAAE,UAAU,MAAM,OAAO;AAC/B,mBAAgB,MAAM,MAAM,EAAE,QAAQ,aAAa,CAAC;AAGpD,cAAW,YAAY,GAAG,eAAe;AACvC,QAAI,eAAe;AACjB,mBAAc,OAAO;AACrB,qBAAgB;;KAElB;;EAGJ,MAAM,cAAc;AAClB,OAAI,KAAK,KAAK,UAAW;GAEzB,MAAM,EAAE,UAAU,MAAM,OAAO;AAC/B,SAAM,MAAM,EAAE,QAAQ,aAAa,CAAC;;EAGtC,MAAM,WAAW;AACf,OAAI,eAAe;AACjB,UAAM,cAAc,OAAO;AAC3B,oBAAgB;;;EAGrB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwindCleanup.d.mts","names":[],"sources":["../../../src/plugins/postcss/tailwindCleanup.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"tailwindCleanup.d.mts","names":[],"sources":["../../../src/plugins/postcss/tailwindCleanup.ts"],"mappings":";;;;;;AA0CA;;;;;;;;iBAAgB,eAAA,CAAgB,MAAA,EAAQ,aAAA,GAAgB,OAAA,CAAQ,MAAA"}
|
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
const DEFAULT_SELECTORS = [":host", ":lang"];
|
|
3
3
|
const DEFAULT_AT_RULES = ["layer", "property"];
|
|
4
4
|
/**
|
|
5
|
+
* Split a selector list on top-level commas only.
|
|
6
|
+
*
|
|
7
|
+
* Commas inside parenthesised groups like `:not(:is(:lang(ae), :lang(ar)))`
|
|
8
|
+
* are not treated as selector separators.
|
|
9
|
+
*/
|
|
10
|
+
function splitSelector(selector) {
|
|
11
|
+
const parts = [];
|
|
12
|
+
let depth = 0;
|
|
13
|
+
let start = 0;
|
|
14
|
+
for (let i = 0; i < selector.length; i++) {
|
|
15
|
+
const ch = selector[i];
|
|
16
|
+
if (ch === "(") depth++;
|
|
17
|
+
else if (ch === ")") depth--;
|
|
18
|
+
else if (ch === "," && depth === 0) {
|
|
19
|
+
parts.push(selector.slice(start, i).trim());
|
|
20
|
+
start = i + 1;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
parts.push(selector.slice(start).trim());
|
|
24
|
+
return parts.filter(Boolean);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
5
27
|
* Removes CSS rules whose every comma-separated selector part starts with
|
|
6
28
|
* one of the configured prefixes (e.g. ':host', ':lang'). Rules with mixed
|
|
7
29
|
* selectors have the unwanted parts stripped.
|
|
@@ -14,20 +36,29 @@ const DEFAULT_AT_RULES = ["layer", "property"];
|
|
|
14
36
|
function tailwindCleanup(config) {
|
|
15
37
|
const selectors = config.postcss?.removeSelectors ?? DEFAULT_SELECTORS;
|
|
16
38
|
const atRules = config.postcss?.removeAtRules ?? DEFAULT_AT_RULES;
|
|
17
|
-
return [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
return [
|
|
40
|
+
{
|
|
41
|
+
postcssPlugin: "tailwind-cleanup-selectors",
|
|
42
|
+
Rule(rule) {
|
|
43
|
+
const parts = splitSelector(rule.selector);
|
|
44
|
+
const kept = parts.filter((p) => !selectors.some((s) => p === s || p.includes(`${s}(`)));
|
|
45
|
+
if (kept.length === 0) rule.remove();
|
|
46
|
+
else if (kept.length < parts.length) rule.selector = kept.join(", ");
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
postcssPlugin: "tailwind-cleanup-at-rules",
|
|
51
|
+
AtRule(rule) {
|
|
52
|
+
if (atRules.includes(rule.name)) rule.remove();
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
postcssPlugin: "tailwind-cleanup-text-decoration",
|
|
57
|
+
Declaration(decl) {
|
|
58
|
+
if (decl.prop === "text-decoration-line") decl.prop = "text-decoration";
|
|
59
|
+
}
|
|
29
60
|
}
|
|
30
|
-
|
|
61
|
+
];
|
|
31
62
|
}
|
|
32
63
|
|
|
33
64
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwindCleanup.mjs","names":[],"sources":["../../../src/plugins/postcss/tailwindCleanup.ts"],"sourcesContent":["import postcss from 'postcss'\nimport type { MaizzleConfig } from '../../types/config.ts'\n\nconst DEFAULT_SELECTORS = [':host', ':lang']\nconst DEFAULT_AT_RULES = ['layer', 'property']\n\n/**\n * Removes CSS rules whose every comma-separated selector part starts with\n * one of the configured prefixes (e.g. ':host', ':lang'). Rules with mixed\n * selectors have the unwanted parts stripped.\n *\n * Also removes entire at-rules by name (e.g. '@layer', '@property').\n *\n * Intended to clean up Tailwind's compiled output after lightningcss has\n * flattened all modern CSS syntax.\n */\nexport function tailwindCleanup(config: MaizzleConfig): postcss.Plugin[] {\n const selectors: string[] = config.postcss?.removeSelectors ?? DEFAULT_SELECTORS\n const atRules: string[] = config.postcss?.removeAtRules ?? DEFAULT_AT_RULES\n\n return [\n {\n postcssPlugin: 'tailwind-cleanup-selectors',\n Rule(rule) {\n const parts = rule.selector
|
|
1
|
+
{"version":3,"file":"tailwindCleanup.mjs","names":[],"sources":["../../../src/plugins/postcss/tailwindCleanup.ts"],"sourcesContent":["import postcss from 'postcss'\nimport type { MaizzleConfig } from '../../types/config.ts'\n\nconst DEFAULT_SELECTORS = [':host', ':lang']\nconst DEFAULT_AT_RULES = ['layer', 'property']\n\n/**\n * Split a selector list on top-level commas only.\n *\n * Commas inside parenthesised groups like `:not(:is(:lang(ae), :lang(ar)))`\n * are not treated as selector separators.\n */\nfunction splitSelector(selector: string): string[] {\n const parts: string[] = []\n let depth = 0\n let start = 0\n\n for (let i = 0; i < selector.length; i++) {\n const ch = selector[i]\n if (ch === '(') depth++\n else if (ch === ')') depth--\n else if (ch === ',' && depth === 0) {\n parts.push(selector.slice(start, i).trim())\n start = i + 1\n }\n }\n\n parts.push(selector.slice(start).trim())\n\n return parts.filter(Boolean)\n}\n\n/**\n * Removes CSS rules whose every comma-separated selector part starts with\n * one of the configured prefixes (e.g. ':host', ':lang'). Rules with mixed\n * selectors have the unwanted parts stripped.\n *\n * Also removes entire at-rules by name (e.g. '@layer', '@property').\n *\n * Intended to clean up Tailwind's compiled output after lightningcss has\n * flattened all modern CSS syntax.\n */\nexport function tailwindCleanup(config: MaizzleConfig): postcss.Plugin[] {\n const selectors: string[] = config.postcss?.removeSelectors ?? DEFAULT_SELECTORS\n const atRules: string[] = config.postcss?.removeAtRules ?? DEFAULT_AT_RULES\n\n return [\n {\n postcssPlugin: 'tailwind-cleanup-selectors',\n Rule(rule) {\n const parts = splitSelector(rule.selector)\n const kept = parts.filter(p => !selectors.some(s => p === s || p.includes(`${s}(`)))\n if (kept.length === 0) {\n rule.remove()\n } else if (kept.length < parts.length) {\n rule.selector = kept.join(', ')\n }\n },\n },\n {\n postcssPlugin: 'tailwind-cleanup-at-rules',\n AtRule(rule) {\n if (atRules.includes(rule.name)) {\n rule.remove()\n }\n },\n },\n {\n postcssPlugin: 'tailwind-cleanup-text-decoration',\n Declaration(decl) {\n if (decl.prop === 'text-decoration-line') {\n decl.prop = 'text-decoration'\n }\n },\n },\n ]\n}\n"],"mappings":";AAGA,MAAM,oBAAoB,CAAC,SAAS,QAAQ;AAC5C,MAAM,mBAAmB,CAAC,SAAS,WAAW;;;;;;;AAQ9C,SAAS,cAAc,UAA4B;CACjD,MAAM,QAAkB,EAAE;CAC1B,IAAI,QAAQ;CACZ,IAAI,QAAQ;AAEZ,MAAK,IAAI,IAAI,GAAG,IAAI,SAAS,QAAQ,KAAK;EACxC,MAAM,KAAK,SAAS;AACpB,MAAI,OAAO,IAAK;WACP,OAAO,IAAK;WACZ,OAAO,OAAO,UAAU,GAAG;AAClC,SAAM,KAAK,SAAS,MAAM,OAAO,EAAE,CAAC,MAAM,CAAC;AAC3C,WAAQ,IAAI;;;AAIhB,OAAM,KAAK,SAAS,MAAM,MAAM,CAAC,MAAM,CAAC;AAExC,QAAO,MAAM,OAAO,QAAQ;;;;;;;;;;;;AAa9B,SAAgB,gBAAgB,QAAyC;CACvE,MAAM,YAAsB,OAAO,SAAS,mBAAmB;CAC/D,MAAM,UAAoB,OAAO,SAAS,iBAAiB;AAE3D,QAAO;EACL;GACE,eAAe;GACf,KAAK,MAAM;IACT,MAAM,QAAQ,cAAc,KAAK,SAAS;IAC1C,MAAM,OAAO,MAAM,QAAO,MAAK,CAAC,UAAU,MAAK,MAAK,MAAM,KAAK,EAAE,SAAS,GAAG,EAAE,GAAG,CAAC,CAAC;AACpF,QAAI,KAAK,WAAW,EAClB,MAAK,QAAQ;aACJ,KAAK,SAAS,MAAM,OAC7B,MAAK,WAAW,KAAK,KAAK,KAAK;;GAGpC;EACD;GACE,eAAe;GACf,OAAO,MAAM;AACX,QAAI,QAAQ,SAAS,KAAK,KAAK,CAC7B,MAAK,QAAQ;;GAGlB;EACD;GACE,eAAe;GACf,YAAY,MAAM;AAChB,QAAI,KAAK,SAAS,uBAChB,MAAK,OAAO;;GAGjB;EACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { MaizzleConfig } from "../types/config.mjs";
|
|
1
|
+
import { MaizzleConfig, MarkdownConfig } from "../types/config.mjs";
|
|
2
2
|
import { RenderContext } from "../composables/renderContext.mjs";
|
|
3
3
|
import { Component } from "vue";
|
|
4
|
-
import {
|
|
4
|
+
import { InlineConfig } from "vite";
|
|
5
5
|
|
|
6
6
|
//#region src/render/createRenderer.d.ts
|
|
7
7
|
interface RenderedTemplate {
|
|
@@ -14,13 +14,20 @@ interface RenderedTemplate {
|
|
|
14
14
|
interface Renderer {
|
|
15
15
|
render(input: string | Component, config: MaizzleConfig): Promise<RenderedTemplate>;
|
|
16
16
|
invalidate(filePath: string): Promise<void>;
|
|
17
|
+
invalidateAll(): Promise<void>;
|
|
17
18
|
close(): Promise<void>;
|
|
18
19
|
}
|
|
19
20
|
interface CreateRendererOptions {
|
|
20
21
|
/** Generate .d.ts files for auto-imports and components (default: false) */
|
|
21
22
|
dts?: boolean;
|
|
22
23
|
/** Options passed to unplugin-vue-markdown */
|
|
23
|
-
markdown?:
|
|
24
|
+
markdown?: MarkdownConfig;
|
|
25
|
+
/** Root directory for resolving user component dirs and .d.ts output */
|
|
26
|
+
root?: string;
|
|
27
|
+
/** Additional component directories to register for auto-import */
|
|
28
|
+
componentDirs?: string[];
|
|
29
|
+
/** User Vite config options to merge into the internal SSR server */
|
|
30
|
+
vite?: InlineConfig;
|
|
24
31
|
}
|
|
25
32
|
/**
|
|
26
33
|
* Lightweight Vite SSR loader for rendering Vue SFC email templates.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createRenderer.d.mts","names":[],"sources":["../../src/render/createRenderer.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"createRenderer.d.mts","names":[],"sources":["../../src/render/createRenderer.ts"],"mappings":";;;;;;UAyJiB,gBAAA;EACf,IAAA;EACA,OAAA;EACA,cAAA,EAAgB,aAAA;EAChB,gBAAA,EAAkB,aAAA;EAClB,SAAA,GAAY,aAAA;AAAA;AAAA,UAGG,QAAA;EACf,MAAA,CAAO,KAAA,WAAgB,SAAA,EAAW,MAAA,EAAQ,aAAA,GAAgB,OAAA,CAAQ,gBAAA;EAClE,UAAA,CAAW,QAAA,WAAmB,OAAA;EAC9B,aAAA,IAAiB,OAAA;EACjB,KAAA,IAAS,OAAA;AAAA;AAAA,UAGM,qBAAA;EAZC;EAchB,GAAA;EAbkB;EAelB,QAAA,GAAW,cAAA;EAdC;EAgBZ,IAAA;EAhByB;EAkBzB,aAAA;EAfuB;EAiBvB,IAAA,GAAO,YAAA;AAAA;;;;;;;iBASa,cAAA,CACpB,OAAA,GAAS,qBAAA,GACR,OAAA,CAAQ,QAAA"}
|