- Tag sha will now be used also if there is a gitHead in last release and it's not in the history
- Use `git merge-base` to determine if a commit is in history, allowing to use CI creating detached head repo
- Mention recovery solution by creating a version tag in `ENOTINHISTORY` and `ENOGITHEAD` error messages
- Do not mention branches containing missing commit in `ENOTINHISTORY` and `ENOGITHEAD` error messages as it's not available by default on most CI
Add several fixes and improvements in the identification of the last release gitHead:
- If there is no last release, unshallow the repo in order to retrieve all existing commits
- If git head is not present in last release, try to retrieve it from git tag with format ‘v\<version\>’ or ‘\<version\>’
- If the last release git head cannot be determined and found in commit history, unshallow the repo and try again
- Throw a ENOGITHEAD error if the gitHead for the last release cannot be found in the npm metadata nor in the git tags, preventing to make release based on the all the commits in the repo as before
- Add integration test for the scenario with a packed repo from which `npm republish` fails to read the git head
Fix#447, Fix#393, Fix#280, Fix#276
- Use async/await instead of callbacks
- Use execa to run command line
- Use AVA for tests
- Add several assertions in the unit tests
- Add documentation (comments) in the tests
- Run tests with a real git repo instead of mocking child_process and add test helpers to create repos, commits and checkout
- Simplify test directory structure
- Simplify code readability (mostly with async/await)
- Use eslint for for linting, prettier for formatting
target_commitish in GitHub Releases has two different meanings:
* Target commit that a new associated tag will be created on
* Target branch to compute how many "commits to since this release"
target_commitish is usually the default branch (aka master), because the
distance between the release and the latest branch is the primary concern.
Before this change, target_commitish was left to be a hash and the
feature of GitHub Releases that shows how much time passed since the
release is ruined, because no tracking branch is given.
By this change, target_commitish is changed to be the default branch
given in the configuration (options.branch) via edit a release API after
the release and tag are created via crate a release API.
This commit removes babel/es6 from all source and test files, because it was introducing a lot of overhead and only little gain.
This commit fixes and enables integration tests on Travis.
This commit fixes#153 and #151 along the way.
_Originally this commit should have only removed babel, but without working tests that's a bit too hairy._
_I only realized that half way into removing babel/es6, so things are all over the place now._
Closes#153, Closes#151
With this new feature you can pass an array of plugin locations/names to
both "verifyConditions" and "verifyRelease" in your `package.json`'s "release"
field. This will run multiple verification plugins in series.
This commit does a lot but it's all connected and tries to make everything more extensible and future proof.
1. CLI arguments and options from the "package.json" are no longer treated as two different things. You can now pass options either way.
BREAKING CHANGE: cli arguments are now normalized to camelCase, so e.g. `options['github-url']` is now `options.githubUrl`
2. Plugins no longer receive config they need one by one, but in one huge object. This way it's easier to pass more info in the future w/o breaking existing plugins that rely on the position of the callback in the arguments array.
BREAKING CHANGE: Plugins now need to read their passed options from one huge config object.
Old:
```js
module.exports = function (pluginConfig, foo, bar, cb) {…}
```
New:
```js
// ES5
module.exports = function(pluginConfig, config, cb) {
var foo = config.foo
var bar = config.bar
…
}
// ES6
module.exports = function (pluginConfig, {foo, bar}, cb) {…}
```