release-it
Advanced tools
Comparing version 0.0.6 to 0.0.9
@@ -8,70 +8,72 @@ var util = require('util'), | ||
var enquiry = when.defer(), | ||
noop = when.resolve(true); | ||
var noop = when.resolve(true); | ||
// TODO: Fix abusing the "when" feature of Inquiry.js prompts (https://github.com/SBoudrias/Inquirer.js/issues/89) | ||
var prompts = { | ||
status: { | ||
prompt: { | ||
type: 'confirm', | ||
name: 'status', | ||
message: 'Show updated files?', | ||
default: false | ||
}, | ||
task: tasks.status | ||
}, | ||
commit: { | ||
prompt: { | ||
type: 'confirm', | ||
name: 'commit', | ||
message: 'Commit (' + util.format(options.commitMessage, options.version) + ')?', | ||
default: true | ||
}, | ||
task: tasks.commit | ||
}, | ||
tag: { | ||
prompt: { | ||
type: 'confirm', | ||
name: 'tag', | ||
message: 'Tag (' + util.format(options.tagName, options.version) + ')?', | ||
default: true | ||
}, | ||
task: tasks.tag | ||
}, | ||
push: { | ||
prompt: { | ||
type: 'confirm', | ||
name: 'push', | ||
message: 'Push?', | ||
default: true | ||
}, | ||
task: sequence.bind(null, [tasks.push, tasks.pushTags]) | ||
}, | ||
publish: { | ||
prompt: { | ||
type: 'confirm', | ||
name: 'publish', | ||
message: 'Publish "' + options.name + '" to npm?', | ||
default: false, | ||
when: function push() { | ||
return (subject === 'src' && !options.distRepo) || (subject === 'dist' && !!options.distRepo); | ||
} | ||
}, | ||
task: tasks.publish | ||
} | ||
}; | ||
inquirer.prompt([{ | ||
type: 'confirm', | ||
name: 'status', | ||
message: 'Show updated files?', | ||
default: false | ||
}, { | ||
type: 'confirm', | ||
name: 'commit', | ||
message: 'Commit (' + util.format(options.commitMessage, options.version) + ')?', | ||
default: true, | ||
when: status | ||
}, { | ||
type: 'confirm', | ||
name: 'tag', | ||
message: 'Tag (' + util.format(options.tagName, options.version) + ')?', | ||
default: true, | ||
when: commit | ||
}, { | ||
type: 'confirm', | ||
name: 'push', | ||
message: 'Push?', | ||
default: true, | ||
when: tag | ||
}, { | ||
type: 'confirm', | ||
name: 'publish', | ||
message: 'Publish "' + options.name + '" to npm?', | ||
default: false, | ||
when: push | ||
}], publish); | ||
function status(answers) { | ||
var execute = answers.status ? tasks.status() : noop, | ||
done = this.async().bind(this, true); | ||
execute.catch(enquiry.reject).then(done); | ||
function getPrompt(prompt, task) { | ||
return function() { | ||
return when.promise(function(resolve) { | ||
inquirer.prompt(prompt, function(answers) { | ||
resolve(answers[prompt.name] ? task() : noop) | ||
}) | ||
}) | ||
} | ||
} | ||
function commit(answers) { | ||
var execute = answers.commit ? tasks.commit() : noop, | ||
done = this.async().bind(this, answers.commit); | ||
execute.catch(enquiry.reject).then(done); | ||
} | ||
function tag(answers) { | ||
var execute = answers.tag ? tasks.tag() : noop, | ||
done = this.async().bind(this, answers.commit); | ||
execute.catch(enquiry.reject).then(done); | ||
} | ||
function push(answers) { | ||
var execute = answers.push ? sequence([tasks.push, tasks.pushTags]) : noop, | ||
result = (subject === 'src' && !options.distRepo) || (subject === 'dist' && !!options.distRepo), | ||
done = this.async().bind(this, result); | ||
execute.catch(enquiry.reject).then(done); | ||
} | ||
function publish(answers) { | ||
var execute = answers.publish ? tasks.publish() : noop; | ||
execute.then(enquiry.resolve, enquiry.reject); | ||
} | ||
return enquiry.promise; | ||
return sequence([ | ||
getPrompt(prompts.status.prompt, prompts.status.task), | ||
getPrompt(prompts.commit.prompt, prompts.commit.task), | ||
getPrompt(prompts.tag.prompt, prompts.tag.task), | ||
getPrompt(prompts.push.prompt, prompts.push.task), | ||
getPrompt(prompts.publish.prompt, prompts.publish.task) | ||
]); | ||
}; |
{ | ||
"name": "release-it", | ||
"version": "0.0.6", | ||
"version": "0.0.9", | ||
"description": "Interactive release tool for Git repositories. Supports to build and release to a distribution/component repository. Publish to npm.", | ||
@@ -30,12 +30,12 @@ "keywords": [ | ||
"dependencies": { | ||
"optimist": "~0.6.0", | ||
"semver": "~2.2.1", | ||
"shelljs": "~0.2.6", | ||
"inquirer": "~0.4.0", | ||
"when": "~2.7.1", | ||
"chalk": "~0.4.0", | ||
"mkdirp": "~0.3.5", | ||
"glob": "~3.2.7", | ||
"graceful-fs": "~2.0.1" | ||
"optimist": "^0.6.1", | ||
"semver": "^2.3.1", | ||
"shelljs": "^0.3.0", | ||
"inquirer": "^0.5.1", | ||
"when": "^3.2.3", | ||
"chalk": "^0.4.0", | ||
"mkdirp": "^0.5.0", | ||
"glob": "^4.0.2", | ||
"graceful-fs": "^3.0.2" | ||
} | ||
} |
# Release It! | ||
Interactive release tool for Git repositories. Supports to build and release to a distribution/component repository. Publish to npm. | ||
Interactive release tool for Git repositories. Publish to npm. Optionally build and release to a distribution/component repository. | ||
@@ -29,6 +29,7 @@ Automatically increments version in package.json, commit, tag, push, publish, done. | ||
## Help | ||
### Help | ||
``` | ||
Release It! v0.0.1 | ||
$ release --help | ||
Release It! v0.0.9 | ||
@@ -47,8 +48,8 @@ Usage: release <increment> [options] | ||
-n, --non-interactive No interaction (assume default answers to questions) | ||
-p, --publish Publish to npm | ||
-p, --publish Publish to npm (only in --non-interactive mode) | ||
-v, --version Print version number | ||
-V, --verbose Verbose output | ||
-V, --verbose Verbose output | ||
``` | ||
## Default Settings | ||
### Default Settings | ||
@@ -78,8 +79,15 @@ ```js | ||
## Overrides | ||
### Overrides | ||
Place a `.release.json` file and **Release It** will use it to overwrite default settings. You can use `--config` if you want to use another filename/location. Most options can be set on the command-line (these will have highest priority). | ||
### What it does | ||
### Notes | ||
The tool assumes you've configured your SSH keys and remotes correctly. In case you need to configure things, the following pages might be of help. | ||
* GitHub Help: [SSH](https://help.github.com/categories/56/articles) | ||
* GitHub Help: [Managing Remotes](https://help.github.com/categories/18/articles) | ||
## What it does | ||
Many steps need your confirmation before execution. | ||
@@ -90,18 +98,18 @@ | ||
1. The version in each of the `pkgFiles` will be incremented. | ||
1. This change will be committed with the `commitMessage`. | ||
1. This commit is tagged with `tagName` (and `tagAnnotation`). The `%s` will be replaced with the updated version. | ||
1. The commit plus the tag are pushed. | ||
1. If no `distRepo` is configured, the package is published. | ||
1. This change will be committed with `commitMessage`. | ||
1. This commit is tagged with `tagName` (and `tagAnnotation`). The `%s` is replaced with the incremented version. | ||
1. Both the commit and tag are pushed. | ||
1. Without a configured `distRepo`, the package is published to npm. | ||
Additionally, if a distribution repository is configured: | ||
1. The plugin will create the distribution build using the `distBuildTask` Grunt task. | ||
1. The `distStageDir` is where the plugin will clone the `distRepo`. | ||
1. The plugin will create the distribution build using the `distBuildTask` shell command. | ||
1. The `distRepo` is cloned in `distStageDir`. | ||
1. The `distFiles` are copied here (normalized by removing the `distBase` from the target path). | ||
1. Steps 1-4 above are executed for the distribution repository. | ||
1. The package is published. | ||
1. The package is published to npm. | ||
### Usage | ||
## Usage examples | ||
Make a "patch" release (increments the 0.0.x): | ||
Release a "patch" update (increments the `x` in `0.0.x` by one): | ||
@@ -112,3 +120,3 @@ ```shell | ||
Make a patch, minor, major or specific version release with e.g.: | ||
Release a patch, minor, major, or specific version: | ||
@@ -121,3 +129,3 @@ ```shell | ||
You can also do a dry run, which won't write/touch anything, but does output the commands it would execute, and shows the interactivity: | ||
You can also do a dry run, which won't write/touch anything, but does output the commands it would execute, and show the interactivity: | ||
@@ -147,4 +155,4 @@ ```shell | ||
* Should be simple to release the current project you're working at. | ||
* Feature releasing to a separate distribution repository. | ||
* Should be as quiet or verbose as you need it. | ||
* Should allow to release a separate distribution repository. | ||
* Should be as quiet or verbose as you want it to be. | ||
@@ -151,0 +159,0 @@ ## License |
671
157
1862488
15
+ Addedasync@0.8.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedcli-color@0.3.3(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedd@0.1.11.0.2(transitive)
+ Addedes5-ext@0.10.64(transitive)
+ Addedes6-iterator@0.1.32.0.3(transitive)
+ Addedes6-symbol@2.0.13.1.4(transitive)
+ Addedes6-weak-map@0.1.4(transitive)
+ Addedesniff@2.0.1(transitive)
+ Addedevent-emitter@0.3.5(transitive)
+ Addedext@1.7.0(transitive)
+ Addedglob@4.5.3(transitive)
+ Addedgraceful-fs@3.0.12(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinquirer@0.5.1(transitive)
+ Addedlru-queue@0.1.0(transitive)
+ Addedmemoizee@0.3.10(transitive)
+ Addedminimatch@2.0.10(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addednatives@1.1.6(transitive)
+ Addednext-tick@0.2.21.1.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedsemver@2.3.2(transitive)
+ Addedshelljs@0.3.0(transitive)
+ Addedtimers-ext@0.1.8(transitive)
+ Addedtype@2.7.3(transitive)
+ Addedwhen@3.7.8(transitive)
+ Addedwrappy@1.0.2(transitive)
- Removedasync@0.2.10(transitive)
- Removedcli-color@0.2.3(transitive)
- Removedes5-ext@0.9.2(transitive)
- Removedevent-emitter@0.2.2(transitive)
- Removedglob@3.2.11(transitive)
- Removedgraceful-fs@2.0.3(transitive)
- Removedinquirer@0.4.1(transitive)
- Removedlru-cache@2.7.3(transitive)
- Removedmemoizee@0.2.6(transitive)
- Removedminimatch@0.3.0(transitive)
- Removedmkdirp@0.3.5(transitive)
- Removednext-tick@0.1.0(transitive)
- Removedsemver@2.2.1(transitive)
- Removedshelljs@0.2.6(transitive)
- Removedsigmund@1.0.1(transitive)
- Removedwhen@2.7.1(transitive)
Updatedchalk@^0.4.0
Updatedglob@^4.0.2
Updatedgraceful-fs@^3.0.2
Updatedinquirer@^0.5.1
Updatedmkdirp@^0.5.0
Updatedoptimist@^0.6.1
Updatedsemver@^2.3.1
Updatedshelljs@^0.3.0
Updatedwhen@^3.2.3