typerighter 0.43.1 → 0.44.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/{app-DjpuKzvd.js → app-C-CwtIly.js} +334 -334
- package/dist/{cli-BnRDeJy2.js → cli-BYbSBUOA.js} +5 -5
- package/dist/cli.js +1 -1
- package/dist/client/theme-default.js +790 -764
- package/dist/client.js +1 -1
- package/dist/index.js +2 -2
- package/dist/{init-BCfVnwE1.js → init-C3xKB6xH.js} +1 -1
- package/dist/{jsonld-ODTuVGMh.js → jsonld-CrXLLdKW.js} +1 -1
- package/dist/node/build/index.d.ts.map +1 -1
- package/dist/node/lib/codegen/app-entry.d.ts +1 -1
- package/dist/node/lib/codegen/app-entry.d.ts.map +1 -1
- package/dist/node/lib/codegen/index.d.ts +0 -1
- package/dist/node/lib/codegen/index.d.ts.map +1 -1
- package/dist/node/lib/components.d.ts +14 -0
- package/dist/node/lib/components.d.ts.map +1 -0
- package/dist/node/plugin/vite/index.d.ts.map +1 -1
- package/dist/node/plugin/vite/subplugins/component-contract.d.ts +4 -0
- package/dist/node/plugin/vite/subplugins/component-contract.d.ts.map +1 -0
- package/dist/node/plugin/vite/virtual/app.d.ts.map +1 -1
- package/dist/prerenderWorker.js +2 -2
- package/dist/{renderMath-C2Z7HdfG.js → renderMath-DBw8KV_4.js} +1 -1
- package/dist/shared/types/index.d.ts +1 -0
- package/dist/shared/types/index.d.ts.map +1 -1
- package/dist/shared/types/json-schema.d.ts +24 -0
- package/dist/shared/types/json-schema.d.ts.map +1 -0
- package/dist/{shared-QuBFygxT.js → shared-B-wDtFX6.js} +112 -100
- package/dist/shared.js +1 -1
- package/dist/typerighter.css +1 -1
- package/dist/{vite-C9pVUTyV.js → vite-B7uvklyW.js} +556 -428
- package/dist/vite.js +1 -1
- package/package.json +3 -3
- package/dist/node/lib/codegen/components.d.ts +0 -7
- package/dist/node/lib/codegen/components.d.ts.map +0 -1
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as
|
|
3
|
-
import { t as
|
|
4
|
-
import { a as
|
|
5
|
-
import { t as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { build as
|
|
11
|
-
import N, { readdir as
|
|
12
|
-
import { fileURLToPath as
|
|
13
|
-
import
|
|
14
|
-
import { Worker as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
1
|
+
import { $ as e, D as t, E as n, F as r, G as i, H as a, J as o, L as s, P as c, R as l, V as u, X as d, Z as f, _ as p, b as m, c as h, d as g, et as _, g as v, h as y, i as b, p as x, v as S, w as C, y as w, z as T } from "./shared-B-wDtFX6.js";
|
|
2
|
+
import { a as E, i as D, n as O, o as ee, r as te, s as ne, t as re } from "./jsonld-CrXLLdKW.js";
|
|
3
|
+
import { t as ie } from "./temml-D47Z4xZ2.js";
|
|
4
|
+
import { a as ae, i as oe, n as se, r as ce } from "./context-CSvoDxVt.js";
|
|
5
|
+
import { t as le } from "./es-ClqUVRJn.js";
|
|
6
|
+
import k, { resolve as A } from "node:path";
|
|
7
|
+
import j from "picocolors";
|
|
8
|
+
import ue from "@tailwindcss/vite";
|
|
9
|
+
import de from "@vitejs/plugin-vue";
|
|
10
|
+
import { build as fe, normalizePath as M } from "vite";
|
|
11
|
+
import N, { readdir as pe } from "node:fs/promises";
|
|
12
|
+
import { fileURLToPath as me } from "node:url";
|
|
13
|
+
import he from "node:os";
|
|
14
|
+
import { Worker as ge } from "node:worker_threads";
|
|
15
|
+
import P, { createReadStream as _e, existsSync as ve, globSync as ye, readFileSync as be, statSync as xe } from "node:fs";
|
|
16
|
+
import { createChecker as Se, createCheckerByJson as Ce } from "vue-component-meta";
|
|
17
|
+
import { createHighlighter as we, guessEmbeddedLanguages as Te, isSpecialLang as Ee } from "shiki";
|
|
18
|
+
import { createRequire as De } from "node:module";
|
|
18
19
|
//#region src/node/lib/worker-pool/index.ts
|
|
19
|
-
var
|
|
20
|
+
var Oe = class {
|
|
20
21
|
workers = [];
|
|
21
22
|
queue = [];
|
|
22
23
|
destroyed = !1;
|
|
23
24
|
startupError;
|
|
24
25
|
constructor(e) {
|
|
25
|
-
let t = e.concurrency ?? Math.max(1, Math.floor(
|
|
26
|
+
let t = e.concurrency ?? Math.max(1, Math.floor(he.cpus().length / 2));
|
|
26
27
|
for (let n = 0; n < t; n++) {
|
|
27
|
-
let t = new
|
|
28
|
+
let t = new ge(e.filename, { workerData: e.workerData }), n = { worker: t };
|
|
28
29
|
this.workers.push(n), t.on("message", (e) => {
|
|
29
30
|
let t = n.pending;
|
|
30
31
|
n.pending = void 0, e.error === void 0 ? t?.resolve(e.result) : t?.reject(Error(e.error)), this.dispatch(n);
|
|
@@ -62,18 +63,18 @@ var Te = class {
|
|
|
62
63
|
};
|
|
63
64
|
//#endregion
|
|
64
65
|
//#region src/node/build/seo/sitemap.ts
|
|
65
|
-
function
|
|
66
|
+
function ke(e, t, n, r) {
|
|
66
67
|
let i = n ?? "";
|
|
67
68
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
68
69
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
69
70
|
${e.map((e) => {
|
|
70
|
-
let n = h(i + t +
|
|
71
|
-
return ` <url><loc>${n}</loc>${a === void 0 ? "" : `<lastmod>${
|
|
71
|
+
let n = h(i + t + c(e)), a = r?.get(e);
|
|
72
|
+
return ` <url><loc>${n}</loc>${a === void 0 ? "" : `<lastmod>${b(a)}</lastmod>`}</url>`;
|
|
72
73
|
}).join("\n")}
|
|
73
74
|
</urlset>
|
|
74
75
|
`;
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
+
function Ae(e, t) {
|
|
77
78
|
return `User-agent: *
|
|
78
79
|
Allow: /
|
|
79
80
|
|
|
@@ -82,7 +83,7 @@ Sitemap: ${e}${t}sitemap.xml
|
|
|
82
83
|
}
|
|
83
84
|
//#endregion
|
|
84
85
|
//#region src/node/build/seo/feed.ts
|
|
85
|
-
function
|
|
86
|
+
function je(e, t, n, r, i, a) {
|
|
86
87
|
let o = [...e].filter((e) => e.fileMetadata.mtime > 0).sort((e, t) => t.fileMetadata.mtime - e.fileMetadata.mtime).slice(0, 50).map((e) => {
|
|
87
88
|
let r = u(e.filepath), i = `${n}${t}${r}`, a = new Date(e.fileMetadata.mtime).toUTCString(), o = h(e.label ?? r), s = e.excerpt === void 0 ? "" : `<![CDATA[${e.excerpt}]]>`;
|
|
88
89
|
return ` <item>
|
|
@@ -108,20 +109,20 @@ ${o}
|
|
|
108
109
|
}
|
|
109
110
|
//#endregion
|
|
110
111
|
//#region src/node/build/fonts.ts
|
|
111
|
-
function
|
|
112
|
-
let t =
|
|
112
|
+
function Me(e) {
|
|
113
|
+
let t = k.basename(e);
|
|
113
114
|
return t.endsWith(".woff2") && t.includes("-latin-") && !t.includes("-latin-ext-");
|
|
114
115
|
}
|
|
115
116
|
//#endregion
|
|
116
117
|
//#region src/node/build/prerender.ts
|
|
117
|
-
var
|
|
118
|
-
async function
|
|
119
|
-
let { clientEntry: t, cssFiles: n, fontFiles: r } = await
|
|
120
|
-
e.pagePaths.length >=
|
|
121
|
-
}
|
|
122
|
-
async function
|
|
123
|
-
let r = new
|
|
124
|
-
filename:
|
|
118
|
+
var Ne = 64;
|
|
119
|
+
async function Pe(e) {
|
|
120
|
+
let { clientEntry: t, cssFiles: n, fontFiles: r } = await Le(e.clientOutDir), i = [n.map((t) => ` <link rel="stylesheet" href="${e.base}${t}">`).join("\n"), r.map((t) => ` <link rel="preload" as="font" type="font/woff2" crossorigin href="${e.base}${t}">`).join("\n")].filter(Boolean).join("\n") || void 0;
|
|
121
|
+
e.pagePaths.length >= Ne ? await Fe(e, t, i) : await Ie(e, t, i);
|
|
122
|
+
}
|
|
123
|
+
async function Fe(e, t, n) {
|
|
124
|
+
let r = new Oe({
|
|
125
|
+
filename: k.resolve(me(import.meta.url), "../prerenderWorker.js"),
|
|
125
126
|
workerData: {
|
|
126
127
|
ssrEntryPath: e.ssrEntryPath,
|
|
127
128
|
base: e.base,
|
|
@@ -135,23 +136,23 @@ async function Me(e, t, n) {
|
|
|
135
136
|
}), i = 0, a = e.pagePaths.length;
|
|
136
137
|
try {
|
|
137
138
|
await Promise.all(e.pagePaths.map(async (t) => {
|
|
138
|
-
let n = await r.run(t), o =
|
|
139
|
-
await N.mkdir(
|
|
139
|
+
let n = await r.run(t), o = k.join(e.outDir, n.fileName);
|
|
140
|
+
await N.mkdir(k.dirname(o), { recursive: !0 }), await N.writeFile(o, n.html), i++, e.progress?.update(i, a);
|
|
140
141
|
}));
|
|
141
142
|
} finally {
|
|
142
143
|
await r.destroy();
|
|
143
144
|
}
|
|
144
145
|
}
|
|
145
|
-
async function
|
|
146
|
+
async function Ie(e, t, n) {
|
|
146
147
|
let r = await (await import(e.ssrEntryPath)).createRenderer(), i = e.pagePaths.length, a = 0;
|
|
147
148
|
for (let o of e.pagePaths) {
|
|
148
|
-
let
|
|
149
|
+
let s = await r(o), l = ee(s.pageData), u = E(s.pageData), d = te(s.pageData), f = e.base + c(o), p = [re({
|
|
149
150
|
title: l,
|
|
150
151
|
description: u,
|
|
151
152
|
canonicalUrl: f,
|
|
152
153
|
author: e.author,
|
|
153
154
|
dateModified: d
|
|
154
|
-
}),
|
|
155
|
+
}), O(o, l)].filter((e) => e !== void 0), m = ne({
|
|
155
156
|
title: l,
|
|
156
157
|
description: u,
|
|
157
158
|
siteTitle: e.siteTitle,
|
|
@@ -161,17 +162,17 @@ async function Ne(e, t, n) {
|
|
|
161
162
|
lang: e.lang,
|
|
162
163
|
entryScript: t,
|
|
163
164
|
canonicalUrl: f,
|
|
164
|
-
ogImagePath:
|
|
165
|
+
ogImagePath: D(s.pageData),
|
|
165
166
|
jsonLdBlocks: p,
|
|
166
167
|
headExtra: n,
|
|
167
|
-
appContent:
|
|
168
|
-
}), h = o === "/" ? "index.html" : `${
|
|
169
|
-
await N.mkdir(
|
|
168
|
+
appContent: s.html
|
|
169
|
+
}), h = o === "/" ? "index.html" : `${c(o)}.html`, g = k.join(e.outDir, h);
|
|
170
|
+
await N.mkdir(k.dirname(g), { recursive: !0 }), await N.writeFile(g, m), a++, e.progress?.update(a, i);
|
|
170
171
|
}
|
|
171
172
|
}
|
|
172
|
-
async function
|
|
173
|
-
let t =
|
|
174
|
-
for (let e of Object.values(r)) e.isEntry ? (i = e.file, e.css && a.push(...e.css)) :
|
|
173
|
+
async function Le(e) {
|
|
174
|
+
let t = k.join(e, ".vite", "manifest.json"), n = await N.readFile(t, "utf-8"), r = JSON.parse(n), i = "", a = [], o = [];
|
|
175
|
+
for (let e of Object.values(r)) e.isEntry ? (i = e.file, e.css && a.push(...e.css)) : Me(e.file) && o.push(e.file);
|
|
175
176
|
return {
|
|
176
177
|
clientEntry: i,
|
|
177
178
|
cssFiles: a,
|
|
@@ -180,8 +181,8 @@ async function Pe(e) {
|
|
|
180
181
|
}
|
|
181
182
|
//#endregion
|
|
182
183
|
//#region src/node/lib/codegen/app-entry.ts
|
|
183
|
-
function
|
|
184
|
-
let { rootDir: n = ".", userComponents: r = [] } = e, i = r.map((e) => `import ${e.name} from ${JSON.stringify(e.absolutePath)};`).join("\n"),
|
|
184
|
+
function Re(e, t) {
|
|
185
|
+
let { rootDir: n = ".", userComponents: r = [] } = e, i = r.map((e) => `import ${e.name} from ${JSON.stringify(e.absolutePath)};`).join("\n"), a = r.map((e) => `app.component(${JSON.stringify(e.name)}, ${e.name});`).join("\n"), o = JSON.stringify({
|
|
185
186
|
title: e.siteTitle,
|
|
186
187
|
description: e.siteDescription,
|
|
187
188
|
basePath: e.basePath ?? "/",
|
|
@@ -205,7 +206,7 @@ import theme from '${t.theme}';
|
|
|
205
206
|
import { pages as initialPages } from '${t.pages}';
|
|
206
207
|
import initialSiteData from '${t.siteData}';
|
|
207
208
|
let pages = initialPages;
|
|
208
|
-
const contentExts = ${JSON.stringify(
|
|
209
|
+
const contentExts = ${JSON.stringify(d)};
|
|
209
210
|
|
|
210
211
|
function findPage(base) {
|
|
211
212
|
for (const ext of contentExts) {
|
|
@@ -230,8 +231,8 @@ async function loadPageModule(pagePath) {
|
|
|
230
231
|
return undefined;
|
|
231
232
|
}
|
|
232
233
|
|
|
233
|
-
const { app, router, searchIndex: searchIndexRef, siteData } = await createTypedownApp(loadPageModule, theme, ${
|
|
234
|
-
${
|
|
234
|
+
const { app, router, searchIndex: searchIndexRef, siteData } = await createTypedownApp(loadPageModule, theme, ${o}, initialSiteData);
|
|
235
|
+
${a}
|
|
235
236
|
app.mount('#app');
|
|
236
237
|
|
|
237
238
|
// Load search index in the background after the app is mounted
|
|
@@ -273,40 +274,61 @@ if (import.meta.hot) {
|
|
|
273
274
|
//#endregion
|
|
274
275
|
//#region src/node/lib/codegen/theme.ts
|
|
275
276
|
var F = "typerighter/client/theme-default";
|
|
276
|
-
function
|
|
277
|
-
let n = e?.notFound ? `import CustomNotFound from ${JSON.stringify(t ?
|
|
277
|
+
function ze(e, t) {
|
|
278
|
+
let n = e?.notFound ? `import CustomNotFound from ${JSON.stringify(t ? k.resolve(t, e.notFound) : e.notFound)};` : "", r = e?.notFound ? ", NotFound: CustomNotFound" : "";
|
|
278
279
|
if (e?.component) {
|
|
279
|
-
let
|
|
280
|
+
let i = t ? k.resolve(t, e.component) : e.component;
|
|
280
281
|
return [
|
|
281
|
-
`import CustomLayout from ${JSON.stringify(
|
|
282
|
+
`import CustomLayout from ${JSON.stringify(i)};`,
|
|
282
283
|
n,
|
|
283
|
-
`export default { Layout: CustomLayout${
|
|
284
|
+
`export default { Layout: CustomLayout${r} };`
|
|
284
285
|
].filter(Boolean).join("\n");
|
|
285
286
|
}
|
|
286
287
|
let a = Object.entries(e?.slots ?? {});
|
|
287
288
|
if (0 < a.length) {
|
|
288
|
-
let e = a.map(([e, t]) => `${JSON.stringify(
|
|
289
|
+
let e = a.map(([e, t]) => `${JSON.stringify(i(e))}: () => h(resolveComponent(${JSON.stringify(t)}))`).join(", ");
|
|
289
290
|
return [
|
|
290
291
|
`import DefaultTheme from ${JSON.stringify(F)};`,
|
|
291
292
|
"import { h, resolveComponent } from 'vue';",
|
|
292
293
|
n,
|
|
293
|
-
`export default { Layout: { render() { return h(DefaultTheme.Layout, null, { ${e} }); } }${
|
|
294
|
+
`export default { Layout: { render() { return h(DefaultTheme.Layout, null, { ${e} }); } }${r} };`
|
|
294
295
|
].filter(Boolean).join("\n");
|
|
295
296
|
}
|
|
296
297
|
return n ? [
|
|
297
298
|
`import DefaultTheme from ${JSON.stringify(F)};`,
|
|
298
299
|
n,
|
|
299
|
-
`export default { ...DefaultTheme${
|
|
300
|
+
`export default { ...DefaultTheme${r} };`
|
|
300
301
|
].join("\n") : `export { default } from ${JSON.stringify(F)};`;
|
|
301
302
|
}
|
|
302
303
|
//#endregion
|
|
303
|
-
//#region src/node/lib/
|
|
304
|
-
|
|
304
|
+
//#region src/node/lib/components.ts
|
|
305
|
+
function Be(e, t) {
|
|
306
|
+
let n = Ve(t), r = {};
|
|
307
|
+
for (let i of e) {
|
|
308
|
+
let e = `./${k.relative(t, i.absolutePath)}`;
|
|
309
|
+
try {
|
|
310
|
+
let t = n.getComponentMeta(i.absolutePath), a = {}, s = !1;
|
|
311
|
+
for (let e of t.props) {
|
|
312
|
+
if (e.global) continue;
|
|
313
|
+
let t = L(e.schema);
|
|
314
|
+
t !== void 0 && (a[e.name] = e.required ? t : o(t), s = !0);
|
|
315
|
+
}
|
|
316
|
+
r[i.name] = {
|
|
317
|
+
source: e,
|
|
318
|
+
props: s ? a : void 0
|
|
319
|
+
};
|
|
320
|
+
} catch {
|
|
321
|
+
r[i.name] = { source: e };
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return r;
|
|
325
|
+
}
|
|
326
|
+
async function I(e, t) {
|
|
305
327
|
let n = [];
|
|
306
328
|
for (let r of e) if (r.kind === "dir") {
|
|
307
|
-
let e =
|
|
329
|
+
let e = k.resolve(t, r.path), i;
|
|
308
330
|
try {
|
|
309
|
-
i = await
|
|
331
|
+
i = await pe(e);
|
|
310
332
|
} catch {
|
|
311
333
|
continue;
|
|
312
334
|
}
|
|
@@ -315,23 +337,86 @@ async function Fe(e, t) {
|
|
|
315
337
|
let r = t.slice(0, -4);
|
|
316
338
|
n.push({
|
|
317
339
|
name: r,
|
|
318
|
-
absolutePath:
|
|
340
|
+
absolutePath: k.join(e, t)
|
|
319
341
|
});
|
|
320
342
|
}
|
|
321
343
|
} else n.push({
|
|
322
344
|
name: r.name,
|
|
323
|
-
absolutePath:
|
|
345
|
+
absolutePath: k.resolve(t, r.source)
|
|
324
346
|
});
|
|
325
347
|
return n;
|
|
326
348
|
}
|
|
349
|
+
function Ve(e) {
|
|
350
|
+
let t = k.join(e, "tsconfig.json");
|
|
351
|
+
return P.existsSync(t) ? Se(t) : Ce(e, { compilerOptions: {
|
|
352
|
+
strict: !1,
|
|
353
|
+
jsx: "preserve",
|
|
354
|
+
jsxImportSource: "vue"
|
|
355
|
+
} });
|
|
356
|
+
}
|
|
357
|
+
function He(e) {
|
|
358
|
+
if (!e || e.length !== 1) return;
|
|
359
|
+
let t = L(e[0]);
|
|
360
|
+
return t === void 0 ? void 0 : {
|
|
361
|
+
type: "array",
|
|
362
|
+
items: t
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
function Ue(e) {
|
|
366
|
+
let t = e ?? [], n = t.some((e) => e === "undefined" || e === "null"), r = t.filter((e) => e !== "undefined" && e !== "null");
|
|
367
|
+
if (r.length !== 1) return;
|
|
368
|
+
let i = L(r[0]);
|
|
369
|
+
if (i !== void 0) return n ? o(i) : i;
|
|
370
|
+
}
|
|
371
|
+
function L(e) {
|
|
372
|
+
if (typeof e == "string") return Ge(e);
|
|
373
|
+
switch (e.kind) {
|
|
374
|
+
case "enum": return Ue(e.schema);
|
|
375
|
+
case "array": return He(e.schema);
|
|
376
|
+
case "object": return We(e.type, e.schema);
|
|
377
|
+
default: return;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
function We(e, t) {
|
|
381
|
+
if (t && 0 < Object.keys(t).length) return Ke(t);
|
|
382
|
+
let n = /^(?:Record<string,\s*(\w+)>|\{\s*\[key:\s*string\]:\s*(\w+);\s*\})$/.exec(e);
|
|
383
|
+
if (!n) return;
|
|
384
|
+
let r = Ge(n[1] ?? n[2]);
|
|
385
|
+
return r === void 0 ? void 0 : {
|
|
386
|
+
type: "object",
|
|
387
|
+
additionalProperties: r
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
function Ge(e) {
|
|
391
|
+
switch (e) {
|
|
392
|
+
case "string": return { type: "string" };
|
|
393
|
+
case "number": return { type: "number" };
|
|
394
|
+
case "boolean": return { type: "boolean" };
|
|
395
|
+
default: return;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
function Ke(e) {
|
|
399
|
+
let t = {}, n = [];
|
|
400
|
+
for (let [r, i] of Object.entries(e)) {
|
|
401
|
+
let e = L(i.schema);
|
|
402
|
+
if (e === void 0) return;
|
|
403
|
+
t[r] = e, i.required && n.push(r);
|
|
404
|
+
}
|
|
405
|
+
let r = {
|
|
406
|
+
type: "object",
|
|
407
|
+
properties: t,
|
|
408
|
+
additionalProperties: !1
|
|
409
|
+
};
|
|
410
|
+
return 0 < n.length && (r.required = n), r;
|
|
411
|
+
}
|
|
327
412
|
//#endregion
|
|
328
413
|
//#region src/node/lib/progress.ts
|
|
329
|
-
var
|
|
414
|
+
var R = [
|
|
330
415
|
"◐",
|
|
331
416
|
"◓",
|
|
332
417
|
"◑",
|
|
333
418
|
"◒"
|
|
334
|
-
],
|
|
419
|
+
], z = class {
|
|
335
420
|
logger;
|
|
336
421
|
label;
|
|
337
422
|
start;
|
|
@@ -339,8 +424,8 @@ var L = [
|
|
|
339
424
|
constructor(e, t) {
|
|
340
425
|
if (this.logger = e, this.label = t, this.start = performance.now(), process.stdout.isTTY) {
|
|
341
426
|
let e = 0;
|
|
342
|
-
process.stdout.write(
|
|
343
|
-
e = (e + 1) %
|
|
427
|
+
process.stdout.write(j.cyan(`${R[0]} ${t}`)), this.spinnerInterval = setInterval(() => {
|
|
428
|
+
e = (e + 1) % R.length, process.stdout.write(`\r${j.cyan(`${R[e]} ${this.label}`)}`);
|
|
344
429
|
}, 120).unref();
|
|
345
430
|
} else this.logger.start(t);
|
|
346
431
|
}
|
|
@@ -352,19 +437,19 @@ var L = [
|
|
|
352
437
|
done(e) {
|
|
353
438
|
this.stopSpinner(), process.stdout.isTTY && process.stdout.write("\r\x1B[K");
|
|
354
439
|
let t = Math.round(performance.now() - this.start);
|
|
355
|
-
this.logger.success(`${e} (${
|
|
440
|
+
this.logger.success(`${e} (${qe(t)})`);
|
|
356
441
|
}
|
|
357
442
|
stopSpinner() {
|
|
358
443
|
this.spinnerInterval &&= (clearInterval(this.spinnerInterval), void 0);
|
|
359
444
|
}
|
|
360
445
|
};
|
|
361
|
-
function
|
|
446
|
+
function qe(e) {
|
|
362
447
|
return e < 1e3 ? `${Math.round(e)}ms` : `${(e / 1e3).toFixed(1)}s`;
|
|
363
448
|
}
|
|
364
449
|
//#endregion
|
|
365
450
|
//#region src/node/build/index.ts
|
|
366
|
-
async function
|
|
367
|
-
let { root: n, logger: r } = e, i =
|
|
451
|
+
async function Je(e, t = {}) {
|
|
452
|
+
let { root: n, logger: r } = e, i = k.resolve(n, t.outDir ?? "dist"), a = k.join(i, ".client"), o = k.join(i, ".server");
|
|
368
453
|
await N.rm(i, {
|
|
369
454
|
recursive: !0,
|
|
370
455
|
force: !0
|
|
@@ -373,10 +458,10 @@ async function Le(e, t = {}) {
|
|
|
373
458
|
s.getConfig(),
|
|
374
459
|
s.listFiles(),
|
|
375
460
|
s.listSidebar()
|
|
376
|
-
]), f = c.origin ?? void 0, p = c.author ?? void 0, m = c.license ?? void 0, h = c.repo ?? void 0, g = t.base ?? c.basePath ?? "/", _ = g.endsWith("/") ? g : g + "/",
|
|
461
|
+
]), f = c.origin ?? void 0, p = c.author ?? void 0, m = c.license ?? void 0, h = c.repo ?? void 0, g = t.base ?? c.basePath ?? "/", _ = g.endsWith("/") ? g : g + "/", v = d.map((e) => ({
|
|
377
462
|
...e,
|
|
378
463
|
header: {}
|
|
379
|
-
})), b = v
|
|
464
|
+
})), b = y(v), x = JSON.stringify({
|
|
380
465
|
title: c.siteTitle,
|
|
381
466
|
description: c.siteDescription,
|
|
382
467
|
basePath: _,
|
|
@@ -390,11 +475,11 @@ async function Le(e, t = {}) {
|
|
|
390
475
|
}), S = JSON.stringify({
|
|
391
476
|
ready: !0,
|
|
392
477
|
contentTree: b
|
|
393
|
-
}), C =
|
|
478
|
+
}), C = k.join(n, "node_modules", ".typerighter");
|
|
394
479
|
await N.mkdir(C, { recursive: !0 });
|
|
395
|
-
let w =
|
|
480
|
+
let w = k.join(C, "client-entry.js"), T = k.join(C, "ssr-entry.js"), E = k.join(C, "theme.js"), D = await I(c.components, n), O = ze(c.layout ?? void 0, n);
|
|
396
481
|
await Promise.all([
|
|
397
|
-
N.writeFile(w,
|
|
482
|
+
N.writeFile(w, Re({
|
|
398
483
|
rootDir: c.rootDir,
|
|
399
484
|
basePath: _,
|
|
400
485
|
origin: f,
|
|
@@ -407,13 +492,13 @@ async function Le(e, t = {}) {
|
|
|
407
492
|
nav: c.nav,
|
|
408
493
|
userComponents: D
|
|
409
494
|
}, {
|
|
410
|
-
theme:
|
|
411
|
-
pages:
|
|
412
|
-
siteData:
|
|
413
|
-
searchIndex:
|
|
414
|
-
pageDataEvent:
|
|
495
|
+
theme: Y,
|
|
496
|
+
pages: G,
|
|
497
|
+
siteData: q,
|
|
498
|
+
searchIndex: J,
|
|
499
|
+
pageDataEvent: X
|
|
415
500
|
})),
|
|
416
|
-
N.writeFile(T,
|
|
501
|
+
N.writeFile(T, Ye({
|
|
417
502
|
rootDir: c.rootDir,
|
|
418
503
|
siteConfig: x,
|
|
419
504
|
siteData: S,
|
|
@@ -423,8 +508,8 @@ async function Le(e, t = {}) {
|
|
|
423
508
|
N.writeFile(E, O)
|
|
424
509
|
]);
|
|
425
510
|
try {
|
|
426
|
-
let s =
|
|
427
|
-
await
|
|
511
|
+
let s = gn({ context: e }), m = e.createViteLogger(), h = new z(r, "Building client bundle...");
|
|
512
|
+
await fe({
|
|
428
513
|
...t.viteConfig,
|
|
429
514
|
root: n,
|
|
430
515
|
base: _,
|
|
@@ -442,10 +527,10 @@ async function Le(e, t = {}) {
|
|
|
442
527
|
}
|
|
443
528
|
}
|
|
444
529
|
});
|
|
445
|
-
let g = await N.readdir(
|
|
530
|
+
let g = await N.readdir(k.join(a, "assets")).catch(() => []);
|
|
446
531
|
h.done(`Client bundle (${g.length} chunks)`);
|
|
447
|
-
let v = new
|
|
448
|
-
await
|
|
532
|
+
let v = new z(r, "Building SSR bundle...");
|
|
533
|
+
await fe({
|
|
449
534
|
...t.viteConfig,
|
|
450
535
|
root: n,
|
|
451
536
|
base: _,
|
|
@@ -463,10 +548,10 @@ async function Le(e, t = {}) {
|
|
|
463
548
|
let t = u(e);
|
|
464
549
|
return t === "index" ? "/" : `/${t}`;
|
|
465
550
|
});
|
|
466
|
-
y.push("/"),
|
|
467
|
-
let x = new
|
|
468
|
-
await
|
|
469
|
-
ssrEntryPath:
|
|
551
|
+
y.push("/"), Ze(b.entries, "", y);
|
|
552
|
+
let x = new z(r, "Pre-rendering pages...");
|
|
553
|
+
await Pe({
|
|
554
|
+
ssrEntryPath: k.join(o, "ssr-entry.js"),
|
|
470
555
|
clientOutDir: a,
|
|
471
556
|
outDir: i,
|
|
472
557
|
base: _,
|
|
@@ -482,11 +567,11 @@ async function Le(e, t = {}) {
|
|
|
482
567
|
let t = u(e.filepath), n = t === "index" ? "/" : `/${t}`;
|
|
483
568
|
S.set(n, e.fileMetadata.mtime);
|
|
484
569
|
}
|
|
485
|
-
let C =
|
|
486
|
-
f !== void 0 && (E.push(N.writeFile(
|
|
487
|
-
let D =
|
|
488
|
-
await N.cp(D, O, { recursive: !0 }).catch(() => {}), await
|
|
489
|
-
let ee =
|
|
570
|
+
let C = ke(y, _, f, S), E = [N.writeFile(k.join(i, "sitemap.xml"), C)];
|
|
571
|
+
f !== void 0 && (E.push(N.writeFile(k.join(i, "robots.txt"), Ae(f, _))), E.push(N.writeFile(k.join(i, "feed.xml"), je(d, _, f, c.siteTitle, c.siteDescription, c.lang)))), await Promise.all(E);
|
|
572
|
+
let D = k.join(a, "assets"), O = k.join(i, "assets");
|
|
573
|
+
await N.cp(D, O, { recursive: !0 }).catch(() => {}), await Xe(k.join(n, c.rootDir), i);
|
|
574
|
+
let ee = k.join(n, c.publicDir);
|
|
490
575
|
await N.cp(ee, i, { recursive: !0 }).catch(() => {});
|
|
491
576
|
} finally {
|
|
492
577
|
await Promise.all([
|
|
@@ -506,13 +591,13 @@ async function Le(e, t = {}) {
|
|
|
506
591
|
}
|
|
507
592
|
r.log(`\nBuild complete. Output: ${i}`);
|
|
508
593
|
}
|
|
509
|
-
function
|
|
510
|
-
let t = `/${e.rootDir}/${
|
|
594
|
+
function Ye(e) {
|
|
595
|
+
let t = `/${e.rootDir}/${f}`, n = JSON.parse(e.siteConfig), r = JSON.parse(e.siteData), i = r.contentTree ?? { entries: [] }, a = v(i.entries ?? [], n.title ?? ""), o = JSON.stringify({
|
|
511
596
|
...r,
|
|
512
|
-
directoryListings:
|
|
513
|
-
}),
|
|
597
|
+
directoryListings: a
|
|
598
|
+
}), s = e.userComponents ?? [], c = s.map((e) => `import ${e.name} from ${JSON.stringify(e.absolutePath)};`).join("\n"), l = s.map((e) => `app.component(${JSON.stringify(e.name)}, ${e.name});`).join("\n");
|
|
514
599
|
return `
|
|
515
|
-
${[
|
|
600
|
+
${[c, "import { createTypedownApp } from 'typerighter/client';"].filter(Boolean).join("\n")}
|
|
516
601
|
import { TdDirectoryIndex, TdGlossaryIndex } from 'typerighter/client/theme-default';
|
|
517
602
|
import { isIndexUrl, getDirectoryFromPageUrl } from 'typerighter/shared';
|
|
518
603
|
import { renderToString } from 'vue/server-renderer';
|
|
@@ -520,8 +605,8 @@ import { h } from 'vue';
|
|
|
520
605
|
import theme from ${JSON.stringify(e.themeModulePath)};
|
|
521
606
|
|
|
522
607
|
const pages = import.meta.glob('${t}', { eager: true });
|
|
523
|
-
const contentExts = ${JSON.stringify(
|
|
524
|
-
const siteData = ${
|
|
608
|
+
const contentExts = ${JSON.stringify(d)};
|
|
609
|
+
const siteData = ${o};
|
|
525
610
|
|
|
526
611
|
function findPage(base) {
|
|
527
612
|
for (const ext of contentExts) {
|
|
@@ -549,7 +634,7 @@ function loadPageModule(pagePath) {
|
|
|
549
634
|
|
|
550
635
|
export async function createRenderer() {
|
|
551
636
|
const { app, router } = await createTypedownApp(loadPageModule, theme, ${e.siteConfig}, siteData);
|
|
552
|
-
${
|
|
637
|
+
${l}
|
|
553
638
|
return async function render(url) {
|
|
554
639
|
await router.go(url, { replace: true });
|
|
555
640
|
const html = await renderToString(app);
|
|
@@ -558,32 +643,32 @@ export async function createRenderer() {
|
|
|
558
643
|
}
|
|
559
644
|
`;
|
|
560
645
|
}
|
|
561
|
-
async function
|
|
646
|
+
async function Xe(e, t) {
|
|
562
647
|
let n = (await N.readdir(e, {
|
|
563
648
|
recursive: !0,
|
|
564
649
|
withFileTypes: !0
|
|
565
650
|
})).filter((e) => e.isFile() && !l(e.name)).map(async (n) => {
|
|
566
|
-
let r =
|
|
567
|
-
return N.mkdir(
|
|
651
|
+
let r = k.join(n.parentPath, n.name), i = k.relative(e, r), a = k.join(t, i);
|
|
652
|
+
return N.mkdir(k.dirname(a), { recursive: !0 }).then(() => N.copyFile(r, a));
|
|
568
653
|
});
|
|
569
654
|
await Promise.all(n);
|
|
570
655
|
}
|
|
571
|
-
function
|
|
656
|
+
function Ze(e, t, n) {
|
|
572
657
|
for (let r of e) {
|
|
573
658
|
if (r.kind !== "dir") continue;
|
|
574
659
|
let e = `${t}/${r.node.name}`;
|
|
575
|
-
p(r.node) || n.push(
|
|
660
|
+
p(r.node) || n.push(C(e)), Ze(r.node.entries, e, n);
|
|
576
661
|
}
|
|
577
662
|
}
|
|
578
663
|
//#endregion
|
|
579
664
|
//#region ../../node_modules/.pnpm/@shikijs+transformers@4.4.3/node_modules/@shikijs/transformers/dist/index.mjs
|
|
580
|
-
var
|
|
665
|
+
var Qe = /(\s+\/\/)/, $e = /(?:\/\/|["'#]|;{1,2}|%{1,2}|--)(\s*)$/, et = /(?:\/\/|#|;{1,2}|%{1,2}|--)(\s*)$/, tt = [
|
|
581
666
|
[/^(<!--)(.+)(-->)$/, !1],
|
|
582
667
|
[/^(\/\*)(.+)(\*\/)$/, !1],
|
|
583
668
|
[/^(\/\/|["'#]|;{1,2}|%{1,2}|--)(.*)$/, !0],
|
|
584
669
|
[/^(\*)(.+)$/, !0]
|
|
585
670
|
];
|
|
586
|
-
function
|
|
671
|
+
function nt(e, t, n) {
|
|
587
672
|
let r = [];
|
|
588
673
|
for (let i of e) {
|
|
589
674
|
if (n === "v3") {
|
|
@@ -592,8 +677,8 @@ function Ge(e, t, n) {
|
|
|
592
677
|
let n = e.children[0];
|
|
593
678
|
if (n.type !== "text") return e;
|
|
594
679
|
let r = t === i.children.length - 1;
|
|
595
|
-
if (!
|
|
596
|
-
let a = n.value.split(
|
|
680
|
+
if (!B(n.value, r)) return e;
|
|
681
|
+
let a = n.value.split(Qe);
|
|
597
682
|
if (a.length <= 1) return e;
|
|
598
683
|
let o = [a[0]];
|
|
599
684
|
for (let e = 1; e < a.length; e += 2) o.push(a[e] + (a[e + 1] || ""));
|
|
@@ -614,13 +699,13 @@ function Ge(e, t, n) {
|
|
|
614
699
|
if (a.type !== "element") continue;
|
|
615
700
|
let o = a.children.at(0);
|
|
616
701
|
if (o?.type !== "text") continue;
|
|
617
|
-
let s = n === e.length - 1, c =
|
|
702
|
+
let s = n === e.length - 1, c = B(o.value, s), l;
|
|
618
703
|
if (!c && n > 0 && o.value.trim().startsWith("[!code")) {
|
|
619
704
|
let t = e[n - 1];
|
|
620
705
|
if (t?.type === "element") {
|
|
621
706
|
let n = t.children.at(0);
|
|
622
707
|
if (n?.type === "text" && n.value.includes("//")) {
|
|
623
|
-
let l =
|
|
708
|
+
let l = B(n.value + o.value, s);
|
|
624
709
|
if (l) {
|
|
625
710
|
c = l, r.push({
|
|
626
711
|
info: l,
|
|
@@ -637,7 +722,7 @@ function Ge(e, t, n) {
|
|
|
637
722
|
}
|
|
638
723
|
if (c) {
|
|
639
724
|
if (t && !s && n !== 0) {
|
|
640
|
-
let t =
|
|
725
|
+
let t = rt(e[n - 1], "{") && rt(e[n + 1], "}");
|
|
641
726
|
r.push({
|
|
642
727
|
info: c,
|
|
643
728
|
line: i,
|
|
@@ -659,16 +744,16 @@ function Ge(e, t, n) {
|
|
|
659
744
|
}
|
|
660
745
|
return r;
|
|
661
746
|
}
|
|
662
|
-
function
|
|
747
|
+
function rt(e, t) {
|
|
663
748
|
if (e.type !== "element") return !1;
|
|
664
749
|
let n = e.children[0];
|
|
665
750
|
return n.type === "text" && n.value.trim() === t;
|
|
666
751
|
}
|
|
667
|
-
function
|
|
752
|
+
function B(e, t) {
|
|
668
753
|
let n = e.trimStart(), r = e.length - n.length;
|
|
669
754
|
n = n.trimEnd();
|
|
670
755
|
let i = e.length - n.length - r;
|
|
671
|
-
for (let [e, a] of
|
|
756
|
+
for (let [e, a] of tt) {
|
|
672
757
|
if (a && !t) continue;
|
|
673
758
|
let o = e.exec(n);
|
|
674
759
|
if (o) return [
|
|
@@ -678,22 +763,22 @@ function z(e, t) {
|
|
|
678
763
|
];
|
|
679
764
|
}
|
|
680
765
|
}
|
|
681
|
-
function
|
|
682
|
-
let t = e.match(
|
|
766
|
+
function it(e) {
|
|
767
|
+
let t = e.match($e);
|
|
683
768
|
return t && t[1].trim().length === 0 ? e.slice(0, t.index) : e;
|
|
684
769
|
}
|
|
685
|
-
function
|
|
686
|
-
let t = e.match(
|
|
770
|
+
function at(e) {
|
|
771
|
+
let t = e.match(et);
|
|
687
772
|
return t && t[1].trim().length === 0 ? e.slice(0, t.index).trimEnd() : e;
|
|
688
773
|
}
|
|
689
|
-
function
|
|
774
|
+
function ot(e, t, n, r) {
|
|
690
775
|
return r ??= "v3", {
|
|
691
776
|
name: e,
|
|
692
777
|
code(e) {
|
|
693
778
|
let i = e.children.filter((e) => e.type === "element"), a = [];
|
|
694
779
|
e.data ??= {};
|
|
695
780
|
let o = e.data;
|
|
696
|
-
o._shiki_notation ??=
|
|
781
|
+
o._shiki_notation ??= nt(i, ["jsx", "tsx"].includes(this.options.lang), r);
|
|
697
782
|
let s = o._shiki_notation;
|
|
698
783
|
for (let e of s) {
|
|
699
784
|
if (e.info[1].length === 0) continue;
|
|
@@ -701,7 +786,7 @@ function Ye(e, t, n, r) {
|
|
|
701
786
|
e.isLineCommentOnly && r !== "v1" && o++;
|
|
702
787
|
let s = !1;
|
|
703
788
|
if (e.info[1] = e.info[1].replace(t, (...t) => n.call(this, t, e.line, e.token, i, o) ? (s = !0, "") : t[0]), !s) continue;
|
|
704
|
-
r === "v1" ? e.info[1] =
|
|
789
|
+
r === "v1" ? e.info[1] = it(e.info[1]) : r === "v3" && (e.info[1] = at(e.info[1]));
|
|
705
790
|
let c = e.info[1].trim().length === 0;
|
|
706
791
|
if (c && (e.info[1] = ""), c && e.isLineCommentOnly) a.push(e.line);
|
|
707
792
|
else if (c && e.isJsxStyle) e.line.children.splice(e.line.children.indexOf(e.token) - 1, 3);
|
|
@@ -726,44 +811,44 @@ function Ye(e, t, n, r) {
|
|
|
726
811
|
}
|
|
727
812
|
};
|
|
728
813
|
}
|
|
729
|
-
var
|
|
730
|
-
function
|
|
814
|
+
var st = /\{([\d,-]+)\}/;
|
|
815
|
+
function ct(e) {
|
|
731
816
|
if (!e) return null;
|
|
732
|
-
let t = e.match(
|
|
817
|
+
let t = e.match(st);
|
|
733
818
|
return t ? t[1].split(",").flatMap((e) => {
|
|
734
819
|
let t = e.split("-").map((e) => Number.parseInt(e, 10));
|
|
735
820
|
return t.length === 1 ? [t[0]] : Array.from({ length: t[1] - t[0] + 1 }, (e, n) => t[0] + n);
|
|
736
821
|
}) : null;
|
|
737
822
|
}
|
|
738
|
-
var
|
|
739
|
-
function
|
|
823
|
+
var lt = Symbol("highlighted-lines");
|
|
824
|
+
function ut(e = {}) {
|
|
740
825
|
let { className: t = "highlighted", zeroIndexed: n = !1 } = e;
|
|
741
826
|
return {
|
|
742
827
|
name: "@shikijs/transformers:meta-highlight",
|
|
743
828
|
line(e, r) {
|
|
744
829
|
if (!this.options.meta?.__raw) return;
|
|
745
830
|
let i = this.meta;
|
|
746
|
-
i[
|
|
747
|
-
let a = i[
|
|
831
|
+
i[lt] ??= ct(this.options.meta.__raw);
|
|
832
|
+
let a = i[lt] ?? [], o = n ? r - 1 : r;
|
|
748
833
|
return a.includes(o) && this.addClassToHast(e, t), e;
|
|
749
834
|
}
|
|
750
835
|
};
|
|
751
836
|
}
|
|
752
|
-
var
|
|
753
|
-
function
|
|
754
|
-
return e.replace(
|
|
837
|
+
var dt = /[.*+?^${}()|[\]\\]/g;
|
|
838
|
+
function ft(e) {
|
|
839
|
+
return e.replace(dt, "\\$&");
|
|
755
840
|
}
|
|
756
|
-
function
|
|
841
|
+
function V(e = {}, t = "@shikijs/transformers:notation-map") {
|
|
757
842
|
let { classMap: n = {}, classActivePre: r = void 0, classActiveCode: i = void 0 } = e;
|
|
758
|
-
return
|
|
843
|
+
return ot(t, RegExp(`#?\\s*\\[!code (${Object.keys(n).map(ft).join("|")})(:\\d+)?\\]`, "gi"), function([e, t, a = ":1"], o, s, c, l) {
|
|
759
844
|
let u = Number.parseInt(a.slice(1), 10);
|
|
760
845
|
for (let e = l; e < Math.min(l + u, c.length); e++) this.addClassToHast(c[e], n[t]);
|
|
761
846
|
return r && this.addClassToHast(this.pre, r), i && this.addClassToHast(this.code, i), !0;
|
|
762
847
|
}, e.matchAlgorithm);
|
|
763
848
|
}
|
|
764
|
-
function
|
|
849
|
+
function pt(e = {}) {
|
|
765
850
|
let { classLineAdd: t = "diff add", classLineRemove: n = "diff remove", classActivePre: r = "has-diff", classActiveCode: i } = e;
|
|
766
|
-
return
|
|
851
|
+
return V({
|
|
767
852
|
classMap: {
|
|
768
853
|
"++": t,
|
|
769
854
|
"--": n
|
|
@@ -773,31 +858,31 @@ function nt(e = {}) {
|
|
|
773
858
|
matchAlgorithm: e.matchAlgorithm
|
|
774
859
|
}, "@shikijs/transformers:notation-diff");
|
|
775
860
|
}
|
|
776
|
-
function
|
|
861
|
+
function mt(e = {}) {
|
|
777
862
|
let { classMap: t = {
|
|
778
863
|
error: ["highlighted", "error"],
|
|
779
864
|
warning: ["highlighted", "warning"],
|
|
780
865
|
info: ["highlighted", "info"]
|
|
781
866
|
}, classActivePre: n = "has-highlighted", classActiveCode: r } = e;
|
|
782
|
-
return
|
|
867
|
+
return V({
|
|
783
868
|
classMap: t,
|
|
784
869
|
classActivePre: n,
|
|
785
870
|
classActiveCode: r,
|
|
786
871
|
matchAlgorithm: e.matchAlgorithm
|
|
787
872
|
}, "@shikijs/transformers:notation-error-level");
|
|
788
873
|
}
|
|
789
|
-
function
|
|
874
|
+
function ht(e = {}) {
|
|
790
875
|
let { classActiveLine: t = "focused", classActivePre: n = "has-focused", classActiveCode: r } = e;
|
|
791
|
-
return
|
|
876
|
+
return V({
|
|
792
877
|
classMap: { focus: t },
|
|
793
878
|
classActivePre: n,
|
|
794
879
|
classActiveCode: r,
|
|
795
880
|
matchAlgorithm: e.matchAlgorithm
|
|
796
881
|
}, "@shikijs/transformers:notation-focus");
|
|
797
882
|
}
|
|
798
|
-
function
|
|
883
|
+
function gt(e = {}) {
|
|
799
884
|
let { classActiveLine: t = "highlighted", classActivePre: n = "has-highlighted", classActiveCode: r } = e;
|
|
800
|
-
return
|
|
885
|
+
return V({
|
|
801
886
|
classMap: {
|
|
802
887
|
highlight: t,
|
|
803
888
|
hl: t
|
|
@@ -809,42 +894,42 @@ function at(e = {}) {
|
|
|
809
894
|
}
|
|
810
895
|
//#endregion
|
|
811
896
|
//#region src/node/lib/render/highlight/language.ts
|
|
812
|
-
var
|
|
897
|
+
var _t = [
|
|
813
898
|
"shellscript",
|
|
814
899
|
"shell",
|
|
815
900
|
"bash",
|
|
816
901
|
"sh",
|
|
817
902
|
"zsh"
|
|
818
903
|
];
|
|
819
|
-
function
|
|
820
|
-
return
|
|
904
|
+
function vt(e) {
|
|
905
|
+
return _t.includes(e);
|
|
821
906
|
}
|
|
822
|
-
var
|
|
823
|
-
function
|
|
824
|
-
return
|
|
907
|
+
var yt = /^[a-zA-Z0-9-_]+/;
|
|
908
|
+
function bt(e) {
|
|
909
|
+
return yt.exec(e)?.[0] || "";
|
|
825
910
|
}
|
|
826
911
|
//#endregion
|
|
827
912
|
//#region src/node/lib/render/highlight/index.ts
|
|
828
|
-
var
|
|
913
|
+
var xt = new FinalizationRegistry((e) => {
|
|
829
914
|
e();
|
|
830
|
-
}),
|
|
915
|
+
}), H = {
|
|
831
916
|
light: "github-light",
|
|
832
917
|
dark: "github-dark"
|
|
833
918
|
};
|
|
834
|
-
async function
|
|
835
|
-
let e = await
|
|
836
|
-
themes: [
|
|
919
|
+
async function St() {
|
|
920
|
+
let e = await we({
|
|
921
|
+
themes: [H.light, H.dark],
|
|
837
922
|
langs: []
|
|
838
923
|
}), t = [
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
924
|
+
ut(),
|
|
925
|
+
pt(),
|
|
926
|
+
ht({
|
|
842
927
|
classActiveLine: "has-focus",
|
|
843
928
|
classActivePre: "has-focused-lines"
|
|
844
929
|
}),
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
930
|
+
gt(),
|
|
931
|
+
mt(),
|
|
932
|
+
Ct(),
|
|
848
933
|
{
|
|
849
934
|
name: "typedown:add-dir",
|
|
850
935
|
pre(e) {
|
|
@@ -853,19 +938,19 @@ async function dt() {
|
|
|
853
938
|
}
|
|
854
939
|
], n = new Set(e.getLoadedLanguages());
|
|
855
940
|
async function r(r, i, a) {
|
|
856
|
-
let o =
|
|
941
|
+
let o = bt(i);
|
|
857
942
|
if (o) {
|
|
858
943
|
let e = i;
|
|
859
944
|
i = o.toLowerCase(), a = e.slice(i.length).replace(/(?<!=)\{/g, " {") + " " + a, a = a.trim().replace(/\s+/g, " ");
|
|
860
945
|
}
|
|
861
946
|
i ||= "txt";
|
|
862
947
|
try {
|
|
863
|
-
!
|
|
948
|
+
!Ee(i) && !n.has(i) && (await e.loadLanguage(i), n.add(i));
|
|
864
949
|
} catch {
|
|
865
|
-
|
|
950
|
+
ae.warn(`\nThe language '${i}' is not loaded, falling back to 'txt' for syntax highlighting.`), i = "txt";
|
|
866
951
|
}
|
|
867
952
|
r = r.trimEnd();
|
|
868
|
-
let s =
|
|
953
|
+
let s = Te(r, i, e);
|
|
869
954
|
return await e.loadLanguage(...s), e.codeToHtml(r, {
|
|
870
955
|
lang: i,
|
|
871
956
|
transformers: [...t, {
|
|
@@ -882,7 +967,7 @@ async function dt() {
|
|
|
882
967
|
}
|
|
883
968
|
}],
|
|
884
969
|
meta: { __raw: a },
|
|
885
|
-
themes:
|
|
970
|
+
themes: H,
|
|
886
971
|
defaultColor: !1,
|
|
887
972
|
colorReplacements: {
|
|
888
973
|
"github-light": {
|
|
@@ -907,13 +992,13 @@ async function dt() {
|
|
|
907
992
|
}
|
|
908
993
|
});
|
|
909
994
|
}
|
|
910
|
-
return
|
|
995
|
+
return xt.register(r, () => e.dispose()), r;
|
|
911
996
|
}
|
|
912
|
-
function
|
|
997
|
+
function Ct() {
|
|
913
998
|
return {
|
|
914
999
|
name: "typedown:disable-shell-symbol-select",
|
|
915
1000
|
tokens(e) {
|
|
916
|
-
if (
|
|
1001
|
+
if (vt(this.options.lang)) for (let t of e) {
|
|
917
1002
|
if (t.length < 2) continue;
|
|
918
1003
|
let e = t[0].content.trim();
|
|
919
1004
|
(e === "$" || e === ">") && t[1].content[0] === " " && (t[0].content = e + " ", t[0].htmlStyle ??= {}, t[0].htmlStyle["user-select"] = "none", t[0].htmlStyle["-webkit-user-select"] = "none", t[1].content = t[1].content.slice(1));
|
|
@@ -923,23 +1008,23 @@ function ft() {
|
|
|
923
1008
|
}
|
|
924
1009
|
//#endregion
|
|
925
1010
|
//#region src/node/lib/render/postprocess.ts
|
|
926
|
-
var
|
|
927
|
-
async function
|
|
928
|
-
return e = await
|
|
1011
|
+
var wt;
|
|
1012
|
+
async function Tt(e) {
|
|
1013
|
+
return e = await Ot(e), e = Mt(e), e;
|
|
929
1014
|
}
|
|
930
|
-
function
|
|
931
|
-
return
|
|
1015
|
+
function Et() {
|
|
1016
|
+
return wt ||= St(), wt;
|
|
932
1017
|
}
|
|
933
|
-
var
|
|
1018
|
+
var Dt = /<pre class="td-code-placeholder"([^>]*)><code>([\s\S]*?)<\/code><\/pre>/g;
|
|
934
1019
|
function U(e, t) {
|
|
935
1020
|
return e.match(RegExp(`${t}="([^"]*)"`))?.[1];
|
|
936
1021
|
}
|
|
937
|
-
async function
|
|
938
|
-
let t = await
|
|
1022
|
+
async function Ot(e) {
|
|
1023
|
+
let t = await Et(), n = [...e.matchAll(Dt)];
|
|
939
1024
|
if (n.length === 0) return e;
|
|
940
1025
|
let r = await Promise.all(n.map(async (e) => {
|
|
941
1026
|
let n = e[1], r = U(n, "data-lang") ?? "", i = U(n, "data-meta") ?? "", a = U(n, "data-title"), o = U(n, "data-line-numbers"), s = g(e[2]);
|
|
942
|
-
return
|
|
1027
|
+
return kt(await t(s, r, i), r, {
|
|
943
1028
|
title: a,
|
|
944
1029
|
lineNumbers: o
|
|
945
1030
|
});
|
|
@@ -950,7 +1035,7 @@ async function gt(e) {
|
|
|
950
1035
|
}
|
|
951
1036
|
return i;
|
|
952
1037
|
}
|
|
953
|
-
function
|
|
1038
|
+
function kt(e, t, n) {
|
|
954
1039
|
t ||= "txt";
|
|
955
1040
|
let r = n.title ?? t.replace(/_/g, " "), i = ["language-" + t];
|
|
956
1041
|
n.title && i.push("has-title"), n.lineNumbers !== void 0 && i.push("line-numbers-mode");
|
|
@@ -961,17 +1046,17 @@ function _t(e, t, n) {
|
|
|
961
1046
|
}
|
|
962
1047
|
return a += "</div>", a;
|
|
963
1048
|
}
|
|
964
|
-
var
|
|
965
|
-
function
|
|
966
|
-
return e = e.replace(
|
|
1049
|
+
var At = /<span class="td-math-inline">([\s\S]*?)<\/span>/g, jt = /<div class="td-math-block">([\s\S]*?)<\/div>/g;
|
|
1050
|
+
function Mt(e) {
|
|
1051
|
+
return e = e.replace(At, (e, t) => Ft(t, !1)), e = e.replace(jt, (e, t) => Ft(t, !0)), e;
|
|
967
1052
|
}
|
|
968
|
-
var
|
|
969
|
-
function
|
|
1053
|
+
var Nt = /`([^`]+)`|\$([^$]+)\$/g;
|
|
1054
|
+
function Pt(e) {
|
|
970
1055
|
let t = 0, n = "";
|
|
971
|
-
for (let r of e.matchAll(
|
|
1056
|
+
for (let r of e.matchAll(Nt)) {
|
|
972
1057
|
if (n += h(e.slice(t, r.index)), r[1] !== void 0) n += `<code>${h(r[1])}</code>`;
|
|
973
1058
|
else if (r[2] !== void 0) try {
|
|
974
|
-
n +=
|
|
1059
|
+
n += ie.renderToString(r[2], { throwOnError: !1 });
|
|
975
1060
|
} catch {
|
|
976
1061
|
n += h(r[0]);
|
|
977
1062
|
}
|
|
@@ -979,10 +1064,10 @@ function St(e) {
|
|
|
979
1064
|
}
|
|
980
1065
|
return n += h(e.slice(t)), n;
|
|
981
1066
|
}
|
|
982
|
-
function
|
|
1067
|
+
function Ft(e, t) {
|
|
983
1068
|
let n = t ? "div" : "span";
|
|
984
1069
|
try {
|
|
985
|
-
return
|
|
1070
|
+
return ie.renderToString(g(e), {
|
|
986
1071
|
throwOnError: !1,
|
|
987
1072
|
displayMode: t
|
|
988
1073
|
});
|
|
@@ -992,24 +1077,24 @@ function W(e, t) {
|
|
|
992
1077
|
}
|
|
993
1078
|
//#endregion
|
|
994
1079
|
//#region src/node/lib/render/vue.ts
|
|
995
|
-
async function
|
|
996
|
-
let r = t.title || t.label || (m(n) ?
|
|
1080
|
+
async function W(e, t, n) {
|
|
1081
|
+
let r = t.title || t.label || (m(n) ? S(n, (await e.getConfig()).siteTitle) : w(n));
|
|
997
1082
|
return {
|
|
998
1083
|
schema: t.schema,
|
|
999
1084
|
schemaLabel: t.schemaLabel,
|
|
1000
1085
|
label: t.label,
|
|
1001
1086
|
icon: t.icon,
|
|
1002
1087
|
frontmatter: t.header ?? {},
|
|
1003
|
-
headings:
|
|
1088
|
+
headings: Lt(t.headings),
|
|
1004
1089
|
title: r,
|
|
1005
|
-
titleHtml:
|
|
1090
|
+
titleHtml: Pt(r),
|
|
1006
1091
|
filepath: n,
|
|
1007
1092
|
fileMetadata: t.fileMetadata,
|
|
1008
1093
|
seoMetadata: t.seoMetadata
|
|
1009
1094
|
};
|
|
1010
1095
|
}
|
|
1011
|
-
async function
|
|
1012
|
-
let r = await
|
|
1096
|
+
async function It(e, t, n) {
|
|
1097
|
+
let r = await Tt(t.content), i = await W(e, t, n), a = JSON.stringify(`@typedown/pages?resource=${encodeURIComponent(n)}`);
|
|
1013
1098
|
return {
|
|
1014
1099
|
vueSrc: [
|
|
1015
1100
|
"<script>",
|
|
@@ -1021,12 +1106,12 @@ async function Ct(e, t, n) {
|
|
|
1021
1106
|
`import { pageData } from ${a}`,
|
|
1022
1107
|
"useRouter().route.data = pageData",
|
|
1023
1108
|
"<\/script>",
|
|
1024
|
-
`<template><div class="typedown-content">\n${
|
|
1109
|
+
`<template><div class="typedown-content">\n${Rt(r)}\n</div></template>`
|
|
1025
1110
|
].join("\n"),
|
|
1026
1111
|
pageData: i
|
|
1027
1112
|
};
|
|
1028
1113
|
}
|
|
1029
|
-
function
|
|
1114
|
+
function Lt(e) {
|
|
1030
1115
|
let t = [], n = [];
|
|
1031
1116
|
for (let r of e) {
|
|
1032
1117
|
let e = {
|
|
@@ -1042,17 +1127,17 @@ function wt(e) {
|
|
|
1042
1127
|
}
|
|
1043
1128
|
return t;
|
|
1044
1129
|
}
|
|
1045
|
-
function
|
|
1130
|
+
function Rt(e) {
|
|
1046
1131
|
return e.replaceAll("{{", "{{").replaceAll("}}", "}}");
|
|
1047
1132
|
}
|
|
1048
1133
|
//#endregion
|
|
1049
1134
|
//#region src/node/plugin/vite/constants.ts
|
|
1050
|
-
var
|
|
1051
|
-
|
|
1052
|
-
var
|
|
1135
|
+
var zt = "@typedown/app", Bt = "\0@typedown/app", G = "@typedown/pages", Vt = "\0" + G;
|
|
1136
|
+
G + "";
|
|
1137
|
+
var K = "\0@typedown/pages?resource=", q = "@typedown/site-data", Ht = "\0@typedown/site-data", J = "@typedown/search-index", Ut = "\0@typedown/search-index", Y = "@typedown/theme", Wt = "\0@typedown/theme", X = "typedown:page-data";
|
|
1053
1138
|
//#endregion
|
|
1054
1139
|
//#region src/node/plugin/vite/virtual/utils.ts
|
|
1055
|
-
function
|
|
1140
|
+
function Z(e, t) {
|
|
1056
1141
|
let n = e.moduleGraph.getModuleById(t);
|
|
1057
1142
|
if (n) {
|
|
1058
1143
|
e.moduleGraph.invalidateModule(n);
|
|
@@ -1069,10 +1154,10 @@ function Q(e, t) {
|
|
|
1069
1154
|
}
|
|
1070
1155
|
//#endregion
|
|
1071
1156
|
//#region src/node/plugin/vite/virtual/app.ts
|
|
1072
|
-
var
|
|
1157
|
+
var Gt = class {
|
|
1073
1158
|
async load(e) {
|
|
1074
|
-
let t = await (await e.getTdContext()).getConfig(), n = await
|
|
1075
|
-
return
|
|
1159
|
+
let t = await (await e.getTdContext()).getConfig(), n = await I(t.components, e.root);
|
|
1160
|
+
return Re({
|
|
1076
1161
|
rootDir: t.rootDir,
|
|
1077
1162
|
basePath: t.basePath,
|
|
1078
1163
|
origin: t.origin ?? void 0,
|
|
@@ -1085,17 +1170,17 @@ var Mt = class {
|
|
|
1085
1170
|
nav: t.nav,
|
|
1086
1171
|
userComponents: n
|
|
1087
1172
|
}, {
|
|
1088
|
-
theme:
|
|
1089
|
-
pages:
|
|
1090
|
-
siteData:
|
|
1091
|
-
searchIndex:
|
|
1092
|
-
pageDataEvent:
|
|
1173
|
+
theme: Y,
|
|
1174
|
+
pages: G,
|
|
1175
|
+
siteData: q,
|
|
1176
|
+
searchIndex: J,
|
|
1177
|
+
pageDataEvent: X
|
|
1093
1178
|
});
|
|
1094
1179
|
}
|
|
1095
1180
|
invalidate(e) {
|
|
1096
|
-
|
|
1181
|
+
Z(e, Bt);
|
|
1097
1182
|
}
|
|
1098
|
-
},
|
|
1183
|
+
}, Kt = class {
|
|
1099
1184
|
async load(e) {
|
|
1100
1185
|
let t = (await e.getConfig()).rootDir ?? ".";
|
|
1101
1186
|
return `export const pages = import.meta.glob('${t === "." ? "/**/*.{td,md}" : `/${t}/**/*.{td,md}`}');`;
|
|
@@ -1104,21 +1189,21 @@ var Mt = class {
|
|
|
1104
1189
|
if (e.startsWith("@typedown/pages?resource=")) return "\0" + e;
|
|
1105
1190
|
}
|
|
1106
1191
|
isPageDataModule(e) {
|
|
1107
|
-
return e.startsWith(
|
|
1192
|
+
return e.startsWith(K);
|
|
1108
1193
|
}
|
|
1109
1194
|
async loadPageData(e, t) {
|
|
1110
|
-
let n = decodeURIComponent(e.slice(
|
|
1195
|
+
let n = decodeURIComponent(e.slice(K.length)), r = await W(t, await t.getFile(n), n);
|
|
1111
1196
|
return `export const pageData = ${JSON.stringify(r)}`;
|
|
1112
1197
|
}
|
|
1113
1198
|
invalidatePageData(e, t) {
|
|
1114
|
-
|
|
1199
|
+
Z(e, K + encodeURIComponent(t));
|
|
1115
1200
|
}
|
|
1116
1201
|
sendPageData(e, t, n) {
|
|
1117
1202
|
t.getFile(n).then(async (r) => {
|
|
1118
|
-
let i = await
|
|
1203
|
+
let i = await W(t, r, n);
|
|
1119
1204
|
e.hot.send({
|
|
1120
1205
|
type: "custom",
|
|
1121
|
-
event:
|
|
1206
|
+
event: X,
|
|
1122
1207
|
data: {
|
|
1123
1208
|
filepath: n,
|
|
1124
1209
|
pageData: i
|
|
@@ -1129,62 +1214,62 @@ var Mt = class {
|
|
|
1129
1214
|
});
|
|
1130
1215
|
}
|
|
1131
1216
|
invalidate(e) {
|
|
1132
|
-
|
|
1217
|
+
Z(e, Vt);
|
|
1133
1218
|
}
|
|
1134
|
-
},
|
|
1219
|
+
}, qt = class {
|
|
1135
1220
|
async load(e) {
|
|
1136
|
-
return
|
|
1221
|
+
return ze((await (await e.getTdContext()).getConfig()).layout ?? void 0, e.root);
|
|
1137
1222
|
}
|
|
1138
1223
|
invalidate(e) {
|
|
1139
|
-
|
|
1224
|
+
Z(e, Wt);
|
|
1140
1225
|
}
|
|
1141
|
-
},
|
|
1226
|
+
}, Jt = "\0@typedown/site-data", Yt = {
|
|
1142
1227
|
ready: !1,
|
|
1143
1228
|
contentTree: { entries: [] },
|
|
1144
1229
|
schemas: {},
|
|
1145
1230
|
directoryListings: {}
|
|
1146
|
-
},
|
|
1231
|
+
}, Xt = class {
|
|
1147
1232
|
data;
|
|
1148
1233
|
scan(e) {
|
|
1149
|
-
let t =
|
|
1234
|
+
let t = ye("**/*.td", {
|
|
1150
1235
|
cwd: e,
|
|
1151
1236
|
exclude: (e) => e.startsWith("_")
|
|
1152
1237
|
}).map((e) => ({
|
|
1153
1238
|
filepath: e,
|
|
1154
|
-
label:
|
|
1239
|
+
label: w(e),
|
|
1155
1240
|
header: {}
|
|
1156
|
-
})), n =
|
|
1241
|
+
})), n = y(t);
|
|
1157
1242
|
this.data = {
|
|
1158
1243
|
contentTree: n,
|
|
1159
1244
|
schemas: {},
|
|
1160
|
-
directoryListings:
|
|
1245
|
+
directoryListings: v(n.entries, "")
|
|
1161
1246
|
};
|
|
1162
1247
|
}
|
|
1163
1248
|
load(e) {
|
|
1164
1249
|
let t = this.data ? {
|
|
1165
1250
|
ready: !0,
|
|
1166
1251
|
...this.data
|
|
1167
|
-
} :
|
|
1252
|
+
} : Yt;
|
|
1168
1253
|
return `export default ${JSON.stringify(t)}`;
|
|
1169
1254
|
}
|
|
1170
1255
|
clear() {
|
|
1171
1256
|
this.data = void 0;
|
|
1172
1257
|
}
|
|
1173
|
-
fetch =
|
|
1174
|
-
|
|
1258
|
+
fetch = x((e, t) => {
|
|
1259
|
+
Q(e).then((e) => {
|
|
1175
1260
|
this.data = e, t && this.invalidate(t);
|
|
1176
1261
|
}).catch((e) => {
|
|
1177
1262
|
console.error("[typedown] Failed to fetch site data:", e instanceof Error ? e.message : e);
|
|
1178
1263
|
});
|
|
1179
1264
|
}, 200);
|
|
1180
1265
|
async fetchSync(e) {
|
|
1181
|
-
this.data = await
|
|
1266
|
+
this.data = await Q(e);
|
|
1182
1267
|
}
|
|
1183
1268
|
invalidate(e) {
|
|
1184
|
-
|
|
1269
|
+
Z(e, Jt);
|
|
1185
1270
|
}
|
|
1186
1271
|
};
|
|
1187
|
-
async function
|
|
1272
|
+
async function Q(e) {
|
|
1188
1273
|
let [t, n, r] = await Promise.all([
|
|
1189
1274
|
e.getConfig(),
|
|
1190
1275
|
e.listSidebar(),
|
|
@@ -1192,21 +1277,21 @@ async function Rt(e) {
|
|
|
1192
1277
|
]), i = await Promise.all(r.map(async (t) => [t, (await e.getSchema(t)).properties])), a = Object.fromEntries(i), o = n.map((e) => ({
|
|
1193
1278
|
...e,
|
|
1194
1279
|
header: {}
|
|
1195
|
-
})), s =
|
|
1280
|
+
})), s = y(o);
|
|
1196
1281
|
return {
|
|
1197
1282
|
contentTree: s,
|
|
1198
1283
|
schemas: a,
|
|
1199
|
-
directoryListings:
|
|
1284
|
+
directoryListings: v(s.entries, t.siteTitle)
|
|
1200
1285
|
};
|
|
1201
1286
|
}
|
|
1202
1287
|
//#endregion
|
|
1203
1288
|
//#region src/node/lib/search-indexer/index.ts
|
|
1204
|
-
var
|
|
1289
|
+
var Zt = class {
|
|
1205
1290
|
index;
|
|
1206
1291
|
constructor() {
|
|
1207
|
-
this.index = new
|
|
1208
|
-
fields:
|
|
1209
|
-
storeFields:
|
|
1292
|
+
this.index = new le({
|
|
1293
|
+
fields: e,
|
|
1294
|
+
storeFields: _
|
|
1210
1295
|
});
|
|
1211
1296
|
}
|
|
1212
1297
|
addAll(e) {
|
|
@@ -1225,20 +1310,20 @@ var zt = class {
|
|
|
1225
1310
|
};
|
|
1226
1311
|
//#endregion
|
|
1227
1312
|
//#region src/node/lib/search-indexer/scan.ts
|
|
1228
|
-
function
|
|
1229
|
-
let n =
|
|
1313
|
+
function Qt(e, t) {
|
|
1314
|
+
let n = nn(e), r = [];
|
|
1230
1315
|
for (let t of n) {
|
|
1231
|
-
let n =
|
|
1316
|
+
let n = tn(e, t);
|
|
1232
1317
|
n && r.push(n);
|
|
1233
1318
|
}
|
|
1234
1319
|
t.addAll(r);
|
|
1235
1320
|
}
|
|
1236
|
-
function
|
|
1237
|
-
let i =
|
|
1238
|
-
i ? r.addPage(i) : r.discardPage(t
|
|
1321
|
+
function $t(e, t, r) {
|
|
1322
|
+
let i = tn(e, A(e, t));
|
|
1323
|
+
i ? r.addPage(i) : r.discardPage(n(t));
|
|
1239
1324
|
}
|
|
1240
|
-
function
|
|
1241
|
-
let n =
|
|
1325
|
+
function en(e, t) {
|
|
1326
|
+
let n = w(e);
|
|
1242
1327
|
if (!t.startsWith("---")) return {
|
|
1243
1328
|
title: n,
|
|
1244
1329
|
body: t
|
|
@@ -1254,56 +1339,56 @@ function Ht(e, t) {
|
|
|
1254
1339
|
body: a
|
|
1255
1340
|
};
|
|
1256
1341
|
}
|
|
1257
|
-
function
|
|
1342
|
+
function tn(e, t) {
|
|
1258
1343
|
let r;
|
|
1259
1344
|
try {
|
|
1260
|
-
r =
|
|
1345
|
+
r = be(t, "utf-8");
|
|
1261
1346
|
} catch {
|
|
1262
1347
|
return;
|
|
1263
1348
|
}
|
|
1264
1349
|
if (!r.trim()) return;
|
|
1265
|
-
let i =
|
|
1350
|
+
let i = t.slice(e.length + 1), { title: a, body: o } = en(i, r);
|
|
1266
1351
|
return {
|
|
1267
|
-
id:
|
|
1352
|
+
id: n(i),
|
|
1268
1353
|
title: a,
|
|
1269
1354
|
text: `${a}\n${o}`
|
|
1270
1355
|
};
|
|
1271
1356
|
}
|
|
1272
|
-
function
|
|
1273
|
-
return
|
|
1357
|
+
function nn(e) {
|
|
1358
|
+
return ye("**/*.td", {
|
|
1274
1359
|
cwd: e,
|
|
1275
1360
|
exclude: (e) => e.startsWith("_")
|
|
1276
|
-
}).map((t) =>
|
|
1361
|
+
}).map((t) => A(e, t));
|
|
1277
1362
|
}
|
|
1278
1363
|
//#endregion
|
|
1279
1364
|
//#region src/node/plugin/vite/virtual/search-index.ts
|
|
1280
|
-
var
|
|
1281
|
-
indexer = new
|
|
1365
|
+
var rn = "\0@typedown/search-index", an = class {
|
|
1366
|
+
indexer = new Zt();
|
|
1282
1367
|
load(e) {
|
|
1283
1368
|
return `export default ${JSON.stringify(this.indexer.serialize())}`;
|
|
1284
1369
|
}
|
|
1285
1370
|
index(e) {
|
|
1286
|
-
|
|
1371
|
+
Qt(e, this.indexer);
|
|
1287
1372
|
}
|
|
1288
1373
|
reindex(e, t) {
|
|
1289
|
-
|
|
1374
|
+
$t(e, t, this.indexer);
|
|
1290
1375
|
}
|
|
1291
1376
|
invalidate(e) {
|
|
1292
|
-
|
|
1377
|
+
Z(e, rn);
|
|
1293
1378
|
}
|
|
1294
|
-
},
|
|
1295
|
-
function
|
|
1379
|
+
}, on = De(import.meta.url);
|
|
1380
|
+
function sn() {
|
|
1296
1381
|
return [{
|
|
1297
1382
|
find: "vue/server-renderer",
|
|
1298
|
-
replacement:
|
|
1383
|
+
replacement: on.resolve("vue/server-renderer")
|
|
1299
1384
|
}, {
|
|
1300
1385
|
find: "vue",
|
|
1301
|
-
replacement:
|
|
1386
|
+
replacement: on.resolve("vue/dist/vue.runtime.esm-bundler.js")
|
|
1302
1387
|
}];
|
|
1303
1388
|
}
|
|
1304
1389
|
//#endregion
|
|
1305
1390
|
//#region src/node/plugin/vite/middleware/vault-assets.ts
|
|
1306
|
-
var
|
|
1391
|
+
var cn = {
|
|
1307
1392
|
jpg: "image/jpeg",
|
|
1308
1393
|
jpeg: "image/jpeg",
|
|
1309
1394
|
png: "image/png",
|
|
@@ -1321,50 +1406,91 @@ var Yt = {
|
|
|
1321
1406
|
woff: "font/woff",
|
|
1322
1407
|
ttf: "font/ttf"
|
|
1323
1408
|
};
|
|
1324
|
-
function
|
|
1325
|
-
return (i, a,
|
|
1326
|
-
if (!i.url || i.method !== "GET" || a.writableEnded) return
|
|
1327
|
-
let c =
|
|
1328
|
-
if (c.startsWith("/@") || c.startsWith("/node_modules")) return
|
|
1329
|
-
let l = n
|
|
1330
|
-
if (
|
|
1331
|
-
let e =
|
|
1409
|
+
function ln(e, n) {
|
|
1410
|
+
return (i, a, o) => {
|
|
1411
|
+
if (!i.url || i.method !== "GET" || a.writableEnded) return o();
|
|
1412
|
+
let c = t(i.url);
|
|
1413
|
+
if (c.startsWith("/@") || c.startsWith("/node_modules")) return o();
|
|
1414
|
+
let l = r(n.basePath), u = (l && c.startsWith(l) ? c.slice(l.length) : c).replace(/^\//, ""), d = A(e.config.root, n.rootDirectory, u);
|
|
1415
|
+
if (ve(d)) try {
|
|
1416
|
+
let e = xe(d);
|
|
1332
1417
|
if (e.isFile()) {
|
|
1333
|
-
let t =
|
|
1334
|
-
a.setHeader("Content-Type", t), a.setHeader("Content-Length", e.size),
|
|
1418
|
+
let t = cn[s(d).slice(1).toLowerCase()] ?? "application/octet-stream";
|
|
1419
|
+
a.setHeader("Content-Type", t), a.setHeader("Content-Length", e.size), _e(d).pipe(a);
|
|
1335
1420
|
return;
|
|
1336
1421
|
}
|
|
1337
1422
|
} catch {}
|
|
1338
|
-
|
|
1423
|
+
o();
|
|
1339
1424
|
};
|
|
1340
1425
|
}
|
|
1341
1426
|
//#endregion
|
|
1342
1427
|
//#region src/node/plugin/vite/middleware/virtual-html.ts
|
|
1343
|
-
function
|
|
1428
|
+
function un(e, n, i) {
|
|
1344
1429
|
return (a, o, s) => {
|
|
1345
1430
|
if (!a.url) return s();
|
|
1346
|
-
let c =
|
|
1431
|
+
let c = r(t(a.url)), l = r(i.basePath);
|
|
1347
1432
|
if (c.startsWith("/@") || c.startsWith("/node_modules") || !c.startsWith(l)) return s();
|
|
1348
1433
|
let u = c.slice(l.length);
|
|
1349
1434
|
if (u.startsWith("/@") || u.startsWith("/node_modules") || c.includes(".") && !c.endsWith("/index.html")) return s();
|
|
1350
|
-
|
|
1351
|
-
let n = await
|
|
1435
|
+
n.getConfig().then(async (t) => {
|
|
1436
|
+
let n = await e.transformIndexHtml(a.url ?? "", dn(i, t));
|
|
1352
1437
|
o.setHeader("Content-Type", "text/html"), o.end(n);
|
|
1353
1438
|
}).catch(() => s());
|
|
1354
1439
|
};
|
|
1355
1440
|
}
|
|
1356
|
-
function
|
|
1357
|
-
return e.devHtml === void 0 && (e.devHtml =
|
|
1441
|
+
function dn(e, t) {
|
|
1442
|
+
return e.devHtml === void 0 && (e.devHtml = ne({
|
|
1358
1443
|
title: t.siteTitle,
|
|
1359
1444
|
description: t.siteDescription,
|
|
1360
1445
|
base: "/",
|
|
1361
|
-
entryScript:
|
|
1446
|
+
entryScript: zt
|
|
1362
1447
|
})), e.devHtml;
|
|
1363
1448
|
}
|
|
1364
1449
|
//#endregion
|
|
1450
|
+
//#region src/node/plugin/vite/subplugins/component-contract.ts
|
|
1451
|
+
var fn = ".typedown/components.json";
|
|
1452
|
+
function pn(e) {
|
|
1453
|
+
return {
|
|
1454
|
+
name: "vite-plugin-typedown-component-contract",
|
|
1455
|
+
async buildStart() {
|
|
1456
|
+
let t = e();
|
|
1457
|
+
if (!t) return;
|
|
1458
|
+
let n = await I((await (await t.getTdContext()).getConfig()).components, t.root);
|
|
1459
|
+
$(t.root, n);
|
|
1460
|
+
},
|
|
1461
|
+
configureServer(t) {
|
|
1462
|
+
let n = e();
|
|
1463
|
+
n && n.getTdContext().then(async (e) => {
|
|
1464
|
+
let r = await e.getConfig(), i = await I(r.components, n.root);
|
|
1465
|
+
$(n.root, i), mn(t, r.components, n.root);
|
|
1466
|
+
}).catch(() => {});
|
|
1467
|
+
}
|
|
1468
|
+
};
|
|
1469
|
+
}
|
|
1470
|
+
function mn(e, t, n) {
|
|
1471
|
+
let r = new Set(t.filter((e) => e.kind === "explicit").map((e) => M(k.resolve(n, e.source)))), i = new Set(t.filter((e) => e.kind === "dir").map((e) => M(k.resolve(n, e.path))));
|
|
1472
|
+
for (let t of i) e.watcher.add(t);
|
|
1473
|
+
let a = (a) => {
|
|
1474
|
+
hn(a, r, i) && (e.config.logger.info("[typedown] component changed, rebuilding contract..."), I(t, n).then((e) => $(n, e)).catch(() => {}));
|
|
1475
|
+
};
|
|
1476
|
+
e.watcher.on("change", a), e.watcher.on("add", a), e.watcher.on("unlink", a);
|
|
1477
|
+
}
|
|
1478
|
+
function hn(e, t, n) {
|
|
1479
|
+
if (!e.endsWith(".vue")) return !1;
|
|
1480
|
+
let r = M(e);
|
|
1481
|
+
if (t.has(r)) return !0;
|
|
1482
|
+
for (let e of n) if (r.startsWith(e + "/")) return !0;
|
|
1483
|
+
return !1;
|
|
1484
|
+
}
|
|
1485
|
+
function $(e, t) {
|
|
1486
|
+
if (t.length === 0) return;
|
|
1487
|
+
let n = Be(t, e), r = k.join(e, fn);
|
|
1488
|
+
P.mkdirSync(k.dirname(r), { recursive: !0 }), P.writeFileSync(r, JSON.stringify(n, null, 2));
|
|
1489
|
+
}
|
|
1490
|
+
//#endregion
|
|
1365
1491
|
//#region src/node/plugin/vite/index.ts
|
|
1366
|
-
function
|
|
1367
|
-
let t = e.context, n, r,
|
|
1492
|
+
function gn(e = {}) {
|
|
1493
|
+
let t = e.context, n, r, i, o = new Gt(), s = new qt(), c = new Kt(), u = new Xt(), d = new an(), f = {
|
|
1368
1494
|
devHtml: void 0,
|
|
1369
1495
|
basePath: "/",
|
|
1370
1496
|
rootDirectory: "vault"
|
|
@@ -1373,158 +1499,160 @@ function $t(e = {}) {
|
|
|
1373
1499
|
if (t === void 0) throw Error("typedown plugin not initialized");
|
|
1374
1500
|
return t.getTdContext();
|
|
1375
1501
|
}
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
c.invalidatePageData(n, i);
|
|
1449
|
-
}
|
|
1502
|
+
let m = {
|
|
1503
|
+
name: "vite-plugin-typedown",
|
|
1504
|
+
enforce: "pre",
|
|
1505
|
+
async config(n) {
|
|
1506
|
+
if (!t) {
|
|
1507
|
+
let r = e.root ? A(n.root ?? process.cwd(), e.root) : ce(n.root ?? process.cwd());
|
|
1508
|
+
t = se(r);
|
|
1509
|
+
}
|
|
1510
|
+
i = n.base ?? "/";
|
|
1511
|
+
let r = await (await p()).getConfig();
|
|
1512
|
+
return {
|
|
1513
|
+
base: n.base ?? r.basePath,
|
|
1514
|
+
publicDir: r.publicDir,
|
|
1515
|
+
server: {
|
|
1516
|
+
port: n.server?.port ?? 8686,
|
|
1517
|
+
strictPort: n.server?.strictPort ?? !1
|
|
1518
|
+
},
|
|
1519
|
+
resolve: { alias: sn() },
|
|
1520
|
+
ssr: { noExternal: ["typerighter"] }
|
|
1521
|
+
};
|
|
1522
|
+
},
|
|
1523
|
+
configResolved(e) {
|
|
1524
|
+
r = A(e.root, e.build.outDir);
|
|
1525
|
+
},
|
|
1526
|
+
async buildStart() {
|
|
1527
|
+
if (n) return;
|
|
1528
|
+
let e = await p(), t = await e.getConfig(), r = A(t.rootDir);
|
|
1529
|
+
d.index(r), await u.fetchSync(e);
|
|
1530
|
+
let i = await e.checkVault();
|
|
1531
|
+
if (xn(i.diagnostics), 0 < i.errorCount) {
|
|
1532
|
+
let e = i.diagnostics.filter((e) => e.severity === "error").map((e) => ` ${e.filepath}:${e.line}:${e.column} - ${e.message} (${e.code})`);
|
|
1533
|
+
this.error(`Vault check failed with ${i.errorCount} error(s):\n${e.join("\n")}`);
|
|
1534
|
+
}
|
|
1535
|
+
},
|
|
1536
|
+
resolveId(e) {
|
|
1537
|
+
if (e === "/@typedown/app" || e === "@typedown/app") return Bt;
|
|
1538
|
+
if (e === "@typedown/pages") return Vt;
|
|
1539
|
+
if (e.startsWith("@typedown/pages?resource=")) return c.resolvePageData(e);
|
|
1540
|
+
if (e === "@typedown/site-data") return Ht;
|
|
1541
|
+
if (e === "@typedown/search-index") return Ut;
|
|
1542
|
+
if (e === "@typedown/theme") return Wt;
|
|
1543
|
+
},
|
|
1544
|
+
async load(e) {
|
|
1545
|
+
if (c.isPageDataModule(e)) return c.loadPageData(e, await p());
|
|
1546
|
+
if (e !== "\0@typedown/search-index" && e !== "\0@typedown/site-data" && e !== "\0@typedown/pages" && e !== "\0@typedown/app" && e !== "\0@typedown/theme") return;
|
|
1547
|
+
let n = await p();
|
|
1548
|
+
if (e === "\0@typedown/search-index") return d.load(n);
|
|
1549
|
+
if (e === "\0@typedown/site-data") return u.load(n);
|
|
1550
|
+
if (e === "\0@typedown/pages") return c.load(n);
|
|
1551
|
+
if (e === "\0@typedown/app") return o.load(t);
|
|
1552
|
+
if (e === "\0@typedown/theme") return s.load(t);
|
|
1553
|
+
},
|
|
1554
|
+
async configureServer(e) {
|
|
1555
|
+
n = e;
|
|
1556
|
+
let t = await p(), r = await t.getConfig(), i = A(r.rootDir);
|
|
1557
|
+
d.index(i), u.scan(i), u.fetch(t, n), e.httpServer?.once("listening", async () => {
|
|
1558
|
+
let e = await t.checkVault();
|
|
1559
|
+
0 < e.diagnostics.length && (console.error(""), xn(e.diagnostics));
|
|
1560
|
+
}), t.rpc.onConfigChanged(() => {
|
|
1561
|
+
n && (f.devHtml = void 0, u.clear(), o.invalidate(n), s.invalidate(n), c.invalidate(n), vn(n), u.fetch(t, n));
|
|
1562
|
+
}), t.rpc.onComponentContractChanged(() => {
|
|
1563
|
+
n && (o.invalidate(n), vn(n));
|
|
1564
|
+
});
|
|
1565
|
+
function a(...e) {
|
|
1566
|
+
n && t.getConfig().then((t) => {
|
|
1567
|
+
if (!n) return;
|
|
1568
|
+
let r = [];
|
|
1569
|
+
for (let i of e) {
|
|
1570
|
+
let e = M(A(n.config.root, t.rootDir, i)), a = n.moduleGraph.getModulesByFile(e);
|
|
1571
|
+
if (a?.size) {
|
|
1572
|
+
for (let e of a) n.moduleGraph.invalidateModule(e), r.push(bn(e));
|
|
1573
|
+
c.invalidatePageData(n, i);
|
|
1450
1574
|
}
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
})
|
|
1456
|
-
}
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
},
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1575
|
+
}
|
|
1576
|
+
0 < r.length && n.hot.send({
|
|
1577
|
+
type: "update",
|
|
1578
|
+
updates: r
|
|
1579
|
+
});
|
|
1580
|
+
}).catch(() => {});
|
|
1581
|
+
}
|
|
1582
|
+
t.rpc.onContentUpdated(({ filepath: e, affectedFiles: r = [] }) => {
|
|
1583
|
+
n && (d.reindex(i, e), d.invalidate(n), c.invalidate(n), u.fetch(t, n), a(e, ...r), c.sendPageData(n, t, e));
|
|
1584
|
+
}), t.rpc.onContentDeleted(({ filepath: e }) => {
|
|
1585
|
+
n && (d.reindex(i, e), d.invalidate(n), c.invalidate(n), u.fetch(t, n), a(e));
|
|
1586
|
+
});
|
|
1587
|
+
function l() {
|
|
1588
|
+
n && (u.clear(), yn(n), u.fetch(t, n));
|
|
1589
|
+
}
|
|
1590
|
+
t.rpc.onSchemaUpdated(l), t.rpc.onSchemaDeleted(l);
|
|
1591
|
+
let m = await t.getConfig();
|
|
1592
|
+
f.basePath = m.basePath, f.rootDirectory = m.rootDir, t.rpc.onConfigChanged((e) => {
|
|
1593
|
+
f.basePath = e.basePath, f.rootDirectory = e.rootDir, f.devHtml = void 0;
|
|
1594
|
+
}), e.middlewares.use(ln(e, f)), e.middlewares.use(un(e, t, f));
|
|
1595
|
+
},
|
|
1596
|
+
async transform(e, t) {
|
|
1597
|
+
let n = t.split("?")[0];
|
|
1598
|
+
if (!l(n)) return;
|
|
1599
|
+
if (T(n)) return {
|
|
1600
|
+
code: `<script>import theme from '${Y}'; import { TdNotFound } from 'typerighter/client/theme-default'; export default theme.NotFound || TdNotFound; export const pageData = { frontmatter: {}, headings: [], title: '' };<\/script>`,
|
|
1601
|
+
map: null
|
|
1602
|
+
};
|
|
1603
|
+
let r = await p(), i = await r.getConfig(), o = a(n, i.rootDir);
|
|
1604
|
+
try {
|
|
1605
|
+
let { vueSrc: e } = await It(r, await r.getFile(o), o);
|
|
1606
|
+
return {
|
|
1607
|
+
code: e,
|
|
1476
1608
|
map: null
|
|
1477
1609
|
};
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
code: e,
|
|
1483
|
-
map: null
|
|
1484
|
-
};
|
|
1485
|
-
} catch (e) {
|
|
1486
|
-
if (ie(e)) return;
|
|
1487
|
-
let t = e instanceof Error ? e.message : String(e);
|
|
1488
|
-
this.error(`[typedown] Failed to transform ${o}: ${t}`);
|
|
1489
|
-
}
|
|
1490
|
-
},
|
|
1491
|
-
handleHotUpdate({ file: e }) {
|
|
1492
|
-
if (l(e)) return [];
|
|
1493
|
-
},
|
|
1494
|
-
async closeBundle() {
|
|
1495
|
-
if (!e.context && t) try {
|
|
1496
|
-
let e = (await (await t.getTdContext()).getConfig()).basePath, n = e.startsWith(a) ? e.slice(a.length) : e.replace(/^\//, "");
|
|
1497
|
-
await Le(t, {
|
|
1498
|
-
outDir: j(r, n),
|
|
1499
|
-
base: e
|
|
1500
|
-
});
|
|
1501
|
-
} finally {
|
|
1502
|
-
t.dispose();
|
|
1503
|
-
}
|
|
1610
|
+
} catch (e) {
|
|
1611
|
+
if (oe(e)) return;
|
|
1612
|
+
let t = e instanceof Error ? e.message : String(e);
|
|
1613
|
+
this.error(`[typedown] Failed to transform ${o}: ${t}`);
|
|
1504
1614
|
}
|
|
1505
1615
|
},
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1616
|
+
handleHotUpdate({ file: e }) {
|
|
1617
|
+
if (l(e)) return [];
|
|
1618
|
+
},
|
|
1619
|
+
async closeBundle() {
|
|
1620
|
+
if (!e.context && t) try {
|
|
1621
|
+
let e = (await (await t.getTdContext()).getConfig()).basePath, n = e.startsWith(i) ? e.slice(i.length) : e.replace(/^\//, "");
|
|
1622
|
+
await Je(t, {
|
|
1623
|
+
outDir: A(r, n),
|
|
1624
|
+
base: e
|
|
1625
|
+
});
|
|
1626
|
+
} finally {
|
|
1627
|
+
t.dispose();
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1630
|
+
}, h = de({
|
|
1631
|
+
include: e.root ? RegExp(`${e.root.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}/.*\\.(?:vue|td)$`) : /\.(?:vue|td)$/,
|
|
1632
|
+
template: { transformAssetUrls: !1 }
|
|
1633
|
+
});
|
|
1634
|
+
return [
|
|
1635
|
+
m,
|
|
1636
|
+
pn(() => t),
|
|
1637
|
+
h,
|
|
1638
|
+
...ue()
|
|
1511
1639
|
];
|
|
1512
1640
|
}
|
|
1513
|
-
function
|
|
1641
|
+
function _n(e) {
|
|
1514
1642
|
return [...e.moduleGraph.idToModuleMap.entries()].filter(([e]) => e.endsWith(".td")).map(([, e]) => e);
|
|
1515
1643
|
}
|
|
1516
|
-
function
|
|
1517
|
-
for (let t of
|
|
1644
|
+
function vn(e) {
|
|
1645
|
+
for (let t of _n(e)) e.moduleGraph.invalidateModule(t);
|
|
1518
1646
|
e.hot.send({ type: "full-reload" });
|
|
1519
1647
|
}
|
|
1520
|
-
function
|
|
1521
|
-
let t =
|
|
1648
|
+
function yn(e) {
|
|
1649
|
+
let t = _n(e).map((t) => (e.moduleGraph.invalidateModule(t), bn(t)));
|
|
1522
1650
|
0 < t.length && e.hot.send({
|
|
1523
1651
|
type: "update",
|
|
1524
1652
|
updates: t
|
|
1525
1653
|
});
|
|
1526
1654
|
}
|
|
1527
|
-
function
|
|
1655
|
+
function bn(e) {
|
|
1528
1656
|
return {
|
|
1529
1657
|
type: "js-update",
|
|
1530
1658
|
path: e.url,
|
|
@@ -1532,11 +1660,11 @@ function nn(e) {
|
|
|
1532
1660
|
timestamp: Date.now()
|
|
1533
1661
|
};
|
|
1534
1662
|
}
|
|
1535
|
-
function
|
|
1663
|
+
function xn(e) {
|
|
1536
1664
|
for (let t of e) {
|
|
1537
|
-
let e = `${t.filepath}:${t.line}:${t.column}`, n = t.severity === "error" ?
|
|
1538
|
-
console.error(` ${n} ${e} ${t.message} ${
|
|
1665
|
+
let e = `${t.filepath}:${t.line}:${t.column}`, n = t.severity === "error" ? j.red("error") : j.yellow("warn");
|
|
1666
|
+
console.error(` ${n} ${e} ${t.message} ${j.dim(`(${t.code})`)}`);
|
|
1539
1667
|
}
|
|
1540
1668
|
}
|
|
1541
1669
|
//#endregion
|
|
1542
|
-
export {
|
|
1670
|
+
export { q as a, J as i, G as n, Y as o, X as r, Je as s, gn as t };
|