@maizzle/framework 6.0.0 → 6.0.1
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/components/Layout.vue +2 -0
- package/dist/config/index.d.ts +10 -1
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +44 -10
- package/dist/config/index.js.map +1 -1
- package/dist/serve.d.ts.map +1 -1
- package/dist/serve.js +55 -20
- package/dist/serve.js.map +1 -1
- 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 -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-DaqjATE_.js → vue.runtime.esm-bundler-N1X0OxKs.js} +29 -14
- package/dist/server/ui/.vite/deps/vue.runtime.esm-bundler-N1X0OxKs.js.map +1 -0
- package/dist/transformers/inlineCss.js +1 -1
- package/dist/transformers/inlineCss.js.map +1 -1
- package/package.json +2 -2
- package/dist/server/ui/.vite/deps/vue.runtime.esm-bundler-DaqjATE_.js.map +0 -1
package/dist/config/index.d.ts
CHANGED
|
@@ -19,6 +19,15 @@ declare function resolveConfig(config?: Partial<MaizzleConfig> | string, cwd?: s
|
|
|
19
19
|
* explicitly via {@link resolveConfig} and pass the result in.
|
|
20
20
|
*/
|
|
21
21
|
declare function resolveConfigObject(config?: Partial<MaizzleConfig>, cwd?: string): MaizzleConfig;
|
|
22
|
+
/**
|
|
23
|
+
* Whether Node can natively `import()` this file as ESM — true for `.mjs`
|
|
24
|
+
* and for `.js` whose nearest package.json declares `"type": "module"`.
|
|
25
|
+
* jiti hands such files to Node's native loader, which caches them in the
|
|
26
|
+
* (unbustable) module registry, so we import them ourselves with a fresh
|
|
27
|
+
* query instead. Everything else (CJS, TS) goes through jiti, which already
|
|
28
|
+
* re-evaluates per instance.
|
|
29
|
+
*/
|
|
30
|
+
declare function isNativeESM(absolutePath: string): boolean;
|
|
22
31
|
//#endregion
|
|
23
|
-
export { defaults, defineConfig, resolveConfig, resolveConfigObject };
|
|
32
|
+
export { defaults, defineConfig, isNativeESM, resolveConfig, resolveConfigObject };
|
|
24
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/config/index.ts"],"mappings":";;;;;;;;AA8BA;;;iBAAsB,aAAA,CACpB,MAAA,GAAS,OAAA,CAAQ,aAAA,YACjB,GAAA,YACC,OAAA,CAAQ,aAAA;;;;;;;;;iBAqBK,mBAAA,CACd,MAAA,GAAS,OAAA,CAAQ,aAAA,GACjB,GAAA,YACC,aAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/config/index.ts"],"mappings":";;;;;;;;AA8BA;;;iBAAsB,aAAA,CACpB,MAAA,GAAS,OAAA,CAAQ,aAAA,YACjB,GAAA,YACC,OAAA,CAAQ,aAAA;;;;;;;;;iBAqBK,mBAAA,CACd,MAAA,GAAS,OAAA,CAAQ,aAAA,GACjB,GAAA,YACC,aAAA;;;;AAxBqB;AAqBxB;;;;iBAuFgB,WAAA,CAAY,YAAoB"}
|
package/dist/config/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defaults } from "./defaults.js";
|
|
2
2
|
import { defineConfig } from "../composables/defineConfig.js";
|
|
3
|
-
import { existsSync } from "node:fs";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
|
-
import { resolve } from "pathe";
|
|
3
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
4
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
|
+
import { dirname, extname, join, resolve } from "pathe";
|
|
6
6
|
import { createJiti } from "jiti";
|
|
7
7
|
import { createDefu } from "defu";
|
|
8
8
|
//#region src/config/index.ts
|
|
@@ -79,24 +79,58 @@ function normalizeConfig(programmaticConfig, fileConfig, cwd) {
|
|
|
79
79
|
}
|
|
80
80
|
return merged;
|
|
81
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Whether Node can natively `import()` this file as ESM — true for `.mjs`
|
|
84
|
+
* and for `.js` whose nearest package.json declares `"type": "module"`.
|
|
85
|
+
* jiti hands such files to Node's native loader, which caches them in the
|
|
86
|
+
* (unbustable) module registry, so we import them ourselves with a fresh
|
|
87
|
+
* query instead. Everything else (CJS, TS) goes through jiti, which already
|
|
88
|
+
* re-evaluates per instance.
|
|
89
|
+
*/
|
|
90
|
+
function isNativeESM(absolutePath) {
|
|
91
|
+
const ext = extname(absolutePath);
|
|
92
|
+
if (ext === ".mjs") return true;
|
|
93
|
+
if (ext === ".cjs" || ext === ".ts" || ext === ".mts" || ext === ".cts") return false;
|
|
94
|
+
let dir = dirname(absolutePath);
|
|
95
|
+
for (;;) {
|
|
96
|
+
const pkgPath = join(dir, "package.json");
|
|
97
|
+
if (existsSync(pkgPath)) try {
|
|
98
|
+
return JSON.parse(readFileSync(pkgPath, "utf-8")).type === "module";
|
|
99
|
+
} catch {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
const parent = dirname(dir);
|
|
103
|
+
if (parent === dir) return false;
|
|
104
|
+
dir = parent;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Monotonic nonce appended to native-import URLs so each load is fresh even
|
|
109
|
+
* when two reloads land in the same millisecond.
|
|
110
|
+
*/
|
|
111
|
+
let configLoadNonce = 0;
|
|
112
|
+
async function importConfig(absolutePath, jiti) {
|
|
113
|
+
if (isNativeESM(absolutePath)) {
|
|
114
|
+
const mod = await import(`${pathToFileURL(absolutePath).href}?t=${Date.now()}-${configLoadNonce++}`);
|
|
115
|
+
return mod.default ?? mod;
|
|
116
|
+
}
|
|
117
|
+
const mod = await jiti.import(absolutePath);
|
|
118
|
+
return mod.default ?? mod;
|
|
119
|
+
}
|
|
82
120
|
async function loadConfig(configPath, cwd = process.cwd()) {
|
|
83
121
|
const jiti = createJiti(fileURLToPath(import.meta.url), { moduleCache: false });
|
|
84
122
|
if (configPath) {
|
|
85
123
|
const absolutePath = resolve(cwd, configPath);
|
|
86
124
|
if (!existsSync(absolutePath)) throw new Error(`Config file not found: ${absolutePath}`);
|
|
87
|
-
|
|
88
|
-
return mod.default ?? mod;
|
|
125
|
+
return importConfig(absolutePath, jiti);
|
|
89
126
|
}
|
|
90
127
|
for (const filename of CONFIG_FILES) {
|
|
91
128
|
const filepath = resolve(cwd, filename);
|
|
92
|
-
if (existsSync(filepath))
|
|
93
|
-
const mod = await jiti.import(filepath);
|
|
94
|
-
return mod.default ?? mod;
|
|
95
|
-
}
|
|
129
|
+
if (existsSync(filepath)) return importConfig(filepath, jiti);
|
|
96
130
|
}
|
|
97
131
|
return {};
|
|
98
132
|
}
|
|
99
133
|
//#endregion
|
|
100
|
-
export { defaults, defineConfig, resolveConfig, resolveConfigObject };
|
|
134
|
+
export { defaults, defineConfig, isNativeESM, resolveConfig, resolveConfigObject };
|
|
101
135
|
|
|
102
136
|
//# sourceMappingURL=index.js.map
|
package/dist/config/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../src/config/index.ts"],"sourcesContent":["import { existsSync } from 'node:fs'\nimport { resolve } from 'pathe'\nimport { createJiti } from 'jiti'\nimport { fileURLToPath } from 'node:url'\nimport { createDefu } from 'defu'\n\n// defu that replaces arrays: if user provides content: ['x'], it replaces the default, not appends\nconst merge = createDefu((obj, key, value) => {\n if (Array.isArray(obj[key])) {\n obj[key] = value\n return true\n }\n})\nimport { defaults } from './defaults.ts'\nimport type { MaizzleConfig } from '../types/index.ts'\n\nexport { defineConfig } from '../composables/defineConfig.ts'\nexport { defaults } from './defaults.ts'\n\nconst CONFIG_FILES = [\n 'maizzle.config.ts',\n 'maizzle.config.js',\n]\n\n/**\n * Resolve the Maizzle config.\n *\n * Always loads from the config file on disk (maizzle.config.{ts,js}),\n * then merges the programmatic config on top, then fills in defaults.\n */\nexport async function resolveConfig(\n config?: Partial<MaizzleConfig> | string,\n cwd: string = process.cwd(),\n): Promise<MaizzleConfig> {\n // If a string path was provided, load that specific file\n const fileConfig = await loadConfig(\n typeof config === 'string' ? config : undefined,\n cwd,\n )\n\n // Programmatic config (object) overrides file config, which overrides defaults\n const programmaticConfig = typeof config === 'object' && config !== null ? config : {}\n\n return normalizeConfig(programmaticConfig, fileConfig, cwd)\n}\n\n/**\n * Resolve config from a programmatic object only — never touches disk.\n *\n * `render()` uses this so a stray `maizzle.config.{ts,js}` in `cwd` can't\n * silently alter output: the config you pass is the config you get, layered\n * over defaults. Callers who want the project's file config load it\n * explicitly via {@link resolveConfig} and pass the result in.\n */\nexport function resolveConfigObject(\n config?: Partial<MaizzleConfig>,\n cwd: string = process.cwd(),\n): MaizzleConfig {\n const programmaticConfig = config && typeof config === 'object' ? config : {}\n return normalizeConfig(programmaticConfig, {}, cwd)\n}\n\n/**\n * Merge programmatic config over file config over defaults, then resolve\n * filesystem paths (root, content, static, components) relative to cwd/root.\n */\nfunction normalizeConfig(\n programmaticConfig: Partial<MaizzleConfig>,\n fileConfig: Partial<MaizzleConfig>,\n cwd: string,\n): MaizzleConfig {\n const merged = merge(programmaticConfig, fileConfig, defaults) as MaizzleConfig\n\n // Check if root was explicitly provided before resolving\n const hasExplicitRoot = !!(programmaticConfig.root ?? fileConfig.root)\n\n // Resolve root to an absolute path (defaults to cwd)\n const root = resolve(cwd, merged.root ?? '.')\n merged.root = root\n\n // Resolve content patterns relative to root\n if (merged.content) {\n merged.content = merged.content.map(p => {\n // Skip already-absolute or negated patterns\n if (p.startsWith('/') || p.startsWith('!')) return p\n return resolve(root, p)\n })\n }\n\n // Resolve static source patterns relative to root\n if (merged.static?.source) {\n merged.static.source = merged.static.source.map(p => {\n if (p.startsWith('/') || p.startsWith('!')) return p\n return resolve(root, p)\n })\n }\n\n /**\n * Resolve components.source paths relative to cwd (not root), since extra\n * component dirs often live outside the root directory. String\n * entries → resolve in-place. Object entries → resolve\n * `path`, preserve `prefix`/`pathPrefix`.\n */\n if (merged.components?.source) {\n const dirs = Array.isArray(merged.components.source)\n ? merged.components.source\n : [merged.components.source]\n\n merged.components.source = dirs.map(entry => {\n if (typeof entry === 'string') {\n return entry.startsWith('/') ? entry : resolve(cwd, entry)\n }\n return {\n ...entry,\n path: entry.path.startsWith('/') ? entry.path : resolve(cwd, entry.path),\n }\n })\n }\n\n /**\n * Default css.base to root when root is explicitly set, so Tailwind resolves\n * @source from the right directory. When root is not set, leave\n * css.base undefined so Tailwind uses its own default (the\n * template file's directory).\n */\n if (hasExplicitRoot && !merged.css?.base) {\n if (!merged.css) merged.css = {}\n merged.css.base = root\n }\n\n return merged\n}\n\nasync function loadConfig(\n configPath?: string,\n cwd: string = process.cwd(),\n): Promise<MaizzleConfig> {\n const jiti = createJiti(fileURLToPath(import.meta.url), { moduleCache: false })\n\n // If an explicit path was provided, use it directly\n if (configPath) {\n const absolutePath = resolve(cwd, configPath)\n\n if (!existsSync(absolutePath)) {\n throw new Error(`Config file not found: ${absolutePath}`)\n }\n\n
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/config/index.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs'\nimport { resolve, dirname, extname, join } from 'pathe'\nimport { createJiti } from 'jiti'\nimport { fileURLToPath, pathToFileURL } from 'node:url'\nimport { createDefu } from 'defu'\n\n// defu that replaces arrays: if user provides content: ['x'], it replaces the default, not appends\nconst merge = createDefu((obj, key, value) => {\n if (Array.isArray(obj[key])) {\n obj[key] = value\n return true\n }\n})\nimport { defaults } from './defaults.ts'\nimport type { MaizzleConfig } from '../types/index.ts'\n\nexport { defineConfig } from '../composables/defineConfig.ts'\nexport { defaults } from './defaults.ts'\n\nconst CONFIG_FILES = [\n 'maizzle.config.ts',\n 'maizzle.config.js',\n]\n\n/**\n * Resolve the Maizzle config.\n *\n * Always loads from the config file on disk (maizzle.config.{ts,js}),\n * then merges the programmatic config on top, then fills in defaults.\n */\nexport async function resolveConfig(\n config?: Partial<MaizzleConfig> | string,\n cwd: string = process.cwd(),\n): Promise<MaizzleConfig> {\n // If a string path was provided, load that specific file\n const fileConfig = await loadConfig(\n typeof config === 'string' ? config : undefined,\n cwd,\n )\n\n // Programmatic config (object) overrides file config, which overrides defaults\n const programmaticConfig = typeof config === 'object' && config !== null ? config : {}\n\n return normalizeConfig(programmaticConfig, fileConfig, cwd)\n}\n\n/**\n * Resolve config from a programmatic object only — never touches disk.\n *\n * `render()` uses this so a stray `maizzle.config.{ts,js}` in `cwd` can't\n * silently alter output: the config you pass is the config you get, layered\n * over defaults. Callers who want the project's file config load it\n * explicitly via {@link resolveConfig} and pass the result in.\n */\nexport function resolveConfigObject(\n config?: Partial<MaizzleConfig>,\n cwd: string = process.cwd(),\n): MaizzleConfig {\n const programmaticConfig = config && typeof config === 'object' ? config : {}\n return normalizeConfig(programmaticConfig, {}, cwd)\n}\n\n/**\n * Merge programmatic config over file config over defaults, then resolve\n * filesystem paths (root, content, static, components) relative to cwd/root.\n */\nfunction normalizeConfig(\n programmaticConfig: Partial<MaizzleConfig>,\n fileConfig: Partial<MaizzleConfig>,\n cwd: string,\n): MaizzleConfig {\n const merged = merge(programmaticConfig, fileConfig, defaults) as MaizzleConfig\n\n // Check if root was explicitly provided before resolving\n const hasExplicitRoot = !!(programmaticConfig.root ?? fileConfig.root)\n\n // Resolve root to an absolute path (defaults to cwd)\n const root = resolve(cwd, merged.root ?? '.')\n merged.root = root\n\n // Resolve content patterns relative to root\n if (merged.content) {\n merged.content = merged.content.map(p => {\n // Skip already-absolute or negated patterns\n if (p.startsWith('/') || p.startsWith('!')) return p\n return resolve(root, p)\n })\n }\n\n // Resolve static source patterns relative to root\n if (merged.static?.source) {\n merged.static.source = merged.static.source.map(p => {\n if (p.startsWith('/') || p.startsWith('!')) return p\n return resolve(root, p)\n })\n }\n\n /**\n * Resolve components.source paths relative to cwd (not root), since extra\n * component dirs often live outside the root directory. String\n * entries → resolve in-place. Object entries → resolve\n * `path`, preserve `prefix`/`pathPrefix`.\n */\n if (merged.components?.source) {\n const dirs = Array.isArray(merged.components.source)\n ? merged.components.source\n : [merged.components.source]\n\n merged.components.source = dirs.map(entry => {\n if (typeof entry === 'string') {\n return entry.startsWith('/') ? entry : resolve(cwd, entry)\n }\n return {\n ...entry,\n path: entry.path.startsWith('/') ? entry.path : resolve(cwd, entry.path),\n }\n })\n }\n\n /**\n * Default css.base to root when root is explicitly set, so Tailwind resolves\n * @source from the right directory. When root is not set, leave\n * css.base undefined so Tailwind uses its own default (the\n * template file's directory).\n */\n if (hasExplicitRoot && !merged.css?.base) {\n if (!merged.css) merged.css = {}\n merged.css.base = root\n }\n\n return merged\n}\n\n/**\n * Whether Node can natively `import()` this file as ESM — true for `.mjs`\n * and for `.js` whose nearest package.json declares `\"type\": \"module\"`.\n * jiti hands such files to Node's native loader, which caches them in the\n * (unbustable) module registry, so we import them ourselves with a fresh\n * query instead. Everything else (CJS, TS) goes through jiti, which already\n * re-evaluates per instance.\n */\nexport function isNativeESM(absolutePath: string): boolean {\n const ext = extname(absolutePath)\n if (ext === '.mjs') return true\n if (ext === '.cjs' || ext === '.ts' || ext === '.mts' || ext === '.cts') return false\n\n let dir = dirname(absolutePath)\n for (;;) {\n const pkgPath = join(dir, 'package.json')\n if (existsSync(pkgPath)) {\n try {\n return JSON.parse(readFileSync(pkgPath, 'utf-8')).type === 'module'\n } catch {\n return false\n }\n }\n const parent = dirname(dir)\n if (parent === dir) return false\n dir = parent\n }\n}\n\n/**\n * Monotonic nonce appended to native-import URLs so each load is fresh even\n * when two reloads land in the same millisecond.\n */\nlet configLoadNonce = 0\n\nasync function importConfig(absolutePath: string, jiti: ReturnType<typeof createJiti>): Promise<MaizzleConfig> {\n if (isNativeESM(absolutePath)) {\n const url = `${pathToFileURL(absolutePath).href}?t=${Date.now()}-${configLoadNonce++}`\n const mod = await import(url) as any\n return mod.default ?? mod\n }\n\n const mod = await jiti.import(absolutePath) as any\n return mod.default ?? mod\n}\n\nasync function loadConfig(\n configPath?: string,\n cwd: string = process.cwd(),\n): Promise<MaizzleConfig> {\n const jiti = createJiti(fileURLToPath(import.meta.url), { moduleCache: false })\n\n // If an explicit path was provided, use it directly\n if (configPath) {\n const absolutePath = resolve(cwd, configPath)\n\n if (!existsSync(absolutePath)) {\n throw new Error(`Config file not found: ${absolutePath}`)\n }\n\n return importConfig(absolutePath, jiti)\n }\n\n // Otherwise scan cwd for known config file names\n for (const filename of CONFIG_FILES) {\n const filepath = resolve(cwd, filename)\n\n if (existsSync(filepath)) {\n return importConfig(filepath, jiti)\n }\n }\n\n // No config file found, return empty (defaults will be applied by resolveConfig)\n return {}\n}\n"],"mappings":";;;;;;;;AAOA,MAAM,QAAQ,YAAY,KAAK,KAAK,UAAU;CAC5C,IAAI,MAAM,QAAQ,IAAI,IAAI,GAAG;EAC3B,IAAI,OAAO;EACX,OAAO;CACT;AACF,CAAC;AAOD,MAAM,eAAe,CACnB,qBACA,mBACF;;;;;;;AAQA,eAAsB,cACpB,QACA,MAAc,QAAQ,IAAI,GACF;CAExB,MAAM,aAAa,MAAM,WACvB,OAAO,WAAW,WAAW,SAAS,KAAA,GACtC,GACF;CAKA,OAAO,gBAFoB,OAAO,WAAW,YAAY,WAAW,OAAO,SAAS,CAAC,GAE1C,YAAY,GAAG;AAC5D;;;;;;;;;AAUA,SAAgB,oBACd,QACA,MAAc,QAAQ,IAAI,GACX;CAEf,OAAO,gBADoB,UAAU,OAAO,WAAW,WAAW,SAAS,CAAC,GACjC,CAAC,GAAG,GAAG;AACpD;;;;;AAMA,SAAS,gBACP,oBACA,YACA,KACe;CACf,MAAM,SAAS,MAAM,oBAAoB,YAAY,QAAQ;CAG7D,MAAM,kBAAkB,CAAC,EAAE,mBA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AAK,cAAc;EACxC,IAAI,WAAW,OAAO,GACpB,IAAI;GACF,OAAO,KAAK,MAAM,aAAa,SAAS,OAAO,CAAC,CAAC,CAAC,SAAS;EAC7D,QAAQ;GACN,OAAO;EACT;EAEF,MAAM,SAAS,QAAQ,GAAG;EAC1B,IAAI,WAAW,KAAK,OAAO;EAC3B,MAAM;CACR;AACF;;;;;AAMA,IAAI,kBAAkB;AAEtB,eAAe,aAAa,cAAsB,MAA6D;CAC7G,IAAI,YAAY,YAAY,GAAG;EAE7B,MAAM,MAAM,MAAM,OAAO,GADV,cAAc,YAAY,CAAC,CAAC,KAAK,KAAK,KAAK,IAAI,EAAE,GAAG;EAEnE,OAAO,IAAI,WAAW;CACxB;CAEA,MAAM,MAAM,MAAM,KAAK,OAAO,YAAY;CAC1C,OAAO,IAAI,WAAW;AACxB;AAEA,eAAe,WACb,YACA,MAAc,QAAQ,IAAI,GACF;CACxB,MAAM,OAAO,WAAW,cAAc,OAAO,KAAK,GAAG,GAAG,EAAE,aAAa,MAAM,CAAC;CAG9E,IAAI,YAAY;EACd,MAAM,eAAe,QAAQ,KAAK,UAAU;EAE5C,IAAI,CAAC,WAAW,YAAY,GAC1B,MAAM,IAAI,MAAM,0BAA0B,cAAc;EAG1D,OAAO,aAAa,cAAc,IAAI;CACxC;CAGA,KAAK,MAAM,YAAY,cAAc;EACnC,MAAM,WAAW,QAAQ,KAAK,QAAQ;EAEtC,IAAI,WAAW,QAAQ,GACrB,OAAO,aAAa,UAAU,IAAI;CAEtC;CAGA,OAAO,CAAC;AACV"}
|
package/dist/serve.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.d.ts","names":[],"sources":["../src/serve.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"serve.d.ts","names":[],"sources":["../src/serve.ts"],"mappings":";;;;UAqDiB,YAAA;EACf,MAAA,GAAS,OAAO,CAAC,aAAA;;EAEjB,IAAA;EAH2B;EAK3B,IAAA;EAJgB;EAMhB,MAAA;AAAA;;;;;;AAAM;AAYR;;;iBAAsB,KAAA,CAAM,OAAA,GAAS,YAAA,GAAiB,OAAA,CAAA,aAAA;AAAA,iBA0pBtC,WAAA,CAAY,MAAA,EAAQ,aAAa,EAAE,WAAA"}
|
package/dist/serve.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { resolveConfig } from "./config/index.js";
|
|
2
|
+
import { EventManager } from "./events/index.js";
|
|
2
3
|
import { normalizeComponentSources } from "./utils/componentSources.js";
|
|
3
4
|
import { createRenderer } from "./render/createRenderer.js";
|
|
4
5
|
import { runTransformers } from "./transformers/index.js";
|
|
5
6
|
import { createPlaintext } from "./plaintext.js";
|
|
6
7
|
import { stripForHtml, stripForPlaintext } from "./utils/output-markers.js";
|
|
7
8
|
import { _setCurrentTemplate } from "./composables/useCurrentTemplate.js";
|
|
9
|
+
import { cloneConfig } from "./utils/cloneConfig.js";
|
|
8
10
|
import { setActiveRenderer } from "./render/active.js";
|
|
9
11
|
import { serveLint } from "./server/linter.js";
|
|
10
12
|
import { serveCompatibility } from "./server/compatibility.js";
|
|
@@ -68,12 +70,15 @@ async function serve(options = {}) {
|
|
|
68
70
|
* app is itself a Vite dev process — e.g. TanStack Start).
|
|
69
71
|
*/
|
|
70
72
|
setActiveRenderer(renderer);
|
|
73
|
+
const events = new EventManager();
|
|
74
|
+
events.registerConfig(config);
|
|
75
|
+
await events.fireBeforeCreate({ config });
|
|
71
76
|
const server = await createServer({
|
|
72
77
|
configFile: false,
|
|
73
78
|
plugins: [
|
|
74
79
|
vue(),
|
|
75
80
|
tailwindcss(),
|
|
76
|
-
maizzleDevPlugin(config, renderer, options.config)
|
|
81
|
+
maizzleDevPlugin(config, renderer, events, options.config)
|
|
77
82
|
],
|
|
78
83
|
resolve: {
|
|
79
84
|
dedupe: ["vue"],
|
|
@@ -159,7 +164,7 @@ async function serve(options = {}) {
|
|
|
159
164
|
/**
|
|
160
165
|
* Internal Vite plugin that adds Maizzle middleware and file watching to the dev UI server.
|
|
161
166
|
*/
|
|
162
|
-
function maizzleDevPlugin(config, renderer, configInput) {
|
|
167
|
+
function maizzleDevPlugin(config, renderer, events, configInput) {
|
|
163
168
|
return {
|
|
164
169
|
name: "maizzle:dev",
|
|
165
170
|
enforce: "pre",
|
|
@@ -222,6 +227,8 @@ function maizzleDevPlugin(config, renderer, configInput) {
|
|
|
222
227
|
server.watcher.on("change", (file) => enqueue(async () => {
|
|
223
228
|
if (isWatchedFile(file)) {
|
|
224
229
|
config = await resolveConfig(configInput);
|
|
230
|
+
events.clear();
|
|
231
|
+
events.registerConfig(config);
|
|
225
232
|
await renderer.close();
|
|
226
233
|
renderer = await createRenderer({
|
|
227
234
|
dts: true,
|
|
@@ -258,14 +265,14 @@ function maizzleDevPlugin(config, renderer, configInput) {
|
|
|
258
265
|
server.middlewares.use(async (req, res, next) => {
|
|
259
266
|
const url = req.url || "/";
|
|
260
267
|
if (url === "/__maizzle/templates") return serveTemplateList(config, res);
|
|
261
|
-
if (url.startsWith("/__maizzle/render/")) return await serveRenderedTemplate(url, config, renderer, res);
|
|
262
|
-
if (url.startsWith("/__maizzle/source/")) return await serveHighlightedSource(url, config, renderer, res);
|
|
268
|
+
if (url.startsWith("/__maizzle/render/")) return await serveRenderedTemplate(url, config, renderer, events, res);
|
|
269
|
+
if (url.startsWith("/__maizzle/source/")) return await serveHighlightedSource(url, config, renderer, events, res);
|
|
263
270
|
if (url.startsWith("/__maizzle/compatibility/")) return await serveCompatibility(url, res, config, normalizeComponentSources(config.components?.source, process.cwd()));
|
|
264
271
|
if (url.startsWith("/__maizzle/lint/")) return await serveLint(url, res, config, normalizeComponentSources(config.components?.source, process.cwd()));
|
|
265
272
|
if (url.startsWith("/__maizzle/vue-source/")) return await serveVueSource(url, config, res);
|
|
266
|
-
if (url.startsWith("/__maizzle/plaintext/")) return await servePlaintext(url, config, renderer, res);
|
|
267
|
-
if (url.startsWith("/__maizzle/stats/")) return await serveStats(url, config, renderer, res);
|
|
268
|
-
if (url.startsWith("/__maizzle/email/") && req.method === "POST") return await serveEmailEndpoint(url, req, res, config, renderer);
|
|
273
|
+
if (url.startsWith("/__maizzle/plaintext/")) return await servePlaintext(url, config, renderer, events, res);
|
|
274
|
+
if (url.startsWith("/__maizzle/stats/")) return await serveStats(url, config, renderer, events, res);
|
|
275
|
+
if (url.startsWith("/__maizzle/email/") && req.method === "POST") return await serveEmailEndpoint(url, req, res, config, renderer, events);
|
|
269
276
|
if (url === "/__maizzle/email-config") return serveEmailConfig(config, res);
|
|
270
277
|
next();
|
|
271
278
|
});
|
|
@@ -328,24 +335,52 @@ function bumpGeneration() {
|
|
|
328
335
|
renderGeneration++;
|
|
329
336
|
renderCache.clear();
|
|
330
337
|
}
|
|
331
|
-
function getRendered(absolutePath, config, renderer) {
|
|
338
|
+
function getRendered(absolutePath, config, renderer, events) {
|
|
332
339
|
const key = `${renderGeneration}:${absolutePath}`;
|
|
333
340
|
let promise = renderCache.get(key);
|
|
334
341
|
if (!promise) {
|
|
335
342
|
promise = (async () => {
|
|
336
343
|
_setCurrentTemplate(parse(absolutePath));
|
|
337
344
|
try {
|
|
338
|
-
|
|
345
|
+
/**
|
|
346
|
+
* Mirror the build's per-template event pipeline (see buildTemplate)
|
|
347
|
+
* so dev preview fires the same beforeRender / afterRender /
|
|
348
|
+
* afterTransform hooks and matches production output. Clone config so
|
|
349
|
+
* beforeRender mutations stay scoped to this render.
|
|
350
|
+
*/
|
|
351
|
+
const renderConfig = cloneConfig(config);
|
|
352
|
+
const template = {
|
|
353
|
+
source: readFileSync(absolutePath, "utf-8"),
|
|
354
|
+
path: parse(absolutePath)
|
|
355
|
+
};
|
|
356
|
+
const originalSource = template.source;
|
|
357
|
+
await events.fireBeforeRender({
|
|
358
|
+
config: renderConfig,
|
|
359
|
+
template
|
|
360
|
+
});
|
|
361
|
+
const rendered = await renderer.render(absolutePath, renderConfig, template.source !== originalSource ? { source: template.source } : void 0);
|
|
362
|
+
for (const { name, handler } of rendered.sfcEventHandlers) events.on(name, handler);
|
|
339
363
|
const templateConfig = rendered.templateConfig;
|
|
364
|
+
let html = await events.fireAfterRender({
|
|
365
|
+
config: templateConfig,
|
|
366
|
+
template,
|
|
367
|
+
html: rendered.html
|
|
368
|
+
});
|
|
340
369
|
const doctype = rendered.doctype ?? templateConfig.doctype ?? "<!DOCTYPE html>";
|
|
370
|
+
if (templateConfig.useTransformers !== false) html = await runTransformers(html, templateConfig, absolutePath, doctype, rendered.tailwindBlocks);
|
|
341
371
|
return {
|
|
342
|
-
rawHtml: await
|
|
372
|
+
rawHtml: await events.fireAfterTransform({
|
|
373
|
+
config: templateConfig,
|
|
374
|
+
template,
|
|
375
|
+
html
|
|
376
|
+
}),
|
|
343
377
|
doctype,
|
|
344
378
|
templateConfig,
|
|
345
379
|
rendered
|
|
346
380
|
};
|
|
347
381
|
} finally {
|
|
348
382
|
_setCurrentTemplate(void 0);
|
|
383
|
+
events.clearSfcHandlers();
|
|
349
384
|
}
|
|
350
385
|
})();
|
|
351
386
|
renderCache.set(key, promise);
|
|
@@ -355,7 +390,7 @@ function getRendered(absolutePath, config, renderer) {
|
|
|
355
390
|
/**
|
|
356
391
|
* SSR render a .vue template using the Renderer (not the dev UI server).
|
|
357
392
|
*/
|
|
358
|
-
async function serveRenderedTemplate(url, config, renderer, res) {
|
|
393
|
+
async function serveRenderedTemplate(url, config, renderer, events, res) {
|
|
359
394
|
const templateSlug = url.replace("/__maizzle/render/", "").replace(/\?.*$/, "");
|
|
360
395
|
const match = (await glob(config.content ?? ["emails/**/*.vue"])).find((t) => t.replace(/\.(vue|md)$/, "") === templateSlug);
|
|
361
396
|
if (!match) {
|
|
@@ -365,7 +400,7 @@ async function serveRenderedTemplate(url, config, renderer, res) {
|
|
|
365
400
|
}
|
|
366
401
|
const absolutePath = resolve(match);
|
|
367
402
|
try {
|
|
368
|
-
const { rawHtml, doctype } = await getRendered(absolutePath, config, renderer);
|
|
403
|
+
const { rawHtml, doctype } = await getRendered(absolutePath, config, renderer, events);
|
|
369
404
|
let html = rawHtml;
|
|
370
405
|
if (doctype) html = `${doctype}\n${html}`;
|
|
371
406
|
res.setHeader("Content-Type", "text/html");
|
|
@@ -383,7 +418,7 @@ async function getHighlighter() {
|
|
|
383
418
|
});
|
|
384
419
|
return highlighter;
|
|
385
420
|
}
|
|
386
|
-
async function serveHighlightedSource(url, config, renderer, res) {
|
|
421
|
+
async function serveHighlightedSource(url, config, renderer, events, res) {
|
|
387
422
|
const templateSlug = url.replace("/__maizzle/source/", "").replace(/\?.*$/, "");
|
|
388
423
|
const match = (await glob(config.content ?? ["emails/**/*.vue"])).find((t) => t.replace(/\.(vue|md)$/, "") === templateSlug);
|
|
389
424
|
if (!match) {
|
|
@@ -393,7 +428,7 @@ async function serveHighlightedSource(url, config, renderer, res) {
|
|
|
393
428
|
}
|
|
394
429
|
const absolutePath = resolve(match);
|
|
395
430
|
try {
|
|
396
|
-
const { rawHtml, doctype } = await getRendered(absolutePath, config, renderer);
|
|
431
|
+
const { rawHtml, doctype } = await getRendered(absolutePath, config, renderer, events);
|
|
397
432
|
const html = stripForHtml(doctype ? `${doctype}\n${rawHtml}` : rawHtml);
|
|
398
433
|
const highlighted = (await getHighlighter()).codeToHtml(html, {
|
|
399
434
|
lang: "html",
|
|
@@ -434,7 +469,7 @@ async function serveVueSource(url, config, res) {
|
|
|
434
469
|
res.end(`<pre>${error.stack || error.message}</pre>`);
|
|
435
470
|
}
|
|
436
471
|
}
|
|
437
|
-
async function servePlaintext(url, config, renderer, res) {
|
|
472
|
+
async function servePlaintext(url, config, renderer, events, res) {
|
|
438
473
|
const templateSlug = url.replace("/__maizzle/plaintext/", "").replace(/\?.*$/, "");
|
|
439
474
|
const match = (await glob(config.content ?? ["emails/**/*.vue"])).find((t) => t.replace(/\.(vue|md)$/, "") === templateSlug);
|
|
440
475
|
if (!match) {
|
|
@@ -444,7 +479,7 @@ async function servePlaintext(url, config, renderer, res) {
|
|
|
444
479
|
}
|
|
445
480
|
const absolutePath = resolve(match);
|
|
446
481
|
try {
|
|
447
|
-
const { rawHtml } = await getRendered(absolutePath, config, renderer);
|
|
482
|
+
const { rawHtml } = await getRendered(absolutePath, config, renderer, events);
|
|
448
483
|
const plaintext = createPlaintext(stripForPlaintext(rawHtml));
|
|
449
484
|
res.setHeader("Content-Type", "text/plain");
|
|
450
485
|
res.end(plaintext);
|
|
@@ -474,7 +509,7 @@ function humanFileSize(bytes, si = false, dp = 2) {
|
|
|
474
509
|
} while (Math.round(Math.abs(bytes) * r) / r >= threshold && u < units.length - 1);
|
|
475
510
|
return bytes.toFixed(dp) + " " + units[u];
|
|
476
511
|
}
|
|
477
|
-
async function serveStats(url, config, renderer, res) {
|
|
512
|
+
async function serveStats(url, config, renderer, events, res) {
|
|
478
513
|
const templateSlug = url.replace("/__maizzle/stats/", "").replace(/\?.*$/, "");
|
|
479
514
|
const match = (await glob(config.content ?? ["emails/**/*.vue"])).find((t) => t.replace(/\.(vue|md)$/, "") === templateSlug);
|
|
480
515
|
if (!match) {
|
|
@@ -484,7 +519,7 @@ async function serveStats(url, config, renderer, res) {
|
|
|
484
519
|
}
|
|
485
520
|
const absolutePath = resolve(match);
|
|
486
521
|
try {
|
|
487
|
-
const { rawHtml } = await getRendered(absolutePath, config, renderer);
|
|
522
|
+
const { rawHtml } = await getRendered(absolutePath, config, renderer, events);
|
|
488
523
|
const html = stripForHtml(rawHtml);
|
|
489
524
|
const sizeBytes = new TextEncoder().encode(html).length;
|
|
490
525
|
const totalImages = (html.match(/<img\b[^>]*>/gi) || []).length + (html.match(/url\s*\([^)]+\)/gi) || []).length;
|
|
@@ -503,7 +538,7 @@ async function serveStats(url, config, renderer, res) {
|
|
|
503
538
|
res.end(JSON.stringify({ error: error.message }));
|
|
504
539
|
}
|
|
505
540
|
}
|
|
506
|
-
async function serveEmailEndpoint(url, req, res, config, renderer) {
|
|
541
|
+
async function serveEmailEndpoint(url, req, res, config, renderer, events) {
|
|
507
542
|
const templateSlug = url.replace("/__maizzle/email/", "").replace(/\?.*$/, "");
|
|
508
543
|
const match = (await glob(config.content ?? ["emails/**/*.vue"])).find((t) => t.replace(/\.(vue|md)$/, "") === templateSlug);
|
|
509
544
|
if (!match) {
|
|
@@ -537,7 +572,7 @@ async function serveEmailEndpoint(url, req, res, config, renderer) {
|
|
|
537
572
|
}
|
|
538
573
|
const absolutePath = resolve(match);
|
|
539
574
|
try {
|
|
540
|
-
const { rawHtml, doctype, templateConfig } = await getRendered(absolutePath, config, renderer);
|
|
575
|
+
const { rawHtml, doctype, templateConfig } = await getRendered(absolutePath, config, renderer, events);
|
|
541
576
|
let html = doctype ? `${doctype}\n${rawHtml}` : rawHtml;
|
|
542
577
|
const text = createPlaintext(stripForPlaintext(html));
|
|
543
578
|
html = stripForHtml(html);
|
package/dist/serve.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve.js","names":["parsePath"],"sources":["../src/serve.ts"],"sourcesContent":["import { readFileSync } from 'node:fs'\nimport { dirname, resolve, basename, parse as parsePath } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { createRequire } from 'node:module'\nimport { createServer, createLogger, type ViteDevServer } from 'vite'\nimport { renderUnicodeCompact } from 'uqr'\nimport vue from '@vitejs/plugin-vue'\nimport tailwindcss from '@tailwindcss/vite'\nimport { glob } from 'tinyglobby'\nimport { createHighlighter, type Highlighter } from 'shiki'\nimport { createPlaintext } from './plaintext.ts'\nimport { stripForHtml, stripForPlaintext } from './utils/output-markers.ts'\nimport { resolveConfig } from './config/index.ts'\nimport { runTransformers } from './transformers/index.ts'\nimport { createRenderer, type Renderer, type RenderedTemplate } from './render/createRenderer.ts'\nimport { _setCurrentTemplate } from './composables/useCurrentTemplate.ts'\nimport { setActiveRenderer } from './render/active.ts'\nimport { serveCompatibility } from './server/compatibility.ts'\nimport { serveLint } from './server/linter.ts'\nimport { sendEmail } from './server/email.ts'\nimport { normalizeComponentSources } from './utils/componentSources.ts'\nimport { createWatchedFileMatcher } from './utils/watchPaths.ts'\nimport type { MaizzleConfig } from './types/index.ts'\n\nconst __dirname = dirname(fileURLToPath(import.meta.url))\nconst devUIDir = resolve(__dirname, 'server/ui')\n\nconst require = createRequire(import.meta.url)\nconst pkg = (name: string) => {\n const resolved = require.resolve(name).replace(/\\\\/g, '/')\n const marker = `node_modules/${name}`\n const idx = resolved.lastIndexOf(marker)\n\n return resolved.slice(0, idx + marker.length)\n}\n\n/**\n * Resolve a package's ESM entry via its `exports` map. Aliasing to the\n * package directory bypasses `exports` (it only keys off the bare name),\n * so directory resolution can fall back to a UMD/CJS bundle — which Vite 8\n * flags `needsInterop` and then default-imports, breaking ESM-only deps\n * like culori (named exports, no default). Point the alias at the real\n * ESM entry instead.\n */\nconst pkgEsmEntry = (name: string) => {\n const dir = pkg(name)\n const pj = JSON.parse(readFileSync(resolve(dir, 'package.json'), 'utf-8'))\n const entry = pj.exports?.['.']?.import ?? pj.module ?? pj.main\n return resolve(dir, entry)\n}\n\nexport interface ServeOptions {\n config?: Partial<MaizzleConfig> | string\n /** Override the dev server port (takes precedence over config.server.port) */\n port?: number\n /** Expose the server on the network (e.g. --host) */\n host?: boolean | string\n /** When true, suppresses the startup banner/URL output. */\n silent?: boolean\n}\n\n/**\n * Start the Maizzle dev server.\n *\n * Creates two things:\n * 1. A Vite dev server for the dev UI (sidebar + preview, with Vue + Tailwind for the UI itself)\n * 2. A Renderer instance for SSR rendering email templates\n *\n * Template rendering goes through the Renderer, not the Vite dev server.\n */\nexport async function serve(options: ServeOptions = {}) {\n const start = performance.now()\n\n let config = await resolveConfig(options.config)\n const port = options.port ?? config.server?.port ?? 3000\n\n // Create a renderer for SSR rendering email templates (with dts for dev)\n let renderer = await createRenderer({ dts: true, markdown: config.markdown, root: config.root, componentDirs: normalizeComponentSources(config.components?.source, process.cwd()), vite: config.vite })\n\n /**\n * Register so user-land render() calls reuse this renderer instead of\n * spinning up another Vite SSR server (which collides when the host\n * app is itself a Vite dev process — e.g. TanStack Start).\n */\n setActiveRenderer(renderer)\n\n const server = await createServer({\n configFile: false,\n plugins: [\n // Vue and Tailwind are only for the dev UI SPA, not for email templates\n vue(),\n tailwindcss(),\n maizzleDevPlugin(config, renderer, options.config),\n ],\n resolve: {\n dedupe: ['vue'],\n alias: [\n { find: '@', replacement: devUIDir },\n { find: 'vue', replacement: resolve(pkg('vue'), 'dist/vue.runtime.esm-bundler.js') },\n // culori is ESM-only — alias to its ESM entry, not the package dir (see pkgEsmEntry)\n { find: 'culori', replacement: pkgEsmEntry('culori') },\n ...['vue-router', 'reka-ui', '@vueuse/core', '@vueuse/shared', '@lucide/vue', 'class-variance-authority', 'clsx', 'tailwind-merge']\n .map(name => ({ find: name, replacement: pkg(name) })),\n ],\n },\n cacheDir: resolve(devUIDir, '.vite'),\n optimizeDeps: {\n noDiscovery: true,\n include: [\n 'vue',\n 'vue-router',\n '@lucide/vue',\n '@vueuse/core',\n '@vueuse/shared',\n 'reka-ui',\n 'class-variance-authority',\n 'clsx',\n 'tailwind-merge',\n 'culori',\n ],\n },\n server: {\n port,\n host: options.host,\n fs: {\n allow: [process.cwd(), config.root ?? process.cwd(), devUIDir, ...['vue', 'vue-router', 'reka-ui', '@vueuse/core', '@vueuse/shared', '@lucide/vue', 'class-variance-authority', 'clsx', 'tailwind-merge', 'culori'].map(pkg)],\n },\n },\n customLogger: customLogger(),\n })\n\n // Store renderer ref on server for cleanup\n const originalClose = server.close.bind(server)\n server.close = async () => {\n setActiveRenderer(null)\n await renderer.close()\n return originalClose()\n }\n\n await server.listen()\n\n const startupTime = Math.round(performance.now() - start)\n\n if (!options.silent) {\n printBanner(server, startupTime)\n }\n\n // Expose startup time so the plugin can print it later\n ; (server as any)._maizzleStartupTime = startupTime\n\n return server\n}\n\n/**\n * Internal Vite plugin that adds Maizzle middleware and file watching to the dev UI server.\n */\nfunction maizzleDevPlugin(\n config: MaizzleConfig,\n renderer: Renderer,\n configInput: Partial<MaizzleConfig> | string | undefined,\n) {\n return {\n name: 'maizzle:dev',\n enforce: 'pre' as const,\n\n hotUpdate: {\n order: 'pre' as const,\n handler({ file }: { file: string }) {\n /**\n * Prevent Tailwind/Vue from triggering a full reload for email template\n * files. Maizzle handles these via custom HMR events in the\n * watcher below.\n */\n if (isTemplateFile(file)) {\n return []\n }\n },\n },\n\n configureServer(server: ViteDevServer) {\n // File watching\n const defaultWatchPaths = [\n 'maizzle.config.js',\n 'maizzle.config.ts',\n 'tailwind.config.js',\n 'tailwind.config.ts',\n 'locales/**',\n ]\n\n const userWatchPaths = config.server?.watch ?? []\n const watchPaths = [...defaultWatchPaths, ...userWatchPaths]\n // Match against cwd, not config.root: the watched paths (maizzle/tailwind\n // configs, locales) are project-root relative, and `watcher.add` below\n // resolves them against cwd too. Using config.root would break matching\n // when root points at a subdirectory (e.g. the Vite-plugin setup).\n const isWatchedFile = createWatchedFileMatcher(watchPaths, process.cwd())\n\n for (const watchPath of watchPaths) {\n server.watcher.add(watchPath)\n }\n\n /**\n * Serialize watcher work onto one chain. The change handler closes and\n * recreates the renderer across awaits; without serialization a second\n * event firing mid-reload closes a stale renderer and leaks the new one.\n * Errors are caught so one failed task doesn't break the chain.\n */\n let watcherChain: Promise<void> = Promise.resolve()\n const enqueue = (task: () => Promise<void>): Promise<void> => {\n watcherChain = watcherChain.then(task).catch((err) => {\n console.error('[maizzle] watcher task failed:', err)\n })\n return watcherChain\n }\n\n server.watcher.on('add', file => enqueue(async () => {\n if (isTemplateFile(file)) {\n await renderer.invalidateAll()\n bumpGeneration()\n server.ws.send({ type: 'custom', event: 'maizzle:templates-changed' })\n }\n }))\n\n server.watcher.on('unlink', file => enqueue(async () => {\n if (isTemplateFile(file)) {\n await renderer.invalidateAll()\n bumpGeneration()\n server.ws.send({ type: 'custom', event: 'maizzle:templates-changed' })\n }\n }))\n\n server.watcher.on('change', file => enqueue(async () => {\n if (isWatchedFile(file)) {\n config = await resolveConfig(configInput)\n\n // Recreate the renderer so config changes (e.g. markdown.shikiTheme) take effect\n await renderer.close()\n renderer = await createRenderer({ dts: true, markdown: config.markdown, root: config.root, componentDirs: normalizeComponentSources(config.components?.source, process.cwd()), vite: config.vite })\n\n // Re-register the new renderer so user-land render() calls don't keep\n // reusing the closed one (see setActiveRenderer above).\n setActiveRenderer(renderer)\n\n /**\n * Push UI-relevant config bits so the dev UI reacts to live edits\n * without a page reload. Uses the same shape as the initial\n * inject.\n */\n server.ws.send({ type: 'custom', event: 'maizzle:config-updated', data: buildUiConfig(config) })\n }\n\n /**\n * Invalidate all renderer modules so component and config changes\n * are picked up on the next render (Tailwind recompiles with\n * fresh content).\n */\n await renderer.invalidateAll()\n bumpGeneration()\n\n if (\n isTemplateFile(file)\n || isWatchedFile(file)\n ) {\n server.ws.send({ type: 'custom', event: 'maizzle:template-updated', data: { file } })\n }\n }))\n\n // API middleware (before Vite's middleware)\n server.middlewares.use(async (req: any, res: any, next: any) => {\n const url = req.url || '/'\n\n if (url === '/__maizzle/templates') {\n return serveTemplateList(config, res)\n }\n\n if (url.startsWith('/__maizzle/render/')) {\n return await serveRenderedTemplate(url, config, renderer, res)\n }\n\n if (url.startsWith('/__maizzle/source/')) {\n return await serveHighlightedSource(url, config, renderer, res)\n }\n\n if (url.startsWith('/__maizzle/compatibility/')) {\n return await serveCompatibility(url, res, config, normalizeComponentSources(config.components?.source, process.cwd()))\n }\n\n if (url.startsWith('/__maizzle/lint/')) {\n return await serveLint(url, res, config, normalizeComponentSources(config.components?.source, process.cwd()))\n }\n\n if (url.startsWith('/__maizzle/vue-source/')) {\n return await serveVueSource(url, config, res)\n }\n\n if (url.startsWith('/__maizzle/plaintext/')) {\n return await servePlaintext(url, config, renderer, res)\n }\n\n if (url.startsWith('/__maizzle/stats/')) {\n return await serveStats(url, config, renderer, res)\n }\n\n if (url.startsWith('/__maizzle/email/') && req.method === 'POST') {\n return await serveEmailEndpoint(url, req, res, config, renderer)\n }\n\n if (url === '/__maizzle/email-config') {\n return serveEmailConfig(config, res)\n }\n\n next()\n })\n\n // Dev UI fallback (after Vite's middleware)\n return () => {\n server.middlewares.use(async (req: any, res: any, next: any) => {\n if (isNavigationRequest(req)) {\n return await serveDevUI(server, res, req.url || '/', config)\n }\n\n next()\n })\n }\n },\n }\n}\n\nfunction isTemplateFile(file: string): boolean {\n return (file.endsWith('.vue') || file.endsWith('.md')) && !file.includes('server/ui')\n}\n\nfunction isNavigationRequest(req: any): boolean {\n const accept = req.headers?.accept || ''\n return req.method === 'GET' && accept.includes('text/html')\n}\n\n/**\n * Shape exposed to the dev UI both at initial HTML load (as\n * `window.__MAIZZLE_CONFIG__`) and on the `maizzle:config-updated` HMR event.\n * Add UI-visible config bits here; consumers on both ends pick up automatically.\n */\nfunction buildUiConfig(config: MaizzleConfig) {\n return {\n checks: config.server?.checks ?? true,\n }\n}\n\nasync function serveDevUI(server: ViteDevServer, res: any, url: string, config: MaizzleConfig) {\n let indexHtml = readFileSync(resolve(devUIDir, 'index.html'), 'utf-8')\n\n indexHtml = indexHtml.replace('./main.ts', `/@fs/${resolve(devUIDir, 'main.ts')}`)\n indexHtml = indexHtml.replace('./favicon.svg', `/@fs/${resolve(devUIDir, 'favicon.svg')}`)\n\n const configScript = `<script>window.__MAIZZLE_CONFIG__ = ${JSON.stringify(buildUiConfig(config))};</script>`\n indexHtml = indexHtml.replace('</head>', `${configScript}</head>`)\n\n const transformed = await server.transformIndexHtml(url, indexHtml)\n\n res.setHeader('Content-Type', 'text/html')\n res.end(transformed)\n}\n\nasync function serveTemplateList(config: MaizzleConfig, res: any) {\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const templates = await glob(contentPatterns)\n\n const data = templates.map(t => ({\n name: basename(t).replace(/\\.(vue|md)$/, ''),\n path: t,\n href: '/' + t.replace(/\\.(vue|md)$/, ''),\n }))\n\n res.setHeader('Content-Type', 'application/json')\n res.end(JSON.stringify(data))\n}\n\ninterface DedupedRender {\n /** Transformer output — before doctype prepend / stripForHtml / stripForPlaintext. */\n rawHtml: string\n doctype: string\n templateConfig: MaizzleConfig\n rendered: RenderedTemplate\n}\n\n/**\n * Render-result memo for the dev server. A single template save makes the\n * browser fire several endpoint requests in parallel (render, source, stats,\n * plaintext, email) that each need the same SSR render + transformer output.\n * Keying the in-flight Promise by `${generation}:${path}` collapses those into\n * one render and dedupes concurrent requests. The watcher bumps the generation\n * (and clears the cache) on every file/config change, so results never go\n * stale. Each endpoint applies its own tail step (doctype prepend, strip,\n * highlight, …) on top of `rawHtml`, keeping output byte-identical.\n */\nlet renderGeneration = 0\nconst renderCache = new Map<string, Promise<DedupedRender>>()\n\nfunction bumpGeneration() {\n renderGeneration++\n renderCache.clear()\n}\n\nfunction getRendered(absolutePath: string, config: MaizzleConfig, renderer: Renderer): Promise<DedupedRender> {\n const key = `${renderGeneration}:${absolutePath}`\n let promise = renderCache.get(key)\n if (!promise) {\n promise = (async () => {\n _setCurrentTemplate(parsePath(absolutePath))\n try {\n const rendered = await renderer.render(absolutePath, config)\n const templateConfig = rendered.templateConfig\n const doctype = rendered.doctype ?? templateConfig.doctype ?? '<!DOCTYPE html>'\n const rawHtml = await runTransformers(rendered.html, templateConfig, absolutePath, doctype, rendered.tailwindBlocks)\n return { rawHtml, doctype, templateConfig, rendered }\n } finally {\n _setCurrentTemplate(undefined)\n }\n })()\n renderCache.set(key, promise)\n }\n return promise\n}\n\n/**\n * SSR render a .vue template using the Renderer (not the dev UI server).\n */\nasync function serveRenderedTemplate(url: string, config: MaizzleConfig, renderer: Renderer, res: any) {\n const templateSlug = url.replace('/__maizzle/render/', '').replace(/\\?.*$/, '')\n\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const templates = await glob(contentPatterns)\n const match = templates.find(t => t.replace(/\\.(vue|md)$/, '') === templateSlug)\n\n if (!match) {\n res.statusCode = 404\n res.end('Template not found')\n return\n }\n\n const absolutePath = resolve(match)\n\n try {\n const { rawHtml, doctype } = await getRendered(absolutePath, config, renderer)\n let html = rawHtml\n if (doctype) html = `${doctype}\\n${html}`\n\n res.setHeader('Content-Type', 'text/html')\n res.end(stripForHtml(html))\n } catch (error: any) {\n res.statusCode = 500\n res.end(`<pre>${error.stack || error.message}</pre>`)\n }\n}\n\nlet highlighter: Highlighter | null = null\n\nasync function getHighlighter() {\n if (!highlighter) {\n highlighter = await createHighlighter({\n themes: ['laserwave'],\n langs: ['html', 'vue'],\n })\n }\n return highlighter\n}\n\nasync function serveHighlightedSource(url: string, config: MaizzleConfig, renderer: Renderer, res: any) {\n const templateSlug = url.replace('/__maizzle/source/', '').replace(/\\?.*$/, '')\n\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const templates = await glob(contentPatterns)\n const match = templates.find(t => t.replace(/\\.(vue|md)$/, '') === templateSlug)\n\n if (!match) {\n res.statusCode = 404\n res.end('Template not found')\n return\n }\n\n const absolutePath = resolve(match)\n\n try {\n const { rawHtml, doctype } = await getRendered(absolutePath, config, renderer)\n const html = stripForHtml(doctype ? `${doctype}\\n${rawHtml}` : rawHtml)\n\n const hl = await getHighlighter()\n const highlighted = hl.codeToHtml(html, {\n lang: 'html',\n theme: 'laserwave',\n transformers: [{\n line(node, line) {\n node.properties['data-line'] = line\n },\n }],\n })\n\n res.setHeader('Content-Type', 'text/html')\n res.end(highlighted)\n } catch (error: any) {\n res.statusCode = 500\n res.end(`<pre>${error.stack || error.message}</pre>`)\n }\n}\n\nasync function serveVueSource(url: string, config: MaizzleConfig, res: any) {\n const templateSlug = url.replace('/__maizzle/vue-source/', '').replace(/\\?.*$/, '')\n\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const templates = await glob(contentPatterns)\n const match = templates.find(t => t.replace(/\\.(vue|md)$/, '') === templateSlug)\n\n if (!match) {\n res.statusCode = 404\n res.end('Template not found')\n return\n }\n\n try {\n const source = readFileSync(resolve(match), 'utf-8')\n const lang = match.endsWith('.md') ? 'html' : 'vue'\n\n const hl = await getHighlighter()\n const highlighted = hl.codeToHtml(source, {\n lang,\n theme: 'laserwave',\n transformers: [{\n line(node, line) {\n node.properties['data-line'] = line\n },\n }],\n })\n\n res.setHeader('Content-Type', 'text/html')\n res.end(highlighted)\n } catch (error: any) {\n res.statusCode = 500\n res.end(`<pre>${error.stack || error.message}</pre>`)\n }\n}\n\nasync function servePlaintext(url: string, config: MaizzleConfig, renderer: Renderer, res: any) {\n const templateSlug = url.replace('/__maizzle/plaintext/', '').replace(/\\?.*$/, '')\n\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const templates = await glob(contentPatterns)\n const match = templates.find(t => t.replace(/\\.(vue|md)$/, '') === templateSlug)\n\n if (!match) {\n res.statusCode = 404\n res.end('Template not found')\n return\n }\n\n const absolutePath = resolve(match)\n\n try {\n const { rawHtml } = await getRendered(absolutePath, config, renderer)\n const plaintext = createPlaintext(stripForPlaintext(rawHtml))\n\n res.setHeader('Content-Type', 'text/plain')\n res.end(plaintext)\n } catch (error: any) {\n res.statusCode = 500\n res.end(error.message)\n }\n}\n\nfunction humanFileSize(bytes: number, si = false, dp = 2) {\n const threshold = si ? 1000 : 1024\n\n if (Math.abs(bytes) < threshold) {\n return bytes + ' B'\n }\n\n const units = ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']\n let u = -1\n const r = 10 ** dp\n\n do {\n bytes /= threshold\n ++u\n } while (Math.round(Math.abs(bytes) * r) / r >= threshold && u < units.length - 1)\n\n return bytes.toFixed(dp) + ' ' + units[u]\n}\n\nasync function serveStats(url: string, config: MaizzleConfig, renderer: Renderer, res: any) {\n const templateSlug = url.replace('/__maizzle/stats/', '').replace(/\\?.*$/, '')\n\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const templates = await glob(contentPatterns)\n const match = templates.find(t => t.replace(/\\.(vue|md)$/, '') === templateSlug)\n\n if (!match) {\n res.statusCode = 404\n res.end(JSON.stringify({ error: 'Template not found' }))\n return\n }\n\n const absolutePath = resolve(match)\n\n try {\n const { rawHtml } = await getRendered(absolutePath, config, renderer)\n const html = stripForHtml(rawHtml)\n\n const sizeBytes = new TextEncoder().encode(html).length\n\n // Count images: <img> tags and CSS background images\n const imgTags = (html.match(/<img\\b[^>]*>/gi) || []).length\n const bgImages = (html.match(/url\\s*\\([^)]+\\)/gi) || []).length\n const totalImages = imgTags + bgImages\n\n // Count links\n const links = (html.match(/<a\\b[^>]*href\\s*=/gi) || []).length\n\n res.setHeader('Content-Type', 'application/json')\n res.end(JSON.stringify({\n size: {\n bytes: sizeBytes,\n formatted: humanFileSize(sizeBytes),\n },\n images: totalImages,\n links,\n }))\n } catch (error: any) {\n res.statusCode = 500\n res.end(JSON.stringify({ error: error.message }))\n }\n}\n\nasync function serveEmailEndpoint(url: string, req: any, res: any, config: MaizzleConfig, renderer: Renderer) {\n const templateSlug = url.replace('/__maizzle/email/', '').replace(/\\?.*$/, '')\n\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const templates = await glob(contentPatterns)\n const match = templates.find(t => t.replace(/\\.(vue|md)$/, '') === templateSlug)\n\n if (!match) {\n res.statusCode = 404\n res.end(JSON.stringify({ success: false, message: 'Template not found' }))\n return\n }\n\n let body = ''\n for await (const chunk of req) body += chunk\n\n let payload: { to: string[]; subject: string }\n\n try {\n payload = JSON.parse(body)\n } catch {\n res.statusCode = 400\n res.end(JSON.stringify({ success: false, message: 'Invalid JSON' }))\n return\n }\n\n if (!payload.to?.length) {\n res.statusCode = 400\n res.end(JSON.stringify({ success: false, message: 'Missing recipients' }))\n return\n }\n\n const absolutePath = resolve(match)\n\n try {\n const { rawHtml, doctype, templateConfig } = await getRendered(absolutePath, config, renderer)\n let html = doctype ? `${doctype}\\n${rawHtml}` : rawHtml\n\n const text = createPlaintext(stripForPlaintext(html))\n html = stripForHtml(html)\n\n const result = await sendEmail(\n { to: payload.to, subject: payload.subject, html, text },\n config,\n templateConfig,\n )\n\n res.setHeader('Content-Type', 'application/json')\n res.end(JSON.stringify(result))\n } catch (error: any) {\n res.statusCode = 500\n res.end(JSON.stringify({ success: false, message: error.message }))\n }\n}\n\nfunction serveEmailConfig(config: MaizzleConfig, res: any) {\n const emailConfig = config.server?.email\n res.setHeader('Content-Type', 'application/json')\n res.end(JSON.stringify({\n to: emailConfig?.to ? (Array.isArray(emailConfig.to) ? emailConfig.to : [emailConfig.to]) : [],\n from: emailConfig?.from ?? '',\n subject: emailConfig?.subject ?? '',\n hasTransport: !!emailConfig?.transport,\n }))\n}\n\nexport function printBanner(server: ViteDevServer, startupTime?: number) {\n const info = server.config.logger.info\n const time = startupTime ?? (server as any)._maizzleStartupTime\n\n const networkUrl = server.resolvedUrls?.network[0]\n if (networkUrl) {\n const qr = renderUnicodeCompact(networkUrl, { border: 1 })\n info('')\n info(qr.split('\\n').map(line => ` ${line}`).join('\\n'))\n }\n\n info('')\n info(` \\x1b[32m\\x1b[1mMAIZZLE\\x1b[0m\\x1b[32m v6.0.0\\x1b[0m \\x1b[2mready in\\x1b[0m \\x1b[1m${time}\\x1b[0m ms`)\n info('')\n server.printUrls()\n info('')\n}\n\nfunction customLogger() {\n const logger = createLogger('info')\n const warn = logger.warn\n\n logger.warn = (message, options) => {\n if (typeof message === 'string' && message.includes('<tr> cannot be child of <table>')) {\n return\n }\n\n warn(message, options)\n }\n\n return logger\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,WAAW,QADC,QAAQ,cAAc,OAAO,KAAK,GAAG,CACtB,GAAG,WAAW;AAE/C,MAAM,UAAU,cAAc,OAAO,KAAK,GAAG;AAC7C,MAAM,OAAO,SAAiB;CAC5B,MAAM,WAAW,QAAQ,QAAQ,IAAI,CAAC,CAAC,QAAQ,OAAO,GAAG;CACzD,MAAM,SAAS,gBAAgB;CAC/B,MAAM,MAAM,SAAS,YAAY,MAAM;CAEvC,OAAO,SAAS,MAAM,GAAG,MAAM,OAAO,MAAM;AAC9C;;;;;;;;;AAUA,MAAM,eAAe,SAAiB;CACpC,MAAM,MAAM,IAAI,IAAI;CACpB,MAAM,KAAK,KAAK,MAAM,aAAa,QAAQ,KAAK,cAAc,GAAG,OAAO,CAAC;CAEzE,OAAO,QAAQ,KADD,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AEA,SAAgB,YAAY,QAAuB,aAAsB;CACvE,MAAM,OAAO,OAAO,OAAO,OAAO;CAClC,MAAM,OAAO,eAAgB,OAAe;CAE5C,MAAM,aAAa,OAAO,cAAc,QAAQ;CAChD,IAAI,YAAY;EACd,MAAM,KAAK,qBAAqB,YAAY,EAAE,QAAQ,EAAE,CAAC;EACzD,KAAK,EAAE;EACP,KAAK,GAAG,MAAM,IAAI,CAAC,CAAC,KAAI,SAAQ,KAAK,MAAM,CAAC,CAAC,KAAK,IAAI,CAAC;CACzD;CAEA,KAAK,EAAE;CACP,KAAK,wFAAwF,KAAK,WAAW;CAC7G,KAAK,EAAE;CACP,OAAO,UAAU;CACjB,KAAK,EAAE;AACT;AAEA,SAAS,eAAe;CACtB,MAAM,SAAS,aAAa,MAAM;CAClC,MAAM,OAAO,OAAO;CAEpB,OAAO,QAAQ,SAAS,YAAY;EAClC,IAAI,OAAO,YAAY,YAAY,QAAQ,SAAS,iCAAiC,GACnF;EAGF,KAAK,SAAS,OAAO;CACvB;CAEA,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"serve.js","names":["parsePath"],"sources":["../src/serve.ts"],"sourcesContent":["import { readFileSync } from 'node:fs'\nimport { dirname, resolve, basename, parse as parsePath } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { createRequire } from 'node:module'\nimport { createServer, createLogger, type ViteDevServer } from 'vite'\nimport { renderUnicodeCompact } from 'uqr'\nimport vue from '@vitejs/plugin-vue'\nimport tailwindcss from '@tailwindcss/vite'\nimport { glob } from 'tinyglobby'\nimport { createHighlighter, type Highlighter } from 'shiki'\nimport { createPlaintext } from './plaintext.ts'\nimport { stripForHtml, stripForPlaintext } from './utils/output-markers.ts'\nimport { resolveConfig } from './config/index.ts'\nimport { runTransformers } from './transformers/index.ts'\nimport { EventManager } from './events/index.ts'\nimport { cloneConfig } from './utils/cloneConfig.ts'\nimport { createRenderer, type Renderer, type RenderedTemplate } from './render/createRenderer.ts'\nimport { _setCurrentTemplate } from './composables/useCurrentTemplate.ts'\nimport { setActiveRenderer } from './render/active.ts'\nimport { serveCompatibility } from './server/compatibility.ts'\nimport { serveLint } from './server/linter.ts'\nimport { sendEmail } from './server/email.ts'\nimport { normalizeComponentSources } from './utils/componentSources.ts'\nimport { createWatchedFileMatcher } from './utils/watchPaths.ts'\nimport type { MaizzleConfig } from './types/index.ts'\n\nconst __dirname = dirname(fileURLToPath(import.meta.url))\nconst devUIDir = resolve(__dirname, 'server/ui')\n\nconst require = createRequire(import.meta.url)\nconst pkg = (name: string) => {\n const resolved = require.resolve(name).replace(/\\\\/g, '/')\n const marker = `node_modules/${name}`\n const idx = resolved.lastIndexOf(marker)\n\n return resolved.slice(0, idx + marker.length)\n}\n\n/**\n * Resolve a package's ESM entry via its `exports` map. Aliasing to the\n * package directory bypasses `exports` (it only keys off the bare name),\n * so directory resolution can fall back to a UMD/CJS bundle — which Vite 8\n * flags `needsInterop` and then default-imports, breaking ESM-only deps\n * like culori (named exports, no default). Point the alias at the real\n * ESM entry instead.\n */\nconst pkgEsmEntry = (name: string) => {\n const dir = pkg(name)\n const pj = JSON.parse(readFileSync(resolve(dir, 'package.json'), 'utf-8'))\n const entry = pj.exports?.['.']?.import ?? pj.module ?? pj.main\n return resolve(dir, entry)\n}\n\nexport interface ServeOptions {\n config?: Partial<MaizzleConfig> | string\n /** Override the dev server port (takes precedence over config.server.port) */\n port?: number\n /** Expose the server on the network (e.g. --host) */\n host?: boolean | string\n /** When true, suppresses the startup banner/URL output. */\n silent?: boolean\n}\n\n/**\n * Start the Maizzle dev server.\n *\n * Creates two things:\n * 1. A Vite dev server for the dev UI (sidebar + preview, with Vue + Tailwind for the UI itself)\n * 2. A Renderer instance for SSR rendering email templates\n *\n * Template rendering goes through the Renderer, not the Vite dev server.\n */\nexport async function serve(options: ServeOptions = {}) {\n const start = performance.now()\n\n let config = await resolveConfig(options.config)\n const port = options.port ?? config.server?.port ?? 3000\n\n // Create a renderer for SSR rendering email templates (with dts for dev)\n let renderer = await createRenderer({ dts: true, markdown: config.markdown, root: config.root, componentDirs: normalizeComponentSources(config.components?.source, process.cwd()), vite: config.vite })\n\n /**\n * Register so user-land render() calls reuse this renderer instead of\n * spinning up another Vite SSR server (which collides when the host\n * app is itself a Vite dev process — e.g. TanStack Start).\n */\n setActiveRenderer(renderer)\n\n const events = new EventManager()\n events.registerConfig(config)\n await events.fireBeforeCreate({ config })\n\n const server = await createServer({\n configFile: false,\n plugins: [\n // Vue and Tailwind are only for the dev UI SPA, not for email templates\n vue(),\n tailwindcss(),\n maizzleDevPlugin(config, renderer, events, options.config),\n ],\n resolve: {\n dedupe: ['vue'],\n alias: [\n { find: '@', replacement: devUIDir },\n { find: 'vue', replacement: resolve(pkg('vue'), 'dist/vue.runtime.esm-bundler.js') },\n // culori is ESM-only — alias to its ESM entry, not the package dir (see pkgEsmEntry)\n { find: 'culori', replacement: pkgEsmEntry('culori') },\n ...['vue-router', 'reka-ui', '@vueuse/core', '@vueuse/shared', '@lucide/vue', 'class-variance-authority', 'clsx', 'tailwind-merge']\n .map(name => ({ find: name, replacement: pkg(name) })),\n ],\n },\n cacheDir: resolve(devUIDir, '.vite'),\n optimizeDeps: {\n noDiscovery: true,\n include: [\n 'vue',\n 'vue-router',\n '@lucide/vue',\n '@vueuse/core',\n '@vueuse/shared',\n 'reka-ui',\n 'class-variance-authority',\n 'clsx',\n 'tailwind-merge',\n 'culori',\n ],\n },\n server: {\n port,\n host: options.host,\n fs: {\n allow: [process.cwd(), config.root ?? process.cwd(), devUIDir, ...['vue', 'vue-router', 'reka-ui', '@vueuse/core', '@vueuse/shared', '@lucide/vue', 'class-variance-authority', 'clsx', 'tailwind-merge', 'culori'].map(pkg)],\n },\n },\n customLogger: customLogger(),\n })\n\n // Store renderer ref on server for cleanup\n const originalClose = server.close.bind(server)\n server.close = async () => {\n setActiveRenderer(null)\n await renderer.close()\n return originalClose()\n }\n\n await server.listen()\n\n const startupTime = Math.round(performance.now() - start)\n\n if (!options.silent) {\n printBanner(server, startupTime)\n }\n\n // Expose startup time so the plugin can print it later\n ; (server as any)._maizzleStartupTime = startupTime\n\n return server\n}\n\n/**\n * Internal Vite plugin that adds Maizzle middleware and file watching to the dev UI server.\n */\nfunction maizzleDevPlugin(\n config: MaizzleConfig,\n renderer: Renderer,\n events: EventManager,\n configInput: Partial<MaizzleConfig> | string | undefined,\n) {\n return {\n name: 'maizzle:dev',\n enforce: 'pre' as const,\n\n hotUpdate: {\n order: 'pre' as const,\n handler({ file }: { file: string }) {\n /**\n * Prevent Tailwind/Vue from triggering a full reload for email template\n * files. Maizzle handles these via custom HMR events in the\n * watcher below.\n */\n if (isTemplateFile(file)) {\n return []\n }\n },\n },\n\n configureServer(server: ViteDevServer) {\n // File watching\n const defaultWatchPaths = [\n 'maizzle.config.js',\n 'maizzle.config.ts',\n 'tailwind.config.js',\n 'tailwind.config.ts',\n 'locales/**',\n ]\n\n const userWatchPaths = config.server?.watch ?? []\n const watchPaths = [...defaultWatchPaths, ...userWatchPaths]\n // Match against cwd, not config.root: the watched paths (maizzle/tailwind\n // configs, locales) are project-root relative, and `watcher.add` below\n // resolves them against cwd too. Using config.root would break matching\n // when root points at a subdirectory (e.g. the Vite-plugin setup).\n const isWatchedFile = createWatchedFileMatcher(watchPaths, process.cwd())\n\n for (const watchPath of watchPaths) {\n server.watcher.add(watchPath)\n }\n\n /**\n * Serialize watcher work onto one chain. The change handler closes and\n * recreates the renderer across awaits; without serialization a second\n * event firing mid-reload closes a stale renderer and leaks the new one.\n * Errors are caught so one failed task doesn't break the chain.\n */\n let watcherChain: Promise<void> = Promise.resolve()\n const enqueue = (task: () => Promise<void>): Promise<void> => {\n watcherChain = watcherChain.then(task).catch((err) => {\n console.error('[maizzle] watcher task failed:', err)\n })\n return watcherChain\n }\n\n server.watcher.on('add', file => enqueue(async () => {\n if (isTemplateFile(file)) {\n await renderer.invalidateAll()\n bumpGeneration()\n server.ws.send({ type: 'custom', event: 'maizzle:templates-changed' })\n }\n }))\n\n server.watcher.on('unlink', file => enqueue(async () => {\n if (isTemplateFile(file)) {\n await renderer.invalidateAll()\n bumpGeneration()\n server.ws.send({ type: 'custom', event: 'maizzle:templates-changed' })\n }\n }))\n\n server.watcher.on('change', file => enqueue(async () => {\n if (isWatchedFile(file)) {\n config = await resolveConfig(configInput)\n\n // Re-register event handlers against the reloaded config (the config\n // object is replaced wholesale, so old handlers would be stale).\n events.clear()\n events.registerConfig(config)\n\n // Recreate the renderer so config changes (e.g. markdown.shikiTheme) take effect\n await renderer.close()\n renderer = await createRenderer({ dts: true, markdown: config.markdown, root: config.root, componentDirs: normalizeComponentSources(config.components?.source, process.cwd()), vite: config.vite })\n\n // Re-register the new renderer so user-land render() calls don't keep\n // reusing the closed one (see setActiveRenderer above).\n setActiveRenderer(renderer)\n\n /**\n * Push UI-relevant config bits so the dev UI reacts to live edits\n * without a page reload. Uses the same shape as the initial\n * inject.\n */\n server.ws.send({ type: 'custom', event: 'maizzle:config-updated', data: buildUiConfig(config) })\n }\n\n /**\n * Invalidate all renderer modules so component and config changes\n * are picked up on the next render (Tailwind recompiles with\n * fresh content).\n */\n await renderer.invalidateAll()\n bumpGeneration()\n\n if (\n isTemplateFile(file)\n || isWatchedFile(file)\n ) {\n server.ws.send({ type: 'custom', event: 'maizzle:template-updated', data: { file } })\n }\n }))\n\n // API middleware (before Vite's middleware)\n server.middlewares.use(async (req: any, res: any, next: any) => {\n const url = req.url || '/'\n\n if (url === '/__maizzle/templates') {\n return serveTemplateList(config, res)\n }\n\n if (url.startsWith('/__maizzle/render/')) {\n return await serveRenderedTemplate(url, config, renderer, events, res)\n }\n\n if (url.startsWith('/__maizzle/source/')) {\n return await serveHighlightedSource(url, config, renderer, events, res)\n }\n\n if (url.startsWith('/__maizzle/compatibility/')) {\n return await serveCompatibility(url, res, config, normalizeComponentSources(config.components?.source, process.cwd()))\n }\n\n if (url.startsWith('/__maizzle/lint/')) {\n return await serveLint(url, res, config, normalizeComponentSources(config.components?.source, process.cwd()))\n }\n\n if (url.startsWith('/__maizzle/vue-source/')) {\n return await serveVueSource(url, config, res)\n }\n\n if (url.startsWith('/__maizzle/plaintext/')) {\n return await servePlaintext(url, config, renderer, events, res)\n }\n\n if (url.startsWith('/__maizzle/stats/')) {\n return await serveStats(url, config, renderer, events, res)\n }\n\n if (url.startsWith('/__maizzle/email/') && req.method === 'POST') {\n return await serveEmailEndpoint(url, req, res, config, renderer, events)\n }\n\n if (url === '/__maizzle/email-config') {\n return serveEmailConfig(config, res)\n }\n\n next()\n })\n\n // Dev UI fallback (after Vite's middleware)\n return () => {\n server.middlewares.use(async (req: any, res: any, next: any) => {\n if (isNavigationRequest(req)) {\n return await serveDevUI(server, res, req.url || '/', config)\n }\n\n next()\n })\n }\n },\n }\n}\n\nfunction isTemplateFile(file: string): boolean {\n return (file.endsWith('.vue') || file.endsWith('.md')) && !file.includes('server/ui')\n}\n\nfunction isNavigationRequest(req: any): boolean {\n const accept = req.headers?.accept || ''\n return req.method === 'GET' && accept.includes('text/html')\n}\n\n/**\n * Shape exposed to the dev UI both at initial HTML load (as\n * `window.__MAIZZLE_CONFIG__`) and on the `maizzle:config-updated` HMR event.\n * Add UI-visible config bits here; consumers on both ends pick up automatically.\n */\nfunction buildUiConfig(config: MaizzleConfig) {\n return {\n checks: config.server?.checks ?? true,\n }\n}\n\nasync function serveDevUI(server: ViteDevServer, res: any, url: string, config: MaizzleConfig) {\n let indexHtml = readFileSync(resolve(devUIDir, 'index.html'), 'utf-8')\n\n indexHtml = indexHtml.replace('./main.ts', `/@fs/${resolve(devUIDir, 'main.ts')}`)\n indexHtml = indexHtml.replace('./favicon.svg', `/@fs/${resolve(devUIDir, 'favicon.svg')}`)\n\n const configScript = `<script>window.__MAIZZLE_CONFIG__ = ${JSON.stringify(buildUiConfig(config))};</script>`\n indexHtml = indexHtml.replace('</head>', `${configScript}</head>`)\n\n const transformed = await server.transformIndexHtml(url, indexHtml)\n\n res.setHeader('Content-Type', 'text/html')\n res.end(transformed)\n}\n\nasync function serveTemplateList(config: MaizzleConfig, res: any) {\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const templates = await glob(contentPatterns)\n\n const data = templates.map(t => ({\n name: basename(t).replace(/\\.(vue|md)$/, ''),\n path: t,\n href: '/' + t.replace(/\\.(vue|md)$/, ''),\n }))\n\n res.setHeader('Content-Type', 'application/json')\n res.end(JSON.stringify(data))\n}\n\ninterface DedupedRender {\n /** Transformer output — before doctype prepend / stripForHtml / stripForPlaintext. */\n rawHtml: string\n doctype: string\n templateConfig: MaizzleConfig\n rendered: RenderedTemplate\n}\n\n/**\n * Render-result memo for the dev server. A single template save makes the\n * browser fire several endpoint requests in parallel (render, source, stats,\n * plaintext, email) that each need the same SSR render + transformer output.\n * Keying the in-flight Promise by `${generation}:${path}` collapses those into\n * one render and dedupes concurrent requests. The watcher bumps the generation\n * (and clears the cache) on every file/config change, so results never go\n * stale. Each endpoint applies its own tail step (doctype prepend, strip,\n * highlight, …) on top of `rawHtml`, keeping output byte-identical.\n */\nlet renderGeneration = 0\nconst renderCache = new Map<string, Promise<DedupedRender>>()\n\nfunction bumpGeneration() {\n renderGeneration++\n renderCache.clear()\n}\n\nfunction getRendered(absolutePath: string, config: MaizzleConfig, renderer: Renderer, events: EventManager): Promise<DedupedRender> {\n const key = `${renderGeneration}:${absolutePath}`\n let promise = renderCache.get(key)\n if (!promise) {\n promise = (async () => {\n _setCurrentTemplate(parsePath(absolutePath))\n try {\n /**\n * Mirror the build's per-template event pipeline (see buildTemplate)\n * so dev preview fires the same beforeRender / afterRender /\n * afterTransform hooks and matches production output. Clone config so\n * beforeRender mutations stay scoped to this render.\n */\n const renderConfig = cloneConfig(config)\n const template = { source: readFileSync(absolutePath, 'utf-8'), path: parsePath(absolutePath) }\n const originalSource = template.source\n\n await events.fireBeforeRender({ config: renderConfig, template })\n\n const rendered = await renderer.render(\n absolutePath,\n renderConfig,\n template.source !== originalSource ? { source: template.source } : undefined,\n )\n\n for (const { name, handler } of rendered.sfcEventHandlers) {\n events.on(name, handler)\n }\n\n const templateConfig = rendered.templateConfig\n let html = await events.fireAfterRender({ config: templateConfig, template, html: rendered.html })\n const doctype = rendered.doctype ?? templateConfig.doctype ?? '<!DOCTYPE html>'\n\n if (templateConfig.useTransformers !== false) {\n html = await runTransformers(html, templateConfig, absolutePath, doctype, rendered.tailwindBlocks)\n }\n\n const rawHtml = await events.fireAfterTransform({ config: templateConfig, template, html })\n\n return { rawHtml, doctype, templateConfig, rendered }\n } finally {\n _setCurrentTemplate(undefined)\n events.clearSfcHandlers()\n }\n })()\n renderCache.set(key, promise)\n }\n return promise\n}\n\n/**\n * SSR render a .vue template using the Renderer (not the dev UI server).\n */\nasync function serveRenderedTemplate(url: string, config: MaizzleConfig, renderer: Renderer, events: EventManager, res: any) {\n const templateSlug = url.replace('/__maizzle/render/', '').replace(/\\?.*$/, '')\n\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const templates = await glob(contentPatterns)\n const match = templates.find(t => t.replace(/\\.(vue|md)$/, '') === templateSlug)\n\n if (!match) {\n res.statusCode = 404\n res.end('Template not found')\n return\n }\n\n const absolutePath = resolve(match)\n\n try {\n const { rawHtml, doctype } = await getRendered(absolutePath, config, renderer, events)\n let html = rawHtml\n if (doctype) html = `${doctype}\\n${html}`\n\n res.setHeader('Content-Type', 'text/html')\n res.end(stripForHtml(html))\n } catch (error: any) {\n res.statusCode = 500\n res.end(`<pre>${error.stack || error.message}</pre>`)\n }\n}\n\nlet highlighter: Highlighter | null = null\n\nasync function getHighlighter() {\n if (!highlighter) {\n highlighter = await createHighlighter({\n themes: ['laserwave'],\n langs: ['html', 'vue'],\n })\n }\n return highlighter\n}\n\nasync function serveHighlightedSource(url: string, config: MaizzleConfig, renderer: Renderer, events: EventManager, res: any) {\n const templateSlug = url.replace('/__maizzle/source/', '').replace(/\\?.*$/, '')\n\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const templates = await glob(contentPatterns)\n const match = templates.find(t => t.replace(/\\.(vue|md)$/, '') === templateSlug)\n\n if (!match) {\n res.statusCode = 404\n res.end('Template not found')\n return\n }\n\n const absolutePath = resolve(match)\n\n try {\n const { rawHtml, doctype } = await getRendered(absolutePath, config, renderer, events)\n const html = stripForHtml(doctype ? `${doctype}\\n${rawHtml}` : rawHtml)\n\n const hl = await getHighlighter()\n const highlighted = hl.codeToHtml(html, {\n lang: 'html',\n theme: 'laserwave',\n transformers: [{\n line(node, line) {\n node.properties['data-line'] = line\n },\n }],\n })\n\n res.setHeader('Content-Type', 'text/html')\n res.end(highlighted)\n } catch (error: any) {\n res.statusCode = 500\n res.end(`<pre>${error.stack || error.message}</pre>`)\n }\n}\n\nasync function serveVueSource(url: string, config: MaizzleConfig, res: any) {\n const templateSlug = url.replace('/__maizzle/vue-source/', '').replace(/\\?.*$/, '')\n\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const templates = await glob(contentPatterns)\n const match = templates.find(t => t.replace(/\\.(vue|md)$/, '') === templateSlug)\n\n if (!match) {\n res.statusCode = 404\n res.end('Template not found')\n return\n }\n\n try {\n const source = readFileSync(resolve(match), 'utf-8')\n const lang = match.endsWith('.md') ? 'html' : 'vue'\n\n const hl = await getHighlighter()\n const highlighted = hl.codeToHtml(source, {\n lang,\n theme: 'laserwave',\n transformers: [{\n line(node, line) {\n node.properties['data-line'] = line\n },\n }],\n })\n\n res.setHeader('Content-Type', 'text/html')\n res.end(highlighted)\n } catch (error: any) {\n res.statusCode = 500\n res.end(`<pre>${error.stack || error.message}</pre>`)\n }\n}\n\nasync function servePlaintext(url: string, config: MaizzleConfig, renderer: Renderer, events: EventManager, res: any) {\n const templateSlug = url.replace('/__maizzle/plaintext/', '').replace(/\\?.*$/, '')\n\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const templates = await glob(contentPatterns)\n const match = templates.find(t => t.replace(/\\.(vue|md)$/, '') === templateSlug)\n\n if (!match) {\n res.statusCode = 404\n res.end('Template not found')\n return\n }\n\n const absolutePath = resolve(match)\n\n try {\n const { rawHtml } = await getRendered(absolutePath, config, renderer, events)\n const plaintext = createPlaintext(stripForPlaintext(rawHtml))\n\n res.setHeader('Content-Type', 'text/plain')\n res.end(plaintext)\n } catch (error: any) {\n res.statusCode = 500\n res.end(error.message)\n }\n}\n\nfunction humanFileSize(bytes: number, si = false, dp = 2) {\n const threshold = si ? 1000 : 1024\n\n if (Math.abs(bytes) < threshold) {\n return bytes + ' B'\n }\n\n const units = ['KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']\n let u = -1\n const r = 10 ** dp\n\n do {\n bytes /= threshold\n ++u\n } while (Math.round(Math.abs(bytes) * r) / r >= threshold && u < units.length - 1)\n\n return bytes.toFixed(dp) + ' ' + units[u]\n}\n\nasync function serveStats(url: string, config: MaizzleConfig, renderer: Renderer, events: EventManager, res: any) {\n const templateSlug = url.replace('/__maizzle/stats/', '').replace(/\\?.*$/, '')\n\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const templates = await glob(contentPatterns)\n const match = templates.find(t => t.replace(/\\.(vue|md)$/, '') === templateSlug)\n\n if (!match) {\n res.statusCode = 404\n res.end(JSON.stringify({ error: 'Template not found' }))\n return\n }\n\n const absolutePath = resolve(match)\n\n try {\n const { rawHtml } = await getRendered(absolutePath, config, renderer, events)\n const html = stripForHtml(rawHtml)\n\n const sizeBytes = new TextEncoder().encode(html).length\n\n // Count images: <img> tags and CSS background images\n const imgTags = (html.match(/<img\\b[^>]*>/gi) || []).length\n const bgImages = (html.match(/url\\s*\\([^)]+\\)/gi) || []).length\n const totalImages = imgTags + bgImages\n\n // Count links\n const links = (html.match(/<a\\b[^>]*href\\s*=/gi) || []).length\n\n res.setHeader('Content-Type', 'application/json')\n res.end(JSON.stringify({\n size: {\n bytes: sizeBytes,\n formatted: humanFileSize(sizeBytes),\n },\n images: totalImages,\n links,\n }))\n } catch (error: any) {\n res.statusCode = 500\n res.end(JSON.stringify({ error: error.message }))\n }\n}\n\nasync function serveEmailEndpoint(url: string, req: any, res: any, config: MaizzleConfig, renderer: Renderer, events: EventManager) {\n const templateSlug = url.replace('/__maizzle/email/', '').replace(/\\?.*$/, '')\n\n const contentPatterns = config.content ?? ['emails/**/*.vue']\n const templates = await glob(contentPatterns)\n const match = templates.find(t => t.replace(/\\.(vue|md)$/, '') === templateSlug)\n\n if (!match) {\n res.statusCode = 404\n res.end(JSON.stringify({ success: false, message: 'Template not found' }))\n return\n }\n\n let body = ''\n for await (const chunk of req) body += chunk\n\n let payload: { to: string[]; subject: string }\n\n try {\n payload = JSON.parse(body)\n } catch {\n res.statusCode = 400\n res.end(JSON.stringify({ success: false, message: 'Invalid JSON' }))\n return\n }\n\n if (!payload.to?.length) {\n res.statusCode = 400\n res.end(JSON.stringify({ success: false, message: 'Missing recipients' }))\n return\n }\n\n const absolutePath = resolve(match)\n\n try {\n const { rawHtml, doctype, templateConfig } = await getRendered(absolutePath, config, renderer, events)\n let html = doctype ? `${doctype}\\n${rawHtml}` : rawHtml\n\n const text = createPlaintext(stripForPlaintext(html))\n html = stripForHtml(html)\n\n const result = await sendEmail(\n { to: payload.to, subject: payload.subject, html, text },\n config,\n templateConfig,\n )\n\n res.setHeader('Content-Type', 'application/json')\n res.end(JSON.stringify(result))\n } catch (error: any) {\n res.statusCode = 500\n res.end(JSON.stringify({ success: false, message: error.message }))\n }\n}\n\nfunction serveEmailConfig(config: MaizzleConfig, res: any) {\n const emailConfig = config.server?.email\n res.setHeader('Content-Type', 'application/json')\n res.end(JSON.stringify({\n to: emailConfig?.to ? (Array.isArray(emailConfig.to) ? emailConfig.to : [emailConfig.to]) : [],\n from: emailConfig?.from ?? '',\n subject: emailConfig?.subject ?? '',\n hasTransport: !!emailConfig?.transport,\n }))\n}\n\nexport function printBanner(server: ViteDevServer, startupTime?: number) {\n const info = server.config.logger.info\n const time = startupTime ?? (server as any)._maizzleStartupTime\n\n const networkUrl = server.resolvedUrls?.network[0]\n if (networkUrl) {\n const qr = renderUnicodeCompact(networkUrl, { border: 1 })\n info('')\n info(qr.split('\\n').map(line => ` ${line}`).join('\\n'))\n }\n\n info('')\n info(` \\x1b[32m\\x1b[1mMAIZZLE\\x1b[0m\\x1b[32m v6.0.0\\x1b[0m \\x1b[2mready in\\x1b[0m \\x1b[1m${time}\\x1b[0m ms`)\n info('')\n server.printUrls()\n info('')\n}\n\nfunction customLogger() {\n const logger = createLogger('info')\n const warn = logger.warn\n\n logger.warn = (message, options) => {\n if (typeof message === 'string' && message.includes('<tr> cannot be child of <table>')) {\n return\n }\n\n warn(message, options)\n }\n\n return logger\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAM,WAAW,QADC,QAAQ,cAAc,OAAO,KAAK,GAAG,CACtB,GAAG,WAAW;AAE/C,MAAM,UAAU,cAAc,OAAO,KAAK,GAAG;AAC7C,MAAM,OAAO,SAAiB;CAC5B,MAAM,WAAW,QAAQ,QAAQ,IAAI,CAAC,CAAC,QAAQ,OAAO,GAAG;CACzD,MAAM,SAAS,gBAAgB;CAC/B,MAAM,MAAM,SAAS,YAAY,MAAM;CAEvC,OAAO,SAAS,MAAM,GAAG,MAAM,OAAO,MAAM;AAC9C;;;;;;;;;AAUA,MAAM,eAAe,SAAiB;CACpC,MAAM,MAAM,IAAI,IAAI;CACpB,MAAM,KAAK,KAAK,MAAM,aAAa,QAAQ,KAAK,cAAc,GAAG,OAAO,CAAC;CAEzE,OAAO,QAAQ,KADD,GAAG,UAAU,IAAI,EAAE,UAAU,GAAG,UAAU,GAAG,IAClC;AAC3B;;;;;;;;;;AAqBA,eAAsB,MAAM,UAAwB,CAAC,GAAG;CACtD,MAAM,QAAQ,YAAY,IAAI;CAE9B,IAAI,SAAS,MAAM,cAAc,QAAQ,MAAM;CAC/C,MAAM,OAAO,QAAQ,QAAQ,OAAO,QAAQ,QAAQ;CAGpD,IAAI,WAAW,MAAM,eAAe;EAAE,KAAK;EAAM,UAAU,OAAO;EAAU,MAAM,OAAO;EAAM,eAAe,0BAA0B,OAAO,YAAY,QAAQ,QAAQ,IA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{ St as inject, W as computed, Wt as provide, mt as h } from "./vue.runtime.esm-bundler-N1X0OxKs.js";
|
|
3
3
|
//#region ../../home/cosmin/Work/maizzle/framework/node_modules/@lucide/vue/dist/esm/shared/src/utils/isEmptyString.mjs
|
|
4
4
|
/**
|
|
5
5
|
* @license @lucide/vue v1.17.0 - ISC
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Gn as reactive, It as onMounted, Jn as shallowReactive, Kn as readonly, N as Fragment, Nt as onBeforeUpdate, Pn as getCurrentScope, Qn as toRaw, Rn as isReadonly, St as inject, Vn as markRaw, Vt as onUpdated, W as computed, Xn as shallowRef, Yn as shallowReadonly, _n as watch, dt as getCurrentInstance, gt as hasInjectionContext, i as TransitionGroup, jn as customRef, kt as nextTick, mt as h, qn as ref, rr as unref, rt as defineComponent, tr as toValue, vn as watchEffect, zn as isRef } from "./vue.runtime.esm-bundler-
|
|
1
|
+
import { Gn as reactive, It as onMounted, Jn as shallowReactive, Kn as readonly, N as Fragment, Nt as onBeforeUpdate, Pn as getCurrentScope, Qn as toRaw, Rn as isReadonly, St as inject, Vn as markRaw, Vt as onUpdated, W as computed, Xn as shallowRef, Yn as shallowReadonly, _n as watch, dt as getCurrentInstance, gt as hasInjectionContext, i as TransitionGroup, jn as customRef, kt as nextTick, mt as h, qn as ref, rr as unref, rt as defineComponent, tr as toValue, vn as watchEffect, zn as isRef } from "./vue.runtime.esm-bundler-N1X0OxKs.js";
|
|
2
2
|
import { assert, autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, controlledComputed, controlledRef, createDisposableDirective, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, createReactiveFn, createRef, createSharedComposable, createSingletonPromise, debounceFilter, debouncedRef, debouncedWatch, eagerComputed, extendRef, formatDate, get, getLifeCycleTarget, hasOwn, hyphenate, identity, ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, pausableWatch, promiseTimeout, provideLocal, pxValue, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refManualReset, refThrottled, refWithControl, set, syncRef, syncRefs, throttleFilter, throttledRef, throttledWatch, timestamp, toArray, toReactive, toRef, toRefs, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever } from "./@vueuse_shared.js";
|
|
3
3
|
//#region ../../home/cosmin/Work/maizzle/framework/node_modules/@vueuse/core/dist/index.js
|
|
4
4
|
function computedAsync(evaluationCallback, initialState, optionsOrRef) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $n as toRef$1, Bt as onUnmounted, Gn as reactive, Hn as onScopeDispose, It as onMounted, Kn as readonly, Ln as isReactive, Mt as onBeforeUnmount, Nn as effectScope, Pn as getCurrentScope, St as inject, W as computed, Wt as provide, Xn as shallowRef, Yn as shallowReadonly, _n as watch, dt as getCurrentInstance, er as toRefs$1, gt as hasInjectionContext, jn as customRef, jt as onBeforeMount, kt as nextTick, qn as ref, rr as unref, tr as toValue, vn as watchEffect, zn as isRef } from "./vue.runtime.esm-bundler-
|
|
1
|
+
import { $n as toRef$1, Bt as onUnmounted, Gn as reactive, Hn as onScopeDispose, It as onMounted, Kn as readonly, Ln as isReactive, Mt as onBeforeUnmount, Nn as effectScope, Pn as getCurrentScope, St as inject, W as computed, Wt as provide, Xn as shallowRef, Yn as shallowReadonly, _n as watch, dt as getCurrentInstance, er as toRefs$1, gt as hasInjectionContext, jn as customRef, jt as onBeforeMount, kt as nextTick, qn as ref, rr as unref, tr as toValue, vn as watchEffect, zn as isRef } from "./vue.runtime.esm-bundler-N1X0OxKs.js";
|
|
2
2
|
//#region ../../home/cosmin/Work/maizzle/framework/node_modules/@vueuse/shared/dist/index.js
|
|
3
3
|
/**
|
|
4
4
|
*
|