fix(stricli): stop advertising -H as the --help-all alias#1057
Merged
Conversation
Contributor
Codecov Results 📊✅ Patch coverage is 100.00%. Project has 4338 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 81.97% 82.07% +0.1%
==========================================
Files 334 335 +1
Lines 24157 24193 +36
Branches 15807 15839 +32
==========================================
+ Hits 19802 19855 +53
- Misses 4355 4338 -17
- Partials 1659 1659 —Generated by Codecov Action |
Our @stricli/core patch already frees the `-H` alias (used by `api -H` for headers, gh-style) by removing it from input parsing and the reserved-alias guard. However the help renderer still displayed `-H` as the alias for `--help-all`, which collides visually with the command-level `-H`/`--header` alias in `sentry api --help`. Extend the patch to drop `-H` from both help-all display sites: - the flags table row (`aliases: "-H"` -> `aliases: ""`) - the usage-line generator (always yield `--help-all`, never `-H`) `--help-all` / `--helpAll` still work; only the cosmetic alias display is removed. Also retarget the patch filename from 1.2.5 to the installed 1.2.7 so `check:patches` reports a clean match (the patch applies unchanged across the bump; only the filename version differed).
529c007 to
0ef839b
Compare
BYK
added a commit
that referenced
this pull request
Jun 3, 2026
…ck (#1062) Follow-ups from the post-merge review of #1057. No production code changes — tooling, docs hygiene, and a CI safety net. ## 1. Remove `MIGRATION-PLAN.md` + gitignore the scratch-doc class `MIGRATION-PLAN.md` was a throwaway Bun→Node migration scratch doc that had already drifted stale (e.g. still referenced the old `@stricli/core@1.2.5` patch that #1057 retargeted to `1.2.7`). These planning/migration notes shouldn't live in the repo. Deleted it and added `.gitignore` patterns so the whole class stays local: ``` *-PLAN.md *_PLAN.md PLAN.md *-MIGRATION.md MIGRATION-*.md MIGRATION_*.md ``` Verified these match `MIGRATION-PLAN.md` and do **not** catch legit tracked docs (`DEVELOPMENT.md`, `CONTRIBUTING.md`, `README.md`, `AGENTS.md`, `CHANGELOG.md`, `docs/.../contributing.md`). ## 2. Drop stale `.lore.md` entry Removed the lore entry that documented the old **`bun patch`** SDK patch-regeneration workflow (`rm -rf ~/.bun/install/cache/@sentry`, `bun patch --commit`, "remove `.bun-tag-*` hunks"). The project uses `pnpm patch` now, so the instructions were actively misleading. ## 3. Harden `check:patches` with content assertions This is the meaningful one. The `@stricli/core` `-H` patch edits exact line-context in **both** the ESM (`dist/index.js`) and CJS (`dist/index.cjs`) bundles, and **will** break on any Stricli version bump that shifts those lines. pnpm only **warns** (does not fail) when a patch no longer applies — it installs the unpatched package. The previous version-only check would still pass in that case, silently re-introducing the `-H` crash. Added `CONTENT_ASSERTIONS` to `script/check-patches.ts` that verify each patch's *effect* is present in the installed files (asserts the stale `checkForReservedAliases(aliases, ["h", "H"])` marker is **absent** from both bundles). Fails hard (exit 1) if a patch silently dropped. The script header now also documents this fragility as a permanent maintenance cost (upstreaming a config option for `-H` is unlikely to be accepted). ## Testing - `pnpm run check:patches` → ✓ passes with patches applied - Negative test: reintroduced the stale `["h", "H"]` marker into the installed ESM bundle → script correctly **fails with exit 1** and the actionable regenerate message; restored → passes again - `biome check script/check-patches.ts` → clean - `tsc --noEmit` → no errors in `check-patches.ts` - `git check-ignore` confirms gitignore patterns hit `MIGRATION-PLAN.md` and miss all real docs
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to the
@stricli/corepatch that frees the-Halias for ourapicommand (gh-style-H "Key: Value"headers). While the patch already removed-Hfrom Stricli's input parsing and reserved-alias guard, the help renderer still displayed-Has the alias for--help-all. Insentry api --helpthis collides visually with the command-level-H/--headeralias.This PR extends the patch to drop
-Hfrom both help-all display sites:aliases: "-H"→aliases: ""(the--help-allrow now shows no alias)--help-all, never-HBoth
dist/index.js(ESM) anddist/index.cjs(CJS) are patched for defense-in-depth (8 hunks total: 4 per file).--help-all/--helpAllcontinue to work; only the cosmetic alias display is removed.Before / After (
sentry api --helpAll)Before —
-Happeared twice (header alias and help-all alias):After —
-Honly maps to--header; help-all shows no alias:Patch filename retarget (1.2.5 → 1.2.7)
The patch was keyed to
@stricli/core@1.2.5while1.2.7is installed. The patch applies unchanged across the bump, butcheck:patchesemitted a (non-fatal) version-mismatch warning. Renamed the patch file to@stricli%2Fcore@1.2.7.patchand updatedpackage.json+ lockfile socheck:patchesnow reports a clean match.Context
This is the cosmetic half of a
-Hinvestigation. The other half — a contributor hittingInternalError: Unable to use reserved alias -H— was a patch-not-applied problem on their machine (installed with a non-pnpm package manager / stalenode_modules), not a code bug and not a Stricli 1.2.7 change.-Hhas been Stricli's help-all alias since at least 1.2.4 (verified against pristine npm tarballs for 1.2.4/1.2.5/1.2.7).Testing
pnpm run check:patches→ ✓ all patched dependency versions matchpnpm run typecheck→ passes (also regenerates docs + SDK, which import every command incl.api.ts— no reserved-alias crash)pnpm run lint→ clean (766 files)sentry api --helpAllrenders as shown abovedist/index.js(ESM) anddist/index.cjs(CJS) in installednode_modules/@stricli/core