Skip to content

Commit 0f80cb0

Browse files
committed
Fix arboristOverrideSetClassPath typo
1 parent 6c4df42 commit 0f80cb0

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/shadow/arborist/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import {
66
arboristClassPath,
77
arboristEdgeClassPath,
88
arboristNodeClassPath,
9-
arboristOverrideSetClassPatch
9+
arboristOverrideSetClassPath
1010
} from '../npm-paths'
1111

1212
export 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
}

src/shadow/arborist/lib/override-set.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import npa from 'npm-package-arg'
22
import semver from 'semver'
33

44
import constants from '../../../constants'
5-
import { arboristOverrideSetClassPatch } from '../../npm-paths'
5+
import { arboristOverrideSetClassPath } from '../../npm-paths'
66
import { getLogger } from '../../proc-log'
77

88
import 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:

src/shadow/npm-paths.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import path from 'node:path'
44
import constants from '../constants'
55
import { findRoot } from '../utils/path-resolve'
66

7-
const { SOCKET_CLI_ISSUES_URL } = constants
7+
const { NODE_MODULES, SOCKET_CLI_ISSUES_URL } = constants
88

99
const npmEntrypoint = realpathSync(process.argv[1]!)
1010
const 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)
2525
export const arboristPkgPath = path.join(npmNmPath, '@npmcli/arborist')
2626
export const arboristClassPath = path.join(
2727
arboristPkgPath,
@@ -33,7 +33,8 @@ export const arboristDepValidPath = path.join(
3333
)
3434
export const arboristEdgeClassPath = path.join(arboristPkgPath, 'lib/edge.js')
3535
export 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')

0 commit comments

Comments
 (0)