typerighter 0.11.0 → 0.11.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.
- package/dist/{app-C-qfoH4a.js → app-C35j_dTB.js} +1 -1
- package/dist/{cli-SWWO1fzA.js → cli-C_HI052E.js} +53 -53
- package/dist/cli.js +1 -1
- package/dist/client/theme-default.js +515 -421
- package/dist/client.js +1 -1
- package/dist/index.js +2 -2
- package/dist/{init-3_ZHUZAp.js → init-pXnb5d5A.js} +7 -7
- package/dist/node/plugin/vite/index.d.ts.map +1 -1
- package/dist/{shared-BIdsxcZ2.js → shared-xivlz-gA.js} +1 -1
- package/dist/shared.js +2 -2
- package/dist/typerighter.css +1 -1
- package/dist/{vite-8CV23ALg.js → vite-ofOi3oqG.js} +38 -3
- package/dist/vite.js +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as e, _ as t, v as n, w as r } from "./shared-
|
|
1
|
+
import { E as e, _ as t, v as n, w as r } from "./shared-xivlz-gA.js";
|
|
2
2
|
import { Fragment as i, computed as a, createApp as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, h as f, inject as p, markRaw as m, mergeProps as h, nextTick as g, openBlock as _, provide as v, reactive as ee, readonly as y, ref as b, renderList as x, renderSlot as S, shallowRef as C, toDisplayString as w, unref as T, watch as te, withKeys as E, withModifiers as D } from "vue";
|
|
3
3
|
//#region ../../node_modules/.pnpm/@lucide+vue@1.30.0_vue@3.5.40_typescript@6.0.3_/node_modules/@lucide/vue/dist/esm/shared/src/utils/isEmptyString.mjs
|
|
4
4
|
var O = (e) => e === "", ne = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), k = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), re = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), ie = (e) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { A as e,
|
|
2
|
-
import { a as s, n as c, t as l } from "./vite-
|
|
3
|
-
import u from "node:
|
|
4
|
-
import d from "
|
|
5
|
-
import
|
|
6
|
-
import m from "
|
|
1
|
+
import { A as e, I as t, L as n, M as r, d as i, f as a, s as o } from "./shared-xivlz-gA.js";
|
|
2
|
+
import { a as s, n as c, t as l } from "./vite-ofOi3oqG.js";
|
|
3
|
+
import u from "node:fs";
|
|
4
|
+
import d from "node:path";
|
|
5
|
+
import f from "picocolors";
|
|
6
|
+
import { build as p, createServer as m } from "vite";
|
|
7
7
|
import h from "node:fs/promises";
|
|
8
8
|
//#region src/node/build/prerender.ts
|
|
9
9
|
async function g(e) {
|
|
@@ -19,8 +19,8 @@ async function g(e) {
|
|
|
19
19
|
cssFiles: r,
|
|
20
20
|
jsFiles: i,
|
|
21
21
|
base: e.base
|
|
22
|
-
}),
|
|
23
|
-
await h.mkdir(
|
|
22
|
+
}), u = s === "/" ? "index.html" : `${s.replace(/^\//, "")}.html`, f = d.join(e.outDir, u);
|
|
23
|
+
await h.mkdir(d.dirname(f), { recursive: !0 }), await h.writeFile(f, l), o++, e.progress?.update(o, a);
|
|
24
24
|
}));
|
|
25
25
|
}
|
|
26
26
|
function _(e) {
|
|
@@ -58,7 +58,7 @@ ${a}
|
|
|
58
58
|
</html>`;
|
|
59
59
|
}
|
|
60
60
|
async function v(e) {
|
|
61
|
-
let t =
|
|
61
|
+
let t = d.join(e, ".vite", "manifest.json"), n = await h.readFile(t, "utf-8"), r = JSON.parse(n), i = "", a = [], o = [];
|
|
62
62
|
for (let e of Object.values(r)) e.isEntry ? (i = e.file, e.css && a.push(...e.css)) : e.file.endsWith(".js") && o.push(e.file);
|
|
63
63
|
return {
|
|
64
64
|
clientEntry: i,
|
|
@@ -92,13 +92,13 @@ function b(e) {
|
|
|
92
92
|
//#endregion
|
|
93
93
|
//#region src/node/build/index.ts
|
|
94
94
|
var x = "typerighter/client/theme-default";
|
|
95
|
-
async function S(
|
|
96
|
-
let { root:
|
|
95
|
+
async function S(e, t = {}) {
|
|
96
|
+
let { root: n, logger: a } = e, o = d.resolve(n, t.outDir ?? "dist"), s = t.base ?? "/", u = d.join(o, ".client"), f = d.join(o, ".server");
|
|
97
97
|
await h.rm(o, {
|
|
98
98
|
recursive: !0,
|
|
99
99
|
force: !0
|
|
100
100
|
});
|
|
101
|
-
let m = await
|
|
101
|
+
let m = await e.getTdContext(), [_, v, b, S] = await Promise.all([
|
|
102
102
|
m.getConfig(),
|
|
103
103
|
m.listFiles(),
|
|
104
104
|
m.listFilesGroupedBySchema(),
|
|
@@ -106,9 +106,9 @@ async function S(t, n = {}) {
|
|
|
106
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({
|
|
107
107
|
title: _.siteTitle,
|
|
108
108
|
description: _.siteDescription
|
|
109
|
-
}), j = JSON.stringify({ contentTree: k }), M =
|
|
109
|
+
}), j = JSON.stringify({ contentTree: k }), M = d.join(n, "node_modules", ".typerighter");
|
|
110
110
|
await h.mkdir(M, { recursive: !0 });
|
|
111
|
-
let N =
|
|
111
|
+
let N = d.join(M, "client-entry.js"), P = d.join(M, "ssr-entry.js");
|
|
112
112
|
await Promise.all([h.writeFile(N, l({
|
|
113
113
|
contentDir: _.contentDir,
|
|
114
114
|
siteTitle: _.siteTitle,
|
|
@@ -123,51 +123,51 @@ async function S(t, n = {}) {
|
|
|
123
123
|
siteData: j
|
|
124
124
|
}))]);
|
|
125
125
|
try {
|
|
126
|
-
let i = c({ context:
|
|
127
|
-
await
|
|
128
|
-
...
|
|
129
|
-
root:
|
|
126
|
+
let i = c({ context: e }), l = e.createViteLogger(), m = new y(a, "Building client bundle...");
|
|
127
|
+
await p({
|
|
128
|
+
...t.viteConfig,
|
|
129
|
+
root: n,
|
|
130
130
|
base: s,
|
|
131
131
|
plugins: i,
|
|
132
132
|
customLogger: l,
|
|
133
133
|
logLevel: "silent",
|
|
134
134
|
build: {
|
|
135
|
-
...
|
|
136
|
-
outDir:
|
|
135
|
+
...t.viteConfig?.build,
|
|
136
|
+
outDir: u,
|
|
137
137
|
manifest: !0,
|
|
138
138
|
emptyOutDir: !0,
|
|
139
139
|
rollupOptions: {
|
|
140
|
-
...
|
|
140
|
+
...t.viteConfig?.build?.rollupOptions,
|
|
141
141
|
input: N
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
});
|
|
145
|
-
let b = await h.readdir(
|
|
145
|
+
let b = await h.readdir(d.join(u, "assets")).catch(() => []);
|
|
146
146
|
m.done(`Client bundle (${b.length} chunks)`);
|
|
147
147
|
let x = new y(a, "Building SSR bundle...");
|
|
148
|
-
await
|
|
149
|
-
...
|
|
150
|
-
root:
|
|
148
|
+
await p({
|
|
149
|
+
...t.viteConfig,
|
|
150
|
+
root: n,
|
|
151
151
|
base: s,
|
|
152
152
|
plugins: i,
|
|
153
153
|
customLogger: l,
|
|
154
154
|
logLevel: "silent",
|
|
155
155
|
build: {
|
|
156
|
-
...
|
|
157
|
-
outDir:
|
|
156
|
+
...t.viteConfig?.build,
|
|
157
|
+
outDir: f,
|
|
158
158
|
ssr: P,
|
|
159
159
|
emptyOutDir: !0
|
|
160
160
|
}
|
|
161
161
|
}), x.done("SSR bundle");
|
|
162
|
-
let S = v.map((
|
|
163
|
-
let
|
|
164
|
-
return
|
|
162
|
+
let S = v.map((e) => {
|
|
163
|
+
let t = r(e);
|
|
164
|
+
return t === "index" ? "/" : `/${t}`;
|
|
165
165
|
});
|
|
166
166
|
S.push("/"), E(k.children, "", S);
|
|
167
167
|
let C = new y(a, "Pre-rendering pages...");
|
|
168
168
|
await g({
|
|
169
|
-
ssrEntryPath:
|
|
170
|
-
clientOutDir:
|
|
169
|
+
ssrEntryPath: d.join(f, "ssr-entry.js"),
|
|
170
|
+
clientOutDir: u,
|
|
171
171
|
outDir: o,
|
|
172
172
|
base: s,
|
|
173
173
|
pagePaths: S,
|
|
@@ -175,20 +175,20 @@ async function S(t, n = {}) {
|
|
|
175
175
|
progress: C
|
|
176
176
|
}), C.done(`Pre-rendered ${S.length} pages`);
|
|
177
177
|
let D = T(S, s);
|
|
178
|
-
await h.writeFile(
|
|
179
|
-
let O =
|
|
180
|
-
await h.cp(O, A, { recursive: !0 }).catch(() => {}), await w(
|
|
178
|
+
await h.writeFile(d.join(o, "sitemap.xml"), D);
|
|
179
|
+
let O = d.join(u, "assets"), A = d.join(o, "assets");
|
|
180
|
+
await h.cp(O, A, { recursive: !0 }).catch(() => {}), await w(d.join(n, _.contentDir), o);
|
|
181
181
|
} finally {
|
|
182
182
|
await Promise.all([
|
|
183
183
|
h.rm(M, {
|
|
184
184
|
recursive: !0,
|
|
185
185
|
force: !0
|
|
186
186
|
}),
|
|
187
|
-
h.rm(
|
|
187
|
+
h.rm(u, {
|
|
188
188
|
recursive: !0,
|
|
189
189
|
force: !0
|
|
190
190
|
}),
|
|
191
|
-
h.rm(
|
|
191
|
+
h.rm(f, {
|
|
192
192
|
recursive: !0,
|
|
193
193
|
force: !0
|
|
194
194
|
})
|
|
@@ -197,7 +197,7 @@ async function S(t, n = {}) {
|
|
|
197
197
|
a.log(`\nBuild complete. Output: ${o}`);
|
|
198
198
|
}
|
|
199
199
|
function C(e) {
|
|
200
|
-
let
|
|
200
|
+
let r = `/${e.contentDir}/${n}`, i = JSON.parse(e.siteConfig), o = JSON.parse(e.siteData), s = a((o.contentTree ?? {
|
|
201
201
|
rootItems: [],
|
|
202
202
|
children: []
|
|
203
203
|
}).children ?? [], i.title ?? ""), c = JSON.stringify({
|
|
@@ -212,8 +212,8 @@ import { renderToString } from 'vue/server-renderer';
|
|
|
212
212
|
import { h } from 'vue';
|
|
213
213
|
import theme from '${e.layoutImport}';
|
|
214
214
|
|
|
215
|
-
const pages = import.meta.glob('${
|
|
216
|
-
const contentExts = ${JSON.stringify(
|
|
215
|
+
const pages = import.meta.glob('${r}', { eager: true });
|
|
216
|
+
const contentExts = ${JSON.stringify(t)};
|
|
217
217
|
const siteData = ${c};
|
|
218
218
|
|
|
219
219
|
function findPage(base) {
|
|
@@ -248,13 +248,13 @@ export async function render(url) {
|
|
|
248
248
|
}
|
|
249
249
|
`;
|
|
250
250
|
}
|
|
251
|
-
async function w(
|
|
252
|
-
let r = (await h.readdir(
|
|
251
|
+
async function w(t, n) {
|
|
252
|
+
let r = (await h.readdir(t, {
|
|
253
253
|
recursive: !0,
|
|
254
254
|
withFileTypes: !0
|
|
255
|
-
})).filter((
|
|
256
|
-
let r =
|
|
257
|
-
return h.mkdir(
|
|
255
|
+
})).filter((t) => t.isFile() && !e(t.name)).map(async (e) => {
|
|
256
|
+
let r = d.join(e.parentPath, e.name), i = d.relative(t, r), a = d.join(n, i);
|
|
257
|
+
return h.mkdir(d.dirname(a), { recursive: !0 }).then(() => h.copyFile(r, a));
|
|
258
258
|
});
|
|
259
259
|
await Promise.all(r);
|
|
260
260
|
}
|
|
@@ -623,7 +623,7 @@ var W = class {
|
|
|
623
623
|
t.variadic ? r.push(e.slice(n)) : r.push(e[n]);
|
|
624
624
|
}), r.push(t), n.commandAction.apply(this, r);
|
|
625
625
|
}
|
|
626
|
-
}, q = (e = "") => new K(e), J =
|
|
626
|
+
}, q = (e = "") => new K(e), J = f.bold(f.cyan("[typerighter]"));
|
|
627
627
|
function Y() {
|
|
628
628
|
let e = q("typerighter");
|
|
629
629
|
process.on("uncaughtException", (e) => {
|
|
@@ -631,7 +631,7 @@ function Y() {
|
|
|
631
631
|
}), process.on("unhandledRejection", (e) => {
|
|
632
632
|
X("runtime", e instanceof Error ? e : Error(String(e)));
|
|
633
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) => {
|
|
634
|
-
let n = await
|
|
634
|
+
let n = await m({
|
|
635
635
|
root: Z(e),
|
|
636
636
|
configFile: !1,
|
|
637
637
|
plugins: [c()],
|
|
@@ -652,7 +652,7 @@ function Y() {
|
|
|
652
652
|
n.dispose();
|
|
653
653
|
}
|
|
654
654
|
}), e.command("init [root]", "Scaffold a new project").action(async (e) => {
|
|
655
|
-
let { initialize: t } = await import("./init-
|
|
655
|
+
let { initialize: t } = await import("./init-pXnb5d5A.js");
|
|
656
656
|
await t(Z(e));
|
|
657
657
|
}), e.command("preview [root]", "Preview production build").option("--port <port>", "Port to listen on").action(async (e, t) => {
|
|
658
658
|
let { preview: n } = await import("vite");
|
|
@@ -671,8 +671,8 @@ function Y() {
|
|
|
671
671
|
for (let r of n) {
|
|
672
672
|
let n = await e.formatFile(r);
|
|
673
673
|
if (n.changed) {
|
|
674
|
-
let e =
|
|
675
|
-
|
|
674
|
+
let e = d.resolve(t.contentDir, r);
|
|
675
|
+
u.writeFileSync(e, n.content), i++;
|
|
676
676
|
}
|
|
677
677
|
}
|
|
678
678
|
0 < i && r.success(`Fixed ${i} file(s)`);
|
|
@@ -682,14 +682,14 @@ function Y() {
|
|
|
682
682
|
} finally {
|
|
683
683
|
n.dispose();
|
|
684
684
|
}
|
|
685
|
-
}), e.help(), e.version("0.11.
|
|
685
|
+
}), e.help(), e.version("0.11.2"), e.parse();
|
|
686
686
|
}
|
|
687
687
|
function X(e, t) {
|
|
688
688
|
let n = t instanceof Error ? t.message : String(t);
|
|
689
|
-
console.error(`\n${J} ${
|
|
689
|
+
console.error(`\n${J} ${f.red(`${e} failed`)}\n`), console.error(f.red(n)), console.error(""), process.exit(1);
|
|
690
690
|
}
|
|
691
691
|
function Z(e) {
|
|
692
|
-
return
|
|
692
|
+
return d.resolve(e ?? process.cwd());
|
|
693
693
|
}
|
|
694
694
|
//#endregion
|
|
695
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-C_HI052E.js";
|
|
2
2
|
export { e as cli };
|