release-it 17.4.0 → 17.4.2

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
@@ -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][16].
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][17] to run it in any environment as a standardized container without the need for a
81
- Node environment. Thanks [Juan Carlos][18]!
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][19]
88
- - Article: [Monorepo Semantic Releases][20] ([repo][21])
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][22] to configure it. Most projects use a
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,7 +109,7 @@ Here's a quick example `.release-it.json`:
107
109
  }
108
110
  ```
109
111
 
110
- → See [Configuration][23] for more details.
112
+ → See [Configuration][24] for more details.
111
113
 
112
114
  ## Interactive vs. CI mode
113
115
 
@@ -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][24] to skip this).
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][25] to read from or bump the version in any file
135
- - [@release-it/conventional-changelog][26] to get a recommended bump based on commit messages
136
- - [release-it-calver-plugin][27] to use CalVer (Calendar Versioning)
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][28] for more details.
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][29] in your release-it flow:
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][30] for more details.
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][31]:
162
+ releases][32]:
161
163
 
162
164
  - Configure `gitlab.release: true`
163
- - Obtain a [personal access token][32] (release-it only needs the "api" scope).
164
- - Make sure the token is [available as an environment variable][33].
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][34] for more details.
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][22] is based on `git log ...`. This setting (`git.changelog`) can be overridden. To further
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][35] for more details.
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][24] for more details.
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][36] for more details.
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][37] for more details on execution order of plugin lifecycle
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][22]. Additionally, the following variables are exposed:
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][38] for more details.
282
+ → See [Dry Runs][39] for more details.
281
283
 
282
284
  ## Troubleshooting & debugging
283
285
 
@@ -293,66 +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][25] | Read & write the version from/to any file |
297
- | [@release-it/conventional-changelog][26] | Provides recommended bump, conventional-changelog, and updates `CHANGELOG.md` |
298
- | [@release-it/keep-a-changelog][39] | Maintain CHANGELOG.md using the Keep a Changelog standards |
299
- | [@release-it-plugins/lerna-changelog][40] | Integrates lerna-changelog into the release-it pipeline |
300
- | [@jcamp-code/release-it-changelogen][41] | Use [@unjs/changelogen][42] for versioning and changelog |
301
- | [@release-it-plugins/workspaces][43] | Releases each of your projects configured workspaces |
302
- | [release-it-calver-plugin][27] | Enables Calendar Versioning (calver) with release-it |
303
- | [@grupoboticario/news-fragments][44] | An easy way to generate your changelog file |
304
- | [@j-ulrich/release-it-regex-bumper][45] | Regular expression based version read/write plugin for release-it |
305
- | [@jcamp-code/release-it-dotnet][46] | Use .csproj or .props file for versioning, automate NuGet publishing |
306
- | [release-it-pnpm][47] | Add basic support for pnpm workspaces, integrates with [bumpp][48] and [changelogithub][49] |
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][50].
313
+ → See all [release-it plugins on npm][52].
311
314
 
312
- → See [plugins][51] for documentation to write 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][52] for example code.
320
+ release-it programmatically][54] for example code.
318
321
 
319
322
  ## Projects using release-it
320
323
 
321
- - [AdonisJs][53]
322
- - [Axios][54]
323
- - [Cal.com][55]
324
- - [Ember CLI][56]
325
- - [Halo][57]
326
- - [hosts][58]
327
- - [js-cookie][59]
328
- - [Madge][60]
329
- - [Metalsmith][61]
330
- - [Node-Redis][62]
331
- - [React Native Paper][63]
332
- - [Readability.js][64]
333
- - [Redux][65]
334
- - [Saleor][66]
335
- - [Semantic UI React][67]
336
- - [Shepherd][68]
337
- - [Tabler][69] + [tabler-icons][70]
338
- - Swagger ([swagger-ui][71] + [swagger-editor][72])
339
- - [Repositories that depend on release-it][73]
340
- - GitHub search for [path:\*\*/.release-it.json][74]
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]
341
344
 
342
345
  ## Legacy Node.js
343
346
 
344
347
  The latest major version is v17, supporting Node.js 18 and up (as Node.js v16 is EOL). The previous major version was
345
- v16, supporting Node.js 16. Use release-it v15 for environments running Node.js v14. Also see [CHANGELOG.md][75].
348
+ v16, supporting Node.js 16. Use release-it v15 for environments running Node.js v14. Also see [CHANGELOG.md][77].
346
349
 
347
350
  ## Links
348
351
 
349
- - See [CHANGELOG.md][75] for major/breaking updates, and [releases][76] for a detailed version history.
350
- - To **contribute**, please read [CONTRIBUTING.md][77] first.
351
- - Please [open an issue][78] if anything is missing or unclear in this documentation.
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.
352
355
 
353
356
  ## License
354
357
 
355
- [MIT][79]
358
+ [MIT][81]
356
359
 
357
360
  Are you using release-it at work? Please consider [sponsoring me][14]!
358
361
 
@@ -371,67 +374,69 @@ Are you using release-it at work? Please consider [sponsoring me][14]!
371
374
  [13]: https://badge.fury.io/js/release-it.svg
372
375
  [14]: https://github.com/sponsors/webpro
373
376
  [15]: ./docs/npm.md#yarn
374
- [16]: ./docs/recipes/monorepo.md
375
- [17]: https://github.com/juancarlosjr97/release-it-containerized
376
- [18]: https://github.com/juancarlosjr97
377
- [19]: https://www.youtube.com/watch?v=7pBcuT7j_A0
378
- [20]: https://medium.com/valtech-ch/monorepo-semantic-releases-db114811efa5
379
- [21]: https://github.com/b12k/monorepo-semantic-releases
380
- [22]: ./config/release-it.json
381
- [23]: ./docs/configuration.md
382
- [24]: ./docs/npm.md
383
- [25]: https://github.com/release-it/bumper
384
- [26]: https://github.com/release-it/conventional-changelog
385
- [27]: https://github.com/casmith/release-it-calver-plugin
386
- [28]: ./docs/git.md
387
- [29]: https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases
388
- [30]: ./docs/github-releases.md
389
- [31]: https://docs.gitlab.com/ce/user/project/releases/
390
- [32]: https://gitlab.com/profile/personal_access_tokens
391
- [33]: ./docs/environment-variables.md
392
- [34]: ./docs/gitlab-releases.md
393
- [35]: ./docs/changelog.md
394
- [36]: ./docs/pre-releases.md
395
- [37]: ./docs/plugins.md#execution-order
396
- [38]: ./docs/dry-runs.md
397
- [39]: https://github.com/release-it/keep-a-changelog
398
- [40]: https://github.com/release-it-plugins/lerna-changelog
399
- [41]: https://github.com/jcamp-code/release-it-changelogen
400
- [42]: https://github.com/unjs/changelogen
401
- [43]: https://github.com/release-it-plugins/workspaces
402
- [44]: https://github.com/grupoboticario/news-fragments
403
- [45]: https://github.com/j-ulrich/release-it-regex-bumper
404
- [46]: https://github.com/jcamp-code/release-it-dotnet
405
- [47]: https://github.com/hyoban/release-it-pnpm
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
406
409
  [48]: https://github.com/antfu/bumpp
407
410
  [49]: https://github.com/antfu/changelogithub
408
- [50]: https://www.npmjs.com/search?q=keywords:release-it-plugin
409
- [51]: ./docs/plugins.md
410
- [52]: ./docs/recipes/programmatic.md
411
- [53]: https://github.com/adonisjs/core
412
- [54]: https://github.com/axios/axios
413
- [55]: https://github.com/calcom/cal.com
414
- [56]: https://github.com/ember-cli/ember-cli
415
- [57]: https://github.com/halo-dev/halo
416
- [58]: https://github.com/StevenBlack/hosts
417
- [59]: https://github.com/js-cookie/js-cookie
418
- [60]: https://github.com/pahen/madge
419
- [61]: https://github.com/metalsmith/metalsmith
420
- [62]: https://github.com/redis/node-redis
421
- [63]: https://github.com/callstack/react-native-paper
422
- [64]: https://github.com/mozilla/readability
423
- [65]: https://github.com/reduxjs/redux
424
- [66]: https://github.com/saleor/saleor
425
- [67]: https://github.com/Semantic-Org/Semantic-UI-React
426
- [68]: https://github.com/shipshapecode/shepherd
427
- [69]: https://github.com/tabler/tabler
428
- [70]: https://github.com/tabler/tabler-icons
429
- [71]: https://github.com/swagger-api/swagger-ui
430
- [72]: https://github.com/swagger-api/swagger-editor
431
- [73]: https://github.com/release-it/release-it/network/dependents
432
- [74]: https://github.com/search?q=path%3A**%2F.release-it.json&type=code
433
- [75]: ./CHANGELOG.md
434
- [76]: https://github.com/release-it/release-it/releases
435
- [77]: ./.github/CONTRIBUTING.md
436
- [78]: https://github.com/release-it/release-it/issues/new
437
- [79]: ./LICENSE
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
@@ -27,10 +27,12 @@ const load = async pluginName => {
27
27
  const module = await import(pluginName);
28
28
  plugin = module.default;
29
29
  } catch (err) {
30
+ debug(err);
30
31
  try {
31
32
  const module = await import(path.join(process.cwd(), pluginName));
32
33
  plugin = module.default;
33
34
  } catch (err) {
35
+ debug(err);
34
36
  // In some cases or tests we might need to support legacy `require.resolve`
35
37
  const require = createRequire(process.cwd());
36
38
  const module = await import(url.pathToFileURL(require.resolve(pluginName, { paths: [process.cwd()] })));
@@ -105,8 +105,8 @@ class GitHub extends Release {
105
105
  const { data } = await this.client.users.getAuthenticated();
106
106
  this.setContext({ username: data.login });
107
107
  return true;
108
- } catch (error) {
109
- this.debug(error);
108
+ } catch (err) {
109
+ this.debug(err);
110
110
  return false;
111
111
  }
112
112
  }
@@ -120,8 +120,8 @@ class GitHub extends Release {
120
120
  this.log.verbose(`octokit repos#checkCollaborator (${username})`);
121
121
  await this.client.repos.checkCollaborator(options);
122
122
  return true;
123
- } catch (error) {
124
- this.debug(error);
123
+ } catch (err) {
124
+ this.debug(err);
125
125
  return false;
126
126
  }
127
127
  }
@@ -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/lib/shell.js CHANGED
@@ -78,12 +78,12 @@ class Shell {
78
78
  this.log.verbose(stdout, { isExternal });
79
79
  debug({ command, options, stdout, stderr });
80
80
  return Promise.resolve(stdout || stderr);
81
- } catch (error) {
82
- if (error.stdout) {
83
- this.log.log(`\n${error.stdout}`);
81
+ } catch (err) {
82
+ if (err.stdout) {
83
+ this.log.log(`\n${err.stdout}`);
84
84
  }
85
- debug({ error });
86
- return Promise.reject(new Error(error.stderr || error.message));
85
+ debug(err);
86
+ return Promise.reject(new Error(err.stderr || err.message));
87
87
  }
88
88
  }
89
89
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-it",
3
- "version": "17.4.0",
3
+ "version": "17.4.2",
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
- ".": "./lib/index.js",
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
  },
@@ -56,7 +60,8 @@
56
60
  "config",
57
61
  "lib",
58
62
  "test",
59
- "schema"
63
+ "schema",
64
+ "types"
60
65
  ],
61
66
  "types": "./types/index.d.ts",
62
67
  "scripts": {
@@ -80,9 +85,9 @@
80
85
  "cosmiconfig": "9.0.0",
81
86
  "execa": "8.0.1",
82
87
  "git-url-parse": "14.0.0",
83
- "globby": "14.0.1",
88
+ "globby": "14.0.2",
84
89
  "got": "13.0.0",
85
- "inquirer": "9.2.23",
90
+ "inquirer": "9.3.2",
86
91
  "is-ci": "3.0.1",
87
92
  "issue-parser": "7.0.1",
88
93
  "lodash": "4.17.21",
@@ -92,7 +97,6 @@
92
97
  "open": "10.1.0",
93
98
  "ora": "8.0.1",
94
99
  "os-name": "5.1.0",
95
- "promise.allsettled": "1.0.7",
96
100
  "proxy-agent": "6.4.0",
97
101
  "semver": "7.6.2",
98
102
  "shelljs": "0.8.5",
@@ -104,18 +108,19 @@
104
108
  "devDependencies": {
105
109
  "@eslint/compat": "1.1.0",
106
110
  "@eslint/eslintrc": "3.1.0",
107
- "@eslint/js": "9.5.0",
111
+ "@eslint/js": "9.6.0",
108
112
  "@octokit/request-error": "5.1.0",
113
+ "@types/node": "20.14.9",
109
114
  "ava": "6.1.3",
110
- "eslint": "9.5.0",
115
+ "eslint": "9.6.0",
111
116
  "eslint-config-prettier": "9.1.0",
112
117
  "eslint-plugin-ava": "15.0.1",
113
118
  "eslint-plugin-import": "2.29.1",
114
119
  "eslint-plugin-prettier": "5.1.3",
115
120
  "fs-monkey": "1.0.6",
116
- "globals": "15.6.0",
121
+ "globals": "15.7.0",
117
122
  "installed-check": "9.3.0",
118
- "knip": "5.22.1",
123
+ "knip": "5.23.2",
119
124
  "memfs": "4.9.3",
120
125
  "mock-stdio": "1.0.3",
121
126
  "nock": "13.5.4",
@@ -123,7 +128,12 @@
123
128
  "remark-cli": "12.0.1",
124
129
  "remark-preset-webpro": "1.1.0",
125
130
  "sinon": "18.0.0",
126
- "strip-ansi": "7.1.0"
131
+ "strip-ansi": "7.1.0",
132
+ "typescript": "5.5.2"
133
+ },
134
+ "overrides": {
135
+ "pac-resolver": "7.0.1",
136
+ "socks": "2.8.3"
127
137
  },
128
138
  "engines": {
129
139
  "node": "^18.18.0 || ^20.9.0 || ^22.0.0"
@@ -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?: false | string;
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
+ }
@@ -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
+ };
@@ -0,0 +1,3 @@
1
+ declare module 'release-it';
2
+
3
+ export type { Config } from './config.d';