microsoft / rushstack

Monorepo for tools developed by the Rush Stack community
https://rushstack.io/
Other
5.75k stars 588 forks source link

[rush] rush add npm tags #1159

Open qm3ster opened 5 years ago

qm3ster commented 5 years ago

Currently, running rush add with a tag specifier as the version doesn't work, unlike in the package managers. Example:

rush add -m -p typescript@next

This fails with ERROR: The SemVer specifier "next" is not valid.

Suggested behavior:

This should resolve to the latest version with the tag, then save it in accordance with --caret|--exact flags.

octogonz commented 5 years ago

We should definitely support this! It's probably pretty easy to implement.

The code is here.

qm3ster commented 5 years ago

Perhaps anything that fails semver parsing should just go in the next ("latest") branch? (With "latest" literal generalized to initialSpec)

octogonz commented 5 years ago

Or if the string fails SemVer parsing, we can invoke npm dist-tags ls <package name> to see if it refers to a dist-tag.

antony commented 3 years ago

Is there a workaround for this? I see the issue has been open for a while, or are people just not using next packages?

shanedg commented 2 years ago

@antony you just have to use whatever version that the dist tag is pointed to. still, surprising that rush doesn't recognize dist tags except for latest.