File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 1
1
import { join , dirname } from 'path' ;
2
- import { promisify } from 'util' ;
3
2
4
- import readPackageJson from 'read- package-json' ;
3
+ import PackageJson from '@npmcli/ package-json' ;
5
4
import stripAnsi from 'strip-ansi' ;
6
5
import which from 'which' ;
7
6
8
- const readPackage = promisify ( readPackageJson ) ;
9
-
10
7
import { createOptions } from '../create-options.js' ;
11
8
import { spawn } from '../spawn.js' ;
12
9
import { timeout } from '../timeout.js' ;
@@ -32,7 +29,8 @@ export async function test(packageManager, context) {
32
29
) ;
33
30
let data ;
34
31
try {
35
- data = await readPackage ( join ( wd , 'package.json' ) , false ) ;
32
+ const pkg = await PackageJson . load ( wd ) ;
33
+ data = pkg . content ;
36
34
// Explicitly set the version to the value in the downloaded package.json.
37
35
context . module . version = data . version ;
38
36
} catch {
Original file line number Diff line number Diff line change 34
34
},
35
35
"license" : " MIT" ,
36
36
"dependencies" : {
37
+ "@npmcli/package-json" : " ^7.0.0" ,
37
38
"async" : " ^3.2.6" ,
38
39
"bl" : " ^6.0.16" ,
39
40
"chalk" : " ^5.4.0" ,
44
45
"npm-package-arg" : " ^12.0.1" ,
45
46
"npm-which" : " ^3.0.1" ,
46
47
"pnpm" : " ^9.15.1" ,
47
- "read-package-json" : " ^7.0.1" ,
48
48
"root-check" : " ^2.0.0" ,
49
49
"semver" : " ^7.6.3" ,
50
50
"strip-ansi" : " ^7.1.0" ,
You can’t perform that action at this time.
0 commit comments