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

smart-commit

v2.1.1

Published

Commitizen adapter for easy, sensible Git commit messages.

Downloads

4

Readme

Smart Commit

Introduction

Smart Commit is an adapter for Commitizen.

Commitizen is a command line utility that formats Git commit messages by prompting the committer with questions.

Setup

In order to use Smart Commit you must:

  • Install Commitizen globally.
  • Initialize Commitizen & the Smart Commit adapter in your repo.

First, install Commitizen globally.

npm install -g commitizen

Next, navigate into your project's directory and initialize Commitizen.

commitizen init smart-commit --save --save-exact

This command installs the smart-commit adapter, saves it to your package.json dependencies or devDependencies, and adds the config.commitizen key:

...
  "config": {
    "commitizen": {
      "path": "node_modules/smart-commit"
    }
  }

Any developers (using Commitizen) that contribute to this repo will be shown the Smart Commit prompt.

Usage

  1. Type git cz instead of git commit when committing.
  2. Follow the instructions in the prompt.
  3. Review your formatted commit message and choose to commit, edit, or cancel.

Choosing to edit your commit will open your formatted commit message in your default EDITOR.

Commit Message Format

Commits are, generally, formatted as follows:

<type> <scope>: <Subject>

<body>

BREAKING-CHANGE:
<description>

CLOSES: <issue>
PAIRED-WITH: <Name>, ...

A commit message consists of a header, body, and a footer.

Header

The header includes the type, scope, and subject of the commit.

<type> <scope>: <Subject>

It must be less than 69 characters in length.

Type

Commit type can only be one of the following:

feature:     A new feature.
fix:         A bug fix.
docs:        A change to documentation or comments only.
style:       A change that does not affect the meaning of the code (white-space, alignment, etc).
refactor:    A change that neither fixes a bug nor adds a feature.
performance: A change that improves performance.
test:        Add test(s).
chore:       A change to the build process, auxiliary tools, libraries, etc.

Scope

The scope of a commit specifies the location or target of the changes. This could be a filename, function name, or some other identifier for the general area of the code being modified.

Subject

The subject contains a succinct description of the changes being committed.

It should

  • Be <= 50 characters long
  • Use the imperative, present tense (ie. "Change" not "Changed" nor "Changes").

A subject should not include a period (.) at the end.

Subject Length

Keeping subject lines at this length ensures that they are readable, and forces the author to think for a moment about the most concise way to explain what's going on.

Tip: If you're having a hard time summarizing, you might be committing too many changes at once.

Subject Tense

Imperative means "spoken or written as if giving a command or instruction".

A few examples:

  • Clean your room
  • Close the door
  • Take out the trash

A properly formed git commit subject line should always be able to complete the following sentence:

If applied, this commit will your subject here.

chris.beams.io

Example Headers

docs README.md: Add setup instructions

style userDashboard.js: Replace tabs with soft tabs (2 spaces)

feat login(): Implement validation for login credentials

Body

The body is a detailed description of the change(s) being committed. It should:

  • Explain the problem that the change tries to solve (i.e., What is wrong with the current code without the change?).
  • Justify the way the change solves the problem (i.e., Why the result with the change is better).
  • List alternate solutions considered but discarded, if any.

Example Bodies

The such-and-such in so-and-so file was returning data that was
yada-yada-yada. This caused the fizz in buzz to woof.

This implements bingbang in such-and-such function in order to ensure
the data returned is bongo.
The blerg check in fleepflorp had an off by 1 error. This would cause
it to access uninitialized memory if it was the last argument.

Adding a fingle causes blerg to display an error message and the usage
string instead.

Footer

The footer is optional.

It includes:

  • breaking changes introduced by the commit
  • issues closed by the commit
  • pair programming partners

Example Footer

BREAKING-CHANGES:

Templates are now case-sensitive and use camelCase instead of kebab-case (dash-case).

CLOSES: 276
PAIRED-WITH: Jeremy Reston