liferay-npm-build-tools-common
Advanced tools
Comparing version 1.2.1 to 1.2.2
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
value: true | ||
}); | ||
@@ -28,3 +28,3 @@ exports.getPackageJsonPath = getPackageJsonPath; | ||
function getPackageJsonPath(modulePath) { | ||
return _path2.default.join(getPackageDir(modulePath), 'package.json'); | ||
return _path2.default.join(getPackageDir(modulePath), 'package.json'); | ||
} | ||
@@ -39,29 +39,29 @@ | ||
function getPackageDir(modulePath) { | ||
var absModulePath = _path2.default.resolve(modulePath); | ||
var dir = packageDirCache[absModulePath]; | ||
var absModulePath = _path2.default.resolve(modulePath); | ||
var dir = packageDirCache[absModulePath]; | ||
if (!dir) { | ||
dir = absModulePath; | ||
var found = false; | ||
if (!dir) { | ||
dir = absModulePath; | ||
var found = false; | ||
while (!found) { | ||
try { | ||
_fs2.default.statSync(_path2.default.join(dir, 'package.json')); | ||
found = true; | ||
} catch (err) { | ||
var dirname = _path2.default.dirname(dir); | ||
while (!found) { | ||
try { | ||
_fs2.default.statSync(_path2.default.join(dir, 'package.json')); | ||
found = true; | ||
} catch (err) { | ||
var dirname = _path2.default.dirname(dir); | ||
if (dirname == dir) { | ||
throw new Error('Cannot find package.json for file: ' + modulePath); | ||
} | ||
if (dirname == dir) { | ||
throw new Error('Cannot find package.json for file: ' + modulePath); | ||
} | ||
dir = dirname; | ||
} | ||
} | ||
dir = dirname; | ||
} | ||
} | ||
packageDirCache[absModulePath] = dir; | ||
} | ||
packageDirCache[absModulePath] = dir; | ||
} | ||
return dir; | ||
return dir; | ||
} | ||
//# sourceMappingURL=packages.js.map |
{ | ||
"name": "liferay-npm-build-tools-common", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Utility library for Liferay NPM Build Tools.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -13,3 +13,3 @@ import fs from 'fs'; | ||
export function getPackageJsonPath(modulePath) { | ||
return path.join(getPackageDir(modulePath), 'package.json'); | ||
return path.join(getPackageDir(modulePath), 'package.json'); | ||
} | ||
@@ -24,30 +24,28 @@ | ||
export function getPackageDir(modulePath) { | ||
let absModulePath = path.resolve(modulePath); | ||
let dir = packageDirCache[absModulePath]; | ||
let absModulePath = path.resolve(modulePath); | ||
let dir = packageDirCache[absModulePath]; | ||
if (!dir) { | ||
dir = absModulePath; | ||
let found = false; | ||
if (!dir) { | ||
dir = absModulePath; | ||
let found = false; | ||
while (!found) { | ||
try { | ||
fs.statSync(path.join(dir, 'package.json')); | ||
found = true; | ||
} catch (err) { | ||
const dirname = path.dirname(dir); | ||
while (!found) { | ||
try { | ||
fs.statSync(path.join(dir, 'package.json')); | ||
found = true; | ||
} catch (err) { | ||
const dirname = path.dirname(dir); | ||
if (dirname == dir) { | ||
throw new Error( | ||
'Cannot find package.json for file: ' + modulePath, | ||
); | ||
} | ||
if (dirname == dir) { | ||
throw new Error('Cannot find package.json for file: ' + modulePath); | ||
} | ||
dir = dirname; | ||
} | ||
} | ||
dir = dirname; | ||
} | ||
} | ||
packageDirCache[absModulePath] = dir; | ||
} | ||
packageDirCache[absModulePath] = dir; | ||
} | ||
return dir; | ||
return dir; | ||
} |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
3
0
5780
5
89