@openpkg-ts/cli 0.2.3 → 0.3.1
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 +133 -0
- package/dist/bin/openpkg.js +701 -0
- package/dist/shared/chunk-1dqs11h6.js +20 -0
- package/dist/src/index.d.ts +12 -0
- package/dist/{index.js → src/index.js} +2 -0
- package/package.json +9 -3
- package/CHANGELOG.md +0 -32
- package/bin/openpkg.ts +0 -61
- package/dist/index.d.ts +0 -2
- package/src/commands/diff.ts +0 -175
- package/src/commands/docs.ts +0 -125
- package/src/commands/snapshot.ts +0 -122
- package/src/index.ts +0 -2
- package/test/diff.test.ts +0 -336
- package/test/docs.test.ts +0 -599
- package/test/get.test.ts +0 -413
- package/test/spec.test.ts +0 -469
- package/tsconfig.json +0 -15
package/README.md
CHANGED
|
@@ -78,6 +78,9 @@ openpkg docs openpkg.json --split -o docs/api/
|
|
|
78
78
|
|
|
79
79
|
# Pipeline: stdin
|
|
80
80
|
openpkg snapshot src/index.ts -o - | openpkg docs - -f md
|
|
81
|
+
|
|
82
|
+
# With adapter (generates framework-specific output)
|
|
83
|
+
openpkg docs openpkg.json --adapter fumadocs -o docs/api/
|
|
81
84
|
```
|
|
82
85
|
|
|
83
86
|
Options:
|
|
@@ -86,6 +89,7 @@ Options:
|
|
|
86
89
|
| `-o, --output <path>` | Output file or directory (default: stdout) |
|
|
87
90
|
| `-f, --format <fmt>` | Format: `md`, `json`, `html` (default: md) |
|
|
88
91
|
| `--split` | One file per export (requires `-o` as directory) |
|
|
92
|
+
| `-a, --adapter <name>` | Use adapter: `fumadocs`, `raw` (default: raw) |
|
|
89
93
|
|
|
90
94
|
### diff
|
|
91
95
|
|
|
@@ -104,6 +108,135 @@ Output includes:
|
|
|
104
108
|
- `docsOnly` - documentation-only changes
|
|
105
109
|
- `summary.semverBump` - recommended version bump
|
|
106
110
|
|
|
111
|
+
### breaking
|
|
112
|
+
|
|
113
|
+
Check for breaking changes. Exit 1 if any found.
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
openpkg breaking old.json new.json
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Output:
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"breaking": [
|
|
123
|
+
{ "id": "createClient", "name": "createClient", "kind": "function", "severity": "high", "reason": "signature changed" }
|
|
124
|
+
],
|
|
125
|
+
"count": 1
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### semver
|
|
130
|
+
|
|
131
|
+
Recommend version bump based on changes.
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
openpkg semver old.json new.json
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Output:
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"bump": "major",
|
|
141
|
+
"reason": "1 breaking change detected"
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### validate
|
|
146
|
+
|
|
147
|
+
Validate spec against schema.
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
openpkg validate openpkg.json
|
|
151
|
+
openpkg validate openpkg.json --version 1.0
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Output:
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"valid": true,
|
|
158
|
+
"errors": []
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### changelog
|
|
163
|
+
|
|
164
|
+
Generate changelog from diff.
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
openpkg changelog old.json new.json
|
|
168
|
+
openpkg changelog old.json new.json --format json
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Markdown output:
|
|
172
|
+
```markdown
|
|
173
|
+
## Breaking Changes
|
|
174
|
+
- **Removed** `oldFunction` (function)
|
|
175
|
+
|
|
176
|
+
## Added
|
|
177
|
+
- `newFunction`
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### diagnostics
|
|
181
|
+
|
|
182
|
+
Analyze spec for quality issues.
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
openpkg diagnostics openpkg.json
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Output:
|
|
189
|
+
```json
|
|
190
|
+
{
|
|
191
|
+
"summary": {
|
|
192
|
+
"total": 5,
|
|
193
|
+
"missingDescriptions": 3,
|
|
194
|
+
"deprecatedNoReason": 1,
|
|
195
|
+
"missingParamDocs": 1
|
|
196
|
+
},
|
|
197
|
+
"diagnostics": { ... }
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### filter
|
|
202
|
+
|
|
203
|
+
Filter spec by various criteria.
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
openpkg filter openpkg.json --kind function,class
|
|
207
|
+
openpkg filter openpkg.json --has-description -o documented.json
|
|
208
|
+
openpkg filter openpkg.json --search "user" --summary
|
|
209
|
+
openpkg filter openpkg.json --deprecated --quiet | jq '.exports[].name'
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Options:
|
|
213
|
+
| Flag | Description |
|
|
214
|
+
|------|-------------|
|
|
215
|
+
| `--kind <kinds>` | Filter by kinds (comma-separated) |
|
|
216
|
+
| `--name <names>` | Filter by exact names (comma-separated) |
|
|
217
|
+
| `--id <ids>` | Filter by export IDs (comma-separated) |
|
|
218
|
+
| `--tag <tags>` | Filter by tags (comma-separated) |
|
|
219
|
+
| `--deprecated` | Only deprecated exports |
|
|
220
|
+
| `--no-deprecated` | Exclude deprecated exports |
|
|
221
|
+
| `--has-description` | Only exports with descriptions |
|
|
222
|
+
| `--missing-description` | Only exports without descriptions |
|
|
223
|
+
| `--search <term>` | Search name/description (case-insensitive) |
|
|
224
|
+
| `--module <path>` | Filter by source file path (contains) |
|
|
225
|
+
| `-o, --output <file>` | Output file (default: stdout) |
|
|
226
|
+
| `--summary` | Only output matched/total counts |
|
|
227
|
+
| `--quiet` | Output raw spec only (no wrapper) |
|
|
228
|
+
|
|
229
|
+
All criteria use AND logic when combined.
|
|
230
|
+
|
|
231
|
+
Output (default):
|
|
232
|
+
```json
|
|
233
|
+
{
|
|
234
|
+
"spec": { ... },
|
|
235
|
+
"matched": 12,
|
|
236
|
+
"total": 45
|
|
237
|
+
}
|
|
238
|
+
```
|
|
239
|
+
|
|
107
240
|
## Pipelines
|
|
108
241
|
|
|
109
242
|
Commands are composable via stdin/stdout:
|