typerighter 0.8.0 → 0.10.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.
- package/dist/{app-Dn-65wMj.js → app-C-qfoH4a.js} +1 -1
- package/dist/brand-CG1fQshq.js +5 -0
- package/dist/{cli-Doj0ofRb.js → cli-C3M8uZ5E.js} +115 -87
- package/dist/cli.js +1 -1
- package/dist/client/app/router.d.ts.map +1 -1
- package/dist/client/theme-default.js +354 -328
- package/dist/client.js +1 -1
- package/dist/es-CG8rP6j5.js +22524 -0
- package/dist/index.js +2 -2
- package/dist/{init-cYe8Z2-E.js → init-B9dG7io-.js} +654 -644
- package/dist/node/build/index.d.ts.map +1 -1
- package/dist/node/build/prerender.d.ts +2 -0
- package/dist/node/build/prerender.d.ts.map +1 -1
- package/dist/node/plugin/vite/index.d.ts.map +1 -1
- package/dist/typerighter.css +1 -1
- package/dist/vite-8CV23ALg.js +10704 -0
- package/dist/vite.js +1 -1
- package/package.json +3 -3
- package/dist/brand-CJDq15GW.js +0 -705
- package/dist/vite-CASZdq-i.js +0 -32496
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
//#region src/shared/brand.ts
|
|
2
|
+
var e = "m15 10c-2.7614 0-5 2.2386-5 5v98c0 2.761 2.2386 5 5 5h178c2.761 0 5-2.239 5-5v-98c0-2.7614-2.239-5-5-5zm-15 5c0-8.28427 6.71573-15 15-15h178c8.284 0 15 6.71573 15 15v98c0 8.284-6.716 15-15 15h-178c-8.28427 0-15-6.716-15-15z", t = "M30 30h70v16h-27v52h-16v-52h-27z", n = "m155 98-30-33h20v-35h20v35h20z", r = "0 0 208 128", i = "#a0522d", a = `<svg fill='none' viewBox='${r}' xmlns='http://www.w3.org/2000/svg'><path clip-rule='evenodd' d='${e}' fill-rule='evenodd' fill='${i}'/><path d='${t}' fill='${i}'/><path d='${n}' fill='${i}'/></svg>`;
|
|
3
|
+
`${encodeURIComponent(a)}`;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { r as a, t as i, e as n, i as r, n as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as e, F as t, O as n, P as r, d as i, f as a, s as o } from "./shared-BIdsxcZ2.js";
|
|
2
|
-
import { a as s, n as c, t as l } from "./vite-
|
|
2
|
+
import { a as s, n as c, t as l } from "./vite-8CV23ALg.js";
|
|
3
3
|
import u from "node:path";
|
|
4
4
|
import d from "picocolors";
|
|
5
5
|
import { build as f, createServer as p } from "vite";
|
|
@@ -13,6 +13,8 @@ async function g(e) {
|
|
|
13
13
|
content: c.html,
|
|
14
14
|
title: c.pageData.title,
|
|
15
15
|
description: c.pageData.frontmatter.description === void 0 ? "" : String(c.pageData.frontmatter.description),
|
|
16
|
+
url: e.base + s.replace(/^\//, ""),
|
|
17
|
+
siteTitle: e.siteTitle,
|
|
16
18
|
clientEntry: n,
|
|
17
19
|
cssFiles: r,
|
|
18
20
|
jsFiles: i,
|
|
@@ -22,16 +24,32 @@ async function g(e) {
|
|
|
22
24
|
}));
|
|
23
25
|
}
|
|
24
26
|
function _(e) {
|
|
25
|
-
let t = e.cssFiles.map((t) => ` <link rel="stylesheet" href="${e.base}${t}">`).join("\n"),
|
|
27
|
+
let t = o(e.title), n = o(e.description), r = e.title === e.siteTitle ? t : `${t} - ${o(e.siteTitle)}`, i = e.cssFiles.map((t) => ` <link rel="stylesheet" href="${e.base}${t}">`).join("\n"), a = e.jsFiles.map((t) => ` <link rel="modulepreload" href="${e.base}${t}">`).join("\n");
|
|
26
28
|
return `<!DOCTYPE html>
|
|
27
29
|
<html lang="${e.lang ?? "en"}">
|
|
28
30
|
<head>
|
|
29
31
|
<meta charset="UTF-8">
|
|
30
32
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
31
|
-
<title>${
|
|
32
|
-
<meta name="description" content="${
|
|
33
|
-
${
|
|
34
|
-
${
|
|
33
|
+
<title>${r}</title>
|
|
34
|
+
<meta name="description" content="${n}">
|
|
35
|
+
<link rel="icon" href="${e.base}favicon.svg" type="image/svg+xml">
|
|
36
|
+
<link rel="canonical" href="${o(e.url)}">
|
|
37
|
+
<meta property="og:type" content="article">
|
|
38
|
+
<meta property="og:title" content="${t}">
|
|
39
|
+
<meta property="og:description" content="${n}">
|
|
40
|
+
<meta property="og:image" content="${e.base}og-image.png">
|
|
41
|
+
<meta name="twitter:card" content="summary_large_image">
|
|
42
|
+
<meta name="twitter:title" content="${t}">
|
|
43
|
+
<meta name="twitter:description" content="${n}">
|
|
44
|
+
<meta name="twitter:image" content="${e.base}og-image.png">
|
|
45
|
+
<script type="application/ld+json">${JSON.stringify({
|
|
46
|
+
"@context": "https://schema.org",
|
|
47
|
+
"@type": "Article",
|
|
48
|
+
headline: e.title,
|
|
49
|
+
description: e.description
|
|
50
|
+
})}<\/script>
|
|
51
|
+
${i}
|
|
52
|
+
${a}
|
|
35
53
|
</head>
|
|
36
54
|
<body>
|
|
37
55
|
<div id="app">${e.content}</div>
|
|
@@ -85,24 +103,24 @@ async function S(t, n = {}) {
|
|
|
85
103
|
m.listFiles(),
|
|
86
104
|
m.listFilesGroupedBySchema(),
|
|
87
105
|
m.listSchemas()
|
|
88
|
-
]),
|
|
106
|
+
]), D = await Promise.all(S.map(async (e) => [e, (await m.getSchema(e)).properties])), O = Object.fromEntries(D), k = i(Object.values(b).flat()), A = JSON.stringify({
|
|
89
107
|
title: _.siteTitle,
|
|
90
108
|
description: _.siteDescription
|
|
91
|
-
}),
|
|
92
|
-
await h.mkdir(
|
|
93
|
-
let
|
|
94
|
-
await Promise.all([h.writeFile(
|
|
109
|
+
}), j = JSON.stringify({ contentTree: k }), M = u.join(r, "node_modules", ".typerighter");
|
|
110
|
+
await h.mkdir(M, { recursive: !0 });
|
|
111
|
+
let N = u.join(M, "client-entry.js"), P = u.join(M, "ssr-entry.js");
|
|
112
|
+
await Promise.all([h.writeFile(N, l({
|
|
95
113
|
contentDir: _.contentDir,
|
|
96
114
|
siteTitle: _.siteTitle,
|
|
97
115
|
siteDescription: _.siteDescription,
|
|
98
116
|
repo: _.repo,
|
|
99
|
-
contentTree:
|
|
100
|
-
schemas:
|
|
101
|
-
})), h.writeFile(
|
|
117
|
+
contentTree: k,
|
|
118
|
+
schemas: O
|
|
119
|
+
})), h.writeFile(P, C({
|
|
102
120
|
contentDir: _.contentDir,
|
|
103
121
|
layoutImport: x,
|
|
104
|
-
siteConfig:
|
|
105
|
-
siteData:
|
|
122
|
+
siteConfig: A,
|
|
123
|
+
siteData: j
|
|
106
124
|
}))]);
|
|
107
125
|
try {
|
|
108
126
|
let i = c({ context: t }), l = t.createViteLogger(), m = new y(a, "Building client bundle...");
|
|
@@ -120,7 +138,7 @@ async function S(t, n = {}) {
|
|
|
120
138
|
emptyOutDir: !0,
|
|
121
139
|
rollupOptions: {
|
|
122
140
|
...n.viteConfig?.build?.rollupOptions,
|
|
123
|
-
input:
|
|
141
|
+
input: N
|
|
124
142
|
}
|
|
125
143
|
}
|
|
126
144
|
});
|
|
@@ -137,7 +155,7 @@ async function S(t, n = {}) {
|
|
|
137
155
|
build: {
|
|
138
156
|
...n.viteConfig?.build,
|
|
139
157
|
outDir: p,
|
|
140
|
-
ssr:
|
|
158
|
+
ssr: P,
|
|
141
159
|
emptyOutDir: !0
|
|
142
160
|
}
|
|
143
161
|
}), x.done("SSR bundle");
|
|
@@ -145,7 +163,7 @@ async function S(t, n = {}) {
|
|
|
145
163
|
let n = e(t);
|
|
146
164
|
return n === "index" ? "/" : `/${n}`;
|
|
147
165
|
});
|
|
148
|
-
S.push("/"),
|
|
166
|
+
S.push("/"), E(k.children, "", S);
|
|
149
167
|
let C = new y(a, "Pre-rendering pages...");
|
|
150
168
|
await g({
|
|
151
169
|
ssrEntryPath: u.join(p, "ssr-entry.js"),
|
|
@@ -153,13 +171,16 @@ async function S(t, n = {}) {
|
|
|
153
171
|
outDir: o,
|
|
154
172
|
base: s,
|
|
155
173
|
pagePaths: S,
|
|
174
|
+
siteTitle: _.siteTitle,
|
|
156
175
|
progress: C
|
|
157
176
|
}), C.done(`Pre-rendered ${S.length} pages`);
|
|
158
|
-
let
|
|
159
|
-
await h.
|
|
177
|
+
let D = T(S, s);
|
|
178
|
+
await h.writeFile(u.join(o, "sitemap.xml"), D);
|
|
179
|
+
let O = u.join(d, "assets"), A = u.join(o, "assets");
|
|
180
|
+
await h.cp(O, A, { recursive: !0 }).catch(() => {}), await w(u.join(r, _.contentDir), o);
|
|
160
181
|
} finally {
|
|
161
182
|
await Promise.all([
|
|
162
|
-
h.rm(
|
|
183
|
+
h.rm(M, {
|
|
163
184
|
recursive: !0,
|
|
164
185
|
force: !0
|
|
165
186
|
}),
|
|
@@ -237,26 +258,33 @@ async function w(e, t) {
|
|
|
237
258
|
});
|
|
238
259
|
await Promise.all(r);
|
|
239
260
|
}
|
|
240
|
-
function T(e, t
|
|
261
|
+
function T(e, t) {
|
|
262
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
263
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
264
|
+
${e.map((e) => ` <url><loc>${o(t + e.replace(/^\//, ""))}</loc></url>`).join("\n")}
|
|
265
|
+
</urlset>
|
|
266
|
+
`;
|
|
267
|
+
}
|
|
268
|
+
function E(e, t, n) {
|
|
241
269
|
for (let r of e) {
|
|
242
270
|
let e = `${t}/${r.name}`;
|
|
243
|
-
n.push(e),
|
|
271
|
+
n.push(e), E(r.children, e, n);
|
|
244
272
|
}
|
|
245
273
|
}
|
|
246
274
|
//#endregion
|
|
247
275
|
//#region ../../node_modules/.pnpm/cac@7.0.0/node_modules/cac/dist/index.js
|
|
248
|
-
function
|
|
276
|
+
function D(e) {
|
|
249
277
|
return e == null ? [] : Array.isArray(e) ? e : [e];
|
|
250
278
|
}
|
|
251
|
-
function
|
|
279
|
+
function O(e, t, n, r) {
|
|
252
280
|
var i, a = e[t], o = ~r.string.indexOf(t) ? n == null || n === !0 ? "" : String(n) : typeof n == "boolean" ? n : ~r.boolean.indexOf(t) ? n === "false" ? !1 : n === "true" || (e._.push((i = +n, i * 0 == 0 ? i : n)), !!n) : (i = +n, i * 0 == 0 ? i : n);
|
|
253
281
|
e[t] = a == null ? o : Array.isArray(a) ? a.concat(o) : [a, o];
|
|
254
282
|
}
|
|
255
|
-
function
|
|
283
|
+
function k(e, t) {
|
|
256
284
|
e ||= [], t ||= {};
|
|
257
285
|
var n, r, i, a, o, s = { _: [] }, c = 0, l = 0, u = 0, d = e.length;
|
|
258
286
|
let f = t.alias !== void 0, p = t.unknown !== void 0, m = t.default !== void 0;
|
|
259
|
-
if (t.alias = t.alias || {}, t.string =
|
|
287
|
+
if (t.alias = t.alias || {}, t.string = D(t.string), t.boolean = D(t.boolean), f) for (n in t.alias) for (r = t.alias[n] = D(t.alias[n]), c = 0; c < r.length; c++) (t.alias[r[c]] = r.concat(n)).splice(c, 1);
|
|
260
288
|
for (c = t.boolean.length; c-- > 0;) for (r = t.alias[t.boolean[c]] || [], l = r.length; l-- > 0;) t.boolean.push(r[l]);
|
|
261
289
|
for (c = t.string.length; c-- > 0;) for (r = t.alias[t.string[c]] || [], l = r.length; l-- > 0;) t.string.push(r[l]);
|
|
262
290
|
if (m) {
|
|
@@ -277,7 +305,7 @@ function O(e, t) {
|
|
|
277
305
|
for (u = l + 1; u < i.length && i.charCodeAt(u) !== 61; u++);
|
|
278
306
|
for (a = i.substring(l, u), o = i.substring(++u) || c + 1 === d || ("" + e[c + 1]).charCodeAt(0) === 45 || e[++c], r = l === 2 ? [a] : a, u = 0; u < r.length; u++) {
|
|
279
307
|
if (a = r[u], p && !~h.indexOf(a)) return t.unknown("-".repeat(l) + a);
|
|
280
|
-
|
|
308
|
+
O(s, a, u + 1 < r.length || o, t);
|
|
281
309
|
}
|
|
282
310
|
}
|
|
283
311
|
}
|
|
@@ -285,10 +313,10 @@ function O(e, t) {
|
|
|
285
313
|
if (f) for (n in s) for (r = t.alias[n] || []; r.length > 0;) s[r.shift()] = s[n];
|
|
286
314
|
return s;
|
|
287
315
|
}
|
|
288
|
-
function
|
|
316
|
+
function A(e) {
|
|
289
317
|
return e.replace(/[<[].+/, "").trim();
|
|
290
318
|
}
|
|
291
|
-
function
|
|
319
|
+
function j(e) {
|
|
292
320
|
let t = /<([^>]+)>/g, n = /\[([^\]]+)\]/g, r = [], i = (e) => {
|
|
293
321
|
let t = !1, n = e[1];
|
|
294
322
|
return n.startsWith("...") && (n = n.slice(3), t = !0), {
|
|
@@ -302,7 +330,7 @@ function A(e) {
|
|
|
302
330
|
for (; o = n.exec(e);) r.push(i(o));
|
|
303
331
|
return r;
|
|
304
332
|
}
|
|
305
|
-
function
|
|
333
|
+
function M(e) {
|
|
306
334
|
let t = {
|
|
307
335
|
alias: {},
|
|
308
336
|
boolean: []
|
|
@@ -310,16 +338,16 @@ function j(e) {
|
|
|
310
338
|
for (let [n, r] of e.entries()) r.names.length > 1 && (t.alias[r.names[0]] = r.names.slice(1)), r.isBoolean && (r.negated && e.some((e, t) => t !== n && e.names.some((e) => r.names.includes(e)) && typeof e.required == "boolean") || t.boolean.push(r.names[0]));
|
|
311
339
|
return t;
|
|
312
340
|
}
|
|
313
|
-
function
|
|
341
|
+
function N(e) {
|
|
314
342
|
return e.sort((e, t) => e.length > t.length ? -1 : 1)[0];
|
|
315
343
|
}
|
|
316
|
-
function
|
|
344
|
+
function P(e, t) {
|
|
317
345
|
return e.length >= t ? e : `${e}${" ".repeat(t - e.length)}`;
|
|
318
346
|
}
|
|
319
|
-
function
|
|
347
|
+
function F(e) {
|
|
320
348
|
return e.replaceAll(/([a-z])-([a-z])/g, (e, t, n) => t + n.toUpperCase());
|
|
321
349
|
}
|
|
322
|
-
function
|
|
350
|
+
function I(e, t, n) {
|
|
323
351
|
let r = e;
|
|
324
352
|
for (let e = 0; e < t.length; e++) {
|
|
325
353
|
let i = t[e];
|
|
@@ -334,24 +362,24 @@ function F(e, t, n) {
|
|
|
334
362
|
r = r[i];
|
|
335
363
|
}
|
|
336
364
|
}
|
|
337
|
-
function
|
|
365
|
+
function L(e, t) {
|
|
338
366
|
for (let n of Object.keys(t)) {
|
|
339
367
|
let r = t[n];
|
|
340
368
|
r.shouldTransform && (e[n] = [e[n]].flat(), typeof r.transformFunction == "function" && (e[n] = e[n].map(r.transformFunction)));
|
|
341
369
|
}
|
|
342
370
|
}
|
|
343
|
-
function
|
|
371
|
+
function R(e) {
|
|
344
372
|
let t = /([^\\/]+)$/.exec(e);
|
|
345
373
|
return t ? t[1] : "";
|
|
346
374
|
}
|
|
347
|
-
function
|
|
348
|
-
return e.split(".").map((e, t) => t === 0 ?
|
|
375
|
+
function z(e) {
|
|
376
|
+
return e.split(".").map((e, t) => t === 0 ? F(e) : e).join(".");
|
|
349
377
|
}
|
|
350
|
-
var
|
|
378
|
+
var B = class extends Error {
|
|
351
379
|
constructor(e) {
|
|
352
380
|
super(e), this.name = "CACError", typeof Error.captureStackTrace != "function" && (this.stack = Error(e).stack);
|
|
353
381
|
}
|
|
354
|
-
},
|
|
382
|
+
}, V = class {
|
|
355
383
|
rawName;
|
|
356
384
|
description;
|
|
357
385
|
name;
|
|
@@ -361,17 +389,17 @@ var z = class extends Error {
|
|
|
361
389
|
config;
|
|
362
390
|
negated;
|
|
363
391
|
constructor(e, t, n) {
|
|
364
|
-
this.rawName = e, this.description = t, this.config = Object.assign({}, n), e = e.replaceAll(".*", ""), this.negated = !1, this.names =
|
|
392
|
+
this.rawName = e, this.description = t, this.config = Object.assign({}, n), e = e.replaceAll(".*", ""), this.negated = !1, this.names = A(e).split(",").map((e) => {
|
|
365
393
|
let t = e.trim().replace(/^-{1,2}/, "");
|
|
366
|
-
return t.startsWith("no-") && (this.negated = !0, t = t.replace(/^no-/, "")),
|
|
394
|
+
return t.startsWith("no-") && (this.negated = !0, t = t.replace(/^no-/, "")), z(t);
|
|
367
395
|
}).sort((e, t) => e.length > t.length ? 1 : -1), this.name = this.names.at(-1), this.negated && this.config.default == null && (this.config.default = !0), e.includes("<") ? this.required = !0 : e.includes("[") ? this.required = !1 : this.isBoolean = !0;
|
|
368
396
|
}
|
|
369
|
-
},
|
|
397
|
+
}, H, U;
|
|
370
398
|
if (typeof process < "u") {
|
|
371
399
|
let e;
|
|
372
|
-
e = typeof Deno < "u" && typeof Deno.version?.deno == "string" ? "deno" : typeof Bun < "u" && typeof Bun.version == "string" ? "bun" : "node",
|
|
373
|
-
} else
|
|
374
|
-
var
|
|
400
|
+
e = typeof Deno < "u" && typeof Deno.version?.deno == "string" ? "deno" : typeof Bun < "u" && typeof Bun.version == "string" ? "bun" : "node", U = `${process.platform}-${process.arch} ${e}-${process.version}`, H = process.argv;
|
|
401
|
+
} else U = typeof navigator > "u" ? "unknown" : `${navigator.platform} ${navigator.userAgent}`;
|
|
402
|
+
var W = class {
|
|
375
403
|
rawName;
|
|
376
404
|
description;
|
|
377
405
|
config;
|
|
@@ -387,7 +415,7 @@ var U = class {
|
|
|
387
415
|
helpCallback;
|
|
388
416
|
globalCommand;
|
|
389
417
|
constructor(e, t, n = {}, r) {
|
|
390
|
-
this.rawName = e, this.description = t, this.config = n, this.cli = r, this.options = [], this.aliasNames = [], this.name =
|
|
418
|
+
this.rawName = e, this.description = t, this.config = n, this.cli = r, this.options = [], this.aliasNames = [], this.name = A(e), this.args = j(e), this.examples = [];
|
|
391
419
|
}
|
|
392
420
|
usage(e) {
|
|
393
421
|
return this.usageText = e, this;
|
|
@@ -405,7 +433,7 @@ var U = class {
|
|
|
405
433
|
return this.examples.push(e), this;
|
|
406
434
|
}
|
|
407
435
|
option(e, t, n) {
|
|
408
|
-
let r = new
|
|
436
|
+
let r = new V(e, t, n);
|
|
409
437
|
return this.options.push(r), this;
|
|
410
438
|
}
|
|
411
439
|
alias(e) {
|
|
@@ -421,7 +449,7 @@ var U = class {
|
|
|
421
449
|
return this.name === "" || this.aliasNames.includes("!");
|
|
422
450
|
}
|
|
423
451
|
get isGlobalCommand() {
|
|
424
|
-
return this instanceof
|
|
452
|
+
return this instanceof G;
|
|
425
453
|
}
|
|
426
454
|
hasOption(e) {
|
|
427
455
|
return e = e.split(".")[0], this.options.find((t) => t.names.includes(e));
|
|
@@ -432,10 +460,10 @@ var U = class {
|
|
|
432
460
|
title: "Usage",
|
|
433
461
|
body: ` $ ${e} ${this.usageText || this.rawName}`
|
|
434
462
|
}), (this.isGlobalCommand || this.isDefaultCommand) && t.length > 0) {
|
|
435
|
-
let n =
|
|
463
|
+
let n = N(t.map((e) => e.rawName));
|
|
436
464
|
a.push({
|
|
437
465
|
title: "Commands",
|
|
438
|
-
body: t.map((e) => ` ${
|
|
466
|
+
body: t.map((e) => ` ${P(e.rawName, n.length)} ${e.description}`).join("\n")
|
|
439
467
|
}, {
|
|
440
468
|
title: "For more info, run any command with the `--help` flag",
|
|
441
469
|
body: t.map((t) => ` $ ${e}${t.name === "" ? "" : ` ${t.name}`} --help`).join("\n")
|
|
@@ -443,10 +471,10 @@ var U = class {
|
|
|
443
471
|
}
|
|
444
472
|
let o = this.isGlobalCommand ? r : [...this.options, ...r || []];
|
|
445
473
|
if (!this.isGlobalCommand && !this.isDefaultCommand && (o = o.filter((e) => e.name !== "version")), o.length > 0) {
|
|
446
|
-
let e =
|
|
474
|
+
let e = N(o.map((e) => e.rawName));
|
|
447
475
|
a.push({
|
|
448
476
|
title: "Options",
|
|
449
|
-
body: o.map((t) => ` ${
|
|
477
|
+
body: o.map((t) => ` ${P(t.rawName, e.length)} ${t.description} ${t.config.default === void 0 ? "" : `(default: ${t.config.default})`}`).join("\n")
|
|
450
478
|
});
|
|
451
479
|
}
|
|
452
480
|
this.examples.length > 0 && a.push({
|
|
@@ -456,16 +484,16 @@ var U = class {
|
|
|
456
484
|
}
|
|
457
485
|
outputVersion() {
|
|
458
486
|
let { name: e } = this.cli, { versionNumber: t } = this.cli.globalCommand;
|
|
459
|
-
t && console.info(`${e}/${t} ${
|
|
487
|
+
t && console.info(`${e}/${t} ${U}`);
|
|
460
488
|
}
|
|
461
489
|
checkRequiredArgs() {
|
|
462
490
|
let e = this.args.filter((e) => e.required).length;
|
|
463
|
-
if (this.cli.args.length < e) throw new
|
|
491
|
+
if (this.cli.args.length < e) throw new B(`missing required args for command \`${this.rawName}\``);
|
|
464
492
|
}
|
|
465
493
|
checkUnknownOptions() {
|
|
466
494
|
let { options: e, globalCommand: t } = this.cli;
|
|
467
495
|
if (!this.config.allowUnknownOptions) {
|
|
468
|
-
for (let n of Object.keys(e)) if (n !== "--" && !this.hasOption(n) && !t.hasOption(n)) throw new
|
|
496
|
+
for (let n of Object.keys(e)) if (n !== "--" && !this.hasOption(n) && !t.hasOption(n)) throw new B(`Unknown option \`${n.length > 1 ? `--${n}` : `-${n}`}\``);
|
|
469
497
|
}
|
|
470
498
|
}
|
|
471
499
|
checkOptionValue() {
|
|
@@ -474,19 +502,19 @@ var U = class {
|
|
|
474
502
|
let r = e[t.name.split(".")[0]];
|
|
475
503
|
if (t.required) {
|
|
476
504
|
let e = n.some((e) => e.negated && e.names.includes(t.name));
|
|
477
|
-
if (r === !0 || r === !1 && !e) throw new
|
|
505
|
+
if (r === !0 || r === !1 && !e) throw new B(`option \`${t.rawName}\` value is missing`);
|
|
478
506
|
}
|
|
479
507
|
}
|
|
480
508
|
}
|
|
481
509
|
checkUnusedArgs() {
|
|
482
510
|
let e = this.args.some((e) => e.variadic) ? Infinity : this.args.length;
|
|
483
|
-
if (e < this.cli.args.length) throw new
|
|
511
|
+
if (e < this.cli.args.length) throw new B(`Unused args: ${this.cli.args.slice(e).map((e) => `\`${e}\``).join(", ")}`);
|
|
484
512
|
}
|
|
485
|
-
},
|
|
513
|
+
}, G = class extends W {
|
|
486
514
|
constructor(e) {
|
|
487
515
|
super("@@global@@", "", {}, e);
|
|
488
516
|
}
|
|
489
|
-
},
|
|
517
|
+
}, K = class extends EventTarget {
|
|
490
518
|
name;
|
|
491
519
|
commands;
|
|
492
520
|
globalCommand;
|
|
@@ -498,13 +526,13 @@ var U = class {
|
|
|
498
526
|
showHelpOnExit;
|
|
499
527
|
showVersionOnExit;
|
|
500
528
|
constructor(e = "") {
|
|
501
|
-
super(), this.name = e, this.commands = [], this.rawArgs = [], this.args = [], this.options = {}, this.globalCommand = new
|
|
529
|
+
super(), this.name = e, this.commands = [], this.rawArgs = [], this.args = [], this.options = {}, this.globalCommand = new G(this), this.globalCommand.usage("<command> [options]");
|
|
502
530
|
}
|
|
503
531
|
usage(e) {
|
|
504
532
|
return this.globalCommand.usage(e), this;
|
|
505
533
|
}
|
|
506
534
|
command(e, t, n) {
|
|
507
|
-
let r = new
|
|
535
|
+
let r = new W(e, t || "", n, this);
|
|
508
536
|
return r.globalCommand = this.globalCommand, this.commands.push(r), r;
|
|
509
537
|
}
|
|
510
538
|
option(e, t, n) {
|
|
@@ -533,10 +561,10 @@ var U = class {
|
|
|
533
561
|
}
|
|
534
562
|
parse(e, { run: t = !0 } = {}) {
|
|
535
563
|
if (!e) {
|
|
536
|
-
if (!
|
|
537
|
-
e =
|
|
564
|
+
if (!H) throw Error("No argv provided and runtime process argv is not available.");
|
|
565
|
+
e = H;
|
|
538
566
|
}
|
|
539
|
-
this.rawArgs = e, this.name ||= e[1] ?
|
|
567
|
+
this.rawArgs = e, this.name ||= e[1] ? R(e[1]) : "cli";
|
|
540
568
|
let n = !0;
|
|
541
569
|
for (let t of this.commands) {
|
|
542
570
|
let r = this.mri(e.slice(2), t), i = r.args[0];
|
|
@@ -568,19 +596,19 @@ var U = class {
|
|
|
568
596
|
return t && this.runMatchedCommand(), !this.matchedCommand && this.args[0] && this.dispatchEvent(new CustomEvent("command:*", { detail: this.args[0] })), r;
|
|
569
597
|
}
|
|
570
598
|
mri(e, t) {
|
|
571
|
-
let n = [...this.globalCommand.options, ...t ? t.options : []], r =
|
|
599
|
+
let n = [...this.globalCommand.options, ...t ? t.options : []], r = M(n), i = [], a = e.indexOf("--");
|
|
572
600
|
a !== -1 && (i = e.slice(a + 1), e = e.slice(0, a));
|
|
573
|
-
let o =
|
|
601
|
+
let o = k(e, r);
|
|
574
602
|
o = Object.keys(o).reduce((e, t) => ({
|
|
575
603
|
...e,
|
|
576
|
-
[
|
|
604
|
+
[z(t)]: o[t]
|
|
577
605
|
}), { _: [] });
|
|
578
606
|
let s = o._, c = { "--": i }, l = t && t.config.ignoreOptionDefaultValue ? t.config.ignoreOptionDefaultValue : this.globalCommand.config.ignoreOptionDefaultValue, u = Object.create(null);
|
|
579
607
|
for (let e of n) {
|
|
580
608
|
if (!l && e.config.default !== void 0) for (let t of e.names) c[t] = e.config.default;
|
|
581
609
|
Array.isArray(e.config.type) && u[e.name] === void 0 && (u[e.name] = Object.create(null), u[e.name].shouldTransform = !0, u[e.name].transformFunction = e.config.type[0]);
|
|
582
610
|
}
|
|
583
|
-
for (let e of Object.keys(o)) e !== "_" && (
|
|
611
|
+
for (let e of Object.keys(o)) e !== "_" && (I(c, e.split("."), o[e]), L(c, u));
|
|
584
612
|
return {
|
|
585
613
|
args: s,
|
|
586
614
|
options: c
|
|
@@ -595,16 +623,16 @@ var U = class {
|
|
|
595
623
|
t.variadic ? r.push(e.slice(n)) : r.push(e[n]);
|
|
596
624
|
}), r.push(t), n.commandAction.apply(this, r);
|
|
597
625
|
}
|
|
598
|
-
},
|
|
599
|
-
function
|
|
600
|
-
let e =
|
|
626
|
+
}, q = (e = "") => new K(e), J = d.bold(d.cyan("[typerighter]"));
|
|
627
|
+
function Y() {
|
|
628
|
+
let e = q("typerighter");
|
|
601
629
|
process.on("uncaughtException", (e) => {
|
|
602
|
-
|
|
630
|
+
X("runtime", e);
|
|
603
631
|
}), process.on("unhandledRejection", (e) => {
|
|
604
|
-
|
|
632
|
+
X("runtime", e instanceof Error ? e : Error(String(e)));
|
|
605
633
|
}), e.command("[root]", "Start dev server").alias("dev").option("--port <port>", "Port to listen on").option("--host", "Expose to network").action(async (e, t) => {
|
|
606
634
|
let n = await p({
|
|
607
|
-
root:
|
|
635
|
+
root: Z(e),
|
|
608
636
|
configFile: !1,
|
|
609
637
|
plugins: [c()],
|
|
610
638
|
server: {
|
|
@@ -614,7 +642,7 @@ function J() {
|
|
|
614
642
|
});
|
|
615
643
|
await n.listen(), n.printUrls();
|
|
616
644
|
}), e.command("build [root]", "Build for production").option("--outDir <dir>", "Output directory", { default: "dist" }).option("--base <path>", "Base public path", { default: "/" }).action(async (e, t) => {
|
|
617
|
-
let n = s(
|
|
645
|
+
let n = s(Z(e));
|
|
618
646
|
try {
|
|
619
647
|
await S(n, {
|
|
620
648
|
outDir: t.outDir,
|
|
@@ -624,16 +652,16 @@ function J() {
|
|
|
624
652
|
n.dispose();
|
|
625
653
|
}
|
|
626
654
|
}), e.command("init [root]", "Scaffold a new project").action(async (e) => {
|
|
627
|
-
let { initialize: t } = await import("./init-
|
|
628
|
-
await t(
|
|
655
|
+
let { initialize: t } = await import("./init-B9dG7io-.js");
|
|
656
|
+
await t(Z(e));
|
|
629
657
|
}), e.command("preview [root]", "Preview production build").option("--port <port>", "Port to listen on").action(async (e, t) => {
|
|
630
658
|
let { preview: n } = await import("vite");
|
|
631
659
|
(await n({
|
|
632
|
-
root:
|
|
660
|
+
root: Z(e),
|
|
633
661
|
preview: { port: t.port }
|
|
634
662
|
})).printUrls();
|
|
635
663
|
}), e.command("check [root]", "Check vault for errors").option("--fix", "Auto-fix formatting issues").action(async (e, t) => {
|
|
636
|
-
let n = s(
|
|
664
|
+
let n = s(Z(e)), { logger: r } = n;
|
|
637
665
|
try {
|
|
638
666
|
r.start("Checking vault...");
|
|
639
667
|
let e = await n.getTdContext(), i = await e.checkVault();
|
|
@@ -654,14 +682,14 @@ function J() {
|
|
|
654
682
|
} finally {
|
|
655
683
|
n.dispose();
|
|
656
684
|
}
|
|
657
|
-
}), e.help(), e.version("0.
|
|
685
|
+
}), e.help(), e.version("0.10.0"), e.parse();
|
|
658
686
|
}
|
|
659
|
-
function
|
|
687
|
+
function X(e, t) {
|
|
660
688
|
let n = t instanceof Error ? t.message : String(t);
|
|
661
|
-
console.error(`\n${
|
|
689
|
+
console.error(`\n${J} ${d.red(`${e} failed`)}\n`), console.error(d.red(n)), console.error(""), process.exit(1);
|
|
662
690
|
}
|
|
663
|
-
function
|
|
691
|
+
function Z(e) {
|
|
664
692
|
return u.resolve(e ?? process.cwd());
|
|
665
693
|
}
|
|
666
694
|
//#endregion
|
|
667
|
-
export { S as n,
|
|
695
|
+
export { S as n, Y as t };
|
package/dist/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "./cli-
|
|
1
|
+
import { t as e } from "./cli-C3M8uZ5E.js";
|
|
2
2
|
export { e as cli };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/client/app/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EAAE,YAAY,EACxB,MAAM,KAAK,CAAC;AAIb,OAAO,EAEL,KAAK,QAAQ,EAAE,KAAK,UAAU,EAC/B,MAAM,UAAU,CAAC;AAIlB,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,SAAS,GAAG,SAAS,CAAC;IAClC,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QACzB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpB,mBAAmB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,GAAG,OAAO,GAAG,SAAS,CAAC;IACzF,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;CACrE;AAED,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,MAAM,CAA6B,CAAC;AAS5E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,wBAAgB,YAAY,CAC1B,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,EACjE,OAAO,GAAE,aAAkB,GAC1B,MAAM,
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/client/app/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EAAE,YAAY,EACxB,MAAM,KAAK,CAAC;AAIb,OAAO,EAEL,KAAK,QAAQ,EAAE,KAAK,UAAU,EAC/B,MAAM,UAAU,CAAC;AAIlB,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,SAAS,GAAG,SAAS,CAAC;IAClC,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,KAAK,CAAC;IACb,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QACzB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpB,mBAAmB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,GAAG,OAAO,GAAG,SAAS,CAAC;IACzF,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC;CACrE;AAED,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,MAAM,CAA6B,CAAC;AAS5E,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,wBAAgB,YAAY,CAC1B,cAAc,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,EACjE,OAAO,GAAE,aAAkB,GAC1B,MAAM,CAyIR;AAGD,wBAAgB,YAAY,CAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAchD;AAGD,wBAAgB,QAAQ,IAAK,KAAK,CAEjC;AAGD,wBAAgB,SAAS,IAAK,MAAM,CAMnC"}
|