@nimtech/nimpress 2.7.0 → 2.7.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/cli.es.js +1 -1
- package/dist/nimpress.es.js +1 -1
- package/dist/{plugin-C8OdcVeq.js → plugin-BZgsCxCz.js} +251 -250
- package/dist/plugin.es.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { readFile as le, readdir as Jt, writeFile as fe, copyFile as dn, cp as hn, mkdir as Je } from "node:fs/promises";
|
|
2
|
-
import { existsSync as he, readFileSync as Ce, statSync as
|
|
2
|
+
import { existsSync as he, readFileSync as Ce, statSync as yt, readdirSync as He, createReadStream as Ho } from "node:fs";
|
|
3
3
|
import { createRequire as Bn } from "node:module";
|
|
4
4
|
import { request as zo } from "node:http";
|
|
5
5
|
import { execFileSync as qo } from "node:child_process";
|
|
6
6
|
import { resolve as V, dirname as K, join as U, relative as Se, basename as Pe, extname as Gt, isAbsolute as xe, sep as $e } from "node:path";
|
|
7
7
|
import { createHash as Wn } from "node:crypto";
|
|
8
|
-
import
|
|
8
|
+
import bt from "gray-matter";
|
|
9
9
|
import Ln from "markdown-it";
|
|
10
10
|
import gn from "markdown-it-anchor";
|
|
11
11
|
import Uo from "markdown-it-attrs";
|
|
@@ -18,7 +18,7 @@ import { parse as zn, stringify as Xo } from "yaml";
|
|
|
18
18
|
import { createHighlighter as Yo } from "shiki";
|
|
19
19
|
import { fileURLToPath as Ko, pathToFileURL as _n } from "node:url";
|
|
20
20
|
import { exporter as Zo } from "@dbml/core";
|
|
21
|
-
import { n as Qo, r as et, e as
|
|
21
|
+
import { n as Qo, r as et, e as wt, b as Lt, p as qn, c as Vt, d as Xt, g as vt, h as es, k as Yt, o as ts, s as ns, j as we, m as os, a as Un, l as ss, q as rs, t as as } from "./typeMembers-CNvE92EX.js";
|
|
22
22
|
import { loadConfigFromFile as is } from "vite";
|
|
23
23
|
const yn = {
|
|
24
24
|
out: "dist",
|
|
@@ -88,7 +88,7 @@ const yn = {
|
|
|
88
88
|
"TryPanel",
|
|
89
89
|
"TryDialog"
|
|
90
90
|
];
|
|
91
|
-
function
|
|
91
|
+
function kt(e) {
|
|
92
92
|
return dt.includes(e) ? e : e.replace(/^.*\//, "").replace(/\.css$/, "");
|
|
93
93
|
}
|
|
94
94
|
const ls = u.object({
|
|
@@ -246,13 +246,13 @@ const hs = ["nimpress.config.ts", "nimpress.config.js", "nimpress.config.mjs", "
|
|
|
246
246
|
function wn(e) {
|
|
247
247
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
248
248
|
}
|
|
249
|
-
function
|
|
249
|
+
function Ht(e, t) {
|
|
250
250
|
if (!t) return e;
|
|
251
251
|
const n = { ...e };
|
|
252
252
|
for (const [o, s] of Object.entries(t)) {
|
|
253
253
|
if (s === void 0) continue;
|
|
254
254
|
const r = n[o];
|
|
255
|
-
wn(r) && wn(s) ? n[o] =
|
|
255
|
+
wn(r) && wn(s) ? n[o] = Ht(r, s) : n[o] = s;
|
|
256
256
|
}
|
|
257
257
|
return n;
|
|
258
258
|
}
|
|
@@ -271,8 +271,8 @@ async function gs(e) {
|
|
|
271
271
|
}
|
|
272
272
|
async function _s(e, t) {
|
|
273
273
|
const n = await gs(e), o = n?.config ? { ...n.config, modules: void 0 } : void 0, s = t ? { ...t, modules: void 0 } : void 0;
|
|
274
|
-
let r =
|
|
275
|
-
r =
|
|
274
|
+
let r = Ht(Ke, o);
|
|
275
|
+
r = Ht(r, s), r.css = typeof r.css == "string" ? [r.css] : r.css ?? [], r.base = Qo(r.base);
|
|
276
276
|
const i = t?.modules ?? n?.config?.modules;
|
|
277
277
|
return r.modules = {
|
|
278
278
|
dir: Ke.modules.dir,
|
|
@@ -286,8 +286,8 @@ function ys(e) {
|
|
|
286
286
|
logo: e.logo,
|
|
287
287
|
github: e.github,
|
|
288
288
|
brand: e.brand,
|
|
289
|
-
theme:
|
|
290
|
-
themes:
|
|
289
|
+
theme: kt(e.theme),
|
|
290
|
+
themes: $t(e).map(kt),
|
|
291
291
|
base: e.base,
|
|
292
292
|
contentRoot: e.contentDir,
|
|
293
293
|
navRoutes: e.navRoutes,
|
|
@@ -305,7 +305,7 @@ function ys(e) {
|
|
|
305
305
|
guardedBase: `/${e.paths.guarded}`
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
|
-
function
|
|
308
|
+
function $t(e) {
|
|
309
309
|
return Array.from(/* @__PURE__ */ new Set([...e.themes, e.theme]));
|
|
310
310
|
}
|
|
311
311
|
function bs(e) {
|
|
@@ -2443,7 +2443,7 @@ function Ms(e, t) {
|
|
|
2443
2443
|
}, t || {});
|
|
2444
2444
|
Cs(e, o);
|
|
2445
2445
|
}
|
|
2446
|
-
const pe = "\x1B[0m",
|
|
2446
|
+
const pe = "\x1B[0m", xt = "\x1B[1m", ht = "\x1B[2m", Jn = "\x1B[38;2;204;120;92m", Ee = "\x1B[38;2;229;174;156m", Ne = "\x1B[38;2;160;160;170m", ct = [
|
|
2447
2447
|
" ███╗ ██╗ ██╗ ███╗ ███╗ ██████╗ ██████╗ ███████╗ ███████╗ ███████╗",
|
|
2448
2448
|
" ████╗ ██║ ██║ ████╗ ████║ ██╔══██╗ ██╔══██╗ ██╔════╝ ██╔════╝ ██╔════╝",
|
|
2449
2449
|
" ██╔██╗ ██║ ██║ ██╔████╔██║ ██████╔╝ ██████╔╝ █████╗ ███████╗ ███████╗",
|
|
@@ -2484,11 +2484,11 @@ function Fs(e = {}) {
|
|
|
2484
2484
|
for (const b of ct) d.push(Jn + b + pe);
|
|
2485
2485
|
d.push("");
|
|
2486
2486
|
const h = [
|
|
2487
|
-
`${
|
|
2487
|
+
`${xt}${t}${pe}${Ne} · ${o}${pe}`,
|
|
2488
2488
|
`${Ne}${n}${pe}`,
|
|
2489
2489
|
`${Ee}Version${pe} ${s} ${Ee}${c}${pe}`
|
|
2490
2490
|
];
|
|
2491
|
-
f && h.push(`${Ee}Nimpress${pe} ${f}`), h.push(`${Ee}➜${pe} Local ${
|
|
2491
|
+
f && h.push(`${Ee}Nimpress${pe} ${f}`), h.push(`${Ee}➜${pe} Local ${xt}${r}${pe}`), h.push(`${Ee}➜${pe} Network ${ht}${i}${pe}`);
|
|
2492
2492
|
const w = Ns(h), T = ct[0].length, k = ct[0].length - ct[0].trimStart().length, D = Xe + 4, _ = " ".repeat(Math.max(0, Math.floor((T + k - D) / 2)));
|
|
2493
2493
|
for (const b of w) d.push(_ + b);
|
|
2494
2494
|
return d.push(""), d.join(`
|
|
@@ -2542,11 +2542,11 @@ function gt(e, t, n) {
|
|
|
2542
2542
|
return e.split(`
|
|
2543
2543
|
`).reduce((s, r) => s + Math.max(1, Math.ceil(r.trim().length / o)), 0);
|
|
2544
2544
|
}
|
|
2545
|
-
function
|
|
2545
|
+
function Dt(e) {
|
|
2546
2546
|
return e.reduce((t, n) => Math.max(t, n.length), 0);
|
|
2547
2547
|
}
|
|
2548
2548
|
function fr(e, t) {
|
|
2549
|
-
const n =
|
|
2549
|
+
const n = Dt(t.map((f) => f.name)) * Ys, o = Dt(t.map((f) => f.type)) * Ks, s = Dt(t.map((f) => f.linkLabel)) * er, r = t.some((f) => f.pk || f.fk) ? tr : 0, i = Math.round(n + o + s + r + nr), c = Math.round(e.length * Vn + 32);
|
|
2550
2550
|
return Math.min(Vs, Math.max(Gs, i, c));
|
|
2551
2551
|
}
|
|
2552
2552
|
function dr(e) {
|
|
@@ -2790,11 +2790,11 @@ ${n}`;
|
|
|
2790
2790
|
i = et(o, c.index + c[0].length);
|
|
2791
2791
|
else {
|
|
2792
2792
|
const _ = o.match(/defineProps<\s*([A-Za-z_$][\w$]*)\s*>/);
|
|
2793
|
-
_ && (i =
|
|
2793
|
+
_ && (i = wt(r, _[1]));
|
|
2794
2794
|
}
|
|
2795
2795
|
const f = /* @__PURE__ */ new Map(), d = o.match(/(?:const|let)\s*\{([\s\S]*?)\}\s*=\s*(?:withDefaults\s*\(\s*)?defineProps/);
|
|
2796
2796
|
if (d)
|
|
2797
|
-
for (const _ of
|
|
2797
|
+
for (const _ of Lt(d[1])) {
|
|
2798
2798
|
const b = _.match(/^([A-Za-z_$][\w$]*)\s*=\s*([\s\S]+)$/);
|
|
2799
2799
|
b && f.set(b[1], qn(b[2]));
|
|
2800
2800
|
}
|
|
@@ -2802,7 +2802,7 @@ ${n}`;
|
|
|
2802
2802
|
if (i)
|
|
2803
2803
|
for (const _ of Vt(i)) {
|
|
2804
2804
|
const b = Xt(
|
|
2805
|
-
|
|
2805
|
+
vt(_.name, _.type, _.optional, r, _.description),
|
|
2806
2806
|
_
|
|
2807
2807
|
);
|
|
2808
2808
|
f.has(_.name) && (b.default = f.get(_.name)), h.push(b);
|
|
@@ -2810,7 +2810,7 @@ ${n}`;
|
|
|
2810
2810
|
for (const _ of o.matchAll(/\bdefineModel(?:<([^>]*)>)?\(\s*(?:['"]([\w-]+)['"])?/g)) {
|
|
2811
2811
|
const b = _[2] ?? "modelValue";
|
|
2812
2812
|
if (h.some(($) => $.name === b)) continue;
|
|
2813
|
-
const P =
|
|
2813
|
+
const P = vt(b, _[1]?.trim() || "string", !0, r);
|
|
2814
2814
|
P.bindable = !0;
|
|
2815
2815
|
const N = o.slice(0, _.index).match(/\/\*\*((?:[^*]|\*(?!\/))*)\*\/\s*(?:const|let)\s+[\w$]+\s*=\s*$/);
|
|
2816
2816
|
if (N) {
|
|
@@ -2846,7 +2846,7 @@ function $r(e, t, n = "") {
|
|
|
2846
2846
|
const o = e.match(/<script[^>]*>([\s\S]*?)<\/script>/)?.[1] ?? "", s = `${o}
|
|
2847
2847
|
${n}`, r = o.match(/(?:let|const)\s*\{([\s\S]*?)\}\s*(?::\s*([\s\S]*?))?=\s*\$props\(\)/), i = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set();
|
|
2848
2848
|
if (r)
|
|
2849
|
-
for (const k of
|
|
2849
|
+
for (const k of Lt(r[1])) {
|
|
2850
2850
|
const D = k.match(/^([A-Za-z_$][\w$]*)\s*=\s*([\s\S]+)$/);
|
|
2851
2851
|
if (!D) continue;
|
|
2852
2852
|
const _ = D[2].trim().match(/^\$bindable\(([\s\S]*)\)$/);
|
|
@@ -2859,7 +2859,7 @@ ${n}`, r = o.match(/(?:let|const)\s*\{([\s\S]*?)\}\s*(?::\s*([\s\S]*?))?=\s*\$pr
|
|
|
2859
2859
|
f = et(d, 1);
|
|
2860
2860
|
else {
|
|
2861
2861
|
const k = d.match(/^([A-Za-z_$][\w$]*)/);
|
|
2862
|
-
k && (f =
|
|
2862
|
+
k && (f = wt(s, k[1]));
|
|
2863
2863
|
}
|
|
2864
2864
|
const h = [], w = [], T = [];
|
|
2865
2865
|
if (f)
|
|
@@ -2873,13 +2873,13 @@ ${n}`, r = o.match(/(?:let|const)\s*\{([\s\S]*?)\}\s*(?::\s*([\s\S]*?))?=\s*\$pr
|
|
|
2873
2873
|
continue;
|
|
2874
2874
|
}
|
|
2875
2875
|
const D = Xt(
|
|
2876
|
-
|
|
2876
|
+
vt(k.name, k.type, k.optional, s, k.description),
|
|
2877
2877
|
k
|
|
2878
2878
|
);
|
|
2879
2879
|
i.has(k.name) && (D.default = i.get(k.name)), c.has(k.name) && (D.bindable = !0), h.push(D);
|
|
2880
2880
|
}
|
|
2881
2881
|
else if (r) {
|
|
2882
|
-
for (const k of
|
|
2882
|
+
for (const k of Lt(r[1])) {
|
|
2883
2883
|
const D = k.match(/^([A-Za-z_$][\w$]*)/)?.[1];
|
|
2884
2884
|
if (!D || D === "children") continue;
|
|
2885
2885
|
const _ = { name: D, kind: "json", type: "unknown" };
|
|
@@ -2907,7 +2907,7 @@ function Yn(e, t = []) {
|
|
|
2907
2907
|
}
|
|
2908
2908
|
function xr(e, t, n) {
|
|
2909
2909
|
const o = U(e, "node_modules", t);
|
|
2910
|
-
if (!he(o) || !
|
|
2910
|
+
if (!he(o) || !yt(o).isDirectory()) return null;
|
|
2911
2911
|
const s = [
|
|
2912
2912
|
`${n}.vue.d.ts`,
|
|
2913
2913
|
`${n}.svelte.d.ts`,
|
|
@@ -2921,7 +2921,7 @@ function xr(e, t, n) {
|
|
|
2921
2921
|
return null;
|
|
2922
2922
|
}
|
|
2923
2923
|
function gi(e, t) {
|
|
2924
|
-
const n =
|
|
2924
|
+
const n = wt(e, `${t}Props`) ?? wt(e, "Props");
|
|
2925
2925
|
if (!n) return;
|
|
2926
2926
|
const o = [], s = [], r = [];
|
|
2927
2927
|
for (const i of Vt(n)) {
|
|
@@ -2933,7 +2933,7 @@ function gi(e, t) {
|
|
|
2933
2933
|
r.push(i.name);
|
|
2934
2934
|
continue;
|
|
2935
2935
|
}
|
|
2936
|
-
o.push(Xt(
|
|
2936
|
+
o.push(Xt(vt(i.name, i.type, i.optional, e, i.description), i));
|
|
2937
2937
|
}
|
|
2938
2938
|
return { component: t, props: o, slots: s, emits: r };
|
|
2939
2939
|
}
|
|
@@ -3024,7 +3024,7 @@ async function yi(e) {
|
|
|
3024
3024
|
};
|
|
3025
3025
|
return Zt(c, o.vite);
|
|
3026
3026
|
}
|
|
3027
|
-
function
|
|
3027
|
+
function jt(e, t, n, o, s) {
|
|
3028
3028
|
const r = t.systems[n];
|
|
3029
3029
|
if (!r?.source) return null;
|
|
3030
3030
|
const i = V(e, r.source), c = r.framework === "vue" ? ".vue" : ".svelte", f = s ? [V(i, s)] : [U(i, o, o + c), U(i, o + c)];
|
|
@@ -3065,7 +3065,7 @@ async function ot(e, t) {
|
|
|
3065
3065
|
} catch {
|
|
3066
3066
|
continue;
|
|
3067
3067
|
}
|
|
3068
|
-
const { data: c } =
|
|
3068
|
+
const { data: c } = bt(i);
|
|
3069
3069
|
if (c?.type !== "component") continue;
|
|
3070
3070
|
const f = c.data ?? {}, d = String(f.system ?? ""), h = String(f.component ?? "");
|
|
3071
3071
|
!d || !h || s.push({
|
|
@@ -3169,10 +3169,10 @@ function Ge(e = process.cwd()) {
|
|
|
3169
3169
|
const n = Ye.length;
|
|
3170
3170
|
Ye.length = 0;
|
|
3171
3171
|
const o = n === 1 ? "schema warning" : "schema warnings", s = t.size === 1 ? "component" : "components", r = [""];
|
|
3172
|
-
r.push(` ${Ee}${
|
|
3172
|
+
r.push(` ${Ee}${xt}nimpress modules${pe} ${Ne}${n} ${o} in ${t.size} ${s}${pe}`), r.push("");
|
|
3173
3173
|
for (const [i, c] of t) {
|
|
3174
3174
|
const f = c.find((w) => w.sourceFile)?.sourceFile;
|
|
3175
|
-
r.push(` ${Jn}${
|
|
3175
|
+
r.push(` ${Jn}${xt}${i}${pe}${f ? ` ${ht}${Se(e, f)}${pe}` : ""}`);
|
|
3176
3176
|
const d = Math.max(...c.map((w) => (w.line ? `L${w.line}` : "·").length)), h = Math.max(...c.map((w) => (w.path || "(component)").length));
|
|
3177
3177
|
for (const w of c) {
|
|
3178
3178
|
const T = (w.line ? `L${w.line}` : "·").padStart(d), k = (w.path || "(component)").padEnd(h);
|
|
@@ -3255,7 +3255,7 @@ async function bi(e, t) {
|
|
|
3255
3255
|
const o = await le(n.path, "utf-8"), s = rt(o, n.form), { merged: r } = en(t, s);
|
|
3256
3256
|
await fe(n.path, tt(r, n.form));
|
|
3257
3257
|
}
|
|
3258
|
-
function
|
|
3258
|
+
function zt(e) {
|
|
3259
3259
|
const t = Gt(e);
|
|
3260
3260
|
return t === ".vue" ? "vue" : t === ".svelte" ? "svelte" : null;
|
|
3261
3261
|
}
|
|
@@ -3273,7 +3273,7 @@ function Mr(e, t, n) {
|
|
|
3273
3273
|
async function Tr(e, t, n) {
|
|
3274
3274
|
const o = await ot(e, t.contentDir), s = V(e, n);
|
|
3275
3275
|
if ((n.includes("/") || n.includes("\\")) && he(s)) {
|
|
3276
|
-
const d =
|
|
3276
|
+
const d = zt(s);
|
|
3277
3277
|
if (!d)
|
|
3278
3278
|
throw new Error(`[nimpress] modules: ${n} is not a .vue or .svelte component file`);
|
|
3279
3279
|
const h = Pe(s, Gt(s)), w = Dr(e, t, s);
|
|
@@ -3293,12 +3293,12 @@ async function Tr(e, t, n) {
|
|
|
3293
3293
|
const d = r.map((h) => `${h.system}/${h.component}`).join(", ");
|
|
3294
3294
|
throw new Error(`[nimpress] modules: ${n} is ambiguous across ${d}, pass the component file path`);
|
|
3295
3295
|
}
|
|
3296
|
-
const i = r[0], c =
|
|
3296
|
+
const i = r[0], c = jt(e, t.modules, i.system, i.component, i.file);
|
|
3297
3297
|
if (!c)
|
|
3298
3298
|
throw new Error(
|
|
3299
3299
|
`[nimpress] modules: no source file found for ${i.system}/${i.component}, the schema upsert needs the component source`
|
|
3300
3300
|
);
|
|
3301
|
-
const f =
|
|
3301
|
+
const f = zt(c.componentFile) ?? c.systemConfig.framework;
|
|
3302
3302
|
return {
|
|
3303
3303
|
system: i.system,
|
|
3304
3304
|
component: i.component,
|
|
@@ -3322,25 +3322,25 @@ async function wi(e, t, n = {}) {
|
|
|
3322
3322
|
let s = 0;
|
|
3323
3323
|
for (const r of o) {
|
|
3324
3324
|
if (n.system && r.system !== n.system) continue;
|
|
3325
|
-
const i =
|
|
3325
|
+
const i = jt(e, t.modules, r.system, r.component, r.file);
|
|
3326
3326
|
if (!i) {
|
|
3327
3327
|
console.warn(`nimpress modules: no source for ${r.system}/${r.component}, skipped`);
|
|
3328
3328
|
continue;
|
|
3329
3329
|
}
|
|
3330
|
-
const c =
|
|
3330
|
+
const c = zt(i.componentFile) ?? i.systemConfig.framework, f = await Qt(i.componentFile, c, r.component);
|
|
3331
3331
|
f && (await tn(K(r.pageFile), r.component, f), s++);
|
|
3332
3332
|
}
|
|
3333
3333
|
return s;
|
|
3334
3334
|
}
|
|
3335
|
-
const Ir = 6161,
|
|
3336
|
-
function
|
|
3335
|
+
const Ir = 6161, qt = "virtual:nimpress-harness/";
|
|
3336
|
+
function St(e, t) {
|
|
3337
3337
|
const n = e.systems[t]?.port;
|
|
3338
3338
|
if (n) return n;
|
|
3339
3339
|
const o = Object.keys(e.systems).sort();
|
|
3340
3340
|
return Ir + Math.max(0, o.indexOf(t));
|
|
3341
3341
|
}
|
|
3342
|
-
function
|
|
3343
|
-
return `${
|
|
3342
|
+
function Ut(e, t) {
|
|
3343
|
+
return `${qt}${e}/${t}/entry`;
|
|
3344
3344
|
}
|
|
3345
3345
|
function to() {
|
|
3346
3346
|
return `const params = new URLSearchParams(location.search)
|
|
@@ -3771,7 +3771,7 @@ function ro(e, t, n, o) {
|
|
|
3771
3771
|
const r = [];
|
|
3772
3772
|
for (const i of o) {
|
|
3773
3773
|
if (i.system !== n) continue;
|
|
3774
|
-
const c = ao(i.pageFile), f = st(K(i.pageFile))?.path ?? U(K(i.pageFile), "schema.json"), d = s.source ?
|
|
3774
|
+
const c = ao(i.pageFile), f = st(K(i.pageFile))?.path ?? U(K(i.pageFile), "schema.json"), d = s.source ? jt(e, t, n, i.component, i.file) : null;
|
|
3775
3775
|
if (d) {
|
|
3776
3776
|
r.push({ component: i.component, importSpec: d.componentFile, storyFiles: c, schemaFile: f });
|
|
3777
3777
|
continue;
|
|
@@ -3811,7 +3811,7 @@ function qr(e, t, n, o, s) {
|
|
|
3811
3811
|
(k) => k.startsWith(".") || xe(k) ? V(e, k) : k
|
|
3812
3812
|
), c = Hr(e, r), f = zr(e, r);
|
|
3813
3813
|
let d = new Map(o.map((k) => [k.component, k]));
|
|
3814
|
-
const h = "\0" +
|
|
3814
|
+
const h = "\0" + qt, w = (k) => {
|
|
3815
3815
|
if (!k.startsWith(h)) return null;
|
|
3816
3816
|
const D = k.slice(h.length).split("/");
|
|
3817
3817
|
return D[0] === n && D[1] ? D[1] : null;
|
|
@@ -3819,7 +3819,7 @@ function qr(e, t, n, o, s) {
|
|
|
3819
3819
|
return {
|
|
3820
3820
|
name: "nimpress:harness",
|
|
3821
3821
|
resolveId(k) {
|
|
3822
|
-
return k.startsWith(h) ? k : k.startsWith(
|
|
3822
|
+
return k.startsWith(h) ? k : k.startsWith(qt) ? "\0" + k : null;
|
|
3823
3823
|
},
|
|
3824
3824
|
load(k) {
|
|
3825
3825
|
const D = w(k);
|
|
@@ -3833,7 +3833,7 @@ function qr(e, t, n, o, s) {
|
|
|
3833
3833
|
const P = await ot(e, t.contentDir), N = [...d.keys()];
|
|
3834
3834
|
d = new Map(ro(e, t.modules, n, P).map(($) => [$.component, $]));
|
|
3835
3835
|
for (const $ of /* @__PURE__ */ new Set([...N, ...d.keys()])) {
|
|
3836
|
-
const A = k.moduleGraph.getModuleById("\0" +
|
|
3836
|
+
const A = k.moduleGraph.getModuleById("\0" + Ut(n, $));
|
|
3837
3837
|
A && k.moduleGraph.invalidateModule(A);
|
|
3838
3838
|
}
|
|
3839
3839
|
k.ws.send({ type: "full-reload" });
|
|
@@ -3853,7 +3853,7 @@ function qr(e, t, n, o, s) {
|
|
|
3853
3853
|
return;
|
|
3854
3854
|
}
|
|
3855
3855
|
if (Z === "entry.js") {
|
|
3856
|
-
const te = await k.transformRequest(
|
|
3856
|
+
const te = await k.transformRequest(Ut(n, H));
|
|
3857
3857
|
if (!te) return N();
|
|
3858
3858
|
P.statusCode = 200, P.setHeader("Content-Type", "application/javascript"), P.end(te.code);
|
|
3859
3859
|
return;
|
|
@@ -3906,12 +3906,12 @@ async function vi(e, t, n, o) {
|
|
|
3906
3906
|
},
|
|
3907
3907
|
server: {
|
|
3908
3908
|
host: "127.0.0.1",
|
|
3909
|
-
port:
|
|
3909
|
+
port: St(s, n),
|
|
3910
3910
|
strictPort: !0,
|
|
3911
3911
|
fs: { allow: [e, d] },
|
|
3912
3912
|
hmr: {
|
|
3913
3913
|
host: "127.0.0.1",
|
|
3914
|
-
clientPort:
|
|
3914
|
+
clientPort: St(s, n)
|
|
3915
3915
|
}
|
|
3916
3916
|
},
|
|
3917
3917
|
build: {
|
|
@@ -3919,7 +3919,7 @@ async function vi(e, t, n, o) {
|
|
|
3919
3919
|
emptyOutDir: !0,
|
|
3920
3920
|
target: "es2022",
|
|
3921
3921
|
rollupOptions: {
|
|
3922
|
-
input: Object.fromEntries(c.map((N) => [N.component,
|
|
3922
|
+
input: Object.fromEntries(c.map((N) => [N.component, Ut(n, N.component)]))
|
|
3923
3923
|
}
|
|
3924
3924
|
},
|
|
3925
3925
|
base: T
|
|
@@ -3931,7 +3931,7 @@ async function vi(e, t, n, o) {
|
|
|
3931
3931
|
resolve: { ..._.resolve, alias: [{ find: /^vue$/, replacement: "vue/dist/vue.esm-bundler.js" }, ...P] }
|
|
3932
3932
|
};
|
|
3933
3933
|
}
|
|
3934
|
-
function
|
|
3934
|
+
function Mt(e, t) {
|
|
3935
3935
|
const n = e.search(new RegExp(`\\b${t}\\s*:`));
|
|
3936
3936
|
if (n < 0) return;
|
|
3937
3937
|
const o = e.indexOf("{", n);
|
|
@@ -3943,7 +3943,7 @@ function Dt(e, t) {
|
|
|
3943
3943
|
return;
|
|
3944
3944
|
}
|
|
3945
3945
|
}
|
|
3946
|
-
function
|
|
3946
|
+
function Tt(e, t) {
|
|
3947
3947
|
const n = e.search(new RegExp(`\\b${t}\\s*:`));
|
|
3948
3948
|
if (n < 0) return e;
|
|
3949
3949
|
const o = e.indexOf("{", n);
|
|
@@ -3952,7 +3952,7 @@ function Mt(e, t) {
|
|
|
3952
3952
|
return e.slice(0, n) + e.slice(o + 1 + s.length + 1);
|
|
3953
3953
|
}
|
|
3954
3954
|
function io(e, t) {
|
|
3955
|
-
const n = e.match(/^\s*\/\/\s*story:\s*(.+)$/m)?.[1]?.trim(), o =
|
|
3955
|
+
const n = e.match(/^\s*\/\/\s*story:\s*(.+)$/m)?.[1]?.trim(), o = Tt(Tt(e, "props"), "slots"), s = Mt(o, "sidebar"), r = Tt(o, "sidebar"), i = r.match(/\bname\s*:\s*['"]([^'"]+)['"]/)?.[1], c = r.match(/\bdescription\s*:\s*['"]([^'"]+)['"]/)?.[1], f = Mt(e, "props"), d = Mt(e, "slots");
|
|
3956
3956
|
return {
|
|
3957
3957
|
name: n ?? i ?? Pe(t).replace(/\.story\.tsx?$/, "").replace(/_/g, " "),
|
|
3958
3958
|
file: t,
|
|
@@ -4006,7 +4006,7 @@ function $i(e, t) {
|
|
|
4006
4006
|
return e.find((o) => o.story.toLowerCase() === n) ?? e.find((o) => o.name.toLowerCase() === n);
|
|
4007
4007
|
}
|
|
4008
4008
|
function xi(e, t) {
|
|
4009
|
-
return `http://127.0.0.1:${
|
|
4009
|
+
return `http://127.0.0.1:${St(e.modules, t.system)}${Un(e.base, t.route)}`;
|
|
4010
4010
|
}
|
|
4011
4011
|
function Jr(e) {
|
|
4012
4012
|
let t = e;
|
|
@@ -4047,7 +4047,7 @@ async function Gr(e, t, n) {
|
|
|
4047
4047
|
}
|
|
4048
4048
|
function Vr(e) {
|
|
4049
4049
|
try {
|
|
4050
|
-
return
|
|
4050
|
+
return yt(e).isFile();
|
|
4051
4051
|
} catch {
|
|
4052
4052
|
return !1;
|
|
4053
4053
|
}
|
|
@@ -4070,7 +4070,7 @@ async function Xr(e, t, n, o) {
|
|
|
4070
4070
|
return i;
|
|
4071
4071
|
}
|
|
4072
4072
|
async function Yr(e) {
|
|
4073
|
-
const { cwd: t, modules: n, pageFile: o, data: s, editable: r } = e, i = String(s.system ?? ""), c = String(s.component ?? ""), f = typeof s.file == "string" ? s.file : void 0, d = await Ur(K(o)), h =
|
|
4073
|
+
const { cwd: t, modules: n, pageFile: o, data: s, editable: r } = e, i = String(s.system ?? ""), c = String(s.component ?? ""), f = typeof s.file == "string" ? s.file : void 0, d = await Ur(K(o)), h = jt(t, n, i, c, f), w = [];
|
|
4074
4074
|
if (r && h) {
|
|
4075
4075
|
const $ = h.componentFile.endsWith(".svelte") ? "svelte" : "vue";
|
|
4076
4076
|
try {
|
|
@@ -4127,7 +4127,7 @@ async function Yr(e) {
|
|
|
4127
4127
|
}
|
|
4128
4128
|
function Kr(e, t = "virtual:nimpress/main") {
|
|
4129
4129
|
const n = e.logo ? `
|
|
4130
|
-
<link rel="icon" href="${e.logo}" />` : "", o = JSON.stringify(
|
|
4130
|
+
<link rel="icon" href="${e.logo}" />` : "", o = JSON.stringify($t(e).map(kt)), s = JSON.stringify(kt(e.theme));
|
|
4131
4131
|
return `<!doctype html>
|
|
4132
4132
|
<html lang="en">
|
|
4133
4133
|
<head>
|
|
@@ -4155,7 +4155,7 @@ function Kr(e, t = "virtual:nimpress/main") {
|
|
|
4155
4155
|
</html>
|
|
4156
4156
|
`;
|
|
4157
4157
|
}
|
|
4158
|
-
const lt = "virtual:nimpress/manifest", pt = "virtual:nimpress/search", ut = "virtual:nimpress/pages", mt = "virtual:nimpress/bodies",
|
|
4158
|
+
const lt = "virtual:nimpress/manifest", pt = "virtual:nimpress/search", ut = "virtual:nimpress/pages", mt = "virtual:nimpress/bodies", Nt = "virtual:nimpress/config", It = "virtual:nimpress/main", Ve = "virtual:nimpress/page-component/", Le = "virtual:nimpress/page-body/", Ft = 20, Zr = "https://github.com/nimling/nimpress";
|
|
4159
4159
|
function ye(e) {
|
|
4160
4160
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
4161
4161
|
}
|
|
@@ -4165,7 +4165,7 @@ function Qr(e) {
|
|
|
4165
4165
|
function On(e) {
|
|
4166
4166
|
return e === 0 ? "rss.xml" : `rss-${e + 1}.xml`;
|
|
4167
4167
|
}
|
|
4168
|
-
const
|
|
4168
|
+
const Rt = [
|
|
4169
4169
|
"Google-Extended",
|
|
4170
4170
|
"Applebot-Extended",
|
|
4171
4171
|
"OAI-SearchBot",
|
|
@@ -4429,7 +4429,7 @@ async function nn(e, t = []) {
|
|
|
4429
4429
|
function Fe(e) {
|
|
4430
4430
|
return e.toLowerCase().replace(/[^a-z0-9\s-]/g, "").trim().replace(/\s+/g, "-");
|
|
4431
4431
|
}
|
|
4432
|
-
function
|
|
4432
|
+
function Bt(e) {
|
|
4433
4433
|
return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
|
|
4434
4434
|
}
|
|
4435
4435
|
const Mn = {
|
|
@@ -4722,7 +4722,7 @@ function Oa(e, t) {
|
|
|
4722
4722
|
return n ? n[1] : null;
|
|
4723
4723
|
}
|
|
4724
4724
|
const Da = new Set("a an the and or but if then else of to in on at by for with from as is are was were be been being it its this that these those there here which who whom what when where why how not no yes you your we our they their he she his her them us me my i so do does did done can could should would will shall may might must into over under again more most some any each every all both few own same than too very just also only such other another one two three first last new use used using page pages file files field fields set sets value values see".split(" "));
|
|
4725
|
-
function
|
|
4725
|
+
function Wt(e) {
|
|
4726
4726
|
return e.toLowerCase().replace(/```[\s\S]*?```/g, " ").replace(/`[^`]*`/g, " ").replace(/[^\p{L}\p{N}\s-]/gu, " ").split(/\s+/).map((t) => t.replace(/^-+|-+$/g, "")).filter((t) => t.length > 2 && !Da.has(t) && !/^\d+$/.test(t));
|
|
4727
4727
|
}
|
|
4728
4728
|
function Ma(e) {
|
|
@@ -4738,7 +4738,7 @@ function Ta(e) {
|
|
|
4738
4738
|
const i = /* @__PURE__ */ new Map(), c = (f, d) => {
|
|
4739
4739
|
for (const h of f) i.set(h, (i.get(h) ?? 0) + d);
|
|
4740
4740
|
};
|
|
4741
|
-
c(
|
|
4741
|
+
c(Wt(r.title), 6), c(Wt(r.headings.join(" ")), 3), c(r.tags.map((f) => f.toLowerCase()), 8), c(Wt(r.body), 1);
|
|
4742
4742
|
for (const f of i.keys()) t.set(f, (t.get(f) ?? 0) + 1);
|
|
4743
4743
|
return { source: r, counts: i };
|
|
4744
4744
|
}), o = Math.max(e.length, 1), s = /* @__PURE__ */ new Map();
|
|
@@ -5131,13 +5131,13 @@ function Rn(e) {
|
|
|
5131
5131
|
function Te(e) {
|
|
5132
5132
|
return e ? e.replace(/[-_]/g, " ").replace(/\b\w/g, (t) => t.toUpperCase()) : "";
|
|
5133
5133
|
}
|
|
5134
|
-
function
|
|
5134
|
+
function _t(e) {
|
|
5135
5135
|
e.sort((t, n) => {
|
|
5136
5136
|
const o = t.order ?? Number.MAX_SAFE_INTEGER, s = n.order ?? Number.MAX_SAFE_INTEGER;
|
|
5137
5137
|
return o !== s ? o - s : t.text.localeCompare(n.text);
|
|
5138
5138
|
});
|
|
5139
5139
|
for (const t of e)
|
|
5140
|
-
t.items &&
|
|
5140
|
+
t.items && _t(t.items);
|
|
5141
5141
|
}
|
|
5142
5142
|
function Ga(e) {
|
|
5143
5143
|
let t = Ke, n = V(process.cwd(), Ke.contentDir), o = V(process.cwd(), Ke.assetsDir), s = /* @__PURE__ */ new Map(), r = null, i = V(process.cwd(), "dist"), c = !1, f = null;
|
|
@@ -5193,19 +5193,19 @@ function Ga(e) {
|
|
|
5193
5193
|
return N(S, g);
|
|
5194
5194
|
}, x = async (g) => {
|
|
5195
5195
|
if (y.has(g)) return y.get(g);
|
|
5196
|
-
const
|
|
5197
|
-
y.set(g,
|
|
5196
|
+
const C = (g.split("/").pop() ?? "").replace(/\.json$/, "");
|
|
5197
|
+
y.set(g, C);
|
|
5198
5198
|
const E = await v(g);
|
|
5199
|
-
return await p(E, K(g)), m[
|
|
5199
|
+
return await p(E, K(g)), m[C] = E, C;
|
|
5200
5200
|
}, p = async (g, S) => {
|
|
5201
5201
|
if (!g || typeof g != "object") return;
|
|
5202
5202
|
if (Array.isArray(g)) {
|
|
5203
5203
|
for (const E of g) await p(E, S);
|
|
5204
5204
|
return;
|
|
5205
5205
|
}
|
|
5206
|
-
const
|
|
5207
|
-
if (typeof
|
|
5208
|
-
const E = xe(
|
|
5206
|
+
const C = g.$ref;
|
|
5207
|
+
if (typeof C == "string" && !C.startsWith("#")) {
|
|
5208
|
+
const E = xe(C) ? C : V(S, C), I = K(E).split("/").pop() ?? "";
|
|
5209
5209
|
if (I === "schemas") {
|
|
5210
5210
|
const j = await x(E);
|
|
5211
5211
|
g.$ref = `#/components/schemas/${j}`;
|
|
@@ -5214,7 +5214,7 @@ function Ga(e) {
|
|
|
5214
5214
|
if (I === "operations") {
|
|
5215
5215
|
const j = await v(E);
|
|
5216
5216
|
await p(j, K(E)), delete g.$ref;
|
|
5217
|
-
for (const
|
|
5217
|
+
for (const O of Object.keys(j)) g[O] = j[O];
|
|
5218
5218
|
return;
|
|
5219
5219
|
}
|
|
5220
5220
|
return;
|
|
@@ -5225,10 +5225,10 @@ function Ga(e) {
|
|
|
5225
5225
|
for (const g of Object.keys(m)) {
|
|
5226
5226
|
const S = m[g];
|
|
5227
5227
|
if (S && typeof S == "object" && typeof S.$ref == "string" && !S.$ref.startsWith("#")) {
|
|
5228
|
-
const
|
|
5229
|
-
y.set(
|
|
5230
|
-
const E = await v(
|
|
5231
|
-
await p(E, K(
|
|
5228
|
+
const C = xe(S.$ref) ? S.$ref : V(l, S.$ref);
|
|
5229
|
+
y.set(C, g);
|
|
5230
|
+
const E = await v(C);
|
|
5231
|
+
await p(E, K(C)), m[g] = E;
|
|
5232
5232
|
}
|
|
5233
5233
|
}
|
|
5234
5234
|
for (const g of Object.keys(a))
|
|
@@ -5260,8 +5260,8 @@ function Ga(e) {
|
|
|
5260
5260
|
function te(a, l) {
|
|
5261
5261
|
if (!a) return null;
|
|
5262
5262
|
const m = a, y = m.info ?? {}, v = m.components?.securitySchemes ?? {}, x = ["get", "post", "put", "patch", "delete", "head", "options"], p = (j) => H(j, m)?.example, g = /* @__PURE__ */ new Map(), S = m.paths ?? {};
|
|
5263
|
-
for (const [j,
|
|
5264
|
-
const R = H(
|
|
5263
|
+
for (const [j, O] of Object.entries(S)) {
|
|
5264
|
+
const R = H(O, m);
|
|
5265
5265
|
if (!R || typeof R != "object") continue;
|
|
5266
5266
|
const B = (R.parameters ?? []).map((M) => H(M, m));
|
|
5267
5267
|
for (const M of x) {
|
|
@@ -5310,10 +5310,10 @@ function Ga(e) {
|
|
|
5310
5310
|
g.has(se) || g.set(se, []), g.get(se).push(re);
|
|
5311
5311
|
}
|
|
5312
5312
|
}
|
|
5313
|
-
const
|
|
5314
|
-
for (const [j,
|
|
5315
|
-
const R = Z(l,
|
|
5316
|
-
I[j] = R ? { ...
|
|
5313
|
+
const C = [...g.entries()].map(([j, O]) => ({ name: j, operations: O })).sort((j, O) => j.name.localeCompare(O.name)), E = m.components?.schemas ?? {}, I = {};
|
|
5314
|
+
for (const [j, O] of Object.entries(E)) {
|
|
5315
|
+
const R = Z(l, O?.description);
|
|
5316
|
+
I[j] = R ? { ...O, description_html: R } : O;
|
|
5317
5317
|
}
|
|
5318
5318
|
return {
|
|
5319
5319
|
title: y.title ?? "API",
|
|
@@ -5322,12 +5322,12 @@ function Ga(e) {
|
|
|
5322
5322
|
description_html: Z(l, y.description),
|
|
5323
5323
|
servers: m.servers,
|
|
5324
5324
|
securitySchemes: v,
|
|
5325
|
-
tags:
|
|
5325
|
+
tags: C,
|
|
5326
5326
|
schemas: I
|
|
5327
5327
|
};
|
|
5328
5328
|
}
|
|
5329
5329
|
async function de(a) {
|
|
5330
|
-
const l = await le(a, "utf-8"), { data: m, content: y } =
|
|
5330
|
+
const l = await le(a, "utf-8"), { data: m, content: y } = bt(l);
|
|
5331
5331
|
typeof m.type == "number" && (m.type = String(m.type));
|
|
5332
5332
|
const v = po(m, y);
|
|
5333
5333
|
if (v.length) {
|
|
@@ -5337,10 +5337,10 @@ function Ga(e) {
|
|
|
5337
5337
|
if (c) throw new Error(`[nimpress] invalid frontmatter in ${Q}`);
|
|
5338
5338
|
console.warn(`[nimpress] invalid frontmatter in ${Q}`);
|
|
5339
5339
|
}
|
|
5340
|
-
const x = co.safeParse(m), p = x.success ? x.data : { title: a }, g = uo(n, a), S = p.type ?? "doc",
|
|
5340
|
+
const x = co.safeParse(m), p = x.success ? x.data : { title: a }, g = uo(n, a), S = p.type ?? "doc", C = ma(n, a, p.path), E = typeof p.link == "string" && p.link.trim() !== "" ? p.link.trim() : void 0, I = !!E || m.type === void 0 && y.trim() === "", j = t.defaultFrontmatter ?? {};
|
|
5341
5341
|
if (!(t.defaultFrontmatterExclude ?? []).some((Q) => {
|
|
5342
5342
|
const me = Q.startsWith("/") ? Q : "/" + Q;
|
|
5343
|
-
return
|
|
5343
|
+
return C === me || C.startsWith(me + "/");
|
|
5344
5344
|
}))
|
|
5345
5345
|
for (const [Q, me] of Object.entries(j)) {
|
|
5346
5346
|
const Me = Q;
|
|
@@ -5406,7 +5406,7 @@ function Ga(e) {
|
|
|
5406
5406
|
`)), {
|
|
5407
5407
|
slug: g,
|
|
5408
5408
|
filePath: a,
|
|
5409
|
-
effectivePath:
|
|
5409
|
+
effectivePath: C,
|
|
5410
5410
|
type: S,
|
|
5411
5411
|
sidebarOnly: I,
|
|
5412
5412
|
linkTo: E,
|
|
@@ -5469,79 +5469,79 @@ function Ga(e) {
|
|
|
5469
5469
|
async function ze() {
|
|
5470
5470
|
const a = await nn(n), l = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map();
|
|
5471
5471
|
let p, g;
|
|
5472
|
-
const S = [],
|
|
5472
|
+
const S = [], C = [];
|
|
5473
5473
|
let E = [];
|
|
5474
5474
|
for (const j of a) {
|
|
5475
5475
|
if (!j.endsWith(".md")) continue;
|
|
5476
|
-
let
|
|
5476
|
+
let O = "";
|
|
5477
5477
|
try {
|
|
5478
|
-
|
|
5478
|
+
O = await le(j, "utf-8");
|
|
5479
5479
|
} catch {
|
|
5480
5480
|
continue;
|
|
5481
5481
|
}
|
|
5482
|
-
const { data: R, content: B } =
|
|
5483
|
-
String(R.type) === "glossary" && (
|
|
5482
|
+
const { data: R, content: B } = bt(O);
|
|
5483
|
+
String(R.type) === "glossary" && (C.push(j), E = Ca(new Ln().use(Hn), B));
|
|
5484
5484
|
}
|
|
5485
|
-
if (
|
|
5485
|
+
if (C.length > 1) throw new Error(`[nimpress] one type glossary page per site: ${C.join(" and ")}`);
|
|
5486
5486
|
h = E, w = JSON.stringify(E);
|
|
5487
5487
|
const I = new Set(a);
|
|
5488
5488
|
for (const j of [...d.keys()])
|
|
5489
5489
|
I.has(j) || d.delete(j);
|
|
5490
5490
|
for (const j of a) {
|
|
5491
|
-
let
|
|
5491
|
+
let O = null;
|
|
5492
5492
|
try {
|
|
5493
|
-
|
|
5493
|
+
O = await ae(j);
|
|
5494
5494
|
} catch (B) {
|
|
5495
5495
|
console.warn(`[nimpress] failed to process ${j}:`, B);
|
|
5496
5496
|
continue;
|
|
5497
5497
|
}
|
|
5498
|
-
if (!
|
|
5499
|
-
if (S.push(
|
|
5500
|
-
const M = `${pa(
|
|
5501
|
-
L.push(
|
|
5498
|
+
if (!O || Re(O.slug)) continue;
|
|
5499
|
+
if (S.push(O), O.type === "changelog") {
|
|
5500
|
+
const M = `${pa(O.slug)}\0${O.frontmatter.title}`, L = y.get(M) ?? [];
|
|
5501
|
+
L.push(O), y.set(M, L);
|
|
5502
5502
|
continue;
|
|
5503
5503
|
}
|
|
5504
|
-
if (
|
|
5505
|
-
const B = String(
|
|
5506
|
-
v.set(B, [
|
|
5504
|
+
if (O.type === "roadmap") {
|
|
5505
|
+
const B = String(O.filePath);
|
|
5506
|
+
v.set(B, [O]);
|
|
5507
5507
|
}
|
|
5508
|
-
if (
|
|
5509
|
-
throw new Error(`[nimpress] type section belongs on a folder index.md: ${
|
|
5510
|
-
if (
|
|
5511
|
-
throw new Error(`[nimpress] type glossary needs a definition list body: ${
|
|
5512
|
-
if (
|
|
5513
|
-
if (g && g !==
|
|
5514
|
-
throw new Error(`[nimpress] one type tags page per site: ${g} and ${
|
|
5515
|
-
g =
|
|
5508
|
+
if (O.type === "section" && !O.filePath.endsWith(`${$e}index.md`))
|
|
5509
|
+
throw new Error(`[nimpress] type section belongs on a folder index.md: ${O.filePath}`);
|
|
5510
|
+
if (O.type === "glossary" && !O.html.includes("<dl"))
|
|
5511
|
+
throw new Error(`[nimpress] type glossary needs a definition list body: ${O.filePath}`);
|
|
5512
|
+
if (O.type === "tags") {
|
|
5513
|
+
if (g && g !== O.filePath)
|
|
5514
|
+
throw new Error(`[nimpress] one type tags page per site: ${g} and ${O.filePath}`);
|
|
5515
|
+
g = O.filePath;
|
|
5516
5516
|
}
|
|
5517
|
-
if (
|
|
5518
|
-
if (p && p !==
|
|
5519
|
-
throw new Error(`[nimpress] one type 404 page per site: ${p} and ${
|
|
5520
|
-
p =
|
|
5517
|
+
if (O.type === "404") {
|
|
5518
|
+
if (p && p !== O.filePath)
|
|
5519
|
+
throw new Error(`[nimpress] one type 404 page per site: ${p} and ${O.filePath}`);
|
|
5520
|
+
p = O.filePath;
|
|
5521
5521
|
}
|
|
5522
|
-
if (
|
|
5523
|
-
const B = K(
|
|
5522
|
+
if (O.type === "component") {
|
|
5523
|
+
const B = K(O.filePath), M = x.get(B);
|
|
5524
5524
|
if (M)
|
|
5525
5525
|
throw new Error(
|
|
5526
|
-
`[nimpress] one type component page per folder: ${B} holds ${M} and ${
|
|
5526
|
+
`[nimpress] one type component page per folder: ${B} holds ${M} and ${O.filePath}`
|
|
5527
5527
|
);
|
|
5528
|
-
x.set(B,
|
|
5528
|
+
x.set(B, O.filePath);
|
|
5529
5529
|
}
|
|
5530
|
-
const R = m.get(
|
|
5530
|
+
const R = m.get(O.effectivePath);
|
|
5531
5531
|
if (R)
|
|
5532
5532
|
throw new Error(
|
|
5533
|
-
`[nimpress] duplicate path ${
|
|
5533
|
+
`[nimpress] duplicate path ${O.effectivePath}: ${R} and ${O.filePath}`
|
|
5534
5534
|
);
|
|
5535
|
-
m.set(
|
|
5535
|
+
m.set(O.effectivePath, O.filePath), l.set(O.slug, O);
|
|
5536
5536
|
}
|
|
5537
|
-
|
|
5538
|
-
for (const [j,
|
|
5537
|
+
Pt.clear();
|
|
5538
|
+
for (const [j, O] of y) {
|
|
5539
5539
|
const R = j.split("\0", 1)[0], B = mo(R ? "/" + R : "/");
|
|
5540
5540
|
if (m.has(B))
|
|
5541
5541
|
throw new Error(
|
|
5542
5542
|
`[nimpress] path ${B} is occupied by both a changelog collection and a regular page`
|
|
5543
5543
|
);
|
|
5544
|
-
const M =
|
|
5544
|
+
const M = O.filter((F) => !(c && ke(F.frontmatter)));
|
|
5545
5545
|
if (M.length === 0) continue;
|
|
5546
5546
|
M.sort((F, q) => {
|
|
5547
5547
|
const Y = String(F.frontmatter.data?.version ?? ""), J = String(q.frontmatter.data?.version ?? "");
|
|
@@ -5559,7 +5559,7 @@ function Ga(e) {
|
|
|
5559
5559
|
ne = ce.toISOString();
|
|
5560
5560
|
}
|
|
5561
5561
|
const re = Y ? `v${Y}` : "unreleased";
|
|
5562
|
-
return
|
|
5562
|
+
return Pt.set(`${z}#${re}`, F.rawText), {
|
|
5563
5563
|
version: Y,
|
|
5564
5564
|
slug: re,
|
|
5565
5565
|
title: J,
|
|
@@ -5596,24 +5596,24 @@ function Ga(e) {
|
|
|
5596
5596
|
m.set(B, ee.filePath), l.set(ee.slug, ee);
|
|
5597
5597
|
}
|
|
5598
5598
|
if (Ao(v, S), _o(l), go(l), t.seo?.auto) {
|
|
5599
|
-
const j = Ta(S.map((
|
|
5600
|
-
slug:
|
|
5601
|
-
title:
|
|
5602
|
-
headings:
|
|
5603
|
-
tags: Be(
|
|
5604
|
-
body:
|
|
5599
|
+
const j = Ta(S.map((O) => ({
|
|
5600
|
+
slug: O.slug,
|
|
5601
|
+
title: O.frontmatter.title,
|
|
5602
|
+
headings: O.headings.map((R) => R.text),
|
|
5603
|
+
tags: Be(O.frontmatter.tags),
|
|
5604
|
+
body: O.rawText
|
|
5605
5605
|
})));
|
|
5606
|
-
for (const
|
|
5607
|
-
const R = j.get(
|
|
5606
|
+
for (const O of S) {
|
|
5607
|
+
const R = j.get(O.slug);
|
|
5608
5608
|
if (!R) continue;
|
|
5609
|
-
const B =
|
|
5610
|
-
|
|
5609
|
+
const B = O.frontmatter.meta ?? {}, M = B.override === !0, L = M && B.keywords ? B.keywords : R.keywords.length ? R.keywords : B.keywords, z = M && B.description ? B.description : R.description || B.description;
|
|
5610
|
+
O.frontmatter.meta = { ...B, ...L ? { keywords: L } : {}, ...z ? { description: z } : {} };
|
|
5611
5611
|
}
|
|
5612
5612
|
}
|
|
5613
5613
|
s = l;
|
|
5614
5614
|
}
|
|
5615
|
-
const qe = /* @__PURE__ */ new Map(),
|
|
5616
|
-
let
|
|
5615
|
+
const qe = /* @__PURE__ */ new Map(), Pt = /* @__PURE__ */ new Map();
|
|
5616
|
+
let At = JSON.stringify({ pages: [] }, null, 2) + `
|
|
5617
5617
|
`;
|
|
5618
5618
|
function go(a) {
|
|
5619
5619
|
const l = [];
|
|
@@ -5633,10 +5633,10 @@ function Ga(e) {
|
|
|
5633
5633
|
date: g.releaseDate,
|
|
5634
5634
|
title: g.title,
|
|
5635
5635
|
description: g.description,
|
|
5636
|
-
body:
|
|
5636
|
+
body: Pt.get(`${m.slug}#${g.slug}`) ?? ""
|
|
5637
5637
|
}))), l.push(p);
|
|
5638
5638
|
}
|
|
5639
|
-
l.sort((m, y) => m.path.localeCompare(y.path)),
|
|
5639
|
+
l.sort((m, y) => m.path.localeCompare(y.path)), At = JSON.stringify({ pages: l }, null, 2) + `
|
|
5640
5640
|
`;
|
|
5641
5641
|
}
|
|
5642
5642
|
function _o(a) {
|
|
@@ -5650,13 +5650,13 @@ function Ga(e) {
|
|
|
5650
5650
|
}
|
|
5651
5651
|
const y = (m.changelogEntries ?? []).filter((z) => !z.hidden);
|
|
5652
5652
|
if (y.length === 0) continue;
|
|
5653
|
-
const v = m.effectivePath === "/" ? "" : m.effectivePath, x = `${l}${we(t.base, v || "/")}`, p = ve(m) ? `/${t.paths.guarded}/${at(m)}` : "", g = (z) => `${p}${v}/${On(z)}`, S = y.map((z) => z.releaseDate ? new Date(z.releaseDate).getTime() : Number.NaN).filter((z) => !Number.isNaN(z)).sort((z, se) => se - z),
|
|
5654
|
-
for (let z = 0; z + 1 < S.length; z++)
|
|
5655
|
-
const E =
|
|
5653
|
+
const v = m.effectivePath === "/" ? "" : m.effectivePath, x = `${l}${we(t.base, v || "/")}`, p = ve(m) ? `/${t.paths.guarded}/${at(m)}` : "", g = (z) => `${p}${v}/${On(z)}`, S = y.map((z) => z.releaseDate ? new Date(z.releaseDate).getTime() : Number.NaN).filter((z) => !Number.isNaN(z)).sort((z, se) => se - z), C = [];
|
|
5654
|
+
for (let z = 0; z + 1 < S.length; z++) C.push(S[z] - S[z + 1]);
|
|
5655
|
+
const E = C.length ? Math.round(C.reduce((z, se) => z + se, 0) / C.length / 1e3) : void 0, I = E ? Math.min(43200, Math.max(60, Math.round(E / 60))) : 1440, j = E ? E <= 172800 ? "daily" : E <= 1209600 ? "weekly" : E <= 5184e3 ? "monthly" : "yearly" : "weekly", O = S.length ? new Date(S[0]).toUTCString() : void 0, R = ye(m.frontmatter.title), B = ye(
|
|
5656
5656
|
m.frontmatter.description ?? t.site?.description ?? m.frontmatter.title
|
|
5657
|
-
), M = t.site?.locale?.replace("_", "-").toLowerCase(), L = Math.max(1, Math.ceil(y.length /
|
|
5657
|
+
), M = t.site?.locale?.replace("_", "-").toLowerCase(), L = Math.max(1, Math.ceil(y.length / Ft));
|
|
5658
5658
|
for (let z = 0; z < L; z++) {
|
|
5659
|
-
const se = y.slice(z *
|
|
5659
|
+
const se = y.slice(z * Ft, (z + 1) * Ft), ie = [
|
|
5660
5660
|
`<atom:link href="${ye(`${l}${we(t.base, g(z))}`)}" rel="self" type="application/rss+xml"/>`
|
|
5661
5661
|
];
|
|
5662
5662
|
z > 0 && ie.push(
|
|
@@ -5682,7 +5682,7 @@ function Ga(e) {
|
|
|
5682
5682
|
`<description>${B}</description>`,
|
|
5683
5683
|
...ie
|
|
5684
5684
|
];
|
|
5685
|
-
M && F.push(`<language>${ye(M)}</language>`),
|
|
5685
|
+
M && F.push(`<language>${ye(M)}</language>`), O && F.push(`<lastBuildDate>${O}</lastBuildDate>`), F.push(`<ttl>${I}</ttl>`), F.push(`<sy:updatePeriod>${j}</sy:updatePeriod>`), F.push("<sy:updateFrequency>1</sy:updateFrequency>"), E !== void 0 && F.push(`<nimpress:releaseCadence>${E}</nimpress:releaseCadence>`), F.push(`<nimpress:latestVersion>${ye(y[0].version)}</nimpress:latestVersion>`), F.push(`<nimpress:releaseCount>${y.length}</nimpress:releaseCount>`), z > 0 && F.push("<fh:archive/>");
|
|
5686
5686
|
const q = [
|
|
5687
5687
|
'<?xml version="1.0" encoding="UTF-8"?>',
|
|
5688
5688
|
`<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:fh="http://purl.org/syndication/history/1.0" xmlns:nimpress="${Zr}">`,
|
|
@@ -5699,7 +5699,7 @@ function Ga(e) {
|
|
|
5699
5699
|
}
|
|
5700
5700
|
}
|
|
5701
5701
|
}
|
|
5702
|
-
const
|
|
5702
|
+
const Et = /* @__PURE__ */ new Map();
|
|
5703
5703
|
function ve(a) {
|
|
5704
5704
|
return a.frontmatter.gate !== void 0;
|
|
5705
5705
|
}
|
|
@@ -5729,7 +5729,7 @@ function Ga(e) {
|
|
|
5729
5729
|
return l + we(t.base, a.startsWith("/") ? a : "/" + a);
|
|
5730
5730
|
}
|
|
5731
5731
|
function on(a) {
|
|
5732
|
-
if (
|
|
5732
|
+
if (Et.has(a)) return Et.get(a);
|
|
5733
5733
|
let l;
|
|
5734
5734
|
try {
|
|
5735
5735
|
l = qo("git", ["log", "-1", "--format=%cI", "--", a], {
|
|
@@ -5740,25 +5740,25 @@ function Ga(e) {
|
|
|
5740
5740
|
} catch {
|
|
5741
5741
|
l = void 0;
|
|
5742
5742
|
}
|
|
5743
|
-
return
|
|
5743
|
+
return Et.set(a, l), l;
|
|
5744
5744
|
}
|
|
5745
5745
|
function wo(a) {
|
|
5746
5746
|
return a === "changelog" || a === "roadmap" ? "CollectionPage" : a === "openapi" ? "APIReference" : a === "hero" || a === "fullpage" || a === "404" ? "WebPage" : a === "section" || a === "tags" ? "CollectionPage" : a === "glossary" ? "DefinedTermSet" : a === "team" ? "AboutPage" : "TechArticle";
|
|
5747
5747
|
}
|
|
5748
5748
|
function vo(a) {
|
|
5749
|
-
const l = t.meta ?? {}, m = t.site, y = a.frontmatter, v = y.meta ?? {}, x = v.og ?? {}, p = v.twitter ?? {}, g = y.title, S = m?.title && m.title !== g ? `${g} · ${m.title}` : g,
|
|
5749
|
+
const l = t.meta ?? {}, m = t.site, y = a.frontmatter, v = y.meta ?? {}, x = v.og ?? {}, p = v.twitter ?? {}, g = y.title, S = m?.title && m.title !== g ? `${g} · ${m.title}` : g, C = v.description ?? y.description ?? m?.description, E = v.canonical ?? Ae(a.effectivePath), I = (() => {
|
|
5750
5750
|
if (v.keywords) return Array.isArray(v.keywords) ? v.keywords : [v.keywords];
|
|
5751
5751
|
const G = Be(y.tags);
|
|
5752
5752
|
return G.length ? G : l.keywords ?? [];
|
|
5753
|
-
})(), j = Na(v.robots ?? "index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1", t.seo?.ai?.index, v.ai),
|
|
5754
|
-
if (q.push(`<title>${F(S)}</title>`),
|
|
5753
|
+
})(), j = Na(v.robots ?? "index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1", t.seo?.ai?.index, v.ai), O = x.title ?? g, R = x.description ?? C, B = x.image ?? m?.ogImage, M = B ? Ae(B) ?? B : void 0, L = x.type ?? (y.type === "hero" || y.type === "fullpage" || a.effectivePath === "/" ? "website" : "article"), z = l.og?.width ?? 1200, se = l.og?.height ?? 600, ie = p.card ?? (M ? "summary_large_image" : "summary"), ee = p.site ?? m?.twitterSite, F = nt, q = [];
|
|
5754
|
+
if (q.push(`<title>${F(S)}</title>`), C && q.push(`<meta name="description" content="${F(C)}">`), I.length && q.push(`<meta name="keywords" content="${F(I.join(", "))}">`), q.push(`<meta name="robots" content="${F(j)}">`), q.push(`<meta name="googlebot" content="${F(j)}">`), E) {
|
|
5755
5755
|
q.push(`<link rel="canonical" href="${F(E)}">`);
|
|
5756
5756
|
const G = l.localeAlternates ?? [];
|
|
5757
5757
|
for (const X of G)
|
|
5758
5758
|
q.push(`<link rel="alternate" hreflang="${F(X)}" href="${F(E)}">`);
|
|
5759
5759
|
G.length && q.push(`<link rel="alternate" hreflang="x-default" href="${F(E)}">`);
|
|
5760
5760
|
}
|
|
5761
|
-
if (q.push(`<meta property="og:title" content="${F(
|
|
5761
|
+
if (q.push(`<meta property="og:title" content="${F(O)}">`), R && q.push(`<meta property="og:description" content="${F(R)}">`), q.push(`<meta property="og:type" content="${F(L)}">`), E && q.push(`<meta property="og:url" content="${F(E)}">`), M && (q.push(`<meta property="og:image" content="${F(M)}">`), q.push(`<meta property="og:image:width" content="${z}">`), q.push(`<meta property="og:image:height" content="${se}">`), x.imageAlt && q.push(`<meta property="og:image:alt" content="${F(x.imageAlt)}">`)), m?.title && q.push(`<meta property="og:site_name" content="${F(m.title)}">`), m?.locale && q.push(`<meta property="og:locale" content="${F(m.locale)}">`), q.push(`<meta name="twitter:card" content="${F(ie)}">`), ee && q.push(`<meta name="twitter:site" content="${F(ee)}">`), q.push(`<meta name="twitter:title" content="${F(p.title ?? O)}">`), (p.description ?? R) && q.push(`<meta name="twitter:description" content="${F(p.description ?? R ?? "")}">`), (p.image ?? M) && q.push(`<meta name="twitter:image" content="${F(p.image ?? M ?? "")}">`), C && q.push(`<meta name="dc.description" content="${F(C)}">`), q.push(`<meta name="dc.title" content="${F(S)}">`), m?.locale && q.push(`<meta name="dc.language" content="${F(m.locale)}">`), y.type === "changelog" && (y.rss === !0 || y.subscribe === !0)) {
|
|
5762
5762
|
const G = a.effectivePath === "/" ? "/rss.xml" : `${a.effectivePath}/rss.xml`, X = Ae(G) ?? G;
|
|
5763
5763
|
q.push(`<link rel="alternate" type="application/rss+xml" title="${F(g)}" href="${F(X)}">`);
|
|
5764
5764
|
}
|
|
@@ -5796,7 +5796,7 @@ function Ga(e) {
|
|
|
5796
5796
|
"@type": wo(a.type),
|
|
5797
5797
|
name: S,
|
|
5798
5798
|
headline: g,
|
|
5799
|
-
description:
|
|
5799
|
+
description: C,
|
|
5800
5800
|
url: E,
|
|
5801
5801
|
isPartOf: Y ? `${Y}${we(t.base, "/")}#website` : void 0,
|
|
5802
5802
|
dateModified: on(a.filePath)
|
|
@@ -5810,11 +5810,11 @@ function Ga(e) {
|
|
|
5810
5810
|
function ko() {
|
|
5811
5811
|
const a = t.meta ?? {};
|
|
5812
5812
|
if (a.robots?.custom) return a.robots.custom;
|
|
5813
|
-
const l = /* @__PURE__ */ new Set([...a.robots?.block ?? [], ...t.seo?.ai?.index === !1 ?
|
|
5814
|
-
for (const v of
|
|
5813
|
+
const l = /* @__PURE__ */ new Set([...a.robots?.block ?? [], ...t.seo?.ai?.index === !1 ? Rt : []]), m = ["User-agent: *", "Allow: /", ""];
|
|
5814
|
+
for (const v of Rt)
|
|
5815
5815
|
m.push(`User-agent: ${v}`), m.push(l.has(v) ? "Disallow: /" : "Allow: /"), m.push("");
|
|
5816
5816
|
for (const v of l)
|
|
5817
|
-
|
|
5817
|
+
Rt.includes(v) || (m.push(`User-agent: ${v}`), m.push("Disallow: /"), m.push(""));
|
|
5818
5818
|
a.robots?.append && m.push(a.robots.append, "");
|
|
5819
5819
|
const y = Ae("/sitemap.xml");
|
|
5820
5820
|
return y && m.push(`Sitemap: ${y}`), m.join(`
|
|
@@ -5831,8 +5831,8 @@ function Ga(e) {
|
|
|
5831
5831
|
'<?xml version="1.0" encoding="UTF-8"?>',
|
|
5832
5832
|
'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">',
|
|
5833
5833
|
a.map((v) => {
|
|
5834
|
-
const x = `${l}${we(t.base, v.effectivePath === "/" ? "/" : v.effectivePath)}`, p = v.effectivePath.split("/").filter(Boolean).length, g = p === 0 ? "1.0" : p === 1 ? "0.8" : "0.6", S = p === 0 ? "weekly" : "monthly",
|
|
5835
|
-
|
|
5834
|
+
const x = `${l}${we(t.base, v.effectivePath === "/" ? "/" : v.effectivePath)}`, p = v.effectivePath.split("/").filter(Boolean).length, g = p === 0 ? "1.0" : p === 1 ? "0.8" : "0.6", S = p === 0 ? "weekly" : "monthly", C = on(v.filePath), E = [` <loc>${ye(x)}</loc>`];
|
|
5835
|
+
C && E.push(` <lastmod>${ye(C)}</lastmod>`), E.push(` <changefreq>${S}</changefreq>`), E.push(` <priority>${g}</priority>`);
|
|
5836
5836
|
for (const I of m)
|
|
5837
5837
|
E.push(` <xhtml:link rel="alternate" hreflang="${ye(I)}" href="${ye(x)}"/>`);
|
|
5838
5838
|
return ` <url>
|
|
@@ -5856,8 +5856,8 @@ ${E.join(`
|
|
|
5856
5856
|
p.push(I);
|
|
5857
5857
|
continue;
|
|
5858
5858
|
}
|
|
5859
|
-
const
|
|
5860
|
-
R.push(I), x.set(
|
|
5859
|
+
const O = j[0], R = x.get(O) ?? [];
|
|
5860
|
+
R.push(I), x.set(O, R);
|
|
5861
5861
|
}
|
|
5862
5862
|
const g = (I) => {
|
|
5863
5863
|
const j = Ae(I.effectivePath) ?? I.effectivePath;
|
|
@@ -5865,17 +5865,17 @@ ${E.join(`
|
|
|
5865
5865
|
};
|
|
5866
5866
|
for (const I of p) y.push(g(I));
|
|
5867
5867
|
p.length && y.push("");
|
|
5868
|
-
for (const [I, j] of [...x.entries()].sort((
|
|
5869
|
-
const
|
|
5870
|
-
y.push(`## ${
|
|
5868
|
+
for (const [I, j] of [...x.entries()].sort((O, R) => O[0].localeCompare(R[0]))) {
|
|
5869
|
+
const O = j.find((R) => R.effectivePath === `/${I}`);
|
|
5870
|
+
y.push(`## ${O?.frontmatter.title ?? Te(I)}`, ""), j.sort((R, B) => R.effectivePath.localeCompare(B.effectivePath));
|
|
5871
5871
|
for (const R of j) y.push(g(R));
|
|
5872
5872
|
y.push("");
|
|
5873
5873
|
}
|
|
5874
5874
|
const S = new Set(t.meta?.keywords ?? []);
|
|
5875
5875
|
for (const I of a) for (const j of Be(I.frontmatter.tags)) S.add(j);
|
|
5876
5876
|
S.size && y.push("## Keywords", "", [...S].join(", "), "");
|
|
5877
|
-
const
|
|
5878
|
-
return (
|
|
5877
|
+
const C = Ae("/sitemap.xml"), E = Ae("/robots.txt");
|
|
5878
|
+
return (C || E) && (y.push("## Optional", ""), C && y.push(`- [Sitemap](${C})`), E && y.push(`- [Robots](${E})`), y.push("")), l.llms?.append && y.push(l.llms.append, ""), y.join(`
|
|
5879
5879
|
`).replace(/\n{3,}/g, `
|
|
5880
5880
|
|
|
5881
5881
|
`);
|
|
@@ -5895,8 +5895,8 @@ ${E.join(`
|
|
|
5895
5895
|
async function jo() {
|
|
5896
5896
|
const a = t.meta ?? {}, l = bo().sort((p, g) => p.effectivePath.localeCompare(g.effectivePath)), m = U(i, "index.html"), y = await le(m, "utf-8");
|
|
5897
5897
|
for (const p of l) {
|
|
5898
|
-
const g = vo(p), S = y.replace("</head>", `${g}</head>`),
|
|
5899
|
-
await Je(K(
|
|
5898
|
+
const g = vo(p), S = y.replace("</head>", `${g}</head>`), C = p.effectivePath === "/" ? m : U(i, p.effectivePath.replace(/^\//, ""), "index.html");
|
|
5899
|
+
await Je(K(C), { recursive: !0 }), await fe(C, S);
|
|
5900
5900
|
}
|
|
5901
5901
|
await fe(U(i, "robots.txt"), ko());
|
|
5902
5902
|
const v = l.filter((p) => p.type !== "404"), x = $o(v);
|
|
@@ -5927,7 +5927,7 @@ ${E.join(`
|
|
|
5927
5927
|
for (const [p, g] of m) {
|
|
5928
5928
|
const S = U(v, p);
|
|
5929
5929
|
await Je(U(S, "body"), { recursive: !0 });
|
|
5930
|
-
const
|
|
5930
|
+
const C = {}, E = g.map((j) => ({
|
|
5931
5931
|
slug: j.slug,
|
|
5932
5932
|
path: j.effectivePath,
|
|
5933
5933
|
type: j.type,
|
|
@@ -5935,9 +5935,9 @@ ${E.join(`
|
|
|
5935
5935
|
bundle: p
|
|
5936
5936
|
})), I = [`${p}/manifest.json`, `${p}/search.json`];
|
|
5937
5937
|
for (const j of g) {
|
|
5938
|
-
j.pageCss && (
|
|
5938
|
+
j.pageCss && (C[j.effectivePath] = [C[j.effectivePath], j.pageCss].filter(Boolean).join(`
|
|
5939
5939
|
`));
|
|
5940
|
-
const
|
|
5940
|
+
const O = {
|
|
5941
5941
|
html: j.html,
|
|
5942
5942
|
headings: j.headings,
|
|
5943
5943
|
openApiSpec: j.openApiSpec,
|
|
@@ -5951,11 +5951,11 @@ ${E.join(`
|
|
|
5951
5951
|
dbmlFile: j.dbmlFile,
|
|
5952
5952
|
dbmlError: j.dbmlError
|
|
5953
5953
|
}, R = U(S, "body", `${De(j.slug)}.json`);
|
|
5954
|
-
await Je(K(R), { recursive: !0 }), await fe(R, JSON.stringify(
|
|
5954
|
+
await Je(K(R), { recursive: !0 }), await fe(R, JSON.stringify(O)), I.push(`${p}/body/${De(j.slug)}.json`);
|
|
5955
5955
|
}
|
|
5956
5956
|
await fe(
|
|
5957
5957
|
U(S, "manifest.json"),
|
|
5958
|
-
JSON.stringify({ shells: E, styles:
|
|
5958
|
+
JSON.stringify({ shells: E, styles: C, sidebar: an(!0) })
|
|
5959
5959
|
), await fe(U(S, "search.json"), JSON.stringify(un(!0, g))), x[p] = {
|
|
5960
5960
|
pages: Object.fromEntries(g.map((j) => [j.effectivePath, j.frontmatter.gate ?? ""])),
|
|
5961
5961
|
files: I
|
|
@@ -5972,23 +5972,23 @@ ${E.join(`
|
|
|
5972
5972
|
const m = l.filter((v) => Eo(v.type)), y = /* @__PURE__ */ new Map();
|
|
5973
5973
|
for (const v of m) y.set(v.filePath, v);
|
|
5974
5974
|
for (const [, v] of a) {
|
|
5975
|
-
const x = v[0], p = K(x.filePath), g = x.frontmatter.data, S = g?.issues ?? g?.entries,
|
|
5976
|
-
if (typeof S == "string")
|
|
5975
|
+
const x = v[0], p = K(x.filePath), g = x.frontmatter.data, S = g?.issues ?? g?.entries, C = [];
|
|
5976
|
+
if (typeof S == "string") C.push(S);
|
|
5977
5977
|
else if (Array.isArray(S))
|
|
5978
|
-
for (const M of S) typeof M == "string" &&
|
|
5979
|
-
const E =
|
|
5978
|
+
for (const M of S) typeof M == "string" && C.push(M);
|
|
5979
|
+
const E = C.length ? C.map((M) => V(p, M)) : [p], I = m.filter((M) => {
|
|
5980
5980
|
for (const L of E)
|
|
5981
5981
|
if (M.filePath !== L && (M.filePath.startsWith(L + "/") || M.filePath.startsWith(L + "\\")))
|
|
5982
5982
|
return !0;
|
|
5983
5983
|
return !1;
|
|
5984
|
-
}), j = g?.changelog,
|
|
5984
|
+
}), j = g?.changelog, O = [];
|
|
5985
5985
|
if (typeof j == "string")
|
|
5986
|
-
|
|
5986
|
+
O.push(V(p, j));
|
|
5987
5987
|
else if (Array.isArray(j))
|
|
5988
|
-
for (const M of j) typeof M == "string" &&
|
|
5988
|
+
for (const M of j) typeof M == "string" && O.push(V(p, M));
|
|
5989
5989
|
const R = /* @__PURE__ */ new Map();
|
|
5990
5990
|
for (const M of l) {
|
|
5991
|
-
if (M.type !== "changelog" ||
|
|
5991
|
+
if (M.type !== "changelog" || O.length && !O.some(
|
|
5992
5992
|
(re) => M.filePath === re || M.filePath.startsWith(re + "/") || M.filePath.startsWith(re + "\\")
|
|
5993
5993
|
))
|
|
5994
5994
|
continue;
|
|
@@ -6097,37 +6097,37 @@ ${E.join(`
|
|
|
6097
6097
|
if (c && (ke(p.frontmatter) || !a && ve(p)) || p.type === "404" && !p.frontmatter.sidebar?.name) continue;
|
|
6098
6098
|
const g = p.frontmatter.sidebar;
|
|
6099
6099
|
if (p.effectivePath === "/" && !g?.name) continue;
|
|
6100
|
-
const S = p.effectivePath === "/" ? [g.path ?? g.name] : p.effectivePath.split("/").filter(Boolean),
|
|
6101
|
-
if (g?.name &&
|
|
6102
|
-
const
|
|
6103
|
-
y.set(
|
|
6100
|
+
const S = p.effectivePath === "/" ? [g.path ?? g.name] : p.effectivePath.split("/").filter(Boolean), C = p.filePath.endsWith(`${$e}index.md`);
|
|
6101
|
+
if (g?.name && C) {
|
|
6102
|
+
const O = "/" + S.join("/");
|
|
6103
|
+
y.set(O, {
|
|
6104
6104
|
label: g.name,
|
|
6105
|
-
icon: Ue(g.icon, p.filePath) ?? y.get(
|
|
6106
|
-
style: g.style ?? y.get(
|
|
6105
|
+
icon: Ue(g.icon, p.filePath) ?? y.get(O)?.icon,
|
|
6106
|
+
style: g.style ?? y.get(O)?.style
|
|
6107
6107
|
});
|
|
6108
6108
|
}
|
|
6109
6109
|
if (p.sidebarOnly && !p.linkTo) continue;
|
|
6110
|
-
const E =
|
|
6110
|
+
const E = C ? void 0 : g?.path ?? g?.name;
|
|
6111
6111
|
E && S[S.length - 2] !== E && (S.length >= 3 ? S.splice(S.length - 2, 1, E) : S.splice(S.length - 1, 0, E));
|
|
6112
6112
|
let I = l, j = "";
|
|
6113
|
-
for (const
|
|
6114
|
-
j = j + "/" +
|
|
6115
|
-
let R = I.children.get(
|
|
6116
|
-
R || (R = { segment:
|
|
6113
|
+
for (const O of S) {
|
|
6114
|
+
j = j + "/" + O;
|
|
6115
|
+
let R = I.children.get(O);
|
|
6116
|
+
R || (R = { segment: O, fullPath: j, children: /* @__PURE__ */ new Map() }, I.children.set(O, R)), I = R;
|
|
6117
6117
|
}
|
|
6118
|
-
if (I.page = p, !
|
|
6119
|
-
const
|
|
6120
|
-
y.set(
|
|
6118
|
+
if (I.page = p, !C && g?.name) {
|
|
6119
|
+
const O = "/" + S.slice(0, -1).join("/");
|
|
6120
|
+
y.set(O, {
|
|
6121
6121
|
label: g.name,
|
|
6122
|
-
icon: Ue(g.icon, p.filePath) ?? y.get(
|
|
6123
|
-
style: g.style ?? y.get(
|
|
6122
|
+
icon: Ue(g.icon, p.filePath) ?? y.get(O)?.icon,
|
|
6123
|
+
style: g.style ?? y.get(O)?.style
|
|
6124
6124
|
});
|
|
6125
6125
|
}
|
|
6126
6126
|
}
|
|
6127
6127
|
function v(p) {
|
|
6128
6128
|
const g = [];
|
|
6129
6129
|
for (const I of p.children.values()) g.push(v(I));
|
|
6130
|
-
if (
|
|
6130
|
+
if (_t(g), p.page) {
|
|
6131
6131
|
const I = {
|
|
6132
6132
|
text: Rn(p.page),
|
|
6133
6133
|
link: p.page.linkTo ?? p.page.effectivePath,
|
|
@@ -6141,9 +6141,9 @@ ${E.join(`
|
|
|
6141
6141
|
dropdown: cn(p.page)
|
|
6142
6142
|
}, j = y.get(p.fullPath);
|
|
6143
6143
|
j?.label && (I.text = j.label), j?.icon && !I.icon && (I.icon = j.icon), j?.style && (I.style = j.style);
|
|
6144
|
-
const
|
|
6145
|
-
if (p.page.type === "openapi" &&
|
|
6146
|
-
const R =
|
|
6144
|
+
const O = p.page.openApiSpec;
|
|
6145
|
+
if (p.page.type === "openapi" && O?.tags?.length) {
|
|
6146
|
+
const R = O.tags.map((B) => ({
|
|
6147
6147
|
text: B.name,
|
|
6148
6148
|
link: `${p.page.effectivePath}#tag/${B.name}`,
|
|
6149
6149
|
slug: `${p.page.slug}__tag__${B.name}`
|
|
@@ -6215,8 +6215,8 @@ ${E.join(`
|
|
|
6215
6215
|
order: -1
|
|
6216
6216
|
}, B = (p.page.componentData?.stories ?? []).map((M, L) => ({
|
|
6217
6217
|
text: M.sidebar?.name ?? M.name,
|
|
6218
|
-
link: `${p.page.effectivePath}/${
|
|
6219
|
-
slug: `${p.page.slug}__story__${
|
|
6218
|
+
link: `${p.page.effectivePath}/${Bt(M.name)}`,
|
|
6219
|
+
slug: `${p.page.slug}__story__${Bt(M.name)}`,
|
|
6220
6220
|
icon: Ue(M.sidebar?.icon, p.page.filePath),
|
|
6221
6221
|
style: M.sidebar?.style,
|
|
6222
6222
|
order: L
|
|
@@ -6225,29 +6225,30 @@ ${E.join(`
|
|
|
6225
6225
|
} else g.length && (I.items = g);
|
|
6226
6226
|
return I.collapsed !== !1 && I.items?.some((R) => R.collapsed === !1) && (I.collapsed = !1), I;
|
|
6227
6227
|
}
|
|
6228
|
-
const S = y.get(p.fullPath),
|
|
6228
|
+
const S = y.get(p.fullPath), C = {
|
|
6229
6229
|
text: S?.label ?? Te(p.segment),
|
|
6230
6230
|
slug: p.fullPath.replace(/^\//, "")
|
|
6231
6231
|
};
|
|
6232
|
-
S?.icon && (
|
|
6232
|
+
S?.icon && (C.icon = S.icon), S?.style && (C.style = S.style);
|
|
6233
6233
|
const E = [...p.children.values()];
|
|
6234
|
-
if (E.length && E.every((I) => I.page && Object.values(cn(I.page) ?? {}).some((j) => j.some((
|
|
6235
|
-
|
|
6236
|
-
const I = (j) => Math.min(...Object.entries(j.dropdown ?? {}).map(([
|
|
6237
|
-
|
|
6234
|
+
if (E.length && E.every((I) => I.page && Object.values(cn(I.page) ?? {}).some((j) => j.some((O) => O.toLowerCase() === I.segment.toLowerCase())))) {
|
|
6235
|
+
C.variants = !0;
|
|
6236
|
+
const I = (j) => Math.min(...Object.entries(j.dropdown ?? {}).map(([O, R]) => m.get(`${O}:${R[0]}`) ?? Number.MAX_SAFE_INTEGER));
|
|
6237
|
+
for (const j of g) j.order ??= I(j);
|
|
6238
|
+
_t(g);
|
|
6238
6239
|
}
|
|
6239
6240
|
if (g.length) {
|
|
6240
|
-
|
|
6241
|
+
C.items = g;
|
|
6241
6242
|
let I = Number.MAX_SAFE_INTEGER;
|
|
6242
6243
|
for (const j of g)
|
|
6243
6244
|
j.order !== void 0 && j.order < I && (I = j.order);
|
|
6244
|
-
I !== Number.MAX_SAFE_INTEGER && (
|
|
6245
|
+
I !== Number.MAX_SAFE_INTEGER && !C.variants && (C.order = I);
|
|
6245
6246
|
}
|
|
6246
|
-
return
|
|
6247
|
+
return C.items?.some((I) => I.collapsed === !1) && (C.collapsed = !1), C;
|
|
6247
6248
|
}
|
|
6248
6249
|
const x = [];
|
|
6249
6250
|
for (const p of l.children.values()) x.push(v(p));
|
|
6250
|
-
return
|
|
6251
|
+
return _t(x), x;
|
|
6251
6252
|
}
|
|
6252
6253
|
function cn(a) {
|
|
6253
6254
|
const l = Object.entries(a.frontmatter.dropdown ?? {}).filter(([, m]) => m.value?.length);
|
|
@@ -6313,7 +6314,7 @@ ${E.join(`
|
|
|
6313
6314
|
};
|
|
6314
6315
|
if (a[v] = p, l[x.effectivePath] = v, x.type === "component")
|
|
6315
6316
|
for (const g of x.componentData?.stories ?? [])
|
|
6316
|
-
l[`${x.effectivePath}/${
|
|
6317
|
+
l[`${x.effectivePath}/${Bt(g.name)}`] = v;
|
|
6317
6318
|
}
|
|
6318
6319
|
const m = {}, y = Do();
|
|
6319
6320
|
y && (m["/"] = y);
|
|
@@ -6329,11 +6330,11 @@ ${E.join(`
|
|
|
6329
6330
|
if (a) {
|
|
6330
6331
|
if (ke(x.frontmatter) || !ve(x)) continue;
|
|
6331
6332
|
} else if (c && (ke(x.frontmatter) || ve(x))) continue;
|
|
6332
|
-
const p = x.rawText.replace(/```[\s\S]*?```/g, "").replace(/[#*`>_\[\]\(\)]/g, " "), g = x.type === "openapi" ? To(x.openApiSpec) : "", S = x.type === "roadmap" ? No(x.roadmapEntries ?? []) : "",
|
|
6333
|
+
const p = x.rawText.replace(/```[\s\S]*?```/g, "").replace(/[#*`>_\[\]\(\)]/g, " "), g = x.type === "openapi" ? To(x.openApiSpec) : "", S = x.type === "roadmap" ? No(x.roadmapEntries ?? []) : "", C = x.componentData ? [
|
|
6333
6334
|
x.componentData.component,
|
|
6334
6335
|
x.componentData.system,
|
|
6335
6336
|
...(x.componentData.stories ?? []).flatMap((j) => [j.name, j.file])
|
|
6336
|
-
].filter(Boolean).join(" ") : "", E = x.dbmlSource ? x.dbmlSource.replace(/[{}\[\]'"`,]/g, " ") : "", I = [p, g, S,
|
|
6337
|
+
].filter(Boolean).join(" ") : "", E = x.dbmlSource ? x.dbmlSource.replace(/[{}\[\]'"`,]/g, " ") : "", I = [p, g, S, C, E].filter(Boolean).join(`
|
|
6337
6338
|
`);
|
|
6338
6339
|
m.push({
|
|
6339
6340
|
slug: v,
|
|
@@ -6360,8 +6361,8 @@ ${E.join(`
|
|
|
6360
6361
|
if (p == null || g > v) return;
|
|
6361
6362
|
const S = typeof p;
|
|
6362
6363
|
if (S === "string") {
|
|
6363
|
-
const
|
|
6364
|
-
|
|
6364
|
+
const C = p.trim();
|
|
6365
|
+
C && m.push(C);
|
|
6365
6366
|
return;
|
|
6366
6367
|
}
|
|
6367
6368
|
if (S === "number" || S === "boolean") {
|
|
@@ -6370,15 +6371,15 @@ ${E.join(`
|
|
|
6370
6371
|
}
|
|
6371
6372
|
if (S === "object" && !y.has(p)) {
|
|
6372
6373
|
if (y.add(p), Array.isArray(p)) {
|
|
6373
|
-
for (const
|
|
6374
|
+
for (const C of p) x(C, g + 1);
|
|
6374
6375
|
return;
|
|
6375
6376
|
}
|
|
6376
|
-
for (const [
|
|
6377
|
-
if (
|
|
6377
|
+
for (const [C, E] of Object.entries(p)) {
|
|
6378
|
+
if (C === "description_html" || C === "summary_html" || C === "requestBodyHtml") {
|
|
6378
6379
|
typeof E == "string" && m.push(mn(E));
|
|
6379
6380
|
continue;
|
|
6380
6381
|
}
|
|
6381
|
-
m.push(
|
|
6382
|
+
m.push(C), x(E, g + 1);
|
|
6382
6383
|
}
|
|
6383
6384
|
}
|
|
6384
6385
|
};
|
|
@@ -6430,7 +6431,7 @@ ${E.join(`
|
|
|
6430
6431
|
m && a.moduleGraph.invalidateModule(m);
|
|
6431
6432
|
}
|
|
6432
6433
|
}
|
|
6433
|
-
function
|
|
6434
|
+
function Ct(a) {
|
|
6434
6435
|
for (const l of s.keys()) {
|
|
6435
6436
|
const m = Le + De(l) + ".js", y = Ve + De(l) + ".svelte", v = a.moduleGraph.getModuleById(m), x = a.moduleGraph.getModuleById(y);
|
|
6436
6437
|
v && a.moduleGraph.invalidateModule(v), x && a.moduleGraph.invalidateModule(x);
|
|
@@ -6493,7 +6494,7 @@ export default bodies
|
|
|
6493
6494
|
return `export default ${JSON.stringify(m)}
|
|
6494
6495
|
`;
|
|
6495
6496
|
}
|
|
6496
|
-
function
|
|
6497
|
+
function Ot(a) {
|
|
6497
6498
|
return `Custom_${a.replace(/[^a-zA-Z0-9]/g, "_")}`;
|
|
6498
6499
|
}
|
|
6499
6500
|
function Wo(a) {
|
|
@@ -6507,8 +6508,8 @@ export default bodies
|
|
|
6507
6508
|
path: l.effectivePath,
|
|
6508
6509
|
type: l.type,
|
|
6509
6510
|
frontmatter: l.frontmatter
|
|
6510
|
-
}, y = `${Le}${De(a)}.js`, v = JSON.stringify(m).replace(/<\/script>/g, "<\\/script>"), x = Array.from(Ie.entries()), p = x.map(([
|
|
6511
|
-
`), g = (
|
|
6511
|
+
}, y = `${Le}${De(a)}.js`, v = JSON.stringify(m).replace(/<\/script>/g, "<\\/script>"), x = Array.from(Ie.entries()), p = x.map(([C, E]) => ` import ${Ot(C)} from ${JSON.stringify(Wo(E.file))}`).join(`
|
|
6512
|
+
`), g = (C, E) => Ie.has(C) ? Ot(C) : E, S = [
|
|
6512
6513
|
["team", "TeamPage"],
|
|
6513
6514
|
["pricing", "PricingPage"],
|
|
6514
6515
|
["glossary", "GlossaryPage"],
|
|
@@ -6519,10 +6520,10 @@ export default bodies
|
|
|
6519
6520
|
["roadmap", "RoadmapPage"],
|
|
6520
6521
|
["component", "ComponentPage"],
|
|
6521
6522
|
["dbml", "DbmlPage"]
|
|
6522
|
-
].map(([
|
|
6523
|
-
<${g(
|
|
6524
|
-
x.filter(([
|
|
6525
|
-
<${
|
|
6523
|
+
].map(([C, E]) => ` {:else if shell.type === ${JSON.stringify(C)}}
|
|
6524
|
+
<${g(C, E)} page={{ ...shell, ...mod.default }} />`).concat(
|
|
6525
|
+
x.filter(([C]) => !lo.has(C)).map(([C]) => ` {:else if shell.type === ${JSON.stringify(C)}}
|
|
6526
|
+
<${Ot(C)} page={{ ...shell, ...mod.default }} />`)
|
|
6526
6527
|
).join(`
|
|
6527
6528
|
`);
|
|
6528
6529
|
return `<script lang="ts">
|
|
@@ -6574,7 +6575,7 @@ ${S}
|
|
|
6574
6575
|
name: "@nimtech/nimpress:markdown",
|
|
6575
6576
|
async config() {
|
|
6576
6577
|
t = (await _s(process.cwd(), e)).resolved, n = V(process.cwd(), t.contentDir), ra(process.cwd(), t.pageTypes ?? {});
|
|
6577
|
-
for (const l of
|
|
6578
|
+
for (const l of $t(t))
|
|
6578
6579
|
dt.includes(l) || he(V(process.cwd(), l)) || console.warn(`[nimpress] theme ${l} is neither a built in theme, ${dt.join(" or ")}, nor a stylesheet`);
|
|
6579
6580
|
return o = V(process.cwd(), t.assetsDir), {};
|
|
6580
6581
|
},
|
|
@@ -6591,7 +6592,7 @@ ${S}
|
|
|
6591
6592
|
recursive: !0,
|
|
6592
6593
|
filter: (v) => {
|
|
6593
6594
|
try {
|
|
6594
|
-
return
|
|
6595
|
+
return yt(v).isDirectory() || !(v.endsWith(".md") || v.endsWith(".css"));
|
|
6595
6596
|
} catch {
|
|
6596
6597
|
return !1;
|
|
6597
6598
|
}
|
|
@@ -6604,7 +6605,7 @@ ${S}
|
|
|
6604
6605
|
const p = U(i, v.replace(/^\//, ""));
|
|
6605
6606
|
await Je(K(p), { recursive: !0 }), await fe(p, x);
|
|
6606
6607
|
}
|
|
6607
|
-
await fe(U(i, "subscribe.map.json"),
|
|
6608
|
+
await fe(U(i, "subscribe.map.json"), At), await jo();
|
|
6608
6609
|
const y = Array.from(s.values()).find((v) => v.type === "404" && !ke(v.frontmatter) && !ve(v));
|
|
6609
6610
|
y && await dn(U(i, y.effectivePath.replace(/^\//, ""), "index.html"), U(i, "404.html")), await Po();
|
|
6610
6611
|
},
|
|
@@ -6621,7 +6622,7 @@ ${S}
|
|
|
6621
6622
|
a.config.logger.error(String(S));
|
|
6622
6623
|
return;
|
|
6623
6624
|
}
|
|
6624
|
-
it(a),
|
|
6625
|
+
it(a), Ct(a), Ge(), a.ws.send({ type: "full-reload" });
|
|
6625
6626
|
}
|
|
6626
6627
|
}, m = async (p) => {
|
|
6627
6628
|
if (p.startsWith(n) && (p.endsWith(".md") || p.endsWith(".css") || p.match(/\.story\.tsx?$/))) {
|
|
@@ -6632,7 +6633,7 @@ ${S}
|
|
|
6632
6633
|
a.config.logger.error(String(S));
|
|
6633
6634
|
return;
|
|
6634
6635
|
}
|
|
6635
|
-
it(a),
|
|
6636
|
+
it(a), Ct(a), Ge(), a.ws.send({ type: "full-reload" });
|
|
6636
6637
|
return;
|
|
6637
6638
|
}
|
|
6638
6639
|
if (T.has(p)) {
|
|
@@ -6644,7 +6645,7 @@ ${S}
|
|
|
6644
6645
|
if (a.watcher.on("add", l), a.watcher.on("unlink", m), t.banner !== !1) {
|
|
6645
6646
|
const p = Rs(), g = t.banner, S = Date.now();
|
|
6646
6647
|
a.printUrls = function() {
|
|
6647
|
-
const
|
|
6648
|
+
const C = a.resolvedUrls, E = C?.local?.[0] ?? `http://localhost:${a.config.server.port ?? 5173}/`, I = C?.network?.[0] ?? "use --host to expose", j = Fs({
|
|
6648
6649
|
title: g.title ?? t.title ?? p.name ?? "Nimpress",
|
|
6649
6650
|
tagline: g.tagline,
|
|
6650
6651
|
company: g.company,
|
|
@@ -6675,11 +6676,11 @@ ${S}
|
|
|
6675
6676
|
".mp4": "video/mp4"
|
|
6676
6677
|
}, v = t.assetUrlBase, x = (p, g, S) => {
|
|
6677
6678
|
if (!g || g.endsWith(".md")) return !1;
|
|
6678
|
-
const
|
|
6679
|
-
return !
|
|
6679
|
+
const C = U(p, decodeURIComponent(g));
|
|
6680
|
+
return !C.startsWith(p) || !he(C) || !yt(C).isFile() ? !1 : (S.setHeader("Content-Type", y[Gt(C).toLowerCase()] ?? "application/octet-stream"), Ho(C).pipe(S), !0);
|
|
6680
6681
|
};
|
|
6681
6682
|
return a.middlewares.use((p, g, S) => {
|
|
6682
|
-
const
|
|
6683
|
+
const C = (p.url ?? "").split("?")[0], E = Un(t.base, C);
|
|
6683
6684
|
if (E.startsWith("/@") || E.startsWith("/node_modules/")) return S();
|
|
6684
6685
|
if (E === "/__nimpress/claude-md" && p.method === "PUT") {
|
|
6685
6686
|
const R = [];
|
|
@@ -6724,7 +6725,7 @@ ${S}
|
|
|
6724
6725
|
return;
|
|
6725
6726
|
}
|
|
6726
6727
|
if (E === "/subscribe.map.json") {
|
|
6727
|
-
g.setHeader("Content-Type", "application/json; charset=utf-8"), g.end(
|
|
6728
|
+
g.setHeader("Content-Type", "application/json; charset=utf-8"), g.end(At);
|
|
6728
6729
|
return;
|
|
6729
6730
|
}
|
|
6730
6731
|
const j = t.modules.route.replace(/\/$/, "");
|
|
@@ -6737,7 +6738,7 @@ ${S}
|
|
|
6737
6738
|
const L = zo(
|
|
6738
6739
|
{
|
|
6739
6740
|
host: "127.0.0.1",
|
|
6740
|
-
port:
|
|
6741
|
+
port: St(t.modules, B),
|
|
6741
6742
|
path: `${E}${(p.url ?? "").includes("?") ? `?${(p.url ?? "").split("?").slice(1).join("?")}` : ""}`,
|
|
6742
6743
|
method: p.method,
|
|
6743
6744
|
headers: p.headers
|
|
@@ -6762,13 +6763,13 @@ ${S}
|
|
|
6762
6763
|
a.middlewares.use(async (p, g, S) => {
|
|
6763
6764
|
if (p.method !== "GET" && p.method !== "HEAD" || !(p.headers.accept ?? "").includes("text/html")) return S();
|
|
6764
6765
|
try {
|
|
6765
|
-
const
|
|
6766
|
+
const C = await a.transformIndexHtml(
|
|
6766
6767
|
p.url ?? "/",
|
|
6767
6768
|
Kr(t, "/@id/__x00__virtual:nimpress/main")
|
|
6768
6769
|
);
|
|
6769
|
-
g.statusCode = 200, g.setHeader("Content-Type", "text/html"), g.end(
|
|
6770
|
-
} catch (
|
|
6771
|
-
S(
|
|
6770
|
+
g.statusCode = 200, g.setHeader("Content-Type", "text/html"), g.end(C);
|
|
6771
|
+
} catch (C) {
|
|
6772
|
+
S(C);
|
|
6772
6773
|
}
|
|
6773
6774
|
});
|
|
6774
6775
|
};
|
|
@@ -6794,15 +6795,15 @@ ${S}
|
|
|
6794
6795
|
a.server.config.logger.error(String(S));
|
|
6795
6796
|
return;
|
|
6796
6797
|
}
|
|
6797
|
-
return it(a.server),
|
|
6798
|
+
return it(a.server), Ct(a.server), Ge(), a.server.ws.send({ type: "full-reload" }), [];
|
|
6798
6799
|
},
|
|
6799
6800
|
resolveId(a) {
|
|
6800
|
-
return a === lt ? "\0" + lt : a === pt ? "\0" + pt : a === ut ? "\0" + ut : a === mt ? "\0" + mt : a ===
|
|
6801
|
+
return a === lt ? "\0" + lt : a === pt ? "\0" + pt : a === ut ? "\0" + ut : a === mt ? "\0" + mt : a === Nt ? "\0" + Nt : a === It ? "\0" + It : a.startsWith(Ve) && a.endsWith(".svelte") || a.startsWith(Le) && a.endsWith(".js") ? a : null;
|
|
6801
6802
|
},
|
|
6802
6803
|
async load(a) {
|
|
6803
6804
|
if (a === "\0" + lt)
|
|
6804
6805
|
return `export default ${JSON.stringify(Mo())}`;
|
|
6805
|
-
if (a === "\0" +
|
|
6806
|
+
if (a === "\0" + Nt) {
|
|
6806
6807
|
const l = ys(t), m = l.announce || l.feedback ? Fn(await P(), be(), t.base, { math: t.math, icons: t.icons }) : null;
|
|
6807
6808
|
if (l.feedback && m && (l.feedback = {
|
|
6808
6809
|
...l.feedback,
|
|
@@ -6816,8 +6817,8 @@ ${S}
|
|
|
6816
6817
|
}
|
|
6817
6818
|
return `export default ${JSON.stringify(l)}`;
|
|
6818
6819
|
}
|
|
6819
|
-
if (a === "\0" +
|
|
6820
|
-
const l = (E) => E.startsWith("/") ? E : "/" + E.replace(/^\.\//, ""), y = [
|
|
6820
|
+
if (a === "\0" + It) {
|
|
6821
|
+
const l = (E) => E.startsWith("/") ? E : "/" + E.replace(/^\.\//, ""), y = [...$t(t).filter((E) => E !== "stock").map((E) => dt.includes(E) ? `@nimtech/nimpress/themes/${E}.css` : l(E)), ...t.css.map(l)].map((E) => `import ${JSON.stringify(E)}`).join(`
|
|
6821
6822
|
`), v = Object.entries(t.components), x = v.map(([E, I]) => `import Nimpress${E} from ${JSON.stringify(l(I))}`).join(`
|
|
6822
6823
|
`), p = v.length ? `, components: { ${v.map(([E]) => `${E}: Nimpress${E}`).join(", ")} }` : "", g = t.client ? l(t.client) : null, S = g ? `import { authFunctions, subscribeFunctions, feedbackFunctions } from ${JSON.stringify(g)}` : "";
|
|
6823
6824
|
return `import '@nimtech/nimpress/app.css'
|
|
@@ -6865,7 +6866,7 @@ async function Pi(e, t) {
|
|
|
6865
6866
|
} catch {
|
|
6866
6867
|
continue;
|
|
6867
6868
|
}
|
|
6868
|
-
const { data: c, content: f } =
|
|
6869
|
+
const { data: c, content: f } = bt(i);
|
|
6869
6870
|
typeof c.type == "number" && (c.type = String(c.type));
|
|
6870
6871
|
for (const d of po(c, f))
|
|
6871
6872
|
s.push(`${Se(n, r).split($e).join("/")}: ${d}`);
|
|
@@ -6895,14 +6896,14 @@ export {
|
|
|
6895
6896
|
yi as h,
|
|
6896
6897
|
Kr as i,
|
|
6897
6898
|
vi as j,
|
|
6898
|
-
|
|
6899
|
+
St as k,
|
|
6899
6900
|
ra as l,
|
|
6900
6901
|
Pi as m,
|
|
6901
6902
|
Oa as n,
|
|
6902
6903
|
Zn as o,
|
|
6903
6904
|
rt as p,
|
|
6904
6905
|
_i as q,
|
|
6905
|
-
|
|
6906
|
+
jt as r,
|
|
6906
6907
|
st as s,
|
|
6907
6908
|
bi as t,
|
|
6908
6909
|
xr as u,
|