Skip to content

fix: dynamically increment prerelease versions in publish.sh#1932

Open
inlined wants to merge 2 commits into
masterfrom
inlined.fix-publish-prerelease
Open

fix: dynamically increment prerelease versions in publish.sh#1932
inlined wants to merge 2 commits into
masterfrom
inlined.fix-publish-prerelease

Conversation

@inlined

@inlined inlined commented Jul 16, 2026

Copy link
Copy Markdown
Member

Description

Fixes an issue in scripts/publish.sh where prerelease publishing (e.g. running with --prerelease) would fail if rc.0 was already published on npm for that target version series, since it always bumped from the stable version. It now dynamically checks npm for any existing prerelease versions of the target version series, and performs a prerelease increment (e.g., to rc.1) if one exists.

Release Notes

relnote: none

@inlined
inlined force-pushed the inlined.fix-publish-prerelease branch from 3b5481e to e1aa47a Compare July 16, 2026 22:10

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the prerelease versioning logic in scripts/publish.sh to check npm for existing prerelease versions in the target range and increment them if found, rather than always starting from the stable version. The reviewer noted that parsing the raw output of npm view with tail and grep is fragile and prone to errors due to output formatting variations, sorting assumptions, and a hardcoded regex. They suggested a more robust approach using Node.js and the semver package to parse the JSON output safely.

Comment thread scripts/publish.sh Outdated
@inlined
inlined force-pushed the inlined.fix-publish-prerelease branch from e1aa47a to b2a1126 Compare July 16, 2026 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants