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

@bassist/commit

v0.1.1

Published

Simple Commit Lint by @chengpeiquan .

Downloads

75

Readme

@bassist/commit

Simple Commit Lint by @chengpeiquan .

Usage

Please configure Git Hooks management tools based on Husky or simple-git-hooks in advance in your project.

Take Husky as an example:

  1. Initialize Husky configuration according to getting-started documentation
pnpm add -D husky
pnpm exec husky init
  1. Run the following command on the command line to add the check script to the commit-msg hook:
npx husky set .husky/commit-msg 'npx @bassist/commit "$1"'

If this package is installed locally (e.g. devDependencies ), it can also be called through the commit alias.

pnpm add -D @bassist/commit
npx husky set .husky/commit-msg 'pnpm exec commit "$1"'

FAQ

  • Q: hook was ignored because it's not set as executable

A: solve it with the command below (See: #1177).

chmod ug+x .husky/*

Git Commit Message Convention

This is the most popular commit message specification in the world (See: Angular's commit convention).

Whether it is large open source projects or technical teams of large companies, this specification is basically used. Following it will make your work more professional.

In some work scenarios, combined with automated tools, these standardized commit messages can shorten your work time (See: Related tools).

TL;DR:

Messages must be matched by the following regex:

/^(revert: )?(feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip)(\(.+\))?: .{1,50}/

Examples

Appears under "Features" header, utils subheader:

feat(utils): add 'formatTime' to format the time as 'yyyy-MM-dd HH:mm:ss'

Appears under "Bug Fixes" header, eslint subheader, with a link to issue #24:

fix(eslint): fix some misconfigurations for React rules

close #24

Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation:

perf(node-utils): enable more new Node.js features

BREAKING CHANGE: Drop support for Node 14.

The following commit and commit afbd143 do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header.

revert: feat(eslint): add some APIs exports

This reverts commit afbd1436b6b09035f3c17c16daec0493eff54b6d.

Full Message Format

A commit message consists of a header, body and footer. The header has a type, scope and subject:

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

The header is mandatory and the scope of the header is optional.

Revert

If the commit reverts a previous commit, it should begin with revert: , followed by the header of the reverted commit. In the body, it should say: This reverts commit <hash>., where the hash is the SHA of the commit being reverted.

Type

If the prefix is feat, fix or perf, it will appear in the changelog. However, if there is any BREAKING CHANGE, the commit will always appear in the changelog.

Other prefixes are up to your discretion. Suggested prefixes are docs, chore, style, refactor, and test for non-changelog related tasks.

Scope

The scope could be anything specifying the place of the commit change. For example utils, node-utils, eslint, uno, tsconfig etc...

Usually classified according to functional modules, if it is Monorepo, it is classified more according to Packages.

Subject

The subject contains a succinct description of the change:

  • use the imperative, present tense: "change" not "changed" nor "changes"
  • don't capitalize the first letter
  • no dot (.) at the end

Body

Just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.

Footer

The footer should contain any information about Breaking Changes and is also the place to reference GitHub issues that this commit Closes.

Breaking Changes should start with the word BREAKING CHANGE: with a space or two newlines. The rest of the commit message is then used for this.

Related tools

A tool to analyze your git repository's commit log. It can help you generate daily/weekly or longer work reports.

In the form of programming, combined with Git Tags and CI/CD, a CHANGELOG is generated based on the commit message.

Release Notes

Please refer to CHANGELOG for details.

License

MIT License © 2023-PRESENT chengpeiquan