Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Support npm version --interactive #810

Open
pacexy opened this issue Jan 22, 2025 · 0 comments
Open

[FEATURE] Support npm version --interactive #810

pacexy opened this issue Jan 22, 2025 · 0 comments

Comments

@pacexy
Copy link

pacexy commented Jan 22, 2025

Why

Version bumping in npm currently requires explicitly specifying the version increment (e.g. npm version minor). This makes it challenging to create reusable release scripts in package.json, as the version increment needs to be hardcoded or passed as an argument.

How

Current Behavior

npm version minor  # Must specify version increment explicitly

Expected Behavior

Would like to add an interactive mode similar to bumpp:

{
  "scripts": {
    "release": "npm version --interactive"
  }
}

Running npm run release would present an interactive CLI prompt:

? Current version 0.1.0 »
            major 1.0.0
            minor 0.2.0
            patch 0.1.1
>            next 0.1.1
        pre-patch 0.1.1-beta.0
        pre-minor 0.2.0-beta.0
        pre-major 1.0.0-beta.0
            as-is 0.1.0
           custom ...

Benefits:

  • More intuitive version selection
  • Reusable release scripts without hardcoding versions

This would align npm's version bumping workflow with modern CLI tools while maintaining compatibility with existing npm version commands.

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

No branches or pull requests

1 participant