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

@evan361425/version-bumper

v1.1.4

Published

Helper to bump version

Downloads

67

Readme

Version Bumper

Yet, another helper for bumping version.

Features:

  • Changelog
  • Hooking: before commit, before, after scripts
  • Autolink for tickets (e.g. Jira)
  • GitHub PR
  • GitHub release
  • Highly flexible by configuration
  • Tiny without any dependencies

Usage

Install it globally or in specific project.

# Globally
npm i -g @evan361425/version-bumper
# In project
npm i -D @evan361425/version-bumper

You can see command's details by:

$ bumper help
Usage: (npx) bumper <command> [args]
Commands
        (default) Update the version of NPM project
        version   Show the installed and latest version
        deps      Update dependencies with hooking
        help      Show this message
        init      Setup configuration files

Args:
        -h, --help Show command's arguments
        -v, --version version info

Usually, you will need to init for a new project:

$ bumper init
File bumper.json for configuration creating!
File docs/LATEST_VERSION.md for latest version info creating!
File CHANGELOG.md for changelog creating!

Args

Add -h/--help to get information on command:

$ bumper deps -h | less
Usage: (npx) bumper deps [args]
Args:
...

Configuration

You should add ./bumper.json on the project root folder, else set it by the arguments.

The JSON file is follow the ./schema.json's schema. After bumper init, you should automatically bind to the schema.

You can see the schema prettier in JSON Schema Viewer

You can start by bumper init or write it yourself, for example:

{
  // Please go to https://json-schema.app/view/%23/%23%2Fproperties%2Fdeps?url=https%3A%2F%2Fraw.githubusercontent.com%2Fevan361425%2Fversion-bumper%2Fmaster%2Fschema.json
  // for better description!
  "$schema": "node_modules/@evan361425/version-bumper/schema.json",
  "repoLink": "https://github.com/example/example", // default using current repo
  "beforeCommit": [
    "npm version --no-git-tag-version --no-commit-hooks {tag}"
  ],
  "changelog": {
    "header": "# Changelog\n\nThis is my awesome changelog.",
    "template": "ticket: {ticket}\n\n{content}",
    "commitMessage": "chore: bump to {version}\n\nticket: {ticket}\nstage: {stage}"
  },
  "tags": {
    "develop": {
      "pattern": "beta\\d+"
    },
    "staging": {
      "pattern": "v[0-9]+.[0-9]+.[0-9]+-rc\\d+"
    },
    "production": {
      "pattern": "v[0-9]+.[0-9]+.[0-9]+",
      "changelog": true, // Edit changelog and commit/push it
      "release": {
        "enable": true // GitHub Release
      }
    }
  },
  "pr": {
    "repo": "example/other-repo",
    "template": "This PR is auto-generated from bumper\n\n- ticket: {ticket}\n- stage: {stage}\n- version: {version}\n- [diff]({diff})\n\n{content}",
    "branches": {
      "develop": {
        "base": "deploy/develop",
        "head": "master"
      },
      "staging": {
        "base": "deploy/staging",
        "head": "deploy/develop",
        "labels": ["staging"],
        "reviewers": ["some-guy"]
      },
      "production": {
        "base": "deploy/production",
        "head": "deploy/staging",
        "labels": ["production"],
        "siblings": {
          "dr": {
            "head": "deploy/dr",
            "labels": ["dr"]
          }
        }
      }
    }
  },
  "deps": {
    "latestDeps": ["*"],
    "postCommands": [
      "npm run test",
      "git add package.json package-lock.json",
      ["git", "commit", "-m", "chore: bump {name} to {target}\n\nOrigin: {current}"]
    ],
    "ignored": ["some-package", "dev-package"],
    "appendOnly": true,
    "useExact": true,
    "output": "docs/LATEST_UPGRADE.md",
    "dev": {
      "postCommands": [
        "npm run test",
        "git add package.json package-lock.json",
        ["git", "commit", "-m", "chore(dev): bump dev-deps"]
      ]
    }
  }
}

Priority

Arguments can be sent in environment/command/file (see details in bumper <command> -h).

The highest priority will be the environment variables, and the lowest priority will be the settings in configuration file.

Env > Command > Configuration file

Changelog

Changelog using bellow format:

{changelog.header}

- [Unreleased]

Please check git diff.

- [{tag1}] - {date1}

{template}

- [{tag2}] - {date2}

{template}

[unreleased]: {diff}
[{tag1}]: {diff1}
[{tag2}]: {diff2}

Set the format by --changelogTemplate or changelog.template in configuration, for example:

- ticket: {ticket}
- version: {version}
- stage: {stage}
- [diff]({diff})

{content}