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

should-release-it

v1.1.0

Published

Check if should release new version by looking at the commits using conventional commits

Downloads

4

Readme

🚩 Table of Contents

🚀 Introduction

When releasing using release-it you might want to release only if the commits messages have meaningful changes.

This script analyzes the commit messages using conventional commits to check if a new release is necessary.

It looks for the @release-it/conventional-changelog plugin and get the types defined there, the ones that are hidden will not trigger a release.

"plugins": {
  "@release-it/conventional-changelog": {
    "preset": "conventionalcommits",
    "types": [
      { "type": "feat", "section": "Features" },
      { "type": "fix", "section": "Bug Fixes" },
      { "type": "perf", "section": "Performance Improvements" },
      { "type": "revert", "section": "Reverts" },
      { "type": "docs", "section": "Documentation", "hidden": true },
      { "type": "style", "section": "Styles", "hidden": true },
      { "type": "chore", "section": "Miscellaneous Chores", "hidden": true },
      { "type": "refactor", "section": "Code Refactoring", "hidden": true },
      { "type": "test", "section": "Tests", "hidden": true },
      { "type": "build", "section": "Build System", "hidden": true },
      { "type": "ci", "section": "Continuous Integration", "hidden": true }
    ]
  }
}

🔧 Installation

There's no need to install should-release-it, you can use it with npx.

📖 Usage

npx should-release-it <options>
$ npx should-release-it && npm run release-it

Output with no meaningful commits

$ npx should-release-it
» [6:08:53 PM] [should-release-it] › ℹ  Should NOT trigger a release: ci: update workflow
» [6:08:53 PM] [should-release-it] › ℹ  No meaningful commits found, we should not release

Output that should trigger release

$ npx should-release-it
» [11:27:49 PM] [should-release-it] › ℹ  Should NOT trigger a release: ci: clean up workflow
» [11:27:49 PM] [should-release-it] › ℹ  Should trigger a release: feat: update dashboard
» [11:27:49 PM] [should-release-it] › ℹ  Found at least one commit that require a release, we should release

Use on CI:

- name: Check if should release
  run: |
    npx should-release-it || exit 0
    npm run release
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# OR

- name: Check if should release
  id: should-release
  run: |
    if npx should-release-it; then
      echo "value=true" >> $GITHUB_OUTPUT
    else
      echo "value=false" >> $GITHUB_OUTPUT
    fi

Options

| Argument | Description | Type | |-------------------|--------------------------------------------------------------------------------------------------|----------| | --current-version | Version to use when getting git log, if not provided will use the one on package.json. | [string] | | --release-it-dir | Directory to search for the release-it config file, defaults to the current working directory. | [string] | | --silent | Mute logs. | |

💬 Contributing

Would like to help make this package better? Please take a look at the contributing guidelines for a detailed explanation on how you can contribute.

❤️ Acknowledgments

I'd like thank my daily coffee!