@@ -220,8 +220,8 @@ type Conf = {config: {get: (key: string) => string | undefined}};
220220let conf : Conf | undefined ;
221221let rat : typeof registryAuthToken | undefined ;
222222
223- async function getRegistry ( scope ?: string ) : Promise < string > {
224- if ( ! conf ) conf = ( await import ( "@pnpm/npm-conf" ) ) . default ( ) ;
223+ function getRegistry ( scope ?: string ) : string {
224+ if ( ! conf ) conf = require ( "@pnpm/npm-conf" ) ( ) ; // eslint-disable-line @typescript-eslint/no-require-imports -- workaround bun bug with import()
225225
226226 let url : string | undefined ;
227227 if ( scope ) {
@@ -240,7 +240,7 @@ async function getAuthAndRegistry(name: string, registry: string): Promise<AuthA
240240 return { auth : rat ( registry , { recursive : true } ) , registry} ;
241241 } else {
242242 const scope = ( / @ [ a - z 0 - 9 ] [ \w - . ] + / . exec ( name ) || [ "" ] ) [ 0 ] ;
243- const url = normalizeUrl ( await getRegistry ( scope ) ) ;
243+ const url = normalizeUrl ( getRegistry ( scope ) ) ;
244244 if ( url !== registry ) {
245245 try {
246246 const newAuth = rat ( url , { recursive : true } ) ;
@@ -292,7 +292,7 @@ type PackageInfo = [Record<string, any>, string, string | null, string];
292292
293293async function fetchNpmInfo ( name : string , type : string , config : Config ) : Promise < PackageInfo > {
294294 const originalRegistry = normalizeUrl ( ( typeof args . registry === "string" ? args . registry : false ) ||
295- config . registry || ( await getRegistry ( ) ) ,
295+ config . registry || getRegistry ( ) ,
296296 ) ;
297297
298298 const { auth, registry} = await getAuthAndRegistry ( name , originalRegistry ) ;
0 commit comments