Skip to content

Commit 4eb5293

Browse files
Bump read-pkg-up from 4.0.0 to 7.0.1 (#244)
* Bump read-pkg-up from 4.0.0 to 7.0.1 Bumps [read-pkg-up](https://github.com/sindresorhus/read-pkg-up) from 4.0.0 to 7.0.1. - [Release notes](https://github.com/sindresorhus/read-pkg-up/releases) - [Commits](sindresorhus/read-package-up@v4.0.0...v7.0.1) Signed-off-by: dependabot-preview[bot] <[email protected]> * [INTERNAL] Update usage of read-pkg-up Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Matthias Osswald <[email protected]>
1 parent 8e4a380 commit 4eb5293

File tree

3 files changed

+51
-27
lines changed

3 files changed

+51
-27
lines changed

lib/translators/npm.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,8 @@ class NpmTranslator {
286286
return readPkgUp({
287287
cwd: path.dirname(basePath)
288288
}).then((result) => {
289-
if (result.pkg) {
290-
const pkg = result.pkg;
289+
if (result && result.packageJson) {
290+
const pkg = result.packageJson;
291291

292292
// As of today, collections only exist in shims
293293
this.shimCollection(pkg.name, pkg);
@@ -397,14 +397,16 @@ class NpmTranslator {
397397
return readPkgUp({
398398
cwd: dirPath
399399
}).then((result) => {
400-
if (!result.pkg) {
400+
if (!result || !result.packageJson) {
401401
throw new Error(
402402
`[npm translator] Failed to locate package.json for directory "${path.resolve(dirPath)}"`);
403403
}
404-
result.name = result.pkg.name;
405-
// resolved path points to the package.json, but we want just the folder path
406-
result.path = path.dirname(result.path);
407-
return result;
404+
return {
405+
// resolved path points to the package.json, but we want just the folder path
406+
path: path.dirname(result.path),
407+
name: result.packageJson.name,
408+
pkg: result.packageJson
409+
};
408410
}).then(this.processPkg.bind(this)).then((tree) => {
409411
if (this.projectsWoUi5Deps.length) {
410412
log.verbose(

package-lock.json

Lines changed: 41 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
"pacote": "^11.1.4",
114114
"pretty-hrtime": "^1.0.3",
115115
"read-pkg": "^5.2.0",
116-
"read-pkg-up": "^4.0.0",
116+
"read-pkg-up": "^7.0.1",
117117
"resolve": "^1.15.1",
118118
"string.prototype.matchall": "^4.0.2"
119119
},

0 commit comments

Comments
 (0)