fix(cli): read version from package.json instead of hardcoding it - #437
Open
angelraph wants to merge 1 commit into
Open
fix(cli): read version from package.json instead of hardcoding it#437angelraph wants to merge 1 commit into
angelraph wants to merge 1 commit into
Conversation
cli/open-audit-cli.ts hardcoded .version("1.0.0") while package.json's
version field is "0.1.0", causing open-audit-cli --version to report a
release that doesn't exist.
Import the version field from package.json (resolveJsonModule is already
enabled in the build:cli script) so the CLI's reported version always
matches package.json, with no separate value to keep in sync.
Closes Open-audit-foundation#426
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
cli/open-audit-cli.tshardcoded.version("1.0.0")whilepackage.json'sversionfield is"0.1.0"— soopen-audit-cli --versionreported a release that doesn't exist.Fix
Import the version directly from
package.json(JSON module resolution is already enabled in thebuild:cliscript) instead of hardcoding a string, so there's a single source of truth.Verification
npm run build:cli && node dist/cli/open-audit-cli.js --version→0.1.0, matchingpackage.json.package.json's version locally, rebuilt, confirmed the CLI's reported version updated with zero code changes, then reverted.cli/test-cli.shbefore and after the change — the version test passes; a pre-existing, unrelated failure (translation blueprint matching) reproduces identically on unmodifiedmain.Note
I see #430 is also open against this issue. Assigning maintainer's call on which lands — flagging for visibility since our diffs are both about the same line, just wanted to make sure my assignment on the issue was fulfilled.
Closes #426