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

Fix version bumping script #602

Merged
merged 2 commits into from
Jul 29, 2021
Merged

Conversation

LitoMore
Copy link
Contributor

@LitoMore LitoMore commented Jul 27, 2021

Let the script version know when it's time to run.

Make sure version changes are added to staged.

I tried preversion, it still requires us to add changes to staged.

@sindresorhus
Copy link
Owner

version is already a npm script though. So this should work, but I have noticed it doesn't commit the version change, so maybe we need to use preversion or something. I didn't have a chance to check yet.

@LitoMore
Copy link
Contributor Author

That's because we don't a process can trigger the vesion script. We need a tool like the husky (trigger the script when pre-commit) or just use the prepublishOnly to trigger the script before npm publish.

@sindresorhus
Copy link
Owner

$ npm version triggers the version script. np uses npm version.

https://docs.npmjs.com/cli/v7/commands/npm-version

@LitoMore
Copy link
Contributor Author

LitoMore commented Jul 29, 2021

Oh, I see.

I have noticed it doesn't commit the version change.

I think we need to add our changes to staged (git add).

Code updated and tested with npm version patch command, it works well.

I also tried preversion without git add, it still requires us to add changes to staged.

@LitoMore LitoMore changed the title Sync version with package.json before npm publish Add version script changes to staged Jul 29, 2021
@sindresorhus sindresorhus changed the title Add version script changes to staged Fix version bumping script Jul 29, 2021
@sindresorhus sindresorhus merged commit b122bbf into sindresorhus:main Jul 29, 2021
@LitoMore LitoMore deleted the sync-version branch July 29, 2021 09:53
wezzynl added a commit to wezzynl/pure that referenced this pull request Sep 7, 2021
* upstream/main:
  Remove $ prompts from install commands (sindresorhus#607)
  1.17.2
  Improve Apple Silicon compatibility (sindresorhus#606)
  1.17.1
  Do not show hostname when running in GitHub Codespaces (sindresorhus#604)
  Fix version bumping script (sindresorhus#602)
  Add another sponsor to the readme
  1.17.0
  Add nix shell support (sindresorhus#599)
  Add Homebrew install instructions (sindresorhus#591)
  Update info about Fish port (sindresorhus#586)
  Remove antigen and antibody from instruction (sindresorhus#581)
  Update a link
kutsan pushed a commit to kutsan/pure that referenced this pull request Jun 19, 2023
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

Successfully merging this pull request may close these issues.

2 participants