@socketsecurity/cli-with-sentry 0.14.85 → 0.14.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/instrument-with-sentry.js +2 -2
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/module-sync/cli.js +139 -97
- package/dist/module-sync/cli.js.map +1 -1
- package/dist/module-sync/shadow-npm-inject.js +14 -7
- package/dist/module-sync/shadow-npm-inject.js.map +1 -1
- package/dist/require/cli.js +139 -97
- package/dist/require/cli.js.map +1 -1
- package/package.json +1 -1
- package/dist/module-sync/fs.d.ts +0 -61
package/dist/require/cli.js
CHANGED
|
@@ -912,7 +912,7 @@ function emitBanner(name) {
|
|
|
912
912
|
logger.logger.error(getAsciiHeader(name))
|
|
913
913
|
}
|
|
914
914
|
function getAsciiHeader(command) {
|
|
915
|
-
const cliVersion = '0.14.
|
|
915
|
+
const cliVersion = '0.14.87:0330c30:e39f7589:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
|
|
916
916
|
const nodeVersion = process$1.version
|
|
917
917
|
const apiToken = shadowNpmInject.getDefaultToken()
|
|
918
918
|
const shownToken = apiToken ? getLastFiveOfApiToken(apiToken) : 'no'
|
|
@@ -3900,7 +3900,6 @@ async function npmFix(
|
|
|
3900
3900
|
const editablePkgJson = await packages.readPackageJson(cwd, {
|
|
3901
3901
|
editable: true
|
|
3902
3902
|
})
|
|
3903
|
-
const { content: pkgJson } = editablePkgJson
|
|
3904
3903
|
await arb.buildIdealTree()
|
|
3905
3904
|
for (const { 0: name, 1: infos } of infoByPkg) {
|
|
3906
3905
|
const hasUpgrade = !!registry.getManifestData(NPM$f, name)
|
|
@@ -3942,36 +3941,40 @@ async function npmFix(
|
|
|
3942
3941
|
continue
|
|
3943
3942
|
}
|
|
3944
3943
|
const oldSpec = `${name}@${oldVersion}`
|
|
3944
|
+
let targetVersion
|
|
3945
|
+
let failed = false
|
|
3946
|
+
let installed = false
|
|
3947
|
+
let saved = false
|
|
3945
3948
|
if (
|
|
3946
3949
|
shadowNpmInject.updateNode(node, packument, vulnerableVersionRange)
|
|
3947
3950
|
) {
|
|
3948
|
-
|
|
3951
|
+
targetVersion = node.package.version
|
|
3949
3952
|
const fixSpec = `${name}@^${targetVersion}`
|
|
3950
3953
|
const revertData = {
|
|
3951
|
-
...(
|
|
3954
|
+
...(editablePkgJson.content.dependencies
|
|
3952
3955
|
? {
|
|
3953
|
-
dependencies:
|
|
3956
|
+
dependencies: editablePkgJson.content.dependencies
|
|
3954
3957
|
}
|
|
3955
3958
|
: undefined),
|
|
3956
|
-
...(
|
|
3959
|
+
...(editablePkgJson.content.optionalDependencies
|
|
3957
3960
|
? {
|
|
3958
|
-
optionalDependencies:
|
|
3961
|
+
optionalDependencies:
|
|
3962
|
+
editablePkgJson.content.optionalDependencies
|
|
3959
3963
|
}
|
|
3960
3964
|
: undefined),
|
|
3961
|
-
...(
|
|
3965
|
+
...(editablePkgJson.content.peerDependencies
|
|
3962
3966
|
? {
|
|
3963
|
-
peerDependencies:
|
|
3967
|
+
peerDependencies: editablePkgJson.content.peerDependencies
|
|
3964
3968
|
}
|
|
3965
3969
|
: undefined)
|
|
3966
3970
|
}
|
|
3967
3971
|
spinner?.info(`Installing ${fixSpec}`)
|
|
3968
|
-
let saved = false
|
|
3969
|
-
let installed = false
|
|
3970
3972
|
try {
|
|
3971
3973
|
shadowNpmInject.updatePackageJsonFromNode(
|
|
3972
3974
|
editablePkgJson,
|
|
3973
3975
|
arb.idealTree,
|
|
3974
3976
|
node,
|
|
3977
|
+
targetVersion,
|
|
3975
3978
|
rangeStyle
|
|
3976
3979
|
)
|
|
3977
3980
|
// eslint-disable-next-line no-await-in-loop
|
|
@@ -3993,20 +3996,8 @@ async function npmFix(
|
|
|
3993
3996
|
}
|
|
3994
3997
|
spinner?.successAndStop(`Fixed ${name}`)
|
|
3995
3998
|
spinner?.start()
|
|
3996
|
-
// Lazily access constants.ENV[CI].
|
|
3997
|
-
if (constants.ENV[CI$1]) {
|
|
3998
|
-
// eslint-disable-next-line no-await-in-loop
|
|
3999
|
-
const prResponse = await openGitHubPullRequest(
|
|
4000
|
-
name,
|
|
4001
|
-
targetVersion,
|
|
4002
|
-
cwd
|
|
4003
|
-
)
|
|
4004
|
-
if (autoMerge) {
|
|
4005
|
-
// eslint-disable-next-line no-await-in-loop
|
|
4006
|
-
await enableAutoMerge(prResponse.data)
|
|
4007
|
-
}
|
|
4008
|
-
}
|
|
4009
3999
|
} catch {
|
|
4000
|
+
failed = true
|
|
4010
4001
|
spinner?.error(`Reverting ${fixSpec}`)
|
|
4011
4002
|
if (saved) {
|
|
4012
4003
|
editablePkgJson.update(revertData)
|
|
@@ -4022,8 +4013,35 @@ async function npmFix(
|
|
|
4022
4013
|
spinner?.failAndStop(`Failed to fix ${oldSpec}`)
|
|
4023
4014
|
}
|
|
4024
4015
|
} else {
|
|
4016
|
+
failed = true
|
|
4025
4017
|
spinner?.failAndStop(`Could not patch ${oldSpec}`)
|
|
4026
4018
|
}
|
|
4019
|
+
if (
|
|
4020
|
+
!failed &&
|
|
4021
|
+
// Check targetVersion to make TypeScript happy.
|
|
4022
|
+
targetVersion &&
|
|
4023
|
+
// Lazily access constants.ENV[CI].
|
|
4024
|
+
constants.ENV[CI$1]
|
|
4025
|
+
) {
|
|
4026
|
+
let prResponse
|
|
4027
|
+
try {
|
|
4028
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4029
|
+
prResponse = await openGitHubPullRequest(name, targetVersion, cwd)
|
|
4030
|
+
} catch (e) {
|
|
4031
|
+
logger.logger.error('Failed to open pull request', e)
|
|
4032
|
+
}
|
|
4033
|
+
if (prResponse && autoMerge) {
|
|
4034
|
+
try {
|
|
4035
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4036
|
+
await enableAutoMerge(prResponse.data)
|
|
4037
|
+
} catch (e) {
|
|
4038
|
+
logger.logger.error(
|
|
4039
|
+
'Failed to enable auto-merge in pull request',
|
|
4040
|
+
e
|
|
4041
|
+
)
|
|
4042
|
+
}
|
|
4043
|
+
}
|
|
4044
|
+
}
|
|
4027
4045
|
}
|
|
4028
4046
|
}
|
|
4029
4047
|
}
|
|
@@ -4211,7 +4229,7 @@ function runAgentInstall(pkgEnvDetails, options) {
|
|
|
4211
4229
|
...options
|
|
4212
4230
|
}
|
|
4213
4231
|
const skipNodeHardenFlags =
|
|
4214
|
-
|
|
4232
|
+
agent === PNPM$a && pkgEnvDetails.agentVersion.major < 11
|
|
4215
4233
|
return spawn.spawn(agentExecPath, ['install', ...args], {
|
|
4216
4234
|
spinner,
|
|
4217
4235
|
stdio: 'inherit',
|
|
@@ -4232,8 +4250,15 @@ function runAgentInstall(pkgEnvDetails, options) {
|
|
|
4232
4250
|
}
|
|
4233
4251
|
|
|
4234
4252
|
const { CI, NPM: NPM$c, OVERRIDES: OVERRIDES$2, PNPM: PNPM$9 } = constants
|
|
4235
|
-
async function
|
|
4236
|
-
const
|
|
4253
|
+
async function getActualTree(cwd = process.cwd()) {
|
|
4254
|
+
const arb = new shadowNpmInject.SafeArborist({
|
|
4255
|
+
path: cwd,
|
|
4256
|
+
...shadowNpmInject.SAFE_ARBORIST_REIFY_OPTIONS_OVERRIDES
|
|
4257
|
+
})
|
|
4258
|
+
return await arb.loadActual()
|
|
4259
|
+
}
|
|
4260
|
+
async function install(pkgEnvDetails, options) {
|
|
4261
|
+
const { cwd, spinner } = {
|
|
4237
4262
|
__proto__: null,
|
|
4238
4263
|
...options
|
|
4239
4264
|
}
|
|
@@ -4242,8 +4267,7 @@ async function install(pkgEnvDetails, arb, options) {
|
|
|
4242
4267
|
spinner,
|
|
4243
4268
|
stdio: debug.isDebug() ? 'inherit' : 'ignore'
|
|
4244
4269
|
})
|
|
4245
|
-
|
|
4246
|
-
await arb.loadActual()
|
|
4270
|
+
return await getActualTree(cwd)
|
|
4247
4271
|
}
|
|
4248
4272
|
async function pnpmFix(
|
|
4249
4273
|
pkgEnvDetails,
|
|
@@ -4272,12 +4296,7 @@ async function pnpmFix(
|
|
|
4272
4296
|
const editablePkgJson = await packages.readPackageJson(cwd, {
|
|
4273
4297
|
editable: true
|
|
4274
4298
|
})
|
|
4275
|
-
|
|
4276
|
-
const arb = new shadowNpmInject.SafeArborist({
|
|
4277
|
-
path: cwd,
|
|
4278
|
-
...shadowNpmInject.SAFE_ARBORIST_REIFY_OPTIONS_OVERRIDES
|
|
4279
|
-
})
|
|
4280
|
-
await arb.loadActual()
|
|
4299
|
+
let actualTree = await getActualTree(cwd)
|
|
4281
4300
|
for (const { 0: name, 1: infos } of infoByPkg) {
|
|
4282
4301
|
if (registry.getManifestData(NPM$c, name)) {
|
|
4283
4302
|
spinner?.info(`Skipping ${name}. Socket Optimize package exists.`)
|
|
@@ -4285,7 +4304,7 @@ async function pnpmFix(
|
|
|
4285
4304
|
}
|
|
4286
4305
|
const specs = arrays.arrayUnique(
|
|
4287
4306
|
shadowNpmInject
|
|
4288
|
-
.findPackageNodes(
|
|
4307
|
+
.findPackageNodes(actualTree, name)
|
|
4289
4308
|
.map(n => `${n.name}@${n.version}`)
|
|
4290
4309
|
)
|
|
4291
4310
|
const packument =
|
|
@@ -4305,7 +4324,7 @@ async function pnpmFix(
|
|
|
4305
4324
|
vulnerableVersionRange
|
|
4306
4325
|
} of infos) {
|
|
4307
4326
|
const node = shadowNpmInject.findPackageNode(
|
|
4308
|
-
|
|
4327
|
+
actualTree,
|
|
4309
4328
|
name,
|
|
4310
4329
|
oldVersion
|
|
4311
4330
|
)
|
|
@@ -4322,15 +4341,22 @@ async function pnpmFix(
|
|
|
4322
4341
|
const targetPackument = targetVersion
|
|
4323
4342
|
? packument.versions[targetVersion]
|
|
4324
4343
|
: undefined
|
|
4344
|
+
let failed = false
|
|
4345
|
+
let installed = false
|
|
4346
|
+
let saved = false
|
|
4325
4347
|
if (targetVersion && targetPackument) {
|
|
4326
|
-
const oldPnpm =
|
|
4327
|
-
const
|
|
4348
|
+
const oldPnpm = editablePkgJson.content[PNPM$9]
|
|
4349
|
+
const oldPnpmKeyCount = oldPnpm ? Object.keys(oldPnpm).length : 0
|
|
4328
4350
|
const oldOverrides = oldPnpm?.[OVERRIDES$2]
|
|
4329
|
-
const
|
|
4351
|
+
const oldOverridesCount = oldOverrides
|
|
4330
4352
|
? Object.keys(oldOverrides).length
|
|
4331
4353
|
: 0
|
|
4332
4354
|
const overrideKey = `${node.name}@${vulnerableVersionRange}`
|
|
4333
|
-
const overrideRange =
|
|
4355
|
+
const overrideRange = shadowNpmInject.applyRange(
|
|
4356
|
+
oldOverrides?.[overrideKey] ?? targetVersion,
|
|
4357
|
+
targetVersion,
|
|
4358
|
+
rangeStyle
|
|
4359
|
+
)
|
|
4334
4360
|
const fixSpec = `${name}@${overrideRange}`
|
|
4335
4361
|
const updateData = {
|
|
4336
4362
|
[PNPM$9]: {
|
|
@@ -4342,11 +4368,11 @@ async function pnpmFix(
|
|
|
4342
4368
|
}
|
|
4343
4369
|
}
|
|
4344
4370
|
const revertData = {
|
|
4345
|
-
[PNPM$9]:
|
|
4371
|
+
[PNPM$9]: oldPnpmKeyCount
|
|
4346
4372
|
? {
|
|
4347
4373
|
...oldPnpm,
|
|
4348
4374
|
[OVERRIDES$2]:
|
|
4349
|
-
|
|
4375
|
+
oldOverridesCount === 1
|
|
4350
4376
|
? undefined
|
|
4351
4377
|
: {
|
|
4352
4378
|
[overrideKey]: undefined,
|
|
@@ -4354,31 +4380,31 @@ async function pnpmFix(
|
|
|
4354
4380
|
}
|
|
4355
4381
|
}
|
|
4356
4382
|
: undefined,
|
|
4357
|
-
...(
|
|
4383
|
+
...(editablePkgJson.content.dependencies
|
|
4358
4384
|
? {
|
|
4359
|
-
dependencies:
|
|
4385
|
+
dependencies: editablePkgJson.content.dependencies
|
|
4360
4386
|
}
|
|
4361
4387
|
: undefined),
|
|
4362
|
-
...(
|
|
4388
|
+
...(editablePkgJson.content.optionalDependencies
|
|
4363
4389
|
? {
|
|
4364
|
-
optionalDependencies:
|
|
4390
|
+
optionalDependencies:
|
|
4391
|
+
editablePkgJson.content.optionalDependencies
|
|
4365
4392
|
}
|
|
4366
4393
|
: undefined),
|
|
4367
|
-
...(
|
|
4394
|
+
...(editablePkgJson.content.peerDependencies
|
|
4368
4395
|
? {
|
|
4369
|
-
peerDependencies:
|
|
4396
|
+
peerDependencies: editablePkgJson.content.peerDependencies
|
|
4370
4397
|
}
|
|
4371
4398
|
: undefined)
|
|
4372
4399
|
}
|
|
4373
4400
|
spinner?.info(`Installing ${fixSpec}`)
|
|
4374
|
-
let saved = false
|
|
4375
|
-
let installed = false
|
|
4376
4401
|
try {
|
|
4377
4402
|
editablePkgJson.update(updateData)
|
|
4378
4403
|
shadowNpmInject.updatePackageJsonFromNode(
|
|
4379
4404
|
editablePkgJson,
|
|
4380
|
-
|
|
4405
|
+
actualTree,
|
|
4381
4406
|
node,
|
|
4407
|
+
targetVersion,
|
|
4382
4408
|
rangeStyle
|
|
4383
4409
|
)
|
|
4384
4410
|
// eslint-disable-next-line no-await-in-loop
|
|
@@ -4386,7 +4412,7 @@ async function pnpmFix(
|
|
|
4386
4412
|
saved = true
|
|
4387
4413
|
|
|
4388
4414
|
// eslint-disable-next-line no-await-in-loop
|
|
4389
|
-
await install(pkgEnvDetails,
|
|
4415
|
+
actualTree = await install(pkgEnvDetails, {
|
|
4390
4416
|
spinner
|
|
4391
4417
|
})
|
|
4392
4418
|
installed = true
|
|
@@ -4400,21 +4426,8 @@ async function pnpmFix(
|
|
|
4400
4426
|
}
|
|
4401
4427
|
spinner?.successAndStop(`Fixed ${name}`)
|
|
4402
4428
|
spinner?.start()
|
|
4403
|
-
|
|
4404
|
-
// Lazily access constants.ENV[CI].
|
|
4405
|
-
if (constants.ENV[CI]) {
|
|
4406
|
-
// eslint-disable-next-line no-await-in-loop
|
|
4407
|
-
const prResponse = await openGitHubPullRequest(
|
|
4408
|
-
name,
|
|
4409
|
-
targetVersion,
|
|
4410
|
-
cwd
|
|
4411
|
-
)
|
|
4412
|
-
if (autoMerge) {
|
|
4413
|
-
// eslint-disable-next-line no-await-in-loop
|
|
4414
|
-
await enableAutoMerge(prResponse.data)
|
|
4415
|
-
}
|
|
4416
|
-
}
|
|
4417
4429
|
} catch (e) {
|
|
4430
|
+
failed = true
|
|
4418
4431
|
spinner?.error(`Reverting ${fixSpec}`, e)
|
|
4419
4432
|
if (saved) {
|
|
4420
4433
|
editablePkgJson.update(revertData)
|
|
@@ -4423,15 +4436,42 @@ async function pnpmFix(
|
|
|
4423
4436
|
}
|
|
4424
4437
|
if (installed) {
|
|
4425
4438
|
// eslint-disable-next-line no-await-in-loop
|
|
4426
|
-
await install(pkgEnvDetails,
|
|
4439
|
+
actualTree = await install(pkgEnvDetails, {
|
|
4427
4440
|
spinner
|
|
4428
4441
|
})
|
|
4429
4442
|
}
|
|
4430
4443
|
spinner?.failAndStop(`Failed to fix ${oldSpec}`)
|
|
4431
4444
|
}
|
|
4432
4445
|
} else {
|
|
4446
|
+
failed = true
|
|
4433
4447
|
spinner?.failAndStop(`Could not patch ${oldSpec}`)
|
|
4434
4448
|
}
|
|
4449
|
+
if (
|
|
4450
|
+
!failed &&
|
|
4451
|
+
// Check targetVersion to make TypeScript happy.
|
|
4452
|
+
targetVersion &&
|
|
4453
|
+
// Lazily access constants.ENV[CI].
|
|
4454
|
+
constants.ENV[CI]
|
|
4455
|
+
) {
|
|
4456
|
+
let prResponse
|
|
4457
|
+
try {
|
|
4458
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4459
|
+
prResponse = await openGitHubPullRequest(name, targetVersion, cwd)
|
|
4460
|
+
} catch (e) {
|
|
4461
|
+
logger.logger.error('Failed to open pull request', e)
|
|
4462
|
+
}
|
|
4463
|
+
if (prResponse && autoMerge) {
|
|
4464
|
+
try {
|
|
4465
|
+
// eslint-disable-next-line no-await-in-loop
|
|
4466
|
+
await enableAutoMerge(prResponse.data)
|
|
4467
|
+
} catch (e) {
|
|
4468
|
+
logger.logger.error(
|
|
4469
|
+
'Failed to enable auto-merge in pull request',
|
|
4470
|
+
e
|
|
4471
|
+
)
|
|
4472
|
+
}
|
|
4473
|
+
}
|
|
4474
|
+
}
|
|
4435
4475
|
}
|
|
4436
4476
|
}
|
|
4437
4477
|
}
|
|
@@ -6365,13 +6405,13 @@ const depsIncludesByAgent = new Map([
|
|
|
6365
6405
|
[YARN_CLASSIC$5, matchLsCmdViewHumanStdout]
|
|
6366
6406
|
])
|
|
6367
6407
|
|
|
6368
|
-
function getDependencyEntries(
|
|
6408
|
+
function getDependencyEntries(editablePkgJson) {
|
|
6369
6409
|
const {
|
|
6370
6410
|
dependencies,
|
|
6371
6411
|
devDependencies,
|
|
6372
6412
|
optionalDependencies,
|
|
6373
6413
|
peerDependencies
|
|
6374
|
-
} =
|
|
6414
|
+
} = editablePkgJson.content
|
|
6375
6415
|
return [
|
|
6376
6416
|
[
|
|
6377
6417
|
'dependencies',
|
|
@@ -6422,8 +6462,8 @@ const {
|
|
|
6422
6462
|
YARN_BERRY: YARN_BERRY$3,
|
|
6423
6463
|
YARN_CLASSIC: YARN_CLASSIC$4
|
|
6424
6464
|
} = constants
|
|
6425
|
-
function getOverridesDataBun(
|
|
6426
|
-
const overrides =
|
|
6465
|
+
function getOverridesDataBun(editablePkgJson) {
|
|
6466
|
+
const overrides = editablePkgJson.content?.[RESOLUTIONS$1] ?? {}
|
|
6427
6467
|
return {
|
|
6428
6468
|
type: YARN_BERRY$3,
|
|
6429
6469
|
overrides
|
|
@@ -6432,8 +6472,8 @@ function getOverridesDataBun(pkgJson) {
|
|
|
6432
6472
|
|
|
6433
6473
|
// npm overrides documentation:
|
|
6434
6474
|
// https://docs.npmjs.com/cli/v10/configuring-npm/package-json#overrides
|
|
6435
|
-
function getOverridesDataNpm(
|
|
6436
|
-
const overrides =
|
|
6475
|
+
function getOverridesDataNpm(editablePkgJson) {
|
|
6476
|
+
const overrides = editablePkgJson.content?.[OVERRIDES$1] ?? {}
|
|
6437
6477
|
return {
|
|
6438
6478
|
type: NPM$5,
|
|
6439
6479
|
overrides
|
|
@@ -6442,15 +6482,15 @@ function getOverridesDataNpm(pkgJson) {
|
|
|
6442
6482
|
|
|
6443
6483
|
// pnpm overrides documentation:
|
|
6444
6484
|
// https://pnpm.io/package_json#pnpmoverrides
|
|
6445
|
-
function getOverridesDataPnpm(
|
|
6446
|
-
const overrides =
|
|
6485
|
+
function getOverridesDataPnpm(editablePkgJson) {
|
|
6486
|
+
const overrides = editablePkgJson.content?.[PNPM$5]?.[OVERRIDES$1] ?? {}
|
|
6447
6487
|
return {
|
|
6448
6488
|
type: PNPM$5,
|
|
6449
6489
|
overrides
|
|
6450
6490
|
}
|
|
6451
6491
|
}
|
|
6452
|
-
function getOverridesDataVlt(
|
|
6453
|
-
const overrides =
|
|
6492
|
+
function getOverridesDataVlt(editablePkgJson) {
|
|
6493
|
+
const overrides = editablePkgJson.content?.[OVERRIDES$1] ?? {}
|
|
6454
6494
|
return {
|
|
6455
6495
|
type: VLT$3,
|
|
6456
6496
|
overrides
|
|
@@ -6459,8 +6499,8 @@ function getOverridesDataVlt(pkgJson) {
|
|
|
6459
6499
|
|
|
6460
6500
|
// Yarn resolutions documentation:
|
|
6461
6501
|
// https://yarnpkg.com/configuration/manifest#resolutions
|
|
6462
|
-
function getOverridesDataYarn(
|
|
6463
|
-
const overrides =
|
|
6502
|
+
function getOverridesDataYarn(editablePkgJson) {
|
|
6503
|
+
const overrides = editablePkgJson.content?.[RESOLUTIONS$1] ?? {}
|
|
6464
6504
|
return {
|
|
6465
6505
|
type: YARN_BERRY$3,
|
|
6466
6506
|
overrides
|
|
@@ -6469,8 +6509,8 @@ function getOverridesDataYarn(pkgJson) {
|
|
|
6469
6509
|
|
|
6470
6510
|
// Yarn resolutions documentation:
|
|
6471
6511
|
// https://classic.yarnpkg.com/en/docs/selective-version-resolutions
|
|
6472
|
-
function
|
|
6473
|
-
const overrides =
|
|
6512
|
+
function getOverridesDataYarnClassic(editablePkgJson) {
|
|
6513
|
+
const overrides = editablePkgJson.content?.[RESOLUTIONS$1] ?? {}
|
|
6474
6514
|
return {
|
|
6475
6515
|
type: YARN_CLASSIC$4,
|
|
6476
6516
|
overrides
|
|
@@ -6482,12 +6522,12 @@ const overridesDataByAgent = new Map([
|
|
|
6482
6522
|
[PNPM$5, getOverridesDataPnpm],
|
|
6483
6523
|
[VLT$3, getOverridesDataVlt],
|
|
6484
6524
|
[YARN_BERRY$3, getOverridesDataYarn],
|
|
6485
|
-
[YARN_CLASSIC$4,
|
|
6525
|
+
[YARN_CLASSIC$4, getOverridesDataYarnClassic]
|
|
6486
6526
|
])
|
|
6487
6527
|
|
|
6488
6528
|
const { PNPM: PNPM$4 } = constants
|
|
6489
6529
|
const PNPM_WORKSPACE = `${PNPM$4}-workspace`
|
|
6490
|
-
async function getWorkspaceGlobs(agent, pkgPath,
|
|
6530
|
+
async function getWorkspaceGlobs(agent, pkgPath, editablePkgJson) {
|
|
6491
6531
|
let workspacePatterns
|
|
6492
6532
|
if (agent === PNPM$4) {
|
|
6493
6533
|
for (const workspacePath of [
|
|
@@ -6506,7 +6546,7 @@ async function getWorkspaceGlobs(agent, pkgPath, pkgJson) {
|
|
|
6506
6546
|
}
|
|
6507
6547
|
}
|
|
6508
6548
|
} else {
|
|
6509
|
-
workspacePatterns =
|
|
6549
|
+
workspacePatterns = editablePkgJson.content['workspaces']
|
|
6510
6550
|
}
|
|
6511
6551
|
return Array.isArray(workspacePatterns)
|
|
6512
6552
|
? workspacePatterns
|
|
@@ -6779,8 +6819,7 @@ function getHighestEntryIndex(entries, keys) {
|
|
|
6779
6819
|
return getEntryIndexes(entries, keys).at(-1) ?? -1
|
|
6780
6820
|
}
|
|
6781
6821
|
function updatePkgJsonField(editablePkgJson, field, value) {
|
|
6782
|
-
const
|
|
6783
|
-
const oldValue = pkgJson[field]
|
|
6822
|
+
const oldValue = editablePkgJson.content[field]
|
|
6784
6823
|
if (oldValue) {
|
|
6785
6824
|
// The field already exists so we simply update the field value.
|
|
6786
6825
|
if (field === PNPM$1) {
|
|
@@ -6831,7 +6870,7 @@ function updatePkgJsonField(editablePkgJson, field, value) {
|
|
|
6831
6870
|
// Since the field doesn't exist we want to insert it into the package.json
|
|
6832
6871
|
// in a place that makes sense, e.g. close to the "dependencies" field. If
|
|
6833
6872
|
// we can't find a place to insert the field we'll add it to the bottom.
|
|
6834
|
-
const entries = Object.entries(
|
|
6873
|
+
const entries = Object.entries(editablePkgJson.content)
|
|
6835
6874
|
let insertIndex = -1
|
|
6836
6875
|
let isPlacingHigher = false
|
|
6837
6876
|
if (field === OVERRIDES) {
|
|
@@ -6930,9 +6969,12 @@ async function addOverrides(pkgPath, pkgEnvDetails, options) {
|
|
|
6930
6969
|
editable: true
|
|
6931
6970
|
})
|
|
6932
6971
|
}
|
|
6933
|
-
const { content: pkgJson } = editablePkgJson
|
|
6934
6972
|
const workspaceName = path$1.relative(rootPath, pkgPath)
|
|
6935
|
-
const workspaceGlobs = await getWorkspaceGlobs(
|
|
6973
|
+
const workspaceGlobs = await getWorkspaceGlobs(
|
|
6974
|
+
agent,
|
|
6975
|
+
pkgPath,
|
|
6976
|
+
editablePkgJson
|
|
6977
|
+
)
|
|
6936
6978
|
const isRoot = pkgPath === rootPath
|
|
6937
6979
|
const isLockScanned = isRoot && !prod
|
|
6938
6980
|
const isWorkspace = !!workspaceGlobs
|
|
@@ -6952,19 +6994,19 @@ async function addOverrides(pkgPath, pkgEnvDetails, options) {
|
|
|
6952
6994
|
)
|
|
6953
6995
|
}
|
|
6954
6996
|
const overridesDataObjects = []
|
|
6955
|
-
if (
|
|
6956
|
-
overridesDataObjects.push(overridesDataByAgent.get(agent)(
|
|
6997
|
+
if (editablePkgJson.content['private'] || isWorkspace) {
|
|
6998
|
+
overridesDataObjects.push(overridesDataByAgent.get(agent)(editablePkgJson))
|
|
6957
6999
|
} else {
|
|
6958
7000
|
overridesDataObjects.push(
|
|
6959
|
-
overridesDataByAgent.get(NPM$1)(
|
|
6960
|
-
overridesDataByAgent.get(YARN_CLASSIC)(
|
|
7001
|
+
overridesDataByAgent.get(NPM$1)(editablePkgJson),
|
|
7002
|
+
overridesDataByAgent.get(YARN_CLASSIC)(editablePkgJson)
|
|
6961
7003
|
)
|
|
6962
7004
|
}
|
|
6963
7005
|
spinner?.setText(
|
|
6964
7006
|
`Adding overrides${workspaceName ? ` to ${workspaceName}` : ''}...`
|
|
6965
7007
|
)
|
|
6966
7008
|
const depAliasMap = new Map()
|
|
6967
|
-
const depEntries = getDependencyEntries(
|
|
7009
|
+
const depEntries = getDependencyEntries(editablePkgJson)
|
|
6968
7010
|
const manifestEntries = manifestNpmOverrides.filter(({ 1: data }) =>
|
|
6969
7011
|
semver.satisfies(
|
|
6970
7012
|
// Roughly check Node range as semver.coerce will strip leading
|
|
@@ -11307,7 +11349,7 @@ void (async () => {
|
|
|
11307
11349
|
await vendor.updater({
|
|
11308
11350
|
name: SOCKET_CLI_BIN_NAME,
|
|
11309
11351
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
|
|
11310
|
-
version: '0.14.
|
|
11352
|
+
version: '0.14.87',
|
|
11311
11353
|
ttl: 86_400_000 /* 24 hours in milliseconds */
|
|
11312
11354
|
})
|
|
11313
11355
|
try {
|
|
@@ -11375,5 +11417,5 @@ void (async () => {
|
|
|
11375
11417
|
await shadowNpmInject.captureException(e)
|
|
11376
11418
|
}
|
|
11377
11419
|
})()
|
|
11378
|
-
//# debugId=
|
|
11420
|
+
//# debugId=a4b7d441-5d8c-4b09-b5f2-ba36e572f667
|
|
11379
11421
|
//# sourceMappingURL=cli.js.map
|