@@ -239,7 +239,6 @@ type SocketPackageAlert = {
239
239
240
240
interface KnownModules {
241
241
npmlog : typeof import ( 'npmlog' )
242
- pacote : typeof import ( 'pacote' )
243
242
'proc-log' : typeof import ( 'proc-log' )
244
243
}
245
244
@@ -321,18 +320,10 @@ const log = tryRequire(
321
320
< 'npmlog' > path . join ( npmNmPath , 'npmlog/lib/log.js' )
322
321
)
323
322
324
- if ( log === undefined ) {
325
- console . error (
326
- `Unable to integrate with npm CLI logging infrastructure.\n\n${ POTENTIAL_BUG_ERROR_MESSAGE } .`
327
- )
328
- // The exit code 127 indicates that the command or binary being executed
329
- // could not be found.
330
- process . exit ( 127 )
331
- }
332
-
333
- const pacote = tryRequire ( < 'pacote' > path . join ( npmNmPath , 'pacote' ) , 'pacote' ) !
334
- const { tarball } = pacote
335
- const translations = require ( path . join ( rootPath , 'translations.json' ) )
323
+ const pacote : typeof import ( 'pacote' ) = require ( path . join ( npmNmPath , 'pacote' ) )
324
+ const translations : typeof import ( '../../translations.json' ) = require (
325
+ path . join ( rootPath , 'translations.json' )
326
+ )
336
327
337
328
const Arborist : ArboristClass = require ( arboristClassPath )
338
329
const depValid : (
@@ -475,7 +466,7 @@ function findSpecificOverrideSet(
475
466
overrideSet = overrideSet . parent
476
467
}
477
468
// The override sets are incomparable. Neither one contains the other.
478
- log ! . silly ( 'Conflicting override sets' , first , second )
469
+ log ? .silly ( 'Conflicting override sets' , first , second )
479
470
return undefined
480
471
}
481
472
@@ -571,7 +562,7 @@ async function getPackagesAlerts(
571
562
if ( ! blocked ) {
572
563
const pkg = pkgs . find ( p => p . pkgid === id )
573
564
if ( pkg ) {
574
- await tarball . stream (
565
+ await pacote . tarball . stream (
575
566
id ,
576
567
stream => {
577
568
stream . resume ( )
@@ -590,7 +581,7 @@ async function getPackagesAlerts(
590
581
for ( const alert of alerts ) {
591
582
// Based data from { pageProps: { alertTypes } } of:
592
583
// https://socket.dev/_next/data/94666139314b6437ee4491a0864e72b264547585/en-US.json
593
- const info = translations . alerts [ alert . type ]
584
+ const info = ( translations . alerts as any ) [ alert . type ]
594
585
const title = info ?. title ?? alert . type
595
586
const attributes = [
596
587
...( alert . fixable ? [ 'fixable' ] : [ ] ) ,
@@ -1208,7 +1199,7 @@ class SafeNode extends Node {
1208
1199
}
1209
1200
// This is an error condition. We can only get here if the new override set
1210
1201
// is in conflict with the existing.
1211
- log ! . silly ( 'Conflicting override sets' , this . name )
1202
+ log ? .silly ( 'Conflicting override sets' , this . name )
1212
1203
return false
1213
1204
}
1214
1205
0 commit comments