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

npm run release -- --release-as 1.0.0 as first release ends up with 1.1.0 #51

Closed
henrikvilhelmberglund opened this issue Jan 15, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@henrikvilhelmberglund
Copy link

Describe the bug
npm run release -- --release-as 1.0.0 as first release ends up with 1.1.0. Maybe I'm missing something but I thought I would get 1.0.0 and not 1.1.0.

Current behavior
After running npm run release -- --release-as 1.0.0 as the first ever release, the tag ends up as 1.1.0.

Expected behavior
After running npm run release -- --release-as 1.0.0 as the first ever release, the tag ends up as 1.0.0.

Environment

  • "commit-and-tag-version": "^10.1.
  • Node/npm version: 18.12.1/8.13.2
  • OS: Win10 64bit

Possible Solution

Additional context
Add any other context about the problem here. Or a screenshot if applicable
Code_15_22-49-22JNpFnmtd3j

Maybe this is not how you're supposed to use commit-and-tag-version so I'm open for any solutions. 😄

@henrikvilhelmberglund henrikvilhelmberglund added the bug Something isn't working label Jan 15, 2023
@TimothyJones
Copy link
Member

Hmm. This is unexpected.

What is the nr command you’re running there? I’m not familiar with it.

What happens if you remove that tag and commit and do:

npx commit-and-tag-version --dry-run --release-as 1.0.0

(note no double - before the arguments)

Are there any tags in this repository already?

@henrikvilhelmberglund
Copy link
Author

nr is the run alias in https://github.com/antfu/ni so basically the same as npm run.

I tested nr release --dry-run --release-as 1.0.0 and it tagged 1.0.0 as expected so I guess my problem was the extra --. I think I copy pasted those from the README.

Is there a reason for the extra -- or is it safe to omit them?

@TimothyJones
Copy link
Member

You need those with npm run, so my guess is that nr isn’t really an alias for npm run

@henrikvilhelmberglund
Copy link
Author

You're right, nr isn't just npm run but includes the -- already so it's npm run --. Thus running the command in the screenshot with nr adds extra -- which breaks things. I didn't run npm with arguments before so I had no idea it needed -- at all (for example pnpm doesn't use this syntax)

I copied the -- part of the npm command by mistake, I should've run nr release --release-as 1.0.0 in my case. Makes sense. 😊

Thanks for the help!

@TimothyJones
Copy link
Member

You're welcome! Glad it got fixed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants