Socket
Socket
Sign inDemoInstall

release-it

Package Overview
Dependencies
Maintainers
1
Versions
400
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

release-it - npm Package Compare versions

Comparing version 15.8.0 to 15.9.0

11

lib/plugin/GitRelease.js

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

const { changelog } = this.config.getContext();
const releaseNotes = script ? await this.exec(script) : changelog;
const releaseNotes = script ? await this.processReleaseNotes(script) : changelog;
this.setContext({ releaseNotes });

@@ -35,2 +35,11 @@ if (releaseNotes !== changelog) {

async processReleaseNotes(script) {
if (typeof script === 'function') {
const ctx = Object.assign({}, this.config.getContext(), { [this.namespace]: this.getContext() });
return script(ctx);
} else {
return this.exec(script);
}
}
afterRelease() {

@@ -37,0 +46,0 @@ const { isReleased, releaseUrl } = this.getContext();

10

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

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

"cosmiconfig": "8.1.0",
"execa": "7.0.0",
"execa": "7.1.1",
"git-url-parse": "13.1.0",

@@ -77,3 +77,3 @@ "globby": "13.1.3",

"new-github-release-url": "2.0.0",
"node-fetch": "3.3.0",
"node-fetch": "3.3.1",
"open": "8.4.2",

@@ -94,3 +94,3 @@ "ora": "6.1.2",

"ava": "5.2.0",
"eslint": "8.35.0",
"eslint": "8.36.0",
"eslint-config-prettier": "8.7.0",

@@ -105,3 +105,3 @@ "eslint-plugin-ava": "14.0.0",

"prettier": "2.8.4",
"sinon": "15.0.1",
"sinon": "15.0.2",
"strip-ansi": "7.0.1"

@@ -108,0 +108,0 @@ },

@@ -167,2 +167,31 @@ import test from 'ava';

test('should create custom release notes using releaseNotes function', async t => {
const options = {
git,
github: {
pushRepo,
tokenRef,
release: true,
releaseName: 'Release ${tagName}',
releaseNotes(context) {
return `Custom notes for tag ${context.tagName}`;
}
}
};
const github = factory(GitHub, { options });
const exec = sinon.stub(github.shell, 'exec').callThrough();
exec.withArgs('git describe --tags --match=* --abbrev=0').resolves('2.0.1');
interceptAuthentication();
interceptCollaborator();
interceptCreate({ body: { tag_name: '2.0.2', name: 'Release 2.0.2', body: 'Custom notes for tag 2.0.2' } });
await runTasks(github);
const { isReleased, releaseUrl } = github.getContext();
t.true(isReleased);
t.is(releaseUrl, 'https://github.com/user/repo/releases/tag/2.0.2');
exec.restore();
});
test('should create new release for unreleased tag', async t => {

@@ -169,0 +198,0 @@ const options = {

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc