{"name":"mversion","version":"0.5.0","description":"A NPM and Bower module version handler","main":"version.js","scripts":{"test":"mocha tests/*_test.js -R spec"},"repository":{"type":"git","url":"https://github.com/mikaelbr/mversion"},"keywords":["semver","bower","npm","version"],"author":{"name":"Mikael Brevik","url":"@mikaelbrevik"},"license":"MIT","bin":{"mversion":"./bin/version"},"dependencies":{"async":"^0.9.0","vinyl-fs":"^0.3.4","through2":"^1.0.0","minimatch":"^0.3.0","semver":"^2.3.1","mocha":"^1.20.1","chalk":"^0.5.0"},"devDependencies":{"mocha":"*","vinyl":"*"},"bugs":{"url":"https://github.com/mikaelbr/mversion/issues"},"homepage":"https://github.com/mikaelbr/mversion","_id":"mversion@0.5.0","dist":{"shasum":"06bc130bba5b0438d02cca29f628ae0b9c83f336","tarball":"http://registry-npm.ywwl.com/mversion/download/mversion-0.5.0.tgz","integrity":"sha512-lWd7SPd+u3BfmyKqguNP8diRF2t5X4kA2vMiWau/YgUZQU5AKaGhJ5IrzYqC6LSyqttu/1BaNtc5WoiC9sREyQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCguvCNIt/6NsdXelF9SRkHgfBPziJ9qXpWBrnARj9vUwIgM5kGvgA8Pak/HgCS5H7lvvNMl5n9zrV4un/EtNBJiu8="}],"size":9339,"noattachment":false,"key":"/mversion/-/mversion-0.5.0.tgz"},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"mikaelb","email":"mikaelbre@gmail.com"},"maintainers":[{"name":"mikaelb","email":"mikaelbre@gmail.com"}],"directories":{},"deprecated":"Has potential possibility for shell exploitation","readme":"mversion - A cross packaging manager module version handler/bumper\n===\n\n[![npm](https://img.shields.io/npm/v/mversion.svg?style=flat)](https://npmjs.com/package/mversion) [![Travis](https://img.shields.io/travis/mikaelbr/mversion.svg?style=flat)](https://travis-ci.org/mikaelbr/mversion) [![Gemnasium](https://img.shields.io/gemnasium/mikaelbr/mversion.svg?style=flat)](https://gemnasium.com/mikaelbr/mversion)\n\nImitates [```npm version```](https://npmjs.org/doc/version.html) to\nalso work on other packaging files. For those times you have either\nhave multiple packaging files (like ```bower.json```, ```component.json```,\n```manifest.json```) or just not a ```package.json``` file.\n```mversion``` can easily bump your version and optionally commit and create a tag.\n\n## `mversion` file support\n- `package.json`\n- `npm-shrinkwrap.json`\n- `component.json`\n- `bower.json`\n- `manifest.json`\n- `*.jquery.json` (jquery plugin files, e.g `plugin.jquery.json`)\n\n## Usage CLI\n\n```shell\nnpm install -g mversion\n```\n\n### Examples\n\n```shell\n$ mversion patch\nNew Version: 0.0.6\nUpdated package.json\nUpdated component.json\n```\n\n```shell\n$ mversion 0.0.5 -m\nNew Version: 0.0.5\nUpdated package.json\nUpdated component.json\nUpdated manifest.json\nCommited to git and created tag v0.0.5\n```\n\n```shell\n$ mversion 1.0.0-rc1 -m \"Now in wopping v%s\"\nNew Version: 1.0.0-rc1\nUpdated package.json\nUpdated component.json\nCommited to git and created tag v1.0.0-rc1\n```\n\n### Help\n\n```shell\n$ mversion -h\n\nUsage: mversion [ <newversion> | major | minor | patch | prerelease ] [ -m <optional message> ] [ -n | --no-prefix ]\n(run in package dir) - (Also supports premajor, preminor and prepatch, see semver summary)\n\nUpdate module version in either one or all of package.json,\ncomponent.json, bower.json, manifest.json and *.jquery.json.\n```\n\nRun without arguments to get current version.\n\n# Semver Summary\nGiven a version number MAJOR.MINOR.PATCH, increment the:\n- MAJOR version when you make incompatible API changes,,\n- MINOR version when you add functionality in a backwards-compatible manner, and,\n- PATCH version when you make backwards-compatible bug fixes.,\nAdditional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.,\n\n# Update version\nUpdate version by defining new semver valid version\nor a release string (major, minor, patch, build).\n--\nEx: \"mversion minor\"\nEx: \"mversion 1.0.1-beta\"\n--\n\n# Git\nUse -m to auto commit and tag. Apply optional message and\nuse '%s' as placeholder for the updated version. Default\nmessage is 'v%s' where %s is replaced with new version.\n\n--tag (or -t for short) allows for overriding the tag name used. This does not\nchange behaviour of the message, just the tag name. As with -m, all occurances of %s\nis replaced with the newly bumped version.\n\n--no-prefix (or -n for short) is a short hand for setting\na tag name without v as prefix. This does not change behaviour of\nthe message, just the tag name.\n\n--\nEx: \"mversion minor -m\"\nEx: \"mversion minor -m 'Bumped to v%s' --tag 'v%s-src'\"\n--\n\n## Version aliases\n\nIf you are lazy you can also use aliases for the version release type.\n\n```\nmversion p\n```\n\nThe full list of aliases:\n\n```\n\"pa\": \"patch\",\n\"pr\": \"prerelease\",\n\"ma\": \"major\",\n\"mi\": \"minor\",\n// one char might be controversial, but it saves key strokes\n\"m\": \"major\",\n\"p\": \"patch\",\n\"i\": \"minor\"\n```\n\n## Default settings\n\nCreate a `.mversionrc` file in your root with default settings\nas defined in the README.md of the project.\n```\n\n## Default Settings\n\nYou can provide default settings by creating a `.mversionrc` file\nin the root of your project (or in a directory higher up in the hierarchy).\nThis way you can define project specific tag names or commit messages.\n\nSee API below to see what options are accepted.\n\n### Example `.mversionrc`\n\n```json\n{\n  \"commitMessage\": \"Bumped to %s\",\n  \"tagName\": \"v%s-src\"\n}\n```\n\nNow, when doing this in the Terminal:\n```shell\n$ mversion minor\n```\n\nwould now be the same as doing:\n\n```shell\nmversion minor -m \"Bumped to %s\" -t \"v%s-src\"\n```\n\n**Note:** CLI arguments take precedence over default options.\nSo doing this (with the `.mversionrc` file as defined above):\n\n```shell\nmversion minor -m \"Kicked version to %s\"\n```\n\nWould lead to the commit message being `Kicked version to %s`,\nand tag name to be `v%s-src`.\n\n## Hooks\n\n`.mversionrc` will also allow you to define hooks before (`preupdate`)\nand after (`postupdate`) version is updated.\n\n### Example\n\n```json\n{\n  \"scripts\": {\n    \"preupdate\": \"echo 'Bumping version'\",\n    \"precommit\": \"sh ./someHook.sh\",\n    \"postcommit\": \"git push && git push --tags && npm publish\",\n    \"postupdate\": \"echo 'Updated to version %s in manifest files'\"\n  }\n}\n```\n\nIf precommit fails (returns something other that `exit 0`) the commit will be\nchecked out (removing the version bump changes).\n\n## Usage API\n\n```shell\nnpm install mversion\n```\n\n```javascript\nvar mversion = require('mversion');\n\nmversion.get(function (err, data) {\n  /*\n    data = {\n      'package.json': VERSION,\n      'component.json': VERSION\n    }\n  */\n});\n\nmversion.update('minor', function (err, data) { })\nmversion.update('major', function (err, data) { })\nmversion.update({\n    version: 'major',\n    commitMessage: 'Some commit message for version %s'\n  }, function (err, data) { }) // Will commit/tag\nmversion.update({\n    version: 'major',\n    commitMessage: 'Some commit message for version %s',\n    noPrefix: true\n  }, function (err, data) { }) // Make tag without v prefix\nmversion.update('patch', function (err, data) { })\nmversion.update('prerelease', function (err, data) { })\nmversion.update({\n    version: '0.0.1',\n    commitMessage: 'Bumping version'\n  }, function (err, data) { }) // Will commit/tag\nmversion.update('v1.0.1', function (err, data) { })\nmversion.update('v1.0.1-beta', function (err, data) { })\nmversion.update('v1.0.1-010988', function (err, data) { })\n```\n\n\n### `mversion.get(callback(err, data))`\nGet version of all the different package files. See example above.\n\n### `mversion.update([options, ]callback(err, data))`\nUpdate version of found package files.\n\nExample of the `data` returned from the callback:\n\n```json\n{\n  \"newVersion\": \"1.0.0\",\n  \"versions\": { \"package.json\": \"1.0.\"},\n  \"message\": \"Updated package.json\",\n  \"updatedFiles\": [\"/mversion/example/package.json\"]\n}\n```\n\nSome times both `data` and `err` has values. In this case\nsome package files were updated and some not.\n\n#### `options : Undefined`\nIf options is undefined a standard bump of `minor` will be used.\n\n#### `options : String`\nIf options is a string, this string is used as the version bump.\n\nExample:\n```javascript\nmversion.update('major')\n```\n\n#### `options.version : String`\nUsed to bump version. See above.\n\n#### `options.commitMessage : String`\nUsed as message when creating commit in Git. Also used as message for\nthe annotated tag created. If undefined, no commit will be made.\n\nOccurances of `%s` in commit message will be replaced with new version number.\n\nExample:\n```javascript\nmversion.update({\n  version: 'major',\n  commitMessage: 'Bumps to version %s'\n});\n```\n\n#### `options.tagName : String`\nDefault: `v%s`\n\nAllows for overriding of tagName. For instance adding a suffix and\nchangeing tag to be named `v%s-src`.\n\n__Will only take affect if commitMessage is defined.__\n\nOccurances of `%s` in tag name will be replaced with new version number.\n\nExample:\n```javascript\nmversion.update({\n  version: 'major',\n  commitMessage: 'Bumps to version %s',\n  tagName: 'v%s-src'\n});\n// Might produce annotated tag named v1.0.0-src\n```\n\n#### `options.noPrefix : Boolean`\nIf true and commit message is defined, the annotated tag created\nwill not have 'v' as prefix. This is a short hand for defining\nsetting tag name to `%s`. Do not work if tag name is overriden\n(`options.tagName` is defined).\n\nExample:\n```javascript\nmversion.update({\n  version: 'major',\n  commitMessage: 'Bumps to version %s',\n  noPrefix: true\n});\n// Might produce annotated tag named 1.0.0\n```\n\nThis would be the same as:\n```javascript\nmversion.update({\n  version: 'major',\n  commitMessage: 'Bumps to version %s',\n  tagName: '%s'\n});\n// Might produce annotated tag named 1.0.0\n```\n\n### `mversion.isPackageFile(filename) : Boolean`\nChecks whether or not the given filename is a valid package file type.\n\nExamples:\n```javascript\nassert.equal(mversion.isPackageFile('package.json'), true);\nassert.equal(mversion.isPackageFile('component.json'), true);\nassert.equal(mversion.isPackageFile('bower.json'), true);\nassert.equal(mversion.isPackageFile('foobar.json'), false);\nassert.equal(mversion.isPackageFile('foobar.jquery.json'), true);\nassert.equal(mversion.isPackageFile('foojquery.json'), false);\n```\n\n## Changelog\n\n### 1.9.0\n1. Adds aliases for bumps (`p`, `m`, `i`) (#20)\n\n### 1.8.0\n1. Adds Composer support. (#19)\n\n### 1.7.0\n1. Replaces %s with `newVersion` in post scripts. Fixes #18\n\n### 1.6.1\n1. Adds support for git staging files with spaces. Fixes #17\n\n### 1.6.0\n1. Adds auto-updater to `mversion`.\n\n### 1.5.0\n1. Fixes issue with version bump being parsed as number and running string operations.\n2. Improves error given on invalid version input\n3. Bumps minimatch and semver to latest versions.\n\n### 1.4.0\n1. Adds pre-/postcommit hooks allowing for commands to be run before and after\n   version bump git commit.\n\n### 1.3.0\n1. Adds `.mversionrc` file for defining default settings\n2. Adds pre-/postupdate hooks allowing for commands to be run before and after version bump.\n   Useful for instance for doing `npm publish` or `git push`.\n\n### 1.2.0\n1. Adds option to override tag name (options.tagName) in `#update`.\n2. Misc. refactoring and further testing.\n\n### 1.1.0\n1. Improves CLI arguments. Now arguments is indifferent to order\n2. Adds better error handling and user feedback on partial version update (not all files).\n\n### 1.0.0\n1. Changes API to use an object literal, avoiding magic strings/primitives.\n\n\n### 0.5.0\n1. Adds `noPrefix` flag. Allowing to define whether or not to prefix tags with \"v\".\n\n\n## License\n\n[MIT License](http://en.wikipedia.org/wiki/MIT_License)\n","publish_time":1404641918283,"_cnpm_publish_time":1404641918283,"dist-tags":{"latest":"2.0.1"}}