Comments (8)
Because this is not a bug I am going to close this issue. The rfc issue is probably the best place to add more input. Personally I'm a huge fan of this idea.
from cli.
failing and forcing a tag seems nice. even better is if it implemented https://npmjs.com/safe-publish-latest, and failed to implicitly publish a latest
whenever the version being published isn't a non-prerelease that is "later" than all existing versions.
from cli.
If they explicitly want something to be "latest" then it would be wildly improper for npm to prevent that, but it seems reasonable to me that implicit "latest" must always be a "later" non-prerelease.
(to be clear, this is something that'd have to be accepted by the npm team, and probably should be discussed in the RFC repo instead of here)
from cli.
So, this behaviour, then?
npm version 1.0.0
npm publish # no problem
npm version 1.0.1-alpha.1
npm publish
# npm ERR no tag set
npm publish --tag alpha # no problem
npm version 1.0.1-alpha.2
npm publish --tag latest # no problem; set implicitly
npm version 0.1.0 # assuming it's possible
npm publish
# npm ERR a newer 'latest' version is already published
Another question. What should we do about this behaviour:
- developer willingly publishes a pre-release to
latest
(npm/npm#10189 (comment))- say,
1.0.0-rc.1
=>latest
- say,
- developer makes a new pre-release version with the same version number (major.minor.patch), and a different pre-release identifier combo
- say,
1.0.0-rc.2
- say,
- developer runs
npm publish
Should we allow this, because the developer "opted-in" to publishing pre-releases for 1.0.0 to latest
(in other words, because the current latest
is also a pre-release), or should we always require an explicit tag for pre-releases?
from cli.
If they explicitly want something to be "latest" then it would be wildly improper for npm to prevent that, but it seems reasonable to me that implicit "latest" must always be a "later" non-prerelease.
Sounds good. It also matches the behaviour proposed in RFC 7
(to be clear, this is something that'd have to be accepted by the npm team, and probably should be discussed in the RFC repo instead of here)
Thanks for the heads-up! I've drafted one here: npm/rfcs#776
from cli.
➕ 1 on failing when not passing an explicit --tag
for prerelease versions. This has bitten me so many times over the years and has contributed to my beliefs automated publish workflows are superior (despite the tradeoffs). This would remove one of the rough edges around manual publish workflows and seems pretty clearly to be a good thing.
from cli.
Some tag must always be set - what tag would you expect as an alternative?
from cli.
Some tag must always be set - what tag would you expect as an alternative?
If not failing for pre-release builds (which would force the user to set the tag), I'd choose either:
next
for any semver-compliant pre-release version, or- the tag that matches the prerelease suffix, if there is any. For example,
2.0.0-alpha.1
would get the tagalpha
,2.0.0-rc.3
would get the tagrc
from cli.
Related Issues (20)
- [DOCS] npm doesn't install the latest tagged version if engines are invalid HOT 6
- [BUG] npm dist-tag rm only removes the last recently deleted tag HOT 9
- [BUG] `npm publish --provenance` The default value `public` isn't used HOT 5
- [Enchancement] Check files that import the package before uninstalling HOT 1
- [BUG] npm docs with no pkgname arg returns undefined HOT 2
- [BUG] No README.md on npmjs ? HOT 4
- [BUG] Problem / error links are incorrect when path contains prefix before space HOT 3
- [BUG] npm version -ws never update dependencies in package.json HOT 3
- npm ERR! Exit handler never called! npm ERR! This is an error with npm itself. HOT 1
- Licence missing for npm update
- [BUG] <title> HOT 1
- [BUG] npm install --save three: No matching version found for three@^0.777.1. HOT 3
- (npm error Exit handler never called!:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError HOT 1
- [BUG] Unable to upgrade two packages with a dep and peer dep on the same package that is also bumped HOT 5
- npm i changing package-lock.json HOT 4
- [BUG] Windows npm install --prefix errors and looks for the package.json in the cwd HOT 5
- [BUG] <prepare script called with CMD on windows> HOT 1
- Feature request: Add config option to prevent accidental installation of packages in directories without package.json HOT 2
- [BUG] npm publish <package-spec> in a workspace is not taking package-spec into account HOT 1
- [BUG] package binaries with .hidden folders don't install globally HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.