Socket
Socket
Sign inDemoInstall

liferay-npm-bundler-plugin-namespace-packages

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-namespace-packages - npm Package Compare versions

Comparing version 2.6.2 to 2.6.3-alpha.126

LICENSE.md

69

lib/index.js

@@ -1,38 +0,33 @@

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = function (_ref, _ref2) {
var pkg = _ref.pkg,
log = _ref.log,
rootPkgJson = _ref.rootPkgJson;
var pkgJson = _ref2.pkgJson;
if (!pkg.isRoot) {
pkgJson.name = ns.addNamespace(pkgJson.name, rootPkgJson);
log.info('namespace-packages', 'Namespaced package');
}
pkgJson.dependencies = pkgJson.dependencies || {};
Object.keys(pkgJson.dependencies).forEach(function (pkgName) {
var namespacedPkgName = ns.addNamespace(pkgName, rootPkgJson);
var version = pkgJson.dependencies[pkgName];
pkgJson.dependencies[namespacedPkgName] = version;
delete pkgJson.dependencies[pkgName];
});
log.info('namespace-packages', 'Namespaced', Object.keys(pkgJson.dependencies).length, 'dependencies');
"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);
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"));
/**
* @return {void}
*/
function default_1({ log, pkg, rootPkgJson }, { pkgJson }) {
if (!pkg.isRoot) {
pkgJson.name = ns.addNamespace(pkgJson.name, rootPkgJson);
log.info('namespace-packages', 'Namespaced package');
}
pkgJson.dependencies = pkgJson.dependencies || {};
Object.keys(pkgJson.dependencies).forEach(pkgName => {
const namespacedPkgName = ns.addNamespace(pkgName, rootPkgJson);
const version = pkgJson.dependencies[pkgName];
pkgJson.dependencies[namespacedPkgName] = version;
delete pkgJson.dependencies[pkgName];
});
log.info('namespace-packages', 'Namespaced', Object.keys(pkgJson.dependencies).length, 'dependencies');
}
exports.default = default_1;
{
"name": "liferay-npm-bundler-plugin-namespace-packages",
"version": "2.6.2",
"version": "2.6.3-alpha.126+f9a8cd2",
"description": "A liferay-npm-bundler plugin to namespace package names based on root project's name.",
"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",
"read-json-sync": "^2.0.0"
"read-json-sync": "^2.0.1"
},
"dependencies": {
"liferay-npm-build-tools-common": "2.6.2"
}
"liferay-npm-build-tools-common": "2.6.3-alpha.126+f9a8cd2"
},
"gitHead": "f9a8cd23c70ecc6fff238bea906286c1c6cb2ecc"
}
# liferay-npm-bundler-plugin-namespace-packages
> Namespace package names based on the root project's package name and version.
> This plugin prepends `<project-package-name>$` to each package name appearance
> in package.json files so that the packages are isolated per project and don't
> Namespace package names based on the root project's package name and version.
> This plugin prepends `<project-package-name>$` to each package name appearance
> in package.json files so that the packages are isolated per project and don't
> clash.

@@ -19,2 +19,3 @@

**Without options:**
```json

@@ -30,6 +31,6 @@ {

This plugins rewrites package names in `package.json` files to prepend the root
project's name to them.
This plugins rewrites package names in `package.json` files to prepend the root
project's name to them.
In case a module belongs to a scoped package, the root project's name is
In case a module belongs to a scoped package, the root project's name is
prepended to the scope name not including the `@`. So, for example,

@@ -39,13 +40,13 @@ `@a-scope/a-package` would be converted to `@my-project$a-scope/a-package`.

This plugin is normally used to sandbox dependencies of a whole project so that
they are not shared with any other project. This, of course, disables the
possibility of deduplication between different portlets, but leads to better
stability and predictability during runtime (specially when using peer
they are not shared with any other project. This, of course, disables the
possibility of deduplication between different projects, but leads to better
stability and predictability during runtime (specially when using peer
dependencies).
When this plugin is used you are guaranteed that you will get the same
When this plugin is used you are guaranteed that you will get the same
dependencies during runtime as during development.
Please note that, if you intend to use this plugin with `liferay-npm-bundler`,
you should also use its counterpart
`babel-plugin-namespace-modules` which namespaces modules inside AMD `define()`
Please note that, if you intend to use this plugin with `liferay-npm-bundler`,
you should also use its counterpart
`babel-plugin-namespace-modules` which namespaces modules inside AMD `define()`
and `require()` calls too.

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

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

@@ -2,0 +8,0 @@ import PluginLogger from 'liferay-npm-build-tools-common/lib/plugin-logger';

@@ -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';

@@ -6,3 +12,3 @@

*/
export default function({pkg, log, rootPkgJson}, {pkgJson}) {
export default function({log, pkg, rootPkgJson}, {pkgJson}) {
if (!pkg.isRoot) {

@@ -9,0 +15,0 @@ pkgJson.name = ns.addNamespace(pkgJson.name, rootPkgJson);

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