Socket
Socket
Sign inDemoInstall

semantic-release-license

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

semantic-release-license - npm Package Compare versions

Comparing version 1.0.0-beta.2 to 1.0.0-beta.3

build/detect-license-path.js

3

build/detect-license.js

@@ -11,5 +11,2 @@ "use strict";

}
if (license.match(/GNU GENERAL PUBLIC LICENSE/g)) {
return 'GPL';
}
return undefined;

@@ -16,0 +13,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.bsl = void 0;
function bsl(content, nextVersion) {
function bsl(content, context) {
return content
.replace(/(Licensed Work.*)(\d+.\d+.\d+)/, (full, part1) => (`${part1}${nextVersion}`))
.replace(/(Licensed Work.*)(\d+.\d+.\d+)/, (full, part1) => (`${part1}${context.nextRelease.version}`))
.replace(/(Change Date.*)(\d{4}-\d{2}-\d{2})/, (full, part1) => {

@@ -12,5 +12,5 @@ const today = new Date();

})
.replace(/\(c\) 2020/, `(c) ${new Date().getFullYear()}`);
.replace(/(The Licensed Work is \(c\) )(\d{4})/, (full, part1) => `${part1}${new Date().getFullYear()}`);
}
exports.bsl = bsl;
//# sourceMappingURL=bsl.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mit = void 0;
async function mit(license) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function mit(license, context) {
const newYear = new Date().getFullYear();

@@ -6,0 +7,0 @@ return license.replace(/Copyright \(c\) (\d{4})/g, `Copyright (c) ${newYear}`);

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.prepare = exports.verifyConditions = void 0;
const detect_license_1 = require("./detect-license");
const get_license_file_1 = require("./get-license-file");
const fs_1 = require("fs");
const bsl_1 = require("./handlers/bsl");
const mit_1 = require("./handlers/mit");
const gnu_1 = require("./handlers/gnu");
async function verifyConditions({ license }, context) {
const licensePath = (license === null || license === void 0 ? void 0 : license.path) || await get_license_file_1.getLicenseFile();
if (!licensePath) {
throw new Error('License file not found');
}
const content = (await fs_1.promises.readFile(licensePath)).toString();
const licenseType = (license === null || license === void 0 ? void 0 : license.type) || await detect_license_1.detectLicense(content);
if (!licenseType) {
throw new Error('Could not detect license');
}
context.logger.log(`Detected license type ${licenseType}`);
}
exports.verifyConditions = verifyConditions;
async function prepare({ license }, context) {
const licensePath = (license === null || license === void 0 ? void 0 : license.path) || await get_license_file_1.getLicenseFile();
const content = (await fs_1.promises.readFile(licensePath)).toString();
const licenseType = (license === null || license === void 0 ? void 0 : license.type) || await detect_license_1.detectLicense(content);
let replacement = content;
switch (licenseType) {
case 'MIT':
replacement = await mit_1.mit(content);
break;
case 'BSL':
replacement = await bsl_1.bsl(content, context.nextRelease.version);
break;
case 'GPL':
replacement = await gnu_1.gnu(content);
break;
default:
throw new Error(`License type ${licenseType} not supported`);
}
await fs_1.promises.writeFile(licensePath, replacement);
}
exports.prepare = prepare;
__exportStar(require("./verify-conditions"), exports);
__exportStar(require("./prepare"), exports);
//# sourceMappingURL=index.js.map

@@ -0,1 +1,8 @@

# [1.0.0-beta.3](https://github.com/gomeli/semantic-release-license/compare/v1.0.0-beta.2...v1.0.0-beta.3) (2020-11-24)
### Features
* add tests and remove gnu ([cdad416](https://github.com/gomeli/semantic-release-license/commit/cdad416b36ff5b070b29e4ad02b67a9b8d96e57a))
# [1.0.0-beta.2](https://github.com/gomeli/semantic-release-license/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2020-11-24)

@@ -2,0 +9,0 @@

{
"name": "semantic-release-license",
"version": "1.0.0-beta.2",
"version": "1.0.0-beta.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "build/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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