Registry / devops / grunt-bump-build-git

grunt-bump-build-git

JSON →
library1.1.3jsnpmunverified

This Grunt plugin, `grunt-bump-build-git` (current stable version 1.1.3), streamlines the release process for JavaScript projects. It integrates version bumping (following semver), project building via custom Grunt tasks, and Git operations (add, commit, tag) into a single, configurable step. It differentiates itself by providing a comprehensive, automated workflow for releases directly within the Grunt ecosystem, updating `package.json` and other specified JSON files with the new version. The plugin is designed for projects using Grunt `~0.4.2` or higher and runs on Node.js versions `0.8.0` and above. Its release cadence is tied to its maintenance, likely infrequent given its age and the current landscape of build tools, but it remains functional for legacy Grunt-based projects. It aims to reduce manual steps and potential errors during a project's release cycle.

npm install grunt-bump-build-git
INSTALL
IMPORT
SIG · GRUNT-BUMP-BUILD-G
G
grunt-bump-build-git
devopsjavascriptv1.1.3
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

grunt.loadNpmTasks
grunt.loadNpmTasks('grunt-bump-build-git');
import gruntBumpBuildGit from 'grunt-bump-build-git';
Grunt plugins are loaded via `grunt.loadNpmTasks` in the Gruntfile, not traditional ES module or CommonJS `require()` syntax.

This quickstart demonstrates how to configure and use the `grunt-bump-build-git` plugin within a Gruntfile to automate version bumping, running custom build tasks, and committing/tagging changes in Git.

module.exports = function (grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), // Example for packageConfig build: { tasks: ['default'], // Tasks to run after bumping version packageConfig: 'pkg', // Name of config object containing version packages: '*.json', // JSON files to update jsonSpace: 2, // Indentation for JSON files gitAdd: '--all' // Command line arguments for 'git add' }, // Define a simple default task for demonstration default: { // This task would typically run your build process // For example, concat, uglify, cssmin, etc. options: { message: 'Running default build tasks...' } } }); // Load the plugin's task. grunt.loadNpmTasks('grunt-bump-build-git'); // Register a dummy default task if it's not defined if (!grunt.task.exists('default')) { grunt.registerTask('default', 'A dummy default task.', function() { grunt.log.writeln(this.options().message); // In a real project, this would trigger your actual build process }); } // To run: // grunt build:patch:"Release new patch version" // Or just grunt build to create a meta version (e.g., 1.2.3+build.TIMESTAMP) };
Debug
Known issues
gotchaWhen specifying commit messages via the command line, colons (':') must be escaped with a backslash to be parsed correctly by Grunt.
fix
Escape colons with a backslash, e.g., `grunt build:minor:"Set visibility\\:true by default."`. Note the double backslash when used in a shell to ensure the backslash itself is passed.
affects: >=1.0.0
gotchaThis plugin requires Grunt `~0.4.2` or newer. Using older versions of Grunt will prevent the plugin from loading or functioning correctly.
fix
Upgrade Grunt in your project to at least `0.4.2` by running `npm install grunt@~0.4.2 --save-dev`.
affects: <0.4.2
gotchaGit operations will fail if the project directory is not a Git repository or if authentication issues prevent Git from performing actions like `add`, `commit`, or `tag`.
fix
Ensure `git init` has been run in your project root. For automated environments (CI/CD), configure Git with appropriate credentials (e.g., deploy keys, personal access tokens) for the repository.
affects: >=1.0.0
gotchaThe custom tasks specified in the `build.tasks` option (e.g., `['default']`) must be defined and available in your Gruntfile, either directly or loaded from other Grunt plugins.
fix
Verify that all tasks listed in `build.tasks` are properly registered using `grunt.registerTask` or loaded via `grunt.loadNpmTasks` for third-party plugins.
affects: >=1.0.0
Errors
Common errors & fixes
Warning: Task "build:patch" not found. Use --force to continue.
The `grunt-bump-build-git` plugin's tasks have not been loaded or the Gruntfile has an error preventing it.
fix
Ensure `grunt.loadNpmTasks('grunt-bump-build-git');` is present and correctly placed in your Gruntfile.js, and that your Gruntfile has no syntax errors.
fatal: not a git repository (or any of the parent directories): .git
The `grunt-bump-build-git` task attempts to perform Git operations (add, commit, tag) in a directory that is not a Git repository.
fix
Initialize a Git repository in your project's root directory by running `git init`.
Warning: Unable to write "package.json" file (Error: EACCES: permission denied, open 'package.json')
The Grunt process lacks the necessary file system permissions to modify `package.json` or other JSON files specified in `build.packages`.
fix
Adjust the file permissions for the affected JSON files (e.g., `chmod 644 package.json`) or run Grunt with elevated privileges if appropriate for your environment.
Upgrade
Version history
1.1.3latest on npm
Audit
Dependencies
gruntrequiredRuntime peer dependency for Grunt task runner.
Agent activity
4 hits · last 30 days
node
4
Resources
grunt-bump-build-git — npm install grunt-bump-build-git · libregistry