Version manage all the things
versionit is a simple versioning helper inspired by the ultra useful
npm version command. It performs two functions:
updates any valid
JSON files in the current working directory with the updated version.
A valid file is one that has a top-level
tags the version control used in the cwd with the updated version,
git is supported, but implementing additional SCM
taggers should be pretty simple.
versionit has been written to provide the same functionality (and a little
bit extra) provided by the
npm version but in a package manager agnostic
way. For instance, we have a number of package management solutions
poppping up that use a similar approach to NPM but with different
Things such as:
Once installed, you should be able to access the
in a terminal window. You can then, update the version in JSON files in
the cwd in one of the following ways:
versionit <versionno> to explicitly set the version number
versionit bump to bump the patch (0.0.x) version of your
versionit bump-minor to bump the minor (0.x.0) version of
versionit bump-major to bump the major (x.0.0) version of
Or just run
versionit to get the current version of the package.
If you are considering using versionit with your project, then for the time
being I would recommend installing the
npm install email@example.com -g
0.3 version onwards I have included expreimental support for
being able to bump version metadata that is included within a
included in your modules root directory.
For example, consider you have a JS file with the following content:
var metadata =version: '0.1.0';
This would be updated by
versionit to synchronize with the
version once updated by versionit. This is done by versionit doing a walk
of the AST of the file and looking specifically for
within an object containing a literal value. If found, the source of the
file is modified where the version was discovered with updated version
and written back to the file system.
NOTE: This does not perform a full regeneration of your source but a targeted replacement of the version string. The only thing that you may notice a difference with is if you use double-quotes rather than single quotes for your literal strings.
Copyright (c) 2014 Damon Oehlman firstname.lastname@example.org
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.