release-it 15.6.0 → 15.6.1

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
@@ -340,9 +340,8 @@ While mostly used as a CLI tool, release-it can be used as a dependency to integ
340
340
 
341
341
  ## Example projects using release-it
342
342
 
343
- - [antonmedv/fx](https://github.com/antonmedv/fx)
343
+ - [axios/axios](https://github.com/axios/axios)
344
344
  - [blockchain/blockchain-wallet-v4-frontend](https://github.com/blockchain/blockchain-wallet-v4-frontend)
345
- - [callstack/linaria](https://github.com/callstack/linaria)
346
345
  - [callstack/react-native-paper](https://github.com/callstack/react-native-paper)
347
346
  - [ember-cli/ember-cli](https://github.com/ember-cli/ember-cli)
348
347
  - [js-cookie/js-cookie](https://github.com/js-cookie/js-cookie)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-it",
3
- "version": "15.6.0",
3
+ "version": "15.6.1",
4
4
  "description": "Generic CLI tool to automate versioning and package publishing related tasks.",
5
5
  "keywords": [
6
6
  "build",
@@ -60,13 +60,13 @@
60
60
  "license": "MIT",
61
61
  "dependencies": {
62
62
  "@iarna/toml": "2.2.5",
63
- "@octokit/rest": "19.0.5",
63
+ "@octokit/rest": "19.0.7",
64
64
  "async-retry": "1.3.3",
65
- "chalk": "5.1.2",
66
- "cosmiconfig": "8.0.0",
67
- "execa": "6.1.0",
65
+ "chalk": "5.2.0",
66
+ "cosmiconfig": "8.1.0",
67
+ "execa": "7.0.0",
68
68
  "git-url-parse": "13.1.0",
69
- "globby": "13.1.2",
69
+ "globby": "13.1.3",
70
70
  "got": "12.5.3",
71
71
  "inquirer": "9.1.4",
72
72
  "is-ci": "3.0.1",
@@ -74,9 +74,9 @@
74
74
  "mime-types": "2.1.35",
75
75
  "new-github-release-url": "2.0.0",
76
76
  "node-fetch": "3.3.0",
77
- "open": "8.4.0",
77
+ "open": "8.4.2",
78
78
  "ora": "6.1.2",
79
- "os-name": "5.0.1",
79
+ "os-name": "5.1.0",
80
80
  "promise.allsettled": "1.0.6",
81
81
  "proxy-agent": "5.0.0",
82
82
  "semver": "7.3.8",
@@ -87,19 +87,19 @@
87
87
  "yargs-parser": "21.1.1"
88
88
  },
89
89
  "devDependencies": {
90
- "@octokit/request-error": "3.0.2",
91
- "ava": "5.1.0",
92
- "eslint": "8.28.0",
93
- "eslint-config-prettier": "8.5.0",
94
- "eslint-plugin-ava": "13.2.0",
95
- "eslint-plugin-import": "2.26.0",
90
+ "@octokit/request-error": "3.0.3",
91
+ "ava": "5.2.0",
92
+ "eslint": "8.35.0",
93
+ "eslint-config-prettier": "8.6.0",
94
+ "eslint-plugin-ava": "14.0.0",
95
+ "eslint-plugin-import": "2.27.5",
96
96
  "eslint-plugin-prettier": "4.2.1",
97
97
  "mock-fs": "5.2.0",
98
98
  "mock-stdio": "1.0.3",
99
- "nock": "13.2.9",
99
+ "nock": "13.3.0",
100
100
  "nyc": "15.1.0",
101
- "prettier": "2.8.0",
102
- "sinon": "15.0.0",
101
+ "prettier": "2.8.4",
102
+ "sinon": "15.0.1",
103
103
  "strip-ansi": "7.0.1"
104
104
  },
105
105
  "engines": {
package/test/npm.js CHANGED
@@ -108,7 +108,7 @@ test('should add registry to commands when specified', async t => {
108
108
  const exec = sinon.stub(npmClient.shell, 'exec').resolves();
109
109
  exec.withArgs('npm whoami --registry registry.example.org').resolves('john');
110
110
  exec
111
- .withArgs('npm access ls-collaborators release-it --registry registry.example.org')
111
+ .withArgs(/npm access (list collaborators --json|ls-collaborators) release-it --registry registry.example.org/)
112
112
  .resolves(JSON.stringify({ john: ['write'] }));
113
113
  await runTasks(npmClient);
114
114
  t.is(exec.args[0][0], 'npm ping --registry registry.example.org');
@@ -121,7 +121,9 @@ test('should not throw when executing tasks', async t => {
121
121
  const npmClient = factory(npm);
122
122
  const exec = sinon.stub(npmClient.shell, 'exec').resolves();
123
123
  exec.withArgs('npm whoami').resolves('john');
124
- exec.withArgs('npm access ls-collaborators release-it').resolves(JSON.stringify({ john: ['write'] }));
124
+ exec
125
+ .withArgs(/npm access (list collaborators --json|ls-collaborators) release-it/)
126
+ .resolves(JSON.stringify({ john: ['write'] }));
125
127
  await t.notThrowsAsync(runTasks(npmClient));
126
128
  exec.restore();
127
129
  });
@@ -168,7 +170,9 @@ test('should not throw if npm returns 404 for unsupported ping', async t => {
168
170
  const pingError = 'npm ERR! <title>404 - No content for path /-/ping</title>';
169
171
  exec.withArgs('npm ping').rejects(new Error(pingError));
170
172
  exec.withArgs('npm whoami').resolves('john');
171
- exec.withArgs('npm access ls-collaborators release-it').resolves(JSON.stringify({ john: ['write'] }));
173
+ exec
174
+ .withArgs(/npm access (list collaborators --json|ls-collaborators) release-it/)
175
+ .resolves(JSON.stringify({ john: ['write'] }));
172
176
  await runTasks(npmClient);
173
177
  t.is(exec.lastCall.args[0].trim(), 'npm publish . --tag latest');
174
178
  exec.restore();
@@ -197,7 +201,9 @@ test('should throw if user is not a collaborator (v8)', async t => {
197
201
  const exec = sinon.stub(npmClient.shell, 'exec').resolves();
198
202
  exec.withArgs('npm whoami').resolves('ada');
199
203
  exec.withArgs('npm --version').resolves('8.2.0');
200
- exec.withArgs('npm access ls-collaborators release-it').resolves(JSON.stringify({ john: ['write'] }));
204
+ exec
205
+ .withArgs(/npm access (list collaborators --json|ls-collaborators) release-it/)
206
+ .resolves(JSON.stringify({ john: ['write'] }));
201
207
  await t.throwsAsync(runTasks(npmClient), { message: /^User ada is not a collaborator for release-it/ });
202
208
  exec.restore();
203
209
  });
@@ -207,7 +213,7 @@ test('should not throw if user is not a collaborator on a new package', async t
207
213
  const exec = sinon.stub(npmClient.shell, 'exec').resolves();
208
214
  exec.withArgs('npm whoami').resolves('ada');
209
215
  exec
210
- .withArgs('npm access ls-collaborators release-it')
216
+ .withArgs(/npm access (list collaborators --json|ls-collaborators) release-it/)
211
217
  .rejects(
212
218
  new Error(
213
219
  'npm ERR! code E404\nnpm ERR! 404 Not Found - GET https://registry.npmjs.org/-/package/release-it/collaborators?format=cli - File not found'
@@ -268,7 +274,9 @@ test('should publish', async t => {
268
274
  const npmClient = factory(npm);
269
275
  const exec = sinon.stub(npmClient.shell, 'exec').resolves();
270
276
  exec.withArgs('npm whoami').resolves('john');
271
- exec.withArgs('npm access ls-collaborators release-it').resolves(JSON.stringify({ john: ['write'] }));
277
+ exec
278
+ .withArgs(/npm access (list collaborators --json|ls-collaborators) release-it/)
279
+ .resolves(JSON.stringify({ john: ['write'] }));
272
280
  await runTasks(npmClient);
273
281
  t.is(exec.lastCall.args[0].trim(), 'npm publish . --tag latest');
274
282
  exec.restore();
@@ -308,7 +316,7 @@ test('should publish to a different/scoped registry', async t => {
308
316
  .resolves('john');
309
317
  exec
310
318
  .withArgs(
311
- 'npm access ls-collaborators @my-scope/my-pkg --registry https://gitlab.com/api/v4/projects/my-scope%2Fmy-pkg/packages/npm/'
319
+ /npm access (list collaborators --json|ls-collaborators) @my-scope\/my-pkg --registry https:\/\/gitlab\.com\/api\/v4\/projects\/my-scope%2Fmy-pkg\/packages\/npm\//
312
320
  )
313
321
  .resolves(JSON.stringify({ john: ['write'] }));
314
322
 
@@ -337,7 +345,9 @@ test('should not publish when `npm version` fails', async t => {
337
345
  const npmClient = factory(npm, { options });
338
346
  const exec = sinon.stub(npmClient.shell, 'exec').resolves();
339
347
  exec.withArgs('npm whoami').resolves('john');
340
- exec.withArgs('npm access ls-collaborators @my-scope/my-pkg').resolves(JSON.stringify({ john: ['write'] }));
348
+ exec
349
+ .withArgs(/npm access (list collaborators --json|ls-collaborators) @my-scope\/my-pkg/)
350
+ .resolves(JSON.stringify({ john: ['write'] }));
341
351
  exec
342
352
  .withArgs('npm version 1.0.1 --no-git-tag-version')
343
353
  .rejects('npm ERR! Version not changed, might want --allow-same-version');
package/test/tasks.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import path from 'node:path';
2
2
  import test from 'ava';
3
+ import semver from 'semver';
3
4
  import sh from 'shelljs';
4
5
  import _ from 'lodash';
5
6
  import sinon from 'sinon';
@@ -28,6 +29,8 @@ const noop = Promise.resolve();
28
29
 
29
30
  const sandbox = sinon.createSandbox();
30
31
 
32
+ const npmMajorVersion = semver.major(process.env.npm_config_user_agent.match(/npm\/([^ ]+)/)[1]);
33
+
31
34
  const testConfig = {
32
35
  ci: true,
33
36
  config: false
@@ -175,7 +178,7 @@ test.serial('should release all the things (basic)', async t => {
175
178
  'npm whoami',
176
179
  `npm show ${pkgName}@latest version`,
177
180
  'npm --version',
178
- `npm access ls-collaborators ${pkgName}`,
181
+ `npm access ${npmMajorVersion >= 9 ? 'list collaborators --json' : 'ls-collaborators'} ${pkgName}`,
179
182
  'npm version 1.0.1 --no-git-tag-version',
180
183
  'npm publish . --tag latest'
181
184
  ]);
@@ -309,7 +312,7 @@ test.serial('should release all the things (pre-release, github, gitlab)', async
309
312
  'npm whoami',
310
313
  `npm show ${pkgName}@latest version`,
311
314
  'npm --version',
312
- `npm access ls-collaborators ${pkgName}`,
315
+ `npm access ${npmMajorVersion >= 9 ? 'list collaborators --json' : 'ls-collaborators'} ${pkgName}`,
313
316
  'npm version 1.1.0-alpha.0 --no-git-tag-version',
314
317
  'npm publish . --tag alpha'
315
318
  ]);
@@ -349,7 +352,7 @@ test.serial('should publish pre-release without pre-id with different npm.tag',
349
352
  'npm whoami',
350
353
  `npm show ${pkgName}@latest version`,
351
354
  'npm --version',
352
- `npm access ls-collaborators ${pkgName}`,
355
+ `npm access ${npmMajorVersion >= 9 ? 'list collaborators --json' : 'ls-collaborators'} ${pkgName}`,
353
356
  'npm version 2.0.0-0 --no-git-tag-version',
354
357
  'npm publish . --tag next'
355
358
  ]);