@tobi-or-not/docpress 0.1.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 +74 -0
- package/bin/docpress.js +5 -0
- package/dist/commands/build.js +16 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/fetch.js +25 -0
- package/dist/commands/fetch.js.map +1 -0
- package/dist/commands/global.js +6 -0
- package/dist/commands/global.js.map +1 -0
- package/dist/commands/prepare.js +46 -0
- package/dist/commands/prepare.js.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/fetch.js +92 -0
- package/dist/lib/fetch.js.map +1 -0
- package/dist/lib/git.js +33 -0
- package/dist/lib/git.js.map +1 -0
- package/dist/lib/prepare.js +128 -0
- package/dist/lib/prepare.js.map +1 -0
- package/dist/lib/vitepress.js +50 -0
- package/dist/lib/vitepress.js.map +1 -0
- package/dist/schemas/build.js +3 -0
- package/dist/schemas/build.js.map +1 -0
- package/dist/schemas/fetch.js +24 -0
- package/dist/schemas/fetch.js.map +1 -0
- package/dist/schemas/global.js +16 -0
- package/dist/schemas/global.js.map +1 -0
- package/dist/schemas/prepare.js +22 -0
- package/dist/schemas/prepare.js.map +1 -0
- package/dist/utils/commands.js +21 -0
- package/dist/utils/commands.js.map +1 -0
- package/dist/utils/const.js +8 -0
- package/dist/utils/const.js.map +1 -0
- package/dist/utils/functions.js +107 -0
- package/dist/utils/functions.js.map +1 -0
- package/dist/utils/regex.js +20 -0
- package/dist/utils/regex.js.map +1 -0
- package/package.json +62 -0
- package/types/commands/build.d.ts +3 -0
- package/types/commands/fetch.d.ts +4 -0
- package/types/commands/global.d.ts +1 -0
- package/types/commands/prepare.d.ts +4 -0
- package/types/index.d.ts +1 -0
- package/types/lib/fetch.d.ts +19 -0
- package/types/lib/git.d.ts +241 -0
- package/types/lib/prepare.d.ts +55 -0
- package/types/lib/vitepress.d.ts +3 -0
- package/types/schemas/build.d.ts +3 -0
- package/types/schemas/fetch.d.ts +21 -0
- package/types/schemas/global.d.ts +64 -0
- package/types/schemas/prepare.d.ts +18 -0
- package/types/utils/commands.d.ts +82 -0
- package/types/utils/const.d.ts +6 -0
- package/types/utils/functions.d.ts +21 -0
- package/types/utils/regex.d.ts +2 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const globalOptsSchema: z.ZodObject<{
|
|
3
|
+
config: z.ZodOptional<z.ZodEffects<z.ZodString, {
|
|
4
|
+
branch: string;
|
|
5
|
+
gitProvider: "github" | "gitlab";
|
|
6
|
+
username: string;
|
|
7
|
+
reposFilter?: string[] | undefined;
|
|
8
|
+
token?: string | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
extraHeaderPages?: string[] | undefined;
|
|
11
|
+
extraPublicContent?: string[] | undefined;
|
|
12
|
+
extraTheme?: string[] | undefined;
|
|
13
|
+
vitepressConfig?: import("vitepress").UserConfig<import("vitepress").DefaultTheme.Config> | undefined;
|
|
14
|
+
}, string>>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
config?: ({
|
|
17
|
+
branch: string;
|
|
18
|
+
gitProvider: "github" | "gitlab";
|
|
19
|
+
username: string;
|
|
20
|
+
reposFilter?: string[] | undefined;
|
|
21
|
+
token?: string | undefined;
|
|
22
|
+
} & {
|
|
23
|
+
extraHeaderPages?: string[] | undefined;
|
|
24
|
+
extraPublicContent?: string[] | undefined;
|
|
25
|
+
extraTheme?: string[] | undefined;
|
|
26
|
+
vitepressConfig?: import("vitepress").UserConfig<import("vitepress").DefaultTheme.Config> | undefined;
|
|
27
|
+
}) | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
config?: string | undefined;
|
|
30
|
+
}>;
|
|
31
|
+
export type GlobalOpts = Zod.infer<typeof globalOptsSchema>;
|
|
32
|
+
export declare const configSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
33
|
+
branch: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
34
|
+
gitProvider: z.ZodDefault<z.ZodOptional<z.ZodEnum<["github", "gitlab"]>>>;
|
|
35
|
+
reposFilter: z.ZodOptional<z.ZodUnion<[z.ZodEffects<z.ZodString, string[], string>, z.ZodArray<z.ZodString, "many">]>>;
|
|
36
|
+
token: z.ZodOptional<z.ZodString>;
|
|
37
|
+
username: z.ZodString;
|
|
38
|
+
}, {
|
|
39
|
+
extraHeaderPages: z.ZodOptional<z.ZodEffects<z.ZodString, string[], string>>;
|
|
40
|
+
extraPublicContent: z.ZodOptional<z.ZodEffects<z.ZodString, string[], string>>;
|
|
41
|
+
extraTheme: z.ZodOptional<z.ZodEffects<z.ZodString, string[], string>>;
|
|
42
|
+
vitepressConfig: z.ZodOptional<z.ZodEffects<z.ZodString, import("vitepress").UserConfig<import("vitepress").DefaultTheme.Config>, string>>;
|
|
43
|
+
}>, {}>, "strip", z.ZodTypeAny, {
|
|
44
|
+
branch: string;
|
|
45
|
+
gitProvider: "github" | "gitlab";
|
|
46
|
+
username: string;
|
|
47
|
+
reposFilter?: string[] | undefined;
|
|
48
|
+
token?: string | undefined;
|
|
49
|
+
extraHeaderPages?: string[] | undefined;
|
|
50
|
+
extraPublicContent?: string[] | undefined;
|
|
51
|
+
extraTheme?: string[] | undefined;
|
|
52
|
+
vitepressConfig?: import("vitepress").UserConfig<import("vitepress").DefaultTheme.Config> | undefined;
|
|
53
|
+
}, {
|
|
54
|
+
username: string;
|
|
55
|
+
branch?: string | undefined;
|
|
56
|
+
gitProvider?: "github" | "gitlab" | undefined;
|
|
57
|
+
reposFilter?: string | string[] | undefined;
|
|
58
|
+
token?: string | undefined;
|
|
59
|
+
extraHeaderPages?: string | undefined;
|
|
60
|
+
extraPublicContent?: string | undefined;
|
|
61
|
+
extraTheme?: string | undefined;
|
|
62
|
+
vitepressConfig?: string | undefined;
|
|
63
|
+
}>;
|
|
64
|
+
export type Config = Zod.infer<typeof configSchema>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const prepareOptsSchema: z.ZodObject<{
|
|
3
|
+
extraHeaderPages: z.ZodOptional<z.ZodEffects<z.ZodString, string[], string>>;
|
|
4
|
+
extraPublicContent: z.ZodOptional<z.ZodEffects<z.ZodString, string[], string>>;
|
|
5
|
+
extraTheme: z.ZodOptional<z.ZodEffects<z.ZodString, string[], string>>;
|
|
6
|
+
vitepressConfig: z.ZodOptional<z.ZodEffects<z.ZodString, import("vitepress").UserConfig<import("vitepress").DefaultTheme.Config>, string>>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
extraHeaderPages?: string[] | undefined;
|
|
9
|
+
extraPublicContent?: string[] | undefined;
|
|
10
|
+
extraTheme?: string[] | undefined;
|
|
11
|
+
vitepressConfig?: import("vitepress").UserConfig<import("vitepress").DefaultTheme.Config> | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
extraHeaderPages?: string | undefined;
|
|
14
|
+
extraPublicContent?: string | undefined;
|
|
15
|
+
extraTheme?: string | undefined;
|
|
16
|
+
vitepressConfig?: string | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export type PrepareOpts = Zod.infer<typeof prepareOptsSchema>;
|
|
@@ -0,0 +1,82 @@
|
|
|
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
|
+
type Cmd = 'fetch' | 'build' | 'prepare' | 'global';
|
|
7
|
+
interface Options {
|
|
8
|
+
build: BuildOpts;
|
|
9
|
+
fetch: FetchOpts;
|
|
10
|
+
prepare: PrepareOpts;
|
|
11
|
+
global: GlobalOpts;
|
|
12
|
+
}
|
|
13
|
+
export declare const options: {
|
|
14
|
+
build: import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>;
|
|
15
|
+
fetch: import("zod").ZodObject<{
|
|
16
|
+
branch: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
17
|
+
gitProvider: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodEnum<["github", "gitlab"]>>>;
|
|
18
|
+
reposFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodEffects<import("zod").ZodString, string[], string>, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
|
19
|
+
token: import("zod").ZodOptional<import("zod").ZodString>;
|
|
20
|
+
username: import("zod").ZodString;
|
|
21
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
22
|
+
branch: string;
|
|
23
|
+
gitProvider: "github" | "gitlab";
|
|
24
|
+
username: string;
|
|
25
|
+
reposFilter?: string[] | undefined;
|
|
26
|
+
token?: string | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
username: string;
|
|
29
|
+
branch?: string | undefined;
|
|
30
|
+
gitProvider?: "github" | "gitlab" | undefined;
|
|
31
|
+
reposFilter?: string | string[] | undefined;
|
|
32
|
+
token?: string | undefined;
|
|
33
|
+
}>;
|
|
34
|
+
prepare: import("zod").ZodObject<{
|
|
35
|
+
extraHeaderPages: import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodString, string[], string>>;
|
|
36
|
+
extraPublicContent: import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodString, string[], string>>;
|
|
37
|
+
extraTheme: import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodString, string[], string>>;
|
|
38
|
+
vitepressConfig: import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodString, import("vitepress").UserConfig<import("vitepress").DefaultTheme.Config>, string>>;
|
|
39
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
40
|
+
extraHeaderPages?: string[] | undefined;
|
|
41
|
+
extraPublicContent?: string[] | undefined;
|
|
42
|
+
extraTheme?: string[] | undefined;
|
|
43
|
+
vitepressConfig?: import("vitepress").UserConfig<import("vitepress").DefaultTheme.Config> | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
extraHeaderPages?: string | undefined;
|
|
46
|
+
extraPublicContent?: string | undefined;
|
|
47
|
+
extraTheme?: string | undefined;
|
|
48
|
+
vitepressConfig?: string | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
global: import("zod").ZodObject<{
|
|
51
|
+
config: import("zod").ZodOptional<import("zod").ZodEffects<import("zod").ZodString, {
|
|
52
|
+
branch: string;
|
|
53
|
+
gitProvider: "github" | "gitlab";
|
|
54
|
+
username: string;
|
|
55
|
+
reposFilter?: string[] | undefined;
|
|
56
|
+
token?: string | undefined;
|
|
57
|
+
} & {
|
|
58
|
+
extraHeaderPages?: string[] | undefined;
|
|
59
|
+
extraPublicContent?: string[] | undefined;
|
|
60
|
+
extraTheme?: string[] | undefined;
|
|
61
|
+
vitepressConfig?: import("vitepress").UserConfig<import("vitepress").DefaultTheme.Config> | undefined;
|
|
62
|
+
}, string>>;
|
|
63
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
64
|
+
config?: ({
|
|
65
|
+
branch: string;
|
|
66
|
+
gitProvider: "github" | "gitlab";
|
|
67
|
+
username: string;
|
|
68
|
+
reposFilter?: string[] | undefined;
|
|
69
|
+
token?: string | undefined;
|
|
70
|
+
} & {
|
|
71
|
+
extraHeaderPages?: string[] | undefined;
|
|
72
|
+
extraPublicContent?: string[] | undefined;
|
|
73
|
+
extraTheme?: string[] | undefined;
|
|
74
|
+
vitepressConfig?: import("vitepress").UserConfig<import("vitepress").DefaultTheme.Config> | undefined;
|
|
75
|
+
}) | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
config?: string | undefined;
|
|
78
|
+
}>;
|
|
79
|
+
};
|
|
80
|
+
export declare function parseOptions<T extends Cmd>(cmd: T, opts: Options[T]): Options[T];
|
|
81
|
+
export declare function addOptions(cmd: Command, opts: Option[]): Command;
|
|
82
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { EnhancedRepository } from '../lib/fetch.js';
|
|
2
|
+
import type { getInfos } from '../lib/git.js';
|
|
3
|
+
export declare function checkHttpStatus(url: string): Promise<number>;
|
|
4
|
+
interface PrettifyOpts {
|
|
5
|
+
mode?: 'capitalize' | 'uppercase' | 'lowercase';
|
|
6
|
+
replaceDash?: boolean;
|
|
7
|
+
removeIdx?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function prettify(s: string, opts: PrettifyOpts): string;
|
|
10
|
+
export declare function createDir(directory: string, { clean }?: {
|
|
11
|
+
clean?: boolean;
|
|
12
|
+
}): void;
|
|
13
|
+
export declare function isDir(path: string): boolean;
|
|
14
|
+
export declare function isFile(path: string): boolean;
|
|
15
|
+
export declare function extractFiles(paths: string[] | string): string[];
|
|
16
|
+
export declare function getMdFiles(path: string[]): string[];
|
|
17
|
+
export declare function prettifyEnum(arr: readonly string[]): string;
|
|
18
|
+
export declare function getUserInfos(): Awaited<ReturnType<typeof getInfos>>["user"];
|
|
19
|
+
export declare function getUserRepos(): EnhancedRepository[];
|
|
20
|
+
export declare function deepMerge<T extends Record<string, any>>(...objects: T[]): T;
|
|
21
|
+
export {};
|