File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,13 +6,13 @@ import {
66 arboristClassPath ,
77 arboristEdgeClassPath ,
88 arboristNodeClassPath ,
9- arboristOverrideSetClassPatch
9+ arboristOverrideSetClassPath
1010} from '../npm-paths'
1111
1212export function installSafeArborist ( ) {
1313 const cache : { [ key : string ] : any } = require . cache
1414 cache [ arboristClassPath ] = { exports : SafeArborist }
1515 cache [ arboristEdgeClassPath ] = { exports : SafeEdge }
1616 cache [ arboristNodeClassPath ] = { exports : SafeNode }
17- cache [ arboristOverrideSetClassPatch ] = { exports : SafeOverrideSet }
17+ cache [ arboristOverrideSetClassPath ] = { exports : SafeOverrideSet }
1818}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import npa from 'npm-package-arg'
22import semver from 'semver'
33
44import constants from '../../../constants'
5- import { arboristOverrideSetClassPatch } from '../../npm-paths'
5+ import { arboristOverrideSetClassPath } from '../../npm-paths'
66import { getLogger } from '../../proc-log'
77
88import type { SafeEdge } from './edge'
@@ -31,7 +31,7 @@ interface OverrideSetClass {
3131 isEqual ( otherOverrideSet : SafeOverrideSet | undefined ) : boolean
3232}
3333
34- const OverrideSet : OverrideSetClass = require ( arboristOverrideSetClassPatch )
34+ const OverrideSet : OverrideSetClass = require ( arboristOverrideSetClassPath )
3535
3636// Implementation code not related to patch https://github.com/npm/cli/pull/7025
3737// is based on https://github.com/npm/cli/blob/v11.0.0/workspaces/arborist/lib/override-set.js:
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import path from 'node:path'
44import constants from '../constants'
55import { findRoot } from '../utils/path-resolve'
66
7- const { SOCKET_CLI_ISSUES_URL } = constants
7+ const { NODE_MODULES , SOCKET_CLI_ISSUES_URL } = constants
88
99const npmEntrypoint = realpathSync ( process . argv [ 1 ] ! )
1010const npmRootPath = findRoot ( path . dirname ( npmEntrypoint ) )
@@ -21,7 +21,7 @@ Please report to ${SOCKET_CLI_ISSUES_URL}.`
2121 process . exit ( 127 )
2222}
2323
24- export const npmNmPath = path . join ( npmRootPath , 'node_modules' )
24+ export const npmNmPath = path . join ( npmRootPath , NODE_MODULES )
2525export const arboristPkgPath = path . join ( npmNmPath , '@npmcli/arborist' )
2626export const arboristClassPath = path . join (
2727 arboristPkgPath ,
@@ -33,7 +33,8 @@ export const arboristDepValidPath = path.join(
3333)
3434export const arboristEdgeClassPath = path . join ( arboristPkgPath , 'lib/edge.js' )
3535export const arboristNodeClassPath = path . join ( arboristPkgPath , 'lib/node.js' )
36- export const arboristOverrideSetClassPatch = path . join (
36+ export const arboristOverrideSetClassPath = path . join (
3737 arboristPkgPath ,
3838 'lib/override-set.js'
3939)
40+ export const pacotePath = path . join ( npmNmPath , 'pacote' )
You can’t perform that action at this time.
0 commit comments