babel-plugin-alias-modules
Advanced tools
Comparing version 2.19.3 to 2.19.4
"use strict"; | ||
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-FileCopyrightText: © 2020 Liferay, Inc. <https://liferay.com> | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
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; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
@@ -18,2 +29,3 @@ }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Visitor = void 0; | ||
const alias_1 = require("liferay-npm-build-tools-common/lib/alias"); | ||
@@ -90,3 +102,3 @@ const babelIpc = __importStar(require("liferay-npm-build-tools-common/lib/babel-ipc")); | ||
_resolve(requiredModuleName) { | ||
const { _absRootDir, _absFile, _aliasFields, _log } = this; | ||
const { _absFile, _absRootDir, _aliasFields, _log } = this; | ||
// Fail for absolute path modules | ||
@@ -93,0 +105,0 @@ if (requiredModuleName.startsWith('/')) { |
{ | ||
"name": "babel-plugin-alias-modules", | ||
"version": "2.19.3", | ||
"author": "Liferay Frontend Infrastructure Team <pt-frontend-infrastructure@liferay.com>", | ||
"dependencies": { | ||
"liferay-npm-build-tools-common": "2.19.4" | ||
}, | ||
"description": "A Babel plugin to rewrite aliased require() calls.", | ||
"main": "lib/index.js", | ||
"name": "babel-plugin-alias-modules", | ||
"repository": { | ||
"directory": "maintenance/projects/js-toolkit/packages/babel-plugin-alias-modules", | ||
"type": "git", | ||
"url": "https://github.com/liferay/liferay-frontend-projects.git" | ||
}, | ||
"scripts": { | ||
"build": "tsc && yarn copyfiles", | ||
"copyfiles": "node ../../scripts/copyfiles.js", | ||
"build": "tsc && yarn copyfiles", | ||
"prepublish": "yarn build" | ||
}, | ||
"dependencies": { | ||
"liferay-npm-build-tools-common": "2.19.3" | ||
}, | ||
"gitHead": "e64d58bad216574b5abf459929857588b3b7bfbf" | ||
"version": "2.19.4", | ||
"gitHead": "d341f385c91a7d50168a6ce8be978d2f03f6bedc" | ||
} |
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-FileCopyrightText: © 2020 Liferay, Inc. <https://liferay.com> | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
*/ | ||
import path from 'path'; | ||
import * as babelIpc from 'liferay-npm-build-tools-common/lib/babel-ipc'; | ||
import FilePath from 'liferay-npm-build-tools-common/lib/file-path'; | ||
import PluginLogger from 'liferay-npm-build-tools-common/lib/plugin-logger'; | ||
import path from 'path'; | ||
@@ -12,0 +11,0 @@ import {Visitor} from '../index'; |
/** | ||
* © 2017 Liferay, Inc. <https://liferay.com> | ||
* | ||
* SPDX-FileCopyrightText: © 2020 Liferay, Inc. <https://liferay.com> | ||
* SPDX-License-Identifier: LGPL-3.0-or-later | ||
@@ -8,2 +7,3 @@ */ | ||
import { | ||
AliasToType, | ||
AliasToValue, | ||
@@ -13,3 +13,2 @@ getAliasFields, | ||
loadAliases, | ||
AliasToType, | ||
} from 'liferay-npm-build-tools-common/lib/alias'; | ||
@@ -30,3 +29,3 @@ import {BabelIpcObject} from 'liferay-npm-build-tools-common/lib/api/plugins'; | ||
*/ | ||
export default function({types}) { | ||
export default function ({types}) { | ||
t = types; | ||
@@ -117,5 +116,6 @@ | ||
_resolve(requiredModuleName: string): AliasToValue { | ||
const {_absRootDir, _absFile, _aliasFields, _log} = this; | ||
const {_absFile, _absRootDir, _aliasFields, _log} = this; | ||
// Fail for absolute path modules | ||
if (requiredModuleName.startsWith('/')) { | ||
@@ -138,2 +138,3 @@ _log.error( | ||
// First look in file directory (without recursion) | ||
alias = this._getAliasForLocal( | ||
@@ -146,2 +147,3 @@ absFileDir, | ||
// Then, if not found, recursively from target module up | ||
if (alias === undefined) { | ||
@@ -199,2 +201,3 @@ const moduleDir = absFileDir.join(requiredModule.dirname()); | ||
// Try with file alias | ||
if ( | ||
@@ -208,2 +211,3 @@ alias === undefined && | ||
// Try with external module aliases | ||
if (alias === undefined) { | ||
@@ -214,2 +218,3 @@ alias = aliases[searchRelModuleName.asPosix]; | ||
// Found: return it | ||
if (alias !== undefined) { | ||
@@ -220,2 +225,3 @@ return alias; | ||
// Search finished | ||
if (absSearchDir.is(absSearchTopDir)) { | ||
@@ -226,2 +232,3 @@ return undefined; | ||
// Look up in hierachy | ||
alias = this._getAliasForLocal( | ||
@@ -234,2 +241,3 @@ absSearchTopDir, | ||
// Rebase to current folder | ||
if ( | ||
@@ -267,2 +275,3 @@ alias !== undefined && | ||
// Found: return it | ||
if (alias !== undefined) { | ||
@@ -273,2 +282,3 @@ return alias; | ||
// Search finished | ||
if (absSearchDir.is(_absRootDir)) { | ||
@@ -279,2 +289,3 @@ return undefined; | ||
// Look up in hierachy | ||
alias = this._getAliasForExternal( | ||
@@ -286,2 +297,3 @@ absSearchDir.dirname(), | ||
// Rebase to current folder | ||
if ( | ||
@@ -288,0 +300,0 @@ alias !== undefined && |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
2
724
1
0
25232
12
+ Addedbabel-plugin-add-module-metadata@2.19.4(transitive)
+ Addedbabel-plugin-name-amd-modules@2.19.4(transitive)
+ Addedbabel-plugin-namespace-amd-define@2.19.4(transitive)
+ Addedbabel-plugin-namespace-modules@2.19.4(transitive)
+ Addedbabel-plugin-normalize-requires@2.19.4(transitive)
+ Addedbabel-plugin-wrap-modules-amd@2.19.4(transitive)
+ Addedbabel-preset-liferay-standard@2.19.4(transitive)
+ Addedliferay-npm-build-tools-common@2.19.4(transitive)
+ Addedliferay-npm-bundler-plugin-exclude-imports@2.19.4(transitive)
+ Addedliferay-npm-bundler-plugin-inject-imports-dependencies@2.19.4(transitive)
+ Addedliferay-npm-bundler-plugin-inject-peer-dependencies@2.19.4(transitive)
+ Addedliferay-npm-bundler-plugin-namespace-packages@2.19.4(transitive)
+ Addedliferay-npm-bundler-plugin-replace-browser-modules@2.19.4(transitive)
+ Addedliferay-npm-bundler-plugin-resolve-linked-dependencies@2.19.4(transitive)
+ Addedliferay-npm-bundler-preset-standard@2.19.4(transitive)
- Removedbabel-plugin-add-module-metadata@2.19.3(transitive)
- Removedbabel-plugin-name-amd-modules@2.19.3(transitive)
- Removedbabel-plugin-namespace-amd-define@2.19.3(transitive)
- Removedbabel-plugin-namespace-modules@2.19.3(transitive)
- Removedbabel-plugin-normalize-requires@2.19.3(transitive)
- Removedbabel-plugin-wrap-modules-amd@2.19.3(transitive)
- Removedbabel-preset-liferay-standard@2.19.3(transitive)
- Removedliferay-npm-build-tools-common@2.19.3(transitive)
- Removedliferay-npm-bundler-plugin-exclude-imports@2.19.3(transitive)
- Removedliferay-npm-bundler-plugin-inject-imports-dependencies@2.19.3(transitive)
- Removedliferay-npm-bundler-plugin-inject-peer-dependencies@2.19.3(transitive)
- Removedliferay-npm-bundler-plugin-namespace-packages@2.19.3(transitive)
- Removedliferay-npm-bundler-plugin-replace-browser-modules@2.19.3(transitive)
- Removedliferay-npm-bundler-plugin-resolve-linked-dependencies@2.19.3(transitive)
- Removedliferay-npm-bundler-preset-standard@2.19.3(transitive)