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

release-tool

v0.2.2

Published

Release Tool

Downloads

18

Readme

release-tool

NPM Build Status

release-tool is a tool for releasing software. It supports bumping version numbers in JavaScript projects out-of-the-box, but is otherwise generic enough to release any kind of software.

npm install --save-dev release-tool

Usage

By default, the tool runs in an interactive mode. It will prompt you for the version numbers and plans you want to execute before confirming whether or not to proceed.

$ ./node_modules/.bin/release --help

  Usage: release [Options...] [CURRENT_VERSION] [RELEASE_VERSION|NEXT_VERSION] \
             [DEVELOPMENT_VERSION]

  release is a tool for releasing software. It supports bumping version numbers
  in JavaScript projects out-of-the-box, but is otherwise generic enough to
  release any kind of software. Run release with no arguments for interactive
  mode.

  For more information, refer to the README.

  Options:

    -h, --help             output usage information
    -V, --version          output the version number
    -b, --branch [branch]  the branch to release from (defaults to the current branch)
    --bump                 bump CURRENT_VERSION to NEXT_VERSION
    -n, --non-interactive  run in non-interactive mode (e.g., in a script)
    -p, --publish          execute the publish plan
    -s, --slug             specify the repository slug (owner_name/repo_name)
    -t, --token            assign the Travis CI token to use
    -x, --execute          execute the plans (defaults to true unless using Travis CI)

--bump

The tool also bundles a "bump" subcommand for updating version numbers in supported types of software projects (currently only JavaScript). It will bump the version number in package.json (and bower.json, if it exists) from version CURRENT_VERSION to version NEXT_VERSION:

$ ./node_modules/.bin/release --bump ${CURRENT_VERSION} ${NEXT_VERSION}

.release.json

The tool executes up to three types of plans on your Software:

  1. Release: create a Release (or Release Candidate) of the Software.
  2. Development: continue a Development Version (or "snapshot") of the Software.
  3. Publish: publish a Release of the Software.

These plans are described in a .release.json file where you can specify exactly what should happen in each plan.

For example, the tool's own .release.json specifies that, in order to create a Release, the version number must be bumped before committing and tagging the software. In order to continue a Development Version, the version number must be bumped before committing the Software.

{
  "type": "JavaScript",
  "travis": true,
  "slug": "markandrus/release-tool",
  "env": {
    "GH_REF": "github.com/markandrus/release-tool.git"
  },
  "plans": {
    "release": {
      "env": {
        "GIT_USER_NAME": "travis-ci",
        "GIT_USER_EMAIL": "[email protected]"
      },
      "commands": [
        "node ./node_modules/.bin/release --bump ${CURRENT_VERSION} ${RELEASE_VERSION}",
        "git config user.name \"${GIT_USER_NAME}\"",
        "git config user.email \"${GIT_USER_EMAIL}\"",
        "git add .",
        "git commit -m \"Release ${RELEASE_VERSION}\"",
        "git tag ${RELEASE_VERSION}"
      ]
    },
    "development": {
      "commands": [
        "node ./node_modules/.bin/release --bump ${RELEASE_VERSION} ${DEVELOPMENT_VERSION}",
        "git add .",
        "git commit -m \"Continue development on ${DEVELOPMENT_VERSION}\""
      ]
    },
    "publish": {
      "commands": [
        "git remote set-url origin \"https://${GH_TOKEN}@${GH_REF}\"",
        "git rebase HEAD ${BRANCH}",
        "git push origin ${BRANCH} --tags",
        "git checkout ${RELEASE_VERSION}"
      ]
    }
  }
}

Environment Variables

Variables can be assigned in the top-level or plan-level "env" sections. Any unassigned variables referenced in a plan's commands can be overridden by the environment or command-line arguments. All other assigned variables are fixed and cannot be overridden except in the .release.json itself.

Travis CI

If you set the property "travis" to true in the top-level of your software's .release.json, then the tool will not execute any plans locally; instead, it will POST a request to Travis CI in order to execute the plans. You can also set the property to "pro".

Be very careful not to leak any sensitive data.