fix(publish): resolve cipublish
error on v4 branch
#9208
Closed
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.
We can check failed workflow
Below is the error message
Fix publish failure when tag is set to v{number}
While publishing from the
v4
branch of TanStack Query, we encountered an issue caused by thetag option
. The current npm publish logic treats v4 as a valid SemVer range, which triggers an error:Below is the publish function node/22.12.0/lib/node_modules/npm/lib/commands
I’ve tested this behavior locally with --dry-run, and the issue no longer occurs after rewriting --tag to query-v4 only for the v4 branch, not for main, beta, alpha, or rc.
AS-IS(Not work)
v4 is valid range of semver so It can't be npm tag name
To-BE(Work)
query-v4 is invalid range of semver, so it can be npm tag name