Skip to content

RFC: Publish set the tag accordingly to the semver version number#317

Closed
theoludwig wants to merge 1 commit into
npm:latestfrom
theoludwig:publish-accordingly-to-semver-version
Closed

RFC: Publish set the tag accordingly to the semver version number#317
theoludwig wants to merge 1 commit into
npm:latestfrom
theoludwig:publish-accordingly-to-semver-version

Conversation

@theoludwig

Copy link
Copy Markdown

Currently : Versions numbers have no direct connection with dist-tags.
It should be possible to run npm publish without specifying the --tag argument, instead it will pick the tag based on the semver version number (inside package.json).

Examples of various versions values inside package.json

16.0.3 release the package attached to the latest tag
16.0.3-tagname.1 release the package attached to the tagname tag
16.0.3-beta.1 release the package attached to the beta tag

References

@ljharb

ljharb commented Feb 9, 2021

Copy link
Copy Markdown
Contributor

An alternative might be a new config value that opts in to this behavior, that then the project could put in its .npmrc - then there's no surprises for existing authors, but there's an ergonomic path to this behavior for those that know about it.

@darcyclarke darcyclarke added the Agenda will be discussed at the Open RFC call label Feb 10, 2021
@wesleytodd

wesleytodd commented Feb 10, 2021

Copy link
Copy Markdown

Just to document another thing I hope we could change related to dist-tags. If --save-exact was used when installing a dist-tag specifier, it would be great if that saved the exact value. So npm i --save-exact foo@next would result in "foo": "next" in the package.json.

Ended up discussing this on the call, and if we opt'd for a --save-spec that would work as well to avoid the breaking change.

@theoludwig theoludwig changed the title Publish set the tag accordingly to the semver version number RFC: Publish set the tag accordingly to the semver version number Feb 18, 2021
@darcyclarke darcyclarke removed the Agenda will be discussed at the Open RFC call label Feb 24, 2021
@theoludwig theoludwig closed this Jun 24, 2021
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.

4 participants