release-it 14.14.2 → 14.14.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
@@ -156,7 +156,8 @@ remote.
156
156
  ## GitHub Releases
157
157
 
158
158
  GitHub projects can have releases attached to Git tags, containing release notes and assets. There are two ways to add
159
- [GitHub releases](https://help.github.com/articles/creating-releases) in your release-it flow:
159
+ [GitHub releases](https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases) in your
160
+ release-it flow:
160
161
 
161
162
  1. Automated (requires a `GITHUB_TOKEN`)
162
163
  2. Manual (using the GitHub web interface with pre-populated fields)
@@ -255,7 +256,7 @@ will run one after another. Some example release-it configuration:
255
256
  The variables can be found in the [default configuration](./config/release-it.json). Additionally, the following
256
257
  variables are exposed:
257
258
 
258
- ```
259
+ ```text
259
260
  version
260
261
  latestVersion
261
262
  changelog
@@ -327,29 +328,22 @@ While mostly used as a CLI tool, release-it can be used as a dependency to integ
327
328
  - [antonmedv/fx](https://github.com/antonmedv/fx)
328
329
  - [blockchain/blockchain-wallet-v4-frontend](https://github.com/blockchain/blockchain-wallet-v4-frontend)
329
330
  - [callstack/linaria](https://github.com/callstack/linaria)
331
+ - [callstack/react-native-paper](https://github.com/callstack/react-native-paper)
330
332
  - [ember-cli/ember-cli](https://github.com/ember-cli/ember-cli)
331
- - [metalsmith/metalsmith](https://github.com/metalsmith/metalsmith)
332
- - [react-native-paper](https://github.com/callstack/react-native-paper)
333
333
  - [js-cookie/js-cookie](https://github.com/js-cookie/js-cookie)
334
- - [saleor/saleor](https://github.com/saleor/saleor)
334
+ - [metalsmith/metalsmith](https://github.com/metalsmith/metalsmith)
335
335
  - [mozilla/readability](https://github.com/mozilla/readability)
336
336
  - [redis/node-redis](https://github.com/redis/node-redis)
337
+ - [saleor/saleor](https://github.com/saleor/saleor)
337
338
  - [shipshapecode/shepherd](https://github.com/shipshapecode/shepherd)
339
+ - [StevenBlack/hosts](https://github.com/StevenBlack/hosts)
338
340
  - [swagger-api/swagger-ui](https://github.com/swagger-api/swagger-ui) +
339
341
  [swagger-editor](https://github.com/swagger-api/swagger-editor)
340
- - [StevenBlack/hosts](https://github.com/StevenBlack/hosts)
341
342
  - [tabler/tabler](https://github.com/tabler/tabler) + [tabler-icons](https://github.com/tabler/tabler-icons)
342
343
  - [youzan/vant](https://github.com/youzan/vant)
343
344
  - [Repositories that depend on release-it](https://github.com/release-it/release-it/network/dependents)
344
345
  - GitHub search for [filename:.release-it.json](https://github.com/search?q=filename%3A.release-it.json)
345
346
 
346
- ## Resources
347
+ ## License
347
348
 
348
- - [semver.org](https://semver.org)
349
- - [GitHub Help](https://docs.github.com) (→
350
- [About Releases](https://docs.github.com/free-pro-team@latest/github/administering-a-repository/about-releases))
351
- - [npm Blog: Publishing what you mean to publish](https://blog.npmjs.org/post/165769683050/publishing-what-you-mean-to-publish)
352
- - [npm Documentation: package.json](https://docs.npmjs.com/cli/v6/configuring-npm/package-json)
353
- - [Prereleases and npm](https://medium.com/@mbostock/prereleases-and-npm-e778fc5e2420)
354
- - [Glob Primer (node-glob)](https://github.com/isaacs/node-glob#glob-primer) (release-it uses
355
- [globby](https://github.com/sindresorhus/globby#readme))
349
+ [MIT](./LICENSE)
@@ -7,6 +7,7 @@ const _ = require('lodash');
7
7
  const retry = require('async-retry');
8
8
  const newGithubReleaseUrl = require('new-github-release-url');
9
9
  const open = require('open');
10
+ const ProxyAgent = require('proxy-agent');
10
11
  const pkg = require('../../../package.json');
11
12
  const { format, parseVersion, e } = require('../../util');
12
13
  const Release = require('../GitRelease');
@@ -167,7 +168,7 @@ class GitHub extends Release {
167
168
  };
168
169
 
169
170
  if (proxy) {
170
- options.proxy = proxy;
171
+ options.request.agent = new ProxyAgent(proxy);
171
172
  }
172
173
 
173
174
  const client = new Octokit(options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-it",
3
- "version": "14.14.2",
3
+ "version": "14.14.3",
4
4
  "description": "Generic CLI tool to automate versioning and package publishing related tasks.",
5
5
  "keywords": [
6
6
  "build",
@@ -77,6 +77,7 @@
77
77
  "os-name": "4.0.1",
78
78
  "parse-json": "5.2.0",
79
79
  "promise.allsettled": "1.0.5",
80
+ "proxy-agent": "5.0.0",
80
81
  "semver": "7.3.5",
81
82
  "shelljs": "0.8.5",
82
83
  "update-notifier": "5.1.0",
package/test/git.init.js CHANGED
@@ -154,19 +154,13 @@ test.serial('should get the latest custom tag after fetch when tagName is config
154
154
  test.serial('should get the latest tag based on tagMatch', async t => {
155
155
  const shell = factory(Shell);
156
156
  const gitClient = factory(Git, {
157
- options: { git: { tagMatch: '[0-9][0-9].[0-1][0-9].[0-9]*' } },
157
+ options: { git: { tagMatch: '[0-9][0-9]\\.[0-1][0-9]\\.[0-9]*' } },
158
158
  container: { shell }
159
159
  });
160
- const { bare, target } = t.context;
161
- const other = mkTmpDir();
162
- sh.exec('git push');
163
- sh.exec(`git clone ${bare} ${other}`);
164
- sh.pushd('-q', other);
165
160
  sh.exec('git tag 1.0.0');
166
161
  sh.exec('git tag 21.04.3');
167
162
  sh.exec('git tag 1.0.1');
168
163
  sh.exec('git push --tags');
169
- sh.pushd('-q', target);
170
164
  await gitClient.init();
171
165
  t.is(gitClient.config.getContext('latestTag'), '21.04.3');
172
166
  });
@@ -180,3 +174,21 @@ test.serial('should generate correct changelog', async t => {
180
174
  const changelog = await gitClient.getChangelog();
181
175
  t.regex(changelog, /\* Add file \(\w{7}\)\n\* Add file \(\w{7}\)/);
182
176
  });
177
+
178
+ test.serial('should get the full changelog since latest major tag', async t => {
179
+ const shell = factory(Shell);
180
+ const gitClient = factory(Git, {
181
+ options: { git: { tagMatch: '[0-9]\\.[0-9]\\.[0-9]', changelog: git.changelog } },
182
+ container: { shell }
183
+ });
184
+ sh.exec('git tag 1.0.0');
185
+ gitAdd('line', 'file', 'Add file');
186
+ sh.exec('git tag 2.0.0-rc.0');
187
+ gitAdd('line', 'file', 'Add file');
188
+ sh.exec('git tag 2.0.0-rc.1');
189
+ gitAdd('line', 'file', 'Add file');
190
+ await gitClient.init();
191
+ t.is(gitClient.config.getContext('latestTag'), '1.0.0');
192
+ const changelog = await gitClient.getChangelog();
193
+ t.regex(changelog, /\* Add file \(\w{7}\)\n\* Add file \(\w{7}\)\n\* Add file \(\w{7}\)/);
194
+ });
package/test/github.js CHANGED
@@ -236,6 +236,7 @@ test('should release to alternative host and proxy', async t => {
236
236
  const { isReleased, releaseUrl } = github.getContext();
237
237
  t.true(isReleased);
238
238
  t.is(releaseUrl, `https://custom.example.org/user/repo/releases/tag/1.0.1`);
239
+ t.is(github.options.proxy, 'http://proxy:8080');
239
240
  exec.restore();
240
241
  });
241
242