Socket
Socket
Sign inDemoInstall

release-it

Package Overview
Dependencies
9
Maintainers
1
Versions
396
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.6 to 0.0.9

130

lib/enquiry.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc