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

@sliit-foss/automatic-versioning

v2.3.4

Published

A script which will automatically increment your app package version in accordance with conventional commits

Downloads

223

Readme

@sliit-foss/automatic-versioning

A script which will automatically increment your app package version in accordance with conventional commits


Why automatic-versioning

  • Most version bumping scripts only focus on just the version bumping. automatic-versioning takes into account your git changes and automatically increments the version number based on your last commit message only if there are changes in your directory, a feature which is highly useful in monorepos.

Prerequisites

  • Git installed and configured

Installation

# using npm
npm install @sliit-foss/automatic-versioning

# using yarn
yarn add @sliit-foss/automatic-versioning

Usage

  • Add the following script to your package.json
  "scripts": {
      "bump-version": "npx automatic-versioning --name=<package_name>"
  }
  • then:
# using npm
npm run bump-version

# using yarn
yarn bump-version

Usage with commitlint and husky

  • Install the following dependencies

  "dependencies": {
    "@commitlint/cli": "^17.0.1",
    "@commitlint/config-conventional": "^17.0.0",
    "husky": "^4.3.8"
  }
  • Add the following to your package.json

  "config": {
    "commitizen": {
      "path": "cz-conventional-changelog"
    }
  },
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
      "post-commit": "HUSKY_SKIP_HOOKS=1 yarn bump-version",
    }
  },
  "commitlint": {
    "extends": [
      "@commitlint/config-conventional"
    ]
  }

Commit message prefixes and associated version bumping

    - Feature! | Feat! | Fix! | Patch!     - bump major version
    - Feature | Feat                       - bump minor version
    - Fix | Patch                          - bump patch version

Skip commit

  • By default automatic-versioning will commit the newly incremented version to source control. To disable this behavior, add the following to your script: "--skip-commit"
  npx automatic-versioning --name=<package_name> --skip-commit

Disable version bumping for specific commit

  git commit -m "Feat: some feature --no-bump"

Custom app directory to run versioning script

  npx automatic-versioning --name=<package_name> --root=<custom_dir>

Recursively search commit history to find a supporting prefix to trigger a version bump

  npx automatic-versioning --name=<package_name> --recursive

Prerelease branch

  • If this option is specified and the current branch matches it, the versioning will be evaluated as follows

    • Feat! --> Premajor
    • Feat --> Preminor
    • Fix --> Prepatch
  npx automatic-versioning --name=<package_name> --prerelease-branch=<branch_name>

Prerelease

  • If this is specified, the versioning will always be one of prerelease, premajor, preminor or prepatch depending on the above commit mapping
  npx automatic-versioning --name=<package_name> --prerelease

Custom prerelease tag

  npx automatic-versioning --name=<package_name> --prerelease-tag=<name>

Ignore prefixes

  • A list of comma separated prefixes to ignore when evaluating the commit message. By default we stop searching for commits once we come across any prefix considered by commitlint as valid prefixes. You can use this option to ignore a few of them if the need arises
  npx automatic-versioning --name=<package_name> --ignore-prefixes=ci,docs

Migration from V1 to V2

  • --no-commit-edit option has been removed as commits no longer cause problems with the versioning script
  • --no-commit option has been renamed to --skip-commit