@tobi-or-not/docpress 0.12.0 → 0.12.1
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.js +163 -153
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -12,7 +12,7 @@ import { readFile as re } from "node:fs/promises";
|
|
|
12
12
|
var ie = {
|
|
13
13
|
name: "@tobi-or-not/docpress",
|
|
14
14
|
type: "module",
|
|
15
|
-
version: "0.12.
|
|
15
|
+
version: "0.12.1",
|
|
16
16
|
packageManager: "bun@1.4.0",
|
|
17
17
|
homepage: "https://this-is-tobi.com/docpress/introduction",
|
|
18
18
|
repository: {
|
|
@@ -259,29 +259,32 @@ function Te(e, t) {
|
|
|
259
259
|
} else f(e, `---\nlastUpdated: ${t}\n---\n\n${n}`, "utf8");
|
|
260
260
|
}
|
|
261
261
|
function Ee(e) {
|
|
262
|
+
return e ? e.split("/").map((e) => e === "" || e === "." || e === ".." ? e : F(e, { removeIdx: !0 })).join("/") : "";
|
|
263
|
+
}
|
|
264
|
+
function De(e) {
|
|
262
265
|
let t = s(e, "utf8").replace(ge, (e, t, n, r, i) => {
|
|
263
266
|
let a = F(r, {
|
|
264
267
|
mode: "lowercase",
|
|
265
268
|
removeIdx: !0
|
|
266
269
|
});
|
|
267
|
-
return a === "readme.md" && (a = "introduction.md"), `[${t}](${n
|
|
270
|
+
return a === "readme.md" && (a = "introduction.md"), `[${t}](${Ee(n)}${a}${i ?? ""})`;
|
|
268
271
|
});
|
|
269
272
|
f(e, t, "utf8");
|
|
270
273
|
}
|
|
271
|
-
function
|
|
274
|
+
function Oe(e, t) {
|
|
272
275
|
let n = s(e, "utf8").replace(pe, (e, n, r, i) => `[${n}](${t}/${i})`).replace(me, (e, t, n, r) => `[${t}](${r})`);
|
|
273
276
|
f(e, n, "utf8");
|
|
274
277
|
}
|
|
275
278
|
//#endregion
|
|
276
279
|
//#region src/schemas/global.ts
|
|
277
|
-
var U = ["github", "gitlab"], W = ["single", "multi"],
|
|
280
|
+
var U = ["github", "gitlab"], W = ["single", "multi"], ke = [
|
|
278
281
|
"true",
|
|
279
282
|
"false",
|
|
280
283
|
"null"
|
|
281
|
-
], G = /^\w[\w./-]*$/,
|
|
284
|
+
], G = /^\w[\w./-]*$/, Ae = "Branch name must start with a letter, digit or underscore and only contain letters, digits, \".\", \"-\", \"_\" or \"/\".", K = b.object({
|
|
282
285
|
usernames: b.string().array().describe("List of comma separated Git provider usernames used to collect data."),
|
|
283
286
|
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.`),
|
|
284
|
-
branch: b.string().regex(G,
|
|
287
|
+
branch: b.string().regex(G, Ae).optional().describe("Branch used to collect Git provider data. Defaults to each repository's own default branch when not set."),
|
|
285
288
|
gitProvider: b.enum(U).default("github").describe(`Git provider used to retrieve data. Values should be ${z(U)}.`),
|
|
286
289
|
reposFilter: b.string().array().describe("List of comma separated repositories to retrieve from Git provider. Default to all user's public repositories."),
|
|
287
290
|
extraHeaderPages: b.string().array().describe("List of comma separated additional files or directories to process Vitepress header pages."),
|
|
@@ -295,7 +298,7 @@ var U = ["github", "gitlab"], W = ["single", "multi"], Oe = [
|
|
|
295
298
|
websiteTitle: b.string().describe("Website title."),
|
|
296
299
|
websiteTagline: b.string().describe("Website tagline.")
|
|
297
300
|
}), q = K.partial().extend({
|
|
298
|
-
branch: b.string().regex(G,
|
|
301
|
+
branch: b.string().regex(G, Ae).optional().describe(K.shape.branch.description || ""),
|
|
299
302
|
gitProvider: b.enum(U).optional().describe(K.shape.gitProvider.description || ""),
|
|
300
303
|
logLevel: b.enum(O).optional().describe(K.shape.logLevel.description || ""),
|
|
301
304
|
forks: b.boolean().optional().describe(K.shape.forks.description || ""),
|
|
@@ -309,9 +312,9 @@ var U = ["github", "gitlab"], W = ["single", "multi"], Oe = [
|
|
|
309
312
|
extraTheme: b.string().transform(H).optional().describe(K.shape.extraTheme.description || ""),
|
|
310
313
|
vitepressConfig: b.string().optional().describe(K.shape.vitepressConfig.description || ""),
|
|
311
314
|
sidebarMode: b.enum(W).optional().describe(K.shape.sidebarMode.description || ""),
|
|
312
|
-
sidebarCollapsed: b.enum(
|
|
315
|
+
sidebarCollapsed: b.enum(ke).transform((e) => e === "null" ? null : e === "true").optional().describe(`${K.shape.sidebarCollapsed.description} Values should be ${z(ke)}.`)
|
|
313
316
|
});
|
|
314
|
-
function
|
|
317
|
+
function je(e) {
|
|
315
318
|
if (!e) return {};
|
|
316
319
|
let t = { ...e };
|
|
317
320
|
for (let e of [
|
|
@@ -323,26 +326,26 @@ function Ae(e) {
|
|
|
323
326
|
]) typeof t[e] == "string" && (t[e] = [t[e]]);
|
|
324
327
|
return t;
|
|
325
328
|
}
|
|
326
|
-
function
|
|
329
|
+
function Me(e) {
|
|
327
330
|
let t = K.partial().safeParse(e);
|
|
328
331
|
if (!t.success) throw Error(b.prettifyError(t.error));
|
|
329
332
|
return t.data;
|
|
330
333
|
}
|
|
331
|
-
function
|
|
334
|
+
function Ne(e) {
|
|
332
335
|
if (!e.usernames?.length) throw Error("The usernames field is required");
|
|
333
336
|
return e;
|
|
334
337
|
}
|
|
335
|
-
function
|
|
338
|
+
function Pe(e, t) {
|
|
336
339
|
if (e) return e;
|
|
337
340
|
let n = t === "gitlab" ? process.env.GITLAB_TOKEN : process.env.GITHUB_TOKEN;
|
|
338
341
|
return process.env.DOCPRESS_TOKEN || n || void 0;
|
|
339
342
|
}
|
|
340
|
-
function
|
|
343
|
+
function Fe(e) {
|
|
341
344
|
e && (process.env.LOG_LEVEL = String(de(e)));
|
|
342
345
|
}
|
|
343
|
-
var
|
|
346
|
+
var Ie = q.partial().transform((e, t) => {
|
|
344
347
|
try {
|
|
345
|
-
let { config: t, vitepressConfig: n, token: r, ...i } = e, a = je(
|
|
348
|
+
let { config: t, vitepressConfig: n, token: r, ...i } = e, a = Me(je(Ce(t))), o = {
|
|
346
349
|
gitProvider: "github",
|
|
347
350
|
forks: !1,
|
|
348
351
|
lastUpdated: !1,
|
|
@@ -355,9 +358,9 @@ var Fe = q.partial().transform((e, t) => {
|
|
|
355
358
|
...Ce(n) || {}
|
|
356
359
|
} } : {}
|
|
357
360
|
};
|
|
358
|
-
return
|
|
361
|
+
return Fe(o.logLevel), Ne({
|
|
359
362
|
...o,
|
|
360
|
-
token:
|
|
363
|
+
token: Pe(r, o.gitProvider)
|
|
361
364
|
});
|
|
362
365
|
} catch (e) {
|
|
363
366
|
return t.addIssue({
|
|
@@ -370,7 +373,7 @@ var Fe = q.partial().transform((e, t) => {
|
|
|
370
373
|
//#region src/utils/commands.ts
|
|
371
374
|
function J(e, t) {
|
|
372
375
|
k("Initializing Docpress...", "info", "blue"), k("\n\n-> Checking for required environment settings and configurations.", "info"), k(` Debug info - cmd: ${e}`, "debug");
|
|
373
|
-
let n =
|
|
376
|
+
let n = Ie.safeParse(t);
|
|
374
377
|
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;
|
|
375
378
|
}
|
|
376
379
|
function Y(e, t) {
|
|
@@ -382,7 +385,7 @@ function X(e, t) {
|
|
|
382
385
|
}
|
|
383
386
|
//#endregion
|
|
384
387
|
//#region src/lib/git.ts
|
|
385
|
-
var
|
|
388
|
+
var Le = {
|
|
386
389
|
debug: () => {},
|
|
387
390
|
info: () => {},
|
|
388
391
|
warn: (e) => {
|
|
@@ -392,11 +395,11 @@ var Ie = {
|
|
|
392
395
|
e.includes("404") || k(e, "error");
|
|
393
396
|
}
|
|
394
397
|
};
|
|
395
|
-
async function
|
|
398
|
+
async function Re({ username: e, token: t, branch: n }) {
|
|
396
399
|
k(` Get infos for username '${e}'.`, "info");
|
|
397
400
|
let r = new x({
|
|
398
401
|
auth: t,
|
|
399
|
-
log:
|
|
402
|
+
log: Le
|
|
400
403
|
});
|
|
401
404
|
k(" Get user infos.", "debug");
|
|
402
405
|
let { data: i } = await r.rest.users.getByUsername({ username: e }).catch((t) => {
|
|
@@ -412,11 +415,11 @@ async function Le({ username: e, token: t, branch: n }) {
|
|
|
412
415
|
branch: n
|
|
413
416
|
};
|
|
414
417
|
}
|
|
415
|
-
async function
|
|
418
|
+
async function ze({ repository: e, token: t }) {
|
|
416
419
|
k(` Get contributors infos for repository '${e.name}'.`, "info");
|
|
417
420
|
let n = new x({
|
|
418
421
|
auth: t,
|
|
419
|
-
log:
|
|
422
|
+
log: Le
|
|
420
423
|
}), r;
|
|
421
424
|
try {
|
|
422
425
|
r = (await n.rest.repos.get({
|
|
@@ -451,7 +454,7 @@ async function Re({ repository: e, token: t }) {
|
|
|
451
454
|
contributors: i
|
|
452
455
|
};
|
|
453
456
|
}
|
|
454
|
-
function
|
|
457
|
+
function Be(e) {
|
|
455
458
|
let t = /* @__PURE__ */ new Map(), n = null;
|
|
456
459
|
for (let r of e.split("\n")) {
|
|
457
460
|
let e = r.trim();
|
|
@@ -465,12 +468,12 @@ function ze(e) {
|
|
|
465
468
|
}
|
|
466
469
|
return t;
|
|
467
470
|
}
|
|
468
|
-
async function
|
|
471
|
+
async function Ve(e, t, n) {
|
|
469
472
|
let r = R([t]);
|
|
470
473
|
if (!r.length) return;
|
|
471
474
|
let i;
|
|
472
475
|
try {
|
|
473
|
-
i =
|
|
476
|
+
i = Be(await e.raw([
|
|
474
477
|
"-c",
|
|
475
478
|
"core.quotePath=false",
|
|
476
479
|
"log",
|
|
@@ -486,7 +489,7 @@ async function Be(e, t, n) {
|
|
|
486
489
|
n && Te(e, n);
|
|
487
490
|
}
|
|
488
491
|
}
|
|
489
|
-
async function
|
|
492
|
+
async function He(e, t, n, a, o, s) {
|
|
490
493
|
if (t.startsWith("-") || a.startsWith("-")) return k(` Refusing to clone '${e}': unsafe repository URL or branch name.`, "error"), !1;
|
|
491
494
|
I(n, { clean: !0 });
|
|
492
495
|
try {
|
|
@@ -500,23 +503,23 @@ async function Ve(e, t, n, a, o, s) {
|
|
|
500
503
|
});
|
|
501
504
|
await c.init().addConfig("core.sparseCheckout", "true", !0, "local").addRemote("origin", t);
|
|
502
505
|
for (let t of o) k(` Add '${t}' to '${e}' sparse-checkout file.`, "debug"), r(_(n, ".git/info/sparse-checkout"), `${t}\n`, "utf8");
|
|
503
|
-
return k(` Clone repository '${e}'.`, "info"), await c.pull("origin", a), s && await
|
|
506
|
+
return k(` Clone repository '${e}'.`, "info"), await c.pull("origin", a), s && await Ve(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;
|
|
504
507
|
} catch (t) {
|
|
505
508
|
return k(` Error when cloning repository '${e}': ${N(t)}.`, "error"), !1;
|
|
506
509
|
}
|
|
507
510
|
}
|
|
508
511
|
//#endregion
|
|
509
512
|
//#region src/lib/gitlab.ts
|
|
510
|
-
var
|
|
513
|
+
var Ue = "https://gitlab.com/api/v4";
|
|
511
514
|
async function Z(e, t) {
|
|
512
|
-
let n = await fetch(`${
|
|
515
|
+
let n = await fetch(`${Ue}${e}`, { headers: t ? { "PRIVATE-TOKEN": t } : {} });
|
|
513
516
|
if (!n.ok) throw Error(`GitLab API request failed for '${e}' (status: ${n.status}).`);
|
|
514
517
|
return {
|
|
515
518
|
data: await n.json(),
|
|
516
519
|
headers: n.headers
|
|
517
520
|
};
|
|
518
521
|
}
|
|
519
|
-
async function
|
|
522
|
+
async function We(e, t) {
|
|
520
523
|
let n = e.includes("?") ? "&" : "?", r = [], i = "1";
|
|
521
524
|
for (; i;) {
|
|
522
525
|
let a = await Z(`${e}${n}per_page=100&page=${i}`, t);
|
|
@@ -524,7 +527,7 @@ async function Ue(e, t) {
|
|
|
524
527
|
}
|
|
525
528
|
return r;
|
|
526
529
|
}
|
|
527
|
-
function
|
|
530
|
+
function Ge(e) {
|
|
528
531
|
return {
|
|
529
532
|
login: e.username ?? e.path,
|
|
530
533
|
name: e.name,
|
|
@@ -533,7 +536,7 @@ function We(e) {
|
|
|
533
536
|
html_url: e.web_url
|
|
534
537
|
};
|
|
535
538
|
}
|
|
536
|
-
function
|
|
539
|
+
function Ke(e, t) {
|
|
537
540
|
return {
|
|
538
541
|
name: e.path,
|
|
539
542
|
owner: { login: t },
|
|
@@ -547,32 +550,32 @@ function Ge(e, t) {
|
|
|
547
550
|
stargazers_count: e.star_count
|
|
548
551
|
};
|
|
549
552
|
}
|
|
550
|
-
async function
|
|
553
|
+
async function qe({ username: e, token: t, branch: n }) {
|
|
551
554
|
k(` Get infos for username '${e}'.`, "info");
|
|
552
555
|
let { data: r } = await Z(`/users?username=${encodeURIComponent(e)}`, t);
|
|
553
556
|
if (r.length) {
|
|
554
557
|
let i = r[0];
|
|
555
558
|
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
|
|
559
|
+
let a = await We(`/users/${r[0].id}/projects`, t);
|
|
557
560
|
return {
|
|
558
|
-
user:
|
|
559
|
-
repos: a.map((t) =>
|
|
561
|
+
user: Ge(i),
|
|
562
|
+
repos: a.map((t) => Ke(t, i.username ?? e)),
|
|
560
563
|
branch: n
|
|
561
564
|
};
|
|
562
565
|
}
|
|
563
566
|
k(` No GitLab user '${e}' found, trying groups.`, "debug");
|
|
564
567
|
let i = await Z(`/groups/${encodeURIComponent(e)}?with_projects=false`, t).then((e) => e.data).catch(() => {
|
|
565
568
|
throw Error(`No GitLab user or group found for '${e}'.`);
|
|
566
|
-
}), a = await
|
|
569
|
+
}), a = await We(`/groups/${encodeURIComponent(e)}/projects`, t);
|
|
567
570
|
return {
|
|
568
|
-
user:
|
|
569
|
-
repos: a.map((t) =>
|
|
571
|
+
user: Ge(i),
|
|
572
|
+
repos: a.map((t) => Ke(t, i.path ?? e)),
|
|
570
573
|
branch: n
|
|
571
574
|
};
|
|
572
575
|
}
|
|
573
576
|
//#endregion
|
|
574
577
|
//#region src/lib/fetch.ts
|
|
575
|
-
function
|
|
578
|
+
function Je(e, t, n) {
|
|
576
579
|
if (n === "gitlab") {
|
|
577
580
|
let n = e.html_url ?? `https://gitlab.com/${e.owner.login}/${e.name}`;
|
|
578
581
|
return {
|
|
@@ -588,7 +591,7 @@ function qe(e, t, n) {
|
|
|
588
591
|
raw_url: `https://raw.githubusercontent.com/${e.owner.login}/${e.name}/${t}`
|
|
589
592
|
};
|
|
590
593
|
}
|
|
591
|
-
async function
|
|
594
|
+
async function Ye(e) {
|
|
592
595
|
let [t, n, r] = await Promise.all([
|
|
593
596
|
j(`${e.blob_url}/README.md`),
|
|
594
597
|
j(`${e.tree_url}/docs`),
|
|
@@ -600,19 +603,19 @@ async function Je(e) {
|
|
|
600
603
|
docsReadmeStatus: r
|
|
601
604
|
};
|
|
602
605
|
}
|
|
603
|
-
async function
|
|
604
|
-
let { user: s, repos: c, branch: l } = await (r === "gitlab" ?
|
|
606
|
+
async function Xe({ username: e, branch: t, reposFilter: n, gitProvider: r, token: i, lastUpdated: a, multiUser: o }) {
|
|
607
|
+
let { user: s, repos: c, branch: l } = await (r === "gitlab" ? qe : Re)({
|
|
605
608
|
username: e,
|
|
606
609
|
token: i,
|
|
607
610
|
branch: t
|
|
608
|
-
}), { repos: u } = await
|
|
609
|
-
await
|
|
611
|
+
}), { repos: u } = await $e(s, c, l, n, r, o ? `${M(e)}/` : "");
|
|
612
|
+
await et(u, n, a);
|
|
610
613
|
}
|
|
611
|
-
async function
|
|
614
|
+
async function Ze(e, t, n, r, i = "") {
|
|
612
615
|
let a = [];
|
|
613
616
|
return await Promise.all(e.map(async (e) => {
|
|
614
|
-
let o = t ?? e.default_branch ?? "main", s = _(ae, `${i}${F(M(e.name), { removeDot: !0 })}`), c =
|
|
615
|
-
!e.fork && !e.private && !c && (u = await
|
|
617
|
+
let o = t ?? e.default_branch ?? "main", s = _(ae, `${i}${F(M(e.name), { removeDot: !0 })}`), c = tt(e, n), l = Je(e, o, r), u = [];
|
|
618
|
+
!e.fork && !e.private && !c && (u = await Qe(e, o, r, l)), a.push({
|
|
616
619
|
...e,
|
|
617
620
|
docpress: {
|
|
618
621
|
filtered: c,
|
|
@@ -626,25 +629,25 @@ async function Xe(e, t, n, r, i = "") {
|
|
|
626
629
|
});
|
|
627
630
|
})), a;
|
|
628
631
|
}
|
|
629
|
-
async function
|
|
630
|
-
let i = await
|
|
632
|
+
async function Qe(e, t, n, r) {
|
|
633
|
+
let i = await Ye(r ?? Je(e, t, n)), a = [];
|
|
631
634
|
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);
|
|
632
635
|
}
|
|
633
|
-
async function
|
|
636
|
+
async function $e(e, t, n, r, i, a = "") {
|
|
634
637
|
f(`${C}/user-${M(e.login)}.json`, JSON.stringify(e, null, 2));
|
|
635
|
-
let o = await
|
|
638
|
+
let o = await Ze(t, n, r, i, a);
|
|
636
639
|
return f(`${C}/repos-${M(e.login)}.json`, JSON.stringify(o, null, 2)), {
|
|
637
640
|
user: e,
|
|
638
641
|
repos: o
|
|
639
642
|
};
|
|
640
643
|
}
|
|
641
|
-
async function
|
|
644
|
+
async function et(e, t, n) {
|
|
642
645
|
if (!e) {
|
|
643
646
|
k(" No repositories to process.", "warn");
|
|
644
647
|
return;
|
|
645
648
|
}
|
|
646
|
-
let r = await Promise.all(e.filter((e) => !
|
|
647
|
-
let t = await
|
|
649
|
+
let r = await Promise.all(e.filter((e) => !tt(e, t)).map(async (e) => {
|
|
650
|
+
let t = await He(e.name, e.clone_url, e.docpress.projectPath, e.docpress.branch, e.docpress.includes, n);
|
|
648
651
|
return {
|
|
649
652
|
name: e.name,
|
|
650
653
|
success: t
|
|
@@ -657,7 +660,7 @@ async function $e(e, t, n) {
|
|
|
657
660
|
let i = r.filter(({ success: e }) => !e).map(({ name: e }) => e), a = r.length - i.length;
|
|
658
661
|
i.length ? k(` Cloned ${a}/${r.length} repository(ies), ${i.length} failed: ${i.join(", ")}.`, "warn") : k(` Cloned ${a}/${r.length} repository(ies).`, "success");
|
|
659
662
|
}
|
|
660
|
-
function
|
|
663
|
+
function tt(e, t) {
|
|
661
664
|
if ("docpress" in e && !e.docpress.includes.length) return !0;
|
|
662
665
|
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;
|
|
663
666
|
return !(e.clone_url && !e.private && !o);
|
|
@@ -669,15 +672,15 @@ var Q = [
|
|
|
669
672
|
n("--log-level <string>", q.shape.logLevel.description),
|
|
670
673
|
n("-T, --token <string>", q.shape.token.description),
|
|
671
674
|
n("-U, --usernames <string>", q.shape.usernames.description)
|
|
672
|
-
],
|
|
675
|
+
], nt = "fetch", rt = [
|
|
673
676
|
n("-b, --branch <string>", K.shape.branch.description),
|
|
674
677
|
n("-g, --git-provider <string>", K.shape.gitProvider.description).default(K.shape.gitProvider.def.defaultValue),
|
|
675
678
|
n("-l, --last-updated", K.shape.lastUpdated.description),
|
|
676
679
|
n("-r, --repos-filter <string>", K.shape.reposFilter.description)
|
|
677
|
-
],
|
|
678
|
-
await
|
|
680
|
+
], it = X(t(nt), [...rt, ...Q]).description("Fetch docs with the given username(s) and git provider.").action(async (e, t) => {
|
|
681
|
+
await at(J(nt, Y(t, e)));
|
|
679
682
|
});
|
|
680
|
-
async function
|
|
683
|
+
async function at(e) {
|
|
681
684
|
let { usernames: t, reposFilter: n, token: r, branch: i, gitProvider: a, lastUpdated: o } = e;
|
|
682
685
|
k("\n-> Start fetching documentation files. This may take a moment, especially for larger repositories.", "info");
|
|
683
686
|
let s = Date.now();
|
|
@@ -686,7 +689,7 @@ async function it(e) {
|
|
|
686
689
|
for (let e of t) {
|
|
687
690
|
let s = t.length > 1 ? n?.filter((t) => t.replace(/^!/, "").startsWith(`${e}/`)).map((t) => t.replace(`${e}/`, "")) : n;
|
|
688
691
|
try {
|
|
689
|
-
await
|
|
692
|
+
await Xe({
|
|
690
693
|
username: e,
|
|
691
694
|
branch: i,
|
|
692
695
|
reposFilter: s,
|
|
@@ -704,7 +707,7 @@ async function it(e) {
|
|
|
704
707
|
}
|
|
705
708
|
//#endregion
|
|
706
709
|
//#region src/commands/build.ts
|
|
707
|
-
async function
|
|
710
|
+
async function ot(e) {
|
|
708
711
|
let t = console.warn;
|
|
709
712
|
console.warn = function(...e) {
|
|
710
713
|
e.length > 0 && typeof e[0] == "string" && (e[0].includes("[Vue warn]: Invalid watch source:") || e[0].includes("{ open: false }")) || t.apply(console, e);
|
|
@@ -715,14 +718,14 @@ async function at(e) {
|
|
|
715
718
|
console.warn = t;
|
|
716
719
|
}
|
|
717
720
|
}
|
|
718
|
-
var
|
|
719
|
-
await
|
|
721
|
+
var st = X(t("build"), Q).description("Build vitepress website.").action(async (e) => {
|
|
722
|
+
await ct();
|
|
720
723
|
});
|
|
721
|
-
async function
|
|
724
|
+
async function ct() {
|
|
722
725
|
k("\n-> Start building Vitepress website.\n\n", "info");
|
|
723
726
|
let e = Date.now();
|
|
724
727
|
try {
|
|
725
|
-
await
|
|
728
|
+
await ot(async () => {
|
|
726
729
|
await te(C, { onAfterConfigResolve(e) {
|
|
727
730
|
ne(e);
|
|
728
731
|
} });
|
|
@@ -734,13 +737,13 @@ async function st() {
|
|
|
734
737
|
}
|
|
735
738
|
//#endregion
|
|
736
739
|
//#region src/utils/templates.ts
|
|
737
|
-
function
|
|
740
|
+
function lt(e, t) {
|
|
738
741
|
let n = s(e, { encoding: "utf8" });
|
|
739
742
|
I(m(t)), f(t, n);
|
|
740
743
|
}
|
|
741
744
|
//#endregion
|
|
742
745
|
//#region src/lib/vitepress.ts
|
|
743
|
-
var
|
|
746
|
+
var ut = {
|
|
744
747
|
base: "/",
|
|
745
748
|
lang: "en-US",
|
|
746
749
|
vite: { publicDir: "../public" },
|
|
@@ -773,21 +776,21 @@ var lt = {
|
|
|
773
776
|
}
|
|
774
777
|
}
|
|
775
778
|
};
|
|
776
|
-
function
|
|
777
|
-
return n ? B(
|
|
779
|
+
function dt(e, t, n) {
|
|
780
|
+
return n ? B(ut, n, { themeConfig: {
|
|
778
781
|
sidebar: e,
|
|
779
782
|
nav: t
|
|
780
|
-
} }) : B(
|
|
783
|
+
} }) : B(ut, { themeConfig: {
|
|
781
784
|
sidebar: e,
|
|
782
785
|
nav: t
|
|
783
786
|
} });
|
|
784
787
|
}
|
|
785
788
|
//#endregion
|
|
786
789
|
//#region src/lib/prepare.ts
|
|
787
|
-
function
|
|
790
|
+
function ft(e) {
|
|
788
791
|
return e === null ? {} : { collapsed: e };
|
|
789
792
|
}
|
|
790
|
-
async function
|
|
793
|
+
async function pt({ 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
794
|
let m = i && o !== "gitlab";
|
|
792
795
|
i && !m && k(" The forks page is not supported with the 'gitlab' provider, skipping.", "warn");
|
|
793
796
|
let h = be(d), g = xe(d).reduce(({ internals: e, forks: t }, n) => {
|
|
@@ -812,23 +815,23 @@ async function ft({ extraHeaderPages: e, extraPublicContent: t, extraTheme: n, v
|
|
|
812
815
|
}), ee = {
|
|
813
816
|
title: f,
|
|
814
817
|
tagline: p
|
|
815
|
-
}, { index: v, sidebar: y } =
|
|
818
|
+
}, { index: v, sidebar: y } = Tt(g.internals, h, ee, {
|
|
816
819
|
mode: c,
|
|
817
820
|
collapsed: l
|
|
818
821
|
}), b, x;
|
|
819
822
|
if (a(w) && a(T)) {
|
|
820
|
-
let e = await
|
|
821
|
-
b =
|
|
823
|
+
let e = await At(T), t = await jt(w);
|
|
824
|
+
b = Ct(e.themeConfig?.sidebar, y), x = {
|
|
822
825
|
...v,
|
|
823
826
|
features: [...t.features, ...v.features].sort((e, t) => e.title.localeCompare(t.title))
|
|
824
827
|
};
|
|
825
828
|
} else b = y, x = v;
|
|
826
829
|
let S = [];
|
|
827
830
|
if (e) {
|
|
828
|
-
let t =
|
|
831
|
+
let t = Et(e);
|
|
829
832
|
m ? S.push(...t.filter((e) => e.link !== "/forks")) : S.push(...t);
|
|
830
833
|
}
|
|
831
|
-
t && (k(" Add extras Vitepress public folder content.", "info"),
|
|
834
|
+
t && (k(" Add extras Vitepress public folder content.", "info"), Dt(t, _(C, "public"))), n && (k(" Add extras Vitepress theme files.", "info"), Dt(n, _(ce))), m && d.length && (k(" Add fork page to display external contributions.", "info"), await kt(g.forks, d, u), S.push({
|
|
832
835
|
text: "Forks",
|
|
833
836
|
link: "/forks"
|
|
834
837
|
}));
|
|
@@ -836,16 +839,16 @@ async function ft({ extraHeaderPages: e, extraPublicContent: t, extraTheme: n, v
|
|
|
836
839
|
lastUpdated: !0,
|
|
837
840
|
...r
|
|
838
841
|
} : r;
|
|
839
|
-
|
|
842
|
+
Mt(dt(b, S, te), x);
|
|
840
843
|
}
|
|
841
|
-
function
|
|
844
|
+
function mt(e, t) {
|
|
842
845
|
let n = `${F(p(t), {
|
|
843
846
|
mode: "lowercase",
|
|
844
847
|
removeIdx: !0
|
|
845
848
|
}) === "readme.md" ? "\n## Sources" : "# Sources"}\n\nTake a look at the [project sources](${e}).\n`;
|
|
846
849
|
r(t, n, "utf8");
|
|
847
850
|
}
|
|
848
|
-
function
|
|
851
|
+
function ht(e, t, n) {
|
|
849
852
|
let { name: r, login: i, bio: a } = t, { title: o, tagline: s } = n;
|
|
850
853
|
return {
|
|
851
854
|
layout: "home",
|
|
@@ -859,7 +862,7 @@ function mt(e, t, n) {
|
|
|
859
862
|
features: e
|
|
860
863
|
};
|
|
861
864
|
}
|
|
862
|
-
function
|
|
865
|
+
function gt(e, t, n, r = "") {
|
|
863
866
|
let i = {
|
|
864
867
|
title: F(e, {
|
|
865
868
|
mode: "capitalize",
|
|
@@ -870,87 +873,94 @@ function ht(e, t, n, r = "") {
|
|
|
870
873
|
};
|
|
871
874
|
return n ? [...n, i] : [i];
|
|
872
875
|
}
|
|
873
|
-
function
|
|
876
|
+
function _t(e, t, n = !0) {
|
|
874
877
|
return {
|
|
875
878
|
text: F(e, {
|
|
876
879
|
mode: "capitalize",
|
|
877
880
|
replaceDash: !0
|
|
878
881
|
}),
|
|
879
|
-
...
|
|
882
|
+
...ft(n),
|
|
880
883
|
items: t
|
|
881
884
|
};
|
|
882
885
|
}
|
|
883
|
-
function
|
|
884
|
-
return Object.entries(t).flatMap(([t, r]) =>
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
886
|
+
function vt(e, t, n = !0) {
|
|
887
|
+
return Object.entries(t).flatMap(([t, r]) => {
|
|
888
|
+
if (t === "$") return Array.isArray(r) ? r.map((t) => {
|
|
889
|
+
let n = _(e.docpress.projectPath, t), r = F(p(n), {
|
|
890
|
+
mode: "lowercase",
|
|
891
|
+
removeIdx: !0
|
|
892
|
+
});
|
|
893
|
+
return r === "readme.md" && (r = "introduction.md"), r !== p(n) && l(n, _(m(n), r)), {
|
|
894
|
+
text: g(r).name === "introduction" ? "Introduction" : F(r, {
|
|
895
|
+
mode: "capitalize",
|
|
896
|
+
replaceDash: !0,
|
|
897
|
+
removeExt: !0
|
|
898
|
+
}),
|
|
899
|
+
link: `/${e.docpress.routePrefix ?? ""}${F(e.name, { removeDot: !0 })}/${g(r).name}`
|
|
900
|
+
};
|
|
901
|
+
}) : [];
|
|
902
|
+
if (typeof r == "object") {
|
|
903
|
+
let i = F(t, { removeIdx: !0 }), a = _(e.docpress.projectPath, t), o = _(e.docpress.projectPath, i);
|
|
904
|
+
return i !== t && l(a, o), [{
|
|
905
|
+
text: F(i, {
|
|
906
|
+
mode: "capitalize",
|
|
907
|
+
replaceDash: !0
|
|
908
|
+
}),
|
|
909
|
+
...ft(n),
|
|
910
|
+
items: vt({
|
|
911
|
+
...e,
|
|
912
|
+
name: `${e.name}/${i}`,
|
|
913
|
+
docpress: {
|
|
914
|
+
...e.docpress,
|
|
915
|
+
projectPath: o
|
|
916
|
+
}
|
|
917
|
+
}, r, n)
|
|
918
|
+
}];
|
|
919
|
+
}
|
|
920
|
+
return [];
|
|
921
|
+
});
|
|
912
922
|
}
|
|
913
|
-
function
|
|
923
|
+
function yt(e) {
|
|
914
924
|
return e.reduce((e, t) => {
|
|
915
925
|
let [n, ...r] = t.split("/");
|
|
916
|
-
return r.length ? e[n] =
|
|
926
|
+
return r.length ? e[n] = yt([...e[n] ? $(e[n], "") : [], r.join("/")]) : e.$ = [...e.$ || [], n], e;
|
|
917
927
|
}, {});
|
|
918
928
|
}
|
|
919
929
|
function $(e, t = "") {
|
|
920
930
|
return Object.entries(e).flatMap(([e, n]) => e === "$" ? Array.isArray(n) ? n.map((e) => t ? `${t}/${e}` : e) : [] : $(n, t ? `${t}/${e}` : e));
|
|
921
931
|
}
|
|
922
|
-
function
|
|
932
|
+
function bt(e) {
|
|
923
933
|
if (!Array.isArray(e)) return e;
|
|
924
934
|
let t = e.findIndex((e) => e.text === "Sources");
|
|
925
935
|
if (t === -1) return e;
|
|
926
936
|
let [n] = e.splice(t, 1);
|
|
927
937
|
return e.push(n), e;
|
|
928
938
|
}
|
|
929
|
-
var
|
|
930
|
-
function
|
|
939
|
+
var xt = 5;
|
|
940
|
+
function St(e, t, n = []) {
|
|
931
941
|
return e.flatMap((e) => {
|
|
932
942
|
if (!("items" in e) || !e.items?.length) return [];
|
|
933
943
|
let r = [...n, e.text];
|
|
934
|
-
return t >=
|
|
944
|
+
return t >= xt ? [r.join("/")] : St(e.items, t + 1, r);
|
|
935
945
|
});
|
|
936
946
|
}
|
|
937
|
-
function
|
|
947
|
+
function Ct(e, t) {
|
|
938
948
|
if (!e) return t;
|
|
939
949
|
if (Array.isArray(e) && Array.isArray(t)) return [...e, ...t].toSorted((e, t) => (e.text ?? "").localeCompare(t.text ?? ""));
|
|
940
950
|
let n = (e) => Array.isArray(e) ? { "/": e } : e;
|
|
941
|
-
return
|
|
951
|
+
return wt({
|
|
942
952
|
...n(e),
|
|
943
953
|
...n(t)
|
|
944
954
|
});
|
|
945
955
|
}
|
|
946
|
-
function
|
|
956
|
+
function wt(e) {
|
|
947
957
|
return Object.fromEntries(Object.entries(e).toSorted(([e], [t]) => e.localeCompare(t)));
|
|
948
958
|
}
|
|
949
|
-
function
|
|
959
|
+
function Tt(e, t, n, r = {}) {
|
|
950
960
|
let { mode: i = "single", collapsed: a = !0 } = r, o = [], s = [], l = {};
|
|
951
961
|
for (let t of e) {
|
|
952
962
|
k(` Replace urls for repository '${t.name}'.`, "info"), R([t.docpress.projectPath]).forEach((e) => {
|
|
953
|
-
k(` Processing file '${p(e)}' for repository '${t.name}'.`, "debug"), we(e, t.docpress.replace_url), p(e).toLowerCase() === "readme.md" &&
|
|
963
|
+
k(` Processing file '${p(e)}' for repository '${t.name}'.`, "debug"), we(e, t.docpress.replace_url), p(e).toLowerCase() === "readme.md" && Oe(e, t.docpress.replace_url), De(e);
|
|
954
964
|
}), k(` Generate sidebar for repository '${t.name}'.`, "info");
|
|
955
965
|
let e = c(t.docpress.projectPath, { recursive: !0 }).filter((e) => {
|
|
956
966
|
let n = _(t.docpress.projectPath, e.toString());
|
|
@@ -958,18 +968,18 @@ function wt(e, t, n, r = {}) {
|
|
|
958
968
|
}).sort();
|
|
959
969
|
k(` Add sources for repository '${t.name}'.`, "info");
|
|
960
970
|
let n;
|
|
961
|
-
e.length > 1 ? (n = _(t.docpress.projectPath, "sources.md"), e.push("sources.md")) : e.length === 1 && (n = _(t.docpress.projectPath, e[0])), n ?
|
|
962
|
-
let r =
|
|
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(
|
|
971
|
+
e.length > 1 ? (n = _(t.docpress.projectPath, "sources.md"), e.push("sources.md")) : e.length === 1 && (n = _(t.docpress.projectPath, e[0])), n ? mt(t.html_url, n) : k(` No markdown files found for repository '${t.name}', skipping sources.`, "warn");
|
|
972
|
+
let r = bt(vt(t, yt(e), a)), u = St(r, i === "multi" ? 0 : 1);
|
|
973
|
+
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(_t(F(t.name, { removeDot: !0 }), r, a)), o.push(...gt(F(t.name, { removeDot: !0 }), t.description || "", void 0, t.docpress.routePrefix ?? ""));
|
|
964
974
|
}
|
|
965
975
|
k(" Generate index content.", "info");
|
|
966
|
-
let u =
|
|
976
|
+
let u = ht(o.toSorted((e, t) => e.title.localeCompare(t.title)), t, n);
|
|
967
977
|
return {
|
|
968
|
-
sidebar: i === "multi" ?
|
|
978
|
+
sidebar: i === "multi" ? wt(l) : s.toSorted((e, t) => e.text.localeCompare(t.text)),
|
|
969
979
|
index: u
|
|
970
980
|
};
|
|
971
981
|
}
|
|
972
|
-
function
|
|
982
|
+
function Et(e) {
|
|
973
983
|
let t = R(e), n = [];
|
|
974
984
|
k(" Add extras Vitepress headers pages.", "info");
|
|
975
985
|
for (let e of t) {
|
|
@@ -991,7 +1001,7 @@ function Tt(e) {
|
|
|
991
1001
|
}
|
|
992
1002
|
return n;
|
|
993
1003
|
}
|
|
994
|
-
function
|
|
1004
|
+
function Dt(e, t, n) {
|
|
995
1005
|
for (let r of Array.isArray(e) ? e : [e]) {
|
|
996
1006
|
let e = _(process.cwd(), r), a = L(e);
|
|
997
1007
|
for (let o of a) {
|
|
@@ -1002,7 +1012,7 @@ function Et(e, t, n) {
|
|
|
1002
1012
|
}
|
|
1003
1013
|
}
|
|
1004
1014
|
}
|
|
1005
|
-
function
|
|
1015
|
+
function Ot(e) {
|
|
1006
1016
|
let t = e.map(({ repository: e, contributions: t }) => {
|
|
1007
1017
|
let { name: n, owner: r, html_url: i, description: a, stargazers_count: o } = e;
|
|
1008
1018
|
return {
|
|
@@ -1016,9 +1026,9 @@ function Dt(e) {
|
|
|
1016
1026
|
});
|
|
1017
1027
|
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");
|
|
1018
1028
|
}
|
|
1019
|
-
async function
|
|
1020
|
-
|
|
1021
|
-
let { source: r, contributors: i } = await
|
|
1029
|
+
async function kt(e, t, n) {
|
|
1030
|
+
Ot(await Promise.all(e.map(async (e) => {
|
|
1031
|
+
let { source: r, contributors: i } = await ze({
|
|
1022
1032
|
repository: e,
|
|
1023
1033
|
token: n
|
|
1024
1034
|
});
|
|
@@ -1028,7 +1038,7 @@ async function Ot(e, t, n) {
|
|
|
1028
1038
|
};
|
|
1029
1039
|
})).then((e) => e.filter(({ repository: e, contributions: t }) => !!e && t)));
|
|
1030
1040
|
}
|
|
1031
|
-
async function
|
|
1041
|
+
async function At(e) {
|
|
1032
1042
|
try {
|
|
1033
1043
|
let { config: t } = await import(_(process.cwd(), e));
|
|
1034
1044
|
return t ?? {};
|
|
@@ -1036,22 +1046,22 @@ async function kt(e) {
|
|
|
1036
1046
|
return k(` Unable to load existing Vitepress config '${e}', starting from an empty config. ${N(t)}`, "warn"), {};
|
|
1037
1047
|
}
|
|
1038
1048
|
}
|
|
1039
|
-
async function
|
|
1049
|
+
async function jt(e) {
|
|
1040
1050
|
let t = (await re(_(process.cwd(), e))).toString();
|
|
1041
1051
|
return v.parse(t);
|
|
1042
1052
|
}
|
|
1043
|
-
function
|
|
1053
|
+
function Mt(e, t) {
|
|
1044
1054
|
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
1055
|
let n = L(E);
|
|
1046
1056
|
if (!n.length) throw Error(`No template theme files found at '${E}'. The Vitepress build cannot succeed without them.`);
|
|
1047
1057
|
k(" Add Docpress theme files.", "info"), n.forEach((e) => {
|
|
1048
1058
|
let t = e.replace(`${E}/`, "");
|
|
1049
|
-
|
|
1059
|
+
lt(e, _(se, t));
|
|
1050
1060
|
});
|
|
1051
1061
|
}
|
|
1052
1062
|
//#endregion
|
|
1053
1063
|
//#region src/commands/prepare.ts
|
|
1054
|
-
var
|
|
1064
|
+
var Nt = "prepare", Pt = [
|
|
1055
1065
|
n("-c, --extra-public-content <string>", K.shape.extraPublicContent.description),
|
|
1056
1066
|
n("-f, --forks", K.shape.forks.description),
|
|
1057
1067
|
n("-p, --extra-header-pages <string>", K.shape.extraHeaderPages.description),
|
|
@@ -1061,17 +1071,17 @@ var Mt = "prepare", Nt = [
|
|
|
1061
1071
|
n("-v, --vitepress-config <string>", K.shape.vitepressConfig.description),
|
|
1062
1072
|
n("--website-title <string>", K.shape.websiteTitle.description),
|
|
1063
1073
|
n("--website-tagline <string>", K.shape.websiteTagline.description)
|
|
1064
|
-
],
|
|
1065
|
-
await
|
|
1074
|
+
], Ft = X(t(Nt), [...Pt, ...Q]).description("Transform doc to the target vitepress format.").action(async (e, t) => {
|
|
1075
|
+
await It(J(Nt, Y(t, e)));
|
|
1066
1076
|
});
|
|
1067
|
-
async function
|
|
1077
|
+
async function It(e) {
|
|
1068
1078
|
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;
|
|
1069
1079
|
k("\n-> Start transform files to prepare Vitepress build.", "info");
|
|
1070
1080
|
let h = Date.now();
|
|
1071
1081
|
I(m(T), { clean: !0 });
|
|
1072
1082
|
let g = [];
|
|
1073
1083
|
for (let e of d) try {
|
|
1074
|
-
await
|
|
1084
|
+
await pt({
|
|
1075
1085
|
extraHeaderPages: t,
|
|
1076
1086
|
extraPublicContent: n,
|
|
1077
1087
|
extraTheme: r,
|
|
@@ -1094,27 +1104,27 @@ async function Ft(e) {
|
|
|
1094
1104
|
}
|
|
1095
1105
|
//#endregion
|
|
1096
1106
|
//#region src/cli.ts
|
|
1097
|
-
function
|
|
1107
|
+
function Lt() {
|
|
1098
1108
|
let t = new e().name("docpress").description("Build your doc website faster than light ⚡️⚡️⚡️").version(`${ie.version}`).action(async (e, t) => {
|
|
1099
1109
|
let n = J("global", Y(t, e));
|
|
1100
|
-
await
|
|
1110
|
+
await at(n), await It(n), await ct();
|
|
1101
1111
|
}).configureHelp({
|
|
1102
1112
|
sortSubcommands: !0,
|
|
1103
1113
|
sortOptions: !0,
|
|
1104
1114
|
showGlobalOptions: !0
|
|
1105
|
-
}).enablePositionalOptions().passThroughOptions().addCommand(
|
|
1115
|
+
}).enablePositionalOptions().passThroughOptions().addCommand(it).addCommand(Ft).addCommand(st);
|
|
1106
1116
|
return X(t, [
|
|
1107
|
-
...
|
|
1108
|
-
...
|
|
1117
|
+
...rt,
|
|
1118
|
+
...Pt,
|
|
1109
1119
|
...Q
|
|
1110
1120
|
]), t;
|
|
1111
1121
|
}
|
|
1112
|
-
function
|
|
1113
|
-
|
|
1122
|
+
function Rt() {
|
|
1123
|
+
Lt().parseAsync(process.argv).catch((e) => {
|
|
1114
1124
|
k(`\n${N(e)}`, "error"), process.exit(1);
|
|
1115
1125
|
});
|
|
1116
1126
|
}
|
|
1117
1127
|
//#endregion
|
|
1118
|
-
export {
|
|
1128
|
+
export { Lt as getProgram, Rt as main };
|
|
1119
1129
|
|
|
1120
1130
|
//# sourceMappingURL=cli.js.map
|