typerighter 0.43.0 → 0.43.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-DKDYNRYe.js → cli-BnRDeJy2.js} +5 -5
- package/dist/cli.js +1 -1
- package/dist/index.js +2 -2
- package/dist/{init-sdwwozr2.js → init-BCfVnwE1.js} +1 -1
- package/dist/{jsonld-Crj_9xpa.js → jsonld-ODTuVGMh.js} +1 -1
- package/dist/node/build/index.d.ts.map +1 -1
- package/dist/node/lib/codegen/app-entry.d.ts.map +1 -1
- package/dist/node/lib/codegen/theme.d.ts +1 -0
- package/dist/node/lib/codegen/theme.d.ts.map +1 -1
- package/dist/node/lib/codegen/theme.test.d.ts +2 -0
- package/dist/node/lib/codegen/theme.test.d.ts.map +1 -0
- package/dist/node/lib/{htmlTemplate.d.ts → html-template.d.ts} +1 -1
- package/dist/node/lib/html-template.d.ts.map +1 -0
- package/dist/prerenderWorker.js +1 -1
- package/dist/{vite-Cj1Ofykq.js → vite-C9pVUTyV.js} +59 -48
- package/dist/vite.js +1 -1
- package/package.json +3 -3
- package/dist/node/lib/htmlTemplate.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as e, t } from "./vite-
|
|
1
|
+
import { s as e, t } from "./vite-C9pVUTyV.js";
|
|
2
2
|
import { n } from "./context-CSvoDxVt.js";
|
|
3
3
|
import r from "node:path";
|
|
4
4
|
import i from "picocolors";
|
|
@@ -363,7 +363,7 @@ function k() {
|
|
|
363
363
|
}), process.on("unhandledRejection", (e) => {
|
|
364
364
|
A("runtime", e instanceof Error ? e : Error(String(e)));
|
|
365
365
|
}), i.command("[root]", "Start dev server").alias("dev").option("--port <port>", "Port to listen on").option("--host", "Expose to network").option("--fresh", "Start fresh, ignore cache from previous session").option("--verbose", "Print version and build info").action(async (e, n) => {
|
|
366
|
-
n.verbose && console.log(`${O} cli v0.43.
|
|
366
|
+
n.verbose && console.log(`${O} cli v0.43.1 (built 10/14/2026, 3:26:30 AM)\n`), n.fresh && (process.env.TYPEDOWN_NO_CACHE = "1");
|
|
367
367
|
let r = await a({
|
|
368
368
|
root: M(e),
|
|
369
369
|
configFile: !1,
|
|
@@ -388,7 +388,7 @@ function k() {
|
|
|
388
388
|
}
|
|
389
389
|
process.exit(0);
|
|
390
390
|
}), i.command("init [root]", "Scaffold a new project").option("--name <name>", "Project name").option("--title <title>", "Site title").option("--description <description>", "Site description").option("--yes", "Skip confirmation for existing projects").action(async (e, t) => {
|
|
391
|
-
let { initialize: n } = await import("./init-
|
|
391
|
+
let { initialize: n } = await import("./init-BCfVnwE1.js");
|
|
392
392
|
await n(M(e), t);
|
|
393
393
|
}), i.command("preview [root]", "Preview production build").option("--port <port>", "Port to listen on").action(async (e, t) => {
|
|
394
394
|
let r = M(e), i = n(r);
|
|
@@ -426,7 +426,7 @@ function k() {
|
|
|
426
426
|
} finally {
|
|
427
427
|
i.dispose();
|
|
428
428
|
}
|
|
429
|
-
}), i.help(), i.version("0.43.
|
|
429
|
+
}), i.help(), i.version("0.43.1"), i.parse();
|
|
430
430
|
}
|
|
431
431
|
function A(e, t) {
|
|
432
432
|
let n = t instanceof Error ? t.message : String(t);
|
|
@@ -434,7 +434,7 @@ function A(e, t) {
|
|
|
434
434
|
}
|
|
435
435
|
async function j(e) {
|
|
436
436
|
let t = await (await e.getTdContext()).rpc.getVersion();
|
|
437
|
-
console.log(`${O} cli v0.43.
|
|
437
|
+
console.log(`${O} cli v0.43.1 (built 10/14/2026, 3:26:30 AM)`), console.log(`${O} rpc v${t}`), console.log("");
|
|
438
438
|
}
|
|
439
439
|
function M(e) {
|
|
440
440
|
return r.resolve(e ?? process.cwd());
|
package/dist/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as cli } from "./cli-
|
|
1
|
+
export { t as cli } from "./cli-BnRDeJy2.js";
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./vite-
|
|
2
|
-
import { t as s } from "./cli-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./vite-C9pVUTyV.js";
|
|
2
|
+
import { t as s } from "./cli-BnRDeJy2.js";
|
|
3
3
|
export { n as PAGES_ID, i as PAGE_DATA_EVENT, t as SEARCH_INDEX_ID, e as SITE_DATA_ID, r as THEME_ID, a as buildSite, s as cli, o as typedown };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { K as e, c as t, i as n } from "./shared-QuBFygxT.js";
|
|
2
|
-
//#region src/node/lib/
|
|
2
|
+
//#region src/node/lib/html-template.ts
|
|
3
3
|
function r(e) {
|
|
4
4
|
let n = t(e.title), r = t(e.description), i = e.siteTitle !== void 0 && e.title !== e.siteTitle ? `${n} - ${t(e.siteTitle)}` : n, a = e.origin ?? "", o = e.canonicalUrl === void 0 ? void 0 : a + e.canonicalUrl, s = o === void 0 ? "" : `\n <link rel="canonical" href="${t(o)}">`, c = o === void 0 ? "" : `\n <meta property="og:url" content="${t(o)}">`, l = e.ogImagePath === void 0 ? `${a}${e.base}og-image.png` : `${a}${e.ogImagePath}`, u = e.author === void 0 ? "" : `\n <meta name="author" content="${t(e.author)}">`, d = e.siteTitle === void 0 ? "" : `\n <meta property="og:site_name" content="${t(e.siteTitle)}">`, f = a === "" ? "" : `\n <link rel="alternate" type="application/rss+xml" title="${e.siteTitle === void 0 ? "RSS Feed" : t(e.siteTitle)}" href="${a}${e.base}feed.xml">`, p = (e.jsonLdBlocks ?? []).map((e) => `\n <script type="application/ld+json">${e}<\/script>`).join(""), m = e.headExtra === void 0 ? "" : e.headExtra + "\n";
|
|
5
5
|
return `<!DOCTYPE html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/build/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACE,KAAK,YAAY,EACzB,MAAM,MAAM,CAAC;AAkBd,OAAO,KAAK,EACV,UAAU,EACX,MAAM,YAAY,CAAC;AAMpB,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,UAAU,CAAC,EAAE,YAAY,CAAC;CAC3B;AAGD,wBAAsB,SAAS,CAAE,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/build/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACE,KAAK,YAAY,EACzB,MAAM,MAAM,CAAC;AAkBd,OAAO,KAAK,EACV,UAAU,EACX,MAAM,YAAY,CAAC;AAMpB,MAAM,WAAW,YAAY;IAC3B,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uCAAuC;IACvC,UAAU,CAAC,EAAE,YAAY,CAAC;CAC3B;AAGD,wBAAsB,SAAS,CAAE,GAAG,EAAE,UAAU,EAAE,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwN3F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-entry.d.ts","sourceRoot":"","sources":["../../../../src/node/lib/codegen/app-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,cAAc,CAAC;AAKtB,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;CAClC;AAGD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;
|
|
1
|
+
{"version":3,"file":"app-entry.d.ts","sourceRoot":"","sources":["../../../../src/node/lib/codegen/app-entry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,cAAc,CAAC;AAKtB,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE;QACL,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;IACJ,cAAc,CAAC,EAAE,aAAa,EAAE,CAAC;CAClC;AAGD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB;AAGD,wBAAgB,gBAAgB,CAAE,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,gBAAgB,GAAG,MAAM,CA8GzF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/node/lib/codegen/theme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/node/lib/codegen/theme.ts"],"names":[],"mappings":"AAQA,wBAAgB,mBAAmB,CACjC,MAAM,EAAE;IACN,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9B,GAAG,SAAS,EACb,WAAW,CAAC,EAAE,MAAM,GACnB,MAAM,CA2CR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.test.d.ts","sourceRoot":"","sources":["../../../../src/node/lib/codegen/theme.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html-template.d.ts","sourceRoot":"","sources":["../../../src/node/lib/html-template.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,mBAAmB;IAClC,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,wBAAgB,kBAAkB,CAAE,OAAO,EAAE,mBAAmB,GAAG,MAAM,CA4ExE"}
|
package/dist/prerenderWorker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { P as e } from "./shared-QuBFygxT.js";
|
|
2
|
-
import { a as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./jsonld-
|
|
2
|
+
import { a as t, i as n, n as r, o as i, r as a, s as o, t as s } from "./jsonld-ODTuVGMh.js";
|
|
3
3
|
import { pathToFileURL as c } from "node:url";
|
|
4
4
|
import { parentPort as l, workerData as u } from "node:worker_threads";
|
|
5
5
|
//#region src/node/build/prerenderWorker.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { D as e, E as t, F as n, G as r, H as i, J as a, L as o, P as s, Q as c, R as l, V as u, Y as d, Z as f, _ as p, b as m, c as h, d as g, g as _, h as v, i as y, p as b, v as x, w as S, y as C, z as w } from "./shared-QuBFygxT.js";
|
|
2
|
-
import { a as T, i as E, n as D, o as O, r as
|
|
2
|
+
import { a as T, i as E, n as D, o as O, r as ee, s as k, t as te } from "./jsonld-ODTuVGMh.js";
|
|
3
3
|
import { t as ne } from "./temml-D47Z4xZ2.js";
|
|
4
4
|
import { a as re, i as ie, n as ae, r as oe } from "./context-CSvoDxVt.js";
|
|
5
5
|
import { t as se } from "./es-ClqUVRJn.js";
|
|
@@ -13,10 +13,10 @@ import { fileURLToPath as pe } from "node:url";
|
|
|
13
13
|
import me from "node:os";
|
|
14
14
|
import { Worker as he } from "node:worker_threads";
|
|
15
15
|
import { createHighlighter as ge, guessEmbeddedLanguages as _e, isSpecialLang as ve } from "shiki";
|
|
16
|
-
import { createReadStream as ye, existsSync as be, globSync as
|
|
17
|
-
import { createRequire as
|
|
16
|
+
import { createReadStream as ye, existsSync as be, globSync as xe, readFileSync as Se, statSync as Ce } from "node:fs";
|
|
17
|
+
import { createRequire as we } from "node:module";
|
|
18
18
|
//#region src/node/lib/worker-pool/index.ts
|
|
19
|
-
var
|
|
19
|
+
var Te = class {
|
|
20
20
|
workers = [];
|
|
21
21
|
queue = [];
|
|
22
22
|
destroyed = !1;
|
|
@@ -62,7 +62,7 @@ var we = class {
|
|
|
62
62
|
};
|
|
63
63
|
//#endregion
|
|
64
64
|
//#region src/node/build/seo/sitemap.ts
|
|
65
|
-
function
|
|
65
|
+
function Ee(e, t, n, r) {
|
|
66
66
|
let i = n ?? "";
|
|
67
67
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
68
68
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
@@ -73,7 +73,7 @@ ${e.map((e) => {
|
|
|
73
73
|
</urlset>
|
|
74
74
|
`;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function De(e, t) {
|
|
77
77
|
return `User-agent: *
|
|
78
78
|
Allow: /
|
|
79
79
|
|
|
@@ -82,7 +82,7 @@ Sitemap: ${e}${t}sitemap.xml
|
|
|
82
82
|
}
|
|
83
83
|
//#endregion
|
|
84
84
|
//#region src/node/build/seo/feed.ts
|
|
85
|
-
function
|
|
85
|
+
function Oe(e, t, n, r, i, a) {
|
|
86
86
|
let o = [...e].filter((e) => e.fileMetadata.mtime > 0).sort((e, t) => t.fileMetadata.mtime - e.fileMetadata.mtime).slice(0, 50).map((e) => {
|
|
87
87
|
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
88
|
return ` <item>
|
|
@@ -108,19 +108,19 @@ ${o}
|
|
|
108
108
|
}
|
|
109
109
|
//#endregion
|
|
110
110
|
//#region src/node/build/fonts.ts
|
|
111
|
-
function
|
|
111
|
+
function ke(e) {
|
|
112
112
|
let t = A.basename(e);
|
|
113
113
|
return t.endsWith(".woff2") && t.includes("-latin-") && !t.includes("-latin-ext-");
|
|
114
114
|
}
|
|
115
115
|
//#endregion
|
|
116
116
|
//#region src/node/build/prerender.ts
|
|
117
|
-
var
|
|
118
|
-
async function
|
|
119
|
-
let { clientEntry: t, cssFiles: n, fontFiles: r } = await
|
|
120
|
-
e.pagePaths.length >=
|
|
117
|
+
var Ae = 64;
|
|
118
|
+
async function je(e) {
|
|
119
|
+
let { clientEntry: t, cssFiles: n, fontFiles: r } = await Pe(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;
|
|
120
|
+
e.pagePaths.length >= Ae ? await Me(e, t, i) : await Ne(e, t, i);
|
|
121
121
|
}
|
|
122
|
-
async function
|
|
123
|
-
let r = new
|
|
122
|
+
async function Me(e, t, n) {
|
|
123
|
+
let r = new Te({
|
|
124
124
|
filename: A.resolve(pe(import.meta.url), "../prerenderWorker.js"),
|
|
125
125
|
workerData: {
|
|
126
126
|
ssrEntryPath: e.ssrEntryPath,
|
|
@@ -142,16 +142,16 @@ async function je(e, t, n) {
|
|
|
142
142
|
await r.destroy();
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
async function
|
|
145
|
+
async function Ne(e, t, n) {
|
|
146
146
|
let r = await (await import(e.ssrEntryPath)).createRenderer(), i = e.pagePaths.length, a = 0;
|
|
147
147
|
for (let o of e.pagePaths) {
|
|
148
|
-
let c = await r(o), l = O(c.pageData), u = T(c.pageData), d =
|
|
148
|
+
let c = await r(o), l = O(c.pageData), u = T(c.pageData), d = ee(c.pageData), f = e.base + s(o), p = [te({
|
|
149
149
|
title: l,
|
|
150
150
|
description: u,
|
|
151
151
|
canonicalUrl: f,
|
|
152
152
|
author: e.author,
|
|
153
153
|
dateModified: d
|
|
154
|
-
}), D(o, l)].filter((e) => e !== void 0), m =
|
|
154
|
+
}), D(o, l)].filter((e) => e !== void 0), m = k({
|
|
155
155
|
title: l,
|
|
156
156
|
description: u,
|
|
157
157
|
siteTitle: e.siteTitle,
|
|
@@ -169,9 +169,9 @@ async function Me(e, t, n) {
|
|
|
169
169
|
await N.mkdir(A.dirname(g), { recursive: !0 }), await N.writeFile(g, m), a++, e.progress?.update(a, i);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
async function
|
|
172
|
+
async function Pe(e) {
|
|
173
173
|
let t = A.join(e, ".vite", "manifest.json"), n = await N.readFile(t, "utf-8"), r = JSON.parse(n), i = "", a = [], o = [];
|
|
174
|
-
for (let e of Object.values(r)) e.isEntry ? (i = e.file, e.css && a.push(...e.css)) :
|
|
174
|
+
for (let e of Object.values(r)) e.isEntry ? (i = e.file, e.css && a.push(...e.css)) : ke(e.file) && o.push(e.file);
|
|
175
175
|
return {
|
|
176
176
|
clientEntry: i,
|
|
177
177
|
cssFiles: a,
|
|
@@ -180,7 +180,7 @@ async function Ne(e) {
|
|
|
180
180
|
}
|
|
181
181
|
//#endregion
|
|
182
182
|
//#region src/node/lib/codegen/app-entry.ts
|
|
183
|
-
function
|
|
183
|
+
function P(e, t) {
|
|
184
184
|
let { rootDir: n = ".", userComponents: r = [] } = e, i = r.map((e) => `import ${e.name} from ${JSON.stringify(e.absolutePath)};`).join("\n"), o = r.map((e) => `app.component(${JSON.stringify(e.name)}, ${e.name});`).join("\n"), s = JSON.stringify({
|
|
185
185
|
title: e.siteTitle,
|
|
186
186
|
description: e.siteDescription,
|
|
@@ -272,22 +272,32 @@ if (import.meta.hot) {
|
|
|
272
272
|
}
|
|
273
273
|
//#endregion
|
|
274
274
|
//#region src/node/lib/codegen/theme.ts
|
|
275
|
-
var
|
|
276
|
-
function
|
|
275
|
+
var F = "typerighter/client/theme-default";
|
|
276
|
+
function I(e, t) {
|
|
277
|
+
let n = e?.notFound ? `import CustomNotFound from ${JSON.stringify(t ? A.resolve(t, e.notFound) : e.notFound)};` : "", i = e?.notFound ? ", NotFound: CustomNotFound" : "";
|
|
277
278
|
if (e?.component) {
|
|
278
|
-
let
|
|
279
|
-
return [
|
|
279
|
+
let r = t ? A.resolve(t, e.component) : e.component;
|
|
280
|
+
return [
|
|
281
|
+
`import CustomLayout from ${JSON.stringify(r)};`,
|
|
282
|
+
n,
|
|
283
|
+
`export default { Layout: CustomLayout${i} };`
|
|
284
|
+
].filter(Boolean).join("\n");
|
|
280
285
|
}
|
|
281
|
-
let
|
|
282
|
-
if (0 <
|
|
283
|
-
let e =
|
|
286
|
+
let a = Object.entries(e?.slots ?? {});
|
|
287
|
+
if (0 < a.length) {
|
|
288
|
+
let e = a.map(([e, t]) => `${JSON.stringify(r(e))}: () => h(resolveComponent(${JSON.stringify(t)}))`).join(", ");
|
|
284
289
|
return [
|
|
285
|
-
`import DefaultTheme from ${JSON.stringify(
|
|
290
|
+
`import DefaultTheme from ${JSON.stringify(F)};`,
|
|
286
291
|
"import { h, resolveComponent } from 'vue';",
|
|
287
|
-
|
|
288
|
-
|
|
292
|
+
n,
|
|
293
|
+
`export default { Layout: { render() { return h(DefaultTheme.Layout, null, { ${e} }); } }${i} };`
|
|
294
|
+
].filter(Boolean).join("\n");
|
|
289
295
|
}
|
|
290
|
-
return
|
|
296
|
+
return n ? [
|
|
297
|
+
`import DefaultTheme from ${JSON.stringify(F)};`,
|
|
298
|
+
n,
|
|
299
|
+
`export default { ...DefaultTheme${i} };`
|
|
300
|
+
].join("\n") : `export { default } from ${JSON.stringify(F)};`;
|
|
291
301
|
}
|
|
292
302
|
//#endregion
|
|
293
303
|
//#region src/node/lib/codegen/components.ts
|
|
@@ -382,9 +392,9 @@ async function Le(e, t = {}) {
|
|
|
382
392
|
contentTree: b
|
|
383
393
|
}), C = A.join(n, "node_modules", ".typerighter");
|
|
384
394
|
await N.mkdir(C, { recursive: !0 });
|
|
385
|
-
let w = A.join(C, "client-entry.js"), T = A.join(C, "ssr-entry.js"), E = A.join(C, "theme.js"), D = await Fe(c.components, n), O =
|
|
395
|
+
let w = A.join(C, "client-entry.js"), T = A.join(C, "ssr-entry.js"), E = A.join(C, "theme.js"), D = await Fe(c.components, n), O = I(c.layout ?? void 0, n);
|
|
386
396
|
await Promise.all([
|
|
387
|
-
N.writeFile(w,
|
|
397
|
+
N.writeFile(w, P({
|
|
388
398
|
rootDir: c.rootDir,
|
|
389
399
|
basePath: _,
|
|
390
400
|
origin: f,
|
|
@@ -407,6 +417,7 @@ async function Le(e, t = {}) {
|
|
|
407
417
|
rootDir: c.rootDir,
|
|
408
418
|
siteConfig: x,
|
|
409
419
|
siteData: S,
|
|
420
|
+
themeModulePath: E,
|
|
410
421
|
userComponents: D
|
|
411
422
|
})),
|
|
412
423
|
N.writeFile(E, O)
|
|
@@ -454,7 +465,7 @@ async function Le(e, t = {}) {
|
|
|
454
465
|
});
|
|
455
466
|
y.push("/"), Be(b.entries, "", y);
|
|
456
467
|
let x = new R(r, "Pre-rendering pages...");
|
|
457
|
-
await
|
|
468
|
+
await je({
|
|
458
469
|
ssrEntryPath: A.join(o, "ssr-entry.js"),
|
|
459
470
|
clientOutDir: a,
|
|
460
471
|
outDir: i,
|
|
@@ -471,12 +482,12 @@ async function Le(e, t = {}) {
|
|
|
471
482
|
let t = u(e.filepath), n = t === "index" ? "/" : `/${t}`;
|
|
472
483
|
S.set(n, e.fileMetadata.mtime);
|
|
473
484
|
}
|
|
474
|
-
let C =
|
|
475
|
-
f !== void 0 && (E.push(N.writeFile(A.join(i, "robots.txt"),
|
|
485
|
+
let C = Ee(y, _, f, S), E = [N.writeFile(A.join(i, "sitemap.xml"), C)];
|
|
486
|
+
f !== void 0 && (E.push(N.writeFile(A.join(i, "robots.txt"), De(f, _))), E.push(N.writeFile(A.join(i, "feed.xml"), Oe(d, _, f, c.siteTitle, c.siteDescription, c.lang)))), await Promise.all(E);
|
|
476
487
|
let D = A.join(a, "assets"), O = A.join(i, "assets");
|
|
477
488
|
await N.cp(D, O, { recursive: !0 }).catch(() => {}), await ze(A.join(n, c.rootDir), i);
|
|
478
|
-
let
|
|
479
|
-
await N.cp(
|
|
489
|
+
let ee = A.join(n, c.publicDir);
|
|
490
|
+
await N.cp(ee, i, { recursive: !0 }).catch(() => {});
|
|
480
491
|
} finally {
|
|
481
492
|
await Promise.all([
|
|
482
493
|
N.rm(C, {
|
|
@@ -506,7 +517,7 @@ import { TdDirectoryIndex, TdGlossaryIndex } from 'typerighter/client/theme-defa
|
|
|
506
517
|
import { isIndexUrl, getDirectoryFromPageUrl } from 'typerighter/shared';
|
|
507
518
|
import { renderToString } from 'vue/server-renderer';
|
|
508
519
|
import { h } from 'vue';
|
|
509
|
-
import theme from
|
|
520
|
+
import theme from ${JSON.stringify(e.themeModulePath)};
|
|
510
521
|
|
|
511
522
|
const pages = import.meta.glob('${t}', { eager: true });
|
|
512
523
|
const contentExts = ${JSON.stringify(a)};
|
|
@@ -1061,7 +1072,7 @@ function Q(e, t) {
|
|
|
1061
1072
|
var Mt = class {
|
|
1062
1073
|
async load(e) {
|
|
1063
1074
|
let t = await (await e.getTdContext()).getConfig(), n = await Fe(t.components, e.root);
|
|
1064
|
-
return
|
|
1075
|
+
return P({
|
|
1065
1076
|
rootDir: t.rootDir,
|
|
1066
1077
|
basePath: t.basePath,
|
|
1067
1078
|
origin: t.origin ?? void 0,
|
|
@@ -1122,7 +1133,7 @@ var Mt = class {
|
|
|
1122
1133
|
}
|
|
1123
1134
|
}, Pt = class {
|
|
1124
1135
|
async load(e) {
|
|
1125
|
-
return
|
|
1136
|
+
return I((await (await e.getTdContext()).getConfig()).layout ?? void 0, e.root);
|
|
1126
1137
|
}
|
|
1127
1138
|
invalidate(e) {
|
|
1128
1139
|
Q(e, jt);
|
|
@@ -1135,7 +1146,7 @@ var Mt = class {
|
|
|
1135
1146
|
}, Lt = class {
|
|
1136
1147
|
data;
|
|
1137
1148
|
scan(e) {
|
|
1138
|
-
let t =
|
|
1149
|
+
let t = xe("**/*.td", {
|
|
1139
1150
|
cwd: e,
|
|
1140
1151
|
exclude: (e) => e.startsWith("_")
|
|
1141
1152
|
}).map((e) => ({
|
|
@@ -1246,7 +1257,7 @@ function Ht(e, t) {
|
|
|
1246
1257
|
function Ut(e, n) {
|
|
1247
1258
|
let r;
|
|
1248
1259
|
try {
|
|
1249
|
-
r =
|
|
1260
|
+
r = Se(n, "utf-8");
|
|
1250
1261
|
} catch {
|
|
1251
1262
|
return;
|
|
1252
1263
|
}
|
|
@@ -1259,7 +1270,7 @@ function Ut(e, n) {
|
|
|
1259
1270
|
};
|
|
1260
1271
|
}
|
|
1261
1272
|
function Wt(e) {
|
|
1262
|
-
return
|
|
1273
|
+
return xe("**/*.td", {
|
|
1263
1274
|
cwd: e,
|
|
1264
1275
|
exclude: (e) => e.startsWith("_")
|
|
1265
1276
|
}).map((t) => j(e, t));
|
|
@@ -1280,7 +1291,7 @@ var Gt = "\0@typedown/search-index", Kt = class {
|
|
|
1280
1291
|
invalidate(e) {
|
|
1281
1292
|
Q(e, Gt);
|
|
1282
1293
|
}
|
|
1283
|
-
}, qt =
|
|
1294
|
+
}, qt = we(import.meta.url);
|
|
1284
1295
|
function Jt() {
|
|
1285
1296
|
return [{
|
|
1286
1297
|
find: "vue/server-renderer",
|
|
@@ -1317,7 +1328,7 @@ function Xt(t, r) {
|
|
|
1317
1328
|
if (c.startsWith("/@") || c.startsWith("/node_modules")) return s();
|
|
1318
1329
|
let l = n(r.basePath), u = (l && c.startsWith(l) ? c.slice(l.length) : c).replace(/^\//, ""), d = j(t.config.root, r.rootDirectory, u);
|
|
1319
1330
|
if (be(d)) try {
|
|
1320
|
-
let e =
|
|
1331
|
+
let e = Ce(d);
|
|
1321
1332
|
if (e.isFile()) {
|
|
1322
1333
|
let t = Yt[o(d).slice(1).toLowerCase()] ?? "application/octet-stream";
|
|
1323
1334
|
a.setHeader("Content-Type", t), a.setHeader("Content-Length", e.size), ye(d).pipe(a);
|
|
@@ -1343,7 +1354,7 @@ function Zt(t, r, i) {
|
|
|
1343
1354
|
};
|
|
1344
1355
|
}
|
|
1345
1356
|
function Qt(e, t) {
|
|
1346
|
-
return e.devHtml === void 0 && (e.devHtml =
|
|
1357
|
+
return e.devHtml === void 0 && (e.devHtml = k({
|
|
1347
1358
|
title: t.siteTitle,
|
|
1348
1359
|
description: t.siteDescription,
|
|
1349
1360
|
base: "/",
|
|
@@ -1461,7 +1472,7 @@ function $t(e = {}) {
|
|
|
1461
1472
|
let n = t.split("?")[0];
|
|
1462
1473
|
if (!l(n)) return;
|
|
1463
1474
|
if (w(n)) return {
|
|
1464
|
-
code:
|
|
1475
|
+
code: `<script>import theme from '${X}'; import { TdNotFound } from 'typerighter/client/theme-default'; export default theme.NotFound || TdNotFound; export const pageData = { frontmatter: {}, headings: [], title: '' };<\/script>`,
|
|
1465
1476
|
map: null
|
|
1466
1477
|
};
|
|
1467
1478
|
let r = await p(), a = await r.getConfig(), o = i(n, a.rootDir);
|
package/dist/vite.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { n as PAGES_ID, r as PAGE_DATA_EVENT, i as SEARCH_INDEX_ID, a as SITE_DATA_ID, o as THEME_ID, t as typedown } from "./vite-
|
|
1
|
+
export { n as PAGES_ID, r as PAGE_DATA_EVENT, i as SEARCH_INDEX_ID, a as SITE_DATA_ID, o as THEME_ID, t as typedown } from "./vite-C9pVUTyV.js";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "typerighter",
|
|
4
|
-
"version": "0.43.
|
|
4
|
+
"version": "0.43.1",
|
|
5
5
|
"description": "Typedown: A typed content framework.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"@lucide/vue": "^1.47.0",
|
|
62
62
|
"@shikijs/transformers": "^4.4.3",
|
|
63
63
|
"@tailwindcss/vite": "^4.3.3",
|
|
64
|
-
"@typerighter/rpc-client": "0.43.
|
|
65
|
-
"@typerighter/rpc-server": "0.43.
|
|
64
|
+
"@typerighter/rpc-client": "0.43.1",
|
|
65
|
+
"@typerighter/rpc-server": "0.43.1",
|
|
66
66
|
"@vitejs/plugin-vue": "^6.0.10",
|
|
67
67
|
"cac": "^7.0.0",
|
|
68
68
|
"picocolors": "^1.1.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"htmlTemplate.d.ts","sourceRoot":"","sources":["../../../src/node/lib/htmlTemplate.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,mBAAmB;IAClC,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,qCAAqC;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uCAAuC;IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,WAAW,EAAE,MAAM,CAAC;IACpB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAGD,wBAAgB,kBAAkB,CAAE,OAAO,EAAE,mBAAmB,GAAG,MAAM,CA4ExE"}
|