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

cz-customizable-ghooks

v2.0.0

Published

Integrate [cz-customizable](https://github.com/leoforfree/cz-customizable) config with [ghooks](https://github.com/gtramontina/ghooks) or [husky](https://github.com/typicode/husky) to use a single configuration for commit message generation AND commit mes

Downloads

52,556

Readme

cz-customizable-ghooks

Integrate cz-customizable config with ghooks or husky to use a single configuration for commit message generation AND commit message validation.

Build Status

NPM Version semantic-release Coverage Status Dependencies status Dev-dependencies status Commitizen friendly

Purpose

This package validates that a git commit message matches the rules defined in your cz-customizable config file (see cz-customizable). Example commit message rules.

Prerequisites

Make sure you have a git repository (git init) BEFORE installing ghooks, otherwise you have to take extra steps if you install ghooks before running git init.

Installation

This package is designed to be used in conjunction with commitizen, cz-customizable and either ghooks or husky.

  1. Install pre-requisites (if not already installed):
npm i commitizen -g
npm i cz-customizable cz-customizable-ghooks
  1. Configure cz-customizable in package.json:
"config": {
  "cz-customizable": {
    "config": "path/to/your/cz-customizable-rules.js"
  }
}
  1. Install ONE of these git hook packages:
  1. Install ghooks:
npm i ghooks
  1. Configure package.json:
"config": {
  "ghooks": {
    "commit-msg": "cz-customizable-ghooks $2"
  }
}

An example of this setup is in examples/ghooks.

  1. Install husky:
npm i husky
  1. Configure package.json:
  "husky": {
    "hooks": {
      "commitmsg": "cz-customizable-ghooks"
    }
  }

An example of this setup is in examples/husky.

Usage

Commit your changes to git as normal. If the commit message entered is invalid, the commit will be rejected with an error message (according to the rules specified in your cz-customizable config). Works with git command-line and visual Git tools (such as SourceTree).

Additional config

appendIssueFromBranchName

If this config value is set to true, the git branch name is queried, and an attempt is made to parse the branch name, looking for the ticketNumberPrefix and ticketNumberRegExp values. If found, they are appended to the commit message. If the branch name does not match the ticketNumberPrefix and ticketNumberRegExp expression, or if ticketNumberPrefix and ticketNumberRegExp are not provided, the full branch name is appended to the commit message.

This property was previously called appendBranchNameToCommitMessage.

Debugging

You can turn on debug logging by specifying LOGGING_LEVEL=debug before the cz-customizable-ghooks command.