@tobi-or-not/docpress 0.8.2 → 0.9.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.
Files changed (48) hide show
  1. package/README.md +11 -9
  2. package/dist/cli.js +878 -691
  3. package/dist/cli.js.map +1 -1
  4. package/package.json +41 -47
  5. package/dist/tsconfig.tsbuildinfo +0 -1
  6. package/types/cli.d.ts +0 -3
  7. package/types/commands/build.d.ts +0 -3
  8. package/types/commands/fetch.d.ts +0 -4
  9. package/types/commands/global.d.ts +0 -1
  10. package/types/commands/prepare.d.ts +0 -4
  11. package/types/lib/fetch.d.ts +0 -120
  12. package/types/lib/git.d.ts +0 -515
  13. package/types/lib/prepare.d.ts +0 -62
  14. package/types/lib/vitepress.d.ts +0 -3
  15. package/types/public/templates/theme/index.d.ts +0 -8
  16. package/types/schemas/build.d.ts +0 -20
  17. package/types/schemas/fetch.d.ts +0 -52
  18. package/types/schemas/global.d.ts +0 -150
  19. package/types/schemas/prepare.d.ts +0 -61
  20. package/types/src/cli.d.ts +0 -12
  21. package/types/src/commands/build.d.ts +0 -20
  22. package/types/src/commands/fetch.d.ts +0 -15
  23. package/types/src/commands/global.d.ts +0 -4
  24. package/types/src/commands/prepare.d.ts +0 -15
  25. package/types/src/lib/fetch.d.ts +0 -179
  26. package/types/src/lib/git.d.ts +0 -568
  27. package/types/src/lib/prepare.d.ts +0 -214
  28. package/types/src/lib/vitepress.d.ts +0 -11
  29. package/types/src/schemas/build.d.ts +0 -7
  30. package/types/src/schemas/fetch.d.ts +0 -25
  31. package/types/src/schemas/global.d.ts +0 -100
  32. package/types/src/schemas/prepare.d.ts +0 -22
  33. package/types/src/templates/index.d.ts +0 -1
  34. package/types/src/templates/theme/index.d.ts +0 -8
  35. package/types/src/utils/commands.d.ts +0 -95
  36. package/types/src/utils/const.d.ts +0 -40
  37. package/types/src/utils/functions.d.ts +0 -130
  38. package/types/src/utils/logger.d.ts +0 -14
  39. package/types/src/utils/regex.d.ts +0 -4
  40. package/types/src/utils/resolver.d.ts +0 -1
  41. package/types/src/utils/templates.d.ts +0 -7
  42. package/types/templates/index.d.ts +0 -5
  43. package/types/templates/theme/index.d.ts +0 -8
  44. package/types/utils/commands.d.ts +0 -207
  45. package/types/utils/const.d.ts +0 -10
  46. package/types/utils/functions.d.ts +0 -24
  47. package/types/utils/logger.d.ts +0 -4
  48. package/types/utils/regex.d.ts +0 -2
@@ -1,214 +0,0 @@
1
- import type { defineConfig } from 'vitepress';
2
- import type { PrepareOpts } from '../schemas/prepare.js';
3
- import type { GlobalOpts } from '../schemas/global.js';
4
- import { getUserInfos } from '../utils/functions.js';
5
- import type { EnhancedRepository } from './fetch.js';
6
- import type { getInfos } from './git.js';
7
- /**
8
- * Represents a navigation page item with text and link
9
- */
10
- export interface Page {
11
- text: string;
12
- link: string;
13
- }
14
- /**
15
- * Represents a sidebar project with nested items
16
- */
17
- export interface SidebarProject {
18
- text: string;
19
- collapsed: boolean;
20
- items: (Page | SidebarProject)[];
21
- }
22
- /**
23
- * Represents a feature to display on the index page
24
- */
25
- export interface Feature {
26
- title: string;
27
- details: string;
28
- link: string;
29
- }
30
- /**
31
- * Represents the structure of the VitePress index page
32
- */
33
- export interface Index {
34
- layout: string;
35
- hero: {
36
- name: string;
37
- tagline?: string;
38
- };
39
- /** List of features to display */
40
- features: Feature[];
41
- }
42
- /**
43
- * Prepares the documentation structure for a user's repositories
44
- *
45
- * @param options - Options for documentation preparation
46
- * @param options.extraHeaderPages - Array of paths to additional header pages
47
- * @param options.extraPublicContent - Array of paths to additional public content
48
- * @param options.extraTheme - Array of paths to additional theme files
49
- * @param options.vitepressConfig - Path to the VitePress configuration file
50
- * @param options.forks - Flag to include forked repositories
51
- * @param options.token - GitHub token for API access
52
- * @param options.username - GitHub username to fetch repositories for
53
- * @param options.websiteTitle - Custom title for the documentation website
54
- * @param options.websiteTagline - Custom tagline for the documentation website
55
- */
56
- export declare function prepareDoc({ extraHeaderPages, extraPublicContent, extraTheme, vitepressConfig, forks, token, username, websiteTitle, websiteTagline }: Omit<PrepareOpts, 'usernames' | 'branch' | 'gitProvider' | 'reposFilter'> & {
57
- username: PrepareOpts['usernames'][number];
58
- }): Promise<void>;
59
- /**
60
- * Adds a source reference section to a markdown file
61
- *
62
- * @param repoUrl - URL of the GitHub repository
63
- * @param outputPath - Path to the markdown file where sources will be added
64
- */
65
- export declare function addSources(repoUrl: string, outputPath: string): void;
66
- /**
67
- * Information about website title and tagline
68
- */
69
- export interface WebsiteInfos {
70
- title?: string;
71
- tagline?: string;
72
- }
73
- /**
74
- * Generates the index page content for the documentation site
75
- *
76
- * @param features - Array of features to display on the homepage
77
- * @param user - User information retrieved from GitHub
78
- * @param websiteInfos - Custom title and tagline information
79
- * @returns An object with index page configuration
80
- */
81
- export declare function generateIndex(features: Feature[], user: ReturnType<typeof getUserInfos>, websiteInfos: WebsiteInfos): {
82
- layout: string;
83
- hero: {
84
- name: string;
85
- tagline: string | undefined;
86
- };
87
- features: Feature[];
88
- };
89
- /**
90
- * Generates feature cards for the homepage
91
- *
92
- * @param repoName - Name of the repository
93
- * @param description - Description of the repository
94
- * @param features - Optional existing features to append to
95
- * @returns Array of feature objects for the homepage
96
- */
97
- export declare function generateFeatures(repoName: string, description: string, features?: Feature[]): Feature[];
98
- /**
99
- * Generates a sidebar project entry for the documentation navigation
100
- *
101
- * @param repoName - Name of the repository
102
- * @param sidebarPages - Array of sidebar pages to include in this project
103
- * @returns A sidebar project configuration object
104
- */
105
- export declare function generateSidebarProject(repoName: string, sidebarPages: (SidebarProject | Page)[]): {
106
- text: string;
107
- collapsed: boolean;
108
- items: (SidebarProject | Page)[];
109
- };
110
- /**
111
- * Generates sidebar page entries for the documentation navigation
112
- *
113
- * @param repoName - Name of the repository
114
- * @param fileName - Name of the file
115
- * @param sidebarPages - Optional existing sidebar pages to append to
116
- * @returns Array of page objects for the sidebar
117
- */
118
- export declare function generateSidebarPages(repoName: string, fileName: string, sidebarPages?: Page[]): Page[];
119
- /**
120
- * Generates sidebar items from a repository's file structure
121
- *
122
- * @param repository - Repository information
123
- * @param obj - Object representing the file tree structure
124
- * @returns Array of sidebar items (projects and pages)
125
- */
126
- export declare function generateSidebarItems(repository: EnhancedRepository, obj: any): (SidebarProject | Page)[];
127
- /**
128
- * Builds a tree structure from an array of file paths
129
- *
130
- * @param files - Array of file paths to be organized into a tree
131
- * @returns A nested object representing the directory structure
132
- */
133
- export declare function buildTree(files: string[]): any;
134
- /**
135
- * Flattens a nested tree structure into an array of file paths
136
- *
137
- * @param subtree - The tree object to flatten
138
- * @param prefix - Optional path prefix to prepend to each result
139
- * @returns An array of file paths
140
- */
141
- export declare function flattenTree(subtree: any, prefix?: string): string[];
142
- /**
143
- * Transforms repository data into documentation structure
144
- *
145
- * @param repositories - Array of enhanced repositories
146
- * @param user - User information retrieved from GitHub
147
- * @param websiteInfos - Custom title and tagline information
148
- * @returns Object containing sidebar and index page configurations
149
- */
150
- export declare function transformDoc(repositories: EnhancedRepository[], user: ReturnType<typeof getUserInfos>, websiteInfos: WebsiteInfos): {
151
- sidebar: SidebarProject[];
152
- index: {
153
- layout: string;
154
- hero: {
155
- name: string;
156
- tagline: string | undefined;
157
- };
158
- features: Feature[];
159
- };
160
- };
161
- /**
162
- * Adds extra pages to the documentation from specified paths
163
- *
164
- * @param paths - Array of paths to markdown files
165
- * @returns Array of navigation page objects
166
- */
167
- export declare function addExtraPages(paths: string[]): Page[];
168
- /**
169
- * Adds content from specified paths to a target directory
170
- *
171
- * @param paths - String or array of paths to content
172
- * @param dir - Target directory to copy content to
173
- * @param fn - Optional callback function to execute for each file
174
- */
175
- export declare function addContent(paths: string | string[], dir: string, fn?: () => void): void;
176
- /**
177
- * Creates a fork page to display external contributions
178
- *
179
- * @param forks - Array of repositories and contribution counts
180
- */
181
- export declare function addForkPage(forks: {
182
- repository: Awaited<ReturnType<typeof getInfos>>['repos'][number];
183
- contributions: number;
184
- }[]): void;
185
- /**
186
- * Processes forked repositories to generate contribution information
187
- *
188
- * @param repositories - Array of enhanced repositories
189
- * @param username - GitHub username
190
- * @param token - Optional GitHub API token
191
- */
192
- export declare function processForks(repositories: EnhancedRepository[], username: GlobalOpts['usernames'][number], token?: GlobalOpts['token']): Promise<void>;
193
- /**
194
- * Parses a VitePress configuration file
195
- *
196
- * @param path - Path to the VitePress config file
197
- * @returns The parsed configuration object
198
- */
199
- export declare function parseVitepressConfig(path: string): Promise<Partial<ReturnType<typeof defineConfig>>>;
200
- /**
201
- * Parses a VitePress index file
202
- *
203
- * @param path - Path to the index file
204
- * @returns The parsed index object
205
- */
206
- export declare function parseVitepressIndex(path: string): Promise<Index>;
207
- /**
208
- * Generates VitePress configuration and index files
209
- *
210
- * @param vitepressConfig - VitePress configuration object
211
- * @param index - Index page configuration
212
- * @returns The list of theme files that were generated
213
- */
214
- export declare function generateVitepressFiles(vitepressConfig: Partial<ReturnType<typeof defineConfig>>, index: Index): void;
@@ -1,11 +0,0 @@
1
- import type { defineConfig } from 'vitepress';
2
- import type { Page, SidebarProject } from './prepare.js';
3
- /**
4
- * Generates VitePress configuration by merging default and custom configs
5
- *
6
- * @param sidebar - Sidebar configuration
7
- * @param nav - Navigation configuration
8
- * @param vitepressConfig - Optional custom VitePress configuration
9
- * @returns Merged VitePress configuration
10
- */
11
- export declare function getVitepressConfig(sidebar: SidebarProject[], nav: Page[], vitepressConfig?: ReturnType<typeof defineConfig>): Partial<ReturnType<typeof defineConfig>>;
@@ -1,7 +0,0 @@
1
- import type { z } from 'zod';
2
- /**
3
- * Schema for build command options
4
- * Currently empty as build doesn't require specific options
5
- */
6
- export declare const buildOptsSchema: z.ZodObject<{}, z.core.$strip>;
7
- export type BuildOpts = z.infer<typeof buildOptsSchema>;
@@ -1,25 +0,0 @@
1
- import type { GlobalOpts } from './global.js';
2
- /**
3
- * Schema for fetch command options
4
- * Includes options related to Git repository fetching
5
- */
6
- export declare const fetchOptsSchema: import("zod").ZodObject<{
7
- usernames: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>;
8
- branch: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodString>>;
9
- gitProvider: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodEnum<{
10
- github: "github";
11
- }>>>;
12
- reposFilter: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>;
13
- config: import("zod").ZodOptional<import("zod").ZodString>;
14
- token: import("zod").ZodOptional<import("zod").ZodString>;
15
- }, import("zod/v4/core").$strip>;
16
- /**
17
- * Type for fetch options
18
- */
19
- export type FetchOpts = GlobalOpts;
20
- /**
21
- * Type for fetch options with username instead of usernames array
22
- */
23
- export type FetchOptsUser = Omit<FetchOpts, 'usernames'> & {
24
- username: FetchOpts['usernames'][number];
25
- };
@@ -1,100 +0,0 @@
1
- import { z } from 'zod';
2
- /**
3
- * Schema for the DocPress configuration file
4
- * Defines the structure and validation rules for the configuration
5
- */
6
- export declare const configSchema: z.ZodObject<{
7
- usernames: z.ZodArray<z.ZodString>;
8
- branch: z.ZodDefault<z.ZodString>;
9
- gitProvider: z.ZodDefault<z.ZodEnum<{
10
- github: "github";
11
- }>>;
12
- reposFilter: z.ZodArray<z.ZodString>;
13
- extraHeaderPages: z.ZodArray<z.ZodString>;
14
- extraPublicContent: z.ZodArray<z.ZodString>;
15
- extraTheme: z.ZodArray<z.ZodString>;
16
- forks: z.ZodDefault<z.ZodBoolean>;
17
- vitepressConfig: z.ZodAny;
18
- websiteTitle: z.ZodString;
19
- websiteTagline: z.ZodString;
20
- }, z.core.$strip>;
21
- export type Config = z.infer<typeof configSchema>;
22
- /**
23
- * Base CLI schema for parsing command line arguments
24
- * All fields are optional in this schema
25
- */
26
- export declare const baseCliSchema: z.ZodObject<{
27
- branch: z.ZodOptional<z.ZodDefault<z.ZodString>>;
28
- gitProvider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
29
- github: "github";
30
- }>>>;
31
- forks: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
32
- websiteTitle: z.ZodOptional<z.ZodString>;
33
- websiteTagline: z.ZodOptional<z.ZodString>;
34
- config: z.ZodOptional<z.ZodString>;
35
- token: z.ZodOptional<z.ZodString>;
36
- usernames: z.ZodOptional<z.ZodString>;
37
- reposFilter: z.ZodOptional<z.ZodString>;
38
- extraHeaderPages: z.ZodOptional<z.ZodString>;
39
- extraPublicContent: z.ZodOptional<z.ZodString>;
40
- extraTheme: z.ZodOptional<z.ZodString>;
41
- vitepressConfig: z.ZodOptional<z.ZodString>;
42
- }, z.core.$strip>;
43
- export type RawCli = z.infer<typeof baseCliSchema>;
44
- /**
45
- * CLI schema with transformations applied to handle string-to-array conversions
46
- */
47
- export declare const cliSchema: z.ZodObject<{
48
- branch: z.ZodOptional<z.ZodDefault<z.ZodString>>;
49
- gitProvider: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
50
- github: "github";
51
- }>>>;
52
- forks: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
53
- websiteTitle: z.ZodOptional<z.ZodString>;
54
- websiteTagline: z.ZodOptional<z.ZodString>;
55
- config: z.ZodOptional<z.ZodString>;
56
- token: z.ZodOptional<z.ZodString>;
57
- usernames: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>>;
58
- reposFilter: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>>;
59
- extraHeaderPages: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>>;
60
- extraPublicContent: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>>;
61
- extraTheme: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>>;
62
- vitepressConfig: z.ZodOptional<z.ZodString>;
63
- }, z.core.$strip>;
64
- export type Cli = z.infer<typeof cliSchema>;
65
- /**
66
- * Schema for global options that combines CLI arguments and configuration files
67
- * Applies transformations to merge different config sources and validate the result
68
- */
69
- export declare const globalOptsSchema: z.ZodPipe<z.ZodObject<{
70
- branch: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodString>>>;
71
- gitProvider: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodEnum<{
72
- github: "github";
73
- }>>>>;
74
- forks: z.ZodOptional<z.ZodOptional<z.ZodDefault<z.ZodBoolean>>>;
75
- websiteTitle: z.ZodOptional<z.ZodOptional<z.ZodString>>;
76
- websiteTagline: z.ZodOptional<z.ZodOptional<z.ZodString>>;
77
- config: z.ZodOptional<z.ZodOptional<z.ZodString>>;
78
- token: z.ZodOptional<z.ZodOptional<z.ZodString>>;
79
- usernames: z.ZodOptional<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>>>;
80
- reposFilter: z.ZodOptional<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>>>;
81
- extraHeaderPages: z.ZodOptional<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>>>;
82
- extraPublicContent: z.ZodOptional<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>>>;
83
- extraTheme: z.ZodOptional<z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string[], string>>>>;
84
- vitepressConfig: z.ZodOptional<z.ZodOptional<z.ZodString>>;
85
- }, z.core.$strip>, z.ZodTransform<any, {
86
- branch?: string | undefined;
87
- gitProvider?: "github" | undefined;
88
- forks?: boolean | undefined;
89
- websiteTitle?: string | undefined;
90
- websiteTagline?: string | undefined;
91
- config?: string | undefined;
92
- token?: string | undefined;
93
- usernames?: string[] | undefined;
94
- reposFilter?: string[] | undefined;
95
- extraHeaderPages?: string[] | undefined;
96
- extraPublicContent?: string[] | undefined;
97
- extraTheme?: string[] | undefined;
98
- vitepressConfig?: string | undefined;
99
- }>>;
100
- export type GlobalOpts = Required<Pick<z.infer<typeof globalOptsSchema>, 'branch' | 'gitProvider'>> & Omit<z.infer<typeof globalOptsSchema>, 'branch' | 'gitProvider'>;
@@ -1,22 +0,0 @@
1
- import type { GlobalOpts } from './global.js';
2
- /**
3
- * Schema for prepare command options
4
- * Includes options related to documentation preparation and customization
5
- */
6
- export declare const prepareOptsSchema: import("zod").ZodObject<{
7
- usernames: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>;
8
- gitProvider: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodEnum<{
9
- github: "github";
10
- }>>>;
11
- reposFilter: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>;
12
- extraHeaderPages: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>;
13
- extraPublicContent: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>;
14
- extraTheme: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>;
15
- vitepressConfig: import("zod").ZodOptional<import("zod").ZodString>;
16
- config: import("zod").ZodOptional<import("zod").ZodString>;
17
- token: import("zod").ZodOptional<import("zod").ZodString>;
18
- }, import("zod/v4/core").$strip>;
19
- /**
20
- * Type for prepare options
21
- */
22
- export type PrepareOpts = GlobalOpts;
@@ -1 +0,0 @@
1
- export declare function generateFile(src: string, dest: string): void;
@@ -1,8 +0,0 @@
1
- declare const _default: {
2
- enhanceApp({ app }: import("vitepress").EnhanceAppContext): void;
3
- extends: {
4
- Layout: import("@vue/runtime-core").DefineComponent;
5
- enhanceApp: (ctx: import("vitepress").EnhanceAppContext) => void;
6
- };
7
- };
8
- export default _default;
@@ -1,95 +0,0 @@
1
- import type { Command, Option } from 'commander';
2
- import type { GlobalOpts } from '../schemas/global.js';
3
- import type { BuildOpts } from '../schemas/build.js';
4
- import type { FetchOpts } from '../schemas/fetch.js';
5
- import type { PrepareOpts } from '../schemas/prepare.js';
6
- /**
7
- * Type definition for command names
8
- */
9
- type Cmd = 'fetch' | 'build' | 'prepare' | 'global';
10
- /**
11
- * Interface mapping command names to their option types
12
- */
13
- interface Options {
14
- build: BuildOpts;
15
- fetch: FetchOpts;
16
- prepare: PrepareOpts;
17
- global: GlobalOpts;
18
- }
19
- /**
20
- * Mapping of command names to their schema validators
21
- */
22
- export declare const options: {
23
- build: import("zod").ZodObject<{}, import("zod/v4/core").$strip>;
24
- fetch: import("zod").ZodObject<{
25
- usernames: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>;
26
- branch: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodString>>;
27
- gitProvider: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodEnum<{
28
- github: "github";
29
- }>>>;
30
- reposFilter: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>;
31
- config: import("zod").ZodOptional<import("zod").ZodString>;
32
- token: import("zod").ZodOptional<import("zod").ZodString>;
33
- }, import("zod/v4/core").$strip>;
34
- prepare: import("zod").ZodObject<{
35
- usernames: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>;
36
- gitProvider: import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodEnum<{
37
- github: "github";
38
- }>>>;
39
- reposFilter: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>;
40
- extraHeaderPages: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>;
41
- extraPublicContent: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>;
42
- extraTheme: import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>;
43
- vitepressConfig: import("zod").ZodOptional<import("zod").ZodString>;
44
- config: import("zod").ZodOptional<import("zod").ZodString>;
45
- token: import("zod").ZodOptional<import("zod").ZodString>;
46
- }, import("zod/v4/core").$strip>;
47
- global: import("zod").ZodPipe<import("zod").ZodObject<{
48
- branch: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodString>>>;
49
- gitProvider: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodEnum<{
50
- github: "github";
51
- }>>>>;
52
- forks: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodDefault<import("zod").ZodBoolean>>>;
53
- websiteTitle: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
54
- websiteTagline: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
55
- config: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
56
- token: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
57
- usernames: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>>;
58
- reposFilter: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>>;
59
- extraHeaderPages: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>>;
60
- extraPublicContent: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>>;
61
- extraTheme: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodPipe<import("zod").ZodString, import("zod").ZodTransform<string[], string>>>>;
62
- vitepressConfig: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodString>>;
63
- }, import("zod/v4/core").$strip>, import("zod").ZodTransform<any, {
64
- branch?: string | undefined;
65
- gitProvider?: "github" | undefined;
66
- forks?: boolean | undefined;
67
- websiteTitle?: string | undefined;
68
- websiteTagline?: string | undefined;
69
- config?: string | undefined;
70
- token?: string | undefined;
71
- usernames?: string[] | undefined;
72
- reposFilter?: string[] | undefined;
73
- extraHeaderPages?: string[] | undefined;
74
- extraPublicContent?: string[] | undefined;
75
- extraTheme?: string[] | undefined;
76
- vitepressConfig?: string | undefined;
77
- }>>;
78
- };
79
- /**
80
- * Parses and validates command options based on the command type
81
- *
82
- * @param cmd - The command name ('fetch', 'build', 'prepare', or 'global')
83
- * @param opts - Raw options from the command line
84
- * @returns Validated and processed options for the specified command
85
- */
86
- export declare function parseOptions<T extends Cmd>(cmd: T, opts: Record<string, unknown>): Options[T];
87
- /**
88
- * Adds option definitions to a Command instance
89
- *
90
- * @param cmd - The Commander Command instance
91
- * @param opts - Array of option definitions to add
92
- * @returns The Command instance with options added
93
- */
94
- export declare function addOptions(cmd: Command, opts: Option[]): Command;
95
- export {};
@@ -1,40 +0,0 @@
1
- /**
2
- * Main directory for DocPress files
3
- */
4
- export declare const DOCPRESS_DIR: string;
5
- /**
6
- * Path to repositories information JSON file
7
- */
8
- export declare const USER_REPOS_INFOS: string;
9
- /**
10
- * Path to user information JSON file
11
- */
12
- export declare const USER_INFOS: string;
13
- /**
14
- * Directory for documentation files
15
- */
16
- export declare const DOCS_DIR: string;
17
- /**
18
- * Path to the main index file
19
- */
20
- export declare const INDEX_FILE: string;
21
- /**
22
- * Path to the forks documentation file
23
- */
24
- export declare const FORKS_FILE: string;
25
- /**
26
- * Path to VitePress configuration file
27
- */
28
- export declare const VITEPRESS_CONFIG: string;
29
- /**
30
- * Directory for VitePress theme
31
- */
32
- export declare const VITEPRESS_THEME: string;
33
- /**
34
- * Directory for user custom theme files
35
- */
36
- export declare const VITEPRESS_USER_THEME: string;
37
- /**
38
- * Path to template theme files
39
- */
40
- export declare const TEMPLATE_THEME: string;
@@ -1,130 +0,0 @@
1
- import type { GlobalOpts } from '../schemas/global.js';
2
- import type { EnhancedRepository } from '../lib/fetch.js';
3
- import type { getInfos } from '../lib/git.js';
4
- /**
5
- * Checks the HTTP status code of a URL
6
- *
7
- * @param url - URL to check
8
- * @returns HTTP status code (404 if not found, 500 for errors)
9
- */
10
- export declare function checkHttpStatus(url: string): Promise<number>;
11
- /**
12
- * Options for prettifying strings
13
- */
14
- interface PrettifyOpts {
15
- mode?: 'capitalize' | 'uppercase' | 'lowercase';
16
- replaceDash?: boolean;
17
- removeIdx?: boolean;
18
- removeDot?: boolean;
19
- removeExt?: boolean;
20
- }
21
- /**
22
- * Formats a string based on specified options
23
- *
24
- * @param s - Input string to format
25
- * @param opts - Formatting options
26
- * @returns Formatted string
27
- */
28
- export declare function prettify(s: string, opts: PrettifyOpts): string;
29
- /**
30
- * Creates a directory, optionally cleaning it first
31
- *
32
- * @param directory - Path to the directory to create
33
- * @param options - Options object
34
- * @param options.clean - Whether to clean the directory before creating it
35
- */
36
- export declare function createDir(directory: string, { clean }?: {
37
- clean?: boolean;
38
- }): void;
39
- /**
40
- * Checks if a path is a directory
41
- *
42
- * @param path - Path to check
43
- * @returns True if path is a directory, false otherwise
44
- */
45
- export declare function isDir(path: string): boolean;
46
- /**
47
- * Checks if a path is a file
48
- *
49
- * @param path - Path to check
50
- * @returns True if path is a file, false otherwise
51
- */
52
- export declare function isFile(path: string): boolean;
53
- /**
54
- * Extracts a list of file paths from directories and files
55
- *
56
- * @param paths - Path or array of paths to extract files from
57
- * @returns Array of file paths
58
- */
59
- export declare function extractFiles(paths: string[] | string): string[];
60
- /**
61
- * Gets all markdown files from specified paths
62
- *
63
- * @param path - Array of paths to search for markdown files
64
- * @returns Array of markdown file paths
65
- */
66
- export declare function getMdFiles(path: string[]): string[];
67
- /**
68
- * Formats an array of strings into a readable comma-separated list
69
- *
70
- * @param arr - Array of strings to format
71
- * @returns Formatted string (e.g., "a", "b" or "c")
72
- */
73
- export declare function prettifyEnum(arr: readonly string[]): string;
74
- /**
75
- * Gets user information from cached JSON file
76
- *
77
- * @param username - GitHub username
78
- * @returns User information object
79
- */
80
- export declare function getUserInfos(username: GlobalOpts['usernames'][number]): Awaited<ReturnType<typeof getInfos>>["user"];
81
- /**
82
- * Gets repository information from cached JSON file
83
- *
84
- * @param username - GitHub username
85
- * @returns Array of enhanced repository objects
86
- */
87
- export declare function getUserRepos(username: GlobalOpts['usernames'][number]): EnhancedRepository[];
88
- /**
89
- * Deep merges multiple objects
90
- *
91
- * @param objects - Objects to merge
92
- * @returns Merged object
93
- */
94
- export declare function deepMerge<T extends Record<string, any> | null>(...objects: T[]): T;
95
- /**
96
- * Checks if a value is an object (not an array or null)
97
- *
98
- * @param val - Value to check
99
- * @returns True if value is an object, false otherwise
100
- */
101
- export declare function isObject(val: any): val is object;
102
- /**
103
- * Loads and parses a JSON configuration file
104
- *
105
- * @param configPath - Path to the configuration file
106
- * @returns Parsed configuration object or empty object if file doesn't exist
107
- */
108
- export declare function loadConfigFile(configPath?: string): any;
109
- /**
110
- * Splits a comma-separated string into an array of strings
111
- *
112
- * @param s - Comma-separated string
113
- * @returns Array of strings
114
- */
115
- export declare function splitByComma(s: string): string[];
116
- /**
117
- * Replaces relative paths in markdown links with absolute URLs
118
- *
119
- * @param file - Path to the markdown file to process
120
- * @param url - Base URL to use for absolute links
121
- */
122
- export declare function replaceRelativePath(file: string, url: string): void;
123
- /**
124
- * Processes README files to fix various link formats
125
- *
126
- * @param file - Path to the README file to process
127
- * @param url - Base URL to use for absolute links
128
- */
129
- export declare function replaceReadmePath(file: string, url: string): void;
130
- export {};