@stephansama/auto-readme 0.2.3 → 0.2.4
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 +0 -2
- package/config/schema.cjs +29 -29
- package/config/schema.d.cts +43 -43
- package/config/schema.d.ts +43 -43
- package/config/schema.js +19 -19
- package/config/schema.json +1 -1
- package/dist/index.cjs +33 -33
- package/dist/index.js +23 -23
- package/package.json +5 -5
- package/config/schema.yaml +0 -194
package/README.md
CHANGED
|
@@ -208,7 +208,6 @@ _Enum, one of the following possible values:_
|
|
|
208
208
|
|
|
209
209
|
- `'LIST'`
|
|
210
210
|
- `'TABLE'`
|
|
211
|
-
(_optional_)
|
|
212
211
|
|
|
213
212
|
_Default value:_ `'TABLE'`
|
|
214
213
|
|
|
@@ -218,7 +217,6 @@ _Enum, one of the following possible values:_
|
|
|
218
217
|
|
|
219
218
|
- `'JS'`
|
|
220
219
|
- `'RS'`
|
|
221
|
-
(_optional_)
|
|
222
220
|
|
|
223
221
|
_Default value:_ `'JS'`
|
|
224
222
|
|
package/config/schema.cjs
CHANGED
|
@@ -25,16 +25,16 @@ let zod = require("zod");
|
|
|
25
25
|
zod = __toESM(zod);
|
|
26
26
|
|
|
27
27
|
//#region src/schema.ts
|
|
28
|
-
const actionsSchema = zod.
|
|
28
|
+
const actionsSchema = zod.enum([
|
|
29
29
|
"ACTION",
|
|
30
30
|
"PKG",
|
|
31
31
|
"USAGE",
|
|
32
32
|
"WORKSPACE",
|
|
33
33
|
"ZOD"
|
|
34
|
-
]).
|
|
35
|
-
const formatsSchema = zod.
|
|
36
|
-
const languageSchema = zod.
|
|
37
|
-
const headingsSchema = zod.
|
|
34
|
+
]).meta({ description: "Comment action options" });
|
|
35
|
+
const formatsSchema = zod.enum(["LIST", "TABLE"]).default("TABLE");
|
|
36
|
+
const languageSchema = zod.enum(["JS", "RS"]).default("JS");
|
|
37
|
+
const headingsSchema = zod.enum([
|
|
38
38
|
"default",
|
|
39
39
|
"description",
|
|
40
40
|
"devDependency",
|
|
@@ -43,8 +43,8 @@ const headingsSchema = zod.z.enum([
|
|
|
43
43
|
"private",
|
|
44
44
|
"required",
|
|
45
45
|
"version"
|
|
46
|
-
]).
|
|
47
|
-
const tableHeadingsSchema = zod.
|
|
46
|
+
]).meta({ description: "Table heading options" });
|
|
47
|
+
const tableHeadingsSchema = zod.record(actionsSchema, headingsSchema.array().optional()).default({
|
|
48
48
|
ACTION: [
|
|
49
49
|
"name",
|
|
50
50
|
"required",
|
|
@@ -64,10 +64,10 @@ const tableHeadingsSchema = zod.z.record(actionsSchema, headingsSchema.array().o
|
|
|
64
64
|
"description"
|
|
65
65
|
],
|
|
66
66
|
ZOD: []
|
|
67
|
-
});
|
|
68
|
-
const templatesSchema = zod.
|
|
69
|
-
downloadImage: zod.
|
|
70
|
-
emojis: zod.
|
|
67
|
+
}).meta({ description: "Table heading action configuration" });
|
|
68
|
+
const templatesSchema = zod.object({
|
|
69
|
+
downloadImage: zod.string().default("https://img.shields.io/npm/dw/{{name}}?labelColor=211F1F"),
|
|
70
|
+
emojis: zod.record(headingsSchema, zod.string()).default({
|
|
71
71
|
default: "⚙️",
|
|
72
72
|
description: "📝",
|
|
73
73
|
devDependency: "💻",
|
|
@@ -76,45 +76,45 @@ const templatesSchema = zod.z.object({
|
|
|
76
76
|
private: "🔒",
|
|
77
77
|
required: "",
|
|
78
78
|
version: ""
|
|
79
|
-
}),
|
|
80
|
-
registryUrl: zod.
|
|
81
|
-
versionImage: zod.
|
|
79
|
+
}).meta({ description: "Table heading emojis used when enabled" }),
|
|
80
|
+
registryUrl: zod.string().default("https://www.npmjs.com/package/{{name}}"),
|
|
81
|
+
versionImage: zod.string().default("https://img.shields.io/npm/v/{{uri_name}}?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F")
|
|
82
82
|
});
|
|
83
83
|
const defaultTemplates = templatesSchema.parse({});
|
|
84
84
|
const defaultTableHeadings = tableHeadingsSchema.parse(void 0);
|
|
85
|
-
const _configSchema = zod.
|
|
86
|
-
affectedRegexes: zod.
|
|
87
|
-
collapseHeadings: zod.
|
|
85
|
+
const _configSchema = zod.object({
|
|
86
|
+
affectedRegexes: zod.string().array().default([]),
|
|
87
|
+
collapseHeadings: zod.string().array().default([]),
|
|
88
88
|
defaultLanguage: languageSchema.meta({
|
|
89
89
|
alias: "l",
|
|
90
90
|
description: "Default language to infer projects from"
|
|
91
91
|
}),
|
|
92
|
-
disableEmojis: zod.
|
|
92
|
+
disableEmojis: zod.boolean().default(false).meta({
|
|
93
93
|
alias: "e",
|
|
94
94
|
description: "Whether or not to use emojis in markdown table headings"
|
|
95
95
|
}),
|
|
96
|
-
disableMarkdownHeadings: zod.
|
|
97
|
-
enablePrettier: zod.
|
|
98
|
-
enableToc: zod.
|
|
96
|
+
disableMarkdownHeadings: zod.boolean().default(false).meta({ description: "Whether or not to display markdown headings" }),
|
|
97
|
+
enablePrettier: zod.boolean().default(true).meta({ description: "Whether or not to use prettier to format the files" }),
|
|
98
|
+
enableToc: zod.boolean().default(false).meta({
|
|
99
99
|
alias: "t",
|
|
100
100
|
description: "generate table of contents for readmes"
|
|
101
101
|
}),
|
|
102
|
-
enableUsage: zod.
|
|
102
|
+
enableUsage: zod.boolean().default(false).meta({ description: "Whether or not to enable usage plugin" }),
|
|
103
103
|
headings: tableHeadingsSchema.optional().default(defaultTableHeadings).describe("List of headings for different table outputs"),
|
|
104
|
-
onlyReadmes: zod.
|
|
104
|
+
onlyReadmes: zod.boolean().default(true).meta({
|
|
105
105
|
alias: "r",
|
|
106
106
|
description: "Whether or not to only traverse readmes"
|
|
107
107
|
}),
|
|
108
|
-
onlyShowPublicPackages: zod.
|
|
108
|
+
onlyShowPublicPackages: zod.boolean().default(false).meta({
|
|
109
109
|
alias: "p",
|
|
110
110
|
description: "Only show public packages in workspaces"
|
|
111
111
|
}),
|
|
112
|
-
removeScope: zod.
|
|
112
|
+
removeScope: zod.string().default("").meta({ description: "Remove common workspace scope" }),
|
|
113
113
|
templates: templatesSchema.optional().default(defaultTemplates).describe("Handlebars templates used to fuel list and table generation"),
|
|
114
|
-
tocHeading: zod.
|
|
115
|
-
usageFile: zod.
|
|
116
|
-
usageHeading: zod.
|
|
117
|
-
verbose: zod.
|
|
114
|
+
tocHeading: zod.string().default("Table of contents").meta({ description: "Markdown heading used to generate table of contents" }),
|
|
115
|
+
usageFile: zod.string().default("").meta({ description: "Workspace level usage file" }),
|
|
116
|
+
usageHeading: zod.string().default("Usage").meta({ description: "Markdown heading used to generate usage example" }),
|
|
117
|
+
verbose: zod.boolean().default(false).meta({
|
|
118
118
|
alias: "v",
|
|
119
119
|
description: "whether or not to display verbose logging"
|
|
120
120
|
})
|
package/config/schema.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/schema.d.ts
|
|
4
4
|
declare const actionsSchema: z.ZodEnum<{
|
|
@@ -8,121 +8,121 @@ declare const actionsSchema: z.ZodEnum<{
|
|
|
8
8
|
WORKSPACE: "WORKSPACE";
|
|
9
9
|
ZOD: "ZOD";
|
|
10
10
|
}>;
|
|
11
|
-
declare const formatsSchema: z.
|
|
11
|
+
declare const formatsSchema: z.ZodDefault<z.ZodEnum<{
|
|
12
12
|
LIST: "LIST";
|
|
13
13
|
TABLE: "TABLE";
|
|
14
|
-
}
|
|
15
|
-
declare const languageSchema: z.ZodDefault<z.
|
|
14
|
+
}>>;
|
|
15
|
+
declare const languageSchema: z.ZodDefault<z.ZodEnum<{
|
|
16
16
|
JS: "JS";
|
|
17
17
|
RS: "RS";
|
|
18
|
-
}
|
|
18
|
+
}>>;
|
|
19
19
|
declare const defaultTemplates: {
|
|
20
20
|
downloadImage: string;
|
|
21
|
-
emojis: Record<"
|
|
21
|
+
emojis: Record<"description" | "default" | "devDependency" | "downloads" | "name" | "private" | "required" | "version", string>;
|
|
22
22
|
registryUrl: string;
|
|
23
23
|
versionImage: string;
|
|
24
24
|
};
|
|
25
|
-
declare const defaultTableHeadings: Record<"ACTION" | "PKG" | "USAGE" | "WORKSPACE" | "ZOD", ("
|
|
25
|
+
declare const defaultTableHeadings: Record<"ACTION" | "PKG" | "USAGE" | "WORKSPACE" | "ZOD", ("description" | "default" | "devDependency" | "downloads" | "name" | "private" | "required" | "version")[] | undefined>;
|
|
26
26
|
declare const _configSchema: z.ZodObject<{
|
|
27
|
-
affectedRegexes: z.ZodDefault<z.
|
|
28
|
-
collapseHeadings: z.ZodDefault<z.
|
|
29
|
-
defaultLanguage: z.ZodDefault<z.
|
|
27
|
+
affectedRegexes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
28
|
+
collapseHeadings: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
29
|
+
defaultLanguage: z.ZodDefault<z.ZodEnum<{
|
|
30
30
|
JS: "JS";
|
|
31
31
|
RS: "RS";
|
|
32
|
-
}
|
|
32
|
+
}>>;
|
|
33
33
|
disableEmojis: z.ZodDefault<z.ZodBoolean>;
|
|
34
34
|
disableMarkdownHeadings: z.ZodDefault<z.ZodBoolean>;
|
|
35
35
|
enablePrettier: z.ZodDefault<z.ZodBoolean>;
|
|
36
36
|
enableToc: z.ZodDefault<z.ZodBoolean>;
|
|
37
|
-
enableUsage: z.ZodDefault<z.
|
|
38
|
-
headings: z.ZodDefault<z.ZodOptional<z.ZodDefault<z.
|
|
37
|
+
enableUsage: z.ZodDefault<z.ZodBoolean>;
|
|
38
|
+
headings: z.ZodDefault<z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodEnum<{
|
|
39
39
|
ACTION: "ACTION";
|
|
40
40
|
PKG: "PKG";
|
|
41
41
|
USAGE: "USAGE";
|
|
42
42
|
WORKSPACE: "WORKSPACE";
|
|
43
43
|
ZOD: "ZOD";
|
|
44
44
|
}>, z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
45
|
-
default: "default";
|
|
46
45
|
description: "description";
|
|
46
|
+
default: "default";
|
|
47
47
|
devDependency: "devDependency";
|
|
48
48
|
downloads: "downloads";
|
|
49
49
|
name: "name";
|
|
50
50
|
private: "private";
|
|
51
51
|
required: "required";
|
|
52
52
|
version: "version";
|
|
53
|
-
}
|
|
53
|
+
}>>>>>>>;
|
|
54
54
|
onlyReadmes: z.ZodDefault<z.ZodBoolean>;
|
|
55
55
|
onlyShowPublicPackages: z.ZodDefault<z.ZodBoolean>;
|
|
56
|
-
removeScope: z.ZodDefault<z.
|
|
56
|
+
removeScope: z.ZodDefault<z.ZodString>;
|
|
57
57
|
templates: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
58
|
-
downloadImage: z.ZodDefault<z.
|
|
59
|
-
emojis: z.ZodDefault<z.
|
|
60
|
-
default: "default";
|
|
58
|
+
downloadImage: z.ZodDefault<z.ZodString>;
|
|
59
|
+
emojis: z.ZodDefault<z.ZodRecord<z.ZodEnum<{
|
|
61
60
|
description: "description";
|
|
61
|
+
default: "default";
|
|
62
62
|
devDependency: "devDependency";
|
|
63
63
|
downloads: "downloads";
|
|
64
64
|
name: "name";
|
|
65
65
|
private: "private";
|
|
66
66
|
required: "required";
|
|
67
67
|
version: "version";
|
|
68
|
-
}>, z.ZodString
|
|
69
|
-
registryUrl: z.ZodDefault<z.
|
|
70
|
-
versionImage: z.ZodDefault<z.
|
|
68
|
+
}>, z.ZodString>>;
|
|
69
|
+
registryUrl: z.ZodDefault<z.ZodString>;
|
|
70
|
+
versionImage: z.ZodDefault<z.ZodString>;
|
|
71
71
|
}, z.core.$strip>>>;
|
|
72
|
-
tocHeading: z.ZodDefault<z.
|
|
73
|
-
usageFile: z.ZodDefault<z.
|
|
74
|
-
usageHeading: z.ZodDefault<z.
|
|
72
|
+
tocHeading: z.ZodDefault<z.ZodString>;
|
|
73
|
+
usageFile: z.ZodDefault<z.ZodString>;
|
|
74
|
+
usageHeading: z.ZodDefault<z.ZodString>;
|
|
75
75
|
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
76
76
|
}, z.core.$strip>;
|
|
77
77
|
declare const configSchema: z.ZodOptional<z.ZodObject<{
|
|
78
|
-
affectedRegexes: z.ZodDefault<z.
|
|
79
|
-
collapseHeadings: z.ZodDefault<z.
|
|
80
|
-
defaultLanguage: z.ZodDefault<z.
|
|
78
|
+
affectedRegexes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
79
|
+
collapseHeadings: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
80
|
+
defaultLanguage: z.ZodDefault<z.ZodEnum<{
|
|
81
81
|
JS: "JS";
|
|
82
82
|
RS: "RS";
|
|
83
|
-
}
|
|
83
|
+
}>>;
|
|
84
84
|
disableEmojis: z.ZodDefault<z.ZodBoolean>;
|
|
85
85
|
disableMarkdownHeadings: z.ZodDefault<z.ZodBoolean>;
|
|
86
86
|
enablePrettier: z.ZodDefault<z.ZodBoolean>;
|
|
87
87
|
enableToc: z.ZodDefault<z.ZodBoolean>;
|
|
88
|
-
enableUsage: z.ZodDefault<z.
|
|
89
|
-
headings: z.ZodDefault<z.ZodOptional<z.ZodDefault<z.
|
|
88
|
+
enableUsage: z.ZodDefault<z.ZodBoolean>;
|
|
89
|
+
headings: z.ZodDefault<z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodEnum<{
|
|
90
90
|
ACTION: "ACTION";
|
|
91
91
|
PKG: "PKG";
|
|
92
92
|
USAGE: "USAGE";
|
|
93
93
|
WORKSPACE: "WORKSPACE";
|
|
94
94
|
ZOD: "ZOD";
|
|
95
95
|
}>, z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
96
|
-
default: "default";
|
|
97
96
|
description: "description";
|
|
97
|
+
default: "default";
|
|
98
98
|
devDependency: "devDependency";
|
|
99
99
|
downloads: "downloads";
|
|
100
100
|
name: "name";
|
|
101
101
|
private: "private";
|
|
102
102
|
required: "required";
|
|
103
103
|
version: "version";
|
|
104
|
-
}
|
|
104
|
+
}>>>>>>>;
|
|
105
105
|
onlyReadmes: z.ZodDefault<z.ZodBoolean>;
|
|
106
106
|
onlyShowPublicPackages: z.ZodDefault<z.ZodBoolean>;
|
|
107
|
-
removeScope: z.ZodDefault<z.
|
|
107
|
+
removeScope: z.ZodDefault<z.ZodString>;
|
|
108
108
|
templates: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
109
|
-
downloadImage: z.ZodDefault<z.
|
|
110
|
-
emojis: z.ZodDefault<z.
|
|
111
|
-
default: "default";
|
|
109
|
+
downloadImage: z.ZodDefault<z.ZodString>;
|
|
110
|
+
emojis: z.ZodDefault<z.ZodRecord<z.ZodEnum<{
|
|
112
111
|
description: "description";
|
|
112
|
+
default: "default";
|
|
113
113
|
devDependency: "devDependency";
|
|
114
114
|
downloads: "downloads";
|
|
115
115
|
name: "name";
|
|
116
116
|
private: "private";
|
|
117
117
|
required: "required";
|
|
118
118
|
version: "version";
|
|
119
|
-
}>, z.ZodString
|
|
120
|
-
registryUrl: z.ZodDefault<z.
|
|
121
|
-
versionImage: z.ZodDefault<z.
|
|
119
|
+
}>, z.ZodString>>;
|
|
120
|
+
registryUrl: z.ZodDefault<z.ZodString>;
|
|
121
|
+
versionImage: z.ZodDefault<z.ZodString>;
|
|
122
122
|
}, z.core.$strip>>>;
|
|
123
|
-
tocHeading: z.ZodDefault<z.
|
|
124
|
-
usageFile: z.ZodDefault<z.
|
|
125
|
-
usageHeading: z.ZodDefault<z.
|
|
123
|
+
tocHeading: z.ZodDefault<z.ZodString>;
|
|
124
|
+
usageFile: z.ZodDefault<z.ZodString>;
|
|
125
|
+
usageHeading: z.ZodDefault<z.ZodString>;
|
|
126
126
|
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
127
127
|
}, z.core.$strip>>;
|
|
128
128
|
type Config = Partial<z.infer<typeof _configSchema>>;
|
package/config/schema.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/schema.d.ts
|
|
4
4
|
declare const actionsSchema: z.ZodEnum<{
|
|
@@ -8,121 +8,121 @@ declare const actionsSchema: z.ZodEnum<{
|
|
|
8
8
|
WORKSPACE: "WORKSPACE";
|
|
9
9
|
ZOD: "ZOD";
|
|
10
10
|
}>;
|
|
11
|
-
declare const formatsSchema: z.
|
|
11
|
+
declare const formatsSchema: z.ZodDefault<z.ZodEnum<{
|
|
12
12
|
LIST: "LIST";
|
|
13
13
|
TABLE: "TABLE";
|
|
14
|
-
}
|
|
15
|
-
declare const languageSchema: z.ZodDefault<z.
|
|
14
|
+
}>>;
|
|
15
|
+
declare const languageSchema: z.ZodDefault<z.ZodEnum<{
|
|
16
16
|
JS: "JS";
|
|
17
17
|
RS: "RS";
|
|
18
|
-
}
|
|
18
|
+
}>>;
|
|
19
19
|
declare const defaultTemplates: {
|
|
20
20
|
downloadImage: string;
|
|
21
|
-
emojis: Record<"
|
|
21
|
+
emojis: Record<"description" | "default" | "devDependency" | "downloads" | "name" | "private" | "required" | "version", string>;
|
|
22
22
|
registryUrl: string;
|
|
23
23
|
versionImage: string;
|
|
24
24
|
};
|
|
25
|
-
declare const defaultTableHeadings: Record<"ACTION" | "PKG" | "USAGE" | "WORKSPACE" | "ZOD", ("
|
|
25
|
+
declare const defaultTableHeadings: Record<"ACTION" | "PKG" | "USAGE" | "WORKSPACE" | "ZOD", ("description" | "default" | "devDependency" | "downloads" | "name" | "private" | "required" | "version")[] | undefined>;
|
|
26
26
|
declare const _configSchema: z.ZodObject<{
|
|
27
|
-
affectedRegexes: z.ZodDefault<z.
|
|
28
|
-
collapseHeadings: z.ZodDefault<z.
|
|
29
|
-
defaultLanguage: z.ZodDefault<z.
|
|
27
|
+
affectedRegexes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
28
|
+
collapseHeadings: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
29
|
+
defaultLanguage: z.ZodDefault<z.ZodEnum<{
|
|
30
30
|
JS: "JS";
|
|
31
31
|
RS: "RS";
|
|
32
|
-
}
|
|
32
|
+
}>>;
|
|
33
33
|
disableEmojis: z.ZodDefault<z.ZodBoolean>;
|
|
34
34
|
disableMarkdownHeadings: z.ZodDefault<z.ZodBoolean>;
|
|
35
35
|
enablePrettier: z.ZodDefault<z.ZodBoolean>;
|
|
36
36
|
enableToc: z.ZodDefault<z.ZodBoolean>;
|
|
37
|
-
enableUsage: z.ZodDefault<z.
|
|
38
|
-
headings: z.ZodDefault<z.ZodOptional<z.ZodDefault<z.
|
|
37
|
+
enableUsage: z.ZodDefault<z.ZodBoolean>;
|
|
38
|
+
headings: z.ZodDefault<z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodEnum<{
|
|
39
39
|
ACTION: "ACTION";
|
|
40
40
|
PKG: "PKG";
|
|
41
41
|
USAGE: "USAGE";
|
|
42
42
|
WORKSPACE: "WORKSPACE";
|
|
43
43
|
ZOD: "ZOD";
|
|
44
44
|
}>, z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
45
|
-
default: "default";
|
|
46
45
|
description: "description";
|
|
46
|
+
default: "default";
|
|
47
47
|
devDependency: "devDependency";
|
|
48
48
|
downloads: "downloads";
|
|
49
49
|
name: "name";
|
|
50
50
|
private: "private";
|
|
51
51
|
required: "required";
|
|
52
52
|
version: "version";
|
|
53
|
-
}
|
|
53
|
+
}>>>>>>>;
|
|
54
54
|
onlyReadmes: z.ZodDefault<z.ZodBoolean>;
|
|
55
55
|
onlyShowPublicPackages: z.ZodDefault<z.ZodBoolean>;
|
|
56
|
-
removeScope: z.ZodDefault<z.
|
|
56
|
+
removeScope: z.ZodDefault<z.ZodString>;
|
|
57
57
|
templates: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
58
|
-
downloadImage: z.ZodDefault<z.
|
|
59
|
-
emojis: z.ZodDefault<z.
|
|
60
|
-
default: "default";
|
|
58
|
+
downloadImage: z.ZodDefault<z.ZodString>;
|
|
59
|
+
emojis: z.ZodDefault<z.ZodRecord<z.ZodEnum<{
|
|
61
60
|
description: "description";
|
|
61
|
+
default: "default";
|
|
62
62
|
devDependency: "devDependency";
|
|
63
63
|
downloads: "downloads";
|
|
64
64
|
name: "name";
|
|
65
65
|
private: "private";
|
|
66
66
|
required: "required";
|
|
67
67
|
version: "version";
|
|
68
|
-
}>, z.ZodString
|
|
69
|
-
registryUrl: z.ZodDefault<z.
|
|
70
|
-
versionImage: z.ZodDefault<z.
|
|
68
|
+
}>, z.ZodString>>;
|
|
69
|
+
registryUrl: z.ZodDefault<z.ZodString>;
|
|
70
|
+
versionImage: z.ZodDefault<z.ZodString>;
|
|
71
71
|
}, z.core.$strip>>>;
|
|
72
|
-
tocHeading: z.ZodDefault<z.
|
|
73
|
-
usageFile: z.ZodDefault<z.
|
|
74
|
-
usageHeading: z.ZodDefault<z.
|
|
72
|
+
tocHeading: z.ZodDefault<z.ZodString>;
|
|
73
|
+
usageFile: z.ZodDefault<z.ZodString>;
|
|
74
|
+
usageHeading: z.ZodDefault<z.ZodString>;
|
|
75
75
|
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
76
76
|
}, z.core.$strip>;
|
|
77
77
|
declare const configSchema: z.ZodOptional<z.ZodObject<{
|
|
78
|
-
affectedRegexes: z.ZodDefault<z.
|
|
79
|
-
collapseHeadings: z.ZodDefault<z.
|
|
80
|
-
defaultLanguage: z.ZodDefault<z.
|
|
78
|
+
affectedRegexes: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
79
|
+
collapseHeadings: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
80
|
+
defaultLanguage: z.ZodDefault<z.ZodEnum<{
|
|
81
81
|
JS: "JS";
|
|
82
82
|
RS: "RS";
|
|
83
|
-
}
|
|
83
|
+
}>>;
|
|
84
84
|
disableEmojis: z.ZodDefault<z.ZodBoolean>;
|
|
85
85
|
disableMarkdownHeadings: z.ZodDefault<z.ZodBoolean>;
|
|
86
86
|
enablePrettier: z.ZodDefault<z.ZodBoolean>;
|
|
87
87
|
enableToc: z.ZodDefault<z.ZodBoolean>;
|
|
88
|
-
enableUsage: z.ZodDefault<z.
|
|
89
|
-
headings: z.ZodDefault<z.ZodOptional<z.ZodDefault<z.
|
|
88
|
+
enableUsage: z.ZodDefault<z.ZodBoolean>;
|
|
89
|
+
headings: z.ZodDefault<z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodEnum<{
|
|
90
90
|
ACTION: "ACTION";
|
|
91
91
|
PKG: "PKG";
|
|
92
92
|
USAGE: "USAGE";
|
|
93
93
|
WORKSPACE: "WORKSPACE";
|
|
94
94
|
ZOD: "ZOD";
|
|
95
95
|
}>, z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
96
|
-
default: "default";
|
|
97
96
|
description: "description";
|
|
97
|
+
default: "default";
|
|
98
98
|
devDependency: "devDependency";
|
|
99
99
|
downloads: "downloads";
|
|
100
100
|
name: "name";
|
|
101
101
|
private: "private";
|
|
102
102
|
required: "required";
|
|
103
103
|
version: "version";
|
|
104
|
-
}
|
|
104
|
+
}>>>>>>>;
|
|
105
105
|
onlyReadmes: z.ZodDefault<z.ZodBoolean>;
|
|
106
106
|
onlyShowPublicPackages: z.ZodDefault<z.ZodBoolean>;
|
|
107
|
-
removeScope: z.ZodDefault<z.
|
|
107
|
+
removeScope: z.ZodDefault<z.ZodString>;
|
|
108
108
|
templates: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
109
|
-
downloadImage: z.ZodDefault<z.
|
|
110
|
-
emojis: z.ZodDefault<z.
|
|
111
|
-
default: "default";
|
|
109
|
+
downloadImage: z.ZodDefault<z.ZodString>;
|
|
110
|
+
emojis: z.ZodDefault<z.ZodRecord<z.ZodEnum<{
|
|
112
111
|
description: "description";
|
|
112
|
+
default: "default";
|
|
113
113
|
devDependency: "devDependency";
|
|
114
114
|
downloads: "downloads";
|
|
115
115
|
name: "name";
|
|
116
116
|
private: "private";
|
|
117
117
|
required: "required";
|
|
118
118
|
version: "version";
|
|
119
|
-
}>, z.ZodString
|
|
120
|
-
registryUrl: z.ZodDefault<z.
|
|
121
|
-
versionImage: z.ZodDefault<z.
|
|
119
|
+
}>, z.ZodString>>;
|
|
120
|
+
registryUrl: z.ZodDefault<z.ZodString>;
|
|
121
|
+
versionImage: z.ZodDefault<z.ZodString>;
|
|
122
122
|
}, z.core.$strip>>>;
|
|
123
|
-
tocHeading: z.ZodDefault<z.
|
|
124
|
-
usageFile: z.ZodDefault<z.
|
|
125
|
-
usageHeading: z.ZodDefault<z.
|
|
123
|
+
tocHeading: z.ZodDefault<z.ZodString>;
|
|
124
|
+
usageFile: z.ZodDefault<z.ZodString>;
|
|
125
|
+
usageHeading: z.ZodDefault<z.ZodString>;
|
|
126
126
|
verbose: z.ZodDefault<z.ZodBoolean>;
|
|
127
127
|
}, z.core.$strip>>;
|
|
128
128
|
type Config = Partial<z.infer<typeof _configSchema>>;
|
package/config/schema.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as z from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/schema.ts
|
|
4
4
|
const actionsSchema = z.enum([
|
|
@@ -7,9 +7,9 @@ const actionsSchema = z.enum([
|
|
|
7
7
|
"USAGE",
|
|
8
8
|
"WORKSPACE",
|
|
9
9
|
"ZOD"
|
|
10
|
-
]).
|
|
11
|
-
const formatsSchema = z.enum(["LIST", "TABLE"]).default("TABLE")
|
|
12
|
-
const languageSchema = z.enum(["JS", "RS"]).
|
|
10
|
+
]).meta({ description: "Comment action options" });
|
|
11
|
+
const formatsSchema = z.enum(["LIST", "TABLE"]).default("TABLE");
|
|
12
|
+
const languageSchema = z.enum(["JS", "RS"]).default("JS");
|
|
13
13
|
const headingsSchema = z.enum([
|
|
14
14
|
"default",
|
|
15
15
|
"description",
|
|
@@ -19,8 +19,8 @@ const headingsSchema = z.enum([
|
|
|
19
19
|
"private",
|
|
20
20
|
"required",
|
|
21
21
|
"version"
|
|
22
|
-
]).
|
|
23
|
-
const tableHeadingsSchema = z.record(actionsSchema, headingsSchema.array().optional()).
|
|
22
|
+
]).meta({ description: "Table heading options" });
|
|
23
|
+
const tableHeadingsSchema = z.record(actionsSchema, headingsSchema.array().optional()).default({
|
|
24
24
|
ACTION: [
|
|
25
25
|
"name",
|
|
26
26
|
"required",
|
|
@@ -40,10 +40,10 @@ const tableHeadingsSchema = z.record(actionsSchema, headingsSchema.array().optio
|
|
|
40
40
|
"description"
|
|
41
41
|
],
|
|
42
42
|
ZOD: []
|
|
43
|
-
});
|
|
43
|
+
}).meta({ description: "Table heading action configuration" });
|
|
44
44
|
const templatesSchema = z.object({
|
|
45
|
-
downloadImage: z.string().
|
|
46
|
-
emojis: z.record(headingsSchema, z.string()).
|
|
45
|
+
downloadImage: z.string().default("https://img.shields.io/npm/dw/{{name}}?labelColor=211F1F"),
|
|
46
|
+
emojis: z.record(headingsSchema, z.string()).default({
|
|
47
47
|
default: "⚙️",
|
|
48
48
|
description: "📝",
|
|
49
49
|
devDependency: "💻",
|
|
@@ -52,15 +52,15 @@ const templatesSchema = z.object({
|
|
|
52
52
|
private: "🔒",
|
|
53
53
|
required: "",
|
|
54
54
|
version: ""
|
|
55
|
-
}),
|
|
56
|
-
registryUrl: z.string().
|
|
57
|
-
versionImage: z.string().
|
|
55
|
+
}).meta({ description: "Table heading emojis used when enabled" }),
|
|
56
|
+
registryUrl: z.string().default("https://www.npmjs.com/package/{{name}}"),
|
|
57
|
+
versionImage: z.string().default("https://img.shields.io/npm/v/{{uri_name}}?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F")
|
|
58
58
|
});
|
|
59
59
|
const defaultTemplates = templatesSchema.parse({});
|
|
60
60
|
const defaultTableHeadings = tableHeadingsSchema.parse(void 0);
|
|
61
61
|
const _configSchema = z.object({
|
|
62
|
-
affectedRegexes: z.string().array().
|
|
63
|
-
collapseHeadings: z.string().array().
|
|
62
|
+
affectedRegexes: z.string().array().default([]),
|
|
63
|
+
collapseHeadings: z.string().array().default([]),
|
|
64
64
|
defaultLanguage: languageSchema.meta({
|
|
65
65
|
alias: "l",
|
|
66
66
|
description: "Default language to infer projects from"
|
|
@@ -75,7 +75,7 @@ const _configSchema = z.object({
|
|
|
75
75
|
alias: "t",
|
|
76
76
|
description: "generate table of contents for readmes"
|
|
77
77
|
}),
|
|
78
|
-
enableUsage: z.boolean().
|
|
78
|
+
enableUsage: z.boolean().default(false).meta({ description: "Whether or not to enable usage plugin" }),
|
|
79
79
|
headings: tableHeadingsSchema.optional().default(defaultTableHeadings).describe("List of headings for different table outputs"),
|
|
80
80
|
onlyReadmes: z.boolean().default(true).meta({
|
|
81
81
|
alias: "r",
|
|
@@ -85,11 +85,11 @@ const _configSchema = z.object({
|
|
|
85
85
|
alias: "p",
|
|
86
86
|
description: "Only show public packages in workspaces"
|
|
87
87
|
}),
|
|
88
|
-
removeScope: z.string().
|
|
88
|
+
removeScope: z.string().default("").meta({ description: "Remove common workspace scope" }),
|
|
89
89
|
templates: templatesSchema.optional().default(defaultTemplates).describe("Handlebars templates used to fuel list and table generation"),
|
|
90
|
-
tocHeading: z.string().
|
|
91
|
-
usageFile: z.string().
|
|
92
|
-
usageHeading: z.string().
|
|
90
|
+
tocHeading: z.string().default("Table of contents").meta({ description: "Markdown heading used to generate table of contents" }),
|
|
91
|
+
usageFile: z.string().default("").meta({ description: "Workspace level usage file" }),
|
|
92
|
+
usageHeading: z.string().default("Usage").meta({ description: "Markdown heading used to generate usage example" }),
|
|
93
93
|
verbose: z.boolean().default(false).meta({
|
|
94
94
|
alias: "v",
|
|
95
95
|
description: "whether or not to display verbose logging"
|
package/config/schema.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"affectedRegexes":{"default":[],"type":"array","items":{"type":"string"}},"collapseHeadings":{"default":[],"type":"array","items":{"type":"string"}},"defaultLanguage":{"alias":"l","description":"Default language to infer projects from","default":"JS","type":"string","enum":["JS","RS"]},"disableEmojis":{"alias":"e","description":"Whether or not to use emojis in markdown table headings","default":false,"type":"boolean"},"disableMarkdownHeadings":{"description":"Whether or not to display markdown headings","default":false,"type":"boolean"},"enablePrettier":{"description":"Whether or not to use prettier to format the files","default":true,"type":"boolean"},"enableToc":{"alias":"t","description":"generate table of contents for readmes","default":false,"type":"boolean"},"enableUsage":{"description":"Whether or not to enable usage plugin","default":false,"type":"boolean"},"headings":{"description":"List of headings for different table outputs","default":{"ACTION":["name","required","default","description"],"PKG":["name","version","devDependency"],"USAGE":[],"WORKSPACE":["name","version","downloads","description"],"ZOD":[]},"type":"object","propertyNames":{"description":"Comment action options","type":"string","enum":["ACTION","PKG","USAGE","WORKSPACE","ZOD"]},"additionalProperties":{"type":"array","items":{"description":"Table heading options","type":"string","enum":["default","description","devDependency","downloads","name","private","required","version"]}}},"onlyReadmes":{"alias":"r","description":"Whether or not to only traverse readmes","default":true,"type":"boolean"},"onlyShowPublicPackages":{"alias":"p","description":"Only show public packages in workspaces","default":false,"type":"boolean"},"removeScope":{"description":"Remove common workspace scope","default":"","type":"string"},"templates":{"description":"Handlebars templates used to fuel list and table generation","default":{"downloadImage":"https://img.shields.io/npm/dw/{{name}}?labelColor=211F1F","emojis":{"default":"⚙️","description":"📝","devDependency":"💻","downloads":"📥","name":"🏷️","private":"🔒","required":"","version":""},"registryUrl":"https://www.npmjs.com/package/{{name}}","versionImage":"https://img.shields.io/npm/v/{{uri_name}}?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F"},"type":"object","properties":{"downloadImage":{"default":"https://img.shields.io/npm/dw/{{name}}?labelColor=211F1F","type":"string"},"emojis":{"default":{"default":"⚙️","description":"📝","devDependency":"💻","downloads":"📥","name":"🏷️","private":"🔒","required":"","version":""},"
|
|
1
|
+
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"affectedRegexes":{"default":[],"type":"array","items":{"type":"string"}},"collapseHeadings":{"default":[],"type":"array","items":{"type":"string"}},"defaultLanguage":{"alias":"l","description":"Default language to infer projects from","default":"JS","type":"string","enum":["JS","RS"]},"disableEmojis":{"alias":"e","description":"Whether or not to use emojis in markdown table headings","default":false,"type":"boolean"},"disableMarkdownHeadings":{"description":"Whether or not to display markdown headings","default":false,"type":"boolean"},"enablePrettier":{"description":"Whether or not to use prettier to format the files","default":true,"type":"boolean"},"enableToc":{"alias":"t","description":"generate table of contents for readmes","default":false,"type":"boolean"},"enableUsage":{"description":"Whether or not to enable usage plugin","default":false,"type":"boolean"},"headings":{"description":"List of headings for different table outputs","default":{"ACTION":["name","required","default","description"],"PKG":["name","version","devDependency"],"USAGE":[],"WORKSPACE":["name","version","downloads","description"],"ZOD":[]},"type":"object","propertyNames":{"description":"Comment action options","type":"string","enum":["ACTION","PKG","USAGE","WORKSPACE","ZOD"]},"additionalProperties":{"type":"array","items":{"description":"Table heading options","type":"string","enum":["default","description","devDependency","downloads","name","private","required","version"]}}},"onlyReadmes":{"alias":"r","description":"Whether or not to only traverse readmes","default":true,"type":"boolean"},"onlyShowPublicPackages":{"alias":"p","description":"Only show public packages in workspaces","default":false,"type":"boolean"},"removeScope":{"description":"Remove common workspace scope","default":"","type":"string"},"templates":{"description":"Handlebars templates used to fuel list and table generation","default":{"downloadImage":"https://img.shields.io/npm/dw/{{name}}?labelColor=211F1F","emojis":{"default":"⚙️","description":"📝","devDependency":"💻","downloads":"📥","name":"🏷️","private":"🔒","required":"","version":""},"registryUrl":"https://www.npmjs.com/package/{{name}}","versionImage":"https://img.shields.io/npm/v/{{uri_name}}?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F"},"type":"object","properties":{"downloadImage":{"default":"https://img.shields.io/npm/dw/{{name}}?labelColor=211F1F","type":"string"},"emojis":{"description":"Table heading emojis used when enabled","default":{"default":"⚙️","description":"📝","devDependency":"💻","downloads":"📥","name":"🏷️","private":"🔒","required":"","version":""},"type":"object","propertyNames":{"description":"Table heading options","type":"string","enum":["default","description","devDependency","downloads","name","private","required","version"]},"additionalProperties":{"type":"string"}},"registryUrl":{"default":"https://www.npmjs.com/package/{{name}}","type":"string"},"versionImage":{"default":"https://img.shields.io/npm/v/{{uri_name}}?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F","type":"string"}},"required":["downloadImage","emojis","registryUrl","versionImage"],"additionalProperties":false},"tocHeading":{"description":"Markdown heading used to generate table of contents","default":"Table of contents","type":"string"},"usageFile":{"description":"Workspace level usage file","default":"","type":"string"},"usageHeading":{"description":"Markdown heading used to generate usage example","default":"Usage","type":"string"},"verbose":{"alias":"v","description":"whether or not to display verbose logging","default":false,"type":"boolean"}},"required":["affectedRegexes","collapseHeadings","defaultLanguage","disableEmojis","disableMarkdownHeadings","enablePrettier","enableToc","enableUsage","headings","onlyReadmes","onlyShowPublicPackages","removeScope","templates","tocHeading","usageFile","usageHeading","verbose"],"additionalProperties":false}
|
package/dist/index.cjs
CHANGED
|
@@ -79,16 +79,16 @@ let mdast_zone = require("mdast-zone");
|
|
|
79
79
|
mdast_zone = __toESM(mdast_zone);
|
|
80
80
|
|
|
81
81
|
//#region src/schema.ts
|
|
82
|
-
const actionsSchema = zod.
|
|
82
|
+
const actionsSchema = zod.enum([
|
|
83
83
|
"ACTION",
|
|
84
84
|
"PKG",
|
|
85
85
|
"USAGE",
|
|
86
86
|
"WORKSPACE",
|
|
87
87
|
"ZOD"
|
|
88
|
-
]).
|
|
89
|
-
const formatsSchema = zod.
|
|
90
|
-
const languageSchema = zod.
|
|
91
|
-
const headingsSchema = zod.
|
|
88
|
+
]).meta({ description: "Comment action options" });
|
|
89
|
+
const formatsSchema = zod.enum(["LIST", "TABLE"]).default("TABLE");
|
|
90
|
+
const languageSchema = zod.enum(["JS", "RS"]).default("JS");
|
|
91
|
+
const headingsSchema = zod.enum([
|
|
92
92
|
"default",
|
|
93
93
|
"description",
|
|
94
94
|
"devDependency",
|
|
@@ -97,8 +97,8 @@ const headingsSchema = zod.z.enum([
|
|
|
97
97
|
"private",
|
|
98
98
|
"required",
|
|
99
99
|
"version"
|
|
100
|
-
]).
|
|
101
|
-
const tableHeadingsSchema = zod.
|
|
100
|
+
]).meta({ description: "Table heading options" });
|
|
101
|
+
const tableHeadingsSchema = zod.record(actionsSchema, headingsSchema.array().optional()).default({
|
|
102
102
|
ACTION: [
|
|
103
103
|
"name",
|
|
104
104
|
"required",
|
|
@@ -118,10 +118,10 @@ const tableHeadingsSchema = zod.z.record(actionsSchema, headingsSchema.array().o
|
|
|
118
118
|
"description"
|
|
119
119
|
],
|
|
120
120
|
ZOD: []
|
|
121
|
-
});
|
|
122
|
-
const templatesSchema = zod.
|
|
123
|
-
downloadImage: zod.
|
|
124
|
-
emojis: zod.
|
|
121
|
+
}).meta({ description: "Table heading action configuration" });
|
|
122
|
+
const templatesSchema = zod.object({
|
|
123
|
+
downloadImage: zod.string().default("https://img.shields.io/npm/dw/{{name}}?labelColor=211F1F"),
|
|
124
|
+
emojis: zod.record(headingsSchema, zod.string()).default({
|
|
125
125
|
default: "⚙️",
|
|
126
126
|
description: "📝",
|
|
127
127
|
devDependency: "💻",
|
|
@@ -130,45 +130,45 @@ const templatesSchema = zod.z.object({
|
|
|
130
130
|
private: "🔒",
|
|
131
131
|
required: "",
|
|
132
132
|
version: ""
|
|
133
|
-
}),
|
|
134
|
-
registryUrl: zod.
|
|
135
|
-
versionImage: zod.
|
|
133
|
+
}).meta({ description: "Table heading emojis used when enabled" }),
|
|
134
|
+
registryUrl: zod.string().default("https://www.npmjs.com/package/{{name}}"),
|
|
135
|
+
versionImage: zod.string().default("https://img.shields.io/npm/v/{{uri_name}}?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F")
|
|
136
136
|
});
|
|
137
137
|
const defaultTemplates = templatesSchema.parse({});
|
|
138
138
|
const defaultTableHeadings = tableHeadingsSchema.parse(void 0);
|
|
139
|
-
const _configSchema = zod.
|
|
140
|
-
affectedRegexes: zod.
|
|
141
|
-
collapseHeadings: zod.
|
|
139
|
+
const _configSchema = zod.object({
|
|
140
|
+
affectedRegexes: zod.string().array().default([]),
|
|
141
|
+
collapseHeadings: zod.string().array().default([]),
|
|
142
142
|
defaultLanguage: languageSchema.meta({
|
|
143
143
|
alias: "l",
|
|
144
144
|
description: "Default language to infer projects from"
|
|
145
145
|
}),
|
|
146
|
-
disableEmojis: zod.
|
|
146
|
+
disableEmojis: zod.boolean().default(false).meta({
|
|
147
147
|
alias: "e",
|
|
148
148
|
description: "Whether or not to use emojis in markdown table headings"
|
|
149
149
|
}),
|
|
150
|
-
disableMarkdownHeadings: zod.
|
|
151
|
-
enablePrettier: zod.
|
|
152
|
-
enableToc: zod.
|
|
150
|
+
disableMarkdownHeadings: zod.boolean().default(false).meta({ description: "Whether or not to display markdown headings" }),
|
|
151
|
+
enablePrettier: zod.boolean().default(true).meta({ description: "Whether or not to use prettier to format the files" }),
|
|
152
|
+
enableToc: zod.boolean().default(false).meta({
|
|
153
153
|
alias: "t",
|
|
154
154
|
description: "generate table of contents for readmes"
|
|
155
155
|
}),
|
|
156
|
-
enableUsage: zod.
|
|
156
|
+
enableUsage: zod.boolean().default(false).meta({ description: "Whether or not to enable usage plugin" }),
|
|
157
157
|
headings: tableHeadingsSchema.optional().default(defaultTableHeadings).describe("List of headings for different table outputs"),
|
|
158
|
-
onlyReadmes: zod.
|
|
158
|
+
onlyReadmes: zod.boolean().default(true).meta({
|
|
159
159
|
alias: "r",
|
|
160
160
|
description: "Whether or not to only traverse readmes"
|
|
161
161
|
}),
|
|
162
|
-
onlyShowPublicPackages: zod.
|
|
162
|
+
onlyShowPublicPackages: zod.boolean().default(false).meta({
|
|
163
163
|
alias: "p",
|
|
164
164
|
description: "Only show public packages in workspaces"
|
|
165
165
|
}),
|
|
166
|
-
removeScope: zod.
|
|
166
|
+
removeScope: zod.string().default("").meta({ description: "Remove common workspace scope" }),
|
|
167
167
|
templates: templatesSchema.optional().default(defaultTemplates).describe("Handlebars templates used to fuel list and table generation"),
|
|
168
|
-
tocHeading: zod.
|
|
169
|
-
usageFile: zod.
|
|
170
|
-
usageHeading: zod.
|
|
171
|
-
verbose: zod.
|
|
168
|
+
tocHeading: zod.string().default("Table of contents").meta({ description: "Markdown heading used to generate table of contents" }),
|
|
169
|
+
usageFile: zod.string().default("").meta({ description: "Workspace level usage file" }),
|
|
170
|
+
usageHeading: zod.string().default("Usage").meta({ description: "Markdown heading used to generate usage example" }),
|
|
171
|
+
verbose: zod.boolean().default(false).meta({
|
|
172
172
|
alias: "v",
|
|
173
173
|
description: "whether or not to display verbose logging"
|
|
174
174
|
})
|
|
@@ -213,12 +213,12 @@ function zodToYargs() {
|
|
|
213
213
|
const { shape } = configSchema.unwrap();
|
|
214
214
|
const entries = Object.entries(shape).map(([key, value]) => {
|
|
215
215
|
if (complexOptions.includes(key)) return [];
|
|
216
|
-
if (value.def.innerType instanceof zod.
|
|
216
|
+
if (value.def.innerType instanceof zod.ZodObject) return [];
|
|
217
217
|
const meta = value.meta();
|
|
218
218
|
const { innerType } = value.def;
|
|
219
|
-
const isBoolean = innerType instanceof zod.
|
|
220
|
-
const isNumber = innerType instanceof zod.
|
|
221
|
-
const yargType = innerType instanceof zod.
|
|
219
|
+
const isBoolean = innerType instanceof zod.ZodBoolean;
|
|
220
|
+
const isNumber = innerType instanceof zod.ZodNumber;
|
|
221
|
+
const yargType = innerType instanceof zod.ZodArray && "array" || isNumber && "number" || isBoolean && "boolean" || "string";
|
|
222
222
|
const options = {
|
|
223
223
|
default: value.def.defaultValue,
|
|
224
224
|
type: yargType
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import ora from "ora";
|
|
|
5
5
|
import debug from "debug";
|
|
6
6
|
import yargs from "yargs";
|
|
7
7
|
import { hideBin } from "yargs/helpers";
|
|
8
|
-
import
|
|
8
|
+
import * as z from "zod";
|
|
9
9
|
import { commentMarker } from "mdast-comment-marker";
|
|
10
10
|
import toml from "@iarna/toml";
|
|
11
11
|
import { cosmiconfig, getDefaultSearchPlaces } from "cosmiconfig";
|
|
@@ -35,9 +35,9 @@ const actionsSchema = z.enum([
|
|
|
35
35
|
"USAGE",
|
|
36
36
|
"WORKSPACE",
|
|
37
37
|
"ZOD"
|
|
38
|
-
]).
|
|
39
|
-
const formatsSchema = z.enum(["LIST", "TABLE"]).default("TABLE")
|
|
40
|
-
const languageSchema = z.enum(["JS", "RS"]).
|
|
38
|
+
]).meta({ description: "Comment action options" });
|
|
39
|
+
const formatsSchema = z.enum(["LIST", "TABLE"]).default("TABLE");
|
|
40
|
+
const languageSchema = z.enum(["JS", "RS"]).default("JS");
|
|
41
41
|
const headingsSchema = z.enum([
|
|
42
42
|
"default",
|
|
43
43
|
"description",
|
|
@@ -47,8 +47,8 @@ const headingsSchema = z.enum([
|
|
|
47
47
|
"private",
|
|
48
48
|
"required",
|
|
49
49
|
"version"
|
|
50
|
-
]).
|
|
51
|
-
const tableHeadingsSchema = z.record(actionsSchema, headingsSchema.array().optional()).
|
|
50
|
+
]).meta({ description: "Table heading options" });
|
|
51
|
+
const tableHeadingsSchema = z.record(actionsSchema, headingsSchema.array().optional()).default({
|
|
52
52
|
ACTION: [
|
|
53
53
|
"name",
|
|
54
54
|
"required",
|
|
@@ -68,10 +68,10 @@ const tableHeadingsSchema = z.record(actionsSchema, headingsSchema.array().optio
|
|
|
68
68
|
"description"
|
|
69
69
|
],
|
|
70
70
|
ZOD: []
|
|
71
|
-
});
|
|
71
|
+
}).meta({ description: "Table heading action configuration" });
|
|
72
72
|
const templatesSchema = z.object({
|
|
73
|
-
downloadImage: z.string().
|
|
74
|
-
emojis: z.record(headingsSchema, z.string()).
|
|
73
|
+
downloadImage: z.string().default("https://img.shields.io/npm/dw/{{name}}?labelColor=211F1F"),
|
|
74
|
+
emojis: z.record(headingsSchema, z.string()).default({
|
|
75
75
|
default: "⚙️",
|
|
76
76
|
description: "📝",
|
|
77
77
|
devDependency: "💻",
|
|
@@ -80,15 +80,15 @@ const templatesSchema = z.object({
|
|
|
80
80
|
private: "🔒",
|
|
81
81
|
required: "",
|
|
82
82
|
version: ""
|
|
83
|
-
}),
|
|
84
|
-
registryUrl: z.string().
|
|
85
|
-
versionImage: z.string().
|
|
83
|
+
}).meta({ description: "Table heading emojis used when enabled" }),
|
|
84
|
+
registryUrl: z.string().default("https://www.npmjs.com/package/{{name}}"),
|
|
85
|
+
versionImage: z.string().default("https://img.shields.io/npm/v/{{uri_name}}?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F")
|
|
86
86
|
});
|
|
87
87
|
const defaultTemplates = templatesSchema.parse({});
|
|
88
88
|
const defaultTableHeadings = tableHeadingsSchema.parse(void 0);
|
|
89
89
|
const _configSchema = z.object({
|
|
90
|
-
affectedRegexes: z.string().array().
|
|
91
|
-
collapseHeadings: z.string().array().
|
|
90
|
+
affectedRegexes: z.string().array().default([]),
|
|
91
|
+
collapseHeadings: z.string().array().default([]),
|
|
92
92
|
defaultLanguage: languageSchema.meta({
|
|
93
93
|
alias: "l",
|
|
94
94
|
description: "Default language to infer projects from"
|
|
@@ -103,7 +103,7 @@ const _configSchema = z.object({
|
|
|
103
103
|
alias: "t",
|
|
104
104
|
description: "generate table of contents for readmes"
|
|
105
105
|
}),
|
|
106
|
-
enableUsage: z.boolean().
|
|
106
|
+
enableUsage: z.boolean().default(false).meta({ description: "Whether or not to enable usage plugin" }),
|
|
107
107
|
headings: tableHeadingsSchema.optional().default(defaultTableHeadings).describe("List of headings for different table outputs"),
|
|
108
108
|
onlyReadmes: z.boolean().default(true).meta({
|
|
109
109
|
alias: "r",
|
|
@@ -113,11 +113,11 @@ const _configSchema = z.object({
|
|
|
113
113
|
alias: "p",
|
|
114
114
|
description: "Only show public packages in workspaces"
|
|
115
115
|
}),
|
|
116
|
-
removeScope: z.string().
|
|
116
|
+
removeScope: z.string().default("").meta({ description: "Remove common workspace scope" }),
|
|
117
117
|
templates: templatesSchema.optional().default(defaultTemplates).describe("Handlebars templates used to fuel list and table generation"),
|
|
118
|
-
tocHeading: z.string().
|
|
119
|
-
usageFile: z.string().
|
|
120
|
-
usageHeading: z.string().
|
|
118
|
+
tocHeading: z.string().default("Table of contents").meta({ description: "Markdown heading used to generate table of contents" }),
|
|
119
|
+
usageFile: z.string().default("").meta({ description: "Workspace level usage file" }),
|
|
120
|
+
usageHeading: z.string().default("Usage").meta({ description: "Markdown heading used to generate usage example" }),
|
|
121
121
|
verbose: z.boolean().default(false).meta({
|
|
122
122
|
alias: "v",
|
|
123
123
|
description: "whether or not to display verbose logging"
|
|
@@ -163,12 +163,12 @@ function zodToYargs() {
|
|
|
163
163
|
const { shape } = configSchema.unwrap();
|
|
164
164
|
const entries = Object.entries(shape).map(([key, value]) => {
|
|
165
165
|
if (complexOptions.includes(key)) return [];
|
|
166
|
-
if (value.def.innerType instanceof z
|
|
166
|
+
if (value.def.innerType instanceof z.ZodObject) return [];
|
|
167
167
|
const meta = value.meta();
|
|
168
168
|
const { innerType } = value.def;
|
|
169
|
-
const isBoolean = innerType instanceof z
|
|
170
|
-
const isNumber = innerType instanceof z
|
|
171
|
-
const yargType = innerType instanceof z
|
|
169
|
+
const isBoolean = innerType instanceof z.ZodBoolean;
|
|
170
|
+
const isNumber = innerType instanceof z.ZodNumber;
|
|
171
|
+
const yargType = innerType instanceof z.ZodArray && "array" || isNumber && "number" || isBoolean && "boolean" || "string";
|
|
172
172
|
const options = {
|
|
173
173
|
default: value.def.defaultValue,
|
|
174
174
|
type: yargType
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stephansama/auto-readme",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Generate lists and tables for your README automagically based on your repository and comments",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"auto",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"./schema.json": "./config/schema.json",
|
|
40
|
-
"./
|
|
40
|
+
"./package.json": "./package.json"
|
|
41
41
|
},
|
|
42
42
|
"main": "./config/schema.js",
|
|
43
43
|
"types": "./config/schema.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@iarna/toml": "^2.2.5",
|
|
52
52
|
"@manypkg/get-packages": "^3.1.0",
|
|
53
|
-
"cosmiconfig": "
|
|
53
|
+
"cosmiconfig": "9.0.0",
|
|
54
54
|
"debug": "^4.4.3",
|
|
55
55
|
"deepmerge": "^4.3.1",
|
|
56
56
|
"fast-glob": "^3.3.3",
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"remark-usage": "^11.0.1",
|
|
69
69
|
"vfile": "^6.0.3",
|
|
70
70
|
"yaml": "^2.8.1",
|
|
71
|
-
"yargs": "
|
|
72
|
-
"zod": "4.
|
|
71
|
+
"yargs": "18.0.0",
|
|
72
|
+
"zod": "4.2.1",
|
|
73
73
|
"zod2md": "^0.2.4"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
package/config/schema.yaml
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
$schema: https://json-schema.org/draft/2020-12/schema
|
|
2
|
-
type: object
|
|
3
|
-
properties:
|
|
4
|
-
affectedRegexes:
|
|
5
|
-
default: []
|
|
6
|
-
type: array
|
|
7
|
-
items:
|
|
8
|
-
type: string
|
|
9
|
-
collapseHeadings:
|
|
10
|
-
default: []
|
|
11
|
-
type: array
|
|
12
|
-
items:
|
|
13
|
-
type: string
|
|
14
|
-
defaultLanguage:
|
|
15
|
-
alias: l
|
|
16
|
-
description: Default language to infer projects from
|
|
17
|
-
default: JS
|
|
18
|
-
type: string
|
|
19
|
-
enum:
|
|
20
|
-
- JS
|
|
21
|
-
- RS
|
|
22
|
-
disableEmojis:
|
|
23
|
-
alias: e
|
|
24
|
-
description: Whether or not to use emojis in markdown table headings
|
|
25
|
-
default: false
|
|
26
|
-
type: boolean
|
|
27
|
-
disableMarkdownHeadings:
|
|
28
|
-
description: Whether or not to display markdown headings
|
|
29
|
-
default: false
|
|
30
|
-
type: boolean
|
|
31
|
-
enablePrettier:
|
|
32
|
-
description: Whether or not to use prettier to format the files
|
|
33
|
-
default: true
|
|
34
|
-
type: boolean
|
|
35
|
-
enableToc:
|
|
36
|
-
alias: t
|
|
37
|
-
description: generate table of contents for readmes
|
|
38
|
-
default: false
|
|
39
|
-
type: boolean
|
|
40
|
-
enableUsage:
|
|
41
|
-
description: Whether or not to enable usage plugin
|
|
42
|
-
default: false
|
|
43
|
-
type: boolean
|
|
44
|
-
headings:
|
|
45
|
-
description: List of headings for different table outputs
|
|
46
|
-
default:
|
|
47
|
-
ACTION:
|
|
48
|
-
- name
|
|
49
|
-
- required
|
|
50
|
-
- default
|
|
51
|
-
- description
|
|
52
|
-
PKG:
|
|
53
|
-
- name
|
|
54
|
-
- version
|
|
55
|
-
- devDependency
|
|
56
|
-
USAGE: []
|
|
57
|
-
WORKSPACE:
|
|
58
|
-
- name
|
|
59
|
-
- version
|
|
60
|
-
- downloads
|
|
61
|
-
- description
|
|
62
|
-
ZOD: []
|
|
63
|
-
type: object
|
|
64
|
-
propertyNames:
|
|
65
|
-
description: Comment action options
|
|
66
|
-
type: string
|
|
67
|
-
enum:
|
|
68
|
-
- ACTION
|
|
69
|
-
- PKG
|
|
70
|
-
- USAGE
|
|
71
|
-
- WORKSPACE
|
|
72
|
-
- ZOD
|
|
73
|
-
additionalProperties:
|
|
74
|
-
type: array
|
|
75
|
-
items:
|
|
76
|
-
description: Table heading options
|
|
77
|
-
type: string
|
|
78
|
-
enum:
|
|
79
|
-
- default
|
|
80
|
-
- description
|
|
81
|
-
- devDependency
|
|
82
|
-
- downloads
|
|
83
|
-
- name
|
|
84
|
-
- private
|
|
85
|
-
- required
|
|
86
|
-
- version
|
|
87
|
-
onlyReadmes:
|
|
88
|
-
alias: r
|
|
89
|
-
description: Whether or not to only traverse readmes
|
|
90
|
-
default: true
|
|
91
|
-
type: boolean
|
|
92
|
-
onlyShowPublicPackages:
|
|
93
|
-
alias: p
|
|
94
|
-
description: Only show public packages in workspaces
|
|
95
|
-
default: false
|
|
96
|
-
type: boolean
|
|
97
|
-
removeScope:
|
|
98
|
-
description: Remove common workspace scope
|
|
99
|
-
default: ""
|
|
100
|
-
type: string
|
|
101
|
-
templates:
|
|
102
|
-
description: Handlebars templates used to fuel list and table generation
|
|
103
|
-
default:
|
|
104
|
-
downloadImage: https://img.shields.io/npm/dw/{{name}}?labelColor=211F1F
|
|
105
|
-
emojis:
|
|
106
|
-
default: ⚙️
|
|
107
|
-
description: 📝
|
|
108
|
-
devDependency: 💻
|
|
109
|
-
downloads: 📥
|
|
110
|
-
name: 🏷️
|
|
111
|
-
private: 🔒
|
|
112
|
-
required: ""
|
|
113
|
-
version: ""
|
|
114
|
-
registryUrl: https://www.npmjs.com/package/{{name}}
|
|
115
|
-
versionImage: https://img.shields.io/npm/v/{{uri_name}}?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F
|
|
116
|
-
type: object
|
|
117
|
-
properties:
|
|
118
|
-
downloadImage:
|
|
119
|
-
default: https://img.shields.io/npm/dw/{{name}}?labelColor=211F1F
|
|
120
|
-
type: string
|
|
121
|
-
emojis:
|
|
122
|
-
default:
|
|
123
|
-
default: ⚙️
|
|
124
|
-
description: 📝
|
|
125
|
-
devDependency: 💻
|
|
126
|
-
downloads: 📥
|
|
127
|
-
name: 🏷️
|
|
128
|
-
private: 🔒
|
|
129
|
-
required: ""
|
|
130
|
-
version: ""
|
|
131
|
-
description: Table heading emojis used when enabled
|
|
132
|
-
type: object
|
|
133
|
-
propertyNames:
|
|
134
|
-
description: Table heading options
|
|
135
|
-
type: string
|
|
136
|
-
enum:
|
|
137
|
-
- default
|
|
138
|
-
- description
|
|
139
|
-
- devDependency
|
|
140
|
-
- downloads
|
|
141
|
-
- name
|
|
142
|
-
- private
|
|
143
|
-
- required
|
|
144
|
-
- version
|
|
145
|
-
additionalProperties:
|
|
146
|
-
type: string
|
|
147
|
-
registryUrl:
|
|
148
|
-
default: https://www.npmjs.com/package/{{name}}
|
|
149
|
-
type: string
|
|
150
|
-
versionImage:
|
|
151
|
-
default: https://img.shields.io/npm/v/{{uri_name}}?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F
|
|
152
|
-
type: string
|
|
153
|
-
required:
|
|
154
|
-
- downloadImage
|
|
155
|
-
- emojis
|
|
156
|
-
- registryUrl
|
|
157
|
-
- versionImage
|
|
158
|
-
additionalProperties: false
|
|
159
|
-
tocHeading:
|
|
160
|
-
description: Markdown heading used to generate table of contents
|
|
161
|
-
default: Table of contents
|
|
162
|
-
type: string
|
|
163
|
-
usageFile:
|
|
164
|
-
description: Workspace level usage file
|
|
165
|
-
default: ""
|
|
166
|
-
type: string
|
|
167
|
-
usageHeading:
|
|
168
|
-
description: Markdown heading used to generate usage example
|
|
169
|
-
default: Usage
|
|
170
|
-
type: string
|
|
171
|
-
verbose:
|
|
172
|
-
alias: v
|
|
173
|
-
description: whether or not to display verbose logging
|
|
174
|
-
default: false
|
|
175
|
-
type: boolean
|
|
176
|
-
required:
|
|
177
|
-
- affectedRegexes
|
|
178
|
-
- collapseHeadings
|
|
179
|
-
- defaultLanguage
|
|
180
|
-
- disableEmojis
|
|
181
|
-
- disableMarkdownHeadings
|
|
182
|
-
- enablePrettier
|
|
183
|
-
- enableToc
|
|
184
|
-
- enableUsage
|
|
185
|
-
- headings
|
|
186
|
-
- onlyReadmes
|
|
187
|
-
- onlyShowPublicPackages
|
|
188
|
-
- removeScope
|
|
189
|
-
- templates
|
|
190
|
-
- tocHeading
|
|
191
|
-
- usageFile
|
|
192
|
-
- usageHeading
|
|
193
|
-
- verbose
|
|
194
|
-
additionalProperties: false
|