Uses djanta platform plugin bumping tools.
- Optionally prompt for the type of version bump (major, minor, revision, beta, etc.)
- Bump the version number in all of your JSON manifests, including:
package.json
bower.json
component.json
- Replace version number strings in text files, including:
- config files
- source code
- README files
- license files
- Run your
preversion
,version
, andpostversion
scripts - Commit changes to GIT
- Tag the commit with the version number
- Push the commit to remote
You can install djantaio-tools-bump
via npm.
npm install -g djantaio-tools-bump
Usage: djantaio-bump [options]
Options:
-f, --file Define where to load the roadmap from [required] [default: "./release.yml"]
-u, --url-prefix Specify the Git repository host prefix
-t, --semver-tag Define the default semver strategy to use
-M, --master-branch Specify the default working repositiory defaut master branch name
-D, --draft-branch Specify the branch that has to be used as the default working branch
-a, --archetype Use this option to define what kind of the project artifact should be exclusivly bump [default: "npm"]
-c, --changelog Use this option to define whether or not the change log file should be generated
-e, --roadmap Specify the roadmap list to execute [array]
-p, --git-project Specify the local Git project directory
--help Show help [boolean]
Examples:
$ djantaio-bump --file <MANIFEST FILE> ...
$ djantaio-bump --file <MANIFEST FILE> -e <ROADMAP NAME> -e <ROADMAP NAME2> -e <ROADMAP n...> ...
$ djantaio-bump --file <MANIFEST FILE> --semver-tag <YOUR TAEGET VERSION> ...
As specified with the option --file
, here below how you can declare your manifest file
defaults:
url: [email protected]:djanta
origin: origin
changelog: true
archetype: npm
branch:
draft: develop
master: master
version: patch
prerelease:
repositories:
-
tag: true
name: djantaio-bump-test
version: prerelease
archetype: npm
branch:
master: master
draft: develop
command:
- "npm install"
- "npm run compile"
dependencies:
-
name: lodash
version: latest
- dateutil
Type: Object
The default configuration remain the top level where you'd like to define all the common properties shared by bumping strategy such as your repository host url.
Type: String
Default value: ``
A string value that define your git repository host url. The property can overrided by the command line -u, --url-prefix
Type: String
Default value: origin
A string value given to override the default repository url name.
Type: Object
Here's will take place your roadmap configuration.
Type: Arrays
Define the list of the target repository which should be bumped
Type: bool
Default value: true
Define whether the current repository should be tagged. This's basically synomym of enabled
Type: String
Default value:
Required: true
Here's where you can define the target repository name without the .git
extension.
Type: String
Default value: npm
Required: true
Define which archetype should be use to bump you project version. By the default npm
archetype will be used. However, this can be overrided with the comment line --archetype
Type: Object
Default value:
branch:
draft: develop
master: master
Required: true
The branch configuration scope provide the way through to configure the working branch and the master branch.
draft
: the draft branch represent the current working branch where to tag from as themaster
: branch reprsent to merge to after the working branch has been bumped and tagged
Either branch.draft
and branch.master
can be overrided with the command lines --draft-branch|-D
and --master-branch|-M
Type: Array
Default value:
Required: false
The options command
define a list of commad which should executed after bumping your project and before it's become tagged
Type: Array
Default value:
branch:
draft: develop
master: master
Required: false
djantaio-tools-bump
will execute your preversion
, version
, and postversion
scripts, just like the npm version
command does. If your package.json
file contains any or all of these scripts, then they will be executed in the following order:
- The
preversion
script runs before the version is updated (and before the version prompt is shown) - The
version
script runs after the version is updated, but beforegit commit
andgit tag
- The
postversion
script runs aftergit commit
andgit tag
, but beforegit push
I welcome any contributions, enhancements, and bug-fixes. File an issue on GitHub and submit a pull request.
To build the project locally on your computer:
- Clone this repo
git clone https://github.com/djanta/djantaio-tools-bump.git
- Install dependencies
npm install
- Run the tests
npm test