@@ -12,18 +12,26 @@ import {
1212import { confirm } from '@socketsecurity/registry/lib/prompts'
1313import { Spinner } from '@socketsecurity/registry/lib/spinner'
1414
15- import { batchScan , isAlertFixable , isAlertFixableCve , walk } from './alerts'
1615import { kCtorArgs , kRiskyReify } from './index'
16+ import { walk } from './walk'
1717import constants from '../../../../constants'
1818import { uxLookup } from '../../../../utils/alert/rules'
19+ import {
20+ batchScan ,
21+ isAlertFixable ,
22+ isAlertFixableCve
23+ } from '../../../../utils/alert/scan'
1924import { ColorOrMarkdown } from '../../../../utils/color-or-markdown'
2025import { debugLog } from '../../../../utils/debug'
2126import { getSocketDevPackageOverviewUrl } from '../../../../utils/socket-url'
2227import { pacotePath } from '../../../npm-paths'
2328import { Edge , SafeEdge } from '../edge'
2429
25- import type { InstallEffect , SocketArtifact } from './alerts'
2630import type { ArboristClass , AuditAdvisory , SafeArborist } from './index'
31+ import type {
32+ InstallEffect ,
33+ SocketScanArtifact
34+ } from '../../../../utils/alert/scan'
2735import type { SafeNode } from '../node'
2836import type { Writable } from 'node:stream'
2937
@@ -163,7 +171,7 @@ async function getPackagesAlerts(
163171 p . existing ?. startsWith ( `${ name } @` )
164172 ) ?. existing
165173 if ( existing ) {
166- const oldArtifact : SocketArtifact | undefined =
174+ const oldArtifact : SocketScanArtifact | undefined =
167175 // eslint-disable-next-line no-await-in-loop
168176 ( await batchScan ( [ existing ] ) . next ( ) ) . value
169177 if ( oldArtifact ?. alerts ?. length ) {
@@ -364,7 +372,7 @@ export async function reify(
364372 this : SafeArborist ,
365373 ...args : Parameters < InstanceType < ArboristClass > [ 'reify' ] >
366374) : Promise < SafeNode > {
367- const needInfoOn = await walk ( this . diff )
375+ const needInfoOn = walk ( this . diff )
368376 if (
369377 ! needInfoOn . length ||
370378 needInfoOn . findIndex ( c => c . repository_url === NPM_REGISTRY_URL ) === - 1
@@ -421,13 +429,9 @@ export async function reify(
421429 ret = await this [ kRiskyReify ] ( ...args )
422430 await this . loadActual ( )
423431 await this . buildIdealTree ( )
424- alerts = await getPackagesAlerts (
425- this ,
426- await walk ( this . diff , { fix : true } ) ,
427- {
428- fixable : true
429- }
430- )
432+ alerts = await getPackagesAlerts ( this , walk ( this . diff , { fix : true } ) , {
433+ fixable : true
434+ } )
431435 alerts = alerts . filter ( a => {
432436 const { key } = a
433437 if ( prev . has ( key ) ) {
0 commit comments