@maizzle/framework 6.1.4 → 6.1.5
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/dist/build.d.ts +3 -4
- package/dist/build.d.ts.map +1 -1
- package/dist/build.js +1 -5
- package/dist/build.js.map +1 -1
- package/dist/components/utils.d.ts +10 -11
- package/dist/components/utils.d.ts.map +1 -1
- package/dist/composables/defineConfig.d.ts +1 -2
- package/dist/composables/defineConfig.d.ts.map +1 -1
- package/dist/composables/renderContext.d.ts +4 -5
- package/dist/composables/renderContext.d.ts.map +1 -1
- package/dist/composables/useBaseUrl.d.ts +1 -2
- package/dist/composables/useBaseUrl.d.ts.map +1 -1
- package/dist/composables/useConfig.d.ts +2 -3
- package/dist/composables/useConfig.d.ts.map +1 -1
- package/dist/composables/useCurrentTemplate.d.ts +2 -3
- package/dist/composables/useCurrentTemplate.d.ts.map +1 -1
- package/dist/composables/useDoctype.d.ts +1 -2
- package/dist/composables/useDoctype.d.ts.map +1 -1
- package/dist/composables/useEvent.d.ts +1 -2
- package/dist/composables/useEvent.d.ts.map +1 -1
- package/dist/composables/useFont.d.ts +3 -4
- package/dist/composables/useFont.d.ts.map +1 -1
- package/dist/composables/useOutlookFallback.d.ts +1 -2
- package/dist/composables/useOutlookFallback.d.ts.map +1 -1
- package/dist/composables/useOutputPath.d.ts +1 -2
- package/dist/composables/useOutputPath.d.ts.map +1 -1
- package/dist/composables/usePlaintext.d.ts +2 -3
- package/dist/composables/usePlaintext.d.ts.map +1 -1
- package/dist/composables/usePreheader.d.ts +2 -3
- package/dist/composables/usePreheader.d.ts.map +1 -1
- package/dist/composables/useTransformers.d.ts +1 -2
- package/dist/composables/useTransformers.d.ts.map +1 -1
- package/dist/composables/useUrlQuery.d.ts +1 -2
- package/dist/composables/useUrlQuery.d.ts.map +1 -1
- package/dist/config/defaults.d.ts +1 -2
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/index.d.ts +4 -4
- package/dist/config/index.d.ts.map +1 -1
- package/dist/events/index.d.ts +4 -5
- package/dist/events/index.d.ts.map +1 -1
- package/dist/plaintext.d.ts +1 -2
- package/dist/plaintext.d.ts.map +1 -1
- package/dist/plugin.d.ts +1 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugins/postcss/flattenGradients.d.ts +3 -3
- package/dist/plugins/postcss/flattenGradients.d.ts.map +1 -1
- package/dist/plugins/postcss/mergeMediaQueries.d.ts +1 -2
- package/dist/plugins/postcss/mergeMediaQueries.d.ts.map +1 -1
- package/dist/plugins/postcss/pruneVars.d.ts +2 -2
- package/dist/plugins/postcss/pruneVars.d.ts.map +1 -1
- package/dist/plugins/postcss/quoteFontFamilies.d.ts +2 -3
- package/dist/plugins/postcss/quoteFontFamilies.d.ts.map +1 -1
- package/dist/plugins/postcss/removeDeclarations.d.ts +4 -4
- package/dist/plugins/postcss/removeDeclarations.d.ts.map +1 -1
- package/dist/plugins/postcss/resolveMaizzleImports.d.ts +1 -2
- package/dist/plugins/postcss/resolveMaizzleImports.d.ts.map +1 -1
- package/dist/plugins/postcss/resolveProps.d.ts +2 -2
- package/dist/plugins/postcss/resolveProps.d.ts.map +1 -1
- package/dist/plugins/postcss/tailwindCleanup.d.ts +1 -2
- package/dist/plugins/postcss/tailwindCleanup.d.ts.map +1 -1
- package/dist/prepare.d.ts +2 -3
- package/dist/prepare.d.ts.map +1 -1
- package/dist/render/active.d.ts +2 -3
- package/dist/render/active.d.ts.map +1 -1
- package/dist/render/buildTemplate.d.ts +5 -6
- package/dist/render/buildTemplate.d.ts.map +1 -1
- package/dist/render/createRenderer.d.ts +4 -5
- package/dist/render/createRenderer.d.ts.map +1 -1
- package/dist/render/index.d.ts +3 -3
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/injectFonts.d.ts +1 -2
- package/dist/render/injectFonts.d.ts.map +1 -1
- package/dist/render/parallel/buildWorker.d.ts +3 -4
- package/dist/render/parallel/buildWorker.d.ts.map +1 -1
- package/dist/render/plugins/codeBlockExtract.d.ts +1 -2
- package/dist/render/plugins/codeBlockExtract.d.ts.map +1 -1
- package/dist/render/plugins/markdownExtract.d.ts +1 -2
- package/dist/render/plugins/markdownExtract.d.ts.map +1 -1
- package/dist/render/plugins/rawExtract.d.ts +1 -2
- package/dist/render/plugins/rawExtract.d.ts.map +1 -1
- package/dist/render/plugins/rowSourceLocation.d.ts +1 -2
- package/dist/render/plugins/rowSourceLocation.d.ts.map +1 -1
- package/dist/serve.d.ts +3 -4
- package/dist/serve.d.ts.map +1 -1
- package/dist/serve.js +46 -3
- package/dist/serve.js.map +1 -1
- package/dist/server/compatibility.d.ts +2 -3
- package/dist/server/compatibility.d.ts.map +1 -1
- package/dist/server/email.d.ts +2 -3
- package/dist/server/email.d.ts.map +1 -1
- package/dist/server/linter.d.ts +3 -4
- package/dist/server/linter.d.ts.map +1 -1
- package/dist/server/sfc-utils.d.ts +6 -7
- package/dist/server/sfc-utils.d.ts.map +1 -1
- package/dist/server/static.d.ts +10 -0
- package/dist/server/static.d.ts.map +1 -0
- package/dist/server/static.js +71 -0
- package/dist/server/static.js.map +1 -0
- package/dist/server/ui/.vite/deps/@lucide_vue.js +1 -1
- package/dist/server/ui/.vite/deps/@vueuse_core.js +1 -1
- package/dist/server/ui/.vite/deps/@vueuse_shared.js +1 -1
- package/dist/server/ui/.vite/deps/_metadata.json +15 -15
- package/dist/server/ui/.vite/deps/reka-ui.js +1 -2
- package/dist/server/ui/.vite/deps/reka-ui.js.map +1 -1
- package/dist/server/ui/.vite/deps/vue-router.js +1 -1
- package/dist/server/ui/.vite/deps/vue.js +1 -1
- package/dist/server/ui/.vite/deps/{vue.runtime.esm-bundler-S54atuNJ.js → vue.runtime.esm-bundler-Dq07uCLt.js} +174 -53
- package/dist/server/ui/.vite/deps/vue.runtime.esm-bundler-Dq07uCLt.js.map +1 -0
- package/dist/tests/render/_helpers.d.ts +2 -3
- package/dist/tests/render/_helpers.d.ts.map +1 -1
- package/dist/transformers/addAttributes.d.ts +2 -3
- package/dist/transformers/addAttributes.d.ts.map +1 -1
- package/dist/transformers/attributeToStyle.d.ts +2 -3
- package/dist/transformers/attributeToStyle.d.ts.map +1 -1
- package/dist/transformers/base.d.ts +3 -4
- package/dist/transformers/base.d.ts.map +1 -1
- package/dist/transformers/columnWidth.d.ts +1 -2
- package/dist/transformers/columnWidth.d.ts.map +1 -1
- package/dist/transformers/entities.d.ts +3 -4
- package/dist/transformers/entities.d.ts.map +1 -1
- package/dist/transformers/filters/defaults.d.ts +2 -3
- package/dist/transformers/filters/defaults.d.ts.map +1 -1
- package/dist/transformers/filters/index.d.ts +4 -4
- package/dist/transformers/filters/index.d.ts.map +1 -1
- package/dist/transformers/format.d.ts +2 -2
- package/dist/transformers/format.d.ts.map +1 -1
- package/dist/transformers/imgWidth.d.ts +1 -2
- package/dist/transformers/imgWidth.d.ts.map +1 -1
- package/dist/transformers/index.d.ts +1 -2
- package/dist/transformers/index.d.ts.map +1 -1
- package/dist/transformers/inlineCss.d.ts +3 -4
- package/dist/transformers/inlineCss.d.ts.map +1 -1
- package/dist/transformers/inlineLink.d.ts +2 -3
- package/dist/transformers/inlineLink.d.ts.map +1 -1
- package/dist/transformers/minify.d.ts +2 -2
- package/dist/transformers/minify.d.ts.map +1 -1
- package/dist/transformers/minifyCodeInline.d.ts +1 -2
- package/dist/transformers/minifyCodeInline.d.ts.map +1 -1
- package/dist/transformers/msoConditionals.d.ts +1 -2
- package/dist/transformers/msoConditionals.d.ts.map +1 -1
- package/dist/transformers/msoPlaceholders.d.ts +1 -2
- package/dist/transformers/msoPlaceholders.d.ts.map +1 -1
- package/dist/transformers/purgeCss.d.ts +3 -4
- package/dist/transformers/purgeCss.d.ts.map +1 -1
- package/dist/transformers/removeAttributes.d.ts +4 -5
- package/dist/transformers/removeAttributes.d.ts.map +1 -1
- package/dist/transformers/replaceStrings.d.ts +1 -2
- package/dist/transformers/replaceStrings.d.ts.map +1 -1
- package/dist/transformers/safeSelectors.d.ts +2 -3
- package/dist/transformers/safeSelectors.d.ts.map +1 -1
- package/dist/transformers/shorthandCss.d.ts +3 -4
- package/dist/transformers/shorthandCss.d.ts.map +1 -1
- package/dist/transformers/sixHex.d.ts +2 -3
- package/dist/transformers/sixHex.d.ts.map +1 -1
- package/dist/transformers/tailwindComponent.d.ts +1 -2
- package/dist/transformers/tailwindComponent.d.ts.map +1 -1
- package/dist/transformers/tailwindcss.d.ts +2 -3
- package/dist/transformers/tailwindcss.d.ts.map +1 -1
- package/dist/transformers/urlQuery.d.ts +2 -3
- package/dist/transformers/urlQuery.d.ts.map +1 -1
- package/dist/types/config.d.ts +18 -19
- package/dist/types/config.d.ts.map +1 -1
- package/dist/utils/ast/parser.d.ts +1 -2
- package/dist/utils/ast/parser.d.ts.map +1 -1
- package/dist/utils/ast/serializer.d.ts +1 -2
- package/dist/utils/ast/serializer.d.ts.map +1 -1
- package/dist/utils/ast/walker.d.ts +1 -2
- package/dist/utils/ast/walker.d.ts.map +1 -1
- package/dist/utils/cloneConfig.d.ts +1 -2
- package/dist/utils/cloneConfig.d.ts.map +1 -1
- package/dist/utils/compileTailwindCss.d.ts +4 -5
- package/dist/utils/compileTailwindCss.d.ts.map +1 -1
- package/dist/utils/componentSources.d.ts +4 -5
- package/dist/utils/componentSources.d.ts.map +1 -1
- package/dist/utils/cssBox.d.ts +6 -7
- package/dist/utils/cssBox.d.ts.map +1 -1
- package/dist/utils/decodeStyleEntities.d.ts +1 -2
- package/dist/utils/decodeStyleEntities.d.ts.map +1 -1
- package/dist/utils/detect.d.ts +1 -2
- package/dist/utils/detect.d.ts.map +1 -1
- package/dist/utils/output-markers.d.ts +4 -5
- package/dist/utils/output-markers.d.ts.map +1 -1
- package/dist/utils/staticPaths.d.ts +5 -0
- package/dist/utils/staticPaths.d.ts.map +1 -0
- package/dist/utils/staticPaths.js +11 -0
- package/dist/utils/staticPaths.js.map +1 -0
- package/dist/utils/url.d.ts +4 -5
- package/dist/utils/url.d.ts.map +1 -1
- package/dist/utils/watchPaths.d.ts +2 -3
- package/dist/utils/watchPaths.d.ts.map +1 -1
- package/node_modules/tinyexec/dist/main.d.mts +5 -3
- package/node_modules/tinyexec/dist/main.mjs +256 -232
- package/node_modules/tinyexec/package.json +9 -9
- package/package.json +5 -5
- package/dist/server/ui/.vite/deps/vue.runtime.esm-bundler-S54atuNJ.js.map +0 -1
package/dist/build.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MaizzleConfig } from "./types/config.js";
|
|
2
2
|
import "./types/index.js";
|
|
3
3
|
//#region src/build.d.ts
|
|
4
|
-
interface BuildResult {
|
|
4
|
+
export interface BuildResult {
|
|
5
5
|
files: string[];
|
|
6
6
|
config: MaizzleConfig;
|
|
7
7
|
}
|
|
@@ -15,7 +15,7 @@ interface BuildResult {
|
|
|
15
15
|
* to load config from a specific file path. Omit to load `maizzle.config`
|
|
16
16
|
* from the working directory.
|
|
17
17
|
*/
|
|
18
|
-
declare function build(configInput?: Partial<MaizzleConfig> | string): Promise<BuildResult>;
|
|
18
|
+
export declare function build(configInput?: Partial<MaizzleConfig> | string): Promise<BuildResult>;
|
|
19
19
|
/**
|
|
20
20
|
* Decide whether to build in parallel and with how many workers.
|
|
21
21
|
*
|
|
@@ -30,10 +30,9 @@ declare function build(configInput?: Partial<MaizzleConfig> | string): Promise<B
|
|
|
30
30
|
* applies to file-based configs (a path or the default cwd config) — an inline
|
|
31
31
|
* config object has no file to reload and always builds sequentially.
|
|
32
32
|
*/
|
|
33
|
-
declare function resolveParallel(config: MaizzleConfig, count: number, configInput: Partial<MaizzleConfig> | string | undefined): {
|
|
33
|
+
export declare function resolveParallel(config: MaizzleConfig, count: number, configInput: Partial<MaizzleConfig> | string | undefined): {
|
|
34
34
|
enabled: boolean;
|
|
35
35
|
workers: number;
|
|
36
36
|
};
|
|
37
37
|
//#endregion
|
|
38
|
-
export { BuildResult, build, resolveParallel };
|
|
39
38
|
//# sourceMappingURL=build.d.ts.map
|
package/dist/build.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","names":[],"sources":["../src/build.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"build.d.ts","names":[],"sources":["../src/build.ts"],"mappings":";;;iBAciB;EACf;EACA,QAAQ;;;;;;;;;;;;wBAaY,MAAM,cAAc,QAAQ,0BAA0B,QAAQ;;;;;;;;;;;;;;;wBA0HpE,gBACd,QAAQ,eACR,eACA,aAAa,QAAQ;EAClB;EAAkB"}
|
package/dist/build.js
CHANGED
|
@@ -2,6 +2,7 @@ import { resolveConfig } from "./config/index.js";
|
|
|
2
2
|
import { EventManager } from "./events/index.js";
|
|
3
3
|
import { normalizeComponentSources } from "./utils/componentSources.js";
|
|
4
4
|
import { createRenderer } from "./render/createRenderer.js";
|
|
5
|
+
import { staticBase } from "./utils/staticPaths.js";
|
|
5
6
|
import { buildTemplate, computeContentBase } from "./render/buildTemplate.js";
|
|
6
7
|
import { cpSync, existsSync, mkdirSync, rmSync } from "node:fs";
|
|
7
8
|
import { dirname, join, parse, relative, resolve, sep } from "node:path";
|
|
@@ -225,11 +226,6 @@ async function copyStatic(config, outputPath) {
|
|
|
225
226
|
cpSync(file, destPath);
|
|
226
227
|
}
|
|
227
228
|
}
|
|
228
|
-
/** Absolute static (non-glob) prefix of a source pattern, used as the strip base. */
|
|
229
|
-
function staticBase(pattern) {
|
|
230
|
-
const staticPart = pattern.split(/[*{?[]/)[0];
|
|
231
|
-
return resolve(/[/\\]$/.test(staticPart) ? staticPart : dirname(staticPart));
|
|
232
|
-
}
|
|
233
229
|
//#endregion
|
|
234
230
|
export { build, resolveParallel };
|
|
235
231
|
|
package/dist/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","names":["parsePath"],"sources":["../src/build.ts"],"sourcesContent":["import { mkdirSync, cpSync, existsSync, rmSync } from 'node:fs'\nimport { resolve, dirname, relative, join, parse as parsePath, sep } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { availableParallelism } from 'node:os'\nimport { glob } from 'tinyglobby'\nimport ora from 'ora'\nimport { resolveConfig } from './config/index.ts'\nimport { EventManager } from './events/index.ts'\nimport { createRenderer } from './render/createRenderer.ts'\nimport { normalizeComponentSources } from './utils/componentSources.ts'\nimport { buildTemplate, computeContentBase } from './render/buildTemplate.ts'\nimport type { MaizzleConfig } from './types/index.ts'\n\nexport interface BuildResult {\n files: string[]\n config: MaizzleConfig\n}\n\n/**\n * Build all SFC email templates to HTML files.\n *\n * Creates a single Renderer instance, then loops through each template\n * calling render → transformers → write to disk.\n *\n * Pass a `Partial<MaizzleConfig>` to override config inline, or a string\n * to load config from a specific file path. Omit to load `maizzle.config`\n * from the working directory.\n */\nexport async function build(configInput?: Partial<MaizzleConfig> | string): Promise<BuildResult> {\n const start = Date.now()\n const spinner = ora({ text: 'Building templates...', spinner: 'circleHalves' }).start()\n\n try {\n const config = await resolveConfig(configInput)\n\n const events = new EventManager()\n events.registerConfig(config)\n await events.fireBeforeCreate({ config })\n\n const outputPath = resolve(config.output?.path ?? 'dist')\n const outputExtension = config.output?.extension ?? 'html'\n\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const contentBase = computeContentBase(contentPatterns)\n const templateFiles = await glob(contentPatterns)\n\n if (templateFiles.length === 0) {\n spinner.succeed('No templates found')\n return { files: [], config }\n }\n\n // Clear the output directory before writing fresh output. Guard against a\n // misconfigured output.path (e.g. '.', '', '../..') that resolves to the\n // project root or a parent of it — rmSync would wipe the whole project.\n const cwd = process.cwd()\n if (outputPath === parsePath(outputPath).root || outputPath === cwd || cwd.startsWith(outputPath + sep)) {\n throw new Error(`Refusing to clear output path \"${outputPath}\": it is the filesystem root, the current working directory, or a parent of it. Set output.path to a subdirectory like \"dist\".`)\n }\n\n if (existsSync(outputPath)) {\n rmSync(outputPath, { recursive: true, force: true })\n }\n\n const outputFiles: string[] = []\n let droppedAfterBuild = 0\n\n const parallel = resolveParallel(config, templateFiles.length, configInput)\n\n if (parallel.enabled) {\n spinner.text = `Building ${templateFiles.length} templates across ${parallel.workers} workers...`\n\n const result = await runParallelBuild({\n templateFiles,\n workers: parallel.workers,\n config,\n configInput,\n outputPath,\n outputExtension,\n contentBase,\n })\n\n outputFiles.push(...result.files)\n droppedAfterBuild = result.sfcAfterBuildCount\n\n await copyStatic(config, outputPath)\n await events.fireAfterBuild({ files: outputFiles, config })\n } else {\n const renderer = await createRenderer({ markdown: config.markdown, root: config.root, componentDirs: normalizeComponentSources(config.components?.source, process.cwd()), vite: config.vite, customElements: config.vue?.customElements })\n\n try {\n for (const templatePath of templateFiles) {\n const { files } = await buildTemplate(templatePath, { config, renderer, events, outputPath, outputExtension, contentBase })\n outputFiles.push(...files)\n }\n\n await copyStatic(config, outputPath)\n await events.fireAfterBuild({ files: outputFiles, config })\n } finally {\n await renderer.close()\n }\n }\n\n if (droppedAfterBuild > 0) {\n console.warn(`[maizzle] Skipped ${droppedAfterBuild} SFC-registered afterBuild handler(s): afterBuild can't run inside a parallel build worker. Move build-completion logic to the config's afterBuild hook.`)\n }\n\n const duration = ((Date.now() - start) / 1000).toFixed(2)\n const count = outputFiles.length\n spinner.stopAndPersist({\n symbol: '✅',\n text: `Built ${count} template${count !== 1 ? 's' : ''} in ${duration}s`,\n })\n\n return { files: outputFiles, config }\n } catch (err) {\n // Stop the spinner so a thrown error doesn't leave it spinning forever.\n if (spinner.isSpinning) spinner.fail('Build failed')\n throw err\n }\n}\n\n/**\n * Default template count above which parallel build turns on. Benchmarked\n * crossover (with the worker cap below) is ~25 templates; 50 leaves margin so\n * auto-parallel only kicks in where it's a reliable win across hardware.\n * Override per project with `parallel: { threshold }`.\n */\nconst DEFAULT_PARALLEL_THRESHOLD = 50\n\n/**\n * Default worker cap. Each worker runs a full Vite SSR renderer, so startup +\n * contention outweighs added parallelism past ~8 — benchmarks showed 8 beating\n * 12/16/23 at every size. Override with `parallel: { workers }`.\n */\nconst DEFAULT_MAX_WORKERS = 8\n\n/**\n * Decide whether to build in parallel and with how many workers.\n *\n * `config.parallel`:\n * - omitted → parallel when `count > 50`, min(CPU count − 1, 8) workers\n * - `true` → always parallel (ignores threshold), default workers\n * - `false` → always sequential\n * - `{ workers, threshold }` → parallel when `count > threshold` (default 50),\n * using `workers` threads (default min(CPU count − 1, 8))\n *\n * Workers reload the config file to recover function hooks, so parallel only\n * applies to file-based configs (a path or the default cwd config) — an inline\n * config object has no file to reload and always builds sequentially.\n */\nexport function resolveParallel(\n config: MaizzleConfig,\n count: number,\n configInput: Partial<MaizzleConfig> | string | undefined,\n): { enabled: boolean; workers: number } {\n const setting = config.parallel\n if (setting === false) return { enabled: false, workers: 0 }\n\n const fileBased = typeof configInput === 'string' || configInput == null\n if (!fileBased) return { enabled: false, workers: 0 }\n\n const cpus = availableParallelism()\n const defaultWorkers = Math.min(Math.max(1, cpus - 1), DEFAULT_MAX_WORKERS)\n\n let maxWorkers = defaultWorkers\n let threshold = DEFAULT_PARALLEL_THRESHOLD\n // `true` opts in regardless of count; object/omitted stay threshold-gated.\n const ignoreThreshold = setting === true\n\n if (typeof setting === 'object' && setting !== null) {\n if (typeof setting.workers === 'number' && setting.workers > 0) maxWorkers = Math.floor(setting.workers)\n if (typeof setting.threshold === 'number' && setting.threshold >= 0) threshold = Math.floor(setting.threshold)\n }\n\n if (!ignoreThreshold && count <= threshold) return { enabled: false, workers: 0 }\n\n const workers = Math.min(maxWorkers, count)\n return { enabled: workers >= 2 && count >= 2, workers }\n}\n\n/**\n * Run the build across worker threads. Each worker reloads the config (for its\n * function hooks), builds its batch via the same `buildTemplate` as the\n * sequential path, and returns the files it wrote. beforeCreate/afterBuild stay\n * on the main thread (handled by the caller).\n */\nasync function runParallelBuild(opts: {\n templateFiles: string[]\n workers: number\n config: MaizzleConfig\n configInput: Partial<MaizzleConfig> | string | undefined\n outputPath: string\n outputExtension: string\n contentBase: string\n}): Promise<{ files: string[]; sfcAfterBuildCount: number }> {\n const { templateFiles, workers, config, configInput, outputPath, outputExtension, contentBase } = opts\n\n const { default: Tinypool } = await import('tinypool')\n const workerPath = resolve(dirname(fileURLToPath(import.meta.url)), 'render/parallel/worker.mjs')\n\n const configPath = typeof configInput === 'string' ? configInput : undefined\n // Serializable snapshot of the post-beforeCreate config (functions dropped).\n const configData = JSON.parse(JSON.stringify(config)) as Partial<MaizzleConfig>\n\n const batches = shardEvenly(templateFiles, workers)\n\n const pool = new Tinypool({ filename: workerPath, minThreads: batches.length, maxThreads: batches.length })\n\n try {\n const results = await Promise.all(\n batches.map(templatePaths => pool.run({\n templatePaths,\n configPath,\n configData,\n outputPath,\n outputExtension,\n contentBase,\n })),\n )\n\n return {\n files: results.flatMap(r => r.files),\n sfcAfterBuildCount: results.reduce((n, r) => n + r.sfcAfterBuildCount, 0),\n }\n } finally {\n await pool.destroy()\n }\n}\n\n/** Round-robin items into up to `buckets` non-empty groups for even balance. */\nfunction shardEvenly<T>(items: T[], buckets: number): T[][] {\n const out: T[][] = Array.from({ length: buckets }, () => [])\n items.forEach((item, i) => out[i % buckets].push(item))\n return out.filter(b => b.length > 0)\n}\n\nasync function copyStatic(config: MaizzleConfig, outputPath: string): Promise<void> {\n const sources = config.static?.source ?? ['public/**/*.*']\n const destination = config.static?.destination ?? 'public'\n\n // One glob call so negation patterns still apply across the whole set.\n const files = await glob(sources)\n\n // Absolute base dir to strip, per positive source pattern. Each file keeps\n // the structure under its own pattern's base — using only sources[0] sends\n // files from other roots to the wrong place (or escaping the output dir).\n const bases = sources.filter(s => !s.startsWith('!')).map(staticBase)\n\n for (const file of files) {\n const abs = resolve(file)\n const base = bases\n .filter(b => abs === b || abs.startsWith(b + sep))\n .sort((a, b) => b.length - a.length)[0] ?? bases[0] ?? resolve('.')\n\n const destPath = join(outputPath, destination, relative(base, abs))\n const destDir = dirname(destPath)\n\n if (!existsSync(destDir)) {\n mkdirSync(destDir, { recursive: true })\n }\n\n cpSync(file, destPath)\n }\n}\n\n/** Absolute static (non-glob) prefix of a source pattern, used as the strip base. */\nfunction staticBase(pattern: string): string {\n const staticPart = pattern.split(/[*{?[]/)[0]\n // Treat both separators as trailing: resolved patterns use '\\' on Windows.\n return resolve(/[/\\\\]$/.test(staticPart) ? staticPart : dirname(staticPart))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA4BA,eAAsB,MAAM,aAAqE;CAC/F,MAAM,QAAQ,KAAK,IAAI;CACvB,MAAM,UAAU,IAAI;EAAE,MAAM;EAAyB,SAAS;CAAe,CAAC,CAAC,CAAC,MAAM;CAEtF,IAAI;EACF,MAAM,SAAS,MAAM,cAAc,WAAW;EAE9C,MAAM,SAAS,IAAI,aAAa;EAChC,OAAO,eAAe,MAAM;EAC5B,MAAM,OAAO,iBAAiB,EAAE,OAAO,CAAC;EAExC,MAAM,aAAa,QAAQ,OAAO,QAAQ,QAAQ,MAAM;EACxD,MAAM,kBAAkB,OAAO,QAAQ,aAAa;EAEpD,MAAM,kBAAkB,OAAO,WAAW,CAAC,iBAAiB;EAC5D,MAAM,cAAc,mBAAmB,eAAe;EACtD,MAAM,gBAAgB,MAAM,KAAK,eAAe;EAEhD,IAAI,cAAc,WAAW,GAAG;GAC9B,QAAQ,QAAQ,oBAAoB;GACpC,OAAO;IAAE,OAAO,CAAC;IAAG;GAAO;EAC7B;EAKA,MAAM,MAAM,QAAQ,IAAI;EACxB,IAAI,eAAeA,MAAU,UAAU,CAAC,CAAC,QAAQ,eAAe,OAAO,IAAI,WAAW,aAAa,GAAG,GACpG,MAAM,IAAI,MAAM,kCAAkC,WAAW,+HAA+H;EAG9L,IAAI,WAAW,UAAU,GACvB,OAAO,YAAY;GAAE,WAAW;GAAM,OAAO;EAAK,CAAC;EAGrD,MAAM,cAAwB,CAAC;EAC/B,IAAI,oBAAoB;EAExB,MAAM,WAAW,gBAAgB,QAAQ,cAAc,QAAQ,WAAW;EAE1E,IAAI,SAAS,SAAS;GACpB,QAAQ,OAAO,YAAY,cAAc,OAAO,oBAAoB,SAAS,QAAQ;GAErF,MAAM,SAAS,MAAM,iBA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Q,CAAC,CAAC;CAE3C,OAAO,QAAQ,SAAS,KAAK,UAAU,IAAI,aAAa,QAAQ,UAAU,CAAC;AAC7E"}
|
|
1
|
+
{"version":3,"file":"build.js","names":["parsePath"],"sources":["../src/build.ts"],"sourcesContent":["import { mkdirSync, cpSync, existsSync, rmSync } from 'node:fs'\nimport { resolve, dirname, relative, join, parse as parsePath, sep } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { availableParallelism } from 'node:os'\nimport { glob } from 'tinyglobby'\nimport ora from 'ora'\nimport { resolveConfig } from './config/index.ts'\nimport { EventManager } from './events/index.ts'\nimport { createRenderer } from './render/createRenderer.ts'\nimport { normalizeComponentSources } from './utils/componentSources.ts'\nimport { staticBase } from './utils/staticPaths.ts'\nimport { buildTemplate, computeContentBase } from './render/buildTemplate.ts'\nimport type { MaizzleConfig } from './types/index.ts'\n\nexport interface BuildResult {\n files: string[]\n config: MaizzleConfig\n}\n\n/**\n * Build all SFC email templates to HTML files.\n *\n * Creates a single Renderer instance, then loops through each template\n * calling render → transformers → write to disk.\n *\n * Pass a `Partial<MaizzleConfig>` to override config inline, or a string\n * to load config from a specific file path. Omit to load `maizzle.config`\n * from the working directory.\n */\nexport async function build(configInput?: Partial<MaizzleConfig> | string): Promise<BuildResult> {\n const start = Date.now()\n const spinner = ora({ text: 'Building templates...', spinner: 'circleHalves' }).start()\n\n try {\n const config = await resolveConfig(configInput)\n\n const events = new EventManager()\n events.registerConfig(config)\n await events.fireBeforeCreate({ config })\n\n const outputPath = resolve(config.output?.path ?? 'dist')\n const outputExtension = config.output?.extension ?? 'html'\n\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const contentBase = computeContentBase(contentPatterns)\n const templateFiles = await glob(contentPatterns)\n\n if (templateFiles.length === 0) {\n spinner.succeed('No templates found')\n return { files: [], config }\n }\n\n // Clear the output directory before writing fresh output. Guard against a\n // misconfigured output.path (e.g. '.', '', '../..') that resolves to the\n // project root or a parent of it — rmSync would wipe the whole project.\n const cwd = process.cwd()\n if (outputPath === parsePath(outputPath).root || outputPath === cwd || cwd.startsWith(outputPath + sep)) {\n throw new Error(`Refusing to clear output path \"${outputPath}\": it is the filesystem root, the current working directory, or a parent of it. Set output.path to a subdirectory like \"dist\".`)\n }\n\n if (existsSync(outputPath)) {\n rmSync(outputPath, { recursive: true, force: true })\n }\n\n const outputFiles: string[] = []\n let droppedAfterBuild = 0\n\n const parallel = resolveParallel(config, templateFiles.length, configInput)\n\n if (parallel.enabled) {\n spinner.text = `Building ${templateFiles.length} templates across ${parallel.workers} workers...`\n\n const result = await runParallelBuild({\n templateFiles,\n workers: parallel.workers,\n config,\n configInput,\n outputPath,\n outputExtension,\n contentBase,\n })\n\n outputFiles.push(...result.files)\n droppedAfterBuild = result.sfcAfterBuildCount\n\n await copyStatic(config, outputPath)\n await events.fireAfterBuild({ files: outputFiles, config })\n } else {\n const renderer = await createRenderer({ markdown: config.markdown, root: config.root, componentDirs: normalizeComponentSources(config.components?.source, process.cwd()), vite: config.vite, customElements: config.vue?.customElements })\n\n try {\n for (const templatePath of templateFiles) {\n const { files } = await buildTemplate(templatePath, { config, renderer, events, outputPath, outputExtension, contentBase })\n outputFiles.push(...files)\n }\n\n await copyStatic(config, outputPath)\n await events.fireAfterBuild({ files: outputFiles, config })\n } finally {\n await renderer.close()\n }\n }\n\n if (droppedAfterBuild > 0) {\n console.warn(`[maizzle] Skipped ${droppedAfterBuild} SFC-registered afterBuild handler(s): afterBuild can't run inside a parallel build worker. Move build-completion logic to the config's afterBuild hook.`)\n }\n\n const duration = ((Date.now() - start) / 1000).toFixed(2)\n const count = outputFiles.length\n spinner.stopAndPersist({\n symbol: '✅',\n text: `Built ${count} template${count !== 1 ? 's' : ''} in ${duration}s`,\n })\n\n return { files: outputFiles, config }\n } catch (err) {\n // Stop the spinner so a thrown error doesn't leave it spinning forever.\n if (spinner.isSpinning) spinner.fail('Build failed')\n throw err\n }\n}\n\n/**\n * Default template count above which parallel build turns on. Benchmarked\n * crossover (with the worker cap below) is ~25 templates; 50 leaves margin so\n * auto-parallel only kicks in where it's a reliable win across hardware.\n * Override per project with `parallel: { threshold }`.\n */\nconst DEFAULT_PARALLEL_THRESHOLD = 50\n\n/**\n * Default worker cap. Each worker runs a full Vite SSR renderer, so startup +\n * contention outweighs added parallelism past ~8 — benchmarks showed 8 beating\n * 12/16/23 at every size. Override with `parallel: { workers }`.\n */\nconst DEFAULT_MAX_WORKERS = 8\n\n/**\n * Decide whether to build in parallel and with how many workers.\n *\n * `config.parallel`:\n * - omitted → parallel when `count > 50`, min(CPU count − 1, 8) workers\n * - `true` → always parallel (ignores threshold), default workers\n * - `false` → always sequential\n * - `{ workers, threshold }` → parallel when `count > threshold` (default 50),\n * using `workers` threads (default min(CPU count − 1, 8))\n *\n * Workers reload the config file to recover function hooks, so parallel only\n * applies to file-based configs (a path or the default cwd config) — an inline\n * config object has no file to reload and always builds sequentially.\n */\nexport function resolveParallel(\n config: MaizzleConfig,\n count: number,\n configInput: Partial<MaizzleConfig> | string | undefined,\n): { enabled: boolean; workers: number } {\n const setting = config.parallel\n if (setting === false) return { enabled: false, workers: 0 }\n\n const fileBased = typeof configInput === 'string' || configInput == null\n if (!fileBased) return { enabled: false, workers: 0 }\n\n const cpus = availableParallelism()\n const defaultWorkers = Math.min(Math.max(1, cpus - 1), DEFAULT_MAX_WORKERS)\n\n let maxWorkers = defaultWorkers\n let threshold = DEFAULT_PARALLEL_THRESHOLD\n // `true` opts in regardless of count; object/omitted stay threshold-gated.\n const ignoreThreshold = setting === true\n\n if (typeof setting === 'object' && setting !== null) {\n if (typeof setting.workers === 'number' && setting.workers > 0) maxWorkers = Math.floor(setting.workers)\n if (typeof setting.threshold === 'number' && setting.threshold >= 0) threshold = Math.floor(setting.threshold)\n }\n\n if (!ignoreThreshold && count <= threshold) return { enabled: false, workers: 0 }\n\n const workers = Math.min(maxWorkers, count)\n return { enabled: workers >= 2 && count >= 2, workers }\n}\n\n/**\n * Run the build across worker threads. Each worker reloads the config (for its\n * function hooks), builds its batch via the same `buildTemplate` as the\n * sequential path, and returns the files it wrote. beforeCreate/afterBuild stay\n * on the main thread (handled by the caller).\n */\nasync function runParallelBuild(opts: {\n templateFiles: string[]\n workers: number\n config: MaizzleConfig\n configInput: Partial<MaizzleConfig> | string | undefined\n outputPath: string\n outputExtension: string\n contentBase: string\n}): Promise<{ files: string[]; sfcAfterBuildCount: number }> {\n const { templateFiles, workers, config, configInput, outputPath, outputExtension, contentBase } = opts\n\n const { default: Tinypool } = await import('tinypool')\n const workerPath = resolve(dirname(fileURLToPath(import.meta.url)), 'render/parallel/worker.mjs')\n\n const configPath = typeof configInput === 'string' ? configInput : undefined\n // Serializable snapshot of the post-beforeCreate config (functions dropped).\n const configData = JSON.parse(JSON.stringify(config)) as Partial<MaizzleConfig>\n\n const batches = shardEvenly(templateFiles, workers)\n\n const pool = new Tinypool({ filename: workerPath, minThreads: batches.length, maxThreads: batches.length })\n\n try {\n const results = await Promise.all(\n batches.map(templatePaths => pool.run({\n templatePaths,\n configPath,\n configData,\n outputPath,\n outputExtension,\n contentBase,\n })),\n )\n\n return {\n files: results.flatMap(r => r.files),\n sfcAfterBuildCount: results.reduce((n, r) => n + r.sfcAfterBuildCount, 0),\n }\n } finally {\n await pool.destroy()\n }\n}\n\n/** Round-robin items into up to `buckets` non-empty groups for even balance. */\nfunction shardEvenly<T>(items: T[], buckets: number): T[][] {\n const out: T[][] = Array.from({ length: buckets }, () => [])\n items.forEach((item, i) => out[i % buckets].push(item))\n return out.filter(b => b.length > 0)\n}\n\nasync function copyStatic(config: MaizzleConfig, outputPath: string): Promise<void> {\n const sources = config.static?.source ?? ['public/**/*.*']\n const destination = config.static?.destination ?? 'public'\n\n // One glob call so negation patterns still apply across the whole set.\n const files = await glob(sources)\n\n // Absolute base dir to strip, per positive source pattern. Each file keeps\n // the structure under its own pattern's base — using only sources[0] sends\n // files from other roots to the wrong place (or escaping the output dir).\n const bases = sources.filter(s => !s.startsWith('!')).map(staticBase)\n\n for (const file of files) {\n const abs = resolve(file)\n const base = bases\n .filter(b => abs === b || abs.startsWith(b + sep))\n .sort((a, b) => b.length - a.length)[0] ?? bases[0] ?? resolve('.')\n\n const destPath = join(outputPath, destination, relative(base, abs))\n const destDir = dirname(destPath)\n\n if (!existsSync(destDir)) {\n mkdirSync(destDir, { recursive: true })\n }\n\n cpSync(file, destPath)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AA6BA,eAAsB,MAAM,aAAqE;CAC/F,MAAM,QAAQ,KAAK,IAAI;CACvB,MAAM,UAAU,IAAI;EAAE,MAAM;EAAyB,SAAS;CAAe,CAAC,CAAC,CAAC,MAAM;CAEtF,IAAI;EACF,MAAM,SAAS,MAAM,cAAc,WAAW;EAE9C,MAAM,SAAS,IAAI,aAAa;EAChC,OAAO,eAAe,MAAM;EAC5B,MAAM,OAAO,iBAAiB,EAAE,OAAO,CAAC;EAExC,MAAM,aAAa,QAAQ,OAAO,QAAQ,QAAQ,MAAM;EACxD,MAAM,kBAAkB,OAAO,QAAQ,aAAa;EAEpD,MAAM,kBAAkB,OAAO,WAAW,CAAC,iBAAiB;EAC5D,MAAM,cAAc,mBAAmB,eAAe;EACtD,MAAM,gBAAgB,MAAM,KAAK,eAAe;EAEhD,IAAI,cAAc,WAAW,GAAG;GAC9B,QAAQ,QAAQ,oBAAoB;GACpC,OAAO;IAAE,OAAO,CAAC;IAAG;GAAO;EAC7B;EAKA,MAAM,MAAM,QAAQ,IAAI;EACxB,IAAI,eAAeA,MAAU,UAAU,CAAC,CAAC,QAAQ,eAAe,OAAO,IAAI,WAAW,aAAa,GAAG,GACpG,MAAM,IAAI,MAAM,kCAAkC,WAAW,+HAA+H;EAG9L,IAAI,WAAW,UAAU,GACvB,OAAO,YAAY;GAAE,WAAW;GAAM,OAAO;EAAK,CAAC;EAGrD,MAAM,cAAwB,CAAC;EAC/B,IAAI,oBAAoB;EAExB,MAAM,WAAW,gBAAgB,QAAQ,cAAc,QAAQ,WAAW;EA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AK,CAAC;EAGxC,OAAO,MAAM,QAAQ;CACvB;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/components/utils.d.ts
|
|
2
|
-
declare function normalizeToPixels(value: string | number): string;
|
|
2
|
+
export declare function normalizeToPixels(value: string | number): string;
|
|
3
3
|
/**
|
|
4
4
|
* Module-scoped sequential ID generator. Used by components to mint
|
|
5
5
|
* unique marker ids (e.g. `c1`, `c2`) for the post-render transformer.
|
|
@@ -8,18 +8,18 @@ declare function normalizeToPixels(value: string | number): string;
|
|
|
8
8
|
* `<script setup>` into the component's `setup()` function — any
|
|
9
9
|
* `let counter = 0` there resets per instance, causing id collisions.
|
|
10
10
|
*/
|
|
11
|
-
declare function nextId(prefix: string): string;
|
|
12
|
-
declare function hasWidthUtility(classStr: string): boolean;
|
|
13
|
-
declare function hasWidthInStyle(styleStr: string): boolean;
|
|
14
|
-
declare function hasHeightUtility(classStr: string): boolean;
|
|
15
|
-
declare function hasHeightInStyle(styleStr: string): boolean;
|
|
11
|
+
export declare function nextId(prefix: string): string;
|
|
12
|
+
export declare function hasWidthUtility(classStr: string): boolean;
|
|
13
|
+
export declare function hasWidthInStyle(styleStr: string): boolean;
|
|
14
|
+
export declare function hasHeightUtility(classStr: string): boolean;
|
|
15
|
+
export declare function hasHeightInStyle(styleStr: string): boolean;
|
|
16
16
|
/**
|
|
17
17
|
* Shared prop for components that emit MSO/VML fallback markup. The
|
|
18
18
|
* `null` default acts as the "unset" sentinel — `useOutlookFallback`
|
|
19
19
|
* treats `null` as inherit-from-ancestor (root default `true`),
|
|
20
20
|
* letting users override per-component without losing inheritance.
|
|
21
21
|
*/
|
|
22
|
-
declare const outlookFallbackProp: {
|
|
22
|
+
export declare const outlookFallbackProp: {
|
|
23
23
|
readonly type: BooleanConstructor;
|
|
24
24
|
readonly default: null;
|
|
25
25
|
};
|
|
@@ -29,7 +29,7 @@ declare const outlookFallbackProp: {
|
|
|
29
29
|
* `m-0` strips the browser's default `<pre>` margins so it isn't spaced
|
|
30
30
|
* away from its wrapper.
|
|
31
31
|
*/
|
|
32
|
-
declare function codeBlockPreClass(bg: string): string;
|
|
32
|
+
export declare function codeBlockPreClass(bg: string): string;
|
|
33
33
|
/**
|
|
34
34
|
* Build the email-safe table wrapper around highlighted code. Shared by the
|
|
35
35
|
* `<CodeBlock>` component and the Markdown fenced/indented code-block
|
|
@@ -37,7 +37,7 @@ declare function codeBlockPreClass(bg: string): string;
|
|
|
37
37
|
* cell carries the theme background, wrapping a `<pre>` styled
|
|
38
38
|
* with utility classes (not Shiki's raw inline styles).
|
|
39
39
|
*/
|
|
40
|
-
declare function buildCodeBlock(codeContent: string, bg: string, options?: {
|
|
40
|
+
export declare function buildCodeBlock(codeContent: string, bg: string, options?: {
|
|
41
41
|
preClass?: string;
|
|
42
42
|
tdClass?: string;
|
|
43
43
|
styleAttr?: string;
|
|
@@ -47,7 +47,6 @@ declare function buildCodeBlock(codeContent: string, bg: string, options?: {
|
|
|
47
47
|
* pulling the inner code and the theme background out of the highlighted
|
|
48
48
|
* HTML. Falls back to a white background for unhighlighted blocks.
|
|
49
49
|
*/
|
|
50
|
-
declare function shikiToCodeBlock(highlighted: string): string;
|
|
50
|
+
export declare function shikiToCodeBlock(highlighted: string): string;
|
|
51
51
|
//#endregion
|
|
52
|
-
export { buildCodeBlock, codeBlockPreClass, hasHeightInStyle, hasHeightUtility, hasWidthInStyle, hasWidthUtility, nextId, normalizeToPixels, outlookFallbackProp, shikiToCodeBlock };
|
|
53
52
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/components/utils.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/components/utils.ts"],"mappings":";wBAAgB,kBAAkB;;;;;;;;;wBAiBlB,OAAO;wBAKP,gBAAgB;wBAQhB,gBAAgB;wBAIhB,iBAAiB;wBAQjB,iBAAiB;;;;;;;qBAUpB;iBAAA;;;;;;;;;wBAWG,kBAAkB;;;;;;;;wBAWlB,eACd,qBACA,YACA;EAAW;EAAmB;EAAkB;;;;;;;wBAiBlC,iBAAiB"}
|
|
@@ -8,7 +8,6 @@ import "../types/index.js";
|
|
|
8
8
|
* In Vue SFC `<script setup>`: merges with the global config and provides
|
|
9
9
|
* the result to child components via `useConfig()`
|
|
10
10
|
*/
|
|
11
|
-
declare function defineConfig(data?: Partial<MaizzleConfig>): MaizzleConfig;
|
|
11
|
+
export declare function defineConfig(data?: Partial<MaizzleConfig>): MaizzleConfig;
|
|
12
12
|
//#endregion
|
|
13
|
-
export { defineConfig };
|
|
14
13
|
//# sourceMappingURL=defineConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineConfig.d.ts","names":[],"sources":["../../src/composables/defineConfig.ts"],"mappings":";;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"defineConfig.d.ts","names":[],"sources":["../../src/composables/defineConfig.ts"],"mappings":";;;;;;;;;;wBAoBgB,aAAa,OAAM,QAAQ,iBAAsB"}
|
|
@@ -4,18 +4,18 @@ import "../types/index.js";
|
|
|
4
4
|
import { UsePlaintextOptions } from "./usePlaintext.js";
|
|
5
5
|
import { InjectionKey } from "vue";
|
|
6
6
|
//#region src/composables/renderContext.d.ts
|
|
7
|
-
interface FontRegistration {
|
|
7
|
+
export interface FontRegistration {
|
|
8
8
|
family: string;
|
|
9
9
|
slug: string;
|
|
10
10
|
declaration: string;
|
|
11
11
|
url: string;
|
|
12
12
|
}
|
|
13
|
-
interface TailwindBlock {
|
|
13
|
+
export interface TailwindBlock {
|
|
14
14
|
id: string;
|
|
15
15
|
/** Optional raw CSS from the component's `#config` slot. */
|
|
16
16
|
css?: string;
|
|
17
17
|
}
|
|
18
|
-
interface RenderContext {
|
|
18
|
+
export interface RenderContext {
|
|
19
19
|
doctype?: string;
|
|
20
20
|
preheader?: {
|
|
21
21
|
text: string;
|
|
@@ -31,7 +31,6 @@ interface RenderContext {
|
|
|
31
31
|
fonts?: FontRegistration[];
|
|
32
32
|
tailwindBlocks?: TailwindBlock[];
|
|
33
33
|
}
|
|
34
|
-
declare const RenderContextKey: InjectionKey<RenderContext>;
|
|
34
|
+
export declare const RenderContextKey: InjectionKey<RenderContext>;
|
|
35
35
|
//#endregion
|
|
36
|
-
export { FontRegistration, RenderContext, RenderContextKey, TailwindBlock };
|
|
37
36
|
//# sourceMappingURL=renderContext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderContext.d.ts","names":[],"sources":["../../src/composables/renderContext.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"renderContext.d.ts","names":[],"sources":["../../src/composables/renderContext.ts"],"mappings":";;;;;;iBAKiB;EACf;EACA;EACA;EACA;;iBAGe;EACf;;EAEA;;iBAGe;EACf;EACA;IAAc;IAAc;;EAC5B,YAAY;EACZ,kBAAkB;IAAQ,MAAM;IAAW,SAAS,SAAS;;EAC7D,YAAY;EACZ;EACA,QAAQ;EACR,iBAAiB;;qBAIN,kBAAkB,aAAa"}
|
|
@@ -14,7 +14,6 @@ import "../types/index.js";
|
|
|
14
14
|
* useBaseUrl({ url: 'https://cdn.example.com/', styleTag: true })
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
declare function useBaseUrl(value: UrlConfig['base']): void;
|
|
17
|
+
export declare function useBaseUrl(value: UrlConfig['base']): void;
|
|
18
18
|
//#endregion
|
|
19
|
-
export { useBaseUrl };
|
|
20
19
|
//# sourceMappingURL=useBaseUrl.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBaseUrl.d.ts","names":[],"sources":["../../src/composables/useBaseUrl.ts"],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useBaseUrl.d.ts","names":[],"sources":["../../src/composables/useBaseUrl.ts"],"mappings":";;;;;;;;;;;;;;;;wBAkBgB,WAAW,OAAO"}
|
|
@@ -9,8 +9,7 @@ import { InjectionKey } from "vue";
|
|
|
9
9
|
* `Symbol()` would differ between them, so `app.provide()` and the SFC's
|
|
10
10
|
* `inject()` would miss each other and `useConfig()` would throw.
|
|
11
11
|
*/
|
|
12
|
-
declare const MaizzleConfigKey: InjectionKey<MaizzleConfig>;
|
|
13
|
-
declare function useConfig(): MaizzleConfig;
|
|
12
|
+
export declare const MaizzleConfigKey: InjectionKey<MaizzleConfig>;
|
|
13
|
+
export declare function useConfig(): MaizzleConfig;
|
|
14
14
|
//#endregion
|
|
15
|
-
export { MaizzleConfigKey, useConfig };
|
|
16
15
|
//# sourceMappingURL=useConfig.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConfig.d.ts","names":[],"sources":["../../src/composables/useConfig.ts"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useConfig.d.ts","names":[],"sources":["../../src/composables/useConfig.ts"],"mappings":";;;;;;;;;;;qBAWa,kBAAkB,aAAa;wBAE5B,aAAa"}
|
|
@@ -4,7 +4,7 @@ import { ParsedPath } from "node:path";
|
|
|
4
4
|
* Internal — set by the build loop before each template iteration and
|
|
5
5
|
* cleared in `finally`. Not exported from the package entrypoint.
|
|
6
6
|
*/
|
|
7
|
-
declare function _setCurrentTemplate(parsed: ParsedPath | undefined): void;
|
|
7
|
+
export declare function _setCurrentTemplate(parsed: ParsedPath | undefined): void;
|
|
8
8
|
/**
|
|
9
9
|
* Returns the parsed path of the template currently being processed,
|
|
10
10
|
* or `undefined` when called outside the per-template scope (e.g. from
|
|
@@ -24,7 +24,6 @@ declare function _setCurrentTemplate(parsed: ParsedPath | undefined): void;
|
|
|
24
24
|
* }
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
|
-
declare function useCurrentTemplate(): ParsedPath | undefined;
|
|
27
|
+
export declare function useCurrentTemplate(): ParsedPath | undefined;
|
|
28
28
|
//#endregion
|
|
29
|
-
export { _setCurrentTemplate, useCurrentTemplate };
|
|
30
29
|
//# sourceMappingURL=useCurrentTemplate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrentTemplate.d.ts","names":[],"sources":["../../src/composables/useCurrentTemplate.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"useCurrentTemplate.d.ts","names":[],"sources":["../../src/composables/useCurrentTemplate.ts"],"mappings":";;;;;;wBAmBgB,oBAAoB,QAAQ;;;;;;;;;;;;;;;;;;;;wBAuB5B,sBAAsB"}
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
* useDoctype('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">')
|
|
8
8
|
* ```
|
|
9
9
|
*/
|
|
10
|
-
declare function useDoctype(doctype: string): void;
|
|
10
|
+
export declare function useDoctype(doctype: string): void;
|
|
11
11
|
//#endregion
|
|
12
|
-
export { useDoctype };
|
|
13
12
|
//# sourceMappingURL=useDoctype.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDoctype.d.ts","names":[],"sources":["../../src/composables/useDoctype.ts"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useDoctype.d.ts","names":[],"sources":["../../src/composables/useDoctype.ts"],"mappings":";;;;;;;;;wBAWgB,WAAW"}
|
|
@@ -10,7 +10,6 @@ import { EventMap, EventName } from "../events/index.js";
|
|
|
10
10
|
* })
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
|
-
declare function useEvent<K extends EventName>(name: K, handler: EventMap[K]): void;
|
|
13
|
+
export declare function useEvent<K extends EventName>(name: K, handler: EventMap[K]): void;
|
|
14
14
|
//#endregion
|
|
15
|
-
export { useEvent };
|
|
16
15
|
//# sourceMappingURL=useEvent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useEvent.d.ts","names":[],"sources":["../../src/composables/useEvent.ts"],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useEvent.d.ts","names":[],"sources":["../../src/composables/useEvent.ts"],"mappings":";;;;;;;;;;;;wBAcgB,SAAS,UAAU,WAAW,MAAM,GAAG,SAAS,SAAS"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/composables/useFont.d.ts
|
|
2
|
-
type FontProvider = 'google' | 'bunny';
|
|
3
|
-
interface UseFontOptions {
|
|
2
|
+
export type FontProvider = 'google' | 'bunny';
|
|
3
|
+
export interface UseFontOptions {
|
|
4
4
|
/**
|
|
5
5
|
* A single font family name, e.g. `"Roboto"` or `"Open Sans"`.
|
|
6
6
|
*
|
|
@@ -44,7 +44,6 @@ interface UseFontOptions {
|
|
|
44
44
|
* useFont({ family: 'Roboto', fallback: 'Verdana, sans-serif', weights: [400, 600] })
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
|
-
declare function useFont(options: UseFontOptions): void;
|
|
47
|
+
export declare function useFont(options: UseFontOptions): void;
|
|
48
48
|
//#endregion
|
|
49
|
-
export { FontProvider, UseFontOptions, useFont };
|
|
50
49
|
//# sourceMappingURL=useFont.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFont.d.ts","names":[],"sources":["../../src/composables/useFont.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"useFont.d.ts","names":[],"sources":["../../src/composables/useFont.ts"],"mappings":";YA8CY;iBAEK;;;;;;;EAOf;;EAEA;;;;;;EAMA,WAAW;;;;;;EAMX;;EAEA;;EAEA;;EAEA,SAAS;;;;;;;;;;;;;;;;;wBA+CK,QAAQ,SAAS"}
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
* inherited value (defaults to `true` at the root).
|
|
16
16
|
* @returns The resolved boolean for the current component.
|
|
17
17
|
*/
|
|
18
|
-
declare function useOutlookFallback(value?: boolean | null): boolean;
|
|
18
|
+
export declare function useOutlookFallback(value?: boolean | null): boolean;
|
|
19
19
|
//#endregion
|
|
20
|
-
export { useOutlookFallback };
|
|
21
20
|
//# sourceMappingURL=useOutlookFallback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOutlookFallback.d.ts","names":[],"sources":["../../src/composables/useOutlookFallback.ts"],"mappings":";;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useOutlookFallback.d.ts","names":[],"sources":["../../src/composables/useOutlookFallback.ts"],"mappings":";;;;;;;;;;;;;;;;;wBAoBgB,mBAAmB"}
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
* useOutputPath('dist/promos/black-friday.html')
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
declare function useOutputPath(path: string): void;
|
|
14
|
+
export declare function useOutputPath(path: string): void;
|
|
15
15
|
//#endregion
|
|
16
|
-
export { useOutputPath };
|
|
17
16
|
//# sourceMappingURL=useOutputPath.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useOutputPath.d.ts","names":[],"sources":["../../src/composables/useOutputPath.ts"],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useOutputPath.d.ts","names":[],"sources":["../../src/composables/useOutputPath.ts"],"mappings":";;;;;;;;;;;;;wBAegB,cAAc"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/composables/usePlaintext.d.ts
|
|
2
|
-
interface UsePlaintextOptions {
|
|
2
|
+
export interface UsePlaintextOptions {
|
|
3
3
|
extension?: string;
|
|
4
4
|
destination?: string;
|
|
5
5
|
options?: Record<string, unknown>;
|
|
@@ -15,7 +15,6 @@ interface UsePlaintextOptions {
|
|
|
15
15
|
* usePlaintext({ options: { ignoreTags: ['br'] } })
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
|
-
declare function usePlaintext(options?: UsePlaintextOptions): void;
|
|
18
|
+
export declare function usePlaintext(options?: UsePlaintextOptions): void;
|
|
19
19
|
//#endregion
|
|
20
|
-
export { UsePlaintextOptions, usePlaintext };
|
|
21
20
|
//# sourceMappingURL=usePlaintext.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePlaintext.d.ts","names":[],"sources":["../../src/composables/usePlaintext.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"usePlaintext.d.ts","names":[],"sources":["../../src/composables/usePlaintext.ts"],"mappings":";iBAGiB;EACf;EACA;EACA,UAAU;;;;;;;;;;;;;wBAcI,aAAa,UAAU"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/composables/usePreheader.d.ts
|
|
2
|
-
interface UsePreheaderOptions {
|
|
2
|
+
export interface UsePreheaderOptions {
|
|
3
3
|
/**
|
|
4
4
|
* Explicit number of filler sequences to render. When omitted, the count
|
|
5
5
|
* is auto-derived to fill the 200-char inbox preview budget.
|
|
@@ -19,7 +19,6 @@ interface UsePreheaderOptions {
|
|
|
19
19
|
* usePreheader('Welcome!', { spaces: 50 })
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
|
-
declare function usePreheader(text: string, options?: UsePreheaderOptions): void;
|
|
22
|
+
export declare function usePreheader(text: string, options?: UsePreheaderOptions): void;
|
|
23
23
|
//#endregion
|
|
24
|
-
export { UsePreheaderOptions, usePreheader };
|
|
25
24
|
//# sourceMappingURL=usePreheader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePreheader.d.ts","names":[],"sources":["../../src/composables/usePreheader.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"usePreheader.d.ts","names":[],"sources":["../../src/composables/usePreheader.ts"],"mappings":";iBAKiB;;;;;EAKf;;;;;;;;;;;;;;;wBAgBc,aAAa,cAAc,UAAU"}
|
|
@@ -29,7 +29,6 @@ import "../types/index.js";
|
|
|
29
29
|
* useTransformers({ prettify: true })
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
-
declare function useTransformers(value?: boolean | TransformerToggles): void;
|
|
32
|
+
export declare function useTransformers(value?: boolean | TransformerToggles): void;
|
|
33
33
|
//#endregion
|
|
34
|
-
export { useTransformers };
|
|
35
34
|
//# sourceMappingURL=useTransformers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTransformers.d.ts","names":[],"sources":["../../src/composables/useTransformers.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useTransformers.d.ts","names":[],"sources":["../../src/composables/useTransformers.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAiCgB,gBAAgB,kBAAiB"}
|
|
@@ -14,7 +14,6 @@ import "../types/index.js";
|
|
|
14
14
|
* Pass `_options` alongside the params to tweak which tags/attributes
|
|
15
15
|
* receive them (see `UrlQueryOptions`).
|
|
16
16
|
*/
|
|
17
|
-
declare function useUrlQuery(value: UrlQuery): void;
|
|
17
|
+
export declare function useUrlQuery(value: UrlQuery): void;
|
|
18
18
|
//#endregion
|
|
19
|
-
export { useUrlQuery };
|
|
20
19
|
//# sourceMappingURL=useUrlQuery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUrlQuery.d.ts","names":[],"sources":["../../src/composables/useUrlQuery.ts"],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"useUrlQuery.d.ts","names":[],"sources":["../../src/composables/useUrlQuery.ts"],"mappings":";;;;;;;;;;;;;;;;wBAkBgB,YAAY,OAAO"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { MaizzleConfig } from "../types/config.js";
|
|
2
2
|
import "../types/index.js";
|
|
3
3
|
//#region src/config/defaults.d.ts
|
|
4
|
-
declare const defaults: MaizzleConfig;
|
|
4
|
+
export declare const defaults: MaizzleConfig;
|
|
5
5
|
//#endregion
|
|
6
|
-
export { defaults };
|
|
7
6
|
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","names":[],"sources":["../../src/config/defaults.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","names":[],"sources":["../../src/config/defaults.ts"],"mappings":";;;qBAEa,UAAU"}
|
package/dist/config/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { defaults } from "./defaults.js";
|
|
|
9
9
|
* Always loads from the config file on disk (maizzle.config.{ts,js}),
|
|
10
10
|
* then merges the programmatic config on top, then fills in defaults.
|
|
11
11
|
*/
|
|
12
|
-
declare function resolveConfig(config?: Partial<MaizzleConfig> | string, cwd?: string): Promise<MaizzleConfig>;
|
|
12
|
+
export declare function resolveConfig(config?: Partial<MaizzleConfig> | string, cwd?: string): Promise<MaizzleConfig>;
|
|
13
13
|
/**
|
|
14
14
|
* Resolve config from a programmatic object only — never touches disk.
|
|
15
15
|
*
|
|
@@ -18,7 +18,7 @@ declare function resolveConfig(config?: Partial<MaizzleConfig> | string, cwd?: s
|
|
|
18
18
|
* over defaults. Callers who want the project's file config load it
|
|
19
19
|
* explicitly via {@link resolveConfig} and pass the result in.
|
|
20
20
|
*/
|
|
21
|
-
declare function resolveConfigObject(config?: Partial<MaizzleConfig>, cwd?: string): MaizzleConfig;
|
|
21
|
+
export declare function resolveConfigObject(config?: Partial<MaizzleConfig>, cwd?: string): MaizzleConfig;
|
|
22
22
|
/**
|
|
23
23
|
* Whether Node can natively `import()` this file as ESM — true for `.mjs`
|
|
24
24
|
* and for `.js` whose nearest package.json declares `"type": "module"`.
|
|
@@ -27,7 +27,7 @@ declare function resolveConfigObject(config?: Partial<MaizzleConfig>, cwd?: stri
|
|
|
27
27
|
* query instead. Everything else (CJS, TS) goes through jiti, which already
|
|
28
28
|
* re-evaluates per instance.
|
|
29
29
|
*/
|
|
30
|
-
declare function isNativeESM(absolutePath: string): boolean;
|
|
30
|
+
export declare function isNativeESM(absolutePath: string): boolean;
|
|
31
31
|
//#endregion
|
|
32
|
-
export { defaults, defineConfig
|
|
32
|
+
export { defaults, defineConfig };
|
|
33
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/config/index.ts"],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/config/index.ts"],"mappings":";;;;;;;;;;;wBA8BsB,cACpB,SAAS,QAAQ,yBACjB,eACC,QAAQ;;;;;;;;;wBAqBK,oBACd,SAAS,QAAQ,gBACjB,eACC;;;;;;;;;wBAoFa,YAAY"}
|
package/dist/events/index.d.ts
CHANGED
|
@@ -2,17 +2,17 @@ import { MaizzleConfig } from "../types/config.js";
|
|
|
2
2
|
import "../types/index.js";
|
|
3
3
|
import { ParsedPath } from "node:path";
|
|
4
4
|
//#region src/events/index.d.ts
|
|
5
|
-
type EventName = 'beforeCreate' | 'beforeRender' | 'afterRender' | 'afterTransform' | 'afterBuild';
|
|
5
|
+
export type EventName = 'beforeCreate' | 'beforeRender' | 'afterRender' | 'afterTransform' | 'afterBuild';
|
|
6
6
|
/**
|
|
7
7
|
* Info about the template currently being processed, passed to per-template
|
|
8
8
|
* event handlers. `source` is the SFC file contents; `path` is the result of
|
|
9
9
|
* `path.parse(absolutePath)` — `{ root, dir, base, ext, name }`.
|
|
10
10
|
*/
|
|
11
|
-
interface TemplateInfo {
|
|
11
|
+
export interface TemplateInfo {
|
|
12
12
|
source: string;
|
|
13
13
|
path: ParsedPath;
|
|
14
14
|
}
|
|
15
|
-
interface EventMap {
|
|
15
|
+
export interface EventMap {
|
|
16
16
|
beforeCreate: (params: {
|
|
17
17
|
config: MaizzleConfig;
|
|
18
18
|
}) => void | Promise<void>;
|
|
@@ -42,7 +42,7 @@ interface EventMap {
|
|
|
42
42
|
* For events that return a value (beforeRender, afterRender, afterTransform),
|
|
43
43
|
* the returned value replaces the corresponding input for the next handler.
|
|
44
44
|
*/
|
|
45
|
-
declare class EventManager {
|
|
45
|
+
export declare class EventManager {
|
|
46
46
|
private handlers;
|
|
47
47
|
/**
|
|
48
48
|
* Snapshot of config-handler counts per event, captured at registerConfig().
|
|
@@ -110,5 +110,4 @@ declare class EventManager {
|
|
|
110
110
|
clear(): void;
|
|
111
111
|
}
|
|
112
112
|
//#endregion
|
|
113
|
-
export { EventManager, EventMap, EventName, TemplateInfo };
|
|
114
113
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/events/index.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/events/index.ts"],"mappings":";;;;YAGY;;;;;;iBAOK;EACf;EACA,MAAM;;iBAGS;EACf,eAAe;IAAU,QAAQ;eAA2B;EAC5D,eAAe;IAAU,QAAQ;IAAe,UAAU;wBAAmC;EAC7F,cAAc;IAAU,QAAQ;IAAe,UAAU;IAAc;wBAAmC;EAC1G,iBAAiB;IAAU,QAAQ;IAAe,UAAU;IAAc;wBAAmC;EAC7G,aAAa;IAAU;IAAiB,QAAQ;eAA2B;;;;;;;;;qBAUhE;UACH;;;;;;UAMA;;;;EAKR,eAAe,QAAQ;;;;EAevB,GAAG,UAAU,WAAW,MAAM,GAAG,SAAS,SAAS;;;;EAW7C,iBAAiB;IAAU,QAAQ;MAAe;;;;;EAYlD,iBAAiB;IAAU,QAAQ;IAAe,UAAU;MAAiB;;;;EAiB7E,gBAAgB;IAAU,QAAQ;IAAe,UAAU;IAAc;MAAiB;;;;EAmB1F,mBAAmB;IAAU,QAAQ;IAAe,UAAU;IAAc;MAAiB;;;;EAmB7F,eAAe;IAAU;IAAiB,QAAQ;MAAe;;;;;;;;;EAgBvE,iBAAiB,SAAQ;;;;EAczB"}
|
package/dist/plaintext.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
//#region src/plaintext.d.ts
|
|
2
|
-
declare function createPlaintext(html: string, options?: Record<string, unknown>): string;
|
|
2
|
+
export declare function createPlaintext(html: string, options?: Record<string, unknown>): string;
|
|
3
3
|
//#endregion
|
|
4
|
-
export { createPlaintext };
|
|
5
4
|
//# sourceMappingURL=plaintext.d.ts.map
|
package/dist/plaintext.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plaintext.d.ts","names":[],"sources":["../src/plaintext.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"plaintext.d.ts","names":[],"sources":["../src/plaintext.ts"],"mappings":";wBAUgB,gBAAgB,cAAc,UAAU"}
|
package/dist/plugin.d.ts
CHANGED
|
@@ -11,7 +11,6 @@ import { Plugin } from "vite";
|
|
|
11
11
|
* Does NOT inject Vue, Tailwind, or any other plugins into the host's pipeline.
|
|
12
12
|
* The host app manages its own stack. Maizzle runs in its own process.
|
|
13
13
|
*/
|
|
14
|
-
declare function maizzle(configInput?: Partial<MaizzleConfig>): Plugin[];
|
|
14
|
+
export declare function maizzle(configInput?: Partial<MaizzleConfig>): Plugin[];
|
|
15
15
|
//#endregion
|
|
16
|
-
export { maizzle };
|
|
17
16
|
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","names":[],"sources":["../src/plugin.ts"],"mappings":";;;;;;;;;;;;;wBAagB,QAAQ,cAAc,QAAQ,iBAAiB"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { Plugin } from "postcss";
|
|
2
2
|
//#region src/plugins/postcss/flattenGradients.d.ts
|
|
3
3
|
/** A gradient combo found on a DOM element. */
|
|
4
|
-
interface GradientCombo {
|
|
4
|
+
export interface GradientCombo {
|
|
5
5
|
/** Generated class name to emit the flat rule for. */
|
|
6
6
|
className: string;
|
|
7
7
|
/** The gradient utility class tokens present on the element. */
|
|
8
8
|
classes: string[];
|
|
9
9
|
}
|
|
10
10
|
declare const _default: (combos?: GradientCombo[]) => Plugin;
|
|
11
|
-
declare const postcss = true;
|
|
11
|
+
export declare const postcss = true;
|
|
12
12
|
//#endregion
|
|
13
|
-
export {
|
|
13
|
+
export { _default as default };
|
|
14
14
|
//# sourceMappingURL=flattenGradients.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flattenGradients.d.ts","names":[],"sources":["../../../src/plugins/postcss/flattenGradients.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"flattenGradients.d.ts","names":[],"sources":["../../../src/plugins/postcss/flattenGradients.ts"],"mappings":";;;iBA6BiB;;EAEf;;EAEA;;cAuCc,WAAA,SAAQ,oBAAuB;qBA4HlC"}
|