@tobi-or-not/docpress 0.11.0 → 0.12.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/README.md +2 -0
- package/dist/cli.js +340 -282
- package/dist/cli.js.map +1 -1
- package/package.json +22 -13
package/dist/cli.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { Command as e, createCommand as t, createOption as n } from "commander";
|
|
2
2
|
import { appendFileSync as r, cpSync as i, existsSync as a, mkdirSync as o, readFileSync as s, readdirSync as c, renameSync as l, rmSync as u, statSync as d, writeFileSync as f } from "node:fs";
|
|
3
|
-
import { basename as p, dirname as m, join as
|
|
3
|
+
import { basename as p, dirname as m, join as h, parse as g, relative as ee, resolve as _ } from "node:path";
|
|
4
4
|
import v from "yaml";
|
|
5
5
|
import y from "picocolors";
|
|
6
6
|
import { z as b } from "zod";
|
|
7
7
|
import { Octokit as x } from "@octokit/rest";
|
|
8
|
-
import { simpleGit as
|
|
9
|
-
import { build as
|
|
10
|
-
import { withMermaid as
|
|
11
|
-
import { readFile as
|
|
12
|
-
var
|
|
8
|
+
import { simpleGit as S } from "simple-git";
|
|
9
|
+
import { build as te } from "vitepress";
|
|
10
|
+
import { withMermaid as ne } from "vitepress-plugin-mermaid";
|
|
11
|
+
import { readFile as re } from "node:fs/promises";
|
|
12
|
+
var ie = {
|
|
13
13
|
name: "@tobi-or-not/docpress",
|
|
14
14
|
type: "module",
|
|
15
|
-
version: "0.
|
|
16
|
-
packageManager: "bun@1.
|
|
15
|
+
version: "0.12.0",
|
|
16
|
+
packageManager: "bun@1.4.0",
|
|
17
17
|
homepage: "https://this-is-tobi.com/docpress/introduction",
|
|
18
18
|
repository: {
|
|
19
19
|
type: "git",
|
|
@@ -50,35 +50,44 @@ var ae = {
|
|
|
50
50
|
dependencies: {
|
|
51
51
|
"@octokit/rest": "^22.0.1",
|
|
52
52
|
commander: "^15.0.0",
|
|
53
|
+
mermaid: "^11.17.2",
|
|
53
54
|
picocolors: "^1.1.1",
|
|
54
55
|
"simple-git": "^3.36.0",
|
|
55
56
|
vitepress: "^1.6.4",
|
|
56
57
|
"vitepress-plugin-mermaid": "^2.0.17",
|
|
57
58
|
yaml: "^2.9.0",
|
|
58
|
-
zod: "^4.4
|
|
59
|
+
zod: "^4.5.4"
|
|
59
60
|
},
|
|
60
61
|
devDependencies: {
|
|
61
|
-
"@antfu/eslint-config": "^9.1
|
|
62
|
-
"@commitlint/cli": "^21.2.
|
|
63
|
-
"@commitlint/config-conventional": "^21.2.
|
|
64
|
-
"@octokit/types": "^
|
|
65
|
-
"@types/node": "^26.
|
|
62
|
+
"@antfu/eslint-config": "^9.5.1",
|
|
63
|
+
"@commitlint/cli": "^21.2.2",
|
|
64
|
+
"@commitlint/config-conventional": "^21.2.2",
|
|
65
|
+
"@octokit/types": "^18.0.0",
|
|
66
|
+
"@types/node": "^26.4.1",
|
|
66
67
|
"@vitejs/plugin-vue": "^6.0.8",
|
|
67
|
-
"@vitest/coverage-v8": "^4.1.
|
|
68
|
-
eslint: "^10.
|
|
68
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
69
|
+
eslint: "^10.9.1",
|
|
69
70
|
husky: "^9.1.7",
|
|
70
71
|
"nano-staged": "^1.0.2",
|
|
71
72
|
typescript: "^6.0.3",
|
|
72
|
-
vite: "^8.
|
|
73
|
-
vitest: "^4.1.
|
|
74
|
-
vue: "^3.5.
|
|
73
|
+
vite: "^8.2.2",
|
|
74
|
+
vitest: "^4.1.11",
|
|
75
|
+
vue: "^3.5.42"
|
|
75
76
|
},
|
|
76
77
|
publishConfig: {
|
|
77
78
|
registry: "https://registry.npmjs.org/",
|
|
78
79
|
access: "public",
|
|
79
80
|
tag: "latest"
|
|
81
|
+
},
|
|
82
|
+
overrides: {
|
|
83
|
+
"brace-expansion": "^5.0.8",
|
|
84
|
+
dompurify: "^3.4.14",
|
|
85
|
+
"fast-uri": "^3.1.6",
|
|
86
|
+
"js-yaml": "^4.3.1",
|
|
87
|
+
nanoid: "^3.3.16",
|
|
88
|
+
postcss: "^8.5.26"
|
|
80
89
|
}
|
|
81
|
-
},
|
|
90
|
+
}, C = _(process.cwd(), "docpress"), ae = _(process.cwd(), "docpress/docs"), w = _(process.cwd(), "docpress/docs/index.md"), oe = _(process.cwd(), "docpress/docs/forks.md"), T = _(process.cwd(), "docpress/.vitepress/config.ts"), se = _(process.cwd(), "docpress/.vitepress/theme"), ce = _(process.cwd(), "docpress/.vitepress/theme/extras"), E = process.env.NODE_ENV === "development" ? _(import.meta.dirname, "../../public/templates/theme") : _(import.meta.dirname, "./templates/theme"), le = {
|
|
82
91
|
red: y.red,
|
|
83
92
|
yellow: y.yellow,
|
|
84
93
|
white: y.white,
|
|
@@ -125,48 +134,48 @@ function de(e) {
|
|
|
125
134
|
return D[e].level;
|
|
126
135
|
}
|
|
127
136
|
function k(e, t = "info", n) {
|
|
128
|
-
let r = n ?
|
|
137
|
+
let r = n ? le[n](e) : le[D[t].color](e), i = t === "success" ? "info" : t;
|
|
129
138
|
ue() >= D[t].level && console[i](r);
|
|
130
139
|
}
|
|
131
140
|
//#endregion
|
|
132
141
|
//#region src/utils/regex.ts
|
|
133
|
-
var fe = /\[([^\]]+)\]\(\.\.\/([^)]+)\)/g, pe = /\[([^\]]+)\]\((?!\.?\/docs\/|docs\/|http|#)(\.\/)?([^/][^)]+)\)/g, me = /\[([^\]]+)\]\((\.?\/docs\/|docs\/)([^)]*)\)/g, he = /^\d{2}-/,
|
|
142
|
+
var fe = /\[([^\]]+)\]\(\.\.\/([^)]+)\)/g, pe = /\[([^\]]+)\]\((?!\.?\/docs\/|docs\/|http|#)(\.\/)?([^/][^)]+)\)/g, me = /\[([^\]]+)\]\((\.?\/docs\/|docs\/)([^)]*)\)/g, he = /^\d{2}-/, A = /^---\r?\n([\s\S]*?)\r?\n---\r?\n/, ge = /\[([^\]]+)\]\((?!https?:|\/|#|mailto:)([^)#]*\/)?([^)#/]+\.md)(#[^)]*)?\)/g;
|
|
134
143
|
//#endregion
|
|
135
144
|
//#region src/utils/functions.ts
|
|
136
|
-
async function
|
|
145
|
+
async function j(e) {
|
|
137
146
|
try {
|
|
138
147
|
return (await fetch(e, {
|
|
139
148
|
method: "HEAD",
|
|
140
149
|
redirect: "manual"
|
|
141
150
|
})).status;
|
|
142
151
|
} catch (t) {
|
|
143
|
-
return k(` Network error while checking '${e}': ${
|
|
152
|
+
return k(` Network error while checking '${e}': ${N(t)}`, "debug"), 500;
|
|
144
153
|
}
|
|
145
154
|
}
|
|
146
|
-
function
|
|
155
|
+
function M(e) {
|
|
147
156
|
return (e.split(/[/\\]/).pop() ?? "").replace(/[^\w.-]/g, "_").replace(/^\.+/, "") || "_";
|
|
148
157
|
}
|
|
149
|
-
function
|
|
158
|
+
function _e(e) {
|
|
150
159
|
return !V(e) || !("token" in e) ? e : {
|
|
151
160
|
...e,
|
|
152
161
|
token: e.token ? "***" : e.token
|
|
153
162
|
};
|
|
154
163
|
}
|
|
155
|
-
function
|
|
164
|
+
function N(e) {
|
|
156
165
|
return e instanceof Error ? e.message : String(e);
|
|
157
166
|
}
|
|
158
|
-
function
|
|
167
|
+
function P(e) {
|
|
159
168
|
if (e < 1e3) return `${Math.round(e)}ms`;
|
|
160
169
|
let t = e / 1e3;
|
|
161
170
|
if (t < 60) return `${t.toFixed(1)}s`;
|
|
162
171
|
let n = Math.floor(t / 60), r = Math.round(t % 60);
|
|
163
172
|
return `${n}m ${String(r).padStart(2, "0")}s`;
|
|
164
173
|
}
|
|
165
|
-
function
|
|
174
|
+
function F(e, t) {
|
|
166
175
|
let n = "";
|
|
167
176
|
return t?.removeDot && (n = e.startsWith(".") ? e.slice(1) : e, n = n.replaceAll(".", "-")), t?.removeIdx && (n = (n || e).replace(he, "")), t?.removeExt && (n = (n || e).split(".")[0]), t?.replaceDash && (n = (n || e).replaceAll("-", " ")), t?.mode === "capitalize" ? n = (n || e).slice(0, 1).toUpperCase() + (n || e).slice(1).toLowerCase() : t?.mode === "lowercase" ? n = (n || e).toLowerCase() : t?.mode === "uppercase" && (n = (n || e).toUpperCase()), n || e;
|
|
168
177
|
}
|
|
169
|
-
function
|
|
178
|
+
function I(e, { clean: t } = { clean: !1 }) {
|
|
170
179
|
try {
|
|
171
180
|
if (t && a(e)) for (let t of c(e)) u(_(e, t), {
|
|
172
181
|
recursive: !0,
|
|
@@ -177,14 +186,14 @@ function F(e, { clean: t } = { clean: !1 }) {
|
|
|
177
186
|
throw Error(`Unable to create directory '${e}': ${t instanceof Error ? t.message : String(t)}`);
|
|
178
187
|
}
|
|
179
188
|
}
|
|
180
|
-
function
|
|
189
|
+
function ve(e) {
|
|
181
190
|
try {
|
|
182
191
|
return d(e).isDirectory();
|
|
183
192
|
} catch {
|
|
184
193
|
return !1;
|
|
185
194
|
}
|
|
186
195
|
}
|
|
187
|
-
function
|
|
196
|
+
function ye(e) {
|
|
188
197
|
try {
|
|
189
198
|
return d(e).isFile();
|
|
190
199
|
} catch {
|
|
@@ -192,7 +201,7 @@ function I(e) {
|
|
|
192
201
|
}
|
|
193
202
|
}
|
|
194
203
|
function L(e) {
|
|
195
|
-
return (Array.isArray(e) ? e : [e]).flatMap((e) =>
|
|
204
|
+
return (Array.isArray(e) ? e : [e]).flatMap((e) => ye(e) ? [e] : ve(e) ? c(e).filter((e) => e !== ".git").sort().flatMap((t) => L(h(e, t))) : []);
|
|
196
205
|
}
|
|
197
206
|
function R(e) {
|
|
198
207
|
return L(e).filter((e) => p(e).endsWith(".md"));
|
|
@@ -201,10 +210,10 @@ function z(e) {
|
|
|
201
210
|
return e.reduce((e, t, n, r) => n ? n === r.length - 1 ? `${e} or "${t}"` : `${e}, "${t}"` : `"${t}"`, "");
|
|
202
211
|
}
|
|
203
212
|
function be(e) {
|
|
204
|
-
return JSON.parse(s(`${
|
|
213
|
+
return JSON.parse(s(`${C}/user-${M(e)}.json`).toString());
|
|
205
214
|
}
|
|
206
215
|
function xe(e) {
|
|
207
|
-
return JSON.parse(s(`${
|
|
216
|
+
return JSON.parse(s(`${C}/repos-${M(e)}.json`).toString());
|
|
208
217
|
}
|
|
209
218
|
var Se = /* @__PURE__ */ new Set([
|
|
210
219
|
"__proto__",
|
|
@@ -215,13 +224,13 @@ function B(...e) {
|
|
|
215
224
|
return e.reduce((e, t) => (t === null || Object.keys(t).forEach((n) => {
|
|
216
225
|
if (Se.has(n)) return;
|
|
217
226
|
let r = e ? e[n] : null, i = t[n];
|
|
218
|
-
V(r) && V(i) ?
|
|
227
|
+
e[n] = V(r) && V(i) ? B(r, i) : V(i) ? B({}, i) : i;
|
|
219
228
|
}), e), {});
|
|
220
229
|
}
|
|
221
230
|
function V(e) {
|
|
222
231
|
return e && typeof e == "object" && !Array.isArray(e);
|
|
223
232
|
}
|
|
224
|
-
function
|
|
233
|
+
function Ce(e) {
|
|
225
234
|
if (!e) return {};
|
|
226
235
|
let t = _(process.cwd(), e), n;
|
|
227
236
|
try {
|
|
@@ -235,63 +244,74 @@ function H(e) {
|
|
|
235
244
|
throw Error(`Invalid JSON in config file '${e}'.`);
|
|
236
245
|
}
|
|
237
246
|
}
|
|
238
|
-
function
|
|
247
|
+
function H(e) {
|
|
239
248
|
return e.split(",");
|
|
240
249
|
}
|
|
241
|
-
function Ce(e, t) {
|
|
242
|
-
f(e, s(e, "utf8").replace(fe, (e, n, r) => `[${n}](${t}/${r})`), "utf8");
|
|
243
|
-
}
|
|
244
250
|
function we(e, t) {
|
|
245
|
-
let n = s(e, "utf8"), r
|
|
251
|
+
let n = s(e, "utf8").replace(fe, (e, n, r) => `[${n}](${t}/${r})`);
|
|
252
|
+
f(e, n, "utf8");
|
|
253
|
+
}
|
|
254
|
+
function Te(e, t) {
|
|
255
|
+
let n = s(e, "utf8"), r = n.match(A);
|
|
246
256
|
if (r) {
|
|
247
257
|
let i = v.parse(r[1]) ?? {};
|
|
248
|
-
i.lastUpdated = t, f(e, n.replace(
|
|
258
|
+
i.lastUpdated = t, f(e, n.replace(A, `---\n${v.stringify(i)}---\n`), "utf8");
|
|
249
259
|
} else f(e, `---\nlastUpdated: ${t}\n---\n\n${n}`, "utf8");
|
|
250
260
|
}
|
|
251
|
-
function
|
|
252
|
-
|
|
253
|
-
let a =
|
|
261
|
+
function Ee(e) {
|
|
262
|
+
let t = s(e, "utf8").replace(ge, (e, t, n, r, i) => {
|
|
263
|
+
let a = F(r, {
|
|
254
264
|
mode: "lowercase",
|
|
255
265
|
removeIdx: !0
|
|
256
266
|
});
|
|
257
267
|
return a === "readme.md" && (a = "introduction.md"), `[${t}](${n ?? ""}${a}${i ?? ""})`;
|
|
258
|
-
})
|
|
268
|
+
});
|
|
269
|
+
f(e, t, "utf8");
|
|
259
270
|
}
|
|
260
|
-
function
|
|
261
|
-
|
|
271
|
+
function De(e, t) {
|
|
272
|
+
let n = s(e, "utf8").replace(pe, (e, n, r, i) => `[${n}](${t}/${i})`).replace(me, (e, t, n, r) => `[${t}](${r})`);
|
|
273
|
+
f(e, n, "utf8");
|
|
262
274
|
}
|
|
263
275
|
//#endregion
|
|
264
276
|
//#region src/schemas/global.ts
|
|
265
|
-
var
|
|
277
|
+
var U = ["github", "gitlab"], W = ["single", "multi"], Oe = [
|
|
278
|
+
"true",
|
|
279
|
+
"false",
|
|
280
|
+
"null"
|
|
281
|
+
], G = /^\w[\w./-]*$/, ke = "Branch name must start with a letter, digit or underscore and only contain letters, digits, \".\", \"-\", \"_\" or \"/\".", K = b.object({
|
|
266
282
|
usernames: b.string().array().describe("List of comma separated Git provider usernames used to collect data."),
|
|
267
283
|
logLevel: b.enum(O).optional().describe(`Verbosity of the CLI output. Values should be ${z(O)}. Defaults to "info", or to the LOG_LEVEL environment variable when set.`),
|
|
268
|
-
branch: b.string().regex(
|
|
269
|
-
gitProvider: b.enum(
|
|
284
|
+
branch: b.string().regex(G, ke).optional().describe("Branch used to collect Git provider data. Defaults to each repository's own default branch when not set."),
|
|
285
|
+
gitProvider: b.enum(U).default("github").describe(`Git provider used to retrieve data. Values should be ${z(U)}.`),
|
|
270
286
|
reposFilter: b.string().array().describe("List of comma separated repositories to retrieve from Git provider. Default to all user's public repositories."),
|
|
271
287
|
extraHeaderPages: b.string().array().describe("List of comma separated additional files or directories to process Vitepress header pages."),
|
|
272
288
|
extraPublicContent: b.string().array().describe("List of comma separated additional files or directories to process Vitepress public folder."),
|
|
273
289
|
extraTheme: b.string().array().describe("List of comma separated additional files or directories to use as Vitepress theme."),
|
|
274
290
|
forks: b.boolean().default(!1).describe("Whether or not to create the dedicated fork page that aggregate external contributions."),
|
|
275
291
|
lastUpdated: b.boolean().default(!1).describe("Whether or not to inject each page's last Git commit date as Vitepress \"lastUpdated\" frontmatter."),
|
|
292
|
+
sidebarMode: b.enum(W).default("single").describe(`Shape of the generated sidebar. Values should be ${z(W)}. "single" lists every repository in one sidebar, "multi" gives each repository its own sidebar.`),
|
|
293
|
+
sidebarCollapsed: b.union([b.boolean(), b.null()]).default(!0).describe("Collapse behaviour of generated sidebar groups. \"true\" collapses them by default, \"false\" expands them, \"null\" makes them non-collapsible."),
|
|
276
294
|
vitepressConfig: b.any().optional().describe("Path to the vitepress configuration file."),
|
|
277
295
|
websiteTitle: b.string().describe("Website title."),
|
|
278
296
|
websiteTagline: b.string().describe("Website tagline.")
|
|
279
|
-
}),
|
|
280
|
-
branch: b.string().regex(
|
|
281
|
-
gitProvider: b.enum(
|
|
282
|
-
logLevel: b.enum(O).optional().describe(
|
|
283
|
-
forks: b.boolean().optional().describe(
|
|
284
|
-
lastUpdated: b.boolean().optional().describe(
|
|
297
|
+
}), q = K.partial().extend({
|
|
298
|
+
branch: b.string().regex(G, ke).optional().describe(K.shape.branch.description || ""),
|
|
299
|
+
gitProvider: b.enum(U).optional().describe(K.shape.gitProvider.description || ""),
|
|
300
|
+
logLevel: b.enum(O).optional().describe(K.shape.logLevel.description || ""),
|
|
301
|
+
forks: b.boolean().optional().describe(K.shape.forks.description || ""),
|
|
302
|
+
lastUpdated: b.boolean().optional().describe(K.shape.lastUpdated.description || ""),
|
|
285
303
|
config: b.string().optional().describe("Path to the docpress configuration file."),
|
|
286
304
|
token: b.string().optional().describe("Git provider token used to collect data."),
|
|
287
|
-
usernames: b.string().transform(
|
|
288
|
-
reposFilter: b.string().transform(
|
|
289
|
-
extraHeaderPages: b.string().transform(
|
|
290
|
-
extraPublicContent: b.string().transform(
|
|
291
|
-
extraTheme: b.string().transform(
|
|
292
|
-
vitepressConfig: b.string().optional().describe(
|
|
305
|
+
usernames: b.string().transform(H).optional().describe(K.shape.usernames.description || ""),
|
|
306
|
+
reposFilter: b.string().transform(H).optional().describe(K.shape.reposFilter.description || ""),
|
|
307
|
+
extraHeaderPages: b.string().transform(H).optional().describe(K.shape.extraHeaderPages.description || ""),
|
|
308
|
+
extraPublicContent: b.string().transform(H).optional().describe(K.shape.extraPublicContent.description || ""),
|
|
309
|
+
extraTheme: b.string().transform(H).optional().describe(K.shape.extraTheme.description || ""),
|
|
310
|
+
vitepressConfig: b.string().optional().describe(K.shape.vitepressConfig.description || ""),
|
|
311
|
+
sidebarMode: b.enum(W).optional().describe(K.shape.sidebarMode.description || ""),
|
|
312
|
+
sidebarCollapsed: b.enum(Oe).transform((e) => e === "null" ? null : e === "true").optional().describe(`${K.shape.sidebarCollapsed.description} Values should be ${z(Oe)}.`)
|
|
293
313
|
});
|
|
294
|
-
function
|
|
314
|
+
function Ae(e) {
|
|
295
315
|
if (!e) return {};
|
|
296
316
|
let t = { ...e };
|
|
297
317
|
for (let e of [
|
|
@@ -303,39 +323,41 @@ function ke(e) {
|
|
|
303
323
|
]) typeof t[e] == "string" && (t[e] = [t[e]]);
|
|
304
324
|
return t;
|
|
305
325
|
}
|
|
306
|
-
function
|
|
307
|
-
let t =
|
|
326
|
+
function je(e) {
|
|
327
|
+
let t = K.partial().safeParse(e);
|
|
308
328
|
if (!t.success) throw Error(b.prettifyError(t.error));
|
|
309
329
|
return t.data;
|
|
310
330
|
}
|
|
311
|
-
function
|
|
331
|
+
function Me(e) {
|
|
312
332
|
if (!e.usernames?.length) throw Error("The usernames field is required");
|
|
313
333
|
return e;
|
|
314
334
|
}
|
|
315
|
-
function
|
|
335
|
+
function Ne(e, t) {
|
|
316
336
|
if (e) return e;
|
|
317
337
|
let n = t === "gitlab" ? process.env.GITLAB_TOKEN : process.env.GITHUB_TOKEN;
|
|
318
|
-
return process.env.DOCPRESS_TOKEN
|
|
338
|
+
return process.env.DOCPRESS_TOKEN || n || void 0;
|
|
319
339
|
}
|
|
320
|
-
function
|
|
340
|
+
function Pe(e) {
|
|
321
341
|
e && (process.env.LOG_LEVEL = String(de(e)));
|
|
322
342
|
}
|
|
323
|
-
var
|
|
343
|
+
var Fe = q.partial().transform((e, t) => {
|
|
324
344
|
try {
|
|
325
|
-
let { config: t, vitepressConfig: n, token: r, ...i } = e, a = Ae(
|
|
345
|
+
let { config: t, vitepressConfig: n, token: r, ...i } = e, a = je(Ae(Ce(t))), o = {
|
|
326
346
|
gitProvider: "github",
|
|
327
347
|
forks: !1,
|
|
328
348
|
lastUpdated: !1,
|
|
349
|
+
sidebarMode: "single",
|
|
350
|
+
sidebarCollapsed: !0,
|
|
329
351
|
...a,
|
|
330
352
|
...i,
|
|
331
353
|
...n ? { vitepressConfig: {
|
|
332
354
|
...a.vitepressConfig || {},
|
|
333
|
-
...
|
|
355
|
+
...Ce(n) || {}
|
|
334
356
|
} } : {}
|
|
335
357
|
};
|
|
336
|
-
return
|
|
358
|
+
return Pe(o.logLevel), Me({
|
|
337
359
|
...o,
|
|
338
|
-
token:
|
|
360
|
+
token: Ne(r, o.gitProvider)
|
|
339
361
|
});
|
|
340
362
|
} catch (e) {
|
|
341
363
|
return t.addIssue({
|
|
@@ -346,21 +368,21 @@ var Pe = K.partial().transform((e, t) => {
|
|
|
346
368
|
});
|
|
347
369
|
//#endregion
|
|
348
370
|
//#region src/utils/commands.ts
|
|
349
|
-
function
|
|
371
|
+
function J(e, t) {
|
|
350
372
|
k("Initializing Docpress...", "info", "blue"), k("\n\n-> Checking for required environment settings and configurations.", "info"), k(` Debug info - cmd: ${e}`, "debug");
|
|
351
|
-
let n =
|
|
352
|
-
return n.success || (k(` An error occurred while checking configuration.\n ${b.prettifyError(n.error)}`, "error"), process.exit(1)), k(` Debug info - resolved options: ${JSON.stringify(
|
|
373
|
+
let n = Fe.safeParse(t);
|
|
374
|
+
return n.success || (k(` An error occurred while checking configuration.\n ${b.prettifyError(n.error)}`, "error"), process.exit(1)), k(` Debug info - resolved options: ${JSON.stringify(_e(n.data))}`, "debug"), k(" Setup complete! Ready to process your documentation.", "info"), n.data;
|
|
353
375
|
}
|
|
354
|
-
function
|
|
376
|
+
function Y(e, t) {
|
|
355
377
|
return Object.fromEntries(Object.entries(t).filter(([t]) => e.getOptionValueSource(t) !== "default"));
|
|
356
378
|
}
|
|
357
|
-
function
|
|
379
|
+
function X(e, t) {
|
|
358
380
|
for (let n of t) e.addOption(n);
|
|
359
381
|
return e;
|
|
360
382
|
}
|
|
361
383
|
//#endregion
|
|
362
384
|
//#region src/lib/git.ts
|
|
363
|
-
var
|
|
385
|
+
var Ie = {
|
|
364
386
|
debug: () => {},
|
|
365
387
|
info: () => {},
|
|
366
388
|
warn: (e) => {
|
|
@@ -370,11 +392,11 @@ var Fe = {
|
|
|
370
392
|
e.includes("404") || k(e, "error");
|
|
371
393
|
}
|
|
372
394
|
};
|
|
373
|
-
async function
|
|
395
|
+
async function Le({ username: e, token: t, branch: n }) {
|
|
374
396
|
k(` Get infos for username '${e}'.`, "info");
|
|
375
397
|
let r = new x({
|
|
376
398
|
auth: t,
|
|
377
|
-
log:
|
|
399
|
+
log: Ie
|
|
378
400
|
});
|
|
379
401
|
k(" Get user infos.", "debug");
|
|
380
402
|
let { data: i } = await r.rest.users.getByUsername({ username: e }).catch((t) => {
|
|
@@ -390,11 +412,11 @@ async function Ie({ username: e, token: t, branch: n }) {
|
|
|
390
412
|
branch: n
|
|
391
413
|
};
|
|
392
414
|
}
|
|
393
|
-
async function
|
|
415
|
+
async function Re({ repository: e, token: t }) {
|
|
394
416
|
k(` Get contributors infos for repository '${e.name}'.`, "info");
|
|
395
417
|
let n = new x({
|
|
396
418
|
auth: t,
|
|
397
|
-
log:
|
|
419
|
+
log: Ie
|
|
398
420
|
}), r;
|
|
399
421
|
try {
|
|
400
422
|
r = (await n.rest.repos.get({
|
|
@@ -402,7 +424,7 @@ async function Le({ repository: e, token: t }) {
|
|
|
402
424
|
repo: e.name
|
|
403
425
|
})).data;
|
|
404
426
|
} catch (t) {
|
|
405
|
-
return k(` Failed to get repository infos for '${e.name}'. Error : ${
|
|
427
|
+
return k(` Failed to get repository infos for '${e.name}'. Error : ${N(t)}`, "warn"), {
|
|
406
428
|
source: void 0,
|
|
407
429
|
contributors: []
|
|
408
430
|
};
|
|
@@ -419,7 +441,7 @@ async function Le({ repository: e, token: t }) {
|
|
|
419
441
|
per_page: 100
|
|
420
442
|
})) i.push(...e);
|
|
421
443
|
} catch (t) {
|
|
422
|
-
return k(` Failed to get contributors infos for repository '${e.name}'. Error : ${
|
|
444
|
+
return k(` Failed to get contributors infos for repository '${e.name}'. Error : ${N(t)}`, "warn"), {
|
|
423
445
|
source: r.source,
|
|
424
446
|
contributors: []
|
|
425
447
|
};
|
|
@@ -429,7 +451,7 @@ async function Le({ repository: e, token: t }) {
|
|
|
429
451
|
contributors: i
|
|
430
452
|
};
|
|
431
453
|
}
|
|
432
|
-
function
|
|
454
|
+
function ze(e) {
|
|
433
455
|
let t = /* @__PURE__ */ new Map(), n = null;
|
|
434
456
|
for (let r of e.split("\n")) {
|
|
435
457
|
let e = r.trim();
|
|
@@ -443,12 +465,12 @@ function Re(e) {
|
|
|
443
465
|
}
|
|
444
466
|
return t;
|
|
445
467
|
}
|
|
446
|
-
async function
|
|
468
|
+
async function Be(e, t, n) {
|
|
447
469
|
let r = R([t]);
|
|
448
470
|
if (!r.length) return;
|
|
449
471
|
let i;
|
|
450
472
|
try {
|
|
451
|
-
i =
|
|
473
|
+
i = ze(await e.raw([
|
|
452
474
|
"-c",
|
|
453
475
|
"core.quotePath=false",
|
|
454
476
|
"log",
|
|
@@ -456,19 +478,19 @@ async function ze(e, t, n) {
|
|
|
456
478
|
"--name-only"
|
|
457
479
|
]));
|
|
458
480
|
} catch (e) {
|
|
459
|
-
k(` Unable to read commit history for repository '${n}'. Error : ${
|
|
481
|
+
k(` Unable to read commit history for repository '${n}'. Error : ${N(e)}`, "warn");
|
|
460
482
|
return;
|
|
461
483
|
}
|
|
462
484
|
for (let e of r) {
|
|
463
|
-
let n = i.get(
|
|
464
|
-
n &&
|
|
485
|
+
let n = i.get(ee(t, e));
|
|
486
|
+
n && Te(e, n);
|
|
465
487
|
}
|
|
466
488
|
}
|
|
467
|
-
async function
|
|
489
|
+
async function Ve(e, t, n, a, o, s) {
|
|
468
490
|
if (t.startsWith("-") || a.startsWith("-")) return k(` Refusing to clone '${e}': unsafe repository URL or branch name.`, "error"), !1;
|
|
469
|
-
|
|
491
|
+
I(n, { clean: !0 });
|
|
470
492
|
try {
|
|
471
|
-
let c =
|
|
493
|
+
let c = S({
|
|
472
494
|
baseDir: n,
|
|
473
495
|
config: [
|
|
474
496
|
"maintenance.auto=false",
|
|
@@ -478,31 +500,31 @@ async function Be(e, t, n, a, o, s) {
|
|
|
478
500
|
});
|
|
479
501
|
await c.init().addConfig("core.sparseCheckout", "true", !0, "local").addRemote("origin", t);
|
|
480
502
|
for (let t of o) k(` Add '${t}' to '${e}' sparse-checkout file.`, "debug"), r(_(n, ".git/info/sparse-checkout"), `${t}\n`, "utf8");
|
|
481
|
-
return k(` Clone repository '${e}'.`, "info"), await c.pull("origin", a), s && await
|
|
503
|
+
return k(` Clone repository '${e}'.`, "info"), await c.pull("origin", a), s && await Be(c, n, e), o.some((e) => e.includes("docs")) && (i(_(n, "docs"), n, { recursive: !0 }), u(_(n, "docs"), { recursive: !0 })), u(_(n, ".git"), { recursive: !0 }), !0;
|
|
482
504
|
} catch (t) {
|
|
483
|
-
return k(` Error when cloning repository '${e}': ${
|
|
505
|
+
return k(` Error when cloning repository '${e}': ${N(t)}.`, "error"), !1;
|
|
484
506
|
}
|
|
485
507
|
}
|
|
486
508
|
//#endregion
|
|
487
509
|
//#region src/lib/gitlab.ts
|
|
488
|
-
var
|
|
489
|
-
async function
|
|
490
|
-
let n = await fetch(`${
|
|
510
|
+
var He = "https://gitlab.com/api/v4";
|
|
511
|
+
async function Z(e, t) {
|
|
512
|
+
let n = await fetch(`${He}${e}`, { headers: t ? { "PRIVATE-TOKEN": t } : {} });
|
|
491
513
|
if (!n.ok) throw Error(`GitLab API request failed for '${e}' (status: ${n.status}).`);
|
|
492
514
|
return {
|
|
493
515
|
data: await n.json(),
|
|
494
516
|
headers: n.headers
|
|
495
517
|
};
|
|
496
518
|
}
|
|
497
|
-
async function
|
|
519
|
+
async function Ue(e, t) {
|
|
498
520
|
let n = e.includes("?") ? "&" : "?", r = [], i = "1";
|
|
499
521
|
for (; i;) {
|
|
500
|
-
let a = await
|
|
522
|
+
let a = await Z(`${e}${n}per_page=100&page=${i}`, t);
|
|
501
523
|
r.push(...a.data), i = a.headers.get("x-next-page") || null;
|
|
502
524
|
}
|
|
503
525
|
return r;
|
|
504
526
|
}
|
|
505
|
-
function
|
|
527
|
+
function We(e) {
|
|
506
528
|
return {
|
|
507
529
|
login: e.username ?? e.path,
|
|
508
530
|
name: e.name,
|
|
@@ -511,7 +533,7 @@ function Ue(e) {
|
|
|
511
533
|
html_url: e.web_url
|
|
512
534
|
};
|
|
513
535
|
}
|
|
514
|
-
function
|
|
536
|
+
function Ge(e, t) {
|
|
515
537
|
return {
|
|
516
538
|
name: e.path,
|
|
517
539
|
owner: { login: t },
|
|
@@ -525,32 +547,32 @@ function We(e, t) {
|
|
|
525
547
|
stargazers_count: e.star_count
|
|
526
548
|
};
|
|
527
549
|
}
|
|
528
|
-
async function
|
|
550
|
+
async function Ke({ username: e, token: t, branch: n }) {
|
|
529
551
|
k(` Get infos for username '${e}'.`, "info");
|
|
530
|
-
let { data: r } = await
|
|
552
|
+
let { data: r } = await Z(`/users?username=${encodeURIComponent(e)}`, t);
|
|
531
553
|
if (r.length) {
|
|
532
554
|
let i = r[0];
|
|
533
|
-
t && (i = await
|
|
534
|
-
let a = await
|
|
555
|
+
t && (i = await Z(`/users/${r[0].id}`, t).then((e) => e.data).catch(() => r[0])), k(" Get repositories infos.", "debug");
|
|
556
|
+
let a = await Ue(`/users/${r[0].id}/projects`, t);
|
|
535
557
|
return {
|
|
536
|
-
user:
|
|
537
|
-
repos: a.map((t) =>
|
|
558
|
+
user: We(i),
|
|
559
|
+
repos: a.map((t) => Ge(t, i.username ?? e)),
|
|
538
560
|
branch: n
|
|
539
561
|
};
|
|
540
562
|
}
|
|
541
563
|
k(` No GitLab user '${e}' found, trying groups.`, "debug");
|
|
542
|
-
let i = await
|
|
564
|
+
let i = await Z(`/groups/${encodeURIComponent(e)}?with_projects=false`, t).then((e) => e.data).catch(() => {
|
|
543
565
|
throw Error(`No GitLab user or group found for '${e}'.`);
|
|
544
|
-
}), a = await
|
|
566
|
+
}), a = await Ue(`/groups/${encodeURIComponent(e)}/projects`, t);
|
|
545
567
|
return {
|
|
546
|
-
user:
|
|
547
|
-
repos: a.map((t) =>
|
|
568
|
+
user: We(i),
|
|
569
|
+
repos: a.map((t) => Ge(t, i.path ?? e)),
|
|
548
570
|
branch: n
|
|
549
571
|
};
|
|
550
572
|
}
|
|
551
573
|
//#endregion
|
|
552
574
|
//#region src/lib/fetch.ts
|
|
553
|
-
function
|
|
575
|
+
function qe(e, t, n) {
|
|
554
576
|
if (n === "gitlab") {
|
|
555
577
|
let n = e.html_url ?? `https://gitlab.com/${e.owner.login}/${e.name}`;
|
|
556
578
|
return {
|
|
@@ -566,11 +588,11 @@ function Ke(e, t, n) {
|
|
|
566
588
|
raw_url: `https://raw.githubusercontent.com/${e.owner.login}/${e.name}/${t}`
|
|
567
589
|
};
|
|
568
590
|
}
|
|
569
|
-
async function
|
|
591
|
+
async function Je(e) {
|
|
570
592
|
let [t, n, r] = await Promise.all([
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
593
|
+
j(`${e.blob_url}/README.md`),
|
|
594
|
+
j(`${e.tree_url}/docs`),
|
|
595
|
+
j(`${e.blob_url}/docs/01-readme.md`)
|
|
574
596
|
]);
|
|
575
597
|
return {
|
|
576
598
|
rootReadmeStatus: t,
|
|
@@ -578,19 +600,19 @@ async function qe(e) {
|
|
|
578
600
|
docsReadmeStatus: r
|
|
579
601
|
};
|
|
580
602
|
}
|
|
581
|
-
async function
|
|
582
|
-
let { user: s, repos: c, branch: l } = await (r === "gitlab" ?
|
|
603
|
+
async function Ye({ username: e, branch: t, reposFilter: n, gitProvider: r, token: i, lastUpdated: a, multiUser: o }) {
|
|
604
|
+
let { user: s, repos: c, branch: l } = await (r === "gitlab" ? Ke : Le)({
|
|
583
605
|
username: e,
|
|
584
606
|
token: i,
|
|
585
607
|
branch: t
|
|
586
|
-
}), { repos: u } = await
|
|
587
|
-
await
|
|
608
|
+
}), { repos: u } = await Qe(s, c, l, n, r, o ? `${M(e)}/` : "");
|
|
609
|
+
await $e(u, n, a);
|
|
588
610
|
}
|
|
589
|
-
async function
|
|
611
|
+
async function Xe(e, t, n, r, i = "") {
|
|
590
612
|
let a = [];
|
|
591
613
|
return await Promise.all(e.map(async (e) => {
|
|
592
|
-
let o = t ?? e.default_branch ?? "main", s = _(
|
|
593
|
-
!e.fork && !e.private && !c && (u = await
|
|
614
|
+
let o = t ?? e.default_branch ?? "main", s = _(ae, `${i}${F(M(e.name), { removeDot: !0 })}`), c = et(e, n), l = qe(e, o, r), u = [];
|
|
615
|
+
!e.fork && !e.private && !c && (u = await Ze(e, o, r, l)), a.push({
|
|
594
616
|
...e,
|
|
595
617
|
docpress: {
|
|
596
618
|
filtered: c,
|
|
@@ -604,25 +626,25 @@ async function Ye(e, t, n, r, i = "") {
|
|
|
604
626
|
});
|
|
605
627
|
})), a;
|
|
606
628
|
}
|
|
607
|
-
async function
|
|
608
|
-
let i = await
|
|
629
|
+
async function Ze(e, t, n, r) {
|
|
630
|
+
let i = await Je(r ?? qe(e, t, n)), a = [];
|
|
609
631
|
return Object.values(i).every((e) => e !== 200) || !e.size ? [] : (i.docsFolderStatus === 200 && a.push("docs/*"), (i.docsFolderStatus !== 200 || i.docsReadmeStatus !== 200) && a.push("README.md", "!*/**/README.md"), a);
|
|
610
632
|
}
|
|
611
|
-
async function
|
|
612
|
-
f(`${
|
|
613
|
-
let o = await
|
|
614
|
-
return f(`${
|
|
633
|
+
async function Qe(e, t, n, r, i, a = "") {
|
|
634
|
+
f(`${C}/user-${M(e.login)}.json`, JSON.stringify(e, null, 2));
|
|
635
|
+
let o = await Xe(t, n, r, i, a);
|
|
636
|
+
return f(`${C}/repos-${M(e.login)}.json`, JSON.stringify(o, null, 2)), {
|
|
615
637
|
user: e,
|
|
616
638
|
repos: o
|
|
617
639
|
};
|
|
618
640
|
}
|
|
619
|
-
async function
|
|
641
|
+
async function $e(e, t, n) {
|
|
620
642
|
if (!e) {
|
|
621
643
|
k(" No repositories to process.", "warn");
|
|
622
644
|
return;
|
|
623
645
|
}
|
|
624
|
-
let r = await Promise.all(e.filter((e) =>
|
|
625
|
-
let t = await
|
|
646
|
+
let r = await Promise.all(e.filter((e) => !et(e, t)).map(async (e) => {
|
|
647
|
+
let t = await Ve(e.name, e.clone_url, e.docpress.projectPath, e.docpress.branch, e.docpress.includes, n);
|
|
626
648
|
return {
|
|
627
649
|
name: e.name,
|
|
628
650
|
success: t
|
|
@@ -635,36 +657,36 @@ async function Qe(e, t, n) {
|
|
|
635
657
|
let i = r.filter(({ success: e }) => !e).map(({ name: e }) => e), a = r.length - i.length;
|
|
636
658
|
i.length ? k(` Cloned ${a}/${r.length} repository(ies), ${i.length} failed: ${i.join(", ")}.`, "warn") : k(` Cloned ${a}/${r.length} repository(ies).`, "success");
|
|
637
659
|
}
|
|
638
|
-
function
|
|
660
|
+
function et(e, t) {
|
|
639
661
|
if ("docpress" in e && !e.docpress.includes.length) return !0;
|
|
640
662
|
let n = t?.filter((e) => !e.startsWith("!")) ?? [], r = t?.every((e) => e.startsWith("!")), i = t?.filter((e) => e.startsWith("!")).some((t) => e.name === t.substring(1)), a = !t || n.includes(e.name) || e.fork && !i || r && !i, o = i || !a;
|
|
641
663
|
return !(e.clone_url && !e.private && !o);
|
|
642
664
|
}
|
|
643
665
|
//#endregion
|
|
644
666
|
//#region src/commands/global.ts
|
|
645
|
-
var
|
|
646
|
-
n("-C, --config <string>",
|
|
647
|
-
n("--log-level <string>",
|
|
648
|
-
n("-T, --token <string>",
|
|
649
|
-
n("-U, --usernames <string>",
|
|
650
|
-
],
|
|
651
|
-
n("-b, --branch <string>",
|
|
652
|
-
n("-g, --git-provider <string>",
|
|
653
|
-
n("-l, --last-updated",
|
|
654
|
-
n("-r, --repos-filter <string>",
|
|
655
|
-
],
|
|
656
|
-
await
|
|
667
|
+
var Q = [
|
|
668
|
+
n("-C, --config <string>", q.shape.config.description),
|
|
669
|
+
n("--log-level <string>", q.shape.logLevel.description),
|
|
670
|
+
n("-T, --token <string>", q.shape.token.description),
|
|
671
|
+
n("-U, --usernames <string>", q.shape.usernames.description)
|
|
672
|
+
], tt = "fetch", nt = [
|
|
673
|
+
n("-b, --branch <string>", K.shape.branch.description),
|
|
674
|
+
n("-g, --git-provider <string>", K.shape.gitProvider.description).default(K.shape.gitProvider.def.defaultValue),
|
|
675
|
+
n("-l, --last-updated", K.shape.lastUpdated.description),
|
|
676
|
+
n("-r, --repos-filter <string>", K.shape.reposFilter.description)
|
|
677
|
+
], rt = X(t(tt), [...nt, ...Q]).description("Fetch docs with the given username(s) and git provider.").action(async (e, t) => {
|
|
678
|
+
await it(J(tt, Y(t, e)));
|
|
657
679
|
});
|
|
658
|
-
async function
|
|
680
|
+
async function it(e) {
|
|
659
681
|
let { usernames: t, reposFilter: n, token: r, branch: i, gitProvider: a, lastUpdated: o } = e;
|
|
660
682
|
k("\n-> Start fetching documentation files. This may take a moment, especially for larger repositories.", "info");
|
|
661
683
|
let s = Date.now();
|
|
662
|
-
|
|
684
|
+
I(C, { clean: !0 });
|
|
663
685
|
let c = [];
|
|
664
686
|
for (let e of t) {
|
|
665
687
|
let s = t.length > 1 ? n?.filter((t) => t.replace(/^!/, "").startsWith(`${e}/`)).map((t) => t.replace(`${e}/`, "")) : n;
|
|
666
688
|
try {
|
|
667
|
-
await
|
|
689
|
+
await Ye({
|
|
668
690
|
username: e,
|
|
669
691
|
branch: i,
|
|
670
692
|
reposFilter: s,
|
|
@@ -674,15 +696,15 @@ async function rt(e) {
|
|
|
674
696
|
multiUser: t.length > 1
|
|
675
697
|
});
|
|
676
698
|
} catch (t) {
|
|
677
|
-
c.push(e), k(` Failed to fetch documentation for '${e}': ${
|
|
699
|
+
c.push(e), k(` Failed to fetch documentation for '${e}': ${N(t)}`, "error");
|
|
678
700
|
}
|
|
679
701
|
}
|
|
680
702
|
if (c.length === t.length) throw Error(`Failed to fetch documentation for all requested username(s): ${c.join(", ")}.`);
|
|
681
|
-
k(` Fetched documentation for ${t.length - c.length}/${t.length} username(s) in ${
|
|
703
|
+
k(` Fetched documentation for ${t.length - c.length}/${t.length} username(s) in ${P(Date.now() - s)}.`, c.length ? "warn" : "success");
|
|
682
704
|
}
|
|
683
705
|
//#endregion
|
|
684
706
|
//#region src/commands/build.ts
|
|
685
|
-
async function
|
|
707
|
+
async function at(e) {
|
|
686
708
|
let t = console.warn;
|
|
687
709
|
console.warn = function(...e) {
|
|
688
710
|
e.length > 0 && typeof e[0] == "string" && (e[0].includes("[Vue warn]: Invalid watch source:") || e[0].includes("{ open: false }")) || t.apply(console, e);
|
|
@@ -693,32 +715,32 @@ async function it(e) {
|
|
|
693
715
|
console.warn = t;
|
|
694
716
|
}
|
|
695
717
|
}
|
|
696
|
-
var
|
|
697
|
-
await
|
|
718
|
+
var ot = X(t("build"), Q).description("Build vitepress website.").action(async (e) => {
|
|
719
|
+
await st();
|
|
698
720
|
});
|
|
699
|
-
async function
|
|
721
|
+
async function st() {
|
|
700
722
|
k("\n-> Start building Vitepress website.\n\n", "info");
|
|
701
723
|
let e = Date.now();
|
|
702
724
|
try {
|
|
703
|
-
await
|
|
704
|
-
await
|
|
705
|
-
|
|
725
|
+
await at(async () => {
|
|
726
|
+
await te(C, { onAfterConfigResolve(e) {
|
|
727
|
+
ne(e);
|
|
706
728
|
} });
|
|
707
729
|
});
|
|
708
730
|
} catch (e) {
|
|
709
|
-
throw Error(`Docpress build failed: ${
|
|
731
|
+
throw Error(`Docpress build failed: ${N(e)}`);
|
|
710
732
|
}
|
|
711
|
-
k(`\n\nDocpress build succeeded in ${
|
|
733
|
+
k(`\n\nDocpress build succeeded in ${P(Date.now() - e)}.`, "success");
|
|
712
734
|
}
|
|
713
735
|
//#endregion
|
|
714
736
|
//#region src/utils/templates.ts
|
|
715
|
-
function
|
|
737
|
+
function ct(e, t) {
|
|
716
738
|
let n = s(e, { encoding: "utf8" });
|
|
717
|
-
|
|
739
|
+
I(m(t)), f(t, n);
|
|
718
740
|
}
|
|
719
741
|
//#endregion
|
|
720
742
|
//#region src/lib/vitepress.ts
|
|
721
|
-
var
|
|
743
|
+
var lt = {
|
|
722
744
|
base: "/",
|
|
723
745
|
lang: "en-US",
|
|
724
746
|
vite: { publicDir: "../public" },
|
|
@@ -751,21 +773,24 @@ var ct = {
|
|
|
751
773
|
}
|
|
752
774
|
}
|
|
753
775
|
};
|
|
754
|
-
function
|
|
755
|
-
return n ? B(
|
|
776
|
+
function ut(e, t, n) {
|
|
777
|
+
return n ? B(lt, n, { themeConfig: {
|
|
756
778
|
sidebar: e,
|
|
757
779
|
nav: t
|
|
758
|
-
} }) : B(
|
|
780
|
+
} }) : B(lt, { themeConfig: {
|
|
759
781
|
sidebar: e,
|
|
760
782
|
nav: t
|
|
761
783
|
} });
|
|
762
784
|
}
|
|
763
785
|
//#endregion
|
|
764
786
|
//#region src/lib/prepare.ts
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
787
|
+
function dt(e) {
|
|
788
|
+
return e === null ? {} : { collapsed: e };
|
|
789
|
+
}
|
|
790
|
+
async function ft({ extraHeaderPages: e, extraPublicContent: t, extraTheme: n, vitepressConfig: r, forks: i, gitProvider: o, lastUpdated: s, sidebarMode: c, sidebarCollapsed: l, token: u, username: d, websiteTitle: f, websiteTagline: p }) {
|
|
791
|
+
let m = i && o !== "gitlab";
|
|
792
|
+
i && !m && k(" The forks page is not supported with the 'gitlab' provider, skipping.", "warn");
|
|
793
|
+
let h = be(d), g = xe(d).reduce(({ internals: e, forks: t }, n) => {
|
|
769
794
|
let { clone_url: r, private: i, fork: a, docpress: o } = n;
|
|
770
795
|
if (r && !i && !o.filtered) {
|
|
771
796
|
if (!a && o.includes.length) return {
|
|
@@ -785,38 +810,42 @@ async function ut({ extraHeaderPages: e, extraPublicContent: t, extraTheme: n, v
|
|
|
785
810
|
internals: [],
|
|
786
811
|
forks: []
|
|
787
812
|
}), ee = {
|
|
788
|
-
title:
|
|
789
|
-
tagline:
|
|
790
|
-
}, { index:
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
813
|
+
title: f,
|
|
814
|
+
tagline: p
|
|
815
|
+
}, { index: v, sidebar: y } = wt(g.internals, h, ee, {
|
|
816
|
+
mode: c,
|
|
817
|
+
collapsed: l
|
|
818
|
+
}), b, x;
|
|
819
|
+
if (a(w) && a(T)) {
|
|
820
|
+
let e = await kt(T), t = await At(w);
|
|
821
|
+
b = St(e.themeConfig?.sidebar, y), x = {
|
|
822
|
+
...v,
|
|
823
|
+
features: [...t.features, ...v.features].sort((e, t) => e.title.localeCompare(t.title))
|
|
796
824
|
};
|
|
797
|
-
} else
|
|
798
|
-
let
|
|
825
|
+
} else b = y, x = v;
|
|
826
|
+
let S = [];
|
|
799
827
|
if (e) {
|
|
800
|
-
let t =
|
|
801
|
-
|
|
828
|
+
let t = Tt(e);
|
|
829
|
+
m ? S.push(...t.filter((e) => e.link !== "/forks")) : S.push(...t);
|
|
802
830
|
}
|
|
803
|
-
t && (k(" Add extras Vitepress public folder content.", "info"),
|
|
831
|
+
t && (k(" Add extras Vitepress public folder content.", "info"), Et(t, _(C, "public"))), n && (k(" Add extras Vitepress theme files.", "info"), Et(n, _(ce))), m && d.length && (k(" Add fork page to display external contributions.", "info"), await Ot(g.forks, d, u), S.push({
|
|
804
832
|
text: "Forks",
|
|
805
833
|
link: "/forks"
|
|
806
834
|
}));
|
|
807
|
-
let
|
|
835
|
+
let te = s ? {
|
|
808
836
|
lastUpdated: !0,
|
|
809
837
|
...r
|
|
810
838
|
} : r;
|
|
811
|
-
|
|
839
|
+
jt(ut(b, S, te), x);
|
|
812
840
|
}
|
|
813
|
-
function
|
|
814
|
-
|
|
841
|
+
function pt(e, t) {
|
|
842
|
+
let n = `${F(p(t), {
|
|
815
843
|
mode: "lowercase",
|
|
816
844
|
removeIdx: !0
|
|
817
|
-
}) === "readme.md" ? "\n## Sources" : "# Sources"}\n\nTake a look at the [project sources](${e}).\n
|
|
845
|
+
}) === "readme.md" ? "\n## Sources" : "# Sources"}\n\nTake a look at the [project sources](${e}).\n`;
|
|
846
|
+
r(t, n, "utf8");
|
|
818
847
|
}
|
|
819
|
-
function
|
|
848
|
+
function mt(e, t, n) {
|
|
820
849
|
let { name: r, login: i, bio: a } = t, { title: o, tagline: s } = n;
|
|
821
850
|
return {
|
|
822
851
|
layout: "home",
|
|
@@ -830,107 +859,131 @@ function ft(e, t, n) {
|
|
|
830
859
|
features: e
|
|
831
860
|
};
|
|
832
861
|
}
|
|
833
|
-
function
|
|
862
|
+
function ht(e, t, n, r = "") {
|
|
834
863
|
let i = {
|
|
835
|
-
title:
|
|
864
|
+
title: F(e, {
|
|
836
865
|
mode: "capitalize",
|
|
837
866
|
replaceDash: !0
|
|
838
867
|
}),
|
|
839
868
|
details: t,
|
|
840
|
-
link: `/${r}${
|
|
869
|
+
link: `/${r}${F(e, { removeDot: !0 })}/introduction`
|
|
841
870
|
};
|
|
842
871
|
return n ? [...n, i] : [i];
|
|
843
872
|
}
|
|
844
|
-
function
|
|
873
|
+
function gt(e, t, n = !0) {
|
|
845
874
|
return {
|
|
846
|
-
text:
|
|
875
|
+
text: F(e, {
|
|
847
876
|
mode: "capitalize",
|
|
848
877
|
replaceDash: !0
|
|
849
878
|
}),
|
|
850
|
-
|
|
879
|
+
...dt(n),
|
|
851
880
|
items: t
|
|
852
881
|
};
|
|
853
882
|
}
|
|
854
|
-
function
|
|
855
|
-
return Object.entries(t).flatMap(([t,
|
|
856
|
-
let n = _(e.docpress.projectPath, t), r =
|
|
883
|
+
function _t(e, t, n = !0) {
|
|
884
|
+
return Object.entries(t).flatMap(([t, r]) => t === "$" ? Array.isArray(r) ? r.map((t) => {
|
|
885
|
+
let n = _(e.docpress.projectPath, t), r = F(p(n), {
|
|
857
886
|
mode: "lowercase",
|
|
858
887
|
removeIdx: !0
|
|
859
888
|
});
|
|
860
889
|
return r === "readme.md" && (r = "introduction.md"), r !== p(n) && l(n, _(m(n), r)), {
|
|
861
|
-
text:
|
|
890
|
+
text: g(r).name === "introduction" ? "Introduction" : F(r, {
|
|
862
891
|
mode: "capitalize",
|
|
863
892
|
replaceDash: !0,
|
|
864
893
|
removeExt: !0
|
|
865
894
|
}),
|
|
866
|
-
link: `/${e.docpress.routePrefix ?? ""}${
|
|
895
|
+
link: `/${e.docpress.routePrefix ?? ""}${F(e.name, { removeDot: !0 })}/${g(r).name}`
|
|
867
896
|
};
|
|
868
|
-
}) : [] : typeof
|
|
869
|
-
text:
|
|
897
|
+
}) : [] : typeof r == "object" ? [{
|
|
898
|
+
text: F(t, {
|
|
870
899
|
mode: "capitalize",
|
|
871
900
|
replaceDash: !0
|
|
872
901
|
}),
|
|
873
|
-
|
|
874
|
-
items:
|
|
902
|
+
...dt(n),
|
|
903
|
+
items: _t({
|
|
875
904
|
...e,
|
|
876
|
-
name: `${e.name}/${t}
|
|
877
|
-
|
|
905
|
+
name: `${e.name}/${t}`,
|
|
906
|
+
docpress: {
|
|
907
|
+
...e.docpress,
|
|
908
|
+
projectPath: _(e.docpress.projectPath, t)
|
|
909
|
+
}
|
|
910
|
+
}, r, n)
|
|
878
911
|
}] : []);
|
|
879
912
|
}
|
|
880
|
-
function
|
|
913
|
+
function vt(e) {
|
|
881
914
|
return e.reduce((e, t) => {
|
|
882
915
|
let [n, ...r] = t.split("/");
|
|
883
|
-
return r.length ? e[n] =
|
|
916
|
+
return r.length ? e[n] = vt([...e[n] ? $(e[n], "") : [], r.join("/")]) : e.$ = [...e.$ || [], n], e;
|
|
884
917
|
}, {});
|
|
885
918
|
}
|
|
886
|
-
function
|
|
887
|
-
return Object.entries(e).flatMap(([e, n]) => e === "$" ? Array.isArray(n) ? n.map((e) => t ? `${t}/${e}` : e) : [] :
|
|
919
|
+
function $(e, t = "") {
|
|
920
|
+
return Object.entries(e).flatMap(([e, n]) => e === "$" ? Array.isArray(n) ? n.map((e) => t ? `${t}/${e}` : e) : [] : $(n, t ? `${t}/${e}` : e));
|
|
888
921
|
}
|
|
889
|
-
function
|
|
922
|
+
function yt(e) {
|
|
890
923
|
if (!Array.isArray(e)) return e;
|
|
891
924
|
let t = e.findIndex((e) => e.text === "Sources");
|
|
892
925
|
if (t === -1) return e;
|
|
893
926
|
let [n] = e.splice(t, 1);
|
|
894
927
|
return e.push(n), e;
|
|
895
928
|
}
|
|
896
|
-
|
|
897
|
-
|
|
929
|
+
var bt = 5;
|
|
930
|
+
function xt(e, t, n = []) {
|
|
931
|
+
return e.flatMap((e) => {
|
|
932
|
+
if (!("items" in e) || !e.items?.length) return [];
|
|
933
|
+
let r = [...n, e.text];
|
|
934
|
+
return t >= bt ? [r.join("/")] : xt(e.items, t + 1, r);
|
|
935
|
+
});
|
|
936
|
+
}
|
|
937
|
+
function St(e, t) {
|
|
938
|
+
if (!e) return t;
|
|
939
|
+
if (Array.isArray(e) && Array.isArray(t)) return [...e, ...t].toSorted((e, t) => (e.text ?? "").localeCompare(t.text ?? ""));
|
|
940
|
+
let n = (e) => Array.isArray(e) ? { "/": e } : e;
|
|
941
|
+
return Ct({
|
|
942
|
+
...n(e),
|
|
943
|
+
...n(t)
|
|
944
|
+
});
|
|
945
|
+
}
|
|
946
|
+
function Ct(e) {
|
|
947
|
+
return Object.fromEntries(Object.entries(e).toSorted(([e], [t]) => e.localeCompare(t)));
|
|
948
|
+
}
|
|
949
|
+
function wt(e, t, n, r = {}) {
|
|
950
|
+
let { mode: i = "single", collapsed: a = !0 } = r, o = [], s = [], l = {};
|
|
898
951
|
for (let t of e) {
|
|
899
952
|
k(` Replace urls for repository '${t.name}'.`, "info"), R([t.docpress.projectPath]).forEach((e) => {
|
|
900
|
-
k(` Processing file '${p(e)}' for repository '${t.name}'.`, "debug"),
|
|
953
|
+
k(` Processing file '${p(e)}' for repository '${t.name}'.`, "debug"), we(e, t.docpress.replace_url), p(e).toLowerCase() === "readme.md" && De(e, t.docpress.replace_url), Ee(e);
|
|
901
954
|
}), k(` Generate sidebar for repository '${t.name}'.`, "info");
|
|
902
955
|
let e = c(t.docpress.projectPath, { recursive: !0 }).filter((e) => {
|
|
903
956
|
let n = _(t.docpress.projectPath, e.toString());
|
|
904
|
-
return p(n).endsWith(".md") &&
|
|
957
|
+
return p(n).endsWith(".md") && ye(n);
|
|
905
958
|
}).sort();
|
|
906
959
|
k(` Add sources for repository '${t.name}'.`, "info");
|
|
907
960
|
let n;
|
|
908
|
-
e.length > 1 ? (n = _(t.docpress.projectPath, "sources.md"), e.push("sources.md")) : e.length === 1 && (n = _(t.docpress.projectPath, e[0])), n ?
|
|
909
|
-
let
|
|
910
|
-
i.push(
|
|
961
|
+
e.length > 1 ? (n = _(t.docpress.projectPath, "sources.md"), e.push("sources.md")) : e.length === 1 && (n = _(t.docpress.projectPath, e[0])), n ? pt(t.html_url, n) : k(` No markdown files found for repository '${t.name}', skipping sources.`, "warn");
|
|
962
|
+
let r = yt(_t(t, vt(e), a)), u = xt(r, i === "multi" ? 0 : 1);
|
|
963
|
+
u.length && k(` Sidebar for repository '${t.name}' nests deeper than Vitepress renders, pages under ${u.map((e) => `'${e}'`).join(", ")} will not appear in the sidebar.`, "warn"), i === "multi" ? l[`/${t.docpress.routePrefix ?? ""}${F(t.name, { removeDot: !0 })}/`] = r : s.push(gt(F(t.name, { removeDot: !0 }), r, a)), o.push(...ht(F(t.name, { removeDot: !0 }), t.description || "", void 0, t.docpress.routePrefix ?? ""));
|
|
911
964
|
}
|
|
912
965
|
k(" Generate index content.", "info");
|
|
913
|
-
let
|
|
966
|
+
let u = mt(o.toSorted((e, t) => e.title.localeCompare(t.title)), t, n);
|
|
914
967
|
return {
|
|
915
|
-
sidebar: i.toSorted((e, t) => e.text.localeCompare(t.text)),
|
|
916
|
-
index:
|
|
968
|
+
sidebar: i === "multi" ? Ct(l) : s.toSorted((e, t) => e.text.localeCompare(t.text)),
|
|
969
|
+
index: u
|
|
917
970
|
};
|
|
918
971
|
}
|
|
919
|
-
function
|
|
972
|
+
function Tt(e) {
|
|
920
973
|
let t = R(e), n = [];
|
|
921
974
|
k(" Add extras Vitepress headers pages.", "info");
|
|
922
975
|
for (let e of t) {
|
|
923
976
|
k(` Processing file '${e}'.`, "debug");
|
|
924
|
-
let t = _(process.cwd(), e)
|
|
925
|
-
i(t, _(oe, P(p(e), {
|
|
977
|
+
let t = _(process.cwd(), e), r = _(ae, F(p(e), {
|
|
926
978
|
mode: "lowercase",
|
|
927
979
|
removeIdx: !0
|
|
928
|
-
}))
|
|
929
|
-
|
|
980
|
+
}));
|
|
981
|
+
i(t, r), n.push({
|
|
982
|
+
text: F(g(t).name, {
|
|
930
983
|
replaceDash: !0,
|
|
931
984
|
removeIdx: !0
|
|
932
985
|
}),
|
|
933
|
-
link: `/${
|
|
986
|
+
link: `/${F(g(t).name, {
|
|
934
987
|
removeIdx: !0,
|
|
935
988
|
mode: "lowercase"
|
|
936
989
|
})}`
|
|
@@ -938,7 +991,7 @@ function bt(e) {
|
|
|
938
991
|
}
|
|
939
992
|
return n;
|
|
940
993
|
}
|
|
941
|
-
function
|
|
994
|
+
function Et(e, t, n) {
|
|
942
995
|
for (let r of Array.isArray(e) ? e : [e]) {
|
|
943
996
|
let e = _(process.cwd(), r), a = L(e);
|
|
944
997
|
for (let o of a) {
|
|
@@ -949,7 +1002,7 @@ function Q(e, t, n) {
|
|
|
949
1002
|
}
|
|
950
1003
|
}
|
|
951
1004
|
}
|
|
952
|
-
function
|
|
1005
|
+
function Dt(e) {
|
|
953
1006
|
let t = e.map(({ repository: e, contributions: t }) => {
|
|
954
1007
|
let { name: n, owner: r, html_url: i, description: a, stargazers_count: o } = e;
|
|
955
1008
|
return {
|
|
@@ -961,11 +1014,11 @@ function xt(e) {
|
|
|
961
1014
|
contributions: t
|
|
962
1015
|
};
|
|
963
1016
|
});
|
|
964
|
-
k(" Generate forks page.", "info"), f(
|
|
1017
|
+
k(" Generate forks page.", "info"), f(oe, "---\nlayout: fork-page\nrepoList:\n" + v.stringify(t) + "---\n\n# External contributions\n\nThis gallery is a visual representation of the collaborative work done across a variety of open-source projects, each driven by a shared passion for innovation and community growth.\n\nEvery tile below represents a unique project where contributions have been made-ranging from code enhancements to documentation improvements. Each project includes a summary of its goals, features, and links to GitHub for direct access.\n\nThis page serves as both a portfolio of past work and a resource for revisiting projects that have made a meaningful impact.\n");
|
|
965
1018
|
}
|
|
966
|
-
async function
|
|
967
|
-
|
|
968
|
-
let { source: r, contributors: i } = await
|
|
1019
|
+
async function Ot(e, t, n) {
|
|
1020
|
+
Dt(await Promise.all(e.map(async (e) => {
|
|
1021
|
+
let { source: r, contributors: i } = await Re({
|
|
969
1022
|
repository: e,
|
|
970
1023
|
token: n
|
|
971
1024
|
});
|
|
@@ -975,47 +1028,50 @@ async function St(e, t, n) {
|
|
|
975
1028
|
};
|
|
976
1029
|
})).then((e) => e.filter(({ repository: e, contributions: t }) => !!e && t)));
|
|
977
1030
|
}
|
|
978
|
-
async function
|
|
1031
|
+
async function kt(e) {
|
|
979
1032
|
try {
|
|
980
1033
|
let { config: t } = await import(_(process.cwd(), e));
|
|
981
1034
|
return t ?? {};
|
|
982
1035
|
} catch (t) {
|
|
983
|
-
return k(` Unable to load existing Vitepress config '${e}', starting from an empty config. ${
|
|
1036
|
+
return k(` Unable to load existing Vitepress config '${e}', starting from an empty config. ${N(t)}`, "warn"), {};
|
|
984
1037
|
}
|
|
985
1038
|
}
|
|
986
|
-
async function
|
|
987
|
-
let t = (await
|
|
1039
|
+
async function At(e) {
|
|
1040
|
+
let t = (await re(_(process.cwd(), e))).toString();
|
|
988
1041
|
return v.parse(t);
|
|
989
1042
|
}
|
|
990
|
-
function
|
|
991
|
-
|
|
992
|
-
let n = L(
|
|
993
|
-
if (!n.length) throw Error(`No template theme files found at '${
|
|
1043
|
+
function jt(e, t) {
|
|
1044
|
+
I(m(T)), k(" Generate Vitepress config.", "info"), f(T, `export const config = ${JSON.stringify(e, null, 2)}\n\nexport default config\n`), k(" Generate index file.", "info"), f(w, "---\n" + v.stringify(t));
|
|
1045
|
+
let n = L(E);
|
|
1046
|
+
if (!n.length) throw Error(`No template theme files found at '${E}'. The Vitepress build cannot succeed without them.`);
|
|
994
1047
|
k(" Add Docpress theme files.", "info"), n.forEach((e) => {
|
|
995
|
-
|
|
1048
|
+
let t = e.replace(`${E}/`, "");
|
|
1049
|
+
ct(e, _(se, t));
|
|
996
1050
|
});
|
|
997
1051
|
}
|
|
998
1052
|
//#endregion
|
|
999
1053
|
//#region src/commands/prepare.ts
|
|
1000
|
-
var
|
|
1001
|
-
n("-c, --extra-public-content <string>",
|
|
1002
|
-
n("-f, --forks",
|
|
1003
|
-
n("-p, --extra-header-pages <string>",
|
|
1004
|
-
n("-t, --extra-theme <string>",
|
|
1005
|
-
n("
|
|
1006
|
-
n("--
|
|
1007
|
-
n("--
|
|
1008
|
-
|
|
1009
|
-
|
|
1054
|
+
var Mt = "prepare", Nt = [
|
|
1055
|
+
n("-c, --extra-public-content <string>", K.shape.extraPublicContent.description),
|
|
1056
|
+
n("-f, --forks", K.shape.forks.description),
|
|
1057
|
+
n("-p, --extra-header-pages <string>", K.shape.extraHeaderPages.description),
|
|
1058
|
+
n("-t, --extra-theme <string>", K.shape.extraTheme.description),
|
|
1059
|
+
n("--sidebar-mode <string>", K.shape.sidebarMode.description),
|
|
1060
|
+
n("--sidebar-collapsed <string>", K.shape.sidebarCollapsed.description),
|
|
1061
|
+
n("-v, --vitepress-config <string>", K.shape.vitepressConfig.description),
|
|
1062
|
+
n("--website-title <string>", K.shape.websiteTitle.description),
|
|
1063
|
+
n("--website-tagline <string>", K.shape.websiteTagline.description)
|
|
1064
|
+
], Pt = X(t(Mt), [...Nt, ...Q]).description("Transform doc to the target vitepress format.").action(async (e, t) => {
|
|
1065
|
+
await Ft(J(Mt, Y(t, e)));
|
|
1010
1066
|
});
|
|
1011
|
-
async function
|
|
1012
|
-
let { extraHeaderPages: t, extraPublicContent: n, extraTheme: r, vitepressConfig: i, forks: a, gitProvider: o, lastUpdated: s,
|
|
1067
|
+
async function Ft(e) {
|
|
1068
|
+
let { extraHeaderPages: t, extraPublicContent: n, extraTheme: r, vitepressConfig: i, forks: a, gitProvider: o, lastUpdated: s, sidebarMode: c, sidebarCollapsed: l, token: u, usernames: d, websiteTitle: f, websiteTagline: p } = e;
|
|
1013
1069
|
k("\n-> Start transform files to prepare Vitepress build.", "info");
|
|
1014
|
-
let
|
|
1015
|
-
|
|
1016
|
-
let
|
|
1017
|
-
for (let e of
|
|
1018
|
-
await
|
|
1070
|
+
let h = Date.now();
|
|
1071
|
+
I(m(T), { clean: !0 });
|
|
1072
|
+
let g = [];
|
|
1073
|
+
for (let e of d) try {
|
|
1074
|
+
await ft({
|
|
1019
1075
|
extraHeaderPages: t,
|
|
1020
1076
|
extraPublicContent: n,
|
|
1021
1077
|
extraTheme: r,
|
|
@@ -1023,40 +1079,42 @@ async function kt(e) {
|
|
|
1023
1079
|
forks: a,
|
|
1024
1080
|
gitProvider: o,
|
|
1025
1081
|
lastUpdated: s,
|
|
1026
|
-
|
|
1082
|
+
sidebarMode: c,
|
|
1083
|
+
sidebarCollapsed: l,
|
|
1084
|
+
token: u,
|
|
1027
1085
|
username: e,
|
|
1028
|
-
websiteTitle:
|
|
1029
|
-
websiteTagline:
|
|
1086
|
+
websiteTitle: f,
|
|
1087
|
+
websiteTagline: p
|
|
1030
1088
|
});
|
|
1031
1089
|
} catch (t) {
|
|
1032
|
-
|
|
1090
|
+
g.push(e), k(` Failed to prepare documentation for '${e}': ${N(t)}`, "error");
|
|
1033
1091
|
}
|
|
1034
|
-
if (
|
|
1035
|
-
k(` Prepared documentation for ${
|
|
1092
|
+
if (g.length === d.length) throw Error(`Failed to prepare documentation for all requested username(s): ${g.join(", ")}.`);
|
|
1093
|
+
k(` Prepared documentation for ${d.length - g.length}/${d.length} username(s) in ${P(Date.now() - h)}.`, g.length ? "warn" : "success");
|
|
1036
1094
|
}
|
|
1037
1095
|
//#endregion
|
|
1038
1096
|
//#region src/cli.ts
|
|
1039
|
-
function
|
|
1040
|
-
let t = new e().name("docpress").description("Build your doc website faster than light ⚡️⚡️⚡️").version(`${
|
|
1041
|
-
let n =
|
|
1042
|
-
await
|
|
1097
|
+
function It() {
|
|
1098
|
+
let t = new e().name("docpress").description("Build your doc website faster than light ⚡️⚡️⚡️").version(`${ie.version}`).action(async (e, t) => {
|
|
1099
|
+
let n = J("global", Y(t, e));
|
|
1100
|
+
await it(n), await Ft(n), await st();
|
|
1043
1101
|
}).configureHelp({
|
|
1044
1102
|
sortSubcommands: !0,
|
|
1045
1103
|
sortOptions: !0,
|
|
1046
1104
|
showGlobalOptions: !0
|
|
1047
|
-
}).enablePositionalOptions().passThroughOptions().addCommand(
|
|
1048
|
-
return
|
|
1049
|
-
...
|
|
1050
|
-
...
|
|
1051
|
-
...
|
|
1105
|
+
}).enablePositionalOptions().passThroughOptions().addCommand(rt).addCommand(Pt).addCommand(ot);
|
|
1106
|
+
return X(t, [
|
|
1107
|
+
...nt,
|
|
1108
|
+
...Nt,
|
|
1109
|
+
...Q
|
|
1052
1110
|
]), t;
|
|
1053
1111
|
}
|
|
1054
|
-
function
|
|
1055
|
-
|
|
1056
|
-
k(`\n${
|
|
1112
|
+
function Lt() {
|
|
1113
|
+
It().parseAsync(process.argv).catch((e) => {
|
|
1114
|
+
k(`\n${N(e)}`, "error"), process.exit(1);
|
|
1057
1115
|
});
|
|
1058
1116
|
}
|
|
1059
1117
|
//#endregion
|
|
1060
|
-
export {
|
|
1118
|
+
export { It as getProgram, Lt as main };
|
|
1061
1119
|
|
|
1062
1120
|
//# sourceMappingURL=cli.js.map
|