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

grunt-bump-build-git

v1.1.3

Published

Bump the version, build the project and add, commit and tag in git in one step.

Downloads

249

Readme

grunt bump build git

Bump the version, build the project and add, commit and tag in git in one step.

Table of contents

Getting Started

This plugin requires Grunt ~0.4.2

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-bump-build-git --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-bump-build-git');

The build task

Overview

This task allows you to bump your project version, update all available package files (package.json, bower.json, etc.), build the project with your custom tasks and the updated package config version and add, commit and tag the new release in git - all in one step.

Usage Examples

Setup

This task doesn't require any configuration setup, but allows to set custom options the following way:

In your project's Gruntfile, add a section named build to the data object passed into grunt.initConfig().

grunt.initConfig({
  build: {
    tasks: ['default'],
    packageConfig: 'pkg',
    packages: '*.json',
    jsonSpace: 2,
    jsonReplacer: undefined,
    gitAdd: '--all'
  },
})

Build test

Build the project and create a new meta version (e.g. 1.2.3+build.1382987826059):

grunt build

Releases

Build the project and bump the major version (major.minor.patch):

grunt build:major

Build the project and bump the minor version (major.minor.patch):

grunt build:minor

Build the project and bump the patch version (major.minor.patch):

grunt build:patch

Build the project and bump the version to a major/minor/patch prerelease:

grunt build:major-rc.1

Build the project and bump the prerelease version (major.minor.patch-prerelease):

grunt build:pre

Build the project with a specific semver identifier as version:

grunt build:1.2.3-rc.4+test.5

Git integration

Build the project and run git add, git commit and git tag automatically:

grunt build:patch:"Fixed #42"

This adds all unstaged files and commits the changes with the given message to the Git repository.
The message is also used to create an annotated tag with the updated package version as tag name.

To build and commit a test version without creating a tag, run the following command:

grunt build::"Test build"

Colons in commit messages:

If you want to use colons in commit messages, escape them with a backslash:

grunt build:minor:"Set visibility\:true by default."

Options

build.tasks

Type: Array
Default value: ['default']

The list of custom tasks to run after bumping the package version and before running the git tasks.

build.packageConfig

Type: String
Default value: 'pkg'

The name of the config object with the package version.

build.packages

Type: String
Default value: '*.json'

The location of the JSON package files, passed as parameter to grunt.file.expand.

build.jsonSpace

Type: Integer
Default value: 2

The space parameter to JSON.stringify used to render the JSON package files.

build.jsonReplacer

Type: function|Array
Default value: undefined

The replacer parameter to JSON.stringify used to render the JSON package files.

build.gitAdd

Type: String|Boolean
Default value: '--all'

The shell parameters passed to git add.
Set to false to disable calling git add on build runs.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

  • 2013-12-27   v1.1.1   Escape colons in git commit messages.
  • 2013-11-28   v1.1.0   Added gitAdd build option.
  • 2013-10-29   v1.0.0   Initial release.