Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

changelog-safeguard

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

changelog-safeguard

Checks/updates the CHANGELOG.md file

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
Maintainers
0
Weekly downloads
 
Created
Source

ChangeLog Safeguard

CI Tests status

This utility makes sure the CHANGELOG.md file is updated before issuing a new version with npm version.

It requires to have a "# Dev" section at the beginning of the file, and changes it in "# Version x.x.x" according to the new version number.

Getting Started

First, install changelog as a development dependency using npm:

npm install --save-dev changelog-safeguard

Or install it globally:

npm install --global changelog-safeguard

Add it to your version scripts

In package.json:

"scripts": {
  "preversion": "changelog check",
  "version": "changelog update && git add CHANGELOG.md"
}

The preversion script will then reject an obsolete CHANGELOG.md file before npm version updates the package[-lock].json files. Then the version script will update the file and stage it for the version commit.

Issuing new versions of your project

Before using npm version, make sure your CHANGELOG.md file has a "DEV" section at the beginning, otherwise it will be rejected.

# Dev
- The new changes

# Version 1.0.0
- The previous changes

Afterwards, CHANGELOG.md will be updated with the new version number and added to the version commit (if the version script contains git add CHANGELOG.md like recommended above):

# Version 2.0.0
- The new changes

# Version 1.0.0
- The previous changes

The update is only for major, minor and patch versions. It ignores any kind of pre-release (version with a dash like 2.0.0-pre).

Author notes

I just wanted a safeguard to avoid forgetting to keep the change log up-to-date.

Therefore, I kept it as simple as possible. I didn't want to gather Git commit messages either, as they are more relevent for the developers than for the users. But if it is what you are looking for, there are some packages that can take care of it for you.

I will still improve this tool. Suggestions and contributions are welcome.

Keywords

FAQs

Package last updated on 31 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc