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

@liferay/changelog-generator

v1.6.1

Published

Generates changelogs based on the Git commit graph

Downloads

8

Readme

@liferay/changelog-generator

A crude and unsophisticated script for generating or updating CHANGELOG.md based on the local Git history. It was born out of frustration with other tools that were limited by GitHub API throttling or unable to cope with repos with multiple active branches.

In the name of simplicity, it assumes that you are using a recent version of Node (ie. it uses modern JS with no transpilation), and it has no external dependencies other than git.

The generated changelog is based on the merge commits produced by GitHub, which means that the quality of the changelog depends on the quality of the pull request titles (please see the recommendations for producing high quality commit messages and PR titles in the liferay-frontend-guidelines repo). Additionally, if you create merge commits by hand rather than using GitHub, or if you push changes without creating merges, the results may be suboptimal.

Operates in two modes:

  • Invoked as changelog.js --version=x.y.z: will update the existing CHANGELOG.md in preparation for the "x.y.z" release by looking at changes made since the previous release and prepending them to the top.
  • Invoked as changelog.js --regenerate --version=x.y.z: will regenerate and overwrite the existing CHANGELOG.md, in preparation for the "x.y.z" release.

The idea is that is you ever want to make edits by hand you can, and the way you preserve them over time is by running git add --patch to selectively apply newly generated changes while keeping previous manual edits intact.

When run in a monorepo, it can work in two ways:

  • Run from the root of the repo, it produces a single changelog for the entire repo. This is appropriate for projects like liferay-js-themes-toolkit, where the packages in the repo are always released together.
  • Run from a packages/* subdirectory, it produces a changelog specific to that directory. It is assumed that you have a .yarnrc in each package containing a version-tag-prefix; this enables the generator to determine when each package was released and produce an accurate changelog. This is appropriate for projects like liferay-npm-tools, where the packages are versioned independently of one another and are not released together.

Installation

Either:

  • Install globally: yarn global add @liferay/changelog-generator; or:
  • Add to a project: yarn add --dev @liferay/changelog-generator; or:
  • Use the latest without installing: npx @liferay/changelog-generator (see below for usage).

Usage

liferay-changelog-generator [option...]

Options:
  --force                      [optional: disable safety checks]
  --from=FROM                  [default: previous tag]
  --to=TO                      [default: HEAD]
  --help
  --no-update-tags             [optional: disable tag prefetching]
  --outfile=FILE               [default: ./CHANGELOG.md]
  --remote-url=REPOSITORY_URL  [default: inferred]
  --regenerate                 [optional: replace entire changelog]
  --version=VERSION            [required: version being released]

Example projects using @liferay/changelog-generator

FAQ

Is this tool intended to replace Lerna or other tools in all Liferay projects?

This issue explains all this in depth, but the short version is: no, we've used the tool so far in places where we think it makes managing releases easier, but there are no plans to roll it out globally or force its use.

We use it in the projects listed above because it is a simpler and more reliable replacement for alternatives that we used in those projects in the past (eg. github_changelog_generator), or heavyweight tools like conventional-changelog which would provide similar functionality at the cost of involving an enormous dependency graph.

At first glance, this may seem like a "reinvented wheel", but we haven't invented anything; we've actually just built a small, simple wheel (a single file with zero dependencies that in essence basically boils down to a wrapper around an invocation of git log) that's well adapted to our use case.

Clay is an example of a project that currently uses Lerna. Lerna provides its own changelog functionality, among many other things, and @liferay/changelog-generator is not intended to be a replacement for all of that.