@doccov/cli 0.2.1 → 0.4.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/LICENSE +21 -0
- package/README.md +24 -48
- package/dist/cli.js +804 -175
- package/dist/config/index.d.ts +2 -10
- package/dist/config/index.js +3 -13
- package/package.json +3 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Ryan Waits
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,67 +1,43 @@
|
|
|
1
1
|
# @doccov/cli
|
|
2
2
|
|
|
3
|
-
Command-line interface for documentation coverage and drift detection
|
|
3
|
+
Command-line interface for documentation coverage and drift detection.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
|
+
|
|
6
7
|
```bash
|
|
7
8
|
npm install -g @doccov/cli
|
|
8
9
|
```
|
|
9
10
|
|
|
10
|
-
##
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
11
13
|
```bash
|
|
12
|
-
# Check
|
|
14
|
+
# Check coverage
|
|
13
15
|
doccov check --min-coverage 80
|
|
14
16
|
|
|
15
|
-
# Generate
|
|
16
|
-
doccov generate
|
|
17
|
-
|
|
18
|
-
# Point at a specific entry file
|
|
19
|
-
doccov generate src/index.ts --output openpkg.json
|
|
20
|
-
|
|
21
|
-
# Scaffold a config to pin defaults
|
|
22
|
-
doccov init
|
|
23
|
-
|
|
24
|
-
# Strict mode: require examples and 90% coverage
|
|
25
|
-
doccov check --min-coverage 90 --require-examples
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Flags at a Glance
|
|
29
|
-
- `--min-coverage <percentage>` – fail if coverage drops below threshold
|
|
30
|
-
- `--require-examples` – require `@example` blocks on all exports
|
|
31
|
-
- `--include <id>` / `--exclude <id>` – narrow the surface area
|
|
32
|
-
- `--package <name>` – target a workspace package from the monorepo root
|
|
33
|
-
- `--no-external-types` – skip pulling types from installed deps
|
|
34
|
-
- `--output <file>` – write somewhere other than `openpkg.json`
|
|
35
|
-
|
|
36
|
-
## Config File
|
|
37
|
-
Optional `doccov.config.(ts|js|mjs)` keeps CLI defaults alongside your project:
|
|
38
|
-
```ts
|
|
39
|
-
// doccov.config.ts
|
|
40
|
-
import { defineConfig } from '@doccov/cli/config';
|
|
17
|
+
# Generate spec
|
|
18
|
+
doccov generate -o openpkg.json
|
|
41
19
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
exclude: ['internalHelper'],
|
|
45
|
-
});
|
|
20
|
+
# Require examples
|
|
21
|
+
doccov check --require-examples
|
|
46
22
|
```
|
|
47
|
-
CLI flags always win over config values.
|
|
48
23
|
|
|
49
|
-
##
|
|
24
|
+
## Commands
|
|
50
25
|
|
|
51
|
-
|
|
26
|
+
| Command | Description |
|
|
27
|
+
|---------|-------------|
|
|
28
|
+
| `check` | Validate coverage thresholds |
|
|
29
|
+
| `generate` | Generate OpenPkg spec |
|
|
30
|
+
| `diff` | Compare two specs |
|
|
31
|
+
| `report` | Generate coverage report |
|
|
32
|
+
| `scan` | Analyze GitHub repos |
|
|
33
|
+
| `init` | Create config file |
|
|
52
34
|
|
|
53
|
-
|
|
54
|
-
✖ Docs coverage 72% fell below required 80%.
|
|
35
|
+
## Documentation
|
|
55
36
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Suggestion: Did you mean "id"?
|
|
60
|
-
```
|
|
37
|
+
- [CLI Overview](../../docs/cli/overview.md)
|
|
38
|
+
- [Command Reference](../../docs/cli/commands/)
|
|
39
|
+
- [Configuration](../../docs/cli/configuration.md)
|
|
61
40
|
|
|
62
|
-
##
|
|
63
|
-
Full command reference and troubleshooting tips live in the repository:
|
|
64
|
-
- [Usage docs](../../USAGE.md)
|
|
65
|
-
- [Fixtures](../../tests/fixtures/README.md)
|
|
41
|
+
## License
|
|
66
42
|
|
|
67
|
-
MIT
|
|
43
|
+
MIT
|