Socket
Socket
Sign inDemoInstall

@lerna/project

Package Overview
Dependencies
Maintainers
2
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lerna/project - npm Package Compare versions

Comparing version 3.14.2 to 3.15.0

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [3.15.0](https://github.com/lerna/lerna/compare/v3.14.2...v3.15.0) (2019-06-09)
### Features
* **version:** Add `--create-release=[gitlab|github]` option ([#2073](https://github.com/lerna/lerna/issues/2073)) ([4974b78](https://github.com/lerna/lerna/commit/4974b78))
## [3.14.2](https://github.com/lerna/lerna/compare/v3.14.1...v3.14.2) (2019-06-09)

@@ -8,0 +19,0 @@

48

lib/deprecate-config.js

@@ -9,2 +9,6 @@ "use strict";

// add new predicates HERE
remap("command.version.githubRelease", "command.version.createRelease", {
alsoRoot: true,
toValue: value => value && "github",
}),
remap("command.publish.npmTag", "command.publish.distTag", { alsoRoot: true }),

@@ -25,5 +29,6 @@ remap("command.publish.cdVersion", "command.publish.bump", { alsoRoot: true }),

* @param {Boolean} opts.alsoRoot Whether to check root config as well
* @param {Function} opts.toValue Return the new config value given the current value
* @return {Function} predicate accepting (config, filepath)
*/
function remap(search, target, { alsoRoot } = {}) {
function remap(search, target, { alsoRoot, toValue } = {}) {
const pathsToSearch = [search];

@@ -39,10 +44,8 @@

if (dotProp.has(obj.config, searchPath)) {
const localPath = path.relative(".", obj.filepath);
const fromVal = dotProp.get(obj.config, searchPath);
const toVal = toValue ? toValue(fromVal) : fromVal;
log.warn(
"project",
`Deprecated key "${searchPath}" found in ${localPath}\nPlease rename "${searchPath}" => "${target}"`
);
log.warn("project", deprecationMessage(obj, target, searchPath, fromVal, toVal));
dotProp.set(obj.config, target, dotProp.get(obj.config, searchPath));
dotProp.set(obj.config, target, toVal);
dotProp.delete(obj.config, searchPath);

@@ -56,4 +59,35 @@ }

/**
* Builds a deprecation message string that specifies
* a deprecated config option and suggests a correction.
*
* @param {Object} obj A config object
* @param {String} target Path of renamed option
* @param {String} searchSearch Path to deprecated option
* @param {Any} fromVal Current value of deprecated option
* @param {Any} toVal Corrected value of deprecated option
* @return {String} deprecation message
*/
function deprecationMessage(obj, target, searchPath, fromVal, toVal) {
const localPath = path.relative(".", obj.filepath);
let from;
let to;
if (toVal === fromVal) {
from = `"${searchPath}"`;
to = `"${target}"`;
} else {
from = stringify({ [searchPath]: fromVal });
to = stringify({ [target]: toVal });
}
return `Deprecated key "${searchPath}" found in ${localPath}\nPlease update ${from} => ${to}`;
}
function stringify(obj) {
return JSON.stringify(obj).slice(1, -1);
}
function compose(...funcs) {
return funcs.reduce((a, b) => (...args) => a(b(...args)));
}

4

package.json
{
"name": "@lerna/project",
"version": "3.14.2",
"version": "3.15.0",
"description": "Lerna project configuration",

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

},
"gitHead": "b22345b9870f62f1125e109fcc47d2e4260b9d09"
"gitHead": "457d1e8a62f5caf0679973ae8bad564d7752ffd2"
}
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