File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { join , dirname } from 'path' ;
2- import { promisify } from 'util' ;
32
4- import readPackageJson from 'read- package-json' ;
3+ import PackageJson from '@npmcli/ package-json' ;
54import stripAnsi from 'strip-ansi' ;
65import which from 'which' ;
76
8- const readPackage = promisify ( readPackageJson ) ;
9-
107import { createOptions } from '../create-options.js' ;
118import { spawn } from '../spawn.js' ;
129import { timeout } from '../timeout.js' ;
@@ -32,7 +29,8 @@ export async function test(packageManager, context) {
3229 ) ;
3330 let data ;
3431 try {
35- data = await readPackage ( join ( wd , 'package.json' ) , false ) ;
32+ const pkg = await PackageJson . load ( wd ) ;
33+ data = pkg . content ;
3634 // Explicitly set the version to the value in the downloaded package.json.
3735 context . module . version = data . version ;
3836 } catch {
Original file line number Diff line number Diff line change 3434 },
3535 "license" : " MIT" ,
3636 "dependencies" : {
37+ "@npmcli/package-json" : " ^7.0.0" ,
3738 "async" : " ^3.2.6" ,
3839 "bl" : " ^6.0.16" ,
3940 "chalk" : " ^5.4.0" ,
4445 "npm-package-arg" : " ^12.0.1" ,
4546 "npm-which" : " ^3.0.1" ,
4647 "pnpm" : " ^9.15.1" ,
47- "read-package-json" : " ^7.0.1" ,
4848 "root-check" : " ^2.0.0" ,
4949 "semver" : " ^7.6.3" ,
5050 "strip-ansi" : " ^7.1.0" ,
You can’t perform that action at this time.
0 commit comments