@tobi-or-not/docpress 0.8.2 → 0.8.3
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 +79 -79
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/types/cli.d.ts +0 -3
- package/types/commands/build.d.ts +0 -3
- package/types/commands/fetch.d.ts +0 -4
- package/types/commands/global.d.ts +0 -1
- package/types/commands/prepare.d.ts +0 -4
- package/types/lib/fetch.d.ts +0 -120
- package/types/lib/git.d.ts +0 -515
- package/types/lib/prepare.d.ts +0 -62
- package/types/lib/vitepress.d.ts +0 -3
- package/types/schemas/build.d.ts +0 -20
- package/types/schemas/fetch.d.ts +0 -52
- package/types/schemas/global.d.ts +0 -150
- package/types/schemas/prepare.d.ts +0 -61
- package/types/src/templates/index.d.ts +0 -1
- package/types/src/templates/theme/index.d.ts +0 -8
- package/types/src/utils/resolver.d.ts +0 -1
- package/types/templates/index.d.ts +0 -5
- package/types/templates/theme/index.d.ts +0 -8
- package/types/utils/commands.d.ts +0 -207
- package/types/utils/const.d.ts +0 -10
- package/types/utils/functions.d.ts +0 -24
- package/types/utils/logger.d.ts +0 -4
- package/types/utils/regex.d.ts +0 -2
package/dist/cli.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { createOption as m, createCommand as J, Command as
|
|
2
|
-
import { readFileSync as S, existsSync as O, mkdirSync as
|
|
3
|
-
import { resolve as
|
|
1
|
+
import { createOption as m, createCommand as J, Command as ke } from "commander";
|
|
2
|
+
import { readFileSync as S, existsSync as O, mkdirSync as Pe, writeFileSync as v, readdirSync as le, statSync as z, appendFileSync as ue, cpSync as B, rmSync as Z, renameSync as Ee } from "node:fs";
|
|
3
|
+
import { resolve as l, basename as y, join as Fe, dirname as _, parse as R } from "node:path";
|
|
4
4
|
import Te from "axios";
|
|
5
5
|
import { rimrafSync as Oe } from "rimraf";
|
|
6
6
|
import ee from "chalk";
|
|
7
7
|
import { fromError as Re } from "zod-validation-error";
|
|
8
|
-
import { z as
|
|
8
|
+
import { z as u } from "zod";
|
|
9
9
|
import { Octokit as de } from "@octokit/rest";
|
|
10
10
|
import { simpleGit as _e } from "simple-git";
|
|
11
11
|
import { build as Ae } from "vitepress";
|
|
12
12
|
import { withMermaid as Ie } from "vitepress-plugin-mermaid";
|
|
13
13
|
import { readFile as je } from "node:fs/promises";
|
|
14
14
|
import q from "yaml";
|
|
15
|
-
const Le = "0.8.
|
|
15
|
+
const Le = "0.8.3", Ne = {
|
|
16
16
|
version: Le
|
|
17
|
-
}, C =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const pe =
|
|
17
|
+
}, C = l(process.cwd(), "docpress");
|
|
18
|
+
l(process.cwd(), "docpress/repositories.json");
|
|
19
|
+
l(process.cwd(), "docpress/owner.json");
|
|
20
|
+
const pe = l(process.cwd(), "docpress/docs"), M = l(process.cwd(), "docpress/docs/index.md"), Ve = l(process.cwd(), "docpress/docs/forks.md"), E = l(process.cwd(), "docpress/.vitepress/config.ts"), De = l(process.cwd(), "docpress/.vitepress/theme"), Ge = l(process.cwd(), "docpress/.vitepress/theme/extras"), te = process.env.NODE_ENV === "development" ? l(import.meta.dirname, "../../public/templates/theme") : l(import.meta.dirname, "./templates/theme"), He = /\[([^\]]+)\]\(\.\.\/([^)]+)\)/g, Me = /\[([^\]]+)\]\((?!\.?\/docs\/|docs\/|http|#)(\.\/)?([^/][^)]+)\)/g, Ue = /\[([^\]]+)\]\((\.?\/docs\/|docs\/)([^)]*)\)/g, We = /^\d{2}-/;
|
|
21
21
|
async function G(e) {
|
|
22
22
|
try {
|
|
23
23
|
return (await Te.head(e)).status;
|
|
@@ -31,7 +31,7 @@ function f(e, t) {
|
|
|
31
31
|
}
|
|
32
32
|
function F(e, { clean: t } = { clean: !1 }) {
|
|
33
33
|
try {
|
|
34
|
-
t && O(e) && Oe(`${e}/*`, { glob: !0 }), O(e) ||
|
|
34
|
+
t && O(e) && Oe(`${e}/*`, { glob: !0 }), O(e) || Pe(e, { recursive: !0 });
|
|
35
35
|
} catch (r) {
|
|
36
36
|
console.error(r);
|
|
37
37
|
}
|
|
@@ -51,7 +51,7 @@ function ze(e) {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
function A(e) {
|
|
54
|
-
return (Array.isArray(e) ? e : [e]).flatMap((t) => ze(t) ? [t] : Je(t) ?
|
|
54
|
+
return (Array.isArray(e) ? e : [e]).flatMap((t) => ze(t) ? [t] : Je(t) ? le(t).flatMap((r) => A(Fe(t, r))) : []);
|
|
55
55
|
}
|
|
56
56
|
function fe(e) {
|
|
57
57
|
return A(e).filter((t) => y(t).endsWith(".md"));
|
|
@@ -78,13 +78,13 @@ function W(e) {
|
|
|
78
78
|
if (!e)
|
|
79
79
|
return {};
|
|
80
80
|
try {
|
|
81
|
-
const t =
|
|
81
|
+
const t = l(process.cwd(), e), r = S(t, "utf8");
|
|
82
82
|
return JSON.parse(r);
|
|
83
83
|
} catch {
|
|
84
84
|
return {};
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function P(e) {
|
|
88
88
|
return e.split(",");
|
|
89
89
|
}
|
|
90
90
|
function Xe(e, t) {
|
|
@@ -110,39 +110,39 @@ function a(e, t = "info", r) {
|
|
|
110
110
|
const o = r ? ee[r](e) : ee[oe[t].color](e), s = t === "success" ? "info" : t;
|
|
111
111
|
Qe() >= oe[t].level && console[s](o);
|
|
112
112
|
}
|
|
113
|
-
const se = ["github"], d =
|
|
113
|
+
const se = ["github"], d = u.object({
|
|
114
114
|
// Global
|
|
115
|
-
usernames:
|
|
115
|
+
usernames: u.string().array().describe("List of comma separated Git provider usernames used to collect data."),
|
|
116
116
|
// Fetch
|
|
117
|
-
branch:
|
|
118
|
-
gitProvider:
|
|
119
|
-
reposFilter:
|
|
117
|
+
branch: u.string().describe("Branch used to collect Git provider data.").default("main"),
|
|
118
|
+
gitProvider: u.enum(se).describe(`Git provider used to retrieve data. Values should be ${Be(se)}.`).default("github"),
|
|
119
|
+
reposFilter: u.string().array().describe("List of comma separated repositories to retrieve from Git provider. Default to all user's public repositories."),
|
|
120
120
|
// Prepare
|
|
121
|
-
extraHeaderPages:
|
|
122
|
-
extraPublicContent:
|
|
123
|
-
extraTheme:
|
|
124
|
-
forks:
|
|
125
|
-
vitepressConfig:
|
|
126
|
-
websiteTitle:
|
|
127
|
-
websiteTagline:
|
|
121
|
+
extraHeaderPages: u.string().array().describe("List of comma separated additional files or directories to process Vitepress header pages."),
|
|
122
|
+
extraPublicContent: u.string().array().describe("List of comma separated additional files or directories to process Vitepress public folder."),
|
|
123
|
+
extraTheme: u.string().array().describe("List of comma separated additional files or directories to use as Vitepress theme."),
|
|
124
|
+
forks: u.boolean().describe("Whether or not to create the dedicated fork page that aggregate external contributions.").default(!1),
|
|
125
|
+
vitepressConfig: u.any().describe("Path to the vitepress configuration file."),
|
|
126
|
+
websiteTitle: u.string().describe("Website title."),
|
|
127
|
+
websiteTagline: u.string().describe("Website tagline.")
|
|
128
128
|
}), H = d.partial().extend({
|
|
129
|
-
config:
|
|
130
|
-
token:
|
|
131
|
-
usernames:
|
|
132
|
-
reposFilter:
|
|
133
|
-
extraHeaderPages:
|
|
134
|
-
extraPublicContent:
|
|
135
|
-
extraTheme:
|
|
136
|
-
vitepressConfig:
|
|
129
|
+
config: u.string().describe("Path to the docpress configuration file.").optional(),
|
|
130
|
+
token: u.string().describe("Git provider token used to collect data.").optional(),
|
|
131
|
+
usernames: u.string().describe(d.shape.usernames.description || "").optional(),
|
|
132
|
+
reposFilter: u.string().describe(d.shape.reposFilter.description || "").optional(),
|
|
133
|
+
extraHeaderPages: u.string().describe(d.shape.extraHeaderPages.description || "").optional(),
|
|
134
|
+
extraPublicContent: u.string().describe(d.shape.extraPublicContent.description || "").optional(),
|
|
135
|
+
extraTheme: u.string().describe(d.shape.extraTheme.description || "").optional(),
|
|
136
|
+
vitepressConfig: u.string().describe(d.shape.vitepressConfig.description || "").optional()
|
|
137
137
|
}), I = d.partial().extend({
|
|
138
|
-
config:
|
|
139
|
-
token:
|
|
140
|
-
usernames:
|
|
141
|
-
reposFilter:
|
|
142
|
-
extraHeaderPages:
|
|
143
|
-
extraPublicContent:
|
|
144
|
-
extraTheme:
|
|
145
|
-
vitepressConfig:
|
|
138
|
+
config: u.string().describe("Path to the docpress configuration file.").optional(),
|
|
139
|
+
token: u.string().describe("Git provider token used to collect data.").optional(),
|
|
140
|
+
usernames: u.string().describe(d.shape.usernames.description || "").transform(P).optional(),
|
|
141
|
+
reposFilter: u.string().describe(d.shape.reposFilter.description || "").transform(P).optional(),
|
|
142
|
+
extraHeaderPages: u.string().describe(d.shape.extraHeaderPages.description || "").transform(P).optional(),
|
|
143
|
+
extraPublicContent: u.string().describe(d.shape.extraPublicContent.description || "").transform(P).optional(),
|
|
144
|
+
extraTheme: u.string().describe(d.shape.extraTheme.description || "").transform(P).optional(),
|
|
145
|
+
vitepressConfig: u.string().describe(d.shape.vitepressConfig.description || "").optional()
|
|
146
146
|
});
|
|
147
147
|
function Ze(e) {
|
|
148
148
|
return e ? (e.usernames && typeof e.usernames == "string" && (e.usernames = [e.usernames]), e.reposFilter && typeof e.reposFilter == "string" && (e.reposFilter = [e.reposFilter]), e.extraHeaderPages && typeof e.extraHeaderPages == "string" && (e.extraHeaderPages = [e.extraHeaderPages]), e.extraPublicContent && typeof e.extraPublicContent == "string" && (e.extraPublicContent = [e.extraPublicContent]), e.extraTheme && typeof e.extraTheme == "string" && (e.extraTheme = [e.extraTheme]), e) : {};
|
|
@@ -292,20 +292,20 @@ async function ct({
|
|
|
292
292
|
}
|
|
293
293
|
return { source: o.source, contributors: s };
|
|
294
294
|
}
|
|
295
|
-
async function
|
|
295
|
+
async function lt(e, t, r, o, s) {
|
|
296
296
|
F(r, { clean: !0 });
|
|
297
297
|
try {
|
|
298
298
|
const i = _e({ baseDir: r });
|
|
299
299
|
await i.init().addConfig("core.sparseCheckout", "true", !0, "local").addRemote("origin", t);
|
|
300
300
|
for (const n of s)
|
|
301
|
-
a(` Add '${n}' to '${e}' sparse-checkout file.`, "debug"),
|
|
301
|
+
a(` Add '${n}' to '${e}' sparse-checkout file.`, "debug"), ue(l(r, ".git/info/sparse-checkout"), `${n}
|
|
302
302
|
`, "utf8");
|
|
303
|
-
a(` Clone repository '${e}'.`, "info"), await i.pull("origin", o), s.some((n) => n.includes("docs")) && (B(
|
|
303
|
+
a(` Clone repository '${e}'.`, "info"), await i.pull("origin", o), s.some((n) => n.includes("docs")) && (B(l(r, "docs"), r, { recursive: !0 }), Z(l(r, "docs"), { recursive: !0 })), Z(l(r, ".git"), { recursive: !0 });
|
|
304
304
|
} catch (i) {
|
|
305
305
|
a(` Error when cloning repository: ${i}.`, "error");
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
async function
|
|
308
|
+
async function ut(e, t, r) {
|
|
309
309
|
const o = `https://github.com/${e}/${t}/tree/${r}/README.md`, s = `https://github.com/${e}/${t}/tree/${r}/docs`, i = `https://github.com/${e}/${t}/tree/${r}/docs/01-readme.md`, n = await G(o), c = await G(s), p = await G(i);
|
|
310
310
|
return {
|
|
311
311
|
rootReadmeStatus: n,
|
|
@@ -320,7 +320,7 @@ async function pt(e, t, r) {
|
|
|
320
320
|
const o = [];
|
|
321
321
|
return await Promise.all(
|
|
322
322
|
e.map(async (s) => {
|
|
323
|
-
const i = t ?? s.default_branch ?? "main", n =
|
|
323
|
+
const i = t ?? s.default_branch ?? "main", n = l(pe, f(s.name, { removeDot: !0 })), c = me(s, r);
|
|
324
324
|
let p = [];
|
|
325
325
|
!s.fork && !s.private && !c && (p = await ft(s, i)), o.push({
|
|
326
326
|
...s,
|
|
@@ -337,7 +337,7 @@ async function pt(e, t, r) {
|
|
|
337
337
|
), o;
|
|
338
338
|
}
|
|
339
339
|
async function ft(e, t) {
|
|
340
|
-
const r = await
|
|
340
|
+
const r = await ut(e.owner.login, e.name, t), o = [];
|
|
341
341
|
return Object.values(r).every((s) => s === 404) || !e.size ? [] : (r.docsFolderStatus !== 404 && o.push("docs/*"), (r.docsFolderStatus === 404 || r.docsReadmeStatus === 404) && o.push("README.md", "!*/**/README.md"), o);
|
|
342
342
|
}
|
|
343
343
|
async function mt(e, t, r, o) {
|
|
@@ -352,7 +352,7 @@ async function gt(e, t) {
|
|
|
352
352
|
}
|
|
353
353
|
await Promise.all(
|
|
354
354
|
e.filter((r) => !me(r, t)).map(async (r) => {
|
|
355
|
-
await
|
|
355
|
+
await lt(r.name, r.clone_url, r.docpress.projectPath, r.docpress.branch, r.docpress.includes);
|
|
356
356
|
})
|
|
357
357
|
);
|
|
358
358
|
}
|
|
@@ -462,37 +462,37 @@ function $t(e, t, r) {
|
|
|
462
462
|
}
|
|
463
463
|
async function xt({ extraHeaderPages: e, extraPublicContent: t, extraTheme: r, vitepressConfig: o, forks: s, token: i, username: n, websiteTitle: c, websiteTagline: p }) {
|
|
464
464
|
const h = qe(n), b = Ke(n).reduce(({ internals: w, forks: $ }, x) => {
|
|
465
|
-
const { clone_url:
|
|
466
|
-
if (
|
|
465
|
+
const { clone_url: k, private: Se, fork: Y, docpress: Q } = x;
|
|
466
|
+
if (k && !Se && !Q.filtered) {
|
|
467
467
|
if (!Y && Q.includes.length)
|
|
468
468
|
return { internals: [...w, x], forks: $ };
|
|
469
469
|
if (Y)
|
|
470
470
|
return { internals: w, forks: [...$, x] };
|
|
471
471
|
}
|
|
472
472
|
return { internals: w, forks: $ };
|
|
473
|
-
}, { internals: [], forks: [] }), g = { title: c, tagline: p }, { index:
|
|
474
|
-
let
|
|
473
|
+
}, { internals: [], forks: [] }), g = { title: c, tagline: p }, { index: N, sidebar: X } = Ft(b.internals, h, g);
|
|
474
|
+
let V, D;
|
|
475
475
|
if (O(M) && O(E)) {
|
|
476
476
|
const w = await _t(E), $ = await At(M);
|
|
477
|
-
|
|
477
|
+
V = [
|
|
478
478
|
...w.themeConfig?.sidebar ?? [],
|
|
479
479
|
...X
|
|
480
|
-
].sort((x,
|
|
481
|
-
...
|
|
480
|
+
].sort((x, k) => x.text.localeCompare(k.text)), D = {
|
|
481
|
+
...N,
|
|
482
482
|
features: [
|
|
483
483
|
...$.features,
|
|
484
|
-
...
|
|
485
|
-
].sort((x,
|
|
484
|
+
...N.features
|
|
485
|
+
].sort((x, k) => x.title.localeCompare(k.title))
|
|
486
486
|
};
|
|
487
487
|
} else
|
|
488
|
-
|
|
488
|
+
V = X, D = N;
|
|
489
489
|
const T = [];
|
|
490
490
|
if (e) {
|
|
491
491
|
const w = Tt(e);
|
|
492
492
|
s ? T.push(...w.filter(($) => $.link !== "/forks")) : T.push(...w);
|
|
493
493
|
}
|
|
494
|
-
t && (a(" Add extras Vitepress public folder content.", "info"), ae(t,
|
|
495
|
-
const Ce = $t(
|
|
494
|
+
t && (a(" Add extras Vitepress public folder content.", "info"), ae(t, l(C, "public"))), r && (a(" Add extras Vitepress theme files.", "info"), ae(r, l(Ge))), s && n.length && (a(" Add fork page to display external contributions.", "info"), await Rt(b.forks, n, i), T.push({ text: "Forks", link: "/forks" }));
|
|
495
|
+
const Ce = $t(V, T, o);
|
|
496
496
|
It(Ce, D);
|
|
497
497
|
}
|
|
498
498
|
function Ct(e, t) {
|
|
@@ -501,7 +501,7 @@ function Ct(e, t) {
|
|
|
501
501
|
|
|
502
502
|
Take a look at the [project sources](${e}).
|
|
503
503
|
`;
|
|
504
|
-
|
|
504
|
+
ue(t, s, "utf8");
|
|
505
505
|
}
|
|
506
506
|
function St(e, t, r) {
|
|
507
507
|
const { name: o, login: s, bio: i } = t, { title: n, tagline: c } = r;
|
|
@@ -511,7 +511,7 @@ function St(e, t, r) {
|
|
|
511
511
|
features: e
|
|
512
512
|
};
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function kt(e, t, r) {
|
|
515
515
|
const o = {
|
|
516
516
|
title: f(e, { mode: "capitalize", replaceDash: !0 }),
|
|
517
517
|
details: t,
|
|
@@ -519,7 +519,7 @@ function Pt(e, t, r) {
|
|
|
519
519
|
};
|
|
520
520
|
return r ? [...r, o] : [o];
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function Pt(e, t) {
|
|
523
523
|
return {
|
|
524
524
|
text: f(e, { mode: "capitalize", replaceDash: !0 }),
|
|
525
525
|
collapsed: !0,
|
|
@@ -528,9 +528,9 @@ function kt(e, t) {
|
|
|
528
528
|
}
|
|
529
529
|
function we(e, t) {
|
|
530
530
|
return Object.entries(t).flatMap(([r, o]) => r === "$" ? Array.isArray(o) ? o.map((s) => {
|
|
531
|
-
const i =
|
|
531
|
+
const i = l(e.docpress.projectPath, s);
|
|
532
532
|
let n = f(y(i), { mode: "lowercase", removeIdx: !0 });
|
|
533
|
-
return n === "readme.md" && (n = "introduction.md"), n !== y(i) && Ee(i,
|
|
533
|
+
return n === "readme.md" && (n = "introduction.md"), n !== y(i) && Ee(i, l(_(i), n)), {
|
|
534
534
|
text: R(n).name === "introduction" ? "Introduction" : f(n, { mode: "capitalize", replaceDash: !0, removeExt: !0 }),
|
|
535
535
|
link: `/${f(e.name, { removeDot: !0 })}/${R(n).name}`
|
|
536
536
|
};
|
|
@@ -567,12 +567,12 @@ function Ft(e, t, r) {
|
|
|
567
567
|
a(` Replace urls for repository '${n.name}'.`, "info"), fe([n.docpress.projectPath]).forEach((g) => {
|
|
568
568
|
a(` Processing file '${y(g)}' for repository '${n.name}'.`, "debug"), Xe(g, `https://github.com/${n.owner.login}/${n.name}/tree/${n.docpress.branch}`), y(g).toLowerCase() === "readme.md" && Ye(g, `https://github.com/${n.owner.login}/${n.name}/tree/${n.docpress.branch}`);
|
|
569
569
|
}), a(` Generate sidebar for repository '${n.name}'.`, "info");
|
|
570
|
-
const c =
|
|
570
|
+
const c = le(n.docpress.projectPath, { recursive: !0 }).filter((g) => z(l(n.docpress.projectPath, g.toString())).isFile() && y(l(n.docpress.projectPath, g.toString())).endsWith(".md"));
|
|
571
571
|
a(` Add sources for repository '${n.name}'.`, "info");
|
|
572
572
|
let p;
|
|
573
|
-
c.length > 1 ? (p =
|
|
573
|
+
c.length > 1 ? (p = l(n.docpress.projectPath, "sources.md"), c.push("sources.md")) : c.length === 1 && (p = l(n.docpress.projectPath, c[0])), p ? Ct(n.html_url, p) : a(` No markdown files found for repository '${n.name}', skipping sources.`, "warn");
|
|
574
574
|
const h = ye(c), b = Et(we(n, h));
|
|
575
|
-
s.push(
|
|
575
|
+
s.push(Pt(f(n.name, { removeDot: !0 }), b)), o.push(...kt(f(n.name, { removeDot: !0 }), n.description || ""));
|
|
576
576
|
}
|
|
577
577
|
a(" Generate index content.", "info");
|
|
578
578
|
const i = St(o.toSorted((n, c) => n.title.localeCompare(c.title)), t, r);
|
|
@@ -586,7 +586,7 @@ function Tt(e) {
|
|
|
586
586
|
a(" Add extras Vitepress headers pages.", "info");
|
|
587
587
|
for (const o of t) {
|
|
588
588
|
a(` Processing file '${o}'.`, "debug");
|
|
589
|
-
const s =
|
|
589
|
+
const s = l(process.cwd(), o), i = l(pe, f(y(o), { mode: "lowercase", removeIdx: !0 }));
|
|
590
590
|
B(s, i), r.push({
|
|
591
591
|
text: f(R(s).name, { replaceDash: !0, removeIdx: !0 }),
|
|
592
592
|
link: `/${f(R(s).name, { removeIdx: !0, mode: "lowercase" })}`
|
|
@@ -596,11 +596,11 @@ function Tt(e) {
|
|
|
596
596
|
}
|
|
597
597
|
function ae(e, t, r) {
|
|
598
598
|
for (const o of Array.isArray(e) ? e : [e]) {
|
|
599
|
-
const s =
|
|
599
|
+
const s = l(process.cwd(), o), i = A(s);
|
|
600
600
|
for (const n of i) {
|
|
601
601
|
const c = n.replace(s, ".");
|
|
602
602
|
a(` Processing file '${c}' for entry '${o}'.`, "debug");
|
|
603
|
-
const p =
|
|
603
|
+
const p = l(process.cwd(), n), h = l(t, c);
|
|
604
604
|
B(p, h);
|
|
605
605
|
}
|
|
606
606
|
}
|
|
@@ -621,7 +621,7 @@ This page serves as both a portfolio of past work and a resource for revisiting
|
|
|
621
621
|
const { name: c, owner: p, html_url: h, description: b, stargazers_count: g } = i;
|
|
622
622
|
return { name: c, owner: p.login, html_url: h, description: b, stargazers_count: g, contributions: n };
|
|
623
623
|
});
|
|
624
|
-
a(" Generate forks page.", "info"), v(
|
|
624
|
+
a(" Generate forks page.", "info"), v(Ve, t + r + q.stringify(s) + t + o);
|
|
625
625
|
}
|
|
626
626
|
async function Rt(e, t, r) {
|
|
627
627
|
const o = await Promise.all(
|
|
@@ -636,11 +636,11 @@ async function Rt(e, t, r) {
|
|
|
636
636
|
Ot(o);
|
|
637
637
|
}
|
|
638
638
|
async function _t(e) {
|
|
639
|
-
const { config: t } = await import(
|
|
639
|
+
const { config: t } = await import(l(process.cwd(), e)).catch((r) => r);
|
|
640
640
|
return t;
|
|
641
641
|
}
|
|
642
642
|
async function At(e) {
|
|
643
|
-
const t = (await je(
|
|
643
|
+
const t = (await je(l(process.cwd(), e))).toString();
|
|
644
644
|
return q.parse(t);
|
|
645
645
|
}
|
|
646
646
|
function It(e, t) {
|
|
@@ -651,7 +651,7 @@ function It(e, t) {
|
|
|
651
651
|
export default config
|
|
652
652
|
`), a(" Generate index file.", "info"), v(M, r + q.stringify(t)), a(" Add Docpress theme files.", "info"), A(te).forEach((o) => {
|
|
653
653
|
const s = o.replace(`${te}/`, "");
|
|
654
|
-
vt(o,
|
|
654
|
+
vt(o, l(De, s));
|
|
655
655
|
});
|
|
656
656
|
}
|
|
657
657
|
const ce = "prepare", $e = [
|
|
@@ -680,8 +680,8 @@ function Lt(e) {
|
|
|
680
680
|
gitProvider: "github"
|
|
681
681
|
};
|
|
682
682
|
}
|
|
683
|
-
function
|
|
684
|
-
const e = new
|
|
683
|
+
function Nt() {
|
|
684
|
+
const e = new ke().name("docpress").description("Build your doc website faster than light ⚡️⚡️⚡️").version(`${Ne.version}`).action(async (t, r) => {
|
|
685
685
|
const o = Lt(t), s = K("global", o);
|
|
686
686
|
await he(s), await xe(s), await be();
|
|
687
687
|
}).configureHelp({
|
|
@@ -692,10 +692,10 @@ function Vt() {
|
|
|
692
692
|
return j(e, [...ge, ...$e, ...L]), e;
|
|
693
693
|
}
|
|
694
694
|
function Qt() {
|
|
695
|
-
|
|
695
|
+
Nt().parseAsync(process.argv);
|
|
696
696
|
}
|
|
697
697
|
export {
|
|
698
|
-
|
|
698
|
+
Nt as getProgram,
|
|
699
699
|
Qt as main
|
|
700
700
|
};
|
|
701
701
|
//# sourceMappingURL=cli.js.map
|