typerighter 0.1.2 → 0.1.4
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/bin/typedown.js +3 -0
- package/dist/{app-bn8sNpDS.js → app-CM3biamr.js} +18 -14
- package/dist/client/app/composables/useTdContent.d.ts +2 -1
- package/dist/client/app/composables/useTdContent.d.ts.map +1 -1
- package/dist/client/theme-default.js +1 -1
- package/dist/client.js +1 -1
- package/dist/index.js +103 -163
- package/dist/node/build/html.d.ts +1 -0
- package/dist/node/build/html.d.ts.map +1 -1
- package/dist/node/build/html.test.d.ts +2 -0
- package/dist/node/build/html.test.d.ts.map +1 -0
- package/dist/node/build/index.d.ts +0 -4
- package/dist/node/build/index.d.ts.map +1 -1
- package/dist/node/cli/index.d.ts +1 -1
- package/dist/node/cli/index.d.ts.map +1 -1
- package/dist/node/cli/init.d.ts +2 -0
- package/dist/node/cli/init.d.ts.map +1 -0
- package/dist/node/index.d.ts +0 -1
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/lib/typedown-context.d.ts.map +1 -1
- package/dist/node/plugin/{codegen.d.ts → vite/codegen.d.ts} +11 -0
- package/dist/node/plugin/vite/codegen.d.ts.map +1 -0
- package/dist/node/plugin/vite/codegen.test.d.ts.map +1 -0
- package/dist/node/plugin/vite/constants.d.ts.map +1 -0
- package/dist/node/plugin/{vite.d.ts → vite/index.d.ts} +1 -1
- package/dist/node/plugin/vite/index.d.ts.map +1 -0
- package/dist/plugin-C-rHOs3n.js +228 -0
- package/dist/{typedown-context-CWA07Yb7.js → typedown-context-WluCH44c.js} +82 -7
- package/dist/typedown-context-lK0KGe3B.js +2 -0
- package/dist/vite.js +2 -174
- package/package.json +10 -6
- package/dist/logger-DZLd8EDg.js +0 -78
- package/dist/node/build/codegen.d.ts +0 -13
- package/dist/node/build/codegen.d.ts.map +0 -1
- package/dist/node/cli/server.d.ts +0 -5
- package/dist/node/cli/server.d.ts.map +0 -1
- package/dist/node/plugin/codegen.d.ts.map +0 -1
- package/dist/node/plugin/codegen.test.d.ts.map +0 -1
- package/dist/node/plugin/constants.d.ts.map +0 -1
- package/dist/node/plugin/vite.d.ts.map +0 -1
- package/dist/node/plugin.d.ts +0 -3
- package/dist/node/plugin.d.ts.map +0 -1
- package/dist/typedown-context-D78bYNhH.js +0 -2
- /package/dist/node/plugin/{codegen.test.d.ts → vite/codegen.test.d.ts} +0 -0
- /package/dist/node/plugin/{constants.d.ts → vite/constants.d.ts} +0 -0
package/bin/typedown.js
ADDED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import "./shared-DzTfF-_d.js";
|
|
2
|
-
import { computed as e, createApp as t, defineComponent as n, h as r, inject as i, markRaw as a, nextTick as o,
|
|
3
|
-
import { createInjectionState as u } from "@vueuse/core";
|
|
2
|
+
import { computed as e, createApp as t, defineComponent as n, h as r, inject as i, markRaw as a, nextTick as o, provide as s, reactive as c, readonly as l, ref as u } from "vue";
|
|
4
3
|
//#region src/shared/utils/environment.ts
|
|
5
4
|
var d = typeof window < "u", f = Symbol("typedown-router"), p = {
|
|
6
5
|
schema: "",
|
|
@@ -9,7 +8,7 @@ var d = typeof window < "u", f = Symbol("typedown-router"), p = {
|
|
|
9
8
|
title: "Not Found"
|
|
10
9
|
};
|
|
11
10
|
function m(e, t) {
|
|
12
|
-
let n =
|
|
11
|
+
let n = c({
|
|
13
12
|
path: "/",
|
|
14
13
|
hash: "",
|
|
15
14
|
query: "",
|
|
@@ -18,10 +17,10 @@ function m(e, t) {
|
|
|
18
17
|
}), r = {
|
|
19
18
|
route: n,
|
|
20
19
|
async go(e, t) {
|
|
21
|
-
e = y(e), await r.onBeforeRouteChange?.(e) !== !1 && ((!d || t?.initialLoad || v(e, t)) && await
|
|
20
|
+
e = y(e), await r.onBeforeRouteChange?.(e) !== !1 && ((!d || t?.initialLoad || v(e, t)) && await s(e), l(), await r.onAfterRouteChange?.(e));
|
|
22
21
|
}
|
|
23
22
|
}, i;
|
|
24
|
-
async function
|
|
23
|
+
async function s(r) {
|
|
25
24
|
let s = new URL(r, "http://a.com"), c = i = s.pathname;
|
|
26
25
|
try {
|
|
27
26
|
let t = await e(c);
|
|
@@ -54,7 +53,7 @@ function m(e, t) {
|
|
|
54
53
|
}, { capture: !0 }), window.addEventListener("popstate", async (e) => {
|
|
55
54
|
if (e.state == null) return;
|
|
56
55
|
let t = y(location.href);
|
|
57
|
-
await
|
|
56
|
+
await s(t), l(), await r.onAfterRouteChange?.(t);
|
|
58
57
|
}), window.addEventListener("hashchange", (e) => {
|
|
59
58
|
e.preventDefault(), l();
|
|
60
59
|
})), r;
|
|
@@ -105,7 +104,7 @@ function S(e) {
|
|
|
105
104
|
function C() {
|
|
106
105
|
return typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
107
106
|
}
|
|
108
|
-
var w =
|
|
107
|
+
var w = u("system"), T = u(C()), E = !1;
|
|
109
108
|
function D() {
|
|
110
109
|
O();
|
|
111
110
|
let t = e(() => w.value === "system" ? T.value : w.value), n = e(() => t.value === "dark");
|
|
@@ -116,7 +115,7 @@ function D() {
|
|
|
116
115
|
r(t.value === "light" ? "dark" : "light");
|
|
117
116
|
}
|
|
118
117
|
return {
|
|
119
|
-
theme:
|
|
118
|
+
theme: l(w),
|
|
120
119
|
effectiveTheme: t,
|
|
121
120
|
isDark: n,
|
|
122
121
|
setTheme: r,
|
|
@@ -136,15 +135,20 @@ function O() {
|
|
|
136
135
|
}
|
|
137
136
|
//#endregion
|
|
138
137
|
//#region src/client/app/composables/useTdContent.ts
|
|
139
|
-
var
|
|
140
|
-
function
|
|
141
|
-
let n = D()
|
|
142
|
-
return {
|
|
138
|
+
var k = Symbol("td-content");
|
|
139
|
+
function A(t) {
|
|
140
|
+
let n = D(), r = {
|
|
143
141
|
page: e(() => t.data),
|
|
144
142
|
frontmatter: e(() => t.data.frontmatter),
|
|
145
143
|
title: e(() => t.data.title),
|
|
146
144
|
isDark: e(() => n.isDark.value)
|
|
147
145
|
};
|
|
146
|
+
return s(k, r), r;
|
|
147
|
+
}
|
|
148
|
+
function j() {
|
|
149
|
+
let e = i(k);
|
|
150
|
+
if (e === void 0) throw Error("useTdContent() called without a parent provideTdContent()");
|
|
151
|
+
return e;
|
|
148
152
|
}
|
|
149
153
|
//#endregion
|
|
150
154
|
//#region src/client/app/index.ts
|
|
@@ -156,7 +160,7 @@ async function P(e, i, a = {}, o = {}) {
|
|
|
156
160
|
}, c = { sidebarGroups: o.sidebarGroups ?? {} }, l = m(e), u = t(n({
|
|
157
161
|
name: "TypedownApp",
|
|
158
162
|
setup() {
|
|
159
|
-
return
|
|
163
|
+
return A(l.route), () => r(i);
|
|
160
164
|
}
|
|
161
165
|
}));
|
|
162
166
|
return u.provide(f, l), u.provide(M, s), u.provide(N, c), u.component("TypedownContent", b), d && await l.go(location.href, {
|
|
@@ -177,4 +181,4 @@ function I() {
|
|
|
177
181
|
return i(N, { sidebarGroups: {} });
|
|
178
182
|
}
|
|
179
183
|
//#endregion
|
|
180
|
-
export { D as a, _ as c,
|
|
184
|
+
export { D as a, _ as c, j as i, F as n, b as o, I as r, g as s, P as t };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Route } from '../router';
|
|
2
2
|
import type { TypedownData } from '@/shared';
|
|
3
|
-
export declare
|
|
3
|
+
export declare function provideTdContent(route: Route): TypedownData;
|
|
4
|
+
export declare function useTdContent(): TypedownData;
|
|
4
5
|
//# sourceMappingURL=useTdContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTdContent.d.ts","sourceRoot":"","sources":["../../../../src/client/app/composables/useTdContent.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,KAAK,EACN,MAAM,WAAW,CAAC;AAInB,OAAO,KAAK,EACV,YAAY,EACb,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useTdContent.d.ts","sourceRoot":"","sources":["../../../../src/client/app/composables/useTdContent.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,KAAK,EACN,MAAM,WAAW,CAAC;AAInB,OAAO,KAAK,EACV,YAAY,EACb,MAAM,UAAU,CAAC;AAKlB,wBAAgB,gBAAgB,CAAE,KAAK,EAAE,KAAK,GAAG,YAAY,CAY5D;AAGD,wBAAgB,YAAY,IAAK,YAAY,CAQ5C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../shared-DzTfF-_d.js";
|
|
2
2
|
import { a as e, i as t, n, o as r, s as i, t as a } from "../brand-DSd9HWVy.js";
|
|
3
|
-
import { a as o, i as s, n as c, o as l, r as ee, s as te } from "../app-
|
|
3
|
+
import { a as o, i as s, n as c, o as l, r as ee, s as te } from "../app-CM3biamr.js";
|
|
4
4
|
import { Fragment as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as ne, createVNode as g, defineComponent as _, h as v, normalizeClass as y, onMounted as b, onUnmounted as x, openBlock as S, readonly as re, ref as C, renderList as w, renderSlot as T, toDisplayString as E, unref as D, watch as O, withCtx as k } from "vue";
|
|
5
5
|
//#region ../../node_modules/.pnpm/lucide-vue-next@1.0.0_vue@3.5.40_typescript@6.0.3_/node_modules/lucide-vue-next/dist/esm/shared/src/utils/hasA11yProp.js
|
|
6
6
|
var ie = (e) => {
|
package/dist/client.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { c as e, i as t, n, o as r, r as i, s as a, t as o } from "./app-
|
|
1
|
+
import { c as e, i as t, n, o as r, r as i, s as a, t as o } from "./app-CM3biamr.js";
|
|
2
2
|
export { r as Content, o as createTypedownApp, a as useRoute, e as useRouter, n as useSiteConfig, i as useSiteData, t as useTdContent };
|
package/dist/index.js
CHANGED
|
@@ -1,187 +1,127 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
async function o(e = {}, t) {
|
|
8
|
-
return n({
|
|
9
|
-
root: t.root,
|
|
10
|
-
base: t.base,
|
|
11
|
-
cacheDir: t.cacheDir,
|
|
12
|
-
plugins: [],
|
|
13
|
-
server: e,
|
|
14
|
-
customLogger: t.logger,
|
|
15
|
-
configFile: t.configFile
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/node/build/html.ts
|
|
20
|
-
function s(e) {
|
|
21
|
-
let t = e.cssFiles.map((t) => ` <link rel="stylesheet" href="${e.base}${t}">`).join("\n"), n = e.jsFiles.map((t) => ` <link rel="modulepreload" href="${e.base}${t}">`).join("\n");
|
|
22
|
-
return `<!DOCTYPE html>
|
|
23
|
-
<html lang="${e.lang ?? "en"}">
|
|
24
|
-
<head>
|
|
25
|
-
<meta charset="UTF-8">
|
|
26
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
27
|
-
<title>${c(e.title)}</title>
|
|
28
|
-
<meta name="description" content="${c(e.description)}">
|
|
29
|
-
${t}
|
|
30
|
-
${n}
|
|
31
|
-
</head>
|
|
32
|
-
<body>
|
|
33
|
-
<div id="app">${e.content}</div>
|
|
34
|
-
<script type="module" src="${e.base}${e.clientEntry}"><\/script>
|
|
35
|
-
</body>
|
|
36
|
-
</html>`;
|
|
37
|
-
}
|
|
38
|
-
function c(e) {
|
|
39
|
-
return e.replaceAll("&", "&").replaceAll("\"", """).replaceAll("<", "<").replaceAll(">", ">");
|
|
40
|
-
}
|
|
41
|
-
//#endregion
|
|
1
|
+
import { r as e } from "./typedown-context-WluCH44c.js";
|
|
2
|
+
import { i as t, n, r, t as i } from "./plugin-C-rHOs3n.js";
|
|
3
|
+
import a from "node:path";
|
|
4
|
+
import o from "node:fs/promises";
|
|
5
|
+
import s from "node:os";
|
|
6
|
+
import { build as c } from "vite";
|
|
42
7
|
//#region src/node/build/render.ts
|
|
43
8
|
async function l(e) {
|
|
44
|
-
let
|
|
9
|
+
let n = await import(e.ssrEntryPath), { clientEntry: r, cssFiles: i, jsFiles: s } = await u(e.clientOutDir);
|
|
45
10
|
for (let c = 0; c < e.pagePaths.length; c += 8) {
|
|
46
11
|
let l = e.pagePaths.slice(c, c + 8);
|
|
47
12
|
await Promise.all(l.map(async (c) => {
|
|
48
|
-
let l = await
|
|
13
|
+
let l = await n.render(c), u = t({
|
|
49
14
|
content: l.html,
|
|
50
15
|
title: l.pageData.title,
|
|
51
16
|
description: l.pageData.frontmatter.description === void 0 ? "" : String(l.pageData.frontmatter.description),
|
|
52
|
-
clientEntry:
|
|
53
|
-
cssFiles:
|
|
54
|
-
jsFiles:
|
|
17
|
+
clientEntry: r,
|
|
18
|
+
cssFiles: i,
|
|
19
|
+
jsFiles: s,
|
|
55
20
|
base: e.base
|
|
56
|
-
}), d = c === "/" ? "index.html" : `${c.replace(/^\//, "")}.html`, f =
|
|
57
|
-
await
|
|
21
|
+
}), d = c === "/" ? "index.html" : `${c.replace(/^\//, "")}.html`, f = a.join(e.outDir, d);
|
|
22
|
+
await o.mkdir(a.dirname(f), { recursive: !0 }), await o.writeFile(f, u);
|
|
58
23
|
}));
|
|
59
24
|
}
|
|
60
25
|
}
|
|
61
26
|
async function u(e) {
|
|
62
|
-
let t =
|
|
63
|
-
for (let e of
|
|
27
|
+
let t = a.join(e, "assets"), n = [], r = await o.readdir(t).catch(() => n), i = [], s = [], c = "";
|
|
28
|
+
for (let e of r) e.endsWith(".css") ? i.push(`assets/${e}`) : e.endsWith(".js") && (e.startsWith("client-entry") || e.startsWith("index") ? c = `assets/${e}` : s.push(`assets/${e}`));
|
|
64
29
|
return !c && s.length > 0 && (c = s[0], s.splice(0, 1)), {
|
|
65
30
|
clientEntry: c,
|
|
66
|
-
cssFiles:
|
|
31
|
+
cssFiles: i,
|
|
67
32
|
jsFiles: s
|
|
68
33
|
};
|
|
69
34
|
}
|
|
70
35
|
//#endregion
|
|
71
|
-
//#region src/node/build/codegen.ts
|
|
72
|
-
function d(e) {
|
|
73
|
-
let t = `/${e.contentDir}/**/*.td`;
|
|
74
|
-
return `\
|
|
75
|
-
import { createTypedownApp } from '${e.typerighterPackage}/dist/client';
|
|
76
|
-
import Layout from '${e.layoutImport}';
|
|
77
|
-
|
|
78
|
-
const pages = import.meta.glob('${t}');
|
|
79
|
-
|
|
80
|
-
async function loadPageModule(pagePath) {
|
|
81
|
-
const key = '/${e.contentDir}/' + pagePath.replace(/^\\//, '') + '.td';
|
|
82
|
-
const altKey = '/${e.contentDir}/' + pagePath.replace(/^\\//, '') + '/index.td';
|
|
83
|
-
const loader = pages[key] || pages[altKey];
|
|
84
|
-
if (!loader) return undefined;
|
|
85
|
-
return loader();
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
async function main() {
|
|
89
|
-
const { app } = await createTypedownApp(loadPageModule, Layout);
|
|
90
|
-
app.mount('#app');
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
main();
|
|
94
|
-
`;
|
|
95
|
-
}
|
|
96
|
-
function f(e) {
|
|
97
|
-
let t = `/${e.contentDir}/**/*.td`;
|
|
98
|
-
return `\
|
|
99
|
-
import { createTypedownApp } from '${e.typerighterPackage}/dist/client';
|
|
100
|
-
import { renderToString } from 'vue/server-renderer';
|
|
101
|
-
import Layout from '${e.layoutImport}';
|
|
102
|
-
|
|
103
|
-
const pages = import.meta.glob('${t}', { eager: true });
|
|
104
|
-
|
|
105
|
-
function loadPageModule(pagePath) {
|
|
106
|
-
const key = '/${e.contentDir}/' + pagePath.replace(/^\\//, '') + '.td';
|
|
107
|
-
const altKey = '/${e.contentDir}/' + pagePath.replace(/^\\//, '') + '/index.td';
|
|
108
|
-
return Promise.resolve(pages[key] || pages[altKey]);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export async function render(url) {
|
|
112
|
-
const { app, router } = await createTypedownApp(loadPageModule, Layout);
|
|
113
|
-
|
|
114
|
-
await router.go(url, { replace: true });
|
|
115
|
-
|
|
116
|
-
const html = await renderToString(app);
|
|
117
|
-
|
|
118
|
-
return {
|
|
119
|
-
html,
|
|
120
|
-
pageData: router.route.data,
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
`;
|
|
124
|
-
}
|
|
125
|
-
//#endregion
|
|
126
36
|
//#region src/node/build/index.ts
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
37
|
+
var d = "typerighter/client/theme-default";
|
|
38
|
+
async function f(t) {
|
|
39
|
+
let i = a.resolve(t.root), u = a.resolve(i, t.outDir ?? "dist"), f = t.base ?? "/", m = a.join(u, ".client"), h = a.join(u, ".server"), { tdContext: g } = await import("./typedown-context-lK0KGe3B.js"), [_, v, y] = await Promise.all([
|
|
40
|
+
g.getConfig(),
|
|
41
|
+
g.listFiles(),
|
|
42
|
+
g.listFilesGroupedBySchema()
|
|
43
|
+
]), b = v.some((e) => e === "index.td"), x = JSON.stringify({
|
|
44
|
+
title: _.siteTitle,
|
|
45
|
+
description: _.siteDescription
|
|
46
|
+
}), S = JSON.stringify({ sidebarGroups: y }), C = await o.mkdtemp(a.join(s.tmpdir(), "typerighter-")), w = a.join(C, "client-entry.js"), T = a.join(C, "ssr-entry.js");
|
|
47
|
+
await Promise.all([o.writeFile(w, n({
|
|
48
|
+
contentDir: _.contentDir,
|
|
49
|
+
siteTitle: _.siteTitle,
|
|
50
|
+
siteDescription: _.siteDescription,
|
|
51
|
+
hasIndex: b,
|
|
52
|
+
sidebarGroups: y
|
|
53
|
+
})), o.writeFile(T, r({
|
|
54
|
+
contentDir: _.contentDir,
|
|
55
|
+
layoutImport: d,
|
|
56
|
+
siteConfig: x,
|
|
57
|
+
siteData: S
|
|
58
|
+
}))]);
|
|
59
|
+
try {
|
|
60
|
+
e.info("Phase 1: Building client bundle..."), await c({
|
|
61
|
+
...t.viteConfig,
|
|
62
|
+
root: i,
|
|
63
|
+
base: f,
|
|
64
|
+
build: {
|
|
65
|
+
...t.viteConfig?.build,
|
|
66
|
+
outDir: m,
|
|
67
|
+
ssrManifest: !0,
|
|
68
|
+
emptyOutDir: !0,
|
|
69
|
+
rollupOptions: {
|
|
70
|
+
...t.viteConfig?.build?.rollupOptions,
|
|
71
|
+
input: w
|
|
72
|
+
}
|
|
146
73
|
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
74
|
+
}), e.info("Phase 2: Building SSR bundle..."), await c({
|
|
75
|
+
...t.viteConfig,
|
|
76
|
+
root: i,
|
|
77
|
+
base: f,
|
|
78
|
+
build: {
|
|
79
|
+
...t.viteConfig?.build,
|
|
80
|
+
outDir: h,
|
|
81
|
+
ssr: T,
|
|
82
|
+
emptyOutDir: !0
|
|
83
|
+
}
|
|
84
|
+
}), e.info("Phase 3: Pre-rendering pages...");
|
|
85
|
+
let n = v.map((e) => {
|
|
86
|
+
let t = e.replace(/\.td$/, "");
|
|
87
|
+
return t === "index" ? "/" : `/${t}`;
|
|
88
|
+
});
|
|
89
|
+
await l({
|
|
90
|
+
ssrEntryPath: a.join(h, "ssr-entry.js"),
|
|
91
|
+
clientOutDir: m,
|
|
92
|
+
outDir: u,
|
|
93
|
+
base: f,
|
|
94
|
+
pagePaths: n
|
|
95
|
+
});
|
|
96
|
+
let r = a.join(m, "assets"), s = a.join(u, "assets");
|
|
97
|
+
await o.cp(r, s, { recursive: !0 }).catch(() => {}), await p(a.join(i, _.contentDir), u);
|
|
98
|
+
} finally {
|
|
99
|
+
await Promise.all([
|
|
100
|
+
o.rm(C, {
|
|
101
|
+
recursive: !0,
|
|
102
|
+
force: !0
|
|
103
|
+
}),
|
|
104
|
+
o.rm(m, {
|
|
105
|
+
recursive: !0,
|
|
106
|
+
force: !0
|
|
107
|
+
}),
|
|
108
|
+
o.rm(h, {
|
|
109
|
+
recursive: !0,
|
|
110
|
+
force: !0
|
|
111
|
+
})
|
|
112
|
+
]);
|
|
113
|
+
}
|
|
114
|
+
e.info(`Build complete. Output: ${u}`);
|
|
115
|
+
}
|
|
116
|
+
async function p(e, t) {
|
|
117
|
+
let n = (await o.readdir(e, {
|
|
118
|
+
recursive: !0,
|
|
119
|
+
withFileTypes: !0
|
|
120
|
+
})).filter((e) => e.isFile() && !e.name.endsWith(".td")).map((n) => {
|
|
121
|
+
let r = a.join(n.parentPath, n.name), i = a.relative(e, r), s = a.join(t, i);
|
|
122
|
+
return o.mkdir(a.dirname(s), { recursive: !0 }).then(() => o.copyFile(r, s));
|
|
169
123
|
});
|
|
170
|
-
|
|
171
|
-
await i.cp(x, S, { recursive: !0 }).catch(() => {}), await Promise.all([
|
|
172
|
-
i.rm(g, {
|
|
173
|
-
recursive: !0,
|
|
174
|
-
force: !0
|
|
175
|
-
}),
|
|
176
|
-
i.rm(u, {
|
|
177
|
-
recursive: !0,
|
|
178
|
-
force: !0
|
|
179
|
-
}),
|
|
180
|
-
i.rm(p, {
|
|
181
|
-
recursive: !0,
|
|
182
|
-
force: !0
|
|
183
|
-
})
|
|
184
|
-
]), e.info(`Build complete. Output: ${s}`);
|
|
124
|
+
await Promise.all(n);
|
|
185
125
|
}
|
|
186
126
|
//#endregion
|
|
187
|
-
export {
|
|
127
|
+
export { f as buildSite, i as typedown };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../src/node/build/html.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,qDAAqD;IACrD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAGD,wBAAgB,UAAU,CAAE,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAwBhE"}
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../src/node/build/html.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,gDAAgD;IAChD,WAAW,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,qDAAqD;IACrD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAGD,wBAAgB,UAAU,CAAE,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAwBhE;AAGD,wBAAgB,UAAU,CAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAMnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"html.test.d.ts","sourceRoot":"","sources":["../../../src/node/build/html.test.ts"],"names":[],"mappings":""}
|
|
@@ -6,10 +6,6 @@ export interface BuildOptions {
|
|
|
6
6
|
outDir?: string;
|
|
7
7
|
/** Base public path (default: "/") */
|
|
8
8
|
base?: string;
|
|
9
|
-
/** Import path for the theme's Layout component */
|
|
10
|
-
layoutImport: string;
|
|
11
|
-
/** Import path for the theme's NotFound component */
|
|
12
|
-
notFoundImport: string;
|
|
13
9
|
/** Additional Vite config overrides */
|
|
14
10
|
viteConfig?: InlineConfig;
|
|
15
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/build/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACE,KAAK,YAAY,EACzB,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/build/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACE,KAAK,YAAY,EACzB,MAAM,MAAM,CAAC;AAad,MAAM,WAAW,YAAY;IAC3B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,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,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAuHrE"}
|
package/dist/node/cli/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/cli/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/cli/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/node/cli/init.ts"],"names":[],"mappings":"AAUA,wBAAsB,UAAU,CAAE,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDxE"}
|
package/dist/node/index.d.ts
CHANGED
package/dist/node/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typedown-context.d.ts","sourceRoot":"","sources":["../../../src/node/lib/typedown-context.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,SAAS,EACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACV,eAAe,EAAE,YAAY,EAAE,YAAY,EAC5C,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACmB,KAAK,gBAAgB,EAC9C,MAAM,YAAY,CAAC;AAIpB,OAAO,KAAK,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAIlB,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,GAAG,CAAmB;gBAEjB,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,gBAAgB;IAMpD,OAAO,CAAC,YAAY,CAA2B;IAC/C,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,0BAA0B,CAA4B;IAC9D,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,eAAe,CAAmC;IAC1D,OAAO,CAAC,aAAa,CAAsC;IAE3D,OAAO,CAAC,aAAa,CAAK;IAE1B,OAAO,CAAC,4BAA4B;IA8DpC,IAAI,GAAG,IAAK,SAAS,CAEpB;IAIK,OAAO,CAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAIpD,QAAQ,CAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAatD,SAAS,IAAK,OAAO,CAAC,MAAM,EAAE,CAAC;IAQ/B,wBAAwB,IAAK,OAAO,CAAC,aAAa,CAAC;IAgBnD,SAAS,IAAK,OAAO,CAAC,YAAY,CAAC;IASnC,WAAW,CAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAM/C,SAAS,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAYjD,WAAW,IAAK,OAAO,CAAC,MAAM,EAAE,CAAC;IAQvC,IAAI,EAAE,IAAK,gBAAgB,CAE1B;CACF;
|
|
1
|
+
{"version":3,"file":"typedown-context.d.ts","sourceRoot":"","sources":["../../../src/node/lib/typedown-context.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,SAAS,EACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACV,eAAe,EAAE,YAAY,EAAE,YAAY,EAC5C,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACmB,KAAK,gBAAgB,EAC9C,MAAM,YAAY,CAAC;AAIpB,OAAO,KAAK,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAIlB,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,GAAG,CAAmB;gBAEjB,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,gBAAgB;IAMpD,OAAO,CAAC,YAAY,CAA2B;IAC/C,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,0BAA0B,CAA4B;IAC9D,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,eAAe,CAAmC;IAC1D,OAAO,CAAC,aAAa,CAAsC;IAE3D,OAAO,CAAC,aAAa,CAAK;IAE1B,OAAO,CAAC,4BAA4B;IA8DpC,IAAI,GAAG,IAAK,SAAS,CAEpB;IAIK,OAAO,CAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAIpD,QAAQ,CAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAatD,SAAS,IAAK,OAAO,CAAC,MAAM,EAAE,CAAC;IAQ/B,wBAAwB,IAAK,OAAO,CAAC,aAAa,CAAC;IAgBnD,SAAS,IAAK,OAAO,CAAC,YAAY,CAAC;IASnC,WAAW,CAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAM/C,SAAS,CAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAYjD,WAAW,IAAK,OAAO,CAAC,MAAM,EAAE,CAAC;IAQvC,IAAI,EAAE,IAAK,gBAAgB,CAE1B;CACF;AAoDD,eAAO,MAAM,SAAS,iBAAoC,CAAC"}
|
|
@@ -11,6 +11,17 @@ export interface AppEntryOptions {
|
|
|
11
11
|
/** Content files grouped by schema for the sidebar */
|
|
12
12
|
sidebarGroups: SidebarGroups;
|
|
13
13
|
}
|
|
14
|
+
export interface SsrEntryOptions {
|
|
15
|
+
/** Content directory relative to project root */
|
|
16
|
+
contentDir: string;
|
|
17
|
+
/** Import path for the theme */
|
|
18
|
+
layoutImport: string;
|
|
19
|
+
/** Serialized siteConfig JSON */
|
|
20
|
+
siteConfig: string;
|
|
21
|
+
/** Serialized siteData JSON */
|
|
22
|
+
siteData: string;
|
|
23
|
+
}
|
|
14
24
|
export declare function generateAppEntry(options: AppEntryOptions): string;
|
|
15
25
|
export declare function generateIndexSfc(groups: Record<string, unknown[]>): string;
|
|
26
|
+
export declare function generateSsrEntry(options: SsrEntryOptions): string;
|
|
16
27
|
//# sourceMappingURL=codegen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../../../src/node/plugin/vite/codegen.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACd,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,uBAAuB;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,6CAA6C;IAC7C,QAAQ,EAAE,OAAO,CAAC;IAClB,sDAAsD;IACtD,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;CAClB;AAGD,wBAAgB,gBAAgB,CAAE,OAAO,EAAE,eAAe,GAAG,MAAM,CAwClE;AAGD,wBAAgB,gBAAgB,CAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,MAAM,CAe3E;AAGD,wBAAgB,gBAAgB,CAAE,OAAO,EAAE,eAAe,GAAG,MAAM,CAuBlE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.test.d.ts","sourceRoot":"","sources":["../../../../src/node/plugin/vite/codegen.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/node/plugin/vite/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAC9C,eAAO,MAAM,uBAAuB,QAAwB,CAAC;AAC7D,eAAO,MAAM,gBAAgB,0BAA0B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/node/plugin/vite/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,MAAM,EACP,MAAM,MAAM,CAAC;AAqBd,wBAAgB,QAAQ,IAAK,MAAM,EAAE,CA+KpC"}
|