@stephansama/auto-readme 0.2.11 → 0.2.12
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/package.json +6 -3
- package/skills/auto-readme/SKILL.md +189 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stephansama/auto-readme",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.12",
|
|
4
4
|
"description": "Generate lists and tables for your README automagically based on your repository and comments",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"auto",
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"generator",
|
|
11
11
|
"list",
|
|
12
12
|
"markdown",
|
|
13
|
-
"table"
|
|
13
|
+
"table",
|
|
14
|
+
"tanstack-intent"
|
|
14
15
|
],
|
|
15
16
|
"homepage": "https://packages.stephansama.info/api/@stephansama/auto-readme",
|
|
16
17
|
"repository": {
|
|
@@ -40,7 +41,8 @@
|
|
|
40
41
|
"auto-readme": "./dist/cli.mjs"
|
|
41
42
|
},
|
|
42
43
|
"files": [
|
|
43
|
-
"./dist"
|
|
44
|
+
"./dist",
|
|
45
|
+
"skills"
|
|
44
46
|
],
|
|
45
47
|
"dependencies": {
|
|
46
48
|
"@manypkg/get-packages": "3.1.0",
|
|
@@ -68,6 +70,7 @@
|
|
|
68
70
|
"zod2md": "0.2.5"
|
|
69
71
|
},
|
|
70
72
|
"devDependencies": {
|
|
73
|
+
"@tanstack/intent": "0.0.41",
|
|
71
74
|
"@types/mdast": "4.0.4",
|
|
72
75
|
"@types/vfile": "4.0.0",
|
|
73
76
|
"@types/yargs": "17.0.35",
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: auto-readme
|
|
3
|
+
description: >
|
|
4
|
+
Auto-generate and update tables and lists in README files using HTML comment
|
|
5
|
+
markers. Supports WORKSPACE (monorepo package tables), ACTION (GitHub Action
|
|
6
|
+
inputs from action.yml), PKG (package.json dependency tables), ZOD (zod schema
|
|
7
|
+
reference tables), USAGE actions. Run via CLI or as a pre-commit hook with
|
|
8
|
+
--changes to process only modified READMEs.
|
|
9
|
+
type: core
|
|
10
|
+
library: "@stephansama/auto-readme"
|
|
11
|
+
library_version: "1.0.0"
|
|
12
|
+
sources:
|
|
13
|
+
- stephansama/packages:core/auto-readme/src/comment.ts
|
|
14
|
+
- stephansama/packages:core/auto-readme/src/data.ts
|
|
15
|
+
- stephansama/packages:core/auto-readme/src/plugin.ts
|
|
16
|
+
- stephansama/packages:core/auto-readme/src/schema.ts
|
|
17
|
+
- stephansama/packages:core/auto-readme/README.md
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# auto-readme
|
|
21
|
+
|
|
22
|
+
Keeps README files up to date by replacing content between HTML comment markers. Run manually, in CI, or as a pre-commit hook.
|
|
23
|
+
|
|
24
|
+
## Comment syntax
|
|
25
|
+
|
|
26
|
+
```md
|
|
27
|
+
<!-- ACTION_TYPE [options] start -->
|
|
28
|
+
<!-- ACTION_TYPE end -->
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Content between markers is replaced on every run. Markers must be paired — every `start` needs a matching `end`.
|
|
32
|
+
|
|
33
|
+
## Setup
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
pnpx @stephansama/auto-readme
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Add configuration to `package.json`:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"auto-readme": {
|
|
44
|
+
"disableEmojis": false,
|
|
45
|
+
"onlyShowPublicPackages": true
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Or use a standalone config file (`.autoreadmerc.json`, `.config/autoreadmerc.ts`, `autoreadme.config.ts`, etc.).
|
|
51
|
+
|
|
52
|
+
## Core Patterns
|
|
53
|
+
|
|
54
|
+
### Monorepo workspace table
|
|
55
|
+
|
|
56
|
+
```md
|
|
57
|
+
<!-- WORKSPACE start -->
|
|
58
|
+
<!-- WORKSPACE end -->
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Generates a table of all packages in the workspace with name, version badge, download badge, and description. Reads from the pnpm/npm workspace config.
|
|
62
|
+
|
|
63
|
+
### GitHub Action inputs table
|
|
64
|
+
|
|
65
|
+
```md
|
|
66
|
+
<!-- ACTION start -->
|
|
67
|
+
<!-- ACTION end -->
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Place this comment in a README inside a directory that contains `action.yml` or `action.yaml`. Generates a table of action inputs with name, required, default, and description columns.
|
|
71
|
+
|
|
72
|
+
### Package.json dependency table
|
|
73
|
+
|
|
74
|
+
```md
|
|
75
|
+
<!-- PKG start -->
|
|
76
|
+
<!-- PKG end -->
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Generates a table of dependencies and devDependencies from the nearest `package.json`. Pass `path=` to point to a different package.json:
|
|
80
|
+
|
|
81
|
+
```md
|
|
82
|
+
<!-- PKG path="../other-package" start -->
|
|
83
|
+
<!-- PKG end -->
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Zod schema reference table
|
|
87
|
+
|
|
88
|
+
```md
|
|
89
|
+
<!-- ZOD path="./src/schema.js" start -->
|
|
90
|
+
<!-- ZOD end -->
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Generates a markdown reference table from the default export of the given file using `zod2md`. The `path=` parameter is required and must point to a file with a zod schema as its default export.
|
|
94
|
+
|
|
95
|
+
### Pre-commit hook (changed files only)
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
# .husky/pre-commit
|
|
99
|
+
auto-readme --changes
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
`--changes` (`-g`) only processes README files that are modified in the current git changeset. Use in pre-commit hooks to avoid re-processing the entire repo on every commit.
|
|
103
|
+
|
|
104
|
+
## Common Mistakes
|
|
105
|
+
|
|
106
|
+
### HIGH ZOD action used with LIST format
|
|
107
|
+
|
|
108
|
+
Wrong:
|
|
109
|
+
|
|
110
|
+
```md
|
|
111
|
+
<!-- ZOD-LIST path="./src/schema.js" start -->
|
|
112
|
+
<!-- ZOD-LIST end -->
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Correct:
|
|
116
|
+
|
|
117
|
+
```md
|
|
118
|
+
<!-- ZOD path="./src/schema.js" start -->
|
|
119
|
+
<!-- ZOD end -->
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The ZOD action only supports TABLE format. Specifying LIST (e.g. `ZOD-LIST`) throws `"cannot display zod in list format"` at pipeline execution time.
|
|
123
|
+
|
|
124
|
+
Source: `core/auto-readme/src/data.ts`
|
|
125
|
+
|
|
126
|
+
### HIGH ZOD comment missing path= parameter
|
|
127
|
+
|
|
128
|
+
Wrong:
|
|
129
|
+
|
|
130
|
+
```md
|
|
131
|
+
<!-- ZOD start -->
|
|
132
|
+
<!-- ZOD end -->
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Correct:
|
|
136
|
+
|
|
137
|
+
```md
|
|
138
|
+
<!-- ZOD path="./src/schema.js" start -->
|
|
139
|
+
<!-- ZOD end -->
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The ZOD data loader requires `path=` to locate the schema file. Without it, auto-readme throws `"no path found for zod table at markdown file <file>"`.
|
|
143
|
+
|
|
144
|
+
Source: `core/auto-readme/src/data.ts`
|
|
145
|
+
|
|
146
|
+
### HIGH ACTION comment without action.yml in the same directory
|
|
147
|
+
|
|
148
|
+
Wrong:
|
|
149
|
+
|
|
150
|
+
```md
|
|
151
|
+
<!-- In docs/README.md, but no action.yml in docs/ -->
|
|
152
|
+
<!-- ACTION start -->
|
|
153
|
+
<!-- ACTION end -->
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Correct:
|
|
157
|
+
|
|
158
|
+
```md
|
|
159
|
+
<!-- In the same directory as action.yml -->
|
|
160
|
+
<!-- ACTION start -->
|
|
161
|
+
<!-- ACTION end -->
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
The ACTION data loader looks for `action.yml` or `action.yaml` in the same directory as the README file. Place the ACTION comment in the README co-located with the action definition, or use PKG for dependency tables in other directories.
|
|
165
|
+
|
|
166
|
+
Source: `core/auto-readme/src/data.ts:loadActionYaml`
|
|
167
|
+
|
|
168
|
+
### MEDIUM Unclosed or mismatched comment markers
|
|
169
|
+
|
|
170
|
+
Wrong:
|
|
171
|
+
|
|
172
|
+
```md
|
|
173
|
+
<!-- WORKSPACE start -->
|
|
174
|
+
|
|
175
|
+
Some content
|
|
176
|
+
|
|
177
|
+
<!-- WORKSPACE start --> ← second start, no end
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Correct:
|
|
181
|
+
|
|
182
|
+
```md
|
|
183
|
+
<!-- WORKSPACE start -->
|
|
184
|
+
<!-- WORKSPACE end -->
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
The `remark-zone` processor requires matched `start`/`end` pairs. Unmatched or duplicated markers cause the zone transform to silently skip or corrupt the section without an error.
|
|
188
|
+
|
|
189
|
+
Source: `core/auto-readme/src/plugin.ts`
|