Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

liferay-npm-bundler-plugin-inject-imports-dependencies

Package Overview
Dependencies
Maintainers
1
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

liferay-npm-bundler-plugin-inject-imports-dependencies - npm Package Compare versions

Comparing version 1.7.0-alpha.43ab330a to 1.7.0-alpha.cec3fa45

lib/__tests__/__snapshots__/index.test.js.snap

17

lib/index.js

@@ -8,3 +8,4 @@ 'use strict';

exports.default = function (_ref, _ref2) {
var globalConfig = _ref.globalConfig,
var rootPkgJson = _ref.rootPkgJson,
globalConfig = _ref.globalConfig,
config = _ref.config,

@@ -20,8 +21,14 @@ log = _ref.log;

Object.keys(imports[namespace]).forEach(function (pkgName) {
var version = imports[namespace][pkgName];
var name = namespace === '' ? pkgName : ns.addNamespace(pkgName, { name: namespace });
var localName = ns.addNamespace(pkgName, rootPkgJson);
pkgJson.dependencies[name] = version;
var importVersion = imports[namespace][pkgName];
var importName = namespace === '' ? pkgName : ns.addNamespace(pkgName, { name: namespace });
log.info('inject-imports-dependencies', 'Injected dependency', name + ' : ' + version);
pkgJson.dependencies[importName] = importVersion;
if (pkgJson.dependencies[localName] !== importVersion) {
log.warn('inject-imports-dependencies', 'Injected dependency', importName + '@' + importVersion, 'which is not compatible package.json\'s constraints:', localName + '@' + pkgJson.dependencies[localName]);
} else {
log.info('inject-imports-dependencies', 'Injected dependency', importName + '@' + importVersion);
}
});

@@ -28,0 +35,0 @@ });

{
"name": "liferay-npm-bundler-plugin-inject-imports-dependencies",
"version": "1.7.0-alpha.43ab330a",
"version": "1.7.0-alpha.cec3fa45",
"description": "A liferay-npm-bundler plugin to force injection of declared imports as dependencies.",

@@ -15,4 +15,4 @@ "main": "lib/index.js",

"dependencies": {
"liferay-npm-build-tools-common": "1.7.0-alpha.43ab330a"
"liferay-npm-build-tools-common": "1.7.0-alpha.cec3fa45"
}
}

@@ -28,2 +28,2 @@ # liferay-npm-bundler-plugin-inject-imports-dependencies

This plugin injects dependencies declared as imports inside the `.npmbundlerrc`
file in the root `package.json` file.
file in the `package.json` file.

@@ -6,3 +6,6 @@ import * as ns from 'liferay-npm-build-tools-common/lib/namespace';

*/
export default function({globalConfig, config, log}, {pkgJson}) {
export default function(
{rootPkgJson, globalConfig, config, log},
{pkgJson}
) {
const imports = config.imports || globalConfig.imports || {};

@@ -14,4 +17,6 @@

Object.keys(imports[namespace]).forEach(pkgName => {
const version = imports[namespace][pkgName];
const name =
const localName = ns.addNamespace(pkgName, rootPkgJson);
const importVersion = imports[namespace][pkgName];
const importName =
namespace === ''

@@ -21,11 +26,21 @@ ? pkgName

pkgJson.dependencies[name] = version;
pkgJson.dependencies[importName] = importVersion;
log.info(
'inject-imports-dependencies',
'Injected dependency',
`${name} : ${version}`
);
if (pkgJson.dependencies[localName] !== importVersion) {
log.warn(
'inject-imports-dependencies',
'Injected dependency',
`${importName}@${importVersion}`,
'which is not compatible package.json\'s constraints:',
`${localName}@${pkgJson.dependencies[localName]}`
);
} else {
log.info(
'inject-imports-dependencies',
'Injected dependency',
`${importName}@${importVersion}`
);
}
});
});
}

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