fix: derive --help URLs and banner version from package.json - #9
Merged
Conversation
`workforge --help` shipped in @juspay/workforge@1.0.0 advertising Documentation: https://github.com/yourusername/workforge Issues: https://github.com/yourusername/workforge/issues alongside a hardcoded "WorkForge v3.0" banner on a package whose actual version is 1.0.0. Both are user-facing strings in a published artifact, and both were duplicates of metadata package.json already carries. Read them from package.json instead, so they cannot drift again: the homepage and bugs.url fields are already correct, and VERSION was already being read there for --version. package.json's index signature is deliberately loose, so the two fields are narrowed rather than cast. Also drops the "v3.0" prose from CLAUDE.md, which referred to the third internal rewrite rather than any released version, and refreshes the test inventory and count. Adds test/cli-help.test.ts, which asserts the help output against package.json rather than a second copy of the same literals. Verified by reverting the fix: 3 of its 4 assertions fail.
murdore
force-pushed
the
fix/help-epilogue-placeholder-url
branch
from
August 10, 2026 10:30
85aa7d7 to
87c23e1
Compare
Contributor
Author
|
CodeQL flagged It's a fair catch rather than noise — the assertions were literals that never needed regexes. Rewritten as substring checks over a Re-verified after the change: with the fix reverted, and |
|
🎉 This PR is included in version 1.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
The defect
@juspay/workforge@1.0.0is on the registry, and its--helptells users to file issues at a placeholder:It also prints
WorkForge v3.0on a package whose version is1.0.0.Found by installing the published tarball and running it, rather than by reading source:
The fix
Both strings were duplicates of metadata
package.jsonalready carries correctly (homepage,bugs.url), andVERSIONwas already read from there for--version. They now come from the same source, so they cannot drift apart again.PackageJson's index signature is intentionally loose (ConfigValue), so the two fields are narrowed through small helpers rather than cast — noany.After
Test
test/cli-help.test.tsasserts the rendered help againstpackage.jsonrather than against a second copy of the same literals — a test holding its own copy of the URL would have passed against the placeholder.Mutation-checked per this repo's rule that a guard must fail when its fix is reverted:
Restored:
57 passed (57), lint 0 errors,npm pack --dry-runclean.Docs
Drops
v3.0fromCLAUDE.mdprose — it referred to the third internal rewrite, not a released version, and reads as a version claim next to a1.0.0package. Test inventory and count refreshed (41 → 57, and the two newer files were missing).Release note
Typed
fix:deliberately. This is the first release to go through npm trusted publishing — the OIDC connection forjuspay/workforge→release.ymlwithnpm publishpermission was configured today, and both prerequisites are confirmed live in CI on the previous run (npm 11.19.0,@semantic-release/npm 13.1.5). Expect1.0.1with a provenance attestation and noNPM_TOKENinvolved.