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-flow

v1.2.2

Published

Git flow conventional releases

Downloads

43

Readme

release-flow

Build Status codecov

Git flow conventional releases

release-flow is a command line tool that simplifies the developer side of software release process taking over tedious and error prone tasks.

release-flow mixes git flow releases with conventional commits to make release process safe and painless.

Features

  • Based on commit conventions
  • Complements perfectly with CI tools
  • Flexible branching model
  • Pluggable design
  • Completely configurable and customizable
  • Stand-alone (gulp/grunt integration is possible)
  • Suitable for any kind of project and language (small apps, opensource projects, libs, enterprise applications)
  • Built in plugins for Changelog generation and NPM bumps

Installation

Globally (use from console)

npm i -g release-flow

As project dependency (use through npm script or programmatically)

npm i --save-dev release-flow

In your package.json

"scripts": {
  "release": "release-flow"
}

Usage

Start a release (from your development branch)

release-flow start

Effect:

  • Fetches remote changes
  • Compute the next version bump from commits (ie. feat commit === minor)
  • Validates the operation (no uncommitted/untracked changes, no existing tag for the version)
  • Creates and checks out a new release branch
  • Commits (without pushing) any eventual changes made to start the release (ie. changelog, bump package.json)

Publish a release (from the new release branch)

release-flow publish

Finalize a release (from the release branch)

release-flow finish

Effect:

  • Fetches remote changes
  • Validates the operation (no uncommitted/untracked changes)
  • Merges release branch on master
  • Tags master after the release version
  • Merges back to development (if different from master)

Start/Publish/Finish with one command (from your development branch)

release-flow full

Effect:

Same then issuing release-flow start, release-flow publish and release-flow finish in sequence.

NOTE: This approach is especially suitable for libraries and small projects that does not require a QA phase on the release branch.

Supported Branching model

release-flow supports both the canonical git-flow branching model with develop/master and a simplified branching with just master.

Git flow model (default)
// releaseflowrc
module.exports = {
  developmentBranch: "develop",
  productionBranch: "master",
};

full-git-flow

Simplified model
// releaseflowrc
module.exports = {
  developmentBranch: "master",
  productionBranch: "master",
};

simplified-git-flow

Commit conventions

Release flow uses conventional commits to simplify the release process (computing next version, generating changelogs).

Conventional commits are commits with a specific message format:

type([scope]): message [BREAKING]

ie.

  • fix(homepage): fixed title alignment
  • feat: implemented user login
  • feat(api): BREAKING changed endpoint to list users
Default bump detection logic
  • Has one commit whose message contains BREAKINGmajor
  • Has one commit whose type is feat → minor
  • Otherwise → patch

Configuration

release-flow loads a releaseflowrc javascript file to allow configuration.

The following is an extract of the default configuration file:

export default {
  developmentBranch: "develop",
  productionBranch: "master",
  releaseBranchPrefix: "release/",
  tagPrefix: "v",
  remoteName: "origin",
  logLevel: "info",
  initialVersion: "1.0.0",
  repoHttpUrl: null,
  ErrorFactory: DefaultErrorFactory,
  Logger: DefaultLogger,
  repoHttpProtocol: "https",
  getBump: getBump,
  plugins: [],
};

Included Plugins

Bump package json

Bumps package json version on start.

// releaseflowrc
module.exports = {
  plugins: ["bump-package-json"],
};
Generate changelog

Generates a changelog for the release and prepend it CHANGELOG.md or the choosen path on start.

// releaseflowrc
module.exports = {
  changelogPath: 'CHANGELOG.md'
  changelogTemplate: release => 'changelog contents'
  plugins: [
    'generate-changelog'
  ]
};

Advanced usage and plugin creation

A plugin is just a function of the form install(release) => null. To register it is enough to pass it in releaseflowrc

// releaseflowrc
module.exports = {
  plugins: [
    (release) => {
      // ... do something
    },
  ],
};

Tiplcally a plugin adds some step to a release phase (one of start, publish or finish).

A step is an object with a name and a run() function.

To attach a step to a phase is possible to use array methods like push or splice on the release.phases.[start/publish/finish].steps array or use the release.phases.[start/publish/finish].before method to insert the step before another specific step:

// releaseflowrc
module.exports = {
  plugins: [
    (release) => {
      let logVersion = {
        name: "logVersion",
        run(release) {
          console.log(release.version);
        },
      };

      release.phases.start.before("commit", logVersion);
    },
  ],
};