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

@crystal-ball/commit-semantics

v2.0.0

Published

🔮 Projects - Commitizen and Semantic Release configs

Downloads

316

Readme

🔮 Projects - Commit Semantics

This package is a batteries included manager for setting up standardized commit messages with Commitizen and automated CI/CD releases with Semantic Release.

  • Standardized commit messages are constructed using an interactive prompt with options for long descriptions, emojis, breaking change notes and release notes.
  • Fully automated releases include package version and changelog updates, npm publishing, and Github release comments and labels.

⚙️ Setup

1. Install

npm i -D @crystal-ball/commit-semantics husky

2. Configure package.json

{
  "config": {
    "commitizen": {
      "path": "@crystal-ball/commitizen-adapter"
    }
  },
  "husky": {
    "hooks": {
      "prepare-commit-msg": "exec < /dev/tty && git cz --hook"
    }
  },
  "release": {
    "extends": ["@crystal-ball/semantic-release-base"]
  }
}

3. Configure .github/workflows/ci-cd.yml

# Release with Semantic after tests pass on master
jobs:
  ci-cd:
    runs-on: ubuntu-latest
    steps:
      - name: Release
        if: success() && github.ref == 'refs/heads/master'
        run: npx semantic-release
        env:
          GH_TOKEN: ${{ secrets.SEMANTIC_GH_TOKEN }}
          NPM_TOKEN: ${{ secrets.SEMANTIC_NPM_TOKEN }}

This configuration will run semantic-release on any change to the master branch. Commit types of New, Update and Fix, or any commit containing a BREAKING CHANGES footer will trigger a release.

4. Configure Secret

SEMANTIC_GH_TOKEN and SEMANTIC_NPM_TOKEN access tokens for npm and Github should be added to the secrets in the repo settings.

Navigate to Secrets in settings and add the release tokens

🔖 Commit standards

Fully automated releases are only possible by following a standard commit message format that can be parsed when the release job is run. The ESLint format is used and must follow the pattern:

<tag>: <message>

The Husky prepare-commit-msg hook will execute the Commitizen prompt on each commit and using the prompts will ensure the commit is valid.

ℹ️ It is possible to skip the interactive prompts with ctrl+c as well as changing the commit after construction, but neither is recommended.

Configuration of the commitizen adapter is managed in the @crystal-ball/commitizen-adapter package.

🚀 Release tasks

On change to master Semantic Release is run and will manage:

  1. Analyze commits made since the last release to determine if a release should occur and what the version should be.
  2. Parse commits to generate a set of formatted release notes.
  3. Append release notes to the top of the project Changelog.
  4. Push a release commit and tag to Github
  5. Publish the release to NPM
  6. Publish a Github release and add comments and labels to all issues and PRs included in the release.

🔋 Included packages