@savvy-web/cli 0.2.0 → 0.3.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/841.js +850 -688
- package/README.md +80 -0
- package/package.json +2 -1
package/README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# @savvy-web/cli
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@savvy-web/cli)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
The `savvy` binary — one command for the everyday dev tooling in a [Silk Suite](https://github.com/savvy-web/systems) project. It sets up changeset, commit and lint conventions, checks them and runs the git hooks behind them, replacing the three separate `savvy-changesets`, `savvy-commit` and `savvy-lint` bins.
|
|
7
|
+
|
|
8
|
+
## Install
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install --save-dev @savvy-web/cli
|
|
12
|
+
# or
|
|
13
|
+
pnpm add -D @savvy-web/cli
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Most projects install [`@savvy-web/silk`](https://www.npmjs.com/package/@savvy-web/silk) instead, which pulls in `@savvy-web/cli` along with the matching suite versions and the config files the `savvy` commands expect.
|
|
17
|
+
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
Set up a project, then check it:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx savvy init
|
|
24
|
+
# initializes changeset, commit and lint conventions in one pass
|
|
25
|
+
|
|
26
|
+
npx savvy check
|
|
27
|
+
# runs the changeset, commit and lint checks; reports every failure in one pass
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
`savvy init` and `savvy check` are the only setup entry points. The command groups expose the remaining per-tool operations:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npx savvy changeset version
|
|
34
|
+
# applies pending changesets and bumps package versions
|
|
35
|
+
|
|
36
|
+
npx savvy lint fmt package-json
|
|
37
|
+
# formats package.json files to the Silk Suite conventions
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Remove build and cache artifacts across the whole workspace:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npx savvy clean --dry-run
|
|
44
|
+
# previews what would be removed across every workspace package and the repo root
|
|
45
|
+
|
|
46
|
+
npx savvy clean --globs dist,.turbo,coverage
|
|
47
|
+
# removes only the given patterns
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Commands
|
|
51
|
+
|
|
52
|
+
- `savvy init` — orchestrator that runs changeset, commit and lint setup in one pass.
|
|
53
|
+
- `savvy check` — orchestrator that runs all three checks and reports every failure (it does not short-circuit).
|
|
54
|
+
- `savvy clean` — removes build and cache artifacts (`dist`, `.turbo`, `coverage`, `node_modules`, `.rslib` by default) from every workspace package (leaves first) and the repo root (last); `--globs` to customize, `--dry-run` to preview.
|
|
55
|
+
- `savvy commit` — the husky/Claude hook handlers (session-start, pre-commit-message, post-commit-verify, user-prompt-submit).
|
|
56
|
+
- `savvy changeset` — changeset lint, transform, version, classify, branch analysis, release-surface and config inspection.
|
|
57
|
+
- `savvy lint` — formatters for package.json, the pnpm workspace file and YAML.
|
|
58
|
+
|
|
59
|
+
Run any command with `--help` to see its full surface:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npx savvy changeset --help
|
|
63
|
+
# lists the changeset subcommands and their options
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Programmatic API
|
|
67
|
+
|
|
68
|
+
The package also exports the assembled command tree and its handlers for embedding `savvy` in another program:
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
import { runCli } from "@savvy-web/cli";
|
|
72
|
+
|
|
73
|
+
await runCli(process.argv);
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
The individual command groups (`changesetCommand`, `commitCommand`, `lintCommand`) and their named handlers are exported from the package root.
|
|
77
|
+
|
|
78
|
+
## License
|
|
79
|
+
|
|
80
|
+
[MIT](LICENSE)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savvy-web/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The savvy CLI — unified commit, changeset, and lint commands for the Silk Suite",
|
|
6
6
|
"homepage": "https://github.com/savvy-web/systems/tree/main/packages/cli",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"!tsconfig.json",
|
|
44
44
|
"!tsdoc.json",
|
|
45
45
|
"841.js",
|
|
46
|
+
"README.md",
|
|
46
47
|
"bin/savvy.js",
|
|
47
48
|
"index.d.ts",
|
|
48
49
|
"index.js",
|