CRANK
a tool to update version number and changelog, for npm module development
usage
crank version {part}
increments version in package.json
{part} is major
, minor
, or patch
. defaults to patch
crank changelog {file}
updates changelog. {file} defaults to Changelog.md
intentions
- node modules
- Used to manage node modules. (Assumes package.json, etc.)
- move into the future
- Interface designed primarily to increment/update package metadata.
- for build systems
- Intended to use in a build system (gmake, ant, phing, etc). Expects to be intermixed with other commands. (This lets it focus on what it does well -- and not try to do everything.)
- semantic versioning
- By default, makes it easy to manage packages that use semantic versioning.
- read-only
- Doesn't commit to the SCM. (See "not try to do everything" above.)
- config file (optional)
- Options given mainly by config file (instead of commandline arguments). This makes it easier to create re-usable "recipes". (For example, using a config file means that it can be commited to the SCM.)
assumptions
- single change ID
- Change ID ("revision", "commit", etc) of target diretory applies homogeneously to all files/subdirectories in the target.
- clean target
- No modified files in the target directory.
- CWD in module root
- Generally expected to be run in same directory as package.json.
config
- not really needed for simple use cases
- defaults to
crank.json
in the current working directory can be specified with a commandline argument
-
target
: directory to track- defaults to current working directory
-
changelog
:-
file
: path on disk- relative path is relative to the target
-
template
: template type, or path on disk- defaults to file extension
- simple string taken as one of the built-in template types to use
- builtin types are
md
(markdown) andtxt
(plain text)
- builtin types are
- otherwise, template to use
-
changes
:-
dateformat
: string- format to use for change dates
-
filters
: list of objects describing how to modify changes-
subject
: stringmessage
,author
,date
, orchangeid
-
regexp
: string -
replace
: string- if results in
--CRANK:SKIP--
then change is skipped
- if results in
-
-
-
releases
:-
dateformat
: string- format to use for revision dates
-
filters
: list of objects describing how to modify releases-
subject
: stringversion
,date
, orchangeid
-
regexp
: string -
replace
: string- if results in
--CRANK:SKIP--
then release is skipped
- if results in
-
-
skipEmpty
: boolean- if true and release has no changes (after filtering), then the release is skipped
-
-
template
good old mustache
{{version}}
string-
{{date}}
string, date that crank was run -
{{changeid}}
string -
{{changes}}
list of objects-
{{changeid}}
string -
{{date}}
string -
{{author}}
string -
{{message}}
string
-
license
MIT License
Copyright (c) 2012, Yahoo! Inc. All rights reserved.
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.