Socket
Socket
Sign inDemoInstall

release-it

Package Overview
Dependencies
369
Maintainers
1
Versions
390
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 15.10.3 to 15.11.0

25

lib/index.js

@@ -18,3 +18,3 @@ import _ from 'lodash';

const { config } = container;
const { isCI, isVerbose, verbosityLevel, isDryRun } = config;
const { isCI, isVerbose, verbosityLevel, isDryRun, isChangelog, isReleaseVersion } = config;

@@ -66,2 +66,7 @@ container.log = container.log || new Logger({ isCI, isVerbose, verbosityLevel, isDryRun });

if (isChangelog) {
console.log(changelog);
process.exit(0);
}
const incrementBase = { latestVersion, increment, isPreRelease, preReleaseId };

@@ -79,4 +84,8 @@

const action = config.isIncrement ? 'release' : 'update';
const suffix = version && config.isIncrement ? `${latestVersion}...${version}` : `currently at ${latestVersion}`;
if (!isReleaseVersion) {
const action = config.isIncrement ? 'release' : 'update';
const suffix = version && config.isIncrement ? `${latestVersion}...${version}` : `currently at ${latestVersion}`;
log.obtrusive(`🚀 Let's ${action} ${name} (${suffix})`);
log.preview({ title: 'changelog', text: changelog });
}

@@ -89,8 +98,5 @@ if (config.isIncrement) {

log.obtrusive(`No new version to release`);
} else if (!config.isReleaseVersion && !config.isChangelog) {
log.obtrusive(`🚀 Let's ${action} ${name} (${suffix})`);
log.preview({ title: 'changelog', text: changelog });
}
if (config.isReleaseVersion) {
if (isReleaseVersion) {
console.log(version);

@@ -100,7 +106,2 @@ process.exit(0);

if (config.isChangelog) {
console.log(changelog);
process.exit(0);
}
if (version) {

@@ -107,0 +108,0 @@ config.setContext(parseVersion(version));

@@ -11,3 +11,3 @@ import fs from 'node:fs';

import newGithubReleaseUrl from 'new-github-release-url';
import ProxyAgent from 'proxy-agent';
import { ProxyAgent } from 'proxy-agent';
import { format, parseVersion, readJSON, e } from '../../util.js';

@@ -14,0 +14,0 @@ import Release from '../GitRelease.js';

@@ -16,2 +16,3 @@ import path from 'node:path';

const NPM_BASE_URL = 'https://www.npmjs.com';
const NPM_PUBLIC_PATH = '/package';

@@ -202,3 +203,4 @@ const fixArgs = args => (args ? (typeof args === 'string' ? args.split(' ') : args) : []);

const baseUrl = this.getRegistry() || NPM_BASE_URL;
return urlJoin(baseUrl, 'package', this.getName());
const publicPath = this.getPublicPath() || NPM_PUBLIC_PATH;
return urlJoin(baseUrl, publicPath, this.getName());
}

@@ -218,2 +220,7 @@

getPublicPath() {
const { publishConfig } = this.getContext();
return (publishConfig && publishConfig.publicPath) ?? '';
}
async guessPreReleaseTag() {

@@ -220,0 +227,0 @@ const [tag] = await this.getRegistryPreReleaseTags();

@@ -43,3 +43,3 @@ import { debug } from 'node:util';

getContext(path) {
const context = Object.assign({}, this.options, this.context);
const context = _.merge({}, this.options, this.context);
return path ? _.get(context, path) : context;

@@ -46,0 +46,0 @@ }

{
"name": "release-it",
"version": "15.10.3",
"version": "15.11.0",
"description": "Generic CLI tool to automate versioning and package publishing-related tasks.",

@@ -64,3 +64,3 @@ "keywords": [

"@iarna/toml": "2.2.5",
"@octokit/rest": "19.0.7",
"@octokit/rest": "19.0.11",
"async-retry": "1.3.3",

@@ -72,4 +72,4 @@ "chalk": "5.2.0",

"globby": "13.1.4",
"got": "12.6.0",
"inquirer": "9.2.0",
"got": "12.6.1",
"inquirer": "9.2.6",
"is-ci": "3.0.1",

@@ -82,7 +82,7 @@ "issue-parser": "6.0.0",

"open": "9.1.0",
"ora": "6.3.0",
"ora": "6.3.1",
"os-name": "5.1.0",
"promise.allsettled": "1.0.6",
"proxy-agent": "5.0.0",
"semver": "7.5.0",
"proxy-agent": "6.2.1",
"semver": "7.5.1",
"shelljs": "0.8.5",

@@ -96,4 +96,4 @@ "update-notifier": "6.0.2",

"@octokit/request-error": "3.0.3",
"ava": "5.2.0",
"eslint": "8.39.0",
"ava": "5.3.0",
"eslint": "8.41.0",
"eslint-config-prettier": "8.8.0",

@@ -109,4 +109,4 @@ "eslint-plugin-ava": "14.0.0",

"remark-preset-webpro": "0.0.2",
"sinon": "15.0.4",
"strip-ansi": "7.0.1"
"sinon": "15.1.0",
"strip-ansi": "7.1.0"
},

@@ -113,0 +113,0 @@ "engines": {

@@ -81,12 +81,14 @@ # Release It! 🚀

## GitHub Actions
## Videos, articles & examples
Want to use release-it with GitHub Actions to fully automate the whole process? Enjoy this great walk-through: [How to
use GitHub Actions & Release-It to Easily Release Your Code][18] (by [David from Kodaps][19]).
Here's a list of interesting external resources:
→ See [Continuous Integration environments][9] for more details.
- Video: [How to use GitHub Actions & Release-It to Easily Release Your Code][18]
- Article: [Monorepo Semantic Releases][19] ([repo][20])
Want to add yours to the list? Just open a pull request!
## Configuration
Out of the box, release-it has sane defaults, and [plenty of options][20] to configure it. Most projects use a
Out of the box, release-it has sane defaults, and [plenty of options][21] to configure it. Most projects use a
`.release-it.json` file in the project root, or a `release-it` property in `package.json`.

@@ -107,3 +109,3 @@

→ See [Configuration][21] for more details.
→ See [Configuration][22] for more details.

@@ -126,3 +128,3 @@ ## Interactive vs. CI mode

1. For projects with a `package.json`, its `version` will be used (see [npm][22] to skip this).
1. For projects with a `package.json`, its `version` will be used (see [npm][23] to skip this).
2. Otherwise, release-it uses the latest Git tag to determine which version should be released.

@@ -133,5 +135,5 @@ 3. As a last resort, `0.0.0` will be used as the latest version.

- [@release-it/bumper][23] to read from or bump the version in any file
- [@release-it/conventional-changelog][24] to get a recommended bump based on commit messages
- [release-it-calver-plugin][25] to use CalVer (Calendar Versioning)
- [@release-it/bumper][24] to read from or bump the version in any file
- [@release-it/conventional-changelog][25] to get a recommended bump based on commit messages
- [release-it-calver-plugin][26] to use CalVer (Calendar Versioning)

@@ -145,3 +147,3 @@ Add the `--release-version` flag to print the **next** version without releasing anything.

→ See [Git][26] for more details.
→ See [Git][27] for more details.

@@ -151,3 +153,3 @@ ## GitHub Releases

GitHub projects can have releases attached to Git tags, containing release notes and assets. There are two ways to add
[GitHub releases][27] in your release-it flow:
[GitHub releases][28] in your release-it flow:

@@ -157,3 +159,3 @@ 1. Automated (requires a `GITHUB_TOKEN`)

→ See [GitHub Releases][28] for more details.
→ See [GitHub Releases][29] for more details.

@@ -163,9 +165,9 @@ ## GitLab Releases

GitLab projects can have releases attached to Git tags, containing release notes and assets. To automate [GitLab
releases][29]:
releases][30]:
- Configure `gitlab.release: true`
- Obtain a [personal access token][30] (release-it only needs the "api" scope).
- Make sure the token is [available as an environment variable][31].
- Obtain a [personal access token][31] (release-it only needs the "api" scope).
- Make sure the token is [available as an environment variable][32].
→ See [GitLab Releases][32] for more details.
→ See [GitLab Releases][33] for more details.

@@ -177,3 +179,3 @@ ## Changelog

The [default command][20] is based on `git log ...`. This setting (`git.changelog`) can be overridden. To further
The [default command][21] is based on `git log ...`. This setting (`git.changelog`) can be overridden. To further
customize the release notes for the GitHub or GitLab release, there's `github.releaseNotes` or `gitlab.releaseNotes`.

@@ -190,3 +192,3 @@ Make sure any of these commands output the changelog to `stdout`. Note that release-it by default is agnostic to commit

→ See [Changelog][33] for more details.
→ See [Changelog][34] for more details.

@@ -198,3 +200,3 @@ ## Publish to npm

→ See [Publish to npm][22] for more details.
→ See [Publish to npm][23] for more details.

@@ -207,3 +209,3 @@ ## Manage pre-releases

→ See [Manage pre-releases][34] for more details.
→ See [Manage pre-releases][35] for more details.

@@ -238,3 +240,3 @@ ## Update or re-run existing releases

Note that hooks like `after:git:release` will not run when either the `git push` failed, or when it is configured not to
be executed (e.g. `git.push: false`). See [execution order][35] for more details on execution order of plugin lifecycle
be executed (e.g. `git.push: false`). See [execution order][36] for more details on execution order of plugin lifecycle
methods.

@@ -257,3 +259,3 @@

The variables can be found in the [default configuration][20]. Additionally, the following variables are exposed:
The variables can be found in the [default configuration][21]. Additionally, the following variables are exposed:

@@ -289,3 +291,3 @@ ```text

→ See [Dry Runs][36] for more details.
→ See [Dry Runs][37] for more details.

@@ -306,16 +308,16 @@ ## Troubleshooting & debugging

| ----------------------------------------- | ----------------------------------------------------------------------------- |
| [@release-it/bumper][23] | Read & write the version from/to any file |
| [@release-it/conventional-changelog][24] | Provides recommended bump, conventional-changelog, and updates `CHANGELOG.md` |
| [@release-it/keep-a-changelog][37] | Maintain CHANGELOG.md using the Keep a Changelog standards |
| [@release-it-plugins/lerna-changelog][38] | Integrates lerna-changelog into the release-it pipeline |
| [@release-it-plugins/workspaces][39] | Releases each of your projects configured workspaces |
| [release-it-calver-plugin][25] | Enables Calendar Versioning (calver) with release-it |
| [@grupoboticario/news-fragments][40] | An easy way to generate your changelog file |
| [@j-ulrich/release-it-regex-bumper][41] | Regular expression based version read/write plugin for release-it |
| [@release-it/bumper][24] | Read & write the version from/to any file |
| [@release-it/conventional-changelog][25] | Provides recommended bump, conventional-changelog, and updates `CHANGELOG.md` |
| [@release-it/keep-a-changelog][38] | Maintain CHANGELOG.md using the Keep a Changelog standards |
| [@release-it-plugins/lerna-changelog][39] | Integrates lerna-changelog into the release-it pipeline |
| [@release-it-plugins/workspaces][40] | Releases each of your projects configured workspaces |
| [release-it-calver-plugin][26] | Enables Calendar Versioning (calver) with release-it |
| [@grupoboticario/news-fragments][41] | An easy way to generate your changelog file |
| [@j-ulrich/release-it-regex-bumper][42] | Regular expression based version read/write plugin for release-it |
Internally, release-it uses its own plugin architecture (for Git, GitHub, GitLab, npm).
→ See all [release-it plugins on npm][42].
→ See all [release-it plugins on npm][43].
→ See [plugins][43] for documentation to write plugins.
→ See [plugins][44] for documentation to write plugins.

@@ -325,25 +327,25 @@ ## Use release-it programmatically

While mostly used as a CLI tool, release-it can be used as a dependency to integrate in your own scripts. See [use
release-it programmatically][44] for example code.
release-it programmatically][45] for example code.
## Example projects using release-it
- [axios/axios][45]
- [blockchain/blockchain-wallet-v4-frontend][46]
- [callstack/react-native-paper][47]
- [ember-cli/ember-cli][48]
- [js-cookie/js-cookie][49]
- [metalsmith/metalsmith][50]
- [mozilla/readability][51]
- [pahen/madge][52]
- [redis/node-redis][53]
- [reduxjs/redux][54]
- [saleor/saleor][55]
- [Semantic-Org/Semantic-UI-React][56]
- [shipshapecode/shepherd][57]
- [StevenBlack/hosts][58]
- [swagger-api/swagger-ui][59] + [swagger-editor][60]
- [tabler/tabler][61] + [tabler-icons][62]
- [youzan/vant][63]
- [Repositories that depend on release-it][64]
- GitHub search for [path:\*\*/.release-it.json][65]
- [axios/axios][46]
- [blockchain/blockchain-wallet-v4-frontend][47]
- [callstack/react-native-paper][48]
- [ember-cli/ember-cli][49]
- [js-cookie/js-cookie][50]
- [metalsmith/metalsmith][51]
- [mozilla/readability][52]
- [pahen/madge][53]
- [redis/node-redis][54]
- [reduxjs/redux][55]
- [saleor/saleor][56]
- [Semantic-Org/Semantic-UI-React][57]
- [shipshapecode/shepherd][58]
- [StevenBlack/hosts][59]
- [swagger-api/swagger-ui][60] + [swagger-editor][61]
- [tabler/tabler][62] + [tabler-icons][63]
- [youzan/vant][64]
- [Repositories that depend on release-it][65]
- GitHub search for [path:\*\*/.release-it.json][66]

@@ -353,13 +355,13 @@ ## Legacy Node.js

The latest major version is v15, supporting Node.js 14 and up (as Node.js v12 is EOL). Use release-it v14 for
environments running Node.js v10 and v12. Also see [CHANGELOG.md][66].
environments running Node.js v10 and v12. Also see [CHANGELOG.md][67].
## Links
- See [CHANGELOG.md][66] for major/breaking updates, and [releases][67] for a detailed version history.
- To **contribute**, please read [CONTRIBUTING.md][68] first.
- Please [open an issue][69] if anything is missing or unclear in this documentation.
- See [CHANGELOG.md][67] for major/breaking updates, and [releases][68] for a detailed version history.
- To **contribute**, please read [CONTRIBUTING.md][69] first.
- Please [open an issue][70] if anything is missing or unclear in this documentation.
## License
[MIT][70]
[MIT][71]

@@ -384,53 +386,54 @@ [1]: #git

[18]: https://www.youtube.com/watch?v=7pBcuT7j_A0
[19]: https://twitter.com/KodapsAcademy
[20]: ./config/release-it.json
[21]: ./docs/configuration.md
[22]: ./docs/npm.md
[23]: https://github.com/release-it/bumper
[24]: https://github.com/release-it/conventional-changelog
[25]: https://github.com/casmith/release-it-calver-plugin
[26]: ./docs/git.md
[27]: https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases
[28]: ./docs/github-releases.md
[29]: https://docs.gitlab.com/ce/user/project/releases/
[30]: https://gitlab.com/profile/personal_access_tokens
[31]: ./docs/environment-variables.md
[32]: ./docs/gitlab-releases.md
[33]: ./docs/changelog.md
[34]: ./docs/pre-releases.md
[35]: ./docs/plugins.md#execution-order
[36]: ./docs/dry-runs.md
[37]: https://github.com/release-it/keep-a-changelog
[38]: https://github.com/release-it-plugins/lerna-changelog
[39]: https://github.com/release-it-plugins/workspaces
[40]: https://github.com/grupoboticario/news-fragments
[41]: https://github.com/j-ulrich/release-it-regex-bumper
[42]: https://www.npmjs.com/search?q=keywords:release-it-plugin
[43]: ./docs/plugins.md
[44]: ./docs/recipes/programmatic.md
[45]: https://github.com/axios/axios
[46]: https://github.com/blockchain/blockchain-wallet-v4-frontend
[47]: https://github.com/callstack/react-native-paper
[48]: https://github.com/ember-cli/ember-cli
[49]: https://github.com/js-cookie/js-cookie
[50]: https://github.com/metalsmith/metalsmith
[51]: https://github.com/mozilla/readability
[52]: https://github.com/pahen/madge
[53]: https://github.com/redis/node-redis
[54]: https://github.com/reduxjs/redux
[55]: https://github.com/saleor/saleor
[56]: https://github.com/Semantic-Org/Semantic-UI-React
[57]: https://github.com/shipshapecode/shepherd
[58]: https://github.com/StevenBlack/hosts
[59]: https://github.com/swagger-api/swagger-ui
[60]: https://github.com/swagger-api/swagger-editor
[61]: https://github.com/tabler/tabler
[62]: https://github.com/tabler/tabler-icons
[63]: https://github.com/youzan/vant
[64]: https://github.com/release-it/release-it/network/dependents
[65]: https://github.com/search?q=path%3A**%2F.release-it.json&type=code
[66]: ./CHANGELOG.md
[67]: https://github.com/release-it/release-it/releases
[68]: ./.github/CONTRIBUTING.md
[69]: https://github.com/release-it/release-it/issues/new
[70]: ./LICENSE
[19]: https://medium.com/valtech-ch/monorepo-semantic-releases-db114811efa5
[20]: https://github.com/b12k/monorepo-semantic-releases
[21]: ./config/release-it.json
[22]: ./docs/configuration.md
[23]: ./docs/npm.md
[24]: https://github.com/release-it/bumper
[25]: https://github.com/release-it/conventional-changelog
[26]: https://github.com/casmith/release-it-calver-plugin
[27]: ./docs/git.md
[28]: https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases
[29]: ./docs/github-releases.md
[30]: https://docs.gitlab.com/ce/user/project/releases/
[31]: https://gitlab.com/profile/personal_access_tokens
[32]: ./docs/environment-variables.md
[33]: ./docs/gitlab-releases.md
[34]: ./docs/changelog.md
[35]: ./docs/pre-releases.md
[36]: ./docs/plugins.md#execution-order
[37]: ./docs/dry-runs.md
[38]: https://github.com/release-it/keep-a-changelog
[39]: https://github.com/release-it-plugins/lerna-changelog
[40]: https://github.com/release-it-plugins/workspaces
[41]: https://github.com/grupoboticario/news-fragments
[42]: https://github.com/j-ulrich/release-it-regex-bumper
[43]: https://www.npmjs.com/search?q=keywords:release-it-plugin
[44]: ./docs/plugins.md
[45]: ./docs/recipes/programmatic.md
[46]: https://github.com/axios/axios
[47]: https://github.com/blockchain/blockchain-wallet-v4-frontend
[48]: https://github.com/callstack/react-native-paper
[49]: https://github.com/ember-cli/ember-cli
[50]: https://github.com/js-cookie/js-cookie
[51]: https://github.com/metalsmith/metalsmith
[52]: https://github.com/mozilla/readability
[53]: https://github.com/pahen/madge
[54]: https://github.com/redis/node-redis
[55]: https://github.com/reduxjs/redux
[56]: https://github.com/saleor/saleor
[57]: https://github.com/Semantic-Org/Semantic-UI-React
[58]: https://github.com/shipshapecode/shepherd
[59]: https://github.com/StevenBlack/hosts
[60]: https://github.com/swagger-api/swagger-ui
[61]: https://github.com/swagger-api/swagger-editor
[62]: https://github.com/tabler/tabler
[63]: https://github.com/tabler/tabler-icons
[64]: https://github.com/youzan/vant
[65]: https://github.com/release-it/release-it/network/dependents
[66]: https://github.com/search?q=path%3A**%2F.release-it.json&type=code
[67]: ./CHANGELOG.md
[68]: https://github.com/release-it/release-it/releases
[69]: ./.github/CONTRIBUTING.md
[70]: https://github.com/release-it/release-it/issues/new
[71]: ./LICENSE

@@ -21,2 +21,19 @@ import path from 'node:path';

test('should return npm package url (custom publicPath)', t => {
const options = { npm: { name: 'my-cool-package', publishConfig: { publicPath: '/custom/public-path' } } };
const npmClient = factory(npm, { options });
t.is(npmClient.getPackageUrl(), 'https://www.npmjs.com/custom/public-path/my-cool-package');
});
test('should return npm package url (custom registry and publicPath)', t => {
const options = {
npm: {
name: 'my-cool-package',
publishConfig: { registry: 'https://registry.example.org/', publicPath: '/custom/public-path' }
}
};
const npmClient = factory(npm, { options });
t.is(npmClient.getPackageUrl(), 'https://registry.example.org/custom/public-path/my-cool-package');
});
test('should return default tag', async t => {

@@ -23,0 +40,0 @@ const npmClient = factory(npm);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc