release-it 12.4.2 → 12.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -287,7 +287,7 @@ overridden. To customize the release notes for the GitHub or GitLab release, use
287
287
  `gitlab.releaseNotes`. Make sure any of these commands output the changelog to `stdout`.
288
288
 
289
289
  Instead of executing a shell command, a (Handlebars) template can be used to generate the changelog. See
290
- [auto-changelog](./docs/changelogs#auto-changelog) for more details. If your project follows conventions, such as the
290
+ [auto-changelog](./docs/changelog.md#auto-changelog) for more details. If your project follows conventions, such as the
291
291
  [Angular commit guidelines](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#commits), the
292
292
  [@release-it/conventional-changelog](https://github.com/release-it/conventional-changelog) plugin is useful.
293
293
 
@@ -406,7 +406,7 @@ While mostly used as a CLI tool, release-it can be used as a dependency to ingra
406
406
 
407
407
  - [react-navigation/react-navigation](https://github.com/react-navigation/react-navigation)
408
408
  - [swagger-api/swagger-ui](https://github.com/swagger-api/swagger-ui)
409
- - [js-cookie/js-cookie])(https://github.com/js-cookie/js-cookie)
409
+ - [js-cookie/js-cookie](https://github.com/js-cookie/js-cookie)
410
410
  - [StevenBlack/hosts](https://github.com/StevenBlack/hosts)
411
411
  - [react-native-community/react-native-tab-view](https://github.com/react-native-community/react-native-tab-view)
412
412
  - [callstack/linaria](https://github.com/callstack/linaria)
package/lib/util.js CHANGED
@@ -3,13 +3,22 @@ const { EOL } = require('os');
3
3
  const _ = require('lodash');
4
4
  const gitUrlParse = require('git-url-parse');
5
5
  const semver = require('semver');
6
+ const Log = require('./log');
6
7
  const { TimeoutError } = require('./errors');
7
8
 
9
+ const log = new Log();
10
+
8
11
  const format = (template = '', context = {}) => {
9
- template = template.startsWith('git log')
10
- ? template.replace('[REV_RANGE]', '${latestTag}...HEAD')
11
- : template.replace(/%s/g, '${version}');
12
- return _.template(template)(context);
12
+ try {
13
+ template = template.startsWith('git log')
14
+ ? template.replace('[REV_RANGE]', '${latestTag}...HEAD')
15
+ : template.replace(/%s/g, '${version}');
16
+ return _.template(template)(context);
17
+ } catch (error) {
18
+ log.error(`Unable to render template with context:\n${template}\n${JSON.stringify(context)}`);
19
+ log.error(error);
20
+ throw error;
21
+ }
13
22
  };
14
23
 
15
24
  const truncateLines = (input, maxLines = 10, surplusText = null) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-it",
3
- "version": "12.4.2",
3
+ "version": "12.4.3",
4
4
  "description": "CLI release tool for Git repos and npm packages.",
5
5
  "keywords": [
6
6
  "build",
@@ -56,7 +56,7 @@
56
56
  "license": "MIT",
57
57
  "dependencies": {
58
58
  "@iarna/toml": "2.2.3",
59
- "@octokit/rest": "16.30.1",
59
+ "@octokit/rest": "16.33.0",
60
60
  "async-retry": "1.2.3",
61
61
  "chalk": "2.4.2",
62
62
  "cosmiconfig": "5.2.1",
@@ -82,21 +82,21 @@
82
82
  "url-join": "4.0.1",
83
83
  "uuid": "3.3.3",
84
84
  "window-size": "1.1.1",
85
- "yargs-parser": "14.0.0"
85
+ "yargs-parser": "15.0.0"
86
86
  },
87
87
  "devDependencies": {
88
88
  "@octokit/request-error": "1.0.4",
89
89
  "ava": "2.4.0",
90
90
  "codecov": "3.6.1",
91
91
  "eslint": "6.5.1",
92
- "eslint-config-prettier": "6.3.0",
92
+ "eslint-config-prettier": "6.4.0",
93
93
  "eslint-plugin-ava": "9.0.0",
94
94
  "eslint-plugin-import": "2.18.2",
95
95
  "eslint-plugin-prettier": "3.1.1",
96
96
  "markdown-toc": "1.2.0",
97
97
  "mock-fs": "4.10.1",
98
98
  "mock-stdio": "1.0.3",
99
- "nock": "11.3.5",
99
+ "nock": "11.4.0",
100
100
  "nyc": "14.1.1",
101
101
  "prettier": "1.18.2",
102
102
  "proxyquire": "2.1.3",
@@ -20,7 +20,8 @@ const gitAdd = (content, file, message) => {
20
20
  sh.ShellString(content).toEnd(file);
21
21
  sh.exec(`git add ${file}`);
22
22
  const { stdout } = sh.exec(`git commit -m "${message}"`);
23
- return stdout.match(/\[.+([a-z0-9]{7})\]/)[1];
23
+ const match = stdout.match(/\[.+([a-z0-9]{7})\]/);
24
+ return match ? match[1] : null;
24
25
  };
25
26
 
26
27
  module.exports = {