release-it 17.3.0 → 17.4.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 +138 -131
- package/lib/config.js +1 -0
- package/lib/log.js +2 -2
- package/lib/plugin/gitlab/GitLab.js +1 -2
- package/package.json +27 -15
- package/schema/git.json +97 -0
- package/schema/github.json +77 -0
- package/schema/gitlab.json +61 -0
- package/schema/npm.json +57 -0
- package/schema/release-it.json +89 -0
- package/test/github.js +1 -1
- package/test/gitlab.js +1 -1
- package/types/config.d.ts +183 -0
- package/types/hooks.d.ts +47 -0
- package/types/index.d.ts +3 -0
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
🚀 Generic CLI tool to automate versioning and package publishing-related tasks:
|
|
4
4
|
|
|
5
|
-
<img align="right" src="./docs/assets/release-it.svg?raw=true" height="280"
|
|
5
|
+
<img align="right" src="./docs/assets/release-it.svg?raw=true" height="280" />
|
|
6
6
|
|
|
7
7
|
- Bump version (in e.g. `package.json`)
|
|
8
8
|
- [Git commit, tag, push][1]
|
|
@@ -60,13 +60,14 @@ npx release-it
|
|
|
60
60
|
|
|
61
61
|
You will be prompted to select the new version, and more prompts will follow based on your configuration.
|
|
62
62
|
|
|
63
|
-
## Yarn
|
|
63
|
+
## Yarn & pnpm
|
|
64
64
|
|
|
65
|
-
Using Yarn? Please see the [npm section on Yarn][15].
|
|
65
|
+
- Using Yarn? Please see the [npm section on Yarn][15].
|
|
66
|
+
- Using pnpm? Please see [release-it-pnpm][16].
|
|
66
67
|
|
|
67
68
|
## Monorepos
|
|
68
69
|
|
|
69
|
-
Using a monorepo? Please see this [monorepo recipe][
|
|
70
|
+
Using a monorepo? Please see this [monorepo recipe][17].
|
|
70
71
|
|
|
71
72
|
## Global Installation
|
|
72
73
|
|
|
@@ -77,27 +78,28 @@ Per-project installation as shown above is recommended, but global installs are
|
|
|
77
78
|
|
|
78
79
|
## Containerized
|
|
79
80
|
|
|
80
|
-
Use [Release It! - Containerized][
|
|
81
|
-
Node environment. Thanks [Juan Carlos][
|
|
81
|
+
Use [Release It! - Containerized][18] to run it in any environment as a standardized container without the need for a
|
|
82
|
+
Node environment. Thanks [Juan Carlos][19]!
|
|
82
83
|
|
|
83
84
|
## Videos, articles & examples
|
|
84
85
|
|
|
85
86
|
Here's a list of interesting external resources:
|
|
86
87
|
|
|
87
|
-
- Video: [How to use GitHub Actions & Release-It to Easily Release Your Code][
|
|
88
|
-
- Article: [Monorepo Semantic Releases][
|
|
88
|
+
- Video: [How to use GitHub Actions & Release-It to Easily Release Your Code][20]
|
|
89
|
+
- Article: [Monorepo Semantic Releases][21] ([repo][22])
|
|
89
90
|
|
|
90
91
|
Want to add yours to the list? Just open a pull request!
|
|
91
92
|
|
|
92
93
|
## Configuration
|
|
93
94
|
|
|
94
|
-
Out of the box, release-it has sane defaults, and [plenty of options][
|
|
95
|
+
Out of the box, release-it has sane defaults, and [plenty of options][23] to configure it. Most projects use a
|
|
95
96
|
`.release-it.json` file in the project root, or a `release-it` property in `package.json`.
|
|
96
97
|
|
|
97
98
|
Here's a quick example `.release-it.json`:
|
|
98
99
|
|
|
99
100
|
```json
|
|
100
101
|
{
|
|
102
|
+
"$schema": "https://unpkg.com/release-it@17/schema/release-it.json",
|
|
101
103
|
"git": {
|
|
102
104
|
"commitMessage": "chore: release v${version}"
|
|
103
105
|
},
|
|
@@ -107,13 +109,13 @@ Here's a quick example `.release-it.json`:
|
|
|
107
109
|
}
|
|
108
110
|
```
|
|
109
111
|
|
|
110
|
-
→ See [Configuration][
|
|
112
|
+
→ See [Configuration][24] for more details.
|
|
111
113
|
|
|
112
114
|
## Interactive vs. CI mode
|
|
113
115
|
|
|
114
116
|
By default, release-it is **interactive** and allows you to confirm each task before execution:
|
|
115
117
|
|
|
116
|
-
<img src="./docs/assets/release-it-interactive.gif?raw=true" height="290"
|
|
118
|
+
<img src="./docs/assets/release-it-interactive.gif?raw=true" height="290" />
|
|
117
119
|
|
|
118
120
|
By using the `--ci` option, the process is fully automated without prompts. The configured tasks will be executed as
|
|
119
121
|
demonstrated in the first animation above. In a Continuous Integration (CI) environment, this non-interactive mode is
|
|
@@ -125,15 +127,15 @@ Use `--only-version` to use a prompt only to determine the version, and automate
|
|
|
125
127
|
|
|
126
128
|
How does release-it determine the latest version?
|
|
127
129
|
|
|
128
|
-
1. For projects with a `package.json`, its `version` will be used (see [npm][
|
|
130
|
+
1. For projects with a `package.json`, its `version` will be used (see [npm][25] to skip this).
|
|
129
131
|
2. Otherwise, release-it uses the latest Git tag to determine which version should be released.
|
|
130
132
|
3. As a last resort, `0.0.0` will be used as the latest version.
|
|
131
133
|
|
|
132
134
|
Alternatively, a plugin can be used to override this (e.g. to manage a `VERSION` or `composer.json` file):
|
|
133
135
|
|
|
134
|
-
- [@release-it/bumper][
|
|
135
|
-
- [@release-it/conventional-changelog][
|
|
136
|
-
- [release-it-calver-plugin][
|
|
136
|
+
- [@release-it/bumper][26] to read from or bump the version in any file
|
|
137
|
+
- [@release-it/conventional-changelog][27] to get a recommended bump based on commit messages
|
|
138
|
+
- [release-it-calver-plugin][28] to use CalVer (Calendar Versioning)
|
|
137
139
|
|
|
138
140
|
Add the `--release-version` flag to print the **next** version without releasing anything.
|
|
139
141
|
|
|
@@ -142,35 +144,35 @@ Add the `--release-version` flag to print the **next** version without releasing
|
|
|
142
144
|
Git projects are supported well by release-it, automating the tasks to stage, commit, tag and push releases to any Git
|
|
143
145
|
remote.
|
|
144
146
|
|
|
145
|
-
→ See [Git][
|
|
147
|
+
→ See [Git][29] for more details.
|
|
146
148
|
|
|
147
149
|
## GitHub Releases
|
|
148
150
|
|
|
149
151
|
GitHub projects can have releases attached to Git tags, containing release notes and assets. There are two ways to add
|
|
150
|
-
[GitHub releases][
|
|
152
|
+
[GitHub releases][30] in your release-it flow:
|
|
151
153
|
|
|
152
154
|
1. Automated (requires a `GITHUB_TOKEN`)
|
|
153
155
|
2. Manual (using the GitHub web interface with pre-populated fields)
|
|
154
156
|
|
|
155
|
-
→ See [GitHub Releases][
|
|
157
|
+
→ See [GitHub Releases][31] for more details.
|
|
156
158
|
|
|
157
159
|
## GitLab Releases
|
|
158
160
|
|
|
159
161
|
GitLab projects can have releases attached to Git tags, containing release notes and assets. To automate [GitLab
|
|
160
|
-
releases][
|
|
162
|
+
releases][32]:
|
|
161
163
|
|
|
162
164
|
- Configure `gitlab.release: true`
|
|
163
|
-
- Obtain a [personal access token][
|
|
164
|
-
- Make sure the token is [available as an environment variable][
|
|
165
|
+
- Obtain a [personal access token][33] (release-it only needs the "api" scope).
|
|
166
|
+
- Make sure the token is [available as an environment variable][34].
|
|
165
167
|
|
|
166
|
-
→ See [GitLab Releases][
|
|
168
|
+
→ See [GitLab Releases][35] for more details.
|
|
167
169
|
|
|
168
170
|
## Changelog
|
|
169
171
|
|
|
170
172
|
By default, release-it generates a changelog, to show and help select a version for the new release. Additionally, this
|
|
171
173
|
changelog serves as the release notes for the GitHub or GitLab release.
|
|
172
174
|
|
|
173
|
-
The [default command][
|
|
175
|
+
The [default command][23] is based on `git log ...`. This setting (`git.changelog`) can be overridden. To further
|
|
174
176
|
customize the release notes for the GitHub or GitLab release, there's `github.releaseNotes` or `gitlab.releaseNotes`.
|
|
175
177
|
Make sure any of these commands output the changelog to `stdout`. Note that release-it by default is agnostic to commit
|
|
176
178
|
message conventions. Plugins are available for:
|
|
@@ -182,14 +184,14 @@ message conventions. Plugins are available for:
|
|
|
182
184
|
|
|
183
185
|
To print the changelog without releasing anything, add the `--changelog` flag.
|
|
184
186
|
|
|
185
|
-
→ See [Changelog][
|
|
187
|
+
→ See [Changelog][36] for more details.
|
|
186
188
|
|
|
187
189
|
## Publish to npm
|
|
188
190
|
|
|
189
191
|
With a `package.json` in the current directory, release-it will let `npm` bump the version in `package.json` (and
|
|
190
192
|
`package-lock.json` if present), and publish to the npm registry.
|
|
191
193
|
|
|
192
|
-
→ See [Publish to npm][
|
|
194
|
+
→ See [Publish to npm][25] for more details.
|
|
193
195
|
|
|
194
196
|
## Manage pre-releases
|
|
195
197
|
|
|
@@ -197,7 +199,7 @@ With release-it, it's easy to create pre-releases: a version of your software th
|
|
|
197
199
|
it's not in the stable semver range yet. Often "alpha", "beta", and "rc" (release candidate) are used as identifiers for
|
|
198
200
|
pre-releases. An example pre-release version is `2.0.0-beta.0`.
|
|
199
201
|
|
|
200
|
-
→ See [Manage pre-releases][
|
|
202
|
+
→ See [Manage pre-releases][37] for more details.
|
|
201
203
|
|
|
202
204
|
## Update or re-run existing releases
|
|
203
205
|
|
|
@@ -227,7 +229,7 @@ Use the optional `:plugin` part in the middle to hook into a life cycle method e
|
|
|
227
229
|
The core plugins include `version`, `git`, `npm`, `github`, `gitlab`.
|
|
228
230
|
|
|
229
231
|
Note that hooks like `after:git:release` will not run when either the `git push` failed, or when it is configured not to
|
|
230
|
-
be executed (e.g. `git.push: false`). See [execution order][
|
|
232
|
+
be executed (e.g. `git.push: false`). See [execution order][38] for more details on execution order of plugin lifecycle
|
|
231
233
|
methods.
|
|
232
234
|
|
|
233
235
|
All commands can use configuration variables (like template strings). An array of commands can also be provided, they
|
|
@@ -245,7 +247,7 @@ will run one after another. Some example release-it configuration:
|
|
|
245
247
|
}
|
|
246
248
|
```
|
|
247
249
|
|
|
248
|
-
The variables can be found in the [default configuration][
|
|
250
|
+
The variables can be found in the [default configuration][23]. Additionally, the following variables are exposed:
|
|
249
251
|
|
|
250
252
|
```text
|
|
251
253
|
version
|
|
@@ -277,7 +279,7 @@ Using Inquirer.js inside custom hook scripts might cause issues (since release-i
|
|
|
277
279
|
|
|
278
280
|
Use `--dry-run` to show the interactivity and the commands it _would_ execute.
|
|
279
281
|
|
|
280
|
-
→ See [Dry Runs][
|
|
282
|
+
→ See [Dry Runs][39] for more details.
|
|
281
283
|
|
|
282
284
|
## Troubleshooting & debugging
|
|
283
285
|
|
|
@@ -293,65 +295,67 @@ Since v11, release-it can be extended in many, many ways. Here are some plugins:
|
|
|
293
295
|
|
|
294
296
|
| Plugin | Description |
|
|
295
297
|
| ----------------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
296
|
-
| [@release-it/bumper][
|
|
297
|
-
| [@release-it/conventional-changelog][
|
|
298
|
-
| [@release-it/keep-a-changelog][
|
|
299
|
-
| [@release-it-plugins/lerna-changelog][
|
|
300
|
-
| [@jcamp-code/release-it-changelogen][
|
|
301
|
-
| [@release-it-plugins/workspaces][
|
|
302
|
-
| [release-it-calver-plugin][
|
|
303
|
-
| [@grupoboticario/news-fragments][
|
|
304
|
-
| [@j-ulrich/release-it-regex-bumper][
|
|
305
|
-
| [@jcamp-code/release-it-dotnet][
|
|
306
|
-
| [release-it-pnpm][
|
|
298
|
+
| [@release-it/bumper][26] | Read & write the version from/to any file |
|
|
299
|
+
| [@release-it/conventional-changelog][27] | Provides recommended bump, conventional-changelog, and updates `CHANGELOG.md` |
|
|
300
|
+
| [@release-it/keep-a-changelog][40] | Maintain CHANGELOG.md using the Keep a Changelog standards |
|
|
301
|
+
| [@release-it-plugins/lerna-changelog][41] | Integrates lerna-changelog into the release-it pipeline |
|
|
302
|
+
| [@jcamp-code/release-it-changelogen][42] | Use [@unjs/changelogen][43] for versioning and changelog |
|
|
303
|
+
| [@release-it-plugins/workspaces][44] | Releases each of your projects configured workspaces |
|
|
304
|
+
| [release-it-calver-plugin][28] | Enables Calendar Versioning (calver) with release-it |
|
|
305
|
+
| [@grupoboticario/news-fragments][45] | An easy way to generate your changelog file |
|
|
306
|
+
| [@j-ulrich/release-it-regex-bumper][46] | Regular expression based version read/write plugin for release-it |
|
|
307
|
+
| [@jcamp-code/release-it-dotnet][47] | Use .csproj or .props file for versioning, automate NuGet publishing |
|
|
308
|
+
| [release-it-pnpm][16] | Add basic support for pnpm workspaces, integrates with [bumpp][48] and [changelogithub][49] |
|
|
309
|
+
| [changesets-release-it-plugin][50] | Combine [Changesets][51] changelog management with release-it |
|
|
307
310
|
|
|
308
311
|
Internally, release-it uses its own plugin architecture (for Git, GitHub, GitLab, npm).
|
|
309
312
|
|
|
310
|
-
→ See all [release-it plugins on npm][
|
|
313
|
+
→ See all [release-it plugins on npm][52].
|
|
311
314
|
|
|
312
|
-
→ See [plugins][
|
|
315
|
+
→ See [plugins][53] for documentation to write plugins.
|
|
313
316
|
|
|
314
317
|
## Use release-it programmatically
|
|
315
318
|
|
|
316
319
|
While mostly used as a CLI tool, release-it can be used as a dependency to integrate in your own scripts. See [use
|
|
317
|
-
release-it programmatically][
|
|
318
|
-
|
|
319
|
-
##
|
|
320
|
-
|
|
321
|
-
- [
|
|
322
|
-
- [
|
|
323
|
-
- [
|
|
324
|
-
- [
|
|
325
|
-
- [
|
|
326
|
-
- [
|
|
327
|
-
- [
|
|
328
|
-
- [
|
|
329
|
-
- [
|
|
330
|
-
- [
|
|
331
|
-
- [
|
|
332
|
-
- [
|
|
333
|
-
- [
|
|
334
|
-
- [
|
|
335
|
-
- [
|
|
336
|
-
- [
|
|
337
|
-
- [
|
|
338
|
-
- [
|
|
339
|
-
-
|
|
320
|
+
release-it programmatically][54] for example code.
|
|
321
|
+
|
|
322
|
+
## Projects using release-it
|
|
323
|
+
|
|
324
|
+
- [AdonisJs][55]
|
|
325
|
+
- [Axios][56]
|
|
326
|
+
- [Cal.com][57]
|
|
327
|
+
- [Ember CLI][58]
|
|
328
|
+
- [Halo][59]
|
|
329
|
+
- [hosts][60]
|
|
330
|
+
- [js-cookie][61]
|
|
331
|
+
- [Madge][62]
|
|
332
|
+
- [Metalsmith][63]
|
|
333
|
+
- [Node-Redis][64]
|
|
334
|
+
- [React Native Paper][65]
|
|
335
|
+
- [Readability.js][66]
|
|
336
|
+
- [Redux][67]
|
|
337
|
+
- [Saleor][68]
|
|
338
|
+
- [Semantic UI React][69]
|
|
339
|
+
- [Shepherd][70]
|
|
340
|
+
- [Tabler][71] + [tabler-icons][72]
|
|
341
|
+
- Swagger ([swagger-ui][73] + [swagger-editor][74])
|
|
342
|
+
- [Repositories that depend on release-it][75]
|
|
343
|
+
- GitHub search for [path:\*\*/.release-it.json][76]
|
|
340
344
|
|
|
341
345
|
## Legacy Node.js
|
|
342
346
|
|
|
343
347
|
The latest major version is v17, supporting Node.js 18 and up (as Node.js v16 is EOL). The previous major version was
|
|
344
|
-
v16, supporting Node.js 16. Use release-it v15 for environments running Node.js v14. Also see [CHANGELOG.md][
|
|
348
|
+
v16, supporting Node.js 16. Use release-it v15 for environments running Node.js v14. Also see [CHANGELOG.md][77].
|
|
345
349
|
|
|
346
350
|
## Links
|
|
347
351
|
|
|
348
|
-
- See [CHANGELOG.md][
|
|
349
|
-
- To **contribute**, please read [CONTRIBUTING.md][
|
|
350
|
-
- Please [open an issue][
|
|
352
|
+
- See [CHANGELOG.md][77] for major/breaking updates, and [releases][78] for a detailed version history.
|
|
353
|
+
- To **contribute**, please read [CONTRIBUTING.md][79] first.
|
|
354
|
+
- Please [open an issue][80] if anything is missing or unclear in this documentation.
|
|
351
355
|
|
|
352
356
|
## License
|
|
353
357
|
|
|
354
|
-
[MIT][
|
|
358
|
+
[MIT][81]
|
|
355
359
|
|
|
356
360
|
Are you using release-it at work? Please consider [sponsoring me][14]!
|
|
357
361
|
|
|
@@ -370,66 +374,69 @@ Are you using release-it at work? Please consider [sponsoring me][14]!
|
|
|
370
374
|
[13]: https://badge.fury.io/js/release-it.svg
|
|
371
375
|
[14]: https://github.com/sponsors/webpro
|
|
372
376
|
[15]: ./docs/npm.md#yarn
|
|
373
|
-
[16]:
|
|
374
|
-
[17]:
|
|
375
|
-
[18]: https://github.com/juancarlosjr97
|
|
376
|
-
[19]: https://
|
|
377
|
-
[20]: https://
|
|
378
|
-
[21]: https://
|
|
379
|
-
[22]:
|
|
380
|
-
[23]: ./
|
|
381
|
-
[24]: ./docs/
|
|
382
|
-
[25]:
|
|
383
|
-
[26]: https://github.com/release-it/
|
|
384
|
-
[27]: https://github.com/
|
|
385
|
-
[28]:
|
|
386
|
-
[29]:
|
|
387
|
-
[30]:
|
|
388
|
-
[31]:
|
|
389
|
-
[32]: https://gitlab.com/
|
|
390
|
-
[33]:
|
|
391
|
-
[34]: ./docs/
|
|
392
|
-
[35]: ./docs/
|
|
393
|
-
[36]: ./docs/
|
|
394
|
-
[37]: ./docs/
|
|
395
|
-
[38]: ./docs/
|
|
396
|
-
[39]:
|
|
397
|
-
[40]: https://github.com/release-it
|
|
398
|
-
[41]: https://github.com/
|
|
399
|
-
[42]: https://github.com/
|
|
400
|
-
[43]: https://github.com/
|
|
401
|
-
[44]: https://github.com/
|
|
402
|
-
[45]: https://github.com/
|
|
403
|
-
[46]: https://github.com/
|
|
404
|
-
[47]: https://github.com/
|
|
377
|
+
[16]: https://github.com/hyoban/release-it-pnpm
|
|
378
|
+
[17]: ./docs/recipes/monorepo.md
|
|
379
|
+
[18]: https://github.com/juancarlosjr97/release-it-containerized
|
|
380
|
+
[19]: https://github.com/juancarlosjr97
|
|
381
|
+
[20]: https://www.youtube.com/watch?v=7pBcuT7j_A0
|
|
382
|
+
[21]: https://medium.com/valtech-ch/monorepo-semantic-releases-db114811efa5
|
|
383
|
+
[22]: https://github.com/b12k/monorepo-semantic-releases
|
|
384
|
+
[23]: ./config/release-it.json
|
|
385
|
+
[24]: ./docs/configuration.md
|
|
386
|
+
[25]: ./docs/npm.md
|
|
387
|
+
[26]: https://github.com/release-it/bumper
|
|
388
|
+
[27]: https://github.com/release-it/conventional-changelog
|
|
389
|
+
[28]: https://github.com/casmith/release-it-calver-plugin
|
|
390
|
+
[29]: ./docs/git.md
|
|
391
|
+
[30]: https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases
|
|
392
|
+
[31]: ./docs/github-releases.md
|
|
393
|
+
[32]: https://docs.gitlab.com/ce/user/project/releases/
|
|
394
|
+
[33]: https://gitlab.com/profile/personal_access_tokens
|
|
395
|
+
[34]: ./docs/environment-variables.md
|
|
396
|
+
[35]: ./docs/gitlab-releases.md
|
|
397
|
+
[36]: ./docs/changelog.md
|
|
398
|
+
[37]: ./docs/pre-releases.md
|
|
399
|
+
[38]: ./docs/plugins.md#execution-order
|
|
400
|
+
[39]: ./docs/dry-runs.md
|
|
401
|
+
[40]: https://github.com/release-it/keep-a-changelog
|
|
402
|
+
[41]: https://github.com/release-it-plugins/lerna-changelog
|
|
403
|
+
[42]: https://github.com/jcamp-code/release-it-changelogen
|
|
404
|
+
[43]: https://github.com/unjs/changelogen
|
|
405
|
+
[44]: https://github.com/release-it-plugins/workspaces
|
|
406
|
+
[45]: https://github.com/grupoboticario/news-fragments
|
|
407
|
+
[46]: https://github.com/j-ulrich/release-it-regex-bumper
|
|
408
|
+
[47]: https://github.com/jcamp-code/release-it-dotnet
|
|
405
409
|
[48]: https://github.com/antfu/bumpp
|
|
406
410
|
[49]: https://github.com/antfu/changelogithub
|
|
407
|
-
[50]: https://www.npmjs.com/
|
|
408
|
-
[51]:
|
|
409
|
-
[52]:
|
|
410
|
-
[53]:
|
|
411
|
-
[54]:
|
|
412
|
-
[55]: https://github.com/
|
|
413
|
-
[56]: https://github.com/
|
|
414
|
-
[57]: https://github.com/
|
|
415
|
-
[58]: https://github.com/
|
|
416
|
-
[59]: https://github.com/
|
|
417
|
-
[60]: https://github.com/
|
|
418
|
-
[61]: https://github.com/
|
|
419
|
-
[62]: https://github.com/
|
|
420
|
-
[63]: https://github.com/
|
|
421
|
-
[64]: https://github.com/
|
|
422
|
-
[65]: https://github.com/
|
|
423
|
-
[66]: https://github.com/
|
|
424
|
-
[67]: https://github.com/
|
|
425
|
-
[68]: https://github.com/
|
|
426
|
-
[69]: https://github.com/
|
|
427
|
-
[70]: https://github.com/
|
|
428
|
-
[71]: https://github.com/
|
|
429
|
-
[72]: https://github.com/
|
|
430
|
-
[73]: https://github.com/
|
|
431
|
-
[74]:
|
|
432
|
-
[75]: https://github.com/release-it/release-it/
|
|
433
|
-
[76]:
|
|
434
|
-
[77]:
|
|
435
|
-
[78]:
|
|
411
|
+
[50]: https://www.npmjs.com/package/changesets-release-it-plugin
|
|
412
|
+
[51]: https://github.com/changesets/changesets
|
|
413
|
+
[52]: https://www.npmjs.com/search?q=keywords:release-it-plugin
|
|
414
|
+
[53]: ./docs/plugins.md
|
|
415
|
+
[54]: ./docs/recipes/programmatic.md
|
|
416
|
+
[55]: https://github.com/adonisjs/core
|
|
417
|
+
[56]: https://github.com/axios/axios
|
|
418
|
+
[57]: https://github.com/calcom/cal.com
|
|
419
|
+
[58]: https://github.com/ember-cli/ember-cli
|
|
420
|
+
[59]: https://github.com/halo-dev/halo
|
|
421
|
+
[60]: https://github.com/StevenBlack/hosts
|
|
422
|
+
[61]: https://github.com/js-cookie/js-cookie
|
|
423
|
+
[62]: https://github.com/pahen/madge
|
|
424
|
+
[63]: https://github.com/metalsmith/metalsmith
|
|
425
|
+
[64]: https://github.com/redis/node-redis
|
|
426
|
+
[65]: https://github.com/callstack/react-native-paper
|
|
427
|
+
[66]: https://github.com/mozilla/readability
|
|
428
|
+
[67]: https://github.com/reduxjs/redux
|
|
429
|
+
[68]: https://github.com/saleor/saleor
|
|
430
|
+
[69]: https://github.com/Semantic-Org/Semantic-UI-React
|
|
431
|
+
[70]: https://github.com/shipshapecode/shepherd
|
|
432
|
+
[71]: https://github.com/tabler/tabler
|
|
433
|
+
[72]: https://github.com/tabler/tabler-icons
|
|
434
|
+
[73]: https://github.com/swagger-api/swagger-ui
|
|
435
|
+
[74]: https://github.com/swagger-api/swagger-editor
|
|
436
|
+
[75]: https://github.com/release-it/release-it/network/dependents
|
|
437
|
+
[76]: https://github.com/search?q=path%3A**%2F.release-it.json&type=code
|
|
438
|
+
[77]: ./CHANGELOG.md
|
|
439
|
+
[78]: https://github.com/release-it/release-it/releases
|
|
440
|
+
[79]: ./.github/CONTRIBUTING.md
|
|
441
|
+
[80]: https://github.com/release-it/release-it/issues/new
|
|
442
|
+
[81]: ./LICENSE
|
package/lib/config.js
CHANGED
package/lib/log.js
CHANGED
|
@@ -17,11 +17,11 @@ class Logger {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
log(...args) {
|
|
20
|
-
console.log(...args);
|
|
20
|
+
console.log(...args);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
error(...args) {
|
|
24
|
-
console.error(chalk.red('ERROR'), ...args);
|
|
24
|
+
console.error(chalk.red('ERROR'), ...args);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
info(...args) {
|
|
@@ -3,7 +3,6 @@ import path from 'node:path';
|
|
|
3
3
|
import got from 'got';
|
|
4
4
|
import { globby } from 'globby';
|
|
5
5
|
import { FormData, fileFromSync } from 'node-fetch';
|
|
6
|
-
import allSettled from 'promise.allsettled';
|
|
7
6
|
import _ from 'lodash';
|
|
8
7
|
import Release from '../GitRelease.js';
|
|
9
8
|
import { format, e } from '../../util.js';
|
|
@@ -137,7 +136,7 @@ class GitLab extends Release {
|
|
|
137
136
|
});
|
|
138
137
|
});
|
|
139
138
|
try {
|
|
140
|
-
await allSettled(requests).then(results => {
|
|
139
|
+
await Promise.allSettled(requests).then(results => {
|
|
141
140
|
for (const result of results) {
|
|
142
141
|
if (result.status === 'rejected') {
|
|
143
142
|
throw e('Missing one or more milestones in GitLab. Creating a GitLab release will fail.', docs);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-it",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.4.1",
|
|
4
4
|
"description": "Generic CLI tool to automate versioning and package publishing-related tasks.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"build",
|
|
@@ -47,7 +47,11 @@
|
|
|
47
47
|
},
|
|
48
48
|
"type": "module",
|
|
49
49
|
"exports": {
|
|
50
|
-
".":
|
|
50
|
+
".": {
|
|
51
|
+
"import": "./lib/index.js",
|
|
52
|
+
"require": "./lib/index.js",
|
|
53
|
+
"types": "./types/index.d.ts"
|
|
54
|
+
},
|
|
51
55
|
"./package.json": "./package.json",
|
|
52
56
|
"./test/util/index.js": "./test/util/index.js"
|
|
53
57
|
},
|
|
@@ -55,12 +59,15 @@
|
|
|
55
59
|
"bin",
|
|
56
60
|
"config",
|
|
57
61
|
"lib",
|
|
58
|
-
"test"
|
|
62
|
+
"test",
|
|
63
|
+
"schema",
|
|
64
|
+
"types"
|
|
59
65
|
],
|
|
66
|
+
"types": "./types/index.d.ts",
|
|
60
67
|
"scripts": {
|
|
61
68
|
"knip": "knip",
|
|
62
69
|
"lint": "eslint lib test",
|
|
63
|
-
"format": "prettier --write \"{lib,test}/**/*.js\"",
|
|
70
|
+
"format": "prettier --write eslint.config.mjs \"{lib,test}/**/*.js\"",
|
|
64
71
|
"docs": "remark README.md 'docs/**/*.md' '.github/*.md' -o",
|
|
65
72
|
"test": "ava --no-worker-threads && installed-check",
|
|
66
73
|
"release": "./bin/release-it.js"
|
|
@@ -78,11 +85,11 @@
|
|
|
78
85
|
"cosmiconfig": "9.0.0",
|
|
79
86
|
"execa": "8.0.1",
|
|
80
87
|
"git-url-parse": "14.0.0",
|
|
81
|
-
"globby": "14.0.
|
|
88
|
+
"globby": "14.0.2",
|
|
82
89
|
"got": "13.0.0",
|
|
83
|
-
"inquirer": "9.2
|
|
90
|
+
"inquirer": "9.3.2",
|
|
84
91
|
"is-ci": "3.0.1",
|
|
85
|
-
"issue-parser": "7.0.
|
|
92
|
+
"issue-parser": "7.0.1",
|
|
86
93
|
"lodash": "4.17.21",
|
|
87
94
|
"mime-types": "2.1.35",
|
|
88
95
|
"new-github-release-url": "2.0.0",
|
|
@@ -90,7 +97,6 @@
|
|
|
90
97
|
"open": "10.1.0",
|
|
91
98
|
"ora": "8.0.1",
|
|
92
99
|
"os-name": "5.1.0",
|
|
93
|
-
"promise.allsettled": "1.0.7",
|
|
94
100
|
"proxy-agent": "6.4.0",
|
|
95
101
|
"semver": "7.6.2",
|
|
96
102
|
"shelljs": "0.8.5",
|
|
@@ -100,27 +106,33 @@
|
|
|
100
106
|
"yargs-parser": "21.1.1"
|
|
101
107
|
},
|
|
102
108
|
"devDependencies": {
|
|
109
|
+
"@eslint/compat": "1.1.0",
|
|
110
|
+
"@eslint/eslintrc": "3.1.0",
|
|
111
|
+
"@eslint/js": "9.6.0",
|
|
103
112
|
"@octokit/request-error": "5.1.0",
|
|
113
|
+
"@types/node": "20.14.9",
|
|
104
114
|
"ava": "6.1.3",
|
|
105
|
-
"eslint": "
|
|
115
|
+
"eslint": "9.6.0",
|
|
106
116
|
"eslint-config-prettier": "9.1.0",
|
|
107
|
-
"eslint-plugin-ava": "
|
|
117
|
+
"eslint-plugin-ava": "15.0.1",
|
|
108
118
|
"eslint-plugin-import": "2.29.1",
|
|
109
119
|
"eslint-plugin-prettier": "5.1.3",
|
|
110
120
|
"fs-monkey": "1.0.6",
|
|
121
|
+
"globals": "15.7.0",
|
|
111
122
|
"installed-check": "9.3.0",
|
|
112
|
-
"knip": "5.
|
|
113
|
-
"memfs": "4.9.
|
|
123
|
+
"knip": "5.23.2",
|
|
124
|
+
"memfs": "4.9.3",
|
|
114
125
|
"mock-stdio": "1.0.3",
|
|
115
126
|
"nock": "13.5.4",
|
|
116
|
-
"prettier": "3.2
|
|
127
|
+
"prettier": "3.3.2",
|
|
117
128
|
"remark-cli": "12.0.1",
|
|
118
129
|
"remark-preset-webpro": "1.1.0",
|
|
119
130
|
"sinon": "18.0.0",
|
|
120
|
-
"strip-ansi": "7.1.0"
|
|
131
|
+
"strip-ansi": "7.1.0",
|
|
132
|
+
"typescript": "5.5.2"
|
|
121
133
|
},
|
|
122
134
|
"engines": {
|
|
123
|
-
"node": "^18.18.0 || ^20.
|
|
135
|
+
"node": "^18.18.0 || ^20.9.0 || ^22.0.0"
|
|
124
136
|
},
|
|
125
137
|
"remarkConfig": {
|
|
126
138
|
"plugins": [
|
package/schema/git.json
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "release-it#git",
|
|
4
|
+
"title": "JSON schema for release-it Git configuration",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalItems": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"changelog": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"default": "git log --pretty=format:\"* %s (%h)\" ${from}...${to}"
|
|
11
|
+
},
|
|
12
|
+
"requireCleanWorkingDir": {
|
|
13
|
+
"type": "boolean",
|
|
14
|
+
"default": true
|
|
15
|
+
},
|
|
16
|
+
"requireBranch": {
|
|
17
|
+
"type": "boolean",
|
|
18
|
+
"default": false
|
|
19
|
+
},
|
|
20
|
+
"requireUpstream": {
|
|
21
|
+
"type": "boolean",
|
|
22
|
+
"default": true
|
|
23
|
+
},
|
|
24
|
+
"requireCommits": {
|
|
25
|
+
"type": "boolean",
|
|
26
|
+
"default": false
|
|
27
|
+
},
|
|
28
|
+
"requireCommitsFail": {
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"default": true
|
|
31
|
+
},
|
|
32
|
+
"commitsPath": {
|
|
33
|
+
"type": "string",
|
|
34
|
+
"default": ""
|
|
35
|
+
},
|
|
36
|
+
"addUntrackedFiles": {
|
|
37
|
+
"type": "string",
|
|
38
|
+
"default": ""
|
|
39
|
+
},
|
|
40
|
+
"commit": {
|
|
41
|
+
"type": "boolean",
|
|
42
|
+
"default": true
|
|
43
|
+
},
|
|
44
|
+
"commitArgs": {
|
|
45
|
+
"type": "array",
|
|
46
|
+
"uniqueItems": true,
|
|
47
|
+
"items": {
|
|
48
|
+
"type": "string"
|
|
49
|
+
},
|
|
50
|
+
"default": []
|
|
51
|
+
},
|
|
52
|
+
"tag": {
|
|
53
|
+
"type": "boolean",
|
|
54
|
+
"default": true
|
|
55
|
+
},
|
|
56
|
+
"tagExclude": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"default": null
|
|
59
|
+
},
|
|
60
|
+
"tagMatch": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"default": null
|
|
63
|
+
},
|
|
64
|
+
"getLatestTagFromAllRefs": {
|
|
65
|
+
"type": "boolean",
|
|
66
|
+
"default": false
|
|
67
|
+
},
|
|
68
|
+
"tagAnnotation": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"default": "Release ${version}"
|
|
71
|
+
},
|
|
72
|
+
"tagArgs": {
|
|
73
|
+
"type": "array",
|
|
74
|
+
"uniqueItems": true,
|
|
75
|
+
"items": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
"default": []
|
|
79
|
+
},
|
|
80
|
+
"push": {
|
|
81
|
+
"type": "boolean",
|
|
82
|
+
"default": true
|
|
83
|
+
},
|
|
84
|
+
"pushArgs": {
|
|
85
|
+
"type": "array",
|
|
86
|
+
"uniqueItems": true,
|
|
87
|
+
"items": {
|
|
88
|
+
"type": "string"
|
|
89
|
+
},
|
|
90
|
+
"default": ["--follow-tags"]
|
|
91
|
+
},
|
|
92
|
+
"pushRepo": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"default": ""
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "release-it#github",
|
|
4
|
+
"title": "JSON schema for release-it github configuration",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalItems": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"release": {
|
|
9
|
+
"type": "boolean",
|
|
10
|
+
"default": false
|
|
11
|
+
},
|
|
12
|
+
"releaseName": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"default": "Release ${version}"
|
|
15
|
+
},
|
|
16
|
+
"releaseNotes": {
|
|
17
|
+
"default": null
|
|
18
|
+
},
|
|
19
|
+
"autoGenerate": {
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"default": false
|
|
22
|
+
},
|
|
23
|
+
"preRelease": {
|
|
24
|
+
"type": "boolean",
|
|
25
|
+
"default": false
|
|
26
|
+
},
|
|
27
|
+
"draft": {
|
|
28
|
+
"type": "boolean",
|
|
29
|
+
"default": false
|
|
30
|
+
},
|
|
31
|
+
"tokenRef": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"default": "GITHUB_TOKEN"
|
|
34
|
+
},
|
|
35
|
+
"assets": {
|
|
36
|
+
"default": null
|
|
37
|
+
},
|
|
38
|
+
"host": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"default": null
|
|
41
|
+
},
|
|
42
|
+
"timeout": {
|
|
43
|
+
"type": "integer",
|
|
44
|
+
"default": 0
|
|
45
|
+
},
|
|
46
|
+
"proxy": {
|
|
47
|
+
"type": "string",
|
|
48
|
+
"default": null
|
|
49
|
+
},
|
|
50
|
+
"skipChecks": {
|
|
51
|
+
"type": "boolean",
|
|
52
|
+
"default": false
|
|
53
|
+
},
|
|
54
|
+
"web": {
|
|
55
|
+
"type": "boolean",
|
|
56
|
+
"default": false
|
|
57
|
+
},
|
|
58
|
+
"comments": {
|
|
59
|
+
"type": "object",
|
|
60
|
+
"additionalProperties": false,
|
|
61
|
+
"properties": {
|
|
62
|
+
"submit": {
|
|
63
|
+
"type": "boolean",
|
|
64
|
+
"default": false
|
|
65
|
+
},
|
|
66
|
+
"issue": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"default": ":rocket: _This issue has been resolved in v${version}. See [${releaseName}](${releaseUrl}) for release notes._"
|
|
69
|
+
},
|
|
70
|
+
"pr": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"default": ":rocket: _This pull request is included in v${version}. See [${releaseName}](${releaseUrl}) for release notes._"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "release-it#gitlab",
|
|
4
|
+
"title": "JSON schema for release-it gitlab configuration",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalItems": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"release": {
|
|
9
|
+
"type": "boolean",
|
|
10
|
+
"default": false
|
|
11
|
+
},
|
|
12
|
+
"releaseName": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"default": "Release ${version}"
|
|
15
|
+
},
|
|
16
|
+
"releaseNotes": {
|
|
17
|
+
"default": null
|
|
18
|
+
},
|
|
19
|
+
"autoGenerate": {
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"default": false
|
|
22
|
+
},
|
|
23
|
+
"preRelease": {
|
|
24
|
+
"type": "boolean",
|
|
25
|
+
"default": false
|
|
26
|
+
},
|
|
27
|
+
"draft": {
|
|
28
|
+
"type": "boolean",
|
|
29
|
+
"default": false
|
|
30
|
+
},
|
|
31
|
+
"milesstones": {
|
|
32
|
+
"type": "array",
|
|
33
|
+
"items": {
|
|
34
|
+
"type": "string"
|
|
35
|
+
},
|
|
36
|
+
"default": []
|
|
37
|
+
},
|
|
38
|
+
"tokenRef": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"default": "GITLAB_TOKEN"
|
|
41
|
+
},
|
|
42
|
+
"tokenHeader": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"default": "Private-Token"
|
|
45
|
+
},
|
|
46
|
+
"certificateAuthorityFile": {
|
|
47
|
+
"default": null
|
|
48
|
+
},
|
|
49
|
+
"assets": {
|
|
50
|
+
"default": null
|
|
51
|
+
},
|
|
52
|
+
"origin": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"default": null
|
|
55
|
+
},
|
|
56
|
+
"skipChecks": {
|
|
57
|
+
"type": "boolean",
|
|
58
|
+
"default": false
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
package/schema/npm.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "release-it#npm",
|
|
4
|
+
"title": "JSON schema for release-it npm configuration",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalItems": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"publish": {
|
|
9
|
+
"type": "boolean",
|
|
10
|
+
"default": true
|
|
11
|
+
},
|
|
12
|
+
"publishPath": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"default": "."
|
|
15
|
+
},
|
|
16
|
+
"publishArgs": {
|
|
17
|
+
"type": "array",
|
|
18
|
+
"uniqueItems": true,
|
|
19
|
+
"items": {
|
|
20
|
+
"type": "string"
|
|
21
|
+
},
|
|
22
|
+
"default": []
|
|
23
|
+
},
|
|
24
|
+
"tag": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"default": null
|
|
27
|
+
},
|
|
28
|
+
"otp": {
|
|
29
|
+
"type": "string",
|
|
30
|
+
"default": null
|
|
31
|
+
},
|
|
32
|
+
"ignoreVersion": {
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"default": false
|
|
35
|
+
},
|
|
36
|
+
"allowSameVersion": {
|
|
37
|
+
"type": "boolean",
|
|
38
|
+
"default": false
|
|
39
|
+
},
|
|
40
|
+
"versionArgs": {
|
|
41
|
+
"type": "array",
|
|
42
|
+
"uniqueItems": true,
|
|
43
|
+
"items": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
},
|
|
46
|
+
"default": []
|
|
47
|
+
},
|
|
48
|
+
"skipChecks": {
|
|
49
|
+
"type": "boolean",
|
|
50
|
+
"default": false
|
|
51
|
+
},
|
|
52
|
+
"timeout": {
|
|
53
|
+
"type": "integer",
|
|
54
|
+
"default": 10
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"$id": "release-it#release-it",
|
|
4
|
+
"title": "JSON schema for release-it configuration",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"$schema": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The JSON schema version used to validate this configuration file"
|
|
11
|
+
},
|
|
12
|
+
"hooks": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"additionalProperties": true,
|
|
15
|
+
"patternProperties": {
|
|
16
|
+
"^(before|after):((version|git|npm|github|gitlab):)?(init|bump|release)$": {
|
|
17
|
+
"if": {
|
|
18
|
+
"type": "array"
|
|
19
|
+
},
|
|
20
|
+
"then": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"items": {
|
|
23
|
+
"type": "string"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"else": {
|
|
27
|
+
"type": "string"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"plugins": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"additionalProperties": true
|
|
35
|
+
},
|
|
36
|
+
"git": {
|
|
37
|
+
"$comment": "Boolean or git config object",
|
|
38
|
+
"if": {
|
|
39
|
+
"type": "object"
|
|
40
|
+
},
|
|
41
|
+
"then": {
|
|
42
|
+
"$ref": "./git.json"
|
|
43
|
+
},
|
|
44
|
+
"else": {
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"default": false
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"npm": {
|
|
50
|
+
"$comment": "Boolean or npm config object",
|
|
51
|
+
"if": {
|
|
52
|
+
"type": "object"
|
|
53
|
+
},
|
|
54
|
+
"then": {
|
|
55
|
+
"$ref": "./npm.json"
|
|
56
|
+
},
|
|
57
|
+
"else": {
|
|
58
|
+
"type": "boolean",
|
|
59
|
+
"default": false
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"github": {
|
|
63
|
+
"$comment": "Boolean or github config object",
|
|
64
|
+
"if": {
|
|
65
|
+
"type": "object"
|
|
66
|
+
},
|
|
67
|
+
"then": {
|
|
68
|
+
"$ref": "./github.json"
|
|
69
|
+
},
|
|
70
|
+
"else": {
|
|
71
|
+
"type": "boolean",
|
|
72
|
+
"default": false
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
"gitlab": {
|
|
76
|
+
"$comment": "Boolean or gitlab config object",
|
|
77
|
+
"if": {
|
|
78
|
+
"type": "object"
|
|
79
|
+
},
|
|
80
|
+
"then": {
|
|
81
|
+
"$ref": "./gitlab.json"
|
|
82
|
+
},
|
|
83
|
+
"else": {
|
|
84
|
+
"type": "boolean",
|
|
85
|
+
"default": false
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
package/test/github.js
CHANGED
|
@@ -23,7 +23,7 @@ test.serial('should check token and perform checks', async t => {
|
|
|
23
23
|
const options = { github: { release: true, tokenRef, pushRepo } };
|
|
24
24
|
const github = factory(GitHub, { options });
|
|
25
25
|
|
|
26
|
-
process.env[tokenRef] = '123';
|
|
26
|
+
process.env[tokenRef] = '123';
|
|
27
27
|
|
|
28
28
|
interceptAuthentication();
|
|
29
29
|
interceptCollaborator();
|
package/test/gitlab.js
CHANGED
|
@@ -24,7 +24,7 @@ test.serial('should validate token', async t => {
|
|
|
24
24
|
await t.throwsAsync(gitlab.init(), {
|
|
25
25
|
message: /^Environment variable "MY_GITLAB_TOKEN" is required for GitLab releases/
|
|
26
26
|
});
|
|
27
|
-
process.env[tokenRef] = '123';
|
|
27
|
+
process.env[tokenRef] = '123';
|
|
28
28
|
|
|
29
29
|
interceptUser(undefined, { reqheaders: { 'private-token': '123' } });
|
|
30
30
|
interceptCollaborator(undefined, { reqheaders: { 'private-token': '123' } });
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { Hooks } from './hooks';
|
|
2
|
+
|
|
3
|
+
export interface Config {
|
|
4
|
+
hooks?: Hooks;
|
|
5
|
+
|
|
6
|
+
plugins?: Record<string, Record<string, any>>;
|
|
7
|
+
|
|
8
|
+
git?: {
|
|
9
|
+
/** @default "git log --pretty=format:\"* %s (%h)\" ${from}...${to}" */
|
|
10
|
+
changelog?: string;
|
|
11
|
+
|
|
12
|
+
/** @default true */
|
|
13
|
+
requireCleanWorkingDir?: boolean;
|
|
14
|
+
|
|
15
|
+
/** @default false */
|
|
16
|
+
requireBranch?: boolean;
|
|
17
|
+
|
|
18
|
+
/** @default true */
|
|
19
|
+
requireUpstream?: boolean;
|
|
20
|
+
|
|
21
|
+
/** @default false */
|
|
22
|
+
requireCommits?: boolean;
|
|
23
|
+
|
|
24
|
+
/** @default true */
|
|
25
|
+
requireCommitsFail?: boolean;
|
|
26
|
+
|
|
27
|
+
/** @default "" */
|
|
28
|
+
commitsPath?: string;
|
|
29
|
+
|
|
30
|
+
/** @default false */
|
|
31
|
+
addUntrackedFiles?: boolean;
|
|
32
|
+
|
|
33
|
+
/** @default true */
|
|
34
|
+
commit?: boolean;
|
|
35
|
+
|
|
36
|
+
/** @default "Release ${version}" */
|
|
37
|
+
commitMessage?: string;
|
|
38
|
+
|
|
39
|
+
commitArgs?: Array<any>;
|
|
40
|
+
|
|
41
|
+
/** @default true */
|
|
42
|
+
tag?: boolean;
|
|
43
|
+
|
|
44
|
+
/** @default null */
|
|
45
|
+
tagExclude?: any;
|
|
46
|
+
|
|
47
|
+
/** @default null */
|
|
48
|
+
tagName?: any;
|
|
49
|
+
|
|
50
|
+
/** @default null */
|
|
51
|
+
tagMatch?: any;
|
|
52
|
+
|
|
53
|
+
/** @default false */
|
|
54
|
+
getLatestTagFromAllRefs?: boolean;
|
|
55
|
+
|
|
56
|
+
/** @default "Release ${version}" */
|
|
57
|
+
tagAnnotation?: string;
|
|
58
|
+
|
|
59
|
+
tagArgs?: Array<any>;
|
|
60
|
+
|
|
61
|
+
/** @default true */
|
|
62
|
+
push?: boolean;
|
|
63
|
+
|
|
64
|
+
/** @default ["--follow-tags"] */
|
|
65
|
+
pushArgs?: Array<string>;
|
|
66
|
+
|
|
67
|
+
/** @default "" */
|
|
68
|
+
pushRepo?: string;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
npm?: {
|
|
72
|
+
/** @default true */
|
|
73
|
+
publish?: boolean;
|
|
74
|
+
|
|
75
|
+
/** @default "." */
|
|
76
|
+
publishPath?: string;
|
|
77
|
+
|
|
78
|
+
publishArgs?: Array<any>;
|
|
79
|
+
|
|
80
|
+
/** @default null */
|
|
81
|
+
tag?: any;
|
|
82
|
+
|
|
83
|
+
/** @default null */
|
|
84
|
+
otp?: any;
|
|
85
|
+
|
|
86
|
+
/** @default false */
|
|
87
|
+
ignoreVersion?: boolean;
|
|
88
|
+
|
|
89
|
+
/** @default false */
|
|
90
|
+
allowSameVersion?: boolean;
|
|
91
|
+
|
|
92
|
+
versionArgs?: Array<any>;
|
|
93
|
+
|
|
94
|
+
/** @default false */
|
|
95
|
+
skipChecks?: boolean;
|
|
96
|
+
|
|
97
|
+
/** @default 10 */
|
|
98
|
+
timeout?: number;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
github?: {
|
|
102
|
+
/** @default false */
|
|
103
|
+
release?: boolean;
|
|
104
|
+
|
|
105
|
+
/** @default "Release ${version}" */
|
|
106
|
+
releaseName?: string;
|
|
107
|
+
|
|
108
|
+
/** @default null */
|
|
109
|
+
releaseNotes?: any;
|
|
110
|
+
|
|
111
|
+
/** @default false */
|
|
112
|
+
autoGenerate?: boolean;
|
|
113
|
+
|
|
114
|
+
/** @default false */
|
|
115
|
+
preRelease?: boolean;
|
|
116
|
+
|
|
117
|
+
/** @default false */
|
|
118
|
+
draft?: boolean;
|
|
119
|
+
|
|
120
|
+
/** @default "GITHUB_TOKEN" */
|
|
121
|
+
tokenRef?: string;
|
|
122
|
+
|
|
123
|
+
/** @default null */
|
|
124
|
+
assets?: any;
|
|
125
|
+
|
|
126
|
+
/** @default null */
|
|
127
|
+
host?: any;
|
|
128
|
+
|
|
129
|
+
/** @default 0 */
|
|
130
|
+
timeout?: number;
|
|
131
|
+
|
|
132
|
+
/** @default null */
|
|
133
|
+
proxy?: any;
|
|
134
|
+
|
|
135
|
+
/** @default false */
|
|
136
|
+
skipChecks?: boolean;
|
|
137
|
+
|
|
138
|
+
/** @default false */
|
|
139
|
+
web?: boolean;
|
|
140
|
+
|
|
141
|
+
comments?: {
|
|
142
|
+
/** @default false */
|
|
143
|
+
submit?: boolean;
|
|
144
|
+
|
|
145
|
+
/** @default ":rocket?: _This issue has been resolved in v${version}. See [${releaseName}](${releaseUrl}) for release notes._" */
|
|
146
|
+
issue?: string;
|
|
147
|
+
|
|
148
|
+
/** @default ":rocket?: _This pull request is included in v${version}. See [${releaseName}](${releaseUrl}) for release notes._" */
|
|
149
|
+
pr?: string;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
gitlab?: {
|
|
154
|
+
/** @default false */
|
|
155
|
+
release?: boolean;
|
|
156
|
+
|
|
157
|
+
/** @default "Release ${version}" */
|
|
158
|
+
releaseName?: string;
|
|
159
|
+
|
|
160
|
+
/** @default null */
|
|
161
|
+
releaseNotes?: any;
|
|
162
|
+
|
|
163
|
+
milestones?: Array<any>;
|
|
164
|
+
|
|
165
|
+
/** @default "GITLAB_TOKEN" */
|
|
166
|
+
tokenRef?: string;
|
|
167
|
+
|
|
168
|
+
/** @default "Private-Token" */
|
|
169
|
+
tokenHeader?: string;
|
|
170
|
+
|
|
171
|
+
/** @default null */
|
|
172
|
+
certificateAuthorityFile?: any;
|
|
173
|
+
|
|
174
|
+
/** @default null */
|
|
175
|
+
assets?: any;
|
|
176
|
+
|
|
177
|
+
/** @default null */
|
|
178
|
+
origin?: any;
|
|
179
|
+
|
|
180
|
+
/** @default false */
|
|
181
|
+
skipChecks?: boolean;
|
|
182
|
+
};
|
|
183
|
+
}
|
package/types/hooks.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export type HookPrefix = 'before' | 'after';
|
|
2
|
+
export type InternalPlugin = 'version' | 'git' | 'npm' | 'github' | 'gitlab';
|
|
3
|
+
export type HookName = 'init' | 'bump' | 'release';
|
|
4
|
+
|
|
5
|
+
export type Hooks = {
|
|
6
|
+
['before:init']?: string | string[];
|
|
7
|
+
['before:bump']?: string | string[];
|
|
8
|
+
['before:release']?: string | string[];
|
|
9
|
+
['after:init']?: string | string[];
|
|
10
|
+
['after:bump']?: string | string[];
|
|
11
|
+
['after:release']?: string | string[];
|
|
12
|
+
|
|
13
|
+
['before:version:init']?: string | string[];
|
|
14
|
+
['before:version:bump']?: string | string[];
|
|
15
|
+
['before:version:release']?: string | string[];
|
|
16
|
+
['after:version:init']?: string | string[];
|
|
17
|
+
['after:version:bump']?: string | string[];
|
|
18
|
+
['after:version:release']?: string | string[];
|
|
19
|
+
|
|
20
|
+
['before:git:init']?: string | string[];
|
|
21
|
+
['before:git:bump']?: string | string[];
|
|
22
|
+
['before:git:release']?: string | string[];
|
|
23
|
+
['after:git:init']?: string | string[];
|
|
24
|
+
['after:git:bump']?: string | string[];
|
|
25
|
+
['after:git:release']?: string | string[];
|
|
26
|
+
|
|
27
|
+
['before:npm:init']?: string | string[];
|
|
28
|
+
['before:npm:bump']?: string | string[];
|
|
29
|
+
['before:npm:release']?: string | string[];
|
|
30
|
+
['after:npm:init']?: string | string[];
|
|
31
|
+
['after:npm:bump']?: string | string[];
|
|
32
|
+
['after:npm:release']?: string | string[];
|
|
33
|
+
|
|
34
|
+
['before:github:init']?: string | string[];
|
|
35
|
+
['before:github:bump']?: string | string[];
|
|
36
|
+
['before:github:release']?: string | string[];
|
|
37
|
+
['after:github:init']?: string | string[];
|
|
38
|
+
['after:github:bump']?: string | string[];
|
|
39
|
+
['after:github:release']?: string | string[];
|
|
40
|
+
|
|
41
|
+
['before:gitlab:init']?: string | string[];
|
|
42
|
+
['before:gitlab:bump']?: string | string[];
|
|
43
|
+
['before:gitlab:release']?: string | string[];
|
|
44
|
+
['after:gitlab:init']?: string | string[];
|
|
45
|
+
['after:gitlab:bump']?: string | string[];
|
|
46
|
+
['after:gitlab:release']?: string | string[];
|
|
47
|
+
};
|
package/types/index.d.ts
ADDED