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