auto-release-cli
Advanced tools
Comparing version 0.22.0 to 0.23.0
@@ -0,1 +1,19 @@ | ||
# 0.23.0 (Fri Dec 07 2018) | ||
#### 🚀 Enhancement | ||
- add init script [#42](https://github.com/intuit/auto-release/pull/42) ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
#### 🏠 Internal | ||
- center badges [#40](https://github.com/intuit/auto-release/pull/40) ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
- switch to tiny badges [#39](https://github.com/intuit/auto-release/pull/39) ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
#### 📝 Documentation | ||
- add shipit to home page [#41](https://github.com/intuit/auto-release/pull/41) ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
- Add Contributor documentation [#38](https://github.com/intuit/auto-release/pull/38) ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
#### Authors: 1 | ||
- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie)) | ||
--- | ||
# 0.22.0 (Fri Dec 07 2018) | ||
@@ -2,0 +20,0 @@ |
@@ -79,2 +79,13 @@ "use strict"; | ||
}; | ||
var addGithubApi = function (parser) { | ||
return parser.addArgument(['--githubApi'], { | ||
help: 'Github API to use' | ||
}); | ||
}; | ||
var addOnlyPublishWithReleaseLabel = function (parser) { | ||
return parser.addArgument(['--onlyPublishWithReleaseLabel'], { | ||
help: 'Only bump version if `release` label is on pull request', | ||
action: "storeTrue" /* storeTrue */ | ||
}); | ||
}; | ||
function addLoggingParser(parser) { | ||
@@ -89,11 +100,6 @@ parser.addArgument(['-v', '--verbose'], { | ||
}); | ||
parser.addArgument(['--githubApi'], { | ||
help: 'Github API to use' | ||
}); | ||
addGithubApi(parser); | ||
} | ||
function addSemverParser(parser) { | ||
parser.addArgument(['--onlyPublishWithReleaseLabel'], { | ||
help: 'Only bump version if `release` label is on pull request', | ||
action: "storeTrue" /* storeTrue */ | ||
}); | ||
addOnlyPublishWithReleaseLabel(parser); | ||
parser.addArgument(['--major'], { | ||
@@ -214,2 +220,3 @@ help: 'The name of the tag for a major version bump', | ||
['changelog', addChangelogParser], | ||
['init', function () { return undefined; }], | ||
['shipit', function () { return undefined; }] | ||
@@ -216,0 +223,0 @@ ]; |
150
dist/main.js
@@ -80,2 +80,3 @@ #!/usr/bin/env node | ||
var github_release_1 = __importStar(require("./github-release")); | ||
var init_1 = __importDefault(require("./init")); | ||
var exec_promise_1 = __importDefault(require("./utils/exec-promise")); | ||
@@ -312,14 +313,19 @@ var logger_1 = __importDefault(require("./utils/logger")); | ||
switch (_a) { | ||
case 'shipit': return [3 /*break*/, 3]; | ||
case 'label': return [3 /*break*/, 13]; | ||
case 'pr-check': return [3 /*break*/, 15]; | ||
case 'pr': return [3 /*break*/, 24]; | ||
case 'comment': return [3 /*break*/, 32]; | ||
case 'version': return [3 /*break*/, 34]; | ||
case 'changelog': return [3 /*break*/, 36]; | ||
case 'release': return [3 /*break*/, 38]; | ||
case 'init': return [3 /*break*/, 3]; | ||
case 'shipit': return [3 /*break*/, 5]; | ||
case 'label': return [3 /*break*/, 15]; | ||
case 'pr-check': return [3 /*break*/, 17]; | ||
case 'pr': return [3 /*break*/, 26]; | ||
case 'comment': return [3 /*break*/, 34]; | ||
case 'version': return [3 /*break*/, 36]; | ||
case 'changelog': return [3 /*break*/, 38]; | ||
case 'release': return [3 /*break*/, 40]; | ||
} | ||
return [3 /*break*/, 40]; | ||
case 3: return [4 /*yield*/, getVersion(githubRelease, args)]; | ||
return [3 /*break*/, 42]; | ||
case 3: return [4 /*yield*/, init_1.default()]; | ||
case 4: | ||
_c.sent(); | ||
return [3 /*break*/, 43]; | ||
case 5: return [4 /*yield*/, getVersion(githubRelease, args)]; | ||
case 6: | ||
version = _c.sent(); | ||
@@ -330,31 +336,31 @@ if (version === '') { | ||
return [4 /*yield*/, makeChangelog(args, githubRelease, log, prefixRelease, veryVerbose, verbose)]; | ||
case 5: | ||
case 7: | ||
_c.sent(); | ||
if (!isMonorepo()) return [3 /*break*/, 7]; | ||
if (!isMonorepo()) return [3 /*break*/, 9]; | ||
return [4 /*yield*/, exec_promise_1.default("npx lerna publish --yes --force-publish=* " + version + " -m '%v [skip ci]'")]; | ||
case 6: | ||
_c.sent(); | ||
return [3 /*break*/, 11]; | ||
case 7: return [4 /*yield*/, exec_promise_1.default("npm version " + version + " -m \"Bump version to: %s [skip ci]\"")]; | ||
case 8: | ||
_c.sent(); | ||
return [3 /*break*/, 13]; | ||
case 9: return [4 /*yield*/, exec_promise_1.default("npm version " + version + " -m \"Bump version to: %s [skip ci]\"")]; | ||
case 10: | ||
_c.sent(); | ||
return [4 /*yield*/, exec_promise_1.default('npm publish')]; | ||
case 9: | ||
case 11: | ||
_c.sent(); | ||
return [4 /*yield*/, exec_promise_1.default('git push --follow-tags --set-upstream origin $branch')]; | ||
case 10: | ||
_c.sent(); | ||
_c.label = 11; | ||
case 11: return [4 /*yield*/, makeRelease(args, githubRelease, log, prefixRelease, veryVerbose, verbose)]; | ||
case 12: | ||
_c.sent(); | ||
return [3 /*break*/, 41]; | ||
case 13: | ||
_c.label = 13; | ||
case 13: return [4 /*yield*/, makeRelease(args, githubRelease, log, prefixRelease, veryVerbose, verbose)]; | ||
case 14: | ||
_c.sent(); | ||
return [3 /*break*/, 43]; | ||
case 15: | ||
verbose.info("Using command: 'label'"); | ||
return [4 /*yield*/, githubRelease.getLabels(args.pr)]; | ||
case 14: | ||
case 16: | ||
labels = _c.sent(); | ||
console.log(labels.join('\n')); | ||
return [3 /*break*/, 41]; | ||
case 15: | ||
return [3 /*break*/, 43]; | ||
case 17: | ||
verbose.info("Using command: 'pr-check' for '" + args.url + "'"); | ||
@@ -364,11 +370,11 @@ args.target_url = args.url; | ||
msg = void 0; | ||
_c.label = 16; | ||
case 16: | ||
_c.trys.push([16, 19, , 20]); | ||
_c.label = 18; | ||
case 18: | ||
_c.trys.push([18, 21, , 22]); | ||
return [4 /*yield*/, githubRelease.getPullRequest(args.pr)]; | ||
case 17: | ||
case 19: | ||
res = _c.sent(); | ||
args.sha = res.data.head.sha; | ||
return [4 /*yield*/, githubRelease.getLabels(args.pr)]; | ||
case 18: | ||
case 20: | ||
labels = _c.sent(); | ||
@@ -397,4 +403,4 @@ labelTexts_1 = Object.values(semVerLabels); | ||
}; | ||
return [3 /*break*/, 20]; | ||
case 19: | ||
return [3 /*break*/, 22]; | ||
case 21: | ||
error_1 = _c.sent(); | ||
@@ -405,77 +411,77 @@ msg = { | ||
}; | ||
return [3 /*break*/, 20]; | ||
case 20: | ||
return [3 /*break*/, 22]; | ||
case 22: | ||
verbose.info('Posting comment to Github\n', msg); | ||
if (!!args.dry_run) return [3 /*break*/, 22]; | ||
if (!!args.dry_run) return [3 /*break*/, 24]; | ||
return [4 /*yield*/, githubRelease.createStatus(__assign({}, args, msg))]; | ||
case 21: | ||
case 23: | ||
_c.sent(); | ||
log.success('Posted status to Pull Request.'); | ||
return [3 /*break*/, 23]; | ||
case 22: | ||
return [3 /*break*/, 25]; | ||
case 24: | ||
verbose.info('`pr-check` dry run complete.'); | ||
_c.label = 23; | ||
case 23: | ||
_c.label = 25; | ||
case 25: | ||
verbose.success('Finished `pr-check` command'); | ||
return [3 /*break*/, 41]; | ||
case 24: | ||
return [3 /*break*/, 43]; | ||
case 26: | ||
verbose.info("Using command: 'pr'"); | ||
if (!(!args.sha && args.pr)) return [3 /*break*/, 26]; | ||
if (!(!args.sha && args.pr)) return [3 /*break*/, 28]; | ||
verbose.info('Getting commit SHA from PR.'); | ||
return [4 /*yield*/, githubRelease.getPullRequest(args.pr)]; | ||
case 25: | ||
case 27: | ||
res = _c.sent(); | ||
args.sha = res.data.head.sha; | ||
return [3 /*break*/, 28]; | ||
case 26: | ||
if (!!args.sha) return [3 /*break*/, 28]; | ||
return [3 /*break*/, 30]; | ||
case 28: | ||
if (!!args.sha) return [3 /*break*/, 30]; | ||
verbose.info('No PR found, getting commit SHA from HEAD.'); | ||
_b = args; | ||
return [4 /*yield*/, githubRelease.getSha()]; | ||
case 27: | ||
case 29: | ||
_b.sha = _c.sent(); | ||
_c.label = 28; | ||
case 28: | ||
_c.label = 30; | ||
case 30: | ||
verbose.info('Found PR SHA:', args.sha); | ||
args.target_url = args.url; | ||
delete args.url; | ||
if (!!args.dry_run) return [3 /*break*/, 30]; | ||
if (!!args.dry_run) return [3 /*break*/, 32]; | ||
return [4 /*yield*/, githubRelease.createStatus(args)]; | ||
case 29: | ||
case 31: | ||
_c.sent(); | ||
return [3 /*break*/, 31]; | ||
case 30: | ||
return [3 /*break*/, 33]; | ||
case 32: | ||
verbose.info('`pr` dry run complete.'); | ||
_c.label = 31; | ||
case 31: | ||
_c.label = 33; | ||
case 33: | ||
verbose.success('Finished `pr` command'); | ||
return [3 /*break*/, 41]; | ||
case 32: | ||
return [3 /*break*/, 43]; | ||
case 34: | ||
verbose.info("Using command: 'comment'"); | ||
return [4 /*yield*/, githubRelease.createComment(args.message, args.pr, args.context || undefined)]; | ||
case 33: | ||
case 35: | ||
_c.sent(); | ||
log.success("Commented on PR #" + args.pr); | ||
return [3 /*break*/, 41]; | ||
case 34: | ||
return [3 /*break*/, 43]; | ||
case 36: | ||
verbose.info("Using command: 'version'"); | ||
return [4 /*yield*/, getVersion(githubRelease, args)]; | ||
case 35: | ||
case 37: | ||
bump = _c.sent(); | ||
console.log(bump); | ||
return [3 /*break*/, 41]; | ||
case 36: | ||
return [3 /*break*/, 43]; | ||
case 38: | ||
verbose.info("Using command: 'changelog'"); | ||
return [4 /*yield*/, makeChangelog(args, githubRelease, log, prefixRelease, veryVerbose, verbose)]; | ||
case 37: | ||
case 39: | ||
_c.sent(); | ||
return [3 /*break*/, 41]; | ||
case 38: | ||
return [3 /*break*/, 43]; | ||
case 40: | ||
verbose.info("Using command: 'release'"); | ||
return [4 /*yield*/, makeRelease(args, githubRelease, log, prefixRelease, veryVerbose, verbose)]; | ||
case 39: | ||
case 41: | ||
_c.sent(); | ||
return [3 /*break*/, 41]; | ||
case 40: throw new Error("idk what i'm doing."); | ||
case 41: return [2 /*return*/]; | ||
return [3 /*break*/, 43]; | ||
case 42: throw new Error("idk what i'm doing."); | ||
case 43: return [2 /*return*/]; | ||
} | ||
@@ -482,0 +488,0 @@ }); |
{ | ||
"name": "auto-release-cli", | ||
"description": "CLI tools to help facilitate semantic versioning based on Github PR labels.", | ||
"version": "0.22.0", | ||
"version": "0.23.0", | ||
"author": { | ||
@@ -48,2 +48,3 @@ "name": "Andrew Lisowski", | ||
"cosmiconfig": "5.0.7", | ||
"enquirer": "^2.1.1", | ||
"node-fetch": "2.3.0", | ||
@@ -64,3 +65,3 @@ "parse-git": "~1.1.2", | ||
"husky": "^1.2.0", | ||
"ignite": "^1.6.2", | ||
"ignite": "^1.6.3", | ||
"jest": "~23.6.0", | ||
@@ -67,0 +68,0 @@ "lint-staged": "^8.1.0", |
@@ -6,6 +6,8 @@ <div align="center"> | ||
<p>Generate releases based on semantic version labels on pull requests</p> | ||
</div | ||
</div> | ||
[![Codecov](https://img.shields.io/codecov/c/github/intuit/auto-release.svg?style=for-the-badge)](https://codecov.io/gh/intuit/auto-release) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=for-the-badge)](https://github.com/prettier/prettier) [![CircleCI](https://img.shields.io/circleci/project/github/intuit/auto-release/master.svg?style=for-the-badge)](https://circleci.com/gh/intuit/auto-release) [![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=for-the-badge)](#contributors) [![npm](https://img.shields.io/npm/v/auto-release-cli.svg?style=for-the-badge)](https://www.npmjs.com/package/auto-release-cli) [![npm](https://img.shields.io/npm/dt/auto-release-cli.svg?style=for-the-badge)](https://www.npmjs.com/package/auto-release-cli) | ||
<div align="center"><a href="https://circleci.com/gh/intuit/auto-release"><img src="https://img.shields.io/circleci/project/github/intuit/auto-release/master.svg?style=flat-square" alt="CircleCI" /></a> <a href="https://codecov.io/gh/intuit/auto-release"><img src="https://img.shields.io/codecov/c/github/intuit/auto-release.svg?style=flat-square" alt="Codecov" /></a> <a href="https://www.npmjs.com/package/auto-release-cli"><img src="https://img.shields.io/npm/v/auto-release-cli.svg?style=flat-square" alt="npm" /></a> <a href="#contributors"><img src="https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square" alt="All Contributors" /></a> <a href="https://www.npmjs.com/package/auto-release-cli"><img src="https://img.shields.io/npm/dt/auto-release-cli.svg?style=flat-square" alt="npm" /></a> <a href="https://github.com/prettier/prettier"><img src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square" alt="code style: prettier" /></a></div> | ||
<br /> | ||
CI/CD helpers for github releases. Generate releases based on semantic version labels on pull requests. | ||
@@ -29,2 +31,40 @@ | ||
## Start Developing | ||
To get set up, fork and clone the project and run the following command: | ||
```sh | ||
yarn | ||
``` | ||
### Linting | ||
```sh | ||
yarn lint | ||
``` | ||
### Testing | ||
```sh | ||
yarn test | ||
``` | ||
### Build/Typecheck | ||
```sh | ||
yarn build | ||
``` | ||
### Run the docs | ||
```sh | ||
yarn docs:watch | ||
``` | ||
### Contributing | ||
Feel free to make and [issue](https://github.com/intuit/auto-release/issues) or open a [pull request](https://github.com/intuit/auto-release/pulls)! | ||
Make sure to read our [code of conduct](./CODE_OF_CONDUCT.md). | ||
## Contributors | ||
@@ -42,1 +82,5 @@ | ||
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome! | ||
### Adding a Contributor | ||
To add a contributor run `yarn contributors:add`, choose "Add new contributor or edit contribution type" and follow the prompts. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
213544
43
2856
84
19
10
+ Addedenquirer@^2.1.1
+ Addedansi-colors@4.1.3(transitive)
+ Addedansi-regex@5.0.1(transitive)
+ Addedenquirer@2.4.1(transitive)
+ Addedstrip-ansi@6.0.1(transitive)