@stephansama/auto-readme 0.2.1 → 0.2.3
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 +19 -59
- package/config/schema.cjs +119 -128
- package/config/schema.d.cts +94 -135
- package/config/schema.d.ts +94 -135
- package/config/schema.js +96 -101
- package/config/schema.json +1 -1
- package/config/schema.yaml +1 -0
- package/dist/index.cjs +604 -664
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +559 -634
- package/package.json +26 -27
- package/config/schema.cjs.map +0 -1
- package/config/schema.js.map +0 -1
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -180,25 +180,25 @@ _Enum, one of the following possible values:_
|
|
|
180
180
|
|
|
181
181
|
_Object containing the following properties:_
|
|
182
182
|
|
|
183
|
-
| Property | Description | Type
|
|
184
|
-
| :------------------------ | :---------------------------------------------------------- |
|
|
185
|
-
| `affectedRegexes` | | `Array<string>`
|
|
186
|
-
| `collapseHeadings` | | `Array<string>`
|
|
187
|
-
| `defaultLanguage` | Default language to infer projects from | [Language](#language)
|
|
188
|
-
| `disableEmojis` | Whether or not to use emojis in markdown table headings | `boolean`
|
|
189
|
-
| `disableMarkdownHeadings` | Whether or not to display markdown headings | `boolean`
|
|
190
|
-
| `enablePrettier` | Whether or not to use prettier to format the files | `boolean`
|
|
191
|
-
| `enableToc` | generate table of contents for readmes | `boolean`
|
|
192
|
-
| `enableUsage` | Whether or not to enable usage plugin | `boolean`
|
|
193
|
-
| `headings` | List of headings for different table outputs | _Object with dynamic keys of type_ [Actions](#actions) _and values of type_
|
|
194
|
-
| `onlyReadmes` | Whether or not to only traverse readmes | `boolean`
|
|
195
|
-
| `onlyShowPublicPackages` | Only show public packages in workspaces | `boolean`
|
|
196
|
-
| `removeScope` | Remove common workspace scope | `string`
|
|
197
|
-
| `templates` | Handlebars templates used to fuel list and table generation | _Object with properties:_<ul><li>`downloadImage`: `string`</li><li>`emojis`:
|
|
198
|
-
| `tocHeading` | Markdown heading used to generate table of contents | `string`
|
|
199
|
-
| `usageFile` | Workspace level usage file | `string`
|
|
200
|
-
| `usageHeading` | Markdown heading used to generate usage example | `string`
|
|
201
|
-
| `verbose` | whether or not to display verbose logging | `boolean`
|
|
183
|
+
| Property | Description | Type | Default |
|
|
184
|
+
| :------------------------ | :---------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
185
|
+
| `affectedRegexes` | | `Array<string>` | `[]` |
|
|
186
|
+
| `collapseHeadings` | | `Array<string>` | `[]` |
|
|
187
|
+
| `defaultLanguage` | Default language to infer projects from | [Language](#language) | |
|
|
188
|
+
| `disableEmojis` | Whether or not to use emojis in markdown table headings | `boolean` | `false` |
|
|
189
|
+
| `disableMarkdownHeadings` | Whether or not to display markdown headings | `boolean` | `false` |
|
|
190
|
+
| `enablePrettier` | Whether or not to use prettier to format the files | `boolean` | `true` |
|
|
191
|
+
| `enableToc` | generate table of contents for readmes | `boolean` | `false` |
|
|
192
|
+
| `enableUsage` | Whether or not to enable usage plugin | `boolean` | `false` |
|
|
193
|
+
| `headings` | List of headings for different table outputs | _Object with dynamic keys of type_ [Actions](#actions) _and values of type_ `Array<'default' \| 'description' \| 'devDependency' \| 'downloads' \| 'name' \| 'private' \| 'required' \| 'version'>` (_optional_) | `{"ACTION":["name","required","default","description"],"PKG":["name","version","devDependency"],"USAGE":[],"WORKSPACE":["name","version","downloads","description"],"ZOD":[]}` |
|
|
194
|
+
| `onlyReadmes` | Whether or not to only traverse readmes | `boolean` | `true` |
|
|
195
|
+
| `onlyShowPublicPackages` | Only show public packages in workspaces | `boolean` | `false` |
|
|
196
|
+
| `removeScope` | Remove common workspace scope | `string` | `''` |
|
|
197
|
+
| `templates` | Handlebars templates used to fuel list and table generation | _Object with properties:_<ul><li>`downloadImage`: `string`</li><li>`emojis`: `Record<'default' \| 'description' \| 'devDependency' \| 'downloads' \| 'name' \| 'private' \| 'required' \| 'version', string>` - Table heading emojis used when enabled</li><li>`registryUrl`: `string`</li><li>`versionImage`: `string`</li></ul> | `{"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"}` |
|
|
198
|
+
| `tocHeading` | Markdown heading used to generate table of contents | `string` | `'Table of contents'` |
|
|
199
|
+
| `usageFile` | Workspace level usage file | `string` | `''` |
|
|
200
|
+
| `usageHeading` | Markdown heading used to generate usage example | `string` | `'Usage'` |
|
|
201
|
+
| `verbose` | whether or not to display verbose logging | `boolean` | `false` |
|
|
202
202
|
|
|
203
203
|
_All properties are optional._ (_optional_)
|
|
204
204
|
|
|
@@ -212,21 +212,6 @@ _Enum, one of the following possible values:_
|
|
|
212
212
|
|
|
213
213
|
_Default value:_ `'TABLE'`
|
|
214
214
|
|
|
215
|
-
## Headings
|
|
216
|
-
|
|
217
|
-
Table heading options
|
|
218
|
-
|
|
219
|
-
_Enum, one of the following possible values:_
|
|
220
|
-
|
|
221
|
-
- `'default'`
|
|
222
|
-
- `'description'`
|
|
223
|
-
- `'devDependency'`
|
|
224
|
-
- `'downloads'`
|
|
225
|
-
- `'name'`
|
|
226
|
-
- `'private'`
|
|
227
|
-
- `'required'`
|
|
228
|
-
- `'version'`
|
|
229
|
-
|
|
230
215
|
## Language
|
|
231
216
|
|
|
232
217
|
_Enum, one of the following possible values:_
|
|
@@ -237,29 +222,4 @@ _Enum, one of the following possible values:_
|
|
|
237
222
|
|
|
238
223
|
_Default value:_ `'JS'`
|
|
239
224
|
|
|
240
|
-
## TableHeadings
|
|
241
|
-
|
|
242
|
-
Table heading action configuration
|
|
243
|
-
|
|
244
|
-
_Object record with dynamic keys:_
|
|
245
|
-
|
|
246
|
-
- _keys of type_ [Actions](#actions)
|
|
247
|
-
- _values of type_ _Array of [Headings](#headings) items_ (_optional_)
|
|
248
|
-
(_optional_)
|
|
249
|
-
|
|
250
|
-
_Default value:_ `{"ACTION":["name","required","default","description"],"PKG":["name","version","devDependency"],"WORKSPACE":["name","version","downloads","description"],"ZOD":[]}`
|
|
251
|
-
|
|
252
|
-
## Templates
|
|
253
|
-
|
|
254
|
-
_Object containing the following properties:_
|
|
255
|
-
|
|
256
|
-
| Property | Description | Type | Default |
|
|
257
|
-
| :-------------- | :------------------------------------- | :------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------- |
|
|
258
|
-
| `downloadImage` | | `string` | `'https://img.shields.io/npm/dw/{{name}}?labelColor=211F1F'` |
|
|
259
|
-
| `emojis` | Table heading emojis used when enabled | _Object with dynamic keys of type_ [Headings](#headings) _and values of type_ `string` | `{"default":"⚙️","description":"📝","devDependency":"💻","downloads":"📥","name":"🏷️","private":"🔒","required":"","version":""}` |
|
|
260
|
-
| `registryUrl` | | `string` | `'https://www.npmjs.com/package/{{name}}'` |
|
|
261
|
-
| `versionImage` | | `string` | `'https://img.shields.io/npm/v/{{uri_name}}?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F'` |
|
|
262
|
-
|
|
263
|
-
_All properties are optional._
|
|
264
|
-
|
|
265
225
|
<!-- ZOD end -->
|
package/config/schema.cjs
CHANGED
|
@@ -1,139 +1,130 @@
|
|
|
1
|
-
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
8
|
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
17
|
};
|
|
18
|
-
var
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
19
22
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"name",
|
|
44
|
-
"private",
|
|
45
|
-
"required",
|
|
46
|
-
"version"
|
|
23
|
+
//#endregion
|
|
24
|
+
let zod = require("zod");
|
|
25
|
+
zod = __toESM(zod);
|
|
26
|
+
|
|
27
|
+
//#region src/schema.ts
|
|
28
|
+
const actionsSchema = zod.z.enum([
|
|
29
|
+
"ACTION",
|
|
30
|
+
"PKG",
|
|
31
|
+
"USAGE",
|
|
32
|
+
"WORKSPACE",
|
|
33
|
+
"ZOD"
|
|
34
|
+
]).describe("Comment action options");
|
|
35
|
+
const formatsSchema = zod.z.enum(["LIST", "TABLE"]).default("TABLE").optional();
|
|
36
|
+
const languageSchema = zod.z.enum(["JS", "RS"]).optional().default("JS");
|
|
37
|
+
const headingsSchema = zod.z.enum([
|
|
38
|
+
"default",
|
|
39
|
+
"description",
|
|
40
|
+
"devDependency",
|
|
41
|
+
"downloads",
|
|
42
|
+
"name",
|
|
43
|
+
"private",
|
|
44
|
+
"required",
|
|
45
|
+
"version"
|
|
47
46
|
]).describe("Table heading options");
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
const tableHeadingsSchema = zod.z.record(actionsSchema, headingsSchema.array().optional()).optional().describe("Table heading action configuration").default({
|
|
48
|
+
ACTION: [
|
|
49
|
+
"name",
|
|
50
|
+
"required",
|
|
51
|
+
"default",
|
|
52
|
+
"description"
|
|
53
|
+
],
|
|
54
|
+
PKG: [
|
|
55
|
+
"name",
|
|
56
|
+
"version",
|
|
57
|
+
"devDependency"
|
|
58
|
+
],
|
|
59
|
+
USAGE: [],
|
|
60
|
+
WORKSPACE: [
|
|
61
|
+
"name",
|
|
62
|
+
"version",
|
|
63
|
+
"downloads",
|
|
64
|
+
"description"
|
|
65
|
+
],
|
|
66
|
+
ZOD: []
|
|
53
67
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"https://img.shields.io/npm/v/{{uri_name}}?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F"
|
|
69
|
-
)
|
|
68
|
+
const templatesSchema = zod.z.object({
|
|
69
|
+
downloadImage: zod.z.string().optional().default("https://img.shields.io/npm/dw/{{name}}?labelColor=211F1F"),
|
|
70
|
+
emojis: zod.z.record(headingsSchema, zod.z.string()).optional().describe("Table heading emojis used when enabled").default({
|
|
71
|
+
default: "⚙️",
|
|
72
|
+
description: "📝",
|
|
73
|
+
devDependency: "💻",
|
|
74
|
+
downloads: "📥",
|
|
75
|
+
name: "🏷️",
|
|
76
|
+
private: "🔒",
|
|
77
|
+
required: "",
|
|
78
|
+
version: ""
|
|
79
|
+
}),
|
|
80
|
+
registryUrl: zod.z.string().optional().default("https://www.npmjs.com/package/{{name}}"),
|
|
81
|
+
versionImage: zod.z.string().optional().default("https://img.shields.io/npm/v/{{uri_name}}?logo=npm&logoColor=red&color=211F1F&labelColor=211F1F")
|
|
70
82
|
});
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
templates: templatesSchema.optional().default(defaultTemplates).describe(
|
|
110
|
-
"Handlebars templates used to fuel list and table generation"
|
|
111
|
-
),
|
|
112
|
-
tocHeading: import_zod.z.string().optional().default("Table of contents").meta({
|
|
113
|
-
description: "Markdown heading used to generate table of contents"
|
|
114
|
-
}),
|
|
115
|
-
usageFile: import_zod.z.string().optional().default("").meta({
|
|
116
|
-
description: "Workspace level usage file"
|
|
117
|
-
}),
|
|
118
|
-
usageHeading: import_zod.z.string().optional().default("Usage").meta({
|
|
119
|
-
description: "Markdown heading used to generate usage example"
|
|
120
|
-
}),
|
|
121
|
-
verbose: import_zod.z.boolean().default(false).meta({
|
|
122
|
-
alias: "v",
|
|
123
|
-
description: "whether or not to display verbose logging"
|
|
124
|
-
})
|
|
83
|
+
const defaultTemplates = templatesSchema.parse({});
|
|
84
|
+
const defaultTableHeadings = tableHeadingsSchema.parse(void 0);
|
|
85
|
+
const _configSchema = zod.z.object({
|
|
86
|
+
affectedRegexes: zod.z.string().array().optional().default([]),
|
|
87
|
+
collapseHeadings: zod.z.string().array().optional().default([]),
|
|
88
|
+
defaultLanguage: languageSchema.meta({
|
|
89
|
+
alias: "l",
|
|
90
|
+
description: "Default language to infer projects from"
|
|
91
|
+
}),
|
|
92
|
+
disableEmojis: zod.z.boolean().default(false).meta({
|
|
93
|
+
alias: "e",
|
|
94
|
+
description: "Whether or not to use emojis in markdown table headings"
|
|
95
|
+
}),
|
|
96
|
+
disableMarkdownHeadings: zod.z.boolean().default(false).meta({ description: "Whether or not to display markdown headings" }),
|
|
97
|
+
enablePrettier: zod.z.boolean().default(true).meta({ description: "Whether or not to use prettier to format the files" }),
|
|
98
|
+
enableToc: zod.z.boolean().default(false).meta({
|
|
99
|
+
alias: "t",
|
|
100
|
+
description: "generate table of contents for readmes"
|
|
101
|
+
}),
|
|
102
|
+
enableUsage: zod.z.boolean().optional().default(false).meta({ description: "Whether or not to enable usage plugin" }),
|
|
103
|
+
headings: tableHeadingsSchema.optional().default(defaultTableHeadings).describe("List of headings for different table outputs"),
|
|
104
|
+
onlyReadmes: zod.z.boolean().default(true).meta({
|
|
105
|
+
alias: "r",
|
|
106
|
+
description: "Whether or not to only traverse readmes"
|
|
107
|
+
}),
|
|
108
|
+
onlyShowPublicPackages: zod.z.boolean().default(false).meta({
|
|
109
|
+
alias: "p",
|
|
110
|
+
description: "Only show public packages in workspaces"
|
|
111
|
+
}),
|
|
112
|
+
removeScope: zod.z.string().optional().default("").meta({ description: "Remove common workspace scope" }),
|
|
113
|
+
templates: templatesSchema.optional().default(defaultTemplates).describe("Handlebars templates used to fuel list and table generation"),
|
|
114
|
+
tocHeading: zod.z.string().optional().default("Table of contents").meta({ description: "Markdown heading used to generate table of contents" }),
|
|
115
|
+
usageFile: zod.z.string().optional().default("").meta({ description: "Workspace level usage file" }),
|
|
116
|
+
usageHeading: zod.z.string().optional().default("Usage").meta({ description: "Markdown heading used to generate usage example" }),
|
|
117
|
+
verbose: zod.z.boolean().default(false).meta({
|
|
118
|
+
alias: "v",
|
|
119
|
+
description: "whether or not to display verbose logging"
|
|
120
|
+
})
|
|
125
121
|
});
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
languageSchema,
|
|
136
|
-
tableHeadingsSchema,
|
|
137
|
-
templatesSchema
|
|
138
|
-
});
|
|
139
|
-
//# sourceMappingURL=schema.cjs.map
|
|
122
|
+
const configSchema = _configSchema.optional();
|
|
123
|
+
|
|
124
|
+
//#endregion
|
|
125
|
+
exports.actionsSchema = actionsSchema;
|
|
126
|
+
exports.configSchema = configSchema;
|
|
127
|
+
exports.defaultTableHeadings = defaultTableHeadings;
|
|
128
|
+
exports.defaultTemplates = defaultTemplates;
|
|
129
|
+
exports.formatsSchema = formatsSchema;
|
|
130
|
+
exports.languageSchema = languageSchema;
|