Code Monkey home page Code Monkey logo

mversion's Introduction

mversion - A cross packaging manager module version handler

NPM version Build Status Dependency Status

Imitates npm version to also work on other packaging files. For those times you have either have multiple packaging files (like bower.json, component.json, manifest.json) or just not a package.json file. mversion can easily bump your version and optionally commit and create a tag.

mversion file support

  • package.json
  • npm-shrinkwrap.json
  • component.json
  • bower.json
  • manifest.json
  • *.jquery.json (jquery plugin files, e.g plugin.jquery.json)

Usage CLI

npm install -g mversion
$ mversion -h

Usage: mversion [ <newversion> | major | minor | patch | build ] [ -m <optional message> ]
(run in package dir).

Update module version in either or all of package.json,
component.json, bower.json, manifest.json.

Run without arguments to get current version.

# Update version
Update version by defining new semver valid version
or a release string (major, minor, patch, build).
--
Ex: "mversion minor"
Ex: "mversion 1.0.1-beta"
--

# Git
Use -m to auto commit and tag. Apply optional message and
use '%s' as placeholder for the updated version. Default
message is 'v%s' where %s is replaced with new version.
--
Ex: "mversion minor -m"
Ex: "mversion minor -m 'Bumped to v%s'"
--

Examples

$ mversion patch
New Version: 0.0.6
Updated package.json
Updated component.json
$ mversion 0.0.5 -m
New Version: 0.0.5
Updated package.json
Updated component.json
Updated manifest.json
Commited to git and created tag v0.0.5
$ mversion 1.0.0-rc1 -m "Now in wopping v%s"
New Version: 1.0.0-rc1
Updated package.json
Updated component.json
Commited to git and created tag v1.0.0-rc1

Usage API

npm install mversion
var mversion = require('mversion');

mversion.get(function (err, data) {
  /*
    data = {
      'package.json': VERSION,
      'component.json': VERSION
    }
  */
});

mversion.update('minor', function (err, data) { })
mversion.update('major', function (err, data) { })
mversion.update('major', 'Some commit message for version %s', function (err, data) { }) // Will commit/tag
mversion.update('patch', function (err, data) { })
mversion.update('build', function (err, data) { })
mversion.update('0.0.1', 'Bumping version', function (err, data) { }) // Will commit/tag
mversion.update('v1.0.1', function (err, data) { })
mversion.update('v1.0.1-beta', function (err, data) { })
mversion.update('v1.0.1-010988', function (err, data) { })

mversion's People

Contributors

mikaelbr avatar gregberge avatar vvo avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.