@aurodesignsystem-dev/auro-cli 0.0.0-pr348.2 → 0.0.0-pr350.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/README.md +54 -0
- package/dist/auro-cli.js +108 -98
- package/dist/auro-cli.js.map +4 -4
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -51,6 +51,7 @@ Run `auro <command> --help` for options on any command. Defaults are shown where
|
|
|
51
51
|
| `auro rc-workflow` | Cuts the RC branch and opens the RC PR. |
|
|
52
52
|
| `auro pr-release` | Sets the PR preview version in `package.json`. |
|
|
53
53
|
| `auro check-commits` (alias `auro cc`) | Classifies commits and can label the PR. |
|
|
54
|
+
| `auro api-diff` | Checks that a PR's commits declare a big enough version bump for its code changes. |
|
|
54
55
|
|
|
55
56
|
## Full reference
|
|
56
57
|
|
|
@@ -183,6 +184,59 @@ Reads the repo's commits, classifies each by conventional-commit type, and repor
|
|
|
183
184
|
- `-d, --debug`: print detailed commit info.
|
|
184
185
|
- `-r, --release-notes`: generate release notes from the commits.
|
|
185
186
|
|
|
187
|
+
#### `auro api-diff <baseRef> [headRef]`
|
|
188
|
+
|
|
189
|
+
Works out the smallest version bump the code changes from `baseRef` to `headRef` (default `HEAD`) require, and checks that the commits declare at least that much. A version number is a promise to consumers, so a `fix:` commit that removes a public attribute shouldn't ship as a patch.
|
|
190
|
+
|
|
191
|
+
- `--json`: write the result to stdout as JSON.
|
|
192
|
+
- `--enforce`: exit 1 when the commits declare a smaller bump than the code requires (default: off, so the check can run report-only).
|
|
193
|
+
- `--no-rebuild`: compare the committed `custom-elements.json` files instead of rebuilding them. Faster, but only as good as the committed files, and many repos don't commit the manifest.
|
|
194
|
+
- `--manifest <path>`: manifest path from the repo root (default: `customElements` in `package.json`, else `custom-elements.json`).
|
|
195
|
+
- `--install-command <cmd>`: installs dependencies in each rebuilt checkout (default: `npm ci --no-audit --no-fund`).
|
|
196
|
+
- `--build-command <cmd>`: writes the manifest in each rebuilt checkout (default: `npm run build`).
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
auro api-diff origin/dev
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
Everything is compared from the merge base of the two refs, so only the PR's own changes and commits count.
|
|
203
|
+
|
|
204
|
+
**Required bump.** The highest bump among these changes:
|
|
205
|
+
|
|
206
|
+
| Change | Bump |
|
|
207
|
+
|---|---|
|
|
208
|
+
| Element removed or renamed; public attribute, property, method, event, slot, CSS part or CSS custom property removed or made private; type narrowed or replaced; attribute stops reflecting; default value changed, added or removed | Major |
|
|
209
|
+
| `exports` entry, `main`, `types` or `files` entry removed; `exports` added where there was none; peer or runtime dependency moved to a new major; `engines` tightened | Major |
|
|
210
|
+
| Element or public member added; private member made public; type widened; `exports` entry added | Minor |
|
|
211
|
+
| Any file under `src/` or `demo/`, or a `README.md` | Patch |
|
|
212
|
+
| Only `test/`, `.github/`, `docs/` or other unpublished files | None |
|
|
213
|
+
|
|
214
|
+
Only public API counts. Members are filtered on the manifest's `privacy` field, not on name prefixes. Attributes backed by a private or `@internal` property don't count. Default values are compared after normalizing quotes, so `'md'` and `"md"` are the same.
|
|
215
|
+
|
|
216
|
+
The manifest is rebuilt at both refs in temporary git worktrees, by default with `npm ci` and `npm run build`. The rebuild is skipped when only `test/`, `.github/` or `docs/` changed. If the head doesn't build, the check errors (fails closed). If the base doesn't build, the check uses the base's committed manifest, or skips the API comparison, and says so in `warnings` (fails open): a PR shouldn't be blocked by a base it didn't break.
|
|
217
|
+
|
|
218
|
+
**Declared bump.** The highest bump among the non-merge commits, worked out by `@semantic-release/commit-analyzer` with the repo's own release config (usually `@aurodesignsystem/auro-config/releaserc`, including its custom rules: `refactor`, `style` and `docs(README)` release a patch). It's loaded from the repo's `node_modules` when installed, so the check reads commits exactly as the release will. Otherwise auro-cli's own copy and the shared rules are used. The PR title never counts, because merge commits don't affect the version.
|
|
219
|
+
|
|
220
|
+
**Outcome.**
|
|
221
|
+
|
|
222
|
+
- `fail`: the commits declare less than the code requires. Reword the commits (`fix:` → `feat:`, or add `!` and a `BREAKING CHANGE:` footer).
|
|
223
|
+
- `warn`: no release is required, but the commits declare one (for example, a `fix:` that only touches tests).
|
|
224
|
+
- `pass`: otherwise. Declaring more than required is allowed, because behavior can break without the API changing.
|
|
225
|
+
|
|
226
|
+
The JSON starts with `required` and `reasons`, followed by `declared`, `outcome`, a one-line `summary` for PR comments, the refs, each change and commit with its bump, the release config and analyzer used, and any `warnings`:
|
|
227
|
+
|
|
228
|
+
```json
|
|
229
|
+
{
|
|
230
|
+
"required": "major",
|
|
231
|
+
"reasons": ["Removed attribute `ondark` from `<auro-button>`"],
|
|
232
|
+
"declared": "patch",
|
|
233
|
+
"outcome": "fail",
|
|
234
|
+
"summary": "Commits declare `fix` (patch). Code requires major: removed attribute `ondark` from `<auro-button>`."
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Exit codes: `0` when the analysis ran, `1` with `--enforce` when the outcome is `fail`, `2` when the analysis couldn't run (an unknown ref, or a head that won't build).
|
|
239
|
+
|
|
186
240
|
### AI assistant context
|
|
187
241
|
|
|
188
242
|
#### `auro context`
|