typerighter 0.44.2 → 0.45.0

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 { s as e, t } from "./vite-KKwvSM8g.js";
1
+ import { s as e, t } from "./vite-KkSlWwFu.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.44.2 (built 10/16/2026, 2:31:57 PM)\n`), n.fresh && (process.env.TYPEDOWN_NO_CACHE = "1");
366
+ n.verbose && console.log(`${O} cli v0.45.0 (built 10/19/2026, 11:16:46 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-DKr1vEJD.js");
391
+ let { initialize: n } = await import("./init-CbYgEsOM.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.44.2"), i.parse();
429
+ }), i.help(), i.version("0.45.0"), 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.44.2 (built 10/16/2026, 2:31:57 PM)`), console.log(`${O} rpc v${t}`), console.log("");
437
+ console.log(`${O} cli v0.45.0 (built 10/19/2026, 11:16:46 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-DBv4APAX.js";
1
+ export { t as cli } from "./cli-_m_a7JaO.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-KKwvSM8g.js";
2
- import { t as s } from "./cli-DBv4APAX.js";
1
+ import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./vite-KkSlWwFu.js";
2
+ import { t as s } from "./cli-_m_a7JaO.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 };
@@ -754,7 +754,7 @@ function Ge(e) {
754
754
  check: "typerighter check"
755
755
  },
756
756
  devDependencies: {
757
- typerighter: "^0.44.2",
757
+ typerighter: "^0.45.0",
758
758
  typescript: "^5.0.0"
759
759
  }
760
760
  }, void 0, 2) + "\n";
@@ -1,6 +1,7 @@
1
1
  import type { UserComponent } from '@/node/lib/components';
2
2
  export interface AppEntryOptions {
3
3
  rootDir?: string;
4
+ mountPath?: string;
4
5
  basePath?: string;
5
6
  origin?: string;
6
7
  lang?: string;
@@ -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,uBAAuB,CAAC;AAK/B,MAAM,WAA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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,CAqHzF"}
@@ -1,6 +1,8 @@
1
1
  import type { ViteDevServer } from 'vite';
2
2
  import type { AppContext } from '@/node/context';
3
3
  export declare class VirtualApp {
4
+ private readonly mountPath;
5
+ constructor(mountPath?: string);
4
6
  load(context: AppContext): Promise<string>;
5
7
  invalidate(server: ViteDevServer): void;
6
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../../../src/node/plugin/vite/virtual/app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,MAAM,CAAC;AAYd,OAAO,KAAK,EACV,UAAU,EACX,MAAM,gBAAgB,CAAC;AAQxB,qBAAa,UAAU;IACf,IAAI,CAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAgCjD,UAAU,CAAE,MAAM,EAAE,aAAa,GAAG,IAAI;CAGzC"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../../../src/node/plugin/vite/virtual/app.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,MAAM,CAAC;AAYd,OAAO,KAAK,EACV,UAAU,EACX,MAAM,gBAAgB,CAAC;AAQxB,qBAAa,UAAU;IACR,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,GAAE,MAAW;IAE9C,IAAI,CAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IAiCjD,UAAU,CAAE,MAAM,EAAE,aAAa,GAAG,IAAI;CAGzC"}
@@ -2,6 +2,8 @@ import type { ViteDevServer } from 'vite';
2
2
  import { type VirtualModule } from './utils';
3
3
  import type { TypedownContext } from '@/node/lib/typedown-context';
4
4
  export declare class VirtualPages implements VirtualModule {
5
+ private readonly mountPath;
6
+ constructor(mountPath?: string);
5
7
  load(context: TypedownContext): Promise<string>;
6
8
  resolvePageData(id: string): string | undefined;
7
9
  isPageDataModule(resolvedId: string): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../../../../src/node/plugin/vite/virtual/pages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,MAAM,CAAC;AAKd,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EACV,eAAe,EAChB,MAAM,6BAA6B,CAAC;AAKrC,qBAAa,YAAa,YAAW,aAAa;IAC1C,IAAI,CAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IAQtD,eAAe,CAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAMhD,gBAAgB,CAAE,UAAU,EAAE,MAAM,GAAG,OAAO;IAIxC,YAAY,CAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IAQlF,kBAAkB,CAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKlE,YAAY,CAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAmBtF,UAAU,CAAE,MAAM,EAAE,aAAa,GAAG,IAAI;CAGzC"}
1
+ {"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../../../../src/node/plugin/vite/virtual/pages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,MAAM,CAAC;AAKd,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EACV,eAAe,EAChB,MAAM,6BAA6B,CAAC;AAKrC,qBAAa,YAAa,YAAW,aAAa;IAEnC,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,GAAE,MAAW;IAE9C,IAAI,CAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IAYtD,eAAe,CAAE,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAMhD,gBAAgB,CAAE,UAAU,EAAE,MAAM,GAAG,OAAO;IAIxC,YAAY,CAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC;IAQlF,kBAAkB,CAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKlE,YAAY,CAAE,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAmBtF,UAAU,CAAE,MAAM,EAAE,aAAa,GAAG,IAAI;CAGzC"}
@@ -182,7 +182,7 @@ async function Le(e) {
182
182
  //#endregion
183
183
  //#region src/node/lib/codegen/app-entry.ts
184
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
+ let { rootDir: n = ".", mountPath: r = "", userComponents: i = [] } = e, a = [r, n === "." ? "" : n].filter(Boolean).join("/"), o = i.map((e) => `import ${e.name} from ${JSON.stringify(e.absolutePath)};`).join("\n"), s = i.map((e) => `app.component(${JSON.stringify(e.name)}, ${e.name});`).join("\n"), c = JSON.stringify({
186
186
  title: e.siteTitle,
187
187
  description: e.siteDescription,
188
188
  basePath: e.basePath ?? "/",
@@ -195,7 +195,7 @@ function Re(e, t) {
195
195
  nav: e.nav
196
196
  });
197
197
  return `
198
- ${[i, "import 'typerighter/style.css';"].filter(Boolean).join("\n")}
198
+ ${[o, "import 'typerighter/style.css';"].filter(Boolean).join("\n")}
199
199
  import 'typerighter/fonts.css';
200
200
  import('typerighter/math.css');
201
201
  import { createTypedownApp } from 'typerighter/client';
@@ -216,7 +216,7 @@ function findPage(base) {
216
216
  }
217
217
 
218
218
  async function loadPageModule(pagePath) {
219
- const loader = findPage(path.join('/', '${n}', pagePath));
219
+ const loader = findPage(path.join('/', '${a}', pagePath));
220
220
  if (loader) return loader();
221
221
 
222
222
  if (isIndexUrl(pagePath)) {
@@ -231,8 +231,8 @@ async function loadPageModule(pagePath) {
231
231
  return undefined;
232
232
  }
233
233
 
234
- const { app, router, searchIndex: searchIndexRef, siteData } = await createTypedownApp(loadPageModule, theme, ${o}, initialSiteData);
235
- ${a}
234
+ const { app, router, searchIndex: searchIndexRef, siteData } = await createTypedownApp(loadPageModule, theme, ${c}, initialSiteData);
235
+ ${s}
236
236
  app.mount('#app');
237
237
 
238
238
  // Load search index in the background after the app is mounted
@@ -242,7 +242,7 @@ import('${t.searchIndex}').then((m) => { searchIndexRef.value = m.default; });
242
242
  if (import.meta.hot) {
243
243
  import.meta.hot.accept('${t.pages}', (m) => {
244
244
  if (!m) return;
245
- const base = path.join('/', '${n}', router.route.path);
245
+ const base = path.join('/', '${a}', router.route.path);
246
246
  const hadPage = !!findPage(base);
247
247
  pages = m.pages;
248
248
  const hasPage = !!findPage(base);
@@ -262,8 +262,8 @@ if (import.meta.hot) {
262
262
 
263
263
  // Update route.data directly when content changes - Vue SFC setup only re-runs on script block changes
264
264
  import.meta.hot.on('${t.pageDataEvent}', ({ filepath, pageData }) => {
265
- const eventBase = path.join('/', '${n}', path.stripExtension(filepath));
266
- const routeBase = path.join('/', '${n}', router.route.path);
265
+ const eventBase = path.join('/', '${a}', path.stripExtension(filepath));
266
+ const routeBase = path.join('/', '${a}', router.route.path);
267
267
  if (eventBase === routeBase) {
268
268
  router.route.data = pageData;
269
269
  }
@@ -1096,10 +1096,15 @@ function X(e, t) {
1096
1096
  //#endregion
1097
1097
  //#region src/node/plugin/vite/virtual/app.ts
1098
1098
  var Bt = class {
1099
+ mountPath;
1100
+ constructor(e = "") {
1101
+ this.mountPath = e;
1102
+ }
1099
1103
  async load(e) {
1100
1104
  let t = await (await e.getTdContext()).getConfig(), n = await I(t.components, e.root);
1101
1105
  return Re({
1102
1106
  rootDir: t.rootDir,
1107
+ mountPath: this.mountPath,
1103
1108
  basePath: t.basePath,
1104
1109
  origin: t.origin ?? void 0,
1105
1110
  lang: t.lang,
@@ -1122,9 +1127,13 @@ var Bt = class {
1122
1127
  X(e, Ft);
1123
1128
  }
1124
1129
  }, Vt = class {
1130
+ mountPath;
1131
+ constructor(e = "") {
1132
+ this.mountPath = e;
1133
+ }
1125
1134
  async load(e) {
1126
- let t = (await e.getConfig()).rootDir ?? ".";
1127
- return `export const pages = import.meta.glob('${t === "." ? "/**/*.{td,md}" : `/${t}/**/*.{td,md}`}');`;
1135
+ let t = (await e.getConfig()).rootDir ?? ".", n = [this.mountPath, t === "." ? "" : t].filter(Boolean);
1136
+ return `export const pages = import.meta.glob('${0 < n.length ? `/${n.join("/")}/**/*.{td,md}` : "/**/*.{td,md}"}');`;
1128
1137
  }
1129
1138
  resolvePageData(e) {
1130
1139
  if (e.startsWith("@typedown/pages?resource=")) return "\0" + e;
@@ -1520,8 +1529,12 @@ function _n(e, t, n) {
1520
1529
  }
1521
1530
  function vn() {
1522
1531
  try {
1523
- let e = k.resolve(k.dirname(me(import.meta.url)), "builtin-components.json");
1524
- return JSON.parse(P.readFileSync(e, "utf-8"));
1532
+ let e = k.dirname(me(import.meta.url)), t = k.resolve(e, "builtin-components.json"), n = JSON.parse(P.readFileSync(t, "utf-8"));
1533
+ for (let e of Object.values(n)) if (typeof e == "object" && e && "source" in e) {
1534
+ let t = e;
1535
+ typeof t.source == "string" && t.source.startsWith("./") && (t.source = `typerighter/${t.source.slice(2)}`);
1536
+ }
1537
+ return n;
1525
1538
  } catch {
1526
1539
  return {};
1527
1540
  }
@@ -1538,7 +1551,7 @@ function $(e, t) {
1538
1551
  //#endregion
1539
1552
  //#region src/node/plugin/vite/index.ts
1540
1553
  function yn(e = {}) {
1541
- let t = e.context, n, i, a, o = new Bt(), s = new Ht(), l = new Vt(), u = new Gt(), d = new en(), f = {
1554
+ let t = e.context, n, i, a, o = new Bt(e.root ?? ""), s = new Ht(), l = new Vt(e.root ?? ""), u = new Gt(), d = new en(), f = {
1542
1555
  devHtml: void 0,
1543
1556
  basePath: "/",
1544
1557
  rootDirectory: "vault"
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-KKwvSM8g.js";
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-KkSlWwFu.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.44.2",
4
+ "version": "0.45.0",
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.44.2",
65
- "@typerighter/rpc-server": "0.44.2",
64
+ "@typerighter/rpc-client": "0.45.0",
65
+ "@typerighter/rpc-server": "0.45.0",
66
66
  "@vitejs/plugin-vue": "^6.0.10",
67
67
  "cac": "^7.0.0",
68
68
  "picocolors": "^1.1.1",
@@ -74,13 +74,15 @@
74
74
  "vue": "^3.5.43",
75
75
  "vue-component-meta": "^3.3.13"
76
76
  },
77
+ "peerDependencies": {
78
+ "typescript": "^6.0.3"
79
+ },
77
80
  "devDependencies": {
78
81
  "@hdnax/nuclint": "^0.17.5",
79
82
  "@playwright/test": "^1.61.1",
80
83
  "@types/node": "^26.4.1",
81
84
  "minisearch": "^7.2.0",
82
85
  "playwright": "^1.61.1",
83
- "typescript": "^6.0.3",
84
86
  "vitest": "^5.0.1"
85
87
  },
86
88
  "scripts": {