typerighter 0.12.0 → 0.12.2
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/{app-C35j_dTB.js → app-5DaKZ6wW.js} +1 -1
- package/dist/{cli-Be6WWIHS.js → cli-CrhTEDdv.js} +12 -12
- package/dist/cli.js +1 -1
- package/dist/client/theme-default.js +413 -406
- package/dist/client.js +1 -1
- package/dist/index.js +2 -2
- package/dist/{init-Cr4wOumz.js → init-DXSnwZBc.js} +3 -3
- package/dist/node/plugin/vite/index.d.ts.map +1 -1
- package/dist/shared/utils/path.d.ts +1 -0
- package/dist/shared/utils/path.d.ts.map +1 -1
- package/dist/{shared-xivlz-gA.js → shared-D_aJCGWs.js} +59 -55
- package/dist/shared.js +2 -2
- package/dist/{vite-sjqEapXH.js → vite-BqxagMts.js} +25 -10
- package/dist/vite.js +1 -1
- package/package.json +3 -3
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-
|
|
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-5DaKZ6wW.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 };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e, t } from "./vite-
|
|
1
|
+
import { n as e, t } from "./vite-BqxagMts.js";
|
|
2
2
|
import "./vite.js";
|
|
3
|
-
import { n, t as r } from "./cli-
|
|
3
|
+
import { n, t as r } from "./cli-CrhTEDdv.js";
|
|
4
4
|
export { n as buildSite, r as cli, t as generateClientAppEntry, e as typedown };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as n, r } from "./vite-
|
|
1
|
+
import { H as e, s as t } from "./shared-D_aJCGWs.js";
|
|
2
|
+
import { i as n, r } from "./vite-BqxagMts.js";
|
|
3
3
|
import { a as i, i as a, n as o, r as s, t as c } from "./brand-CG1fQshq.js";
|
|
4
4
|
import "node:fs";
|
|
5
5
|
import l from "node:path";
|
|
@@ -2303,7 +2303,7 @@ function ai(e) {
|
|
|
2303
2303
|
build: "typerighter build",
|
|
2304
2304
|
preview: "typerighter preview"
|
|
2305
2305
|
},
|
|
2306
|
-
devDependencies: { typerighter: "^0.12.
|
|
2306
|
+
devDependencies: { typerighter: "^0.12.2" }
|
|
2307
2307
|
}, void 0, 2) + "\n";
|
|
2308
2308
|
}
|
|
2309
2309
|
function oi() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node/plugin/vite/index.ts"],"names":[],"mappings":"AAWA,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;AAoBlB,MAAM,WAAW,qBAAqB;IACpC,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node/plugin/vite/index.ts"],"names":[],"mappings":"AAWA,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;AAoBlB,MAAM,WAAW,qBAAqB;IACpC,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,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,CAiVvE"}
|
|
@@ -3,6 +3,7 @@ export declare function dirname(filepath: string): string;
|
|
|
3
3
|
export declare function extname(filepath: string): string;
|
|
4
4
|
export declare function filestem(filepath: string): string;
|
|
5
5
|
export declare function isContentFile(filepath: string): boolean;
|
|
6
|
+
export declare function isTypeFile(filepath: string): boolean;
|
|
6
7
|
export declare function join(...segments: string[]): string;
|
|
7
8
|
export declare function stripExtension(filepath: string): string;
|
|
8
9
|
//# sourceMappingURL=path.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/path.ts"],"names":[],"mappings":"AAOA,wBAAgB,QAAQ,CAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAStE;AAED,wBAAgB,OAAO,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMjD;AAED,wBAAgB,OAAO,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED,wBAAgB,QAAQ,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKlD;AAED,wBAAgB,aAAa,CAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,wBAAgB,IAAI,CAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAOnD;AAED,wBAAgB,cAAc,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIxD"}
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/path.ts"],"names":[],"mappings":"AAOA,wBAAgB,QAAQ,CAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAStE;AAED,wBAAgB,OAAO,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMjD;AAED,wBAAgB,OAAO,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED,wBAAgB,QAAQ,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAKlD;AAED,wBAAgB,aAAa,CAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAExD;AAGD,wBAAgB,UAAU,CAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAErD;AAED,wBAAgB,IAAI,CAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAOnD;AAED,wBAAgB,cAAc,CAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIxD"}
|
|
@@ -19,10 +19,10 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
|
|
|
19
19
|
"title",
|
|
20
20
|
"titles",
|
|
21
21
|
"text"
|
|
22
|
-
],
|
|
22
|
+
], ee = ["title", "titles"], m = /^[a-z]+:/i;
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/shared/utils/format.ts
|
|
25
|
-
function
|
|
25
|
+
function h(e) {
|
|
26
26
|
let t = e.match(/^(\d+)[-_](.+)$/);
|
|
27
27
|
return t ? {
|
|
28
28
|
order: Number(t[1]),
|
|
@@ -32,45 +32,49 @@ function g(e) {
|
|
|
32
32
|
rest: e
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
function
|
|
36
|
-
let { rest: t } =
|
|
35
|
+
function g(e) {
|
|
36
|
+
let { rest: t } = h(e), n = t.replace(/[-_]/g, " ").split(" ");
|
|
37
37
|
return 0 < n.length && (n[0] = n[0].charAt(0).toUpperCase() + n[0].slice(1)), n.join(" ");
|
|
38
38
|
}
|
|
39
39
|
//#endregion
|
|
40
40
|
//#region src/shared/utils/path.ts
|
|
41
|
-
var
|
|
42
|
-
basename: () =>
|
|
43
|
-
dirname: () =>
|
|
44
|
-
extname: () =>
|
|
45
|
-
filestem: () =>
|
|
46
|
-
isContentFile: () =>
|
|
41
|
+
var _ = /* @__PURE__ */ s({
|
|
42
|
+
basename: () => v,
|
|
43
|
+
dirname: () => y,
|
|
44
|
+
extname: () => b,
|
|
45
|
+
filestem: () => x,
|
|
46
|
+
isContentFile: () => S,
|
|
47
|
+
isTypeFile: () => C,
|
|
47
48
|
join: () => w,
|
|
48
49
|
stripExtension: () => T
|
|
49
50
|
});
|
|
50
|
-
function
|
|
51
|
+
function v(e, t) {
|
|
51
52
|
let n = E(e).split("/").pop() ?? "";
|
|
52
53
|
return t !== void 0 && n.endsWith(t) ? n.slice(0, -t.length) : n;
|
|
53
54
|
}
|
|
54
|
-
function
|
|
55
|
+
function y(e) {
|
|
55
56
|
let t = E(e).split("/");
|
|
56
57
|
return t.pop(), t.join("/");
|
|
57
58
|
}
|
|
58
|
-
function
|
|
59
|
-
let t =
|
|
59
|
+
function b(e) {
|
|
60
|
+
let t = v(e), n = t.lastIndexOf(".");
|
|
60
61
|
return n <= 0 ? "" : t.slice(n);
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
-
let t =
|
|
63
|
+
function x(e) {
|
|
64
|
+
let t = v(e), n = t.lastIndexOf(".");
|
|
64
65
|
return n <= 0 ? t : t.slice(0, n);
|
|
65
66
|
}
|
|
67
|
+
function S(e) {
|
|
68
|
+
return d.includes(b(e));
|
|
69
|
+
}
|
|
66
70
|
function C(e) {
|
|
67
|
-
return
|
|
71
|
+
return S(e) && e.split("/").includes("_types");
|
|
68
72
|
}
|
|
69
73
|
function w(...e) {
|
|
70
74
|
return e.filter(Boolean).join("/").replace(/\\+/g, "/").replace(/\/+/g, "/").replace(/\/$/, "") || "/";
|
|
71
75
|
}
|
|
72
76
|
function T(e) {
|
|
73
|
-
let t =
|
|
77
|
+
let t = b(e);
|
|
74
78
|
return t ? e.slice(0, -t.length) : e;
|
|
75
79
|
}
|
|
76
80
|
function E(e) {
|
|
@@ -78,40 +82,40 @@ function E(e) {
|
|
|
78
82
|
}
|
|
79
83
|
//#endregion
|
|
80
84
|
//#region src/shared/utils/url.ts
|
|
81
|
-
var
|
|
82
|
-
function
|
|
83
|
-
return
|
|
85
|
+
var D = new Set("3g2,3gp,aac,ai,apng,au,avif,bin,bmp,cer,class,conf,crl,css,csv,dll,doc,eps,epub,exe,gif,gz,ics,ief,jar,jpe,jpeg,jpg,js,json,jsonld,m4a,man,mid,midi,mjs,mov,mp2,mp3,mp4,mpe,mpeg,mpg,mpp,oga,ogg,ogv,ogx,opus,otf,p10,p7c,p7m,p7s,pdf,png,ps,qt,roff,rtf,rtx,ser,svg,t,tif,tiff,tr,ts,tsv,ttf,txt,vtt,wav,weba,webm,webp,woff,woff2,xhtml,xml,yaml,yml,zip".split(","));
|
|
86
|
+
function O(e) {
|
|
87
|
+
return N(e) ? j(e) : e;
|
|
84
88
|
}
|
|
85
|
-
function
|
|
89
|
+
function k(e, t) {
|
|
86
90
|
return `${e}/${t}`;
|
|
87
91
|
}
|
|
88
|
-
function k(e) {
|
|
89
|
-
return e === "/" ? "/index" : e + "/index";
|
|
90
|
-
}
|
|
91
92
|
function A(e) {
|
|
92
|
-
return
|
|
93
|
+
return e === "/" ? "/index" : e + "/index";
|
|
93
94
|
}
|
|
94
95
|
function j(e) {
|
|
95
|
-
|
|
96
|
-
return "/" + w(b(e), t);
|
|
96
|
+
return y(P(e)) || "/";
|
|
97
97
|
}
|
|
98
98
|
function M(e) {
|
|
99
|
+
let t = x(e);
|
|
100
|
+
return "/" + w(y(e), t);
|
|
101
|
+
}
|
|
102
|
+
function N(e) {
|
|
99
103
|
return e === "/index" || e.endsWith("/index");
|
|
100
104
|
}
|
|
101
|
-
function
|
|
105
|
+
function te(e, t) {
|
|
102
106
|
return t.startsWith(e + "/") || t === e;
|
|
103
107
|
}
|
|
104
|
-
function te(e) {
|
|
105
|
-
return h.test(e);
|
|
106
|
-
}
|
|
107
108
|
function ne(e) {
|
|
108
|
-
|
|
109
|
-
return t === "" || !ee.has(t.toLowerCase());
|
|
109
|
+
return m.test(e);
|
|
110
110
|
}
|
|
111
111
|
function re(e) {
|
|
112
|
-
|
|
112
|
+
let t = b(e).slice(1);
|
|
113
|
+
return t === "" || !D.has(t.toLowerCase());
|
|
113
114
|
}
|
|
114
115
|
function ie(e) {
|
|
116
|
+
return e === "/" ? "/index" : e;
|
|
117
|
+
}
|
|
118
|
+
function ae(e) {
|
|
115
119
|
let t = e.indexOf("#");
|
|
116
120
|
return 0 <= t ? e.slice(0, t) : e;
|
|
117
121
|
}
|
|
@@ -151,23 +155,23 @@ function I(e, t) {
|
|
|
151
155
|
return t;
|
|
152
156
|
}
|
|
153
157
|
function i(e, t) {
|
|
154
|
-
let n = e.items.find((e) =>
|
|
155
|
-
return n ?
|
|
158
|
+
let n = e.items.find((e) => x(e.filepath) === u);
|
|
159
|
+
return n ? M(n.filepath) : A(`${t}/${e.name}`);
|
|
156
160
|
}
|
|
157
161
|
function a(e, t) {
|
|
158
162
|
for (let o of e) {
|
|
159
163
|
let e = t ? `${t}/${o.name}` : `/${o.name}`;
|
|
160
164
|
n[e] = {
|
|
161
|
-
title:
|
|
165
|
+
title: g(o.name),
|
|
162
166
|
url: e,
|
|
163
167
|
subdirectories: o.children.map((t) => ({
|
|
164
|
-
name:
|
|
168
|
+
name: g(t.name),
|
|
165
169
|
url: i(t, e),
|
|
166
170
|
count: r(t)
|
|
167
171
|
})),
|
|
168
172
|
items: o.items.map((e) => ({
|
|
169
173
|
name: R(e.header, e.filepath),
|
|
170
|
-
url:
|
|
174
|
+
url: M(e.filepath)
|
|
171
175
|
}))
|
|
172
176
|
}, a(o.children, e);
|
|
173
177
|
}
|
|
@@ -176,7 +180,7 @@ function I(e, t) {
|
|
|
176
180
|
title: t,
|
|
177
181
|
url: "/",
|
|
178
182
|
subdirectories: e.map((e) => ({
|
|
179
|
-
name:
|
|
183
|
+
name: g(e.name),
|
|
180
184
|
url: i(e, ""),
|
|
181
185
|
count: r(e)
|
|
182
186
|
})),
|
|
@@ -184,24 +188,24 @@ function I(e, t) {
|
|
|
184
188
|
}, a(e, ""), n;
|
|
185
189
|
}
|
|
186
190
|
function L(e, t) {
|
|
187
|
-
let n = y(
|
|
188
|
-
return n ?
|
|
191
|
+
let n = v(y(e));
|
|
192
|
+
return n ? g(n) : t;
|
|
189
193
|
}
|
|
190
194
|
function R(e, t) {
|
|
191
195
|
if (e._label !== void 0) return String(e._label);
|
|
192
|
-
let n =
|
|
196
|
+
let n = x(t);
|
|
193
197
|
if (n === "index") {
|
|
194
|
-
let e = y(
|
|
195
|
-
return e ?
|
|
198
|
+
let e = v(y(t));
|
|
199
|
+
return e ? g(e) : n;
|
|
196
200
|
}
|
|
197
|
-
return
|
|
201
|
+
return g(n);
|
|
198
202
|
}
|
|
199
203
|
function z(e) {
|
|
200
204
|
e.children.sort((e, t) => {
|
|
201
|
-
let n =
|
|
205
|
+
let n = h(e.name), r = h(t.name);
|
|
202
206
|
return n.order === r.order ? n.rest.localeCompare(r.rest) : n.order - r.order;
|
|
203
207
|
}), e.items.sort((e, t) => {
|
|
204
|
-
let n =
|
|
208
|
+
let n = h(x(e.filepath)), r = h(x(t.filepath));
|
|
205
209
|
return n.order === r.order ? R(e.header, e.filepath).localeCompare(R(t.header, t.filepath)) : n.order - r.order;
|
|
206
210
|
});
|
|
207
211
|
for (let t of e.children) z(t);
|
|
@@ -242,24 +246,24 @@ function Q(e) {
|
|
|
242
246
|
day: "numeric"
|
|
243
247
|
});
|
|
244
248
|
}
|
|
245
|
-
function
|
|
249
|
+
function oe(e, t) {
|
|
246
250
|
return Math.floor(Date.now() / 1e3) - e < Z ? `${t} ${$(e)}` : `${t} at ${Q(e)}`;
|
|
247
251
|
}
|
|
248
252
|
function $(e) {
|
|
249
253
|
let t = Math.floor(Date.now() / 1e3) - e;
|
|
250
254
|
return t < G ? "just now" : t < K ? `${Math.floor(t / G)}m ago` : t < q ? `${Math.floor(t / K)}h ago` : t < J ? `${Math.floor(t / q)}d ago` : t < Y ? `${Math.floor(t / J)}w ago` : t < X ? `${Math.floor(t / Y)}mo ago` : `${Math.floor(t / X)}y ago`;
|
|
251
255
|
}
|
|
252
|
-
var
|
|
256
|
+
var se = new Intl.DateTimeFormat("en-US", {
|
|
253
257
|
year: "numeric",
|
|
254
258
|
month: "short",
|
|
255
259
|
day: "numeric"
|
|
256
260
|
});
|
|
257
|
-
function
|
|
261
|
+
function ce(e) {
|
|
258
262
|
let t = new Date(e);
|
|
259
|
-
return Number.isNaN(t.getTime()) ? e :
|
|
263
|
+
return Number.isNaN(t.getTime()) ? e : se.format(t);
|
|
260
264
|
}
|
|
261
|
-
function
|
|
265
|
+
function le(e) {
|
|
262
266
|
return Math.floor(Date.now() / 1e3) - e < Z ? $(e) : Q(e);
|
|
263
267
|
}
|
|
264
268
|
//#endregion
|
|
265
|
-
export {
|
|
269
|
+
export { S as A, p as B, re as C, v as D, P as E, g as F, o as H, m as I, d as L, _ as M, T as N, b as O, h as P, f as R, ne as S, ae as T, l as U, ee as V, A as _, le as a, N as b, U as c, F as d, I as f, k as g, O as h, $ as i, C as j, x as k, V as l, R as m, ce as n, W as o, L as p, oe as r, H as s, Q as t, B as u, j as v, ie as w, te as x, M as y, u as z };
|
package/dist/shared.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { B as e, C as t, E as n, F as r, I as i, L as a,
|
|
2
|
-
export {
|
|
1
|
+
import { B as e, C as t, E as n, F as r, I as i, L as a, M as o, P as s, R as c, S as l, T as u, V as d, _ as f, a as p, b as m, c as h, d as g, f as _, g as v, h as y, i as b, l as x, m as S, n as C, o as w, p as T, r as E, s as D, t as O, u as k, v as A, w as j, x as M, y as N, z as P } from "./shared-D_aJCGWs.js";
|
|
2
|
+
export { a as CONTENT_EXTENSIONS, c as CONTENT_GLOB, i as EXTERNAL_URL_RE, P as INDEX_FILENAME, e as SEARCH_FIELDS, d as SEARCH_STORE_FIELDS, g as buildContentTree, _ as buildDirectoryListingMap, k as debounce, D as escapeHtml, w as escapeRegex, O as formatAbsoluteTime, C as formatDateString, E as formatEditTime, b as formatRelativeTime, p as formatTime, y as getDirectoryFromPageUrl, v as getDirectoryUrl, f as getIndexUrl, A as getParentUrl, N as getTdContentUrl, T as getTdIndexTitle, S as getTdResourceTitle, x as isBuiltinField, m as isIndexUrl, M as isUrlAncestorOf, l as isUrlExternal, t as isUrlToPage, s as parseNumericPrefix, o as path, j as resolveRootUrl, u as stripAnchor, h as stripHtml, n as stripTrailingSlash, r as unslugify };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as isContentFile, B as
|
|
1
|
+
import { A as isContentFile, B as SEARCH_FIELDS, C as isUrlToPage, H as __commonJSMin, I as EXTERNAL_URL_RE, L as CONTENT_EXTENSIONS, O as extname, S as isUrlExternal, U as __toESM, V as SEARCH_STORE_FIELDS, c as stripHtml, d as buildContentTree, f as buildDirectoryListingMap, j as isTypeFile, k as filestem, m as getTdResourceTitle, p as getTdIndexTitle, s as escapeHtml$2, y as getTdContentUrl, z as INDEX_FILENAME } from "./shared-D_aJCGWs.js";
|
|
2
2
|
import { i as renderToString, n as ParseError, t as MiniSearch } from "./es-CG8rP6j5.js";
|
|
3
3
|
import fs, { createReadStream, existsSync, statSync } from "node:fs";
|
|
4
4
|
import path, { resolve } from "node:path";
|
|
@@ -10566,12 +10566,9 @@ function typedown(A = {}) {
|
|
|
10566
10566
|
};
|
|
10567
10567
|
},
|
|
10568
10568
|
async buildStart() {
|
|
10569
|
+
if (M) return;
|
|
10569
10570
|
let A = await (await F()).checkVault();
|
|
10570
|
-
if (
|
|
10571
|
-
let A = `${j.filepath}:${j.line}:${j.column}`, M = j.severity === "error" ? pc.red("error") : pc.yellow("warn");
|
|
10572
|
-
console.error(` ${M} ${A} ${j.message} ${pc.dim(`(${j.code})`)}`);
|
|
10573
|
-
}
|
|
10574
|
-
if (!M && 0 < A.errorCount) {
|
|
10571
|
+
if (printDiagnostics(A.diagnostics), 0 < A.errorCount) {
|
|
10575
10572
|
let j = A.diagnostics.filter((A) => A.severity === "error").map((A) => ` ${A.filepath}:${A.line}:${A.column} - ${A.message} (${A.code})`);
|
|
10576
10573
|
this.error(`Vault check failed with ${A.errorCount} error(s):\n${j.join("\n")}`);
|
|
10577
10574
|
}
|
|
@@ -10598,7 +10595,9 @@ function typedown(A = {}) {
|
|
|
10598
10595
|
async configureServer(A) {
|
|
10599
10596
|
M = A;
|
|
10600
10597
|
let j = await F();
|
|
10601
|
-
|
|
10598
|
+
A.httpServer?.once("listening", async () => {
|
|
10599
|
+
printDiagnostics((await j.checkVault()).diagnostics);
|
|
10600
|
+
}), j.rpc.onConfigChanged(() => M && hmrFullReload(M)), j.rpc.onContentChanged(({ content: A }) => {
|
|
10602
10601
|
M && (getPageIndexInput(j, A).then((A) => {
|
|
10603
10602
|
A && M && (N.addPage(A), invalidateSearchIndex(M));
|
|
10604
10603
|
}).catch(() => {}), j.getConfig().then((j) => {
|
|
@@ -10669,11 +10668,21 @@ function typedown(A = {}) {
|
|
|
10669
10668
|
async transform(A, j) {
|
|
10670
10669
|
let M = j.split("?")[0];
|
|
10671
10670
|
if (!isContentFile(M)) return;
|
|
10672
|
-
|
|
10673
|
-
|
|
10674
|
-
code: L,
|
|
10671
|
+
if (isTypeFile(M)) return {
|
|
10672
|
+
code: "<script>import { TdNotFound } from 'typerighter/client/theme-default'; export default TdNotFound; export const __pageData = { frontmatter: {}, headings: [], title: '' };<\/script>",
|
|
10675
10673
|
map: null
|
|
10676
10674
|
};
|
|
10675
|
+
let N = await F(), P = (await N.getConfig()).rootDir, I = M.includes(P) ? M.slice(M.indexOf(P) + P.length + 1) : M;
|
|
10676
|
+
try {
|
|
10677
|
+
let { vueSrc: A } = await renderToVueSfc(N, await N.getFile(I), I);
|
|
10678
|
+
return {
|
|
10679
|
+
code: A,
|
|
10680
|
+
map: null
|
|
10681
|
+
};
|
|
10682
|
+
} catch (A) {
|
|
10683
|
+
let j = A instanceof Error ? A.message : String(A);
|
|
10684
|
+
this.error(`[typedown] Failed to transform ${I}: ${j}`);
|
|
10685
|
+
}
|
|
10677
10686
|
},
|
|
10678
10687
|
handleHotUpdate({ file: A }) {
|
|
10679
10688
|
if (isContentFile(A)) return [];
|
|
@@ -10732,5 +10741,11 @@ function makeHmrUpdate(A) {
|
|
|
10732
10741
|
timestamp: Date.now()
|
|
10733
10742
|
};
|
|
10734
10743
|
}
|
|
10744
|
+
function printDiagnostics(A) {
|
|
10745
|
+
for (let j of A) {
|
|
10746
|
+
let A = `${j.filepath}:${j.line}:${j.column}`, M = j.severity === "error" ? pc.red("error") : pc.yellow("warn");
|
|
10747
|
+
console.error(` ${M} ${A} ${j.message} ${pc.dim(`(${j.code})`)}`);
|
|
10748
|
+
}
|
|
10749
|
+
}
|
|
10735
10750
|
//#endregion
|
|
10736
10751
|
export { createAppContext as a, CONFIG_FILE_NAMES as i, typedown as n, VIRTUAL_APP_ID as r, generateClientAppEntry as t };
|
package/dist/vite.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as e, t } from "./vite-
|
|
1
|
+
import { n as e, t } from "./vite-BqxagMts.js";
|
|
2
2
|
export { t as generateClientAppEntry, e 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.12.
|
|
4
|
+
"version": "0.12.2",
|
|
5
5
|
"description": "Typedown: A typed content framework.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"tailwindcss": "^4.3.3",
|
|
86
86
|
"vite": "^6.0.0 || ^7.0.0 || ^8.0.0",
|
|
87
87
|
"vue": "^3.0.0",
|
|
88
|
-
"@typerighter/rpc-client": "0.12.
|
|
89
|
-
"@typerighter/rpc-server": "0.12.
|
|
88
|
+
"@typerighter/rpc-client": "0.12.2",
|
|
89
|
+
"@typerighter/rpc-server": "0.12.2"
|
|
90
90
|
},
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@hdnax/nuclint": "^0.17.4",
|