release-it 17.8.1 → 17.9.0
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 +40 -38
- package/lib/plugin/github/GitHub.js +2 -2
- package/lib/plugin/gitlab/GitLab.js +4 -1
- package/package.json +5 -5
- package/test/gitlab.js +6 -0
- package/test/stub/github.js +2 -2
- package/test/tasks.interactive.js +7 -0
- package/test/tasks.js +9 -3
package/README.md
CHANGED
|
@@ -328,34 +328,35 @@ release-it programmatically][54] for example code.
|
|
|
328
328
|
- [Halo][59]
|
|
329
329
|
- [hosts][60]
|
|
330
330
|
- [js-cookie][61]
|
|
331
|
-
- [
|
|
332
|
-
- [
|
|
333
|
-
- [
|
|
334
|
-
- [
|
|
335
|
-
- [
|
|
336
|
-
- [
|
|
337
|
-
- [
|
|
338
|
-
- [
|
|
339
|
-
- [
|
|
340
|
-
- [
|
|
341
|
-
-
|
|
342
|
-
- [
|
|
343
|
-
-
|
|
331
|
+
- [jQuery][62]
|
|
332
|
+
- [Madge][63]
|
|
333
|
+
- [Metalsmith][64]
|
|
334
|
+
- [Node-Redis][65]
|
|
335
|
+
- [React Native Paper][66]
|
|
336
|
+
- [Readability.js][67]
|
|
337
|
+
- [Redux][68]
|
|
338
|
+
- [Saleor][69]
|
|
339
|
+
- [Semantic UI React][70]
|
|
340
|
+
- [Shepherd][71]
|
|
341
|
+
- [Tabler][72] + [tabler-icons][73]
|
|
342
|
+
- Swagger ([swagger-ui][74] + [swagger-editor][75])
|
|
343
|
+
- [Repositories that depend on release-it][76]
|
|
344
|
+
- GitHub search for [path:\*\*/.release-it.json][77]
|
|
344
345
|
|
|
345
346
|
## Legacy Node.js
|
|
346
347
|
|
|
347
348
|
The latest major version is v17, supporting Node.js 18 and up (as Node.js v16 is EOL). The previous major version was
|
|
348
|
-
v16, supporting Node.js 16. Use release-it v15 for environments running Node.js v14. Also see [CHANGELOG.md][
|
|
349
|
+
v16, supporting Node.js 16. Use release-it v15 for environments running Node.js v14. Also see [CHANGELOG.md][78].
|
|
349
350
|
|
|
350
351
|
## Links
|
|
351
352
|
|
|
352
|
-
- See [CHANGELOG.md][
|
|
353
|
-
- To **contribute**, please read [CONTRIBUTING.md][
|
|
354
|
-
- Please [open an issue][
|
|
353
|
+
- See [CHANGELOG.md][78] for major/breaking updates, and [releases][79] for a detailed version history.
|
|
354
|
+
- To **contribute**, please read [CONTRIBUTING.md][80] first.
|
|
355
|
+
- Please [open an issue][81] if anything is missing or unclear in this documentation.
|
|
355
356
|
|
|
356
357
|
## License
|
|
357
358
|
|
|
358
|
-
[MIT][
|
|
359
|
+
[MIT][82]
|
|
359
360
|
|
|
360
361
|
Are you using release-it at work? Please consider [sponsoring me][14]!
|
|
361
362
|
|
|
@@ -420,23 +421,24 @@ Are you using release-it at work? Please consider [sponsoring me][14]!
|
|
|
420
421
|
[59]: https://github.com/halo-dev/halo
|
|
421
422
|
[60]: https://github.com/StevenBlack/hosts
|
|
422
423
|
[61]: https://github.com/js-cookie/js-cookie
|
|
423
|
-
[62]: https://github.com/
|
|
424
|
-
[63]: https://github.com/
|
|
425
|
-
[64]: https://github.com/
|
|
426
|
-
[65]: https://github.com/
|
|
427
|
-
[66]: https://github.com/
|
|
428
|
-
[67]: https://github.com/
|
|
429
|
-
[68]: https://github.com/
|
|
430
|
-
[69]: https://github.com/
|
|
431
|
-
[70]: https://github.com/
|
|
432
|
-
[71]: https://github.com/
|
|
433
|
-
[72]: https://github.com/tabler/tabler
|
|
434
|
-
[73]: https://github.com/
|
|
435
|
-
[74]: https://github.com/swagger-api/swagger-
|
|
436
|
-
[75]: https://github.com/
|
|
437
|
-
[76]: https://github.com/
|
|
438
|
-
[77]:
|
|
439
|
-
[78]:
|
|
440
|
-
[79]:
|
|
441
|
-
[80]:
|
|
442
|
-
[81]:
|
|
424
|
+
[62]: https://github.com/jquery/jquery
|
|
425
|
+
[63]: https://github.com/pahen/madge
|
|
426
|
+
[64]: https://github.com/metalsmith/metalsmith
|
|
427
|
+
[65]: https://github.com/redis/node-redis
|
|
428
|
+
[66]: https://github.com/callstack/react-native-paper
|
|
429
|
+
[67]: https://github.com/mozilla/readability
|
|
430
|
+
[68]: https://github.com/reduxjs/redux
|
|
431
|
+
[69]: https://github.com/saleor/saleor
|
|
432
|
+
[70]: https://github.com/Semantic-Org/Semantic-UI-React
|
|
433
|
+
[71]: https://github.com/shipshapecode/shepherd
|
|
434
|
+
[72]: https://github.com/tabler/tabler
|
|
435
|
+
[73]: https://github.com/tabler/tabler-icons
|
|
436
|
+
[74]: https://github.com/swagger-api/swagger-ui
|
|
437
|
+
[75]: https://github.com/swagger-api/swagger-editor
|
|
438
|
+
[76]: https://github.com/release-it/release-it/network/dependents
|
|
439
|
+
[77]: https://github.com/search?q=path%3A**%2F.release-it.json&type=code
|
|
440
|
+
[78]: ./CHANGELOG.md
|
|
441
|
+
[79]: https://github.com/release-it/release-it/releases
|
|
442
|
+
[80]: ./.github/CONTRIBUTING.md
|
|
443
|
+
[81]: https://github.com/release-it/release-it/issues/new
|
|
444
|
+
[82]: ./LICENSE
|
|
@@ -215,7 +215,7 @@ class GitHub extends Release {
|
|
|
215
215
|
preRelease = false,
|
|
216
216
|
autoGenerate = false,
|
|
217
217
|
makeLatest = true,
|
|
218
|
-
discussionCategoryName =
|
|
218
|
+
discussionCategoryName = undefined
|
|
219
219
|
} = this.options;
|
|
220
220
|
const { tagName } = this.config.getContext();
|
|
221
221
|
const { version, releaseNotes, isUpdate } = this.getContext();
|
|
@@ -236,7 +236,7 @@ class GitHub extends Release {
|
|
|
236
236
|
draft,
|
|
237
237
|
prerelease: isPreRelease || preRelease,
|
|
238
238
|
generate_release_notes: autoGenerate,
|
|
239
|
-
discussion_category_name: discussionCategoryName
|
|
239
|
+
discussion_category_name: discussionCategoryName
|
|
240
240
|
};
|
|
241
241
|
return Object.assign(options, contextOptions);
|
|
242
242
|
}
|
|
@@ -189,10 +189,11 @@ class GitLab extends Release {
|
|
|
189
189
|
|
|
190
190
|
async createRelease() {
|
|
191
191
|
const { releaseName } = this.options;
|
|
192
|
-
const { tagName } = this.config.getContext();
|
|
192
|
+
const { tagName, branchName, git: { tagAnnotation } = {} } = this.config.getContext();
|
|
193
193
|
const { id, releaseNotes, repo, origin } = this.getContext();
|
|
194
194
|
const { isDryRun } = this.config;
|
|
195
195
|
const name = format(releaseName, this.config.getContext());
|
|
196
|
+
const tagMessage = format(tagAnnotation, this.config.getContext());
|
|
196
197
|
const description = releaseNotes || '-';
|
|
197
198
|
const releaseUrl = `${origin}/${repo.repository}/-/releases`;
|
|
198
199
|
const releaseMilestones = this.getReleaseMilestones();
|
|
@@ -208,7 +209,9 @@ class GitLab extends Release {
|
|
|
208
209
|
const options = {
|
|
209
210
|
json: {
|
|
210
211
|
name,
|
|
212
|
+
ref: branchName,
|
|
211
213
|
tag_name: tagName,
|
|
214
|
+
tag_message: tagMessage,
|
|
212
215
|
description
|
|
213
216
|
}
|
|
214
217
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-it",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.9.0",
|
|
4
4
|
"description": "Generic CLI tool to automate versioning and package publishing-related tasks.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"build",
|
|
@@ -116,10 +116,10 @@
|
|
|
116
116
|
"eslint-plugin-import-x": "4.3.1",
|
|
117
117
|
"eslint-plugin-prettier": "5.2.1",
|
|
118
118
|
"fs-monkey": "1.0.6",
|
|
119
|
-
"globals": "15.
|
|
119
|
+
"globals": "15.11.0",
|
|
120
120
|
"installed-check": "9.3.0",
|
|
121
|
-
"knip": "5.
|
|
122
|
-
"memfs": "4.
|
|
121
|
+
"knip": "5.33.3",
|
|
122
|
+
"memfs": "4.14.0",
|
|
123
123
|
"mock-stdio": "1.0.3",
|
|
124
124
|
"nock": "14.0.0-beta.8",
|
|
125
125
|
"prettier": "3.3.3",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"remark-preset-webpro": "1.1.1",
|
|
128
128
|
"sinon": "19.0.2",
|
|
129
129
|
"strip-ansi": "7.1.0",
|
|
130
|
-
"typescript": "5.6.
|
|
130
|
+
"typescript": "5.6.3"
|
|
131
131
|
},
|
|
132
132
|
"overrides": {
|
|
133
133
|
"pac-resolver": "7.0.1",
|
package/test/gitlab.js
CHANGED
|
@@ -2,6 +2,7 @@ import fs from 'node:fs';
|
|
|
2
2
|
import test from 'ava';
|
|
3
3
|
import sinon from 'sinon';
|
|
4
4
|
import nock from 'nock';
|
|
5
|
+
import Git from '../lib/plugin/git/Git.js';
|
|
5
6
|
import GitLab from '../lib/plugin/gitlab/GitLab.js';
|
|
6
7
|
import { factory, runTasks } from './util/index.js';
|
|
7
8
|
import {
|
|
@@ -63,6 +64,9 @@ test.serial('should upload assets and release', async t => {
|
|
|
63
64
|
const gitlab = factory(GitLab, { options });
|
|
64
65
|
sinon.stub(gitlab, 'getLatestVersion').resolves('2.0.0');
|
|
65
66
|
|
|
67
|
+
const git = factory(Git);
|
|
68
|
+
const ref = (await git.getBranchName()) ?? 'HEAD';
|
|
69
|
+
|
|
66
70
|
interceptUser();
|
|
67
71
|
interceptCollaborator();
|
|
68
72
|
interceptMilestones({
|
|
@@ -89,7 +93,9 @@ test.serial('should upload assets and release', async t => {
|
|
|
89
93
|
interceptPublish({
|
|
90
94
|
body: {
|
|
91
95
|
name: 'Release 2.0.1',
|
|
96
|
+
ref,
|
|
92
97
|
tag_name: '2.0.1',
|
|
98
|
+
tag_message: 'Release 2.0.1',
|
|
93
99
|
description: 'Custom notes',
|
|
94
100
|
assets: {
|
|
95
101
|
links: [
|
package/test/stub/github.js
CHANGED
|
@@ -52,7 +52,7 @@ const interceptCreate = ({
|
|
|
52
52
|
draft = false,
|
|
53
53
|
generate_release_notes = false,
|
|
54
54
|
make_latest = 'true',
|
|
55
|
-
discussion_category_name =
|
|
55
|
+
discussion_category_name = undefined
|
|
56
56
|
}
|
|
57
57
|
} = {}) => {
|
|
58
58
|
nock(api)
|
|
@@ -97,7 +97,7 @@ const interceptUpdate = ({
|
|
|
97
97
|
draft = false,
|
|
98
98
|
generate_release_notes = false,
|
|
99
99
|
make_latest = 'true',
|
|
100
|
-
discussion_category_name =
|
|
100
|
+
discussion_category_name = undefined
|
|
101
101
|
}
|
|
102
102
|
} = {}) => {
|
|
103
103
|
nock(api)
|
|
@@ -8,10 +8,12 @@ import Spinner from '../lib/spinner.js';
|
|
|
8
8
|
import Prompt from '../lib/prompt.js';
|
|
9
9
|
import Config from '../lib/config.js';
|
|
10
10
|
import runTasks from '../lib/index.js';
|
|
11
|
+
import Git from '../lib/plugin/git/Git.js';
|
|
11
12
|
import { mkTmpDir, gitAdd } from './util/helpers.js';
|
|
12
13
|
import ShellStub from './stub/shell.js';
|
|
13
14
|
import { interceptPublish as interceptGitLabPublish } from './stub/gitlab.js';
|
|
14
15
|
import { interceptCreate as interceptGitHubCreate } from './stub/github.js';
|
|
16
|
+
import { factory } from './util/index.js';
|
|
15
17
|
|
|
16
18
|
const noop = Promise.resolve();
|
|
17
19
|
|
|
@@ -160,6 +162,9 @@ test.serial('should run "after:*:release" plugin hooks', async t => {
|
|
|
160
162
|
sh.exec('git tag 1.0.0');
|
|
161
163
|
const sha = gitAdd('line', 'file', 'More file');
|
|
162
164
|
|
|
165
|
+
const git = factory(Git);
|
|
166
|
+
const ref = (await git.getBranchName()) ?? 'HEAD';
|
|
167
|
+
|
|
163
168
|
interceptGitHubCreate({
|
|
164
169
|
owner,
|
|
165
170
|
project,
|
|
@@ -171,7 +176,9 @@ test.serial('should run "after:*:release" plugin hooks', async t => {
|
|
|
171
176
|
project,
|
|
172
177
|
body: {
|
|
173
178
|
name: 'Release 1.1.0',
|
|
179
|
+
ref,
|
|
174
180
|
tag_name: '1.1.0',
|
|
181
|
+
tag_message: 'Release 1.1.0',
|
|
175
182
|
description: `* More file (${sha})`
|
|
176
183
|
}
|
|
177
184
|
});
|
package/test/tasks.js
CHANGED
|
@@ -8,6 +8,7 @@ import Log from '../lib/log.js';
|
|
|
8
8
|
import Spinner from '../lib/spinner.js';
|
|
9
9
|
import Config from '../lib/config.js';
|
|
10
10
|
import runTasks from '../lib/index.js';
|
|
11
|
+
import Git from '../lib/plugin/git/Git.js';
|
|
11
12
|
import { mkTmpDir, gitAdd, getArgs } from './util/helpers.js';
|
|
12
13
|
import ShellStub from './stub/shell.js';
|
|
13
14
|
import {
|
|
@@ -22,6 +23,7 @@ import {
|
|
|
22
23
|
interceptCreate as interceptGitHubCreate,
|
|
23
24
|
interceptAsset as interceptGitHubAsset
|
|
24
25
|
} from './stub/github.js';
|
|
26
|
+
import { factory } from './util/index.js';
|
|
25
27
|
|
|
26
28
|
const rootDir = new URL('..', import.meta.url);
|
|
27
29
|
|
|
@@ -247,6 +249,8 @@ test.serial('should release all the things (pre-release, github, gitlab)', async
|
|
|
247
249
|
sh.exec('git tag v1.0.0');
|
|
248
250
|
const sha = gitAdd('line', 'file', 'More file');
|
|
249
251
|
sh.exec('git push --follow-tags');
|
|
252
|
+
const git = factory(Git);
|
|
253
|
+
const ref = (await git.getBranchName()) ?? 'HEAD';
|
|
250
254
|
|
|
251
255
|
interceptGitHubAuthentication();
|
|
252
256
|
interceptGitHubCollaborator({ owner, project });
|
|
@@ -270,7 +274,9 @@ test.serial('should release all the things (pre-release, github, gitlab)', async
|
|
|
270
274
|
project,
|
|
271
275
|
body: {
|
|
272
276
|
name: 'Release 1.1.0-alpha.0',
|
|
277
|
+
ref,
|
|
273
278
|
tag_name: 'v1.1.0-alpha.0',
|
|
279
|
+
tag_message: `${owner} ${owner}/${project} ${project}`,
|
|
274
280
|
description: `Notes for ${pkgName}: ${sha}`,
|
|
275
281
|
assets: {
|
|
276
282
|
links: [
|
|
@@ -333,7 +339,7 @@ test.serial('should release all the things (pre-release, github, gitlab)', async
|
|
|
333
339
|
t.true(log.obtrusive.firstCall.args[0].endsWith(`release ${pkgName} (1.0.0...1.1.0-alpha.0)`));
|
|
334
340
|
t.true(log.log.firstCall.args[0].endsWith(`https://www.npmjs.com/package/${pkgName}`));
|
|
335
341
|
t.true(log.log.secondCall.args[0].endsWith(`https://github.com/${owner}/${project}/releases/tag/v1.1.0-alpha.0`));
|
|
336
|
-
t.true(log.log.args[
|
|
342
|
+
t.true(log.log.thirdCall.args[0].endsWith(`${project}/-/releases`));
|
|
337
343
|
t.regex(log.log.lastCall.args[0], /Done \(in [0-9]+s\.\)/);
|
|
338
344
|
|
|
339
345
|
exec.restore();
|
|
@@ -365,7 +371,7 @@ test.serial('should publish pre-release without pre-id with different npm.tag',
|
|
|
365
371
|
t.is(stdout.trim(), 'v2.0.0-0');
|
|
366
372
|
t.true(log.obtrusive.firstCall.args[0].endsWith(`release ${pkgName} (1.0.0...2.0.0-0)`));
|
|
367
373
|
t.true(log.log.firstCall.args[0].endsWith(`https://www.npmjs.com/package/${pkgName}`));
|
|
368
|
-
t.regex(log.log.args[
|
|
374
|
+
t.regex(log.log.lastCall.args[0], /Done \(in [0-9]+s\.\)/);
|
|
369
375
|
|
|
370
376
|
exec.restore();
|
|
371
377
|
});
|
|
@@ -385,7 +391,7 @@ test.serial('should handle private package correctly, bump lockfile', async t =>
|
|
|
385
391
|
t.deepEqual(npmArgs, ['npm version 1.0.1 --no-git-tag-version']);
|
|
386
392
|
t.true(log.obtrusive.firstCall.args[0].endsWith(`release ${pkgName} (1.0.0...1.0.1)`));
|
|
387
393
|
t.is(log.warn.length, 0);
|
|
388
|
-
t.regex(log.log.args[0]
|
|
394
|
+
t.regex(log.log.firstCall.args[0], /Done \(in [0-9]+s\.\)/);
|
|
389
395
|
|
|
390
396
|
exec.restore();
|
|
391
397
|
});
|