File tree Expand file tree Collapse file tree 3 files changed +51
-27
lines changed Expand file tree Collapse file tree 3 files changed +51
-27
lines changed Original file line number Diff line number Diff line change @@ -286,8 +286,8 @@ class NpmTranslator {
286
286
return readPkgUp ( {
287
287
cwd : path . dirname ( basePath )
288
288
} ) . then ( ( result ) => {
289
- if ( result . pkg ) {
290
- const pkg = result . pkg ;
289
+ if ( result && result . packageJson ) {
290
+ const pkg = result . packageJson ;
291
291
292
292
// As of today, collections only exist in shims
293
293
this . shimCollection ( pkg . name , pkg ) ;
@@ -397,14 +397,16 @@ class NpmTranslator {
397
397
return readPkgUp ( {
398
398
cwd : dirPath
399
399
} ) . then ( ( result ) => {
400
- if ( ! result . pkg ) {
400
+ if ( ! result || ! result . packageJson ) {
401
401
throw new Error (
402
402
`[npm translator] Failed to locate package.json for directory "${ path . resolve ( dirPath ) } "` ) ;
403
403
}
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
+ } ;
408
410
} ) . then ( this . processPkg . bind ( this ) ) . then ( ( tree ) => {
409
411
if ( this . projectsWoUi5Deps . length ) {
410
412
log . verbose (
Original file line number Diff line number Diff line change 113
113
"pacote" : " ^11.1.4" ,
114
114
"pretty-hrtime" : " ^1.0.3" ,
115
115
"read-pkg" : " ^5.2.0" ,
116
- "read-pkg-up" : " ^4 .0.0 " ,
116
+ "read-pkg-up" : " ^7 .0.1 " ,
117
117
"resolve" : " ^1.15.1" ,
118
118
"string.prototype.matchall" : " ^4.0.2"
119
119
},
You can’t perform that action at this time.
0 commit comments