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 2.6.2 to 2.6.3-alpha.126

LICENSE.md

85

lib/index.js

@@ -1,45 +0,42 @@

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (_ref, _ref2) {
var rootPkgJson = _ref.rootPkgJson,
globalConfig = _ref.globalConfig,
config = _ref.config,
log = _ref.log;
var pkgJson = _ref2.pkgJson;
var imports = config.imports || globalConfig.imports || {};
imports = (0, _imports.normalizeImportsConfig)(imports);
pkgJson.dependencies = pkgJson.dependencies || {};
Object.keys(imports).forEach(function (namespace) {
Object.keys(imports[namespace]).forEach(function (pkgName) {
var localName = ns.addNamespace(pkgName, rootPkgJson);
var importVersion = imports[namespace][pkgName];
var importName = namespace === '' ? pkgName : ns.addNamespace(pkgName, { name: namespace });
pkgJson.dependencies[importName] = importVersion;
if (pkgJson.dependencies[localName] !== undefined && pkgJson.dependencies[localName] !== importVersion) {
log.info('inject-imports-dependencies', 'Injected dependency', importName + '@' + importVersion, '(however, note that the same dependency in package.json', 'has different constraints:', localName + '@' + pkgJson.dependencies[localName] + ')');
} else {
log.info('inject-imports-dependencies', 'Injected dependency', importName + '@' + importVersion);
}
});
});
"use strict";
/**
* © 2017 Liferay, Inc. <https://liferay.com>
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
var _namespace = require('liferay-npm-build-tools-common/lib/namespace');
var ns = _interopRequireWildcard(_namespace);
var _imports = require('liferay-npm-build-tools-common/lib/imports');
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
//# sourceMappingURL=index.js.map
Object.defineProperty(exports, "__esModule", { value: true });
const ns = __importStar(require("liferay-npm-build-tools-common/lib/namespace"));
const imports_1 = require("liferay-npm-build-tools-common/lib/imports");
/**
* @return {void}
*/
function default_1({ config, globalConfig, log, rootPkgJson }, { pkgJson }) {
let imports = config.imports || globalConfig.imports || {};
imports = imports_1.normalizeImportsConfig(imports);
pkgJson.dependencies = pkgJson.dependencies || {};
Object.keys(imports).forEach(namespace => {
Object.keys(imports[namespace]).forEach(pkgName => {
const localName = ns.addNamespace(pkgName, rootPkgJson);
const importVersion = imports[namespace][pkgName];
const importName = namespace === ''
? pkgName
: ns.addNamespace(pkgName, { name: namespace });
pkgJson.dependencies[importName] = importVersion;
if (pkgJson.dependencies[localName] !== undefined &&
pkgJson.dependencies[localName] !== importVersion) {
log.info('inject-imports-dependencies', 'Injected dependency', `${importName}@${importVersion}`, '(however, note that the same dependency in package.json', 'has different constraints:', `${localName}@${pkgJson.dependencies[localName]})`);
}
else {
log.info('inject-imports-dependencies', 'Injected dependency', `${importName}@${importVersion}`);
}
});
});
}
exports.default = default_1;
{
"name": "liferay-npm-bundler-plugin-inject-imports-dependencies",
"version": "2.6.2",
"version": "2.6.3-alpha.126+f9a8cd2",
"description": "A liferay-npm-bundler plugin to force injection of declared imports as dependencies.",
"main": "lib/index.js",
"scripts": {
"build": "babel --source-maps -D -d lib src",
"prepublish": "npm run build"
"copyfiles": "node ../../scripts/copyfiles.js",
"build": "tsc && yarn copyfiles",
"prepublish": "yarn build"
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-preset-es2015": "^6.24.1"
"dependencies": {
"liferay-npm-build-tools-common": "2.6.3-alpha.126+f9a8cd2"
},
"dependencies": {
"liferay-npm-build-tools-common": "2.6.2"
}
"gitHead": "f9a8cd23c70ecc6fff238bea906286c1c6cb2ecc"
}

@@ -0,1 +1,7 @@

/**
* © 2017 Liferay, Inc. <https://liferay.com>
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
import PluginLogger from 'liferay-npm-build-tools-common/lib/plugin-logger';

@@ -23,3 +29,3 @@ import plugin from '../index';

imports: {
'provider': {
provider: {
'pkg-a': '^1.0.0',

@@ -89,3 +95,3 @@ 'pkg-b': '^2.0.0',

imports: {
'provider': {
provider: {
'pkg-a': '^1.0.0',

@@ -92,0 +98,0 @@ 'pkg-b': '^3.0.0',

@@ -0,1 +1,7 @@

/**
* © 2017 Liferay, Inc. <https://liferay.com>
*
* SPDX-License-Identifier: LGPL-3.0-or-later
*/
import * as ns from 'liferay-npm-build-tools-common/lib/namespace';

@@ -7,6 +13,3 @@ import {normalizeImportsConfig} from 'liferay-npm-build-tools-common/lib/imports';

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

@@ -13,0 +16,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