np icon indicating copy to clipboard operation
np copied to clipboard

`np prerelease` should default to `--tag next`

Open fregante opened this issue 5 years ago • 2 comments

Running np lets you choose the release type and tag interactively, but np prerelease requires to pre-specify the tag via flag, erroring if it doesn't have it:

❯ np premajor
  ❯ Prerequisite check
    ✔ Ping npm registry
    ✔ Verify user is authenticated
    ✔ Check git remote
    ✔ Validate version
    ✖ Check for pre-release version
      → You must specify a dist-tag using --tag when publishing a pre-release ve
…
      Check git tag existence
    Git
    Cleanup
    Installing dependencies using npm
    Running tests using npm
    Bumping version using npm
    Publishing package using npm
    Pushing tags

✖ You must specify a dist-tag using --tag when publishing a pre-release version. This prevents accidentally tagging unstable versions as "latest". https://docs.npmjs.com/cli/dist-tag

Steps to reproduce

  1. $ np premajor

Expected behavior

$ np premajor should be the same as $ np premajor --tag next or let you choose interactively.

Environment

np 4.0.2 node v11.6.0 npm 6.9.0 git 2.19.1 OS: macOS 10.14.3

fregante avatar Mar 20 '19 03:03 fregante

You should really prefer just using $ np, but yes, we should probably let you choose interactively here too.

sindresorhus avatar Mar 20 '19 05:03 sindresorhus

See https://github.com/sindresorhus/np/pull/378 as a starting point to solve this.

sindresorhus avatar Nov 29 '19 03:11 sindresorhus