typerighter 0.11.1 → 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/{cli-CfUKa6Fr.js → cli-C_HI052E.js} +33 -33
- package/dist/cli.js +1 -1
- package/dist/client/theme-default.js +2 -2
- package/dist/index.js +2 -2
- package/dist/{init-WIepteR4.js → init-pXnb5d5A.js} +3 -3
- package/dist/node/plugin/vite/index.d.ts.map +1 -1
- package/dist/typerighter.css +1 -1
- package/dist/{vite-rQslY59S.js → vite-ofOi3oqG.js} +38 -3
- package/dist/vite.js +1 -1
- package/package.json +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
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-
|
|
3
|
-
import u from "node:
|
|
4
|
-
import d from "
|
|
5
|
-
import
|
|
6
|
-
import m from "
|
|
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,
|
|
@@ -93,7 +93,7 @@ function b(e) {
|
|
|
93
93
|
//#region src/node/build/index.ts
|
|
94
94
|
var x = "typerighter/client/theme-default";
|
|
95
95
|
async function S(e, t = {}) {
|
|
96
|
-
let { root: n, logger: a } = e, o =
|
|
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
|
|
@@ -106,9 +106,9 @@ async function S(e, t = {}) {
|
|
|
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,
|
|
@@ -124,7 +124,7 @@ async function S(e, t = {}) {
|
|
|
124
124
|
}))]);
|
|
125
125
|
try {
|
|
126
126
|
let i = c({ context: e }), l = e.createViteLogger(), m = new y(a, "Building client bundle...");
|
|
127
|
-
await
|
|
127
|
+
await p({
|
|
128
128
|
...t.viteConfig,
|
|
129
129
|
root: n,
|
|
130
130
|
base: s,
|
|
@@ -133,7 +133,7 @@ async function S(e, t = {}) {
|
|
|
133
133
|
logLevel: "silent",
|
|
134
134
|
build: {
|
|
135
135
|
...t.viteConfig?.build,
|
|
136
|
-
outDir:
|
|
136
|
+
outDir: u,
|
|
137
137
|
manifest: !0,
|
|
138
138
|
emptyOutDir: !0,
|
|
139
139
|
rollupOptions: {
|
|
@@ -142,10 +142,10 @@ async function S(e, t = {}) {
|
|
|
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
|
|
148
|
+
await p({
|
|
149
149
|
...t.viteConfig,
|
|
150
150
|
root: n,
|
|
151
151
|
base: s,
|
|
@@ -154,7 +154,7 @@ async function S(e, t = {}) {
|
|
|
154
154
|
logLevel: "silent",
|
|
155
155
|
build: {
|
|
156
156
|
...t.viteConfig?.build,
|
|
157
|
-
outDir:
|
|
157
|
+
outDir: f,
|
|
158
158
|
ssr: P,
|
|
159
159
|
emptyOutDir: !0
|
|
160
160
|
}
|
|
@@ -166,8 +166,8 @@ async function S(e, t = {}) {
|
|
|
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(e, t = {}) {
|
|
|
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
|
})
|
|
@@ -253,8 +253,8 @@ async function w(t, n) {
|
|
|
253
253
|
recursive: !0,
|
|
254
254
|
withFileTypes: !0
|
|
255
255
|
})).filter((t) => t.isFile() && !e(t.name)).map(async (e) => {
|
|
256
|
-
let r =
|
|
257
|
-
return h.mkdir(
|
|
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 };
|
|
@@ -570,7 +570,7 @@ var Mt = {
|
|
|
570
570
|
class: "td-widget-ref"
|
|
571
571
|
}, W(G(n).name), 9, Lt))])) : (B(), N("span", Rt, W(e.value), 1));
|
|
572
572
|
}
|
|
573
|
-
}), [["__scopeId", "data-v-
|
|
573
|
+
}), [["__scopeId", "data-v-876b5225"]]), Bt = { class: "td-widget-list" }, Vt = { class: "td-widget-list" }, Ht = 5, Ut = /*#__PURE__*/ T(/* @__PURE__ */ I({
|
|
574
574
|
__name: "TdWidgetList",
|
|
575
575
|
props: {
|
|
576
576
|
definition: {},
|
|
@@ -706,7 +706,7 @@ var qt = 5, Jt = /*#__PURE__*/ T(/* @__PURE__ */ I({
|
|
|
706
706
|
class: "td-widget-file-link"
|
|
707
707
|
}, [F(G(Ne), { class: "td-widget-file-icon" }), P("span", $t, W(G(n).split("/").pop() ?? G(n)), 1)], 8, Qt)) : (B(), N(k, { key: 2 }, [me(W(s(e.value)), 1)], 64));
|
|
708
708
|
}
|
|
709
|
-
}), [["__scopeId", "data-v-
|
|
709
|
+
}), [["__scopeId", "data-v-fd07e395"]]), tn = {
|
|
710
710
|
key: 0,
|
|
711
711
|
class: "td-frontmatter-empty"
|
|
712
712
|
}, nn = /*#__PURE__*/ T(/* @__PURE__ */ I({
|
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-ofOi3oqG.js";
|
|
2
2
|
import "./vite.js";
|
|
3
|
-
import { n, t as r } from "./cli-
|
|
3
|
+
import { n, t as r } from "./cli-C_HI052E.js";
|
|
4
4
|
export { n as buildSite, r as cli, t as generateClientAppEntry, e as typedown };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { V as e, s as t } from "./shared-xivlz-gA.js";
|
|
2
|
-
import { i as n, r } from "./vite-
|
|
2
|
+
import { i as n, r } from "./vite-ofOi3oqG.js";
|
|
3
3
|
import { a as i, i as a, n as o, r as s, t as c } from "./brand-CG1fQshq.js";
|
|
4
|
-
import l from "node:path";
|
|
5
4
|
import "node:fs";
|
|
5
|
+
import l from "node:path";
|
|
6
6
|
import u from "node:fs/promises";
|
|
7
7
|
import { styleText as d } from "node:util";
|
|
8
8
|
import f, { stdin as p, stdout as m } from "node:process";
|
|
@@ -2303,7 +2303,7 @@ function ai(e) {
|
|
|
2303
2303
|
build: "typerighter build",
|
|
2304
2304
|
preview: "typerighter preview"
|
|
2305
2305
|
},
|
|
2306
|
-
devDependencies: { typerighter: "^0.11.
|
|
2306
|
+
devDependencies: { typerighter: "^0.11.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":"
|
|
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,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,CAiUvE"}
|