typerighter 0.30.3 → 0.30.4

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.
@@ -1,4 +1,4 @@
1
- import { C as e, F as t, G as n, H as r, L as i, N as a, P as o, V as s, W as c, _ as l, f as u, g as d, h as f, j as p, l as m, p as h, s as g, w as _ } from "./shared-BuA2cqMO.js";
1
+ import { F as e, G as t, H as n, I as r, K as i, M as a, P as o, R as s, T as c, U as l, _ as u, g as d, m as f, p, s as m, u as h, v as g, w as _ } from "./shared-B-n46X4N.js";
2
2
  import { t as v } from "./temml-DZbhOfRE.js";
3
3
  import { t as y } from "./es-ClqUVRJn.js";
4
4
  import b, { resolve as x } from "node:path";
@@ -14,7 +14,7 @@ import { RPC_CANCELLED_CODE as ue, RpcClient as de } from "@typerighter/rpc-clie
14
14
  import { createRequire as fe } from "node:module";
15
15
  //#region src/node/lib/html-template.ts
16
16
  function k(e) {
17
- let t = g(e.title), n = g(e.description), r = e.siteTitle !== void 0 && e.title !== e.siteTitle ? `${t} - ${g(e.siteTitle)}` : t, i = e.canonicalUrl === void 0 ? "" : `\n <link rel="canonical" href="${g(e.canonicalUrl)}">`, a = e.headExtra === void 0 ? "" : e.headExtra + "\n", o = JSON.stringify({
17
+ let t = m(e.title), n = m(e.description), r = e.siteTitle !== void 0 && e.title !== e.siteTitle ? `${t} - ${m(e.siteTitle)}` : t, i = e.canonicalUrl === void 0 ? "" : `\n <link rel="canonical" href="${m(e.canonicalUrl)}">`, a = e.headExtra === void 0 ? "" : e.headExtra + "\n", o = JSON.stringify({
18
18
  "@context": "https://schema.org",
19
19
  "@type": "Article",
20
20
  headline: e.title,
@@ -119,20 +119,20 @@ function he(e) {
119
119
  //#region src/node/build/index.ts
120
120
  var ge = "typerighter/client/theme-default";
121
121
  async function M(e, t = {}) {
122
- let { root: n, logger: r } = e, a = b.resolve(n, t.outDir ?? "dist"), o = b.join(a, ".client"), s = b.join(a, ".server");
123
- await D.rm(a, {
122
+ let { root: n, logger: r } = e, i = b.resolve(n, t.outDir ?? "dist"), a = b.join(i, ".client"), o = b.join(i, ".server");
123
+ await D.rm(i, {
124
124
  recursive: !0,
125
125
  force: !0
126
126
  });
127
- let c = await e.getTdContext(), [l, d, f, p] = await Promise.all([
127
+ let c = await e.getTdContext(), [l, u, d, f] = await Promise.all([
128
128
  c.getConfig(),
129
129
  c.listFiles(),
130
130
  c.listSidebar(),
131
131
  c.listSchemas()
132
- ]), m = t.base ?? l.basePath ?? "/", h = m.endsWith("/") ? m : m + "/", g = f.map((e) => ({
132
+ ]), m = t.base ?? l.basePath ?? "/", h = m.endsWith("/") ? m : m + "/", g = d.map((e) => ({
133
133
  ...e,
134
134
  header: {}
135
- })), _ = u(g), v = JSON.stringify({
135
+ })), _ = p(g), v = JSON.stringify({
136
136
  title: l.siteTitle,
137
137
  description: l.siteDescription,
138
138
  basePath: h,
@@ -159,17 +159,17 @@ async function M(e, t = {}) {
159
159
  siteData: y
160
160
  }))]);
161
161
  try {
162
- let c = Nt({ context: e }), u = e.createViteLogger(), f = new j(r, "Building client bundle...");
162
+ let c = Nt({ context: e }), d = e.createViteLogger(), f = new j(r, "Building client bundle...");
163
163
  await T({
164
164
  ...t.viteConfig,
165
165
  root: n,
166
166
  base: h,
167
167
  plugins: c,
168
- customLogger: u,
168
+ customLogger: d,
169
169
  logLevel: "silent",
170
170
  build: {
171
171
  ...t.viteConfig?.build,
172
- outDir: o,
172
+ outDir: a,
173
173
  manifest: !0,
174
174
  emptyOutDir: !0,
175
175
  rollupOptions: {
@@ -178,7 +178,7 @@ async function M(e, t = {}) {
178
178
  }
179
179
  }
180
180
  });
181
- let p = await D.readdir(b.join(o, "assets")).catch(() => []);
181
+ let p = await D.readdir(b.join(a, "assets")).catch(() => []);
182
182
  f.done(`Client bundle (${p.length} chunks)`);
183
183
  let m = new j(r, "Building SSR bundle...");
184
184
  await T({
@@ -186,56 +186,56 @@ async function M(e, t = {}) {
186
186
  root: n,
187
187
  base: h,
188
188
  plugins: c,
189
- customLogger: u,
189
+ customLogger: d,
190
190
  logLevel: "silent",
191
191
  build: {
192
192
  ...t.viteConfig?.build,
193
- outDir: s,
193
+ outDir: o,
194
194
  ssr: C,
195
195
  emptyOutDir: !0
196
196
  }
197
197
  }), m.done("SSR bundle");
198
- let g = d.map((e) => {
199
- let t = i(e);
198
+ let g = u.map((e) => {
199
+ let t = s(e);
200
200
  return t === "index" ? "/" : `/${t}`;
201
201
  });
202
202
  g.push("/"), N(_.entries, "", g);
203
203
  let v = new j(r, "Pre-rendering pages...");
204
204
  await pe({
205
- ssrEntryPath: b.join(s, "ssr-entry.js"),
206
- clientOutDir: o,
207
- outDir: a,
205
+ ssrEntryPath: b.join(o, "ssr-entry.js"),
206
+ clientOutDir: a,
207
+ outDir: i,
208
208
  base: h,
209
209
  pagePaths: g,
210
210
  siteTitle: l.siteTitle,
211
211
  progress: v
212
212
  }), v.done(`Pre-rendered ${g.length} pages`);
213
213
  let y = ye(g, h);
214
- await D.writeFile(b.join(a, "sitemap.xml"), y);
215
- let x = b.join(o, "assets"), w = b.join(a, "assets");
216
- await D.cp(x, w, { recursive: !0 }).catch(() => {}), await ve(b.join(n, l.rootDir), a);
214
+ await D.writeFile(b.join(i, "sitemap.xml"), y);
215
+ let x = b.join(a, "assets"), w = b.join(i, "assets");
216
+ await D.cp(x, w, { recursive: !0 }).catch(() => {}), await ve(b.join(n, l.rootDir), i);
217
217
  let E = b.join(n, l.publicDir);
218
- await D.cp(E, a, { recursive: !0 }).catch(() => {});
218
+ await D.cp(E, i, { recursive: !0 }).catch(() => {});
219
219
  } finally {
220
220
  await Promise.all([
221
221
  D.rm(x, {
222
222
  recursive: !0,
223
223
  force: !0
224
224
  }),
225
- D.rm(o, {
225
+ D.rm(a, {
226
226
  recursive: !0,
227
227
  force: !0
228
228
  }),
229
- D.rm(s, {
229
+ D.rm(o, {
230
230
  recursive: !0,
231
231
  force: !0
232
232
  })
233
233
  ]);
234
234
  }
235
- r.log(`\nBuild complete. Output: ${a}`);
235
+ r.log(`\nBuild complete. Output: ${i}`);
236
236
  }
237
237
  function _e(e) {
238
- let t = `/${e.rootDir}/${r}`, n = JSON.parse(e.siteConfig), i = JSON.parse(e.siteData), a = i.contentTree ?? { entries: [] }, o = h(a.entries ?? [], n.title ?? ""), c = JSON.stringify({
238
+ let t = `/${e.rootDir}/${l}`, r = JSON.parse(e.siteConfig), i = JSON.parse(e.siteData), a = i.contentTree ?? { entries: [] }, o = f(a.entries ?? [], r.title ?? ""), s = JSON.stringify({
239
239
  ...i,
240
240
  directoryListings: o
241
241
  });
@@ -248,8 +248,8 @@ import { h } from 'vue';
248
248
  import theme from '${e.layoutImport}';
249
249
 
250
250
  const pages = import.meta.glob('${t}', { eager: true });
251
- const contentExts = ${JSON.stringify(s)};
252
- const siteData = ${c};
251
+ const contentExts = ${JSON.stringify(n)};
252
+ const siteData = ${s};
253
253
 
254
254
  function findPage(base) {
255
255
  for (const ext of contentExts) {
@@ -283,20 +283,20 @@ export async function render(url) {
283
283
  }
284
284
  `;
285
285
  }
286
- async function ve(e, t) {
287
- let n = (await D.readdir(e, {
286
+ async function ve(t, n) {
287
+ let r = (await D.readdir(t, {
288
288
  recursive: !0,
289
289
  withFileTypes: !0
290
- })).filter((e) => e.isFile() && !o(e.name)).map(async (n) => {
291
- let r = b.join(n.parentPath, n.name), i = b.relative(e, r), a = b.join(t, i);
290
+ })).filter((t) => t.isFile() && !e(t.name)).map(async (e) => {
291
+ let r = b.join(e.parentPath, e.name), i = b.relative(t, r), a = b.join(n, i);
292
292
  return D.mkdir(b.dirname(a), { recursive: !0 }).then(() => D.copyFile(r, a));
293
293
  });
294
- await Promise.all(n);
294
+ await Promise.all(r);
295
295
  }
296
296
  function ye(e, t) {
297
297
  return `<?xml version="1.0" encoding="UTF-8"?>
298
298
  <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
299
- ${e.map((e) => ` <url><loc>${g(t + e.replace(/^\//, ""))}</loc></url>`).join("\n")}
299
+ ${e.map((e) => ` <url><loc>${m(t + e.replace(/^\//, ""))}</loc></url>`).join("\n")}
300
300
  </urlset>
301
301
  `;
302
302
  }
@@ -698,7 +698,7 @@ async function Ye(e) {
698
698
  let t = await qe(), n = [...e.matchAll(Je)];
699
699
  if (n.length === 0) return e;
700
700
  let r = await Promise.all(n.map(async (e) => {
701
- let n = e[1] || "", r = e[2] || "", i = m(e[3]);
701
+ let n = e[1] || "", r = e[2] || "", i = h(e[3]);
702
702
  return Xe(await t(i, n, r), n, r);
703
703
  })), i = e;
704
704
  for (let e = n.length - 1; 0 <= e; e--) {
@@ -725,7 +725,7 @@ function $e(e) {
725
725
  function V(e, t) {
726
726
  let n = t ? "div" : "span";
727
727
  try {
728
- return v.renderToString(m(e), {
728
+ return v.renderToString(h(e), {
729
729
  throwOnError: !1,
730
730
  displayMode: t
731
731
  });
@@ -736,7 +736,7 @@ function V(e, t) {
736
736
  //#endregion
737
737
  //#region src/node/lib/render/vue.ts
738
738
  async function H(e, t, n) {
739
- let r = t.title || (l(n) ? f(n, (await e.getConfig()).siteTitle) : d(n, t.label));
739
+ let r = t.title || (g(n) ? d(n, (await e.getConfig()).siteTitle) : u(n, t.label));
740
740
  return {
741
741
  schema: t.schema,
742
742
  schemaLabel: t.schemaLabel,
@@ -772,6 +772,7 @@ function tt(e) {
772
772
  let e = {
773
773
  level: r.level,
774
774
  title: r.title,
775
+ titleHtml: r.titleHtml ?? r.title,
775
776
  slug: r.slug,
776
777
  link: `#${r.slug}`,
777
778
  children: []
@@ -982,7 +983,7 @@ var mt = class {
982
983
  }
983
984
  };
984
985
  function Z(e) {
985
- let { rootDir: t = "." } = e, n = JSON.stringify({
986
+ let { rootDir: t = "." } = e, r = JSON.stringify({
986
987
  title: e.siteTitle,
987
988
  description: e.siteDescription,
988
989
  basePath: e.basePath ?? "/",
@@ -1003,7 +1004,7 @@ import theme from 'typerighter/client/theme-default';
1003
1004
  import { pages as initialPages } from '${J}';
1004
1005
  import initialSiteData from '${lt}';
1005
1006
  let pages = initialPages;
1006
- const contentExts = ${JSON.stringify(s)};
1007
+ const contentExts = ${JSON.stringify(n)};
1007
1008
 
1008
1009
  function findPage(base) {
1009
1010
  for (const ext of contentExts) {
@@ -1029,7 +1030,7 @@ async function loadPageModule(pagePath) {
1029
1030
  return undefined;
1030
1031
  }
1031
1032
 
1032
- const { app, searchIndex: searchIndexRef, siteData } = await createTypedownApp(loadPageModule, theme.Layout, ${n}, initialSiteData);
1033
+ const { app, searchIndex: searchIndexRef, siteData } = await createTypedownApp(loadPageModule, theme.Layout, ${r}, initialSiteData);
1033
1034
  app.mount('#app');
1034
1035
 
1035
1036
  // Load search index in the background after the app is mounted
@@ -1087,9 +1088,9 @@ var ht = class {
1087
1088
  exclude: (e) => e.startsWith("_")
1088
1089
  }).map((e) => ({
1089
1090
  filepath: e,
1090
- label: d(e),
1091
+ label: u(e),
1091
1092
  header: {}
1092
- })), n = u(t);
1093
+ })), n = p(t);
1093
1094
  this.data = {
1094
1095
  contentTree: n,
1095
1096
  schemas: {},
@@ -1128,11 +1129,11 @@ async function yt(e) {
1128
1129
  ]), i = await Promise.all(r.map(async (t) => [t, (await e.getSchema(t)).properties])), a = Object.fromEntries(i), o = n.map((e) => ({
1129
1130
  ...e,
1130
1131
  header: {}
1131
- })), s = u(o);
1132
+ })), s = p(o);
1132
1133
  return {
1133
1134
  contentTree: s,
1134
1135
  schemas: a,
1135
- directoryListings: h(s.entries, t.siteTitle)
1136
+ directoryListings: f(s.entries, t.siteTitle)
1136
1137
  };
1137
1138
  }
1138
1139
  //#endregion
@@ -1141,8 +1142,8 @@ var bt = class {
1141
1142
  index;
1142
1143
  constructor() {
1143
1144
  this.index = new y({
1144
- fields: c,
1145
- storeFields: n
1145
+ fields: t,
1146
+ storeFields: i
1146
1147
  });
1147
1148
  }
1148
1149
  addAll(e) {
@@ -1169,12 +1170,12 @@ function xt(e, t) {
1169
1170
  }
1170
1171
  t.addAll(r);
1171
1172
  }
1172
- function St(t, n, r) {
1173
- let i = wt(t, x(t, n));
1174
- i ? r.addPage(i) : r.discardPage(e(n));
1173
+ function St(e, t, n) {
1174
+ let r = wt(e, x(e, t));
1175
+ r ? n.addPage(r) : n.discardPage(_(t));
1175
1176
  }
1176
1177
  function Ct(e, t) {
1177
- let n = d(e);
1178
+ let n = u(e);
1178
1179
  if (!t.startsWith("---")) return {
1179
1180
  title: n,
1180
1181
  body: t
@@ -1190,19 +1191,19 @@ function Ct(e, t) {
1190
1191
  body: a
1191
1192
  };
1192
1193
  }
1193
- function wt(t, n) {
1194
- let r;
1194
+ function wt(e, t) {
1195
+ let n;
1195
1196
  try {
1196
- r = se(n, "utf-8");
1197
+ n = se(t, "utf-8");
1197
1198
  } catch {
1198
1199
  return;
1199
1200
  }
1200
- if (!r.trim()) return;
1201
- let i = n.slice(t.length + 1), { title: a, body: o } = Ct(i, r);
1201
+ if (!n.trim()) return;
1202
+ let r = t.slice(e.length + 1), { title: i, body: a } = Ct(r, n);
1202
1203
  return {
1203
- id: e(i),
1204
- title: a,
1205
- text: `${a}\n${o}`
1204
+ id: _(r),
1205
+ title: i,
1206
+ text: `${i}\n${a}`
1206
1207
  };
1207
1208
  }
1208
1209
  function Tt(e) {
@@ -1260,14 +1261,14 @@ var kt = {
1260
1261
  function At(e, t) {
1261
1262
  return (n, r, i) => {
1262
1263
  if (!n.url || n.method !== "GET" || r.writableEnded) return i();
1263
- let o = _(n.url);
1264
- if (o.startsWith("/@") || o.startsWith("/node_modules")) return i();
1265
- let s = o.replace(/^\//, ""), c = x(e.config.root, t.rootDirectory, s);
1266
- if (ae(c)) try {
1267
- let e = ce(c);
1264
+ let a = c(n.url);
1265
+ if (a.startsWith("/@") || a.startsWith("/node_modules")) return i();
1266
+ let s = a.replace(/^\//, ""), l = x(e.config.root, t.rootDirectory, s);
1267
+ if (ae(l)) try {
1268
+ let e = ce(l);
1268
1269
  if (e.isFile()) {
1269
- let t = kt[a(c).slice(1).toLowerCase()] ?? "application/octet-stream";
1270
- r.setHeader("Content-Type", t), r.setHeader("Content-Length", e.size), ie(c).pipe(r);
1270
+ let t = kt[o(l).slice(1).toLowerCase()] ?? "application/octet-stream";
1271
+ r.setHeader("Content-Type", t), r.setHeader("Content-Length", e.size), ie(l).pipe(r);
1271
1272
  return;
1272
1273
  }
1273
1274
  } catch {}
@@ -1277,16 +1278,16 @@ function At(e, t) {
1277
1278
  //#endregion
1278
1279
  //#region src/node/plugin/vite/middleware/virtual-html.ts
1279
1280
  function jt(e, t, n) {
1280
- return (r, i, a) => {
1281
- if (!r.url) return a();
1282
- let o = p(_(r.url)), s = p(n.basePath);
1283
- if (o.startsWith("/@") || o.startsWith("/node_modules") || !o.startsWith(s)) return a();
1284
- let c = o.slice(s.length);
1285
- if (c.startsWith("/@") || c.startsWith("/node_modules") || o.includes(".") && !o.endsWith("/index.html")) return a();
1281
+ return (r, i, o) => {
1282
+ if (!r.url) return o();
1283
+ let s = a(c(r.url)), l = a(n.basePath);
1284
+ if (s.startsWith("/@") || s.startsWith("/node_modules") || !s.startsWith(l)) return o();
1285
+ let u = s.slice(l.length);
1286
+ if (u.startsWith("/@") || u.startsWith("/node_modules") || s.includes(".") && !s.endsWith("/index.html")) return o();
1286
1287
  t.getConfig().then(async (t) => {
1287
1288
  let a = await e.transformIndexHtml(r.url ?? "", Mt(n, t));
1288
1289
  i.setHeader("Content-Type", "text/html"), i.end(a);
1289
- }).catch(() => a());
1290
+ }).catch(() => o());
1290
1291
  };
1291
1292
  }
1292
1293
  function Mt(e, t) {
@@ -1299,8 +1300,8 @@ function Mt(e, t) {
1299
1300
  }
1300
1301
  //#endregion
1301
1302
  //#region src/node/plugin/vite/index.ts
1302
- function Nt(e = {}) {
1303
- let n = e.context, r, i, a, s = new mt(), c = new ht(), l = new vt(), u = new Dt(), d = {
1303
+ function Nt(t = {}) {
1304
+ let n = t.context, i, a, o, s = new mt(), c = new ht(), l = new vt(), u = new Dt(), d = {
1304
1305
  devHtml: void 0,
1305
1306
  basePath: "/",
1306
1307
  rootDirectory: "vault"
@@ -1313,11 +1314,11 @@ function Nt(e = {}) {
1313
1314
  {
1314
1315
  name: "vite-plugin-typedown",
1315
1316
  enforce: "pre",
1316
- async config(t) {
1317
- n ||= K(e.root ? x(t.root ?? process.cwd(), e.root) : it(t.root ?? process.cwd())), a = t.base ?? "/";
1317
+ async config(e) {
1318
+ n ||= K(t.root ? x(e.root ?? process.cwd(), t.root) : it(e.root ?? process.cwd())), o = e.base ?? "/";
1318
1319
  let r = await (await f()).getConfig();
1319
1320
  return {
1320
- base: t.base ?? r.basePath,
1321
+ base: e.base ?? r.basePath,
1321
1322
  publicDir: r.publicDir,
1322
1323
  server: {
1323
1324
  port: 8686,
@@ -1328,16 +1329,16 @@ function Nt(e = {}) {
1328
1329
  };
1329
1330
  },
1330
1331
  configResolved(e) {
1331
- i = x(e.root, e.build.outDir);
1332
+ a = x(e.root, e.build.outDir);
1332
1333
  },
1333
1334
  async buildStart() {
1334
- if (r) return;
1335
+ if (i) return;
1335
1336
  let e = await f(), t = await e.getConfig(), n = x(t.rootDir);
1336
1337
  u.index(n), await l.fetchSync(e);
1337
- let i = await e.checkVault();
1338
- if ($(i.diagnostics), 0 < i.errorCount) {
1339
- let e = i.diagnostics.filter((e) => e.severity === "error").map((e) => ` ${e.filepath}:${e.line}:${e.column} - ${e.message} (${e.code})`);
1340
- this.error(`Vault check failed with ${i.errorCount} error(s):\n${e.join("\n")}`);
1338
+ let r = await e.checkVault();
1339
+ if ($(r.diagnostics), 0 < r.errorCount) {
1340
+ let e = r.diagnostics.filter((e) => e.severity === "error").map((e) => ` ${e.filepath}:${e.line}:${e.column} - ${e.message} (${e.code})`);
1341
+ this.error(`Vault check failed with ${r.errorCount} error(s):\n${e.join("\n")}`);
1341
1342
  }
1342
1343
  },
1343
1344
  resolveId(e) {
@@ -1357,36 +1358,36 @@ function Nt(e = {}) {
1357
1358
  if (e === "\0@typedown/app") return s.load(t);
1358
1359
  },
1359
1360
  async configureServer(e) {
1360
- r = e;
1361
- let t = await f(), n = await t.getConfig(), i = x(n.rootDir);
1362
- u.index(i), l.scan(i), l.fetch(t, r), e.httpServer?.once("listening", async () => {
1361
+ i = e;
1362
+ let t = await f(), n = await t.getConfig(), r = x(n.rootDir);
1363
+ u.index(r), l.scan(r), l.fetch(t, i), e.httpServer?.once("listening", async () => {
1363
1364
  let e = await t.checkVault();
1364
1365
  0 < e.diagnostics.length && (console.error(""), $(e.diagnostics));
1365
1366
  }), t.rpc.onConfigChanged(() => {
1366
- r && (d.devHtml = void 0, l.clear(), s.invalidate(r), c.invalidate(r), Ft(r), l.fetch(t, r));
1367
+ i && (d.devHtml = void 0, l.clear(), s.invalidate(i), c.invalidate(i), Ft(i), l.fetch(t, i));
1367
1368
  }), t.rpc.onContentChanged(({ content: e, affectedFiles: n = [] }) => {
1368
- r && (u.reindex(i, e), u.invalidate(r), t.getConfig().then((t) => {
1369
- if (!r) return;
1370
- let i = [e, ...n], a = [];
1371
- for (let e of i) {
1372
- let n = ee(x(r.config.root, t.rootDir, e)), i = r.moduleGraph.getModulesByFile(n);
1373
- if (i?.size) {
1374
- for (let e of i) r?.moduleGraph.invalidateModule(e), a.push(Lt(e));
1375
- c.invalidatePageData(r, e);
1369
+ i && (u.reindex(r, e), u.invalidate(i), t.getConfig().then((t) => {
1370
+ if (!i) return;
1371
+ let r = [e, ...n], a = [];
1372
+ for (let e of r) {
1373
+ let n = ee(x(i.config.root, t.rootDir, e)), r = i.moduleGraph.getModulesByFile(n);
1374
+ if (r?.size) {
1375
+ for (let e of r) i?.moduleGraph.invalidateModule(e), a.push(Lt(e));
1376
+ c.invalidatePageData(i, e);
1376
1377
  }
1377
1378
  }
1378
- 0 < a.length && r.hot.send({
1379
+ 0 < a.length && i.hot.send({
1379
1380
  type: "update",
1380
1381
  updates: a
1381
1382
  });
1382
1383
  }).catch(() => {}));
1383
1384
  });
1384
1385
  function a() {
1385
- r && (u.index(i), u.invalidate(r), c.invalidate(r), l.clear(), l.fetch(t, r));
1386
+ i && (u.index(r), u.invalidate(i), c.invalidate(i), l.clear(), l.fetch(t, i));
1386
1387
  }
1387
1388
  t.rpc.onContentCreated(a), t.rpc.onContentDeleted(a);
1388
1389
  function o() {
1389
- r && (l.clear(), It(r), l.fetch(t, r));
1390
+ i && (l.clear(), It(i), l.fetch(t, i));
1390
1391
  }
1391
1392
  t.rpc.onSchemaChanged(o), t.rpc.onSchemaCreated(o), t.rpc.onSchemaDeleted(o);
1392
1393
  let p = await t.getConfig();
@@ -1394,16 +1395,16 @@ function Nt(e = {}) {
1394
1395
  d.basePath = e.basePath, d.rootDirectory = e.rootDir, d.devHtml = void 0;
1395
1396
  }), e.middlewares.use(At(e, d)), e.middlewares.use(jt(e, t, d));
1396
1397
  },
1397
- async transform(e, n) {
1398
- let r = n.split("?")[0];
1399
- if (!o(r)) return;
1400
- if (t(r)) return {
1398
+ async transform(t, n) {
1399
+ let i = n.split("?")[0];
1400
+ if (!e(i)) return;
1401
+ if (r(i)) return {
1401
1402
  code: "<script>import { TdNotFound } from 'typerighter/client/theme-default'; export default TdNotFound; export const pageData = { frontmatter: {}, headings: [], title: '' };<\/script>",
1402
1403
  map: null
1403
1404
  };
1404
- let i = await f(), a = (await i.getConfig()).rootDir, s = r.includes(a) ? r.slice(r.indexOf(a) + a.length + 1) : r;
1405
+ let a = await f(), o = (await a.getConfig()).rootDir, s = i.includes(o) ? i.slice(i.indexOf(o) + o.length + 1) : i;
1405
1406
  try {
1406
- let { vueSrc: e } = await et(i, await i.getFile(s), s);
1407
+ let { vueSrc: e } = await et(a, await a.getFile(s), s);
1407
1408
  return {
1408
1409
  code: e,
1409
1410
  map: null
@@ -1414,14 +1415,14 @@ function Nt(e = {}) {
1414
1415
  this.error(`[typedown] Failed to transform ${s}: ${t}`);
1415
1416
  }
1416
1417
  },
1417
- handleHotUpdate({ file: e }) {
1418
- if (o(e)) return [];
1418
+ handleHotUpdate({ file: t }) {
1419
+ if (e(t)) return [];
1419
1420
  },
1420
1421
  async closeBundle() {
1421
- if (!e.context && n) try {
1422
- let e = (await (await n.getTdContext()).getConfig()).basePath, t = e.startsWith(a) ? e.slice(a.length) : e.replace(/^\//, "");
1422
+ if (!t.context && n) try {
1423
+ let e = (await (await n.getTdContext()).getConfig()).basePath, t = e.startsWith(o) ? e.slice(o.length) : e.replace(/^\//, "");
1423
1424
  await M(n, {
1424
- outDir: x(i, t),
1425
+ outDir: x(a, t),
1425
1426
  base: e
1426
1427
  });
1427
1428
  } finally {
@@ -1430,7 +1431,7 @@ function Nt(e = {}) {
1430
1431
  }
1431
1432
  },
1432
1433
  w({
1433
- include: e.root ? RegExp(`${e.root.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}/.*\\.(?:vue|td)$`) : /\.(?:vue|td)$/,
1434
+ include: t.root ? RegExp(`${t.root.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}/.*\\.(?:vue|td)$`) : /\.(?:vue|td)$/,
1434
1435
  template: { transformAssetUrls: !1 }
1435
1436
  }),
1436
1437
  ...C()
package/dist/vite.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./vite-CYozrIIG.js";
1
+ import { n as e, t } from "./vite-vMuZ0f3f.js";
2
2
  export { e as generateClientAppEntry, t as typedown };
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.30.3",
4
+ "version": "0.30.4",
5
5
  "description": "Typedown: A typed content framework.",
6
6
  "repository": {
7
7
  "type": "git",
@@ -70,8 +70,8 @@
70
70
  "temml": "^0.13.5",
71
71
  "vite": "^8.2.2",
72
72
  "vue": "^3.5.42",
73
- "@typerighter/rpc-client": "0.30.3",
74
- "@typerighter/rpc-server": "0.30.3"
73
+ "@typerighter/rpc-client": "0.30.4",
74
+ "@typerighter/rpc-server": "0.30.4"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@hdnax/nuclint": "^0.17.5",