Socket
Socket
Sign inDemoInstall

release-it

Package Overview
Dependencies
Maintainers
0
Versions
399
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 17.6.0 to 18.0.0-next.0

4

lib/plugin/github/GitHub.js

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

import { Octokit } from '@octokit/rest';
import fetch from 'node-fetch';
import { globby } from 'globby';

@@ -181,4 +180,3 @@ import mime from 'mime-types';

request: {
timeout,
fetch
timeout
}

@@ -185,0 +183,0 @@ };

import fs from 'node:fs';
import path from 'node:path';
import got from 'got';
import { globby } from 'globby';
import { FormData, fileFromSync } from 'node-fetch';
import _ from 'lodash';

@@ -33,18 +31,2 @@ import Release from '../GitRelease.js';

get client() {
if (this._client) return this._client;
const { tokenHeader } = this.options;
const { baseUrl } = this.getContext();
this._client = got.extend({
prefixUrl: baseUrl,
method: 'POST',
headers: {
'user-agent': 'webpro/release-it',
[tokenHeader]: this.token
},
...this.certificateAuthorityOption
});
return this._client;
}
async init() {

@@ -183,4 +165,24 @@ await super.init();

const method = (options.method || 'POST').toLowerCase();
const response = await this.client[method](endpoint, options);
const body = typeof response.body === 'string' ? JSON.parse(response.body) : response.body || {};
const { tokenHeader } = this.options;
const url = `${baseUrl}/${endpoint}${options.searchParams ? `?${new URLSearchParams(options.searchParams)}` : ''}`;
const headers = {
'user-agent': 'webpro/release-it',
[tokenHeader]: this.token
};
const requestOptions = {
method,
headers,
...this.certificateAuthorityOption
};
const response = await fetch(
url,
options.json || options.body
? {
...requestOptions,
body: options.json ? JSON.stringify(options.json) : options.body
}
: requestOptions
);
const body = await response.json();
this.debug(body);

@@ -244,3 +246,4 @@ return body;

const body = new FormData();
body.set('file', fileFromSync(filePath));
const rawData = await fs.promises.readFile(filePath);
body.set('file', new Blob([rawData]), name);
const options = { body };

@@ -247,0 +250,0 @@

@@ -22,3 +22,3 @@ import inquirer from 'inquirer';

choices: 'choices' in prompt && prompt.choices(context),
transformer: 'transformer' in prompt && prompt.transformer(context)
transformer: 'transformer' in prompt ? prompt.transformer(context) : undefined
});

@@ -25,0 +25,0 @@

{
"name": "release-it",
"version": "17.6.0",
"version": "18.0.0-next.0",
"description": "Generic CLI tool to automate versioning and package publishing-related tasks.",

@@ -82,11 +82,10 @@ "keywords": [

"@iarna/toml": "2.2.5",
"@octokit/rest": "20.1.1",
"@octokit/rest": "21.0.2",
"async-retry": "1.3.3",
"chalk": "5.3.0",
"cosmiconfig": "9.0.0",
"execa": "8.0.1",
"git-url-parse": "14.0.0",
"execa": "9.3.1",
"git-url-parse": "15.0.0",
"globby": "14.0.2",
"got": "13.0.0",
"inquirer": "9.3.2",
"inquirer": "10.1.8",
"is-ci": "3.0.1",

@@ -97,10 +96,9 @@ "issue-parser": "7.0.1",

"new-github-release-url": "2.0.0",
"node-fetch": "3.3.2",
"open": "10.1.0",
"ora": "8.0.1",
"os-name": "5.1.0",
"os-name": "6.0.0",
"proxy-agent": "6.4.0",
"semver": "7.6.2",
"semver": "7.6.3",
"shelljs": "0.8.5",
"update-notifier": "7.1.0",
"update-notifier": "7.2.0",
"url-join": "5.0.0",

@@ -113,18 +111,18 @@ "wildcard-match": "5.1.3",

"@eslint/eslintrc": "3.1.0",
"@eslint/js": "9.7.0",
"@octokit/request-error": "5.1.0",
"@eslint/js": "9.9.1",
"@octokit/request-error": "6.1.4",
"@types/node": "20.14.10",
"ava": "6.1.3",
"eslint": "9.7.0",
"eslint": "9.9.1",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-ava": "15.0.1",
"eslint-plugin-import-x": "3.0.1",
"eslint-plugin-prettier": "5.1.3",
"eslint-plugin-import-x": "3.1.0",
"eslint-plugin-prettier": "5.2.1",
"fs-monkey": "1.0.6",
"globals": "15.8.0",
"globals": "15.9.0",
"installed-check": "9.3.0",
"knip": "5.26.0",
"memfs": "4.9.3",
"knip": "5.27.3",
"memfs": "4.11.1",
"mock-stdio": "1.0.3",
"nock": "13.5.4",
"nock": "14.0.0-beta.8",
"prettier": "3.3.3",

@@ -135,3 +133,3 @@ "remark-cli": "12.0.1",

"strip-ansi": "7.1.0",
"typescript": "5.5.3"
"typescript": "5.5.4"
},

@@ -143,3 +141,3 @@ "overrides": {

"engines": {
"node": "^18.18.0 || ^20.9.0 || ^22.0.0"
"node": "^20.9.0 || ^22.0.0"
},

@@ -146,0 +144,0 @@ "remarkConfig": {

@@ -17,3 +17,7 @@ {

"requireBranch": {
"type": "boolean",
"oneOf": [
{ "type": "boolean", "enum": [false] },
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } }
],
"default": false

@@ -20,0 +24,0 @@ },

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

sinon.stub(gitlab, 'getLatestVersion').resolves('1.0.0');
const spy = sinon.spy(gitlab, 'client', ['get']);

@@ -235,3 +234,3 @@ await runTasks(gitlab);

const { isReleased, releaseUrl } = gitlab.getContext();
t.is(spy.get.callCount, 0);
t.is(gitlab.log.exec.args[2][0], 'gitlab releases#uploadAssets');

@@ -241,3 +240,2 @@ t.is(gitlab.log.exec.args[3][0], 'gitlab releases#createRelease "R" (1.0.1)');

t.is(releaseUrl, `${pushRepo}/-/releases`);
spy.get.restore();
});

@@ -248,3 +246,2 @@

const gitlab = factory(GitLab, { options });
const spy = sinon.spy(gitlab, 'client', ['get']);

@@ -254,4 +251,2 @@ await t.notThrowsAsync(gitlab.init());

t.is(spy.get.callCount, 0);
t.is(gitlab.log.exec.args.filter(entry => /checkReleaseMilestones/.test(entry[0])).length, 0);

@@ -258,0 +253,0 @@ });

@@ -45,3 +45,3 @@ import test from 'ava';

choices: false,
transformer: false,
transformer: undefined,
default: true

@@ -48,0 +48,0 @@ });

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