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

Revert changelog script change with improvements #59

Closed
9 tasks done
Cruikshanks opened this issue Oct 20, 2022 · 1 comment
Closed
9 tasks done

Revert changelog script change with improvements #59

Cruikshanks opened this issue Oct 20, 2022 · 1 comment
Labels
housekeeping Refactoring, tidying up or other work which supports the project

Comments

@Cruikshanks
Copy link
Member

Cruikshanks commented Oct 20, 2022

We realised that the previous name for the script was intentional. It was so that it would be automatically kicked off when npm version was called from the command line.

https://github.com/cookpete/auto-changelog#what-you-might-do-if-youre-clever

Using npm version not only means the package-lock.json gets updated as well, but it also generates the correct tag for us. We can also just decide the change type (major, minor or patch) and let npm work out the bump. This means we're less likely to make a mistake.

So, chain what npm version does with what our npm script will do if you rename it version: you get

  • bump the package.json correctly
  • bump the package-lock.json correctly
  • update the CHANGELOG.md file
  • generate the new tag
  • commit the change using the version as the message

So now our process when generating a new release can now be

  • decide on the change type
  • run npm version [major|minor|patch]
  • check the changes
  • push the commit to main
  • push the new tag using git push --tags

Less commands, much simpler, and less likely to cause an error because we mistyped a version number. It also ensures both package files are updated.

  • water-abstraction-import
  • water-abstraction-permit-repository
  • water-abstraction-reporting
  • water-abstraction-returns
  • water-abstraction-service
  • water-abstraction-tactical-crm
  • water-abstraction-tactical-idm
  • water-abstraction-ui
  • water-abstraction-system
Cruikshanks added a commit to DEFRA/water-abstraction-tactical-crm that referenced this issue Oct 20, 2022
DEFRA/water-abstraction-team#59

We realised that the previous name for the script was intentional. It was so that it would be automatically kicked off when `npm version` was called from the command line.

Using `npm version` not only means the `package-lock.json` gets updated as well, but it also generates the correct tag for us. Finally, we can just decide the change type (major, minor or patch) and let npm work out the bump. This means we're less likely to make a mistake.

So now our process when generating a new release will be

- decide on the change type
- run `npm version [major|minor|patch]`
- check the changes
- push the commit

Much simpler as we don't need to be specific with version numbers.
Jozzey added a commit to DEFRA/water-abstraction-import that referenced this issue Oct 20, 2022
DEFRA/water-abstraction-team#59

We realised that the previous name for the script was intentional. It was so that it would be automatically kicked off when `npm version` was called from the command line.

Using `npm version` not only means the `package-lock.json` gets updated as well, but it also generates the correct tag for us. Finally, we can just decide the change type (major, minor or patch) and let npm work out the bump. This means we're less likely to make a mistake.

So now our process when generating a new release will be

- decide on the change type
- run `npm version [major|minor|patch]`
- check the changes
- push the commit

Much simpler as we don't need to be specific with version numbers.
Cruikshanks added a commit to DEFRA/water-abstraction-tactical-idm that referenced this issue Oct 20, 2022
DEFRA/water-abstraction-team#59

We realised that the previous name for the script was intentional. It was so that it would be automatically kicked off when `npm version` was called from the command line.

Using `npm version` not only means the `package-lock.json` gets updated as well, but it also generates the correct tag for us. Finally, we can just decide the change type (major, minor or patch) and let npm work out the bump. This means we're less likely to make a mistake.

So now our process when generating a new release will be

- decide on the change type
- run `npm version [major|minor|patch]`
- check the changes
- push the commit

Much simpler as we don't need to be specific with version numbers.
Cruikshanks added a commit to DEFRA/water-abstraction-ui that referenced this issue Oct 20, 2022
DEFRA/water-abstraction-team#59

We realised that the previous name for the script was intentional. It was so that it would be automatically kicked off when `npm version` was called from the command line.

Using `npm version` not only means the `package-lock.json` gets updated as well, but it also generates the correct tag for us. Finally, we can just decide the change type (major, minor or patch) and let npm work out the bump. This means we're less likely to make a mistake.

So now our process when generating a new release will be

- decide on the change type
- run `npm version [major|minor|patch]`
- check the changes
- push the commit

Much simpler as we don't need to be specific with version numbers.
Jozzey added a commit to DEFRA/water-abstraction-permit-repository that referenced this issue Oct 20, 2022
DEFRA/water-abstraction-team#59

We realised that the previous name for the script was intentional. It was so that it would be automatically kicked off when `npm version` was called from the command line.

Using `npm version` not only means the `package-lock.json` gets updated as well, but it also generates the correct tag for us. Finally, we can just decide the change type (major, minor or patch) and let npm work out the bump. This means we're less likely to make a mistake.

So now our process when generating a new release will be

- decide on the change type
- run `npm version [major|minor|patch]`
- check the changes
- push the commit

Much simpler as we don't need to be specific with version numbers.
Cruikshanks added a commit to DEFRA/water-abstraction-returns that referenced this issue Oct 20, 2022
DEFRA/water-abstraction-team#59

We realised that the previous name for the script was intentional. It was so that it would be automatically kicked off when `npm version` was called from the command line.

Using `npm version` not only means the `package-lock.json` gets updated as well, but it also generates the correct tag for us. Finally, we can just decide the change type (major, minor or patch) and let npm work out the bump. This means we're less likely to make a mistake.

So now our process when generating a new release will be

- decide on the change type
- run `npm version [major|minor|patch]`
- check the changes
- push the commit

Much simpler as we don't need to be specific with version numbers.
Jozzey added a commit to DEFRA/water-abstraction-service that referenced this issue Oct 20, 2022
DEFRA/water-abstraction-team#59

We realised that the previous name for the script was intentional. It was so that it would be automatically kicked off when `npm version` was called from the command line.

Using `npm version` not only means the `package-lock.json` gets updated as well, but it also generates the correct tag for us. Finally, we can just decide the change type (major, minor or patch) and let npm work out the bump. This means we're less likely to make a mistake.

So now our process when generating a new release will be

- decide on the change type
- run `npm version [major|minor|patch]`
- check the changes
- push the commit

Much simpler as we don't need to be specific with version numbers.
@Cruikshanks Cruikshanks changed the title Argh! Revert changelog script change with improvements Oct 20, 2022
@Cruikshanks Cruikshanks added the housekeeping Refactoring, tidying up or other work which supports the project label Oct 20, 2022
Cruikshanks added a commit to DEFRA/water-abstraction-ui that referenced this issue Oct 20, 2022
DEFRA/water-abstraction-team#59

We realised that the previous name for the script was intentional. It was so that it would be automatically kicked off when `npm version` was called from the command line.

Using `npm version` not only means the `package-lock.json` gets updated as well, but it also generates the correct tag for us. Finally, we can just decide the change type (major, minor or patch) and let npm work out the bump. This means we're less likely to make a mistake.

So now our process when generating a new release will be

- decide on the change type
- run `npm version [major|minor|patch]`
- check the changes
- push the commit

Much simpler as we don't need to be specific with version numbers.
Cruikshanks added a commit to DEFRA/water-abstraction-returns that referenced this issue Oct 20, 2022
DEFRA/water-abstraction-team#59

We realised that the previous name for the script was intentional. It was so that it would be automatically kicked off when `npm version` was called from the command line.

Using `npm version` not only means the `package-lock.json` gets updated as well, but it also generates the correct tag for us. Finally, we can just decide the change type (major, minor or patch) and let npm work out the bump. This means we're less likely to make a mistake.

So now our process when generating a new release will be

- decide on the change type
- run `npm version [major|minor|patch]`
- check the changes
- push the commit

Much simpler as we don't need to be specific with version numbers.
Cruikshanks added a commit to DEFRA/water-abstraction-tactical-crm that referenced this issue Oct 20, 2022
DEFRA/water-abstraction-team#59

We realised that the previous name for the script was intentional. It was so that it would be automatically kicked off when `npm version` was called from the command line.

Using `npm version` not only means the `package-lock.json` gets updated as well, but it also generates the correct tag for us. Finally, we can just decide the change type (major, minor or patch) and let npm work out the bump. This means we're less likely to make a mistake.

So now our process when generating a new release will be

- decide on the change type
- run `npm version [major|minor|patch]`
- check the changes
- push the commit

Much simpler as we don't need to be specific with version numbers.
Cruikshanks added a commit to DEFRA/water-abstraction-tactical-idm that referenced this issue Oct 20, 2022
DEFRA/water-abstraction-team#59

We realised that the previous name for the script was intentional. It was so that it would be automatically kicked off when `npm version` was called from the command line.

Using `npm version` not only means the `package-lock.json` gets updated as well, but it also generates the correct tag for us. Finally, we can just decide the change type (major, minor or patch) and let npm work out the bump. This means we're less likely to make a mistake.

So now our process when generating a new release will be

- decide on the change type
- run `npm version [major|minor|patch]`
- check the changes
- push the commit

Much simpler as we don't need to be specific with version numbers.
Jozzey added a commit to DEFRA/water-abstraction-import that referenced this issue Oct 20, 2022
DEFRA/water-abstraction-team#59

We realised that the previous name for the script was intentional. It was so that it would be automatically kicked off when `npm version` was called from the command line.

Using `npm version` not only means the `package-lock.json` gets updated as well, but it also generates the correct tag for us. Finally, we can just decide the change type (major, minor or patch) and let npm work out the bump. This means we're less likely to make a mistake.

So now our process when generating a new release will be

- decide on the change type
- run `npm version [major|minor|patch]`
- check the changes
- push the commit

Much simpler as we don't need to be specific with version numbers.
Jozzey added a commit to DEFRA/water-abstraction-permit-repository that referenced this issue Oct 20, 2022
DEFRA/water-abstraction-team#59

We realised that the previous name for the script was intentional. It was so that it would be automatically kicked off when `npm version` was called from the command line.

Using `npm version` not only means the `package-lock.json` gets updated as well, but it also generates the correct tag for us. Finally, we can just decide the change type (major, minor or patch) and let npm work out the bump. This means we're less likely to make a mistake.

So now our process when generating a new release will be

- decide on the change type
- run `npm version [major|minor|patch]`
- check the changes
- push the commit

Much simpler as we don't need to be specific with version numbers.
Jozzey added a commit to DEFRA/water-abstraction-service that referenced this issue Oct 20, 2022
DEFRA/water-abstraction-team#59

We realised that the previous name for the script was intentional. It was so that it would be automatically kicked off when `npm version` was called from the command line.

Using `npm version` not only means the `package-lock.json` gets updated as well, but it also generates the correct tag for us. Finally, we can just decide the change type (major, minor or patch) and let npm work out the bump. This means we're less likely to make a mistake.

So now our process when generating a new release will be

- decide on the change type
- run `npm version [major|minor|patch]`
- check the changes
- push the commit

Much simpler as we don't need to be specific with version numbers.
Cruikshanks added a commit to DEFRA/water-abstraction-helpers that referenced this issue Nov 25, 2022
DEFRA/water-abstraction-team#59

In all our repos we need to bump versions, generate CHANGELOG files, create tags and mark releases. This applies to the helpers as well, but it seems it doesn't have the support the other repos have.

To bump a node project you can run `npm version`. This bumps the version in the `package.json` as well as the `package-lock.json`. It also generates the correct git tag. It also means we can just decide the change type (major, minor or patch) and let npm work out the bump. That way we're less likely to make a mistake.

If you add a script in named `version:` npm will automatically run it after you have called `npm version`. It's here our other repos update the CHANGELOG.md automatically. This change updates the helpers to have the same hook.

So now our process when generating a new helpers release will be

- decide on the change type
- run `npm version [major|minor|patch]`
- check the changes
- push the commit

Much simpler as we don't need to be specific with version numbers.
Cruikshanks added a commit to DEFRA/water-abstraction-helpers that referenced this issue Nov 25, 2022
DEFRA/water-abstraction-team#59

In all our repos we need to bump versions, generate CHANGELOG files, create tags and mark releases. This applies to the helpers as well, but it seems it doesn't have the support the other repos have.

To bump a node project you can run `npm version`. This bumps the version in the `package.json` as well as the `package-lock.json`. It also generates the correct git tag. It also means we can just decide the change type (major, minor or patch) and let npm work out the bump. That way we're less likely to make a mistake.

If you add a script in named `version:` npm will automatically run it after you have called `npm version`. It's here our other repos update the CHANGELOG.md automatically. This change updates the helpers to have the same hook.

So now our process when generating a new helpers release will be

- decide on the change type
- run `npm version [major|minor|patch]`
- check the changes
- push the commit

Much simpler as we don't need to be specific with version numbers.
Cruikshanks added a commit to DEFRA/hapi-pg-rest-api that referenced this issue Nov 29, 2022
DEFRA/water-abstraction-team#59

Update our post `npm version` script to be consistent with our other repos. Main benefit is we no longer need to have `auto-changelog` as a dependency.
Cruikshanks added a commit to DEFRA/hapi-pg-rest-api that referenced this issue Dec 2, 2022
DEFRA/water-abstraction-team#59

Update our post `npm version` script to be consistent with our other repos. The main benefit is we no longer need to have `auto-changelog` as a dependency.
@Cruikshanks
Copy link
Member Author

We finally implemented this in water-abstraction-system in Add support for versioning the repo.

Happy to mark this issue as done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Refactoring, tidying up or other work which supports the project
Projects
None yet
Development

No branches or pull requests

1 participant