Giter VIP home page Giter VIP logo

Comments (8)

wraithgar avatar wraithgar commented on August 28, 2024 3

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.

ljharb avatar ljharb commented on August 28, 2024 2

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.

ljharb avatar ljharb commented on August 28, 2024 2

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.

kytta avatar kytta commented on August 28, 2024 1

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:

  1. developer willingly publishes a pre-release to latest (npm/npm#10189 (comment))
    • say, 1.0.0-rc.1 => latest
  2. 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
  3. 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.

kytta avatar kytta commented on August 28, 2024 1

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.

wesleytodd avatar wesleytodd commented on August 28, 2024 1

➕ 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.

ljharb avatar ljharb commented on August 28, 2024

Some tag must always be set - what tag would you expect as an alternative?

from cli.

kytta avatar kytta commented on August 28, 2024

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 tag alpha, 2.0.0-rc.3 would get the tag rc

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.