File tree Expand file tree Collapse file tree 5 files changed +19
-19
lines changed
code/core/src/common/js-package-manager Expand file tree Collapse file tree 5 files changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -87,12 +87,12 @@ export class BUNProxy extends JsPackageManager {
8787 return `bunx ${ pkg } ${ specifier ? `@${ specifier } ` : '' } ${ args . join ( ' ' ) } ` ;
8888 }
8989
90- public async getModulePackageJSON (
91- packageName : string ,
92- cwd = this . cwd
93- ) : Promise < PackageJson | null > {
90+ public async getModulePackageJSON ( packageName : string ) : Promise < PackageJson | null > {
9491 const wantedPath = join ( 'node_modules' , packageName , 'package.json' ) ;
95- const packageJsonPath = find . up ( wantedPath , { cwd, last : getProjectRoot ( ) } ) ;
92+ const packageJsonPath = find . up ( wantedPath , {
93+ cwd : this . primaryPackageJson . operationDir ,
94+ last : getProjectRoot ( ) ,
95+ } ) ;
9696
9797 if ( ! packageJsonPath ) {
9898 return null ;
Original file line number Diff line number Diff line change @@ -76,9 +76,12 @@ export class NPMProxy extends JsPackageManager {
7676 return `npm run ${ command } ` ;
7777 }
7878
79- async getModulePackageJSON ( packageName : string , cwd = this . cwd ) : Promise < PackageJson | null > {
79+ async getModulePackageJSON ( packageName : string ) : Promise < PackageJson | null > {
8080 const wantedPath = join ( 'node_modules' , packageName , 'package.json' ) ;
81- const packageJsonPath = find . up ( wantedPath , { cwd, last : getProjectRoot ( ) } ) ;
81+ const packageJsonPath = find . up ( wantedPath , {
82+ cwd : this . primaryPackageJson . operationDir ,
83+ last : getProjectRoot ( ) ,
84+ } ) ;
8285
8386 if ( ! packageJsonPath ) {
8487 return null ;
Original file line number Diff line number Diff line change @@ -127,12 +127,9 @@ export class PNPMProxy extends JsPackageManager {
127127 }
128128
129129 // TODO: Remove pnp compatibility code in SB11
130- public async getModulePackageJSON (
131- packageName : string ,
132- cwd = this . cwd
133- ) : Promise < PackageJson | null > {
130+ public async getModulePackageJSON ( packageName : string ) : Promise < PackageJson | null > {
134131 const pnpapiPath = find . any ( [ '.pnp.js' , '.pnp.cjs' ] , {
135- cwd,
132+ cwd : this . primaryPackageJson . operationDir ,
136133 last : getProjectRoot ( ) ,
137134 } ) ;
138135
Original file line number Diff line number Diff line change @@ -76,12 +76,12 @@ export class Yarn1Proxy extends JsPackageManager {
7676 } ) ;
7777 }
7878
79- public async getModulePackageJSON (
80- packageName : string ,
81- cwd = this . cwd
82- ) : Promise < PackageJson | null > {
79+ public async getModulePackageJSON ( packageName : string ) : Promise < PackageJson | null > {
8380 const wantedPath = join ( 'node_modules' , packageName , 'package.json' ) ;
84- const packageJsonPath = find . up ( wantedPath , { cwd, last : getProjectRoot ( ) } ) ;
81+ const packageJsonPath = find . up ( wantedPath , {
82+ cwd : this . primaryPackageJson . operationDir ,
83+ last : getProjectRoot ( ) ,
84+ } ) ;
8585
8686 if ( ! packageJsonPath ) {
8787 return null ;
Original file line number Diff line number Diff line change @@ -146,9 +146,9 @@ export class Yarn2Proxy extends JsPackageManager {
146146 }
147147
148148 // TODO: Remove pnp compatibility code in SB11
149- async getModulePackageJSON ( packageName : string , cwd = this . cwd ) : Promise < PackageJson | null > {
149+ async getModulePackageJSON ( packageName : string ) : Promise < PackageJson | null > {
150150 const pnpapiPath = find . any ( [ '.pnp.js' , '.pnp.cjs' ] , {
151- cwd,
151+ cwd : this . primaryPackageJson . operationDir ,
152152 last : getProjectRoot ( ) ,
153153 } ) ;
154154
You can’t perform that action at this time.
0 commit comments