@tobi-or-not/docpress 0.8.3 → 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.
- package/README.md +11 -9
- package/dist/cli.js +878 -691
- package/dist/cli.js.map +1 -1
- package/package.json +41 -47
- package/types/public/templates/theme/index.d.ts +0 -8
- package/types/src/cli.d.ts +0 -12
- package/types/src/commands/build.d.ts +0 -20
- package/types/src/commands/fetch.d.ts +0 -15
- package/types/src/commands/global.d.ts +0 -4
- package/types/src/commands/prepare.d.ts +0 -15
- package/types/src/lib/fetch.d.ts +0 -179
- package/types/src/lib/git.d.ts +0 -568
- package/types/src/lib/prepare.d.ts +0 -214
- package/types/src/lib/vitepress.d.ts +0 -11
- package/types/src/schemas/build.d.ts +0 -7
- package/types/src/schemas/fetch.d.ts +0 -25
- package/types/src/schemas/global.d.ts +0 -100
- package/types/src/schemas/prepare.d.ts +0 -22
- package/types/src/utils/commands.d.ts +0 -95
- package/types/src/utils/const.d.ts +0 -40
- package/types/src/utils/functions.d.ts +0 -130
- package/types/src/utils/logger.d.ts +0 -14
- package/types/src/utils/regex.d.ts +0 -4
- package/types/src/utils/templates.d.ts +0 -7
package/package.json
CHANGED
|
@@ -1,72 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tobi-or-not/docpress",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.9.0",
|
|
5
|
+
"packageManager": "bun@1.3.14",
|
|
5
6
|
"homepage": "https://this-is-tobi.com/docpress/introduction",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "https://github.com/this-is-tobi/docpress.git"
|
|
9
10
|
},
|
|
10
|
-
"module": "dist/docpress.js",
|
|
11
|
-
"types": "types/index.d.ts",
|
|
12
11
|
"bin": {
|
|
13
12
|
"docpress": "bin/docpress.js"
|
|
14
13
|
},
|
|
15
14
|
"files": [
|
|
16
15
|
"bin",
|
|
17
|
-
"dist"
|
|
18
|
-
"types"
|
|
16
|
+
"dist"
|
|
19
17
|
],
|
|
20
18
|
"engines": {
|
|
21
|
-
"node": ">=
|
|
22
|
-
},
|
|
23
|
-
"dependencies": {
|
|
24
|
-
"@octokit/rest": "^22.0.1",
|
|
25
|
-
"axios": "^1.13.6",
|
|
26
|
-
"chalk": "^5.6.2",
|
|
27
|
-
"commander": "^14.0.3",
|
|
28
|
-
"octokit": "^5.0.5",
|
|
29
|
-
"rimraf": "^6.1.3",
|
|
30
|
-
"simple-git": "^3.33.0",
|
|
31
|
-
"vitepress": "^1.6.4",
|
|
32
|
-
"vitepress-plugin-mermaid": "^2.0.17",
|
|
33
|
-
"yaml": "^2.8.2",
|
|
34
|
-
"zod": "^4.3.6",
|
|
35
|
-
"zod-validation-error": "^5.0.0"
|
|
36
|
-
},
|
|
37
|
-
"devDependencies": {
|
|
38
|
-
"@antfu/eslint-config": "^7.7.0",
|
|
39
|
-
"@commitlint/cli": "^20.4.3",
|
|
40
|
-
"@commitlint/config-conventional": "^20.4.3",
|
|
41
|
-
"@octokit/types": "^16.0.0",
|
|
42
|
-
"@types/node": "^25.4.0",
|
|
43
|
-
"@vitejs/plugin-vue": "^6.0.4",
|
|
44
|
-
"@vitest/coverage-v8": "^4.0.18",
|
|
45
|
-
"eslint": "^10.0.3",
|
|
46
|
-
"eslint-plugin-import": "^2.32.0",
|
|
47
|
-
"husky": "^9.1.7",
|
|
48
|
-
"lint-staged": "^16.3.3",
|
|
49
|
-
"typescript": "^5.9.3",
|
|
50
|
-
"vite": "^7.3.1",
|
|
51
|
-
"vite-node": "^5.3.0",
|
|
52
|
-
"vitest": "^4.0.18",
|
|
53
|
-
"vue": "^3.5.30"
|
|
54
|
-
},
|
|
55
|
-
"publishConfig": {
|
|
56
|
-
"registry": "https://registry.npmjs.org/",
|
|
57
|
-
"access": "public",
|
|
58
|
-
"tag": "latest"
|
|
19
|
+
"node": ">=22.12.0"
|
|
59
20
|
},
|
|
60
21
|
"scripts": {
|
|
61
|
-
"build": "
|
|
22
|
+
"build": "bun run build:clean && bun run build:types && bun run build:vite",
|
|
62
23
|
"build:clean": "rimraf ./dist ./types ./tsconfig.tsbuildinfo",
|
|
63
24
|
"build:docker": "docker build --tag tobi-or-not/docpress --target prod .",
|
|
64
25
|
"build:types": "tsc",
|
|
65
26
|
"build:vite": "vite build",
|
|
66
|
-
"dev": "
|
|
67
|
-
"dev:clean": "rimraf ./docpress &&
|
|
27
|
+
"dev": "bun ./dev/docpress.ts",
|
|
28
|
+
"dev:clean": "rimraf ./docpress && bun run dev",
|
|
68
29
|
"format": "eslint . --fix",
|
|
69
30
|
"lint": "eslint .",
|
|
31
|
+
"prepare": "husky",
|
|
70
32
|
"start": "./bin/docpress.js",
|
|
71
33
|
"start:docker": "docker run --name docpress --rm -v $(pwd)/docpress:/app/docpress:rw tobi-or-not/docpress",
|
|
72
34
|
"stop:docker": "docker rm --force docpress",
|
|
@@ -77,5 +39,37 @@
|
|
|
77
39
|
"vp:dev": "vitepress dev ./docpress --port 8080",
|
|
78
40
|
"vp:dev:docker": "docker run --publish 8080:8080 --name docpress-vp --rm tobi-or-not/docs",
|
|
79
41
|
"vp:preview": "vitepress preview ./docpress --port 8080"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@octokit/rest": "^22.0.1",
|
|
45
|
+
"chalk": "^5.6.2",
|
|
46
|
+
"commander": "^15.0.0",
|
|
47
|
+
"rimraf": "^6.1.3",
|
|
48
|
+
"simple-git": "^3.36.0",
|
|
49
|
+
"vitepress": "^1.6.4",
|
|
50
|
+
"vitepress-plugin-mermaid": "^2.0.17",
|
|
51
|
+
"yaml": "^2.9.0",
|
|
52
|
+
"zod": "^4.4.3"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@antfu/eslint-config": "^9.1.0",
|
|
56
|
+
"@commitlint/cli": "^21.2.0",
|
|
57
|
+
"@commitlint/config-conventional": "^21.2.0",
|
|
58
|
+
"@octokit/types": "^16.0.0",
|
|
59
|
+
"@types/node": "^26.1.0",
|
|
60
|
+
"@vitejs/plugin-vue": "^6.0.7",
|
|
61
|
+
"@vitest/coverage-v8": "^4.1.9",
|
|
62
|
+
"eslint": "^10.6.0",
|
|
63
|
+
"husky": "^9.1.7",
|
|
64
|
+
"lint-staged": "^17.0.8",
|
|
65
|
+
"typescript": "^6.0.3",
|
|
66
|
+
"vite": "^8.1.3",
|
|
67
|
+
"vitest": "^4.1.9",
|
|
68
|
+
"vue": "^3.5.39"
|
|
69
|
+
},
|
|
70
|
+
"publishConfig": {
|
|
71
|
+
"registry": "https://registry.npmjs.org/",
|
|
72
|
+
"access": "public",
|
|
73
|
+
"tag": "latest"
|
|
80
74
|
}
|
|
81
|
-
}
|
|
75
|
+
}
|
package/types/src/cli.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
/**
|
|
3
|
-
* Creates and configures the Command Line Interface for DocPress
|
|
4
|
-
*
|
|
5
|
-
* @returns A configured Commander program instance
|
|
6
|
-
*/
|
|
7
|
-
export declare function getProgram(): Command;
|
|
8
|
-
/**
|
|
9
|
-
* Entry point for the DocPress CLI
|
|
10
|
-
* Initializes and runs the command parser
|
|
11
|
-
*/
|
|
12
|
-
export declare function main(): void;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Suppress specific Vue warnings during the build process
|
|
3
|
-
*
|
|
4
|
-
* @param callback - Function to execute while warnings are suppressed
|
|
5
|
-
* @returns The result of the callback function
|
|
6
|
-
*/
|
|
7
|
-
export declare function suppressVueWarnings<T>(callback: () => Promise<T>): Promise<T>;
|
|
8
|
-
/**
|
|
9
|
-
* Command line options specific to the build command (none currently)
|
|
10
|
-
*/
|
|
11
|
-
export declare const buildOpts: never[];
|
|
12
|
-
/**
|
|
13
|
-
* The build command definition for Commander
|
|
14
|
-
*/
|
|
15
|
-
export declare const buildCmd: import("commander").Command;
|
|
16
|
-
/**
|
|
17
|
-
* Main function to execute the build command
|
|
18
|
-
* Builds the VitePress static site
|
|
19
|
-
*/
|
|
20
|
-
export declare function main(): Promise<void>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { FetchOpts } from '../schemas/fetch.js';
|
|
2
|
-
/**
|
|
3
|
-
* Command line options specific to the fetch command
|
|
4
|
-
*/
|
|
5
|
-
export declare const fetchOpts: import("commander").Option[];
|
|
6
|
-
/**
|
|
7
|
-
* The fetch command definition for Commander
|
|
8
|
-
*/
|
|
9
|
-
export declare const fetchCmd: import("commander").Command;
|
|
10
|
-
/**
|
|
11
|
-
* Main function to execute the fetch command
|
|
12
|
-
*
|
|
13
|
-
* @param opts - Validated fetch options
|
|
14
|
-
*/
|
|
15
|
-
export declare function main(opts: FetchOpts): Promise<void>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { PrepareOpts } from '../schemas/prepare.js';
|
|
2
|
-
/**
|
|
3
|
-
* Command line options specific to the prepare command
|
|
4
|
-
*/
|
|
5
|
-
export declare const prepareOpts: import("commander").Option[];
|
|
6
|
-
/**
|
|
7
|
-
* The prepare command definition for Commander
|
|
8
|
-
*/
|
|
9
|
-
export declare const prepareCmd: import("commander").Command;
|
|
10
|
-
/**
|
|
11
|
-
* Main function to execute the prepare command
|
|
12
|
-
*
|
|
13
|
-
* @param opts - Validated prepare options
|
|
14
|
-
*/
|
|
15
|
-
export declare function main(opts: PrepareOpts): Promise<void>;
|
package/types/src/lib/fetch.d.ts
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import type { GlobalOpts } from '../schemas/global.js';
|
|
2
|
-
import type { FetchOpts, FetchOptsUser } from '../schemas/fetch.js';
|
|
3
|
-
import { getInfos } from './git.js';
|
|
4
|
-
/**
|
|
5
|
-
* Enhanced repository type with DocPress-specific metadata
|
|
6
|
-
*/
|
|
7
|
-
export type EnhancedRepository = Awaited<ReturnType<typeof getInfos>>['repos'][number] & {
|
|
8
|
-
docpress: {
|
|
9
|
-
branch: string;
|
|
10
|
-
filtered: boolean;
|
|
11
|
-
includes: string[];
|
|
12
|
-
projectPath: string;
|
|
13
|
-
raw_url: string;
|
|
14
|
-
replace_url: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Checks for the existence of documentation files in a repository
|
|
19
|
-
*
|
|
20
|
-
* @param repoOwner - Owner of the repository (username)
|
|
21
|
-
* @param repoName - Name of the repository
|
|
22
|
-
* @param branch - Branch to check for documentation
|
|
23
|
-
* @returns Object containing HTTP status codes for different documentation paths
|
|
24
|
-
*/
|
|
25
|
-
export declare function checkDoc(repoOwner: GlobalOpts['usernames'][number], repoName: string, branch: FetchOpts['branch']): Promise<{
|
|
26
|
-
rootReadmeStatus: number;
|
|
27
|
-
docsFolderStatus: number;
|
|
28
|
-
docsReadmeStatus: number;
|
|
29
|
-
}>;
|
|
30
|
-
/**
|
|
31
|
-
* Fetches documentation from a user's repositories
|
|
32
|
-
*
|
|
33
|
-
* @param options - Options for fetching documentation
|
|
34
|
-
* @param options.username - GitHub username
|
|
35
|
-
* @param options.branch - Branch to use for documentation
|
|
36
|
-
* @param options.reposFilter - Optional filter for repositories
|
|
37
|
-
* @param options.token - GitHub API token
|
|
38
|
-
*/
|
|
39
|
-
export declare function fetchDoc({ username, branch, reposFilter, token }: FetchOptsUser): Promise<void>;
|
|
40
|
-
/**
|
|
41
|
-
* Enhances repository information with DocPress metadata
|
|
42
|
-
*
|
|
43
|
-
* @param repos - List of repositories from Git provider
|
|
44
|
-
* @param branch - Branch to use for documentation
|
|
45
|
-
* @param reposFilter - Optional filter for repositories
|
|
46
|
-
* @returns Array of enhanced repositories with DocPress metadata
|
|
47
|
-
*/
|
|
48
|
-
export declare function enhanceRepositories(repos: Awaited<ReturnType<typeof getInfos>>['repos'], branch?: FetchOpts['branch'], reposFilter?: FetchOpts['reposFilter']): Promise<EnhancedRepository[]>;
|
|
49
|
-
/**
|
|
50
|
-
* Determines which files to include in the sparse checkout based on repository structure
|
|
51
|
-
*
|
|
52
|
-
* @param repo - Repository information
|
|
53
|
-
* @param branch - Branch to check for documentation
|
|
54
|
-
* @returns Array of file patterns to include in sparse checkout
|
|
55
|
-
*/
|
|
56
|
-
export declare function getSparseCheckout(repo: Awaited<ReturnType<typeof getInfos>>['repos'][number], branch: FetchOpts['branch']): Promise<string[]>;
|
|
57
|
-
/**
|
|
58
|
-
* Generates and saves user and repository information
|
|
59
|
-
*
|
|
60
|
-
* @param user - User information from Git provider
|
|
61
|
-
* @param repos - List of repositories from Git provider
|
|
62
|
-
* @param branch - Branch to use for documentation
|
|
63
|
-
* @param reposFilter - Optional filter for repositories
|
|
64
|
-
* @returns Object containing user and enhanced repository information
|
|
65
|
-
*/
|
|
66
|
-
export declare function generateInfos(user: Awaited<ReturnType<typeof getInfos>>['user'], repos: Awaited<ReturnType<typeof getInfos>>['repos'], branch?: FetchOpts['branch'], reposFilter?: FetchOpts['reposFilter']): Promise<{
|
|
67
|
-
user: {
|
|
68
|
-
login: string;
|
|
69
|
-
id: number;
|
|
70
|
-
user_view_type?: string;
|
|
71
|
-
node_id: string;
|
|
72
|
-
avatar_url: string;
|
|
73
|
-
gravatar_id: string | null;
|
|
74
|
-
url: string;
|
|
75
|
-
html_url: string;
|
|
76
|
-
followers_url: string;
|
|
77
|
-
following_url: string;
|
|
78
|
-
gists_url: string;
|
|
79
|
-
starred_url: string;
|
|
80
|
-
subscriptions_url: string;
|
|
81
|
-
organizations_url: string;
|
|
82
|
-
repos_url: string;
|
|
83
|
-
events_url: string;
|
|
84
|
-
received_events_url: string;
|
|
85
|
-
type: string;
|
|
86
|
-
site_admin: boolean;
|
|
87
|
-
name: string | null;
|
|
88
|
-
company: string | null;
|
|
89
|
-
blog: string | null;
|
|
90
|
-
location: string | null;
|
|
91
|
-
email: string | null;
|
|
92
|
-
notification_email?: string | null;
|
|
93
|
-
hireable: boolean | null;
|
|
94
|
-
bio: string | null;
|
|
95
|
-
twitter_username?: string | null;
|
|
96
|
-
public_repos: number;
|
|
97
|
-
public_gists: number;
|
|
98
|
-
followers: number;
|
|
99
|
-
following: number;
|
|
100
|
-
created_at: string;
|
|
101
|
-
updated_at: string;
|
|
102
|
-
private_gists: number;
|
|
103
|
-
total_private_repos: number;
|
|
104
|
-
owned_private_repos: number;
|
|
105
|
-
disk_usage: number;
|
|
106
|
-
collaborators: number;
|
|
107
|
-
two_factor_authentication: boolean;
|
|
108
|
-
plan?: {
|
|
109
|
-
collaborators: number;
|
|
110
|
-
name: string;
|
|
111
|
-
space: number;
|
|
112
|
-
private_repos: number;
|
|
113
|
-
};
|
|
114
|
-
business_plus?: boolean;
|
|
115
|
-
ldap_dn?: string;
|
|
116
|
-
} | {
|
|
117
|
-
login: string;
|
|
118
|
-
id: number;
|
|
119
|
-
user_view_type?: string;
|
|
120
|
-
node_id: string;
|
|
121
|
-
avatar_url: string;
|
|
122
|
-
gravatar_id: string | null;
|
|
123
|
-
url: string;
|
|
124
|
-
html_url: string;
|
|
125
|
-
followers_url: string;
|
|
126
|
-
following_url: string;
|
|
127
|
-
gists_url: string;
|
|
128
|
-
starred_url: string;
|
|
129
|
-
subscriptions_url: string;
|
|
130
|
-
organizations_url: string;
|
|
131
|
-
repos_url: string;
|
|
132
|
-
events_url: string;
|
|
133
|
-
received_events_url: string;
|
|
134
|
-
type: string;
|
|
135
|
-
site_admin: boolean;
|
|
136
|
-
name: string | null;
|
|
137
|
-
company: string | null;
|
|
138
|
-
blog: string | null;
|
|
139
|
-
location: string | null;
|
|
140
|
-
email: string | null;
|
|
141
|
-
notification_email?: string | null;
|
|
142
|
-
hireable: boolean | null;
|
|
143
|
-
bio: string | null;
|
|
144
|
-
twitter_username?: string | null;
|
|
145
|
-
public_repos: number;
|
|
146
|
-
public_gists: number;
|
|
147
|
-
followers: number;
|
|
148
|
-
following: number;
|
|
149
|
-
created_at: string;
|
|
150
|
-
updated_at: string;
|
|
151
|
-
plan?: {
|
|
152
|
-
collaborators: number;
|
|
153
|
-
name: string;
|
|
154
|
-
space: number;
|
|
155
|
-
private_repos: number;
|
|
156
|
-
};
|
|
157
|
-
private_gists?: number;
|
|
158
|
-
total_private_repos?: number;
|
|
159
|
-
owned_private_repos?: number;
|
|
160
|
-
disk_usage?: number;
|
|
161
|
-
collaborators?: number;
|
|
162
|
-
};
|
|
163
|
-
repos: EnhancedRepository[];
|
|
164
|
-
}>;
|
|
165
|
-
/**
|
|
166
|
-
* Fetches documentation from repositories
|
|
167
|
-
*
|
|
168
|
-
* @param repos - List of enhanced repositories
|
|
169
|
-
* @param reposFilter - Optional filter for repositories
|
|
170
|
-
*/
|
|
171
|
-
export declare function getDoc(repos?: EnhancedRepository[], reposFilter?: FetchOpts['reposFilter']): Promise<void>;
|
|
172
|
-
/**
|
|
173
|
-
* Determines if a repository should be filtered out based on filter rules
|
|
174
|
-
*
|
|
175
|
-
* @param repo - Repository information
|
|
176
|
-
* @param reposFilter - Optional filter for repositories
|
|
177
|
-
* @returns True if the repository should be filtered out, false otherwise
|
|
178
|
-
*/
|
|
179
|
-
export declare function isRepoFiltered(repo: EnhancedRepository | Awaited<ReturnType<typeof getInfos>>['repos'][number], reposFilter?: FetchOpts['reposFilter']): boolean;
|