npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@glenn.fowler/changelog-next

v0.2.0

Published

Changelog generator

Downloads

114

Readme

@glenn.fowler/changelog-next

Changelog generator based on perl's Dist::Zilla distribution builder (specifically (part of) Dist::Zilla::Plugin::NextRelease) for use with npm packages.

Usage

Install the package

npm install -D @glenn.fowler/changelog-next

Create a next-changelog.tmpl template file that will serve as the basis for the actual changelog:

This is my shiny changelog!

{{NEXT}}
Security fix
Support for custom configuration

1.0.0 - 2022-01-01
The initial release, it was pretty good.

This needs a {{NEXT}} placeholder token which marks the location for you to specify the changes that belong to the current development cycle.

When the changelog generator is run, the current version and date will replace the {{NEXT}} token and this will be saved to the CHANGELOG file; the next-changelog.tmpl file will have this version & date locked in for the current changes, but will also preserve the {{NEXT}} placeholder ready for noting future changes:

Generated CHANGELOG

This is my shiny changelog!

1.1.0 - 2022-10-10
Security fix
Support for custom configuration

1.0.0 - 2022-01-01
The initial release, it was pretty good.

Updated next-changelog.tmpl

This is my shiny changelog!

{{NEXT}}

1.1.0 - 2022-10-10
Security fix
Support for custom configuration

1.0.0 - 2022-01-01
The initial release, it was pretty good.

Additional configuration

Add the generator script to your package.json's script.version section to automatically update the changelog files when running npm version:

package.json

{
	// ...
	"scripts": {
		"version": "changelog-next && git add next-changelog.tmpl CHANGELOG",
		// ...
	},
	// ...
}

To use a different changelog filename, use the -o flag (currently the available filenames are limited, see the code in filesystem.js) - update the git add code appropriately as well:

package.json

{
	// ...
	"scripts": {
		"version": "changelog-next -o CHANGELOG.md && git add next-changelog.tmpl CHANGELOG.md",
		// ...
	},
	// ...
}

Optionally prevent the changelog template from being included in your package when you publish it:

If you are using the .npmignore file you can add to it:

.npmignore

# Whatever may already be in this file
next-changelog.tmpl

Note the (potentially) unintended consequence of using a .npmignore file being that the .gitignore that may otherwise be filtering out files from your generated package will be disregarded - see https://medium.com/@jdxcode/for-the-love-of-god-dont-use-npmignore-f93c08909d8d

Otherwise you can use the files property of package.json to whitelist exactly the files you wish to be included in your package. If this seems like too much effort, you can just let the changelog template be included in the generated package - it really isn't that big a deal.

Questions

Why not just use conventional commits and generate the changelog using one of the existing packages fully automatically?

I haven't (so far) been sold on the conventional commits approach - I can see the value in it, but personally I like being able to be more flexible with commit messages, and able to precisely craft changelog items without impacting the commit log. This package is scratching my own itch, and if there are other tools that serve your needs better, great!

This package is pretty limited and inflexible; why no configuration ability?

I currently have no expectation that this will get any real usage from other people; complexity that doesn't actually help anyone doesn't seem worthwhile at this stage. If you do want to use it but are running into limitations, please create an issue (or a pull request).