typerighter 0.6.0 → 0.7.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.

Potentially problematic release.


This version of typerighter might be problematic. Click here for more details.

package/dist/client.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, o as i, t as a, u as o } from "./app-BZKg-fe3.js";
1
+ import { a as e, c as t, i as n, l as r, o as i, t as a, u as o } from "./app-Bf0aLzaG.js";
2
2
  export { t as Content, a as createTypedownApp, r as useRoute, o as useRouter, n as useSiteConfig, e as useSiteData, i as useTdContent };
@@ -1,4 +1,4 @@
1
- import { f as isUrlExternal, p as isUrlToPage, y as EXTERNAL_URL_RE } from "./shared-BoWAaUci.js";
1
+ import { f as isUrlExternal, p as isUrlToPage, y as EXTERNAL_URL_RE } from "./shared-CpPZZ8IH.js";
2
2
  import path from "node:path";
3
3
  import pc from "picocolors";
4
4
  import { createLogger } from "vite";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as e, t } from "./vite-BrwFwz0T.js";
1
+ import { n as e, t } from "./vite-DnP-_NzR.js";
2
2
  import "./vite.js";
3
- import { n, t as r } from "./cli-D5-gYw26.js";
3
+ import { n, t as r } from "./cli-CDd4TNg1.js";
4
4
  export { n as buildSite, r as cli, t as generateClientAppEntry, e as typedown };
@@ -1,5 +1,5 @@
1
- import { a as e, c as t, i as n } from "./constants-Dq357AVO.js";
2
- import "./shared-BoWAaUci.js";
1
+ import { a as e, c as t, i as n } from "./constants-DJbUAb1-.js";
2
+ import "./shared-CpPZZ8IH.js";
3
3
  import { o as r, r as i } from "./brand-BfamszbH.js";
4
4
  import a from "node:path";
5
5
  import "node:fs";
@@ -2299,7 +2299,7 @@ function ei(e) {
2299
2299
  build: "typerighter build",
2300
2300
  preview: "typerighter preview"
2301
2301
  },
2302
- devDependencies: { typerighter: "^0.6.0" }
2302
+ devDependencies: { typerighter: "^0.7.0" }
2303
2303
  }, void 0, 2) + "\n";
2304
2304
  }
2305
2305
  function ti() {
@@ -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;AAcd,OAAO,KAAK,EACV,UAAU,EACX,MAAM,YAAY,CAAC;AAIpB,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,CA+J3F"}
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;AAcd,OAAO,KAAK,EACV,UAAU,EACX,MAAM,YAAY,CAAC;AAIpB,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,CAgK3F"}
@@ -4,10 +4,14 @@ import type { ContentTree } from '@/shared';
4
4
  export interface ClientAppEntryOptions {
5
5
  /** Content directory relative to project root */
6
6
  contentDir: string;
7
+ /** URL base path */
8
+ basePath?: string;
7
9
  /** Site title */
8
10
  siteTitle: string;
9
11
  /** Site description */
10
12
  siteDescription: string;
13
+ /** Repository URL */
14
+ repo?: string;
11
15
  /** Content files as a recursive directory tree */
12
16
  contentTree: ContentTree;
13
17
  /** Schema definitions keyed by schema name */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node/plugin/vite/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,MAAM,EACZ,MAAM,MAAM,CAAC;AAId,OAAO,EACiC,KAAK,UAAU,EACtD,MAAM,eAAe,CAAC;AAuBvB,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,UAAU,CAAC;AAKlB,MAAM,WAAW,qBAAqB;IACpC,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,kDAAkD;IAClD,WAAW,EAAE,WAAW,CAAC;IACzB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAGD,MAAM,WAAW,qBAAqB;IAEpC,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAED,wBAAgB,sBAAsB,CAAE,OAAO,EAAE,qBAAqB,GAAG,MAAM,CAgE9E;AAED,wBAAgB,QAAQ,CAAE,OAAO,GAAE,qBAA0B,GAAG,MAAM,EAAE,CAuQvE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node/plugin/vite/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,MAAM,EACZ,MAAM,MAAM,CAAC;AAId,OAAO,EACiC,KAAK,UAAU,EACtD,MAAM,eAAe,CAAC;AAuBvB,OAAO,KAAK,EACV,WAAW,EACZ,MAAM,UAAU,CAAC;AAKlB,MAAM,WAAW,qBAAqB;IACpC,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,oBAAoB;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,qBAAqB;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,WAAW,EAAE,WAAW,CAAC;IACzB,8CAA8C;IAC9C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAGD,MAAM,WAAW,qBAAqB;IAEpC,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAED,wBAAgB,sBAAsB,CAAE,OAAO,EAAE,qBAAqB,GAAG,MAAM,CAoE9E;AAED,wBAAgB,QAAQ,CAAE,OAAO,GAAE,qBAA0B,GAAG,MAAM,EAAE,CAuQvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/content.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAC/D,MAAM,kBAAkB,CAAC;AAY1B,wBAAgB,gBAAgB,CAAE,KAAK,EAAE,cAAc,EAAE,GAAG,WAAW,CAqCtE;AAGD,wBAAgB,wBAAwB,CAAE,IAAI,EAAE,eAAe,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAiEtH;AAED,wBAAgB,eAAe,CAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAI5E;AAGD,wBAAgB,kBAAkB,CAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAK7F"}
1
+ {"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/content.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAC/D,MAAM,kBAAkB,CAAC;AAY1B,wBAAgB,gBAAgB,CAAE,KAAK,EAAE,cAAc,EAAE,GAAG,WAAW,CAqCtE;AAGD,wBAAgB,wBAAwB,CAAE,IAAI,EAAE,eAAe,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CA6DtH;AAED,wBAAgB,eAAe,CAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAI5E;AAGD,wBAAgB,kBAAkB,CAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAa7F"}
@@ -103,54 +103,58 @@ function w(e) {
103
103
  children: t.children
104
104
  };
105
105
  }
106
- function T(e, t) {
107
- let n = {};
108
- function r(e) {
106
+ function T(t, n) {
107
+ let r = {};
108
+ function i(e) {
109
109
  let t = e.items.length;
110
- for (let n of e.children) t += r(n);
110
+ for (let n of e.children) t += i(n);
111
111
  return t;
112
112
  }
113
- function i(e, t) {
114
- let n = e.items[0] ?? e.children[0]?.items[0];
115
- if (!n) return `${t}/${e.name}`;
116
- let r = y(n.filepath);
117
- return d(n.filepath) === "index" ? r : v(r);
113
+ function a(t, n) {
114
+ let r = t.items.find((t) => d(t.filepath) === e);
115
+ return r ? y(r.filepath) : `${n}/${t.name}/index`;
118
116
  }
119
- function a(e, t) {
120
- for (let o of e) {
121
- let e = t ? `${t}/${o.name}` : `/${o.name}`;
122
- n[e] = {
123
- title: s(o.name),
117
+ function o(e, t) {
118
+ for (let n of e) {
119
+ let e = t ? `${t}/${n.name}` : `/${n.name}`;
120
+ r[e] = {
121
+ title: s(n.name),
124
122
  url: e,
125
- subdirectories: o.children.map((t) => ({
123
+ subdirectories: n.children.map((t) => ({
126
124
  name: s(t.name),
127
- url: i(t, e),
128
- count: r(t)
125
+ url: a(t, e),
126
+ count: i(t)
129
127
  })),
130
- items: o.items.map((e) => ({
128
+ items: n.items.map((e) => ({
131
129
  name: D(e.header, e.filepath),
132
130
  url: y(e.filepath)
133
131
  }))
134
- }, a(o.children, e);
132
+ }, o(n.children, e);
135
133
  }
136
134
  }
137
- return n["/"] = {
138
- title: t,
135
+ return r["/"] = {
136
+ title: n,
139
137
  url: "/",
140
- subdirectories: e.map((e) => ({
138
+ subdirectories: t.map((e) => ({
141
139
  name: s(e.name),
142
- url: i(e, ""),
143
- count: r(e)
140
+ url: a(e, ""),
141
+ count: i(e)
144
142
  })),
145
143
  items: []
146
- }, a(e, ""), n;
144
+ }, o(t, ""), r;
147
145
  }
148
146
  function E(e, t) {
149
147
  let n = c(l(e));
150
148
  return n ? s(n) : t;
151
149
  }
152
150
  function D(e, t) {
153
- return e._label === void 0 ? e.name === void 0 ? s(d(t)) : String(e.name) : String(e._label);
151
+ if (e._label !== void 0) return String(e._label);
152
+ let n = d(t);
153
+ if (n === "index") {
154
+ let e = c(l(t));
155
+ return e ? s(e) : n;
156
+ }
157
+ return s(n);
154
158
  }
155
159
  function O(e) {
156
160
  e.children.sort((e, t) => {