@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.
@@ -41,7 +41,7 @@ const relConstantsPath = './constants'
41
41
  Sentry.setTag(
42
42
  'version',
43
43
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
44
- '0.14.85:f285d45:d2e4291f:pub'
44
+ '0.14.87:0330c30:e39f7589:pub'
45
45
  )
46
46
  const constants = require(relConstantsPath)
47
47
  if (constants.ENV.SOCKET_CLI_DEBUG) {
@@ -56,5 +56,5 @@ const relConstantsPath = './constants'
56
56
  } = constants
57
57
  setSentry(Sentry)
58
58
  }
59
- //# debugId=96f123b5-7038-43b8-95e2-69bba9f1d178
59
+ //# debugId=7462b6a0-0ec4-4dd2-9b42-785f00a71795
60
60
  //# sourceMappingURL=instrument-with-sentry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"instrument-with-sentry.js","sources":["../../src/instrument-with-sentry.ts"],"sourcesContent":["// This should ONLY be included in the special Sentry build!\n// Otherwise the Sentry dependency won't even be present in the manifest.\n\nimport { logger } from '@socketsecurity/registry/lib/logger'\n\n// Require constants with require(relConstantsPath) instead of require('./constants')\n// so Rollup doesn't generate a constants2.js chunk.\nconst relConstantsPath = './constants'\n// The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']\".\nif (process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']) {\n const Sentry = require('@sentry/node')\n Sentry.init({\n onFatalError(error: Error) {\n // Defer module loads until after Sentry.init is called.\n if (require(relConstantsPath).ENV.SOCKET_CLI_DEBUG) {\n logger.fail('[DEBUG] [Sentry onFatalError]:', error)\n }\n },\n dsn: 'https://66736701db8e4ffac046bd09fa6aaced@o555220.ingest.us.sentry.io/4508846967619585',\n enabled: true,\n integrations: []\n })\n Sentry.setTag(\n 'environment',\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\".\n process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\n ? 'pub'\n : // The NODE_ENV convention is used by apps to define the runtime environment.\n // https://nodejs.org/en/learn/getting-started/nodejs-the-difference-between-development-and-production\n process.env['NODE_ENV']\n )\n Sentry.setTag(\n 'version',\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_VERSION_HASH']\".\n process.env['INLINED_SOCKET_CLI_VERSION_HASH']\n )\n const constants = require(relConstantsPath)\n if (constants.ENV.SOCKET_CLI_DEBUG) {\n Sentry.setTag('debugging', true)\n logger.log('[DEBUG] Set up Sentry.')\n } else {\n Sentry.setTag('debugging', false)\n }\n const {\n kInternalsSymbol,\n [kInternalsSymbol as unknown as 'Symbol(kInternalsSymbol)']: { setSentry }\n } = constants\n setSentry(Sentry)\n} else if (require(relConstantsPath).ENV.SOCKET_CLI_DEBUG) {\n logger.log('[DEBUG] Sentry disabled explicitly.')\n}\n"],"names":["logger","dsn","enabled","integrations","process","Sentry","setSentry"],"mappings":";;;;;;;;;;;;;AAAA;AACA;;;AAIA;AACA;AACA;AACA;AACoD;AAClD;;;AAGI;;AAEEA;AACF;;AAEFC;AACAC;AACAC;AACF;;AAGE;AACAC;;AAQA;AACAA;AAEF;AACA;AACEC;AACAL;AACF;AACEK;AACF;;;AAGE;AAA+DC;AAAU;AAC3E;;AAEF","debugId":"96f123b5-7038-43b8-95e2-69bba9f1d178"}
1
+ {"version":3,"file":"instrument-with-sentry.js","sources":["../../src/instrument-with-sentry.ts"],"sourcesContent":["// This should ONLY be included in the special Sentry build!\n// Otherwise the Sentry dependency won't even be present in the manifest.\n\nimport { logger } from '@socketsecurity/registry/lib/logger'\n\n// Require constants with require(relConstantsPath) instead of require('./constants')\n// so Rollup doesn't generate a constants2.js chunk.\nconst relConstantsPath = './constants'\n// The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']\".\nif (process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']) {\n const Sentry = require('@sentry/node')\n Sentry.init({\n onFatalError(error: Error) {\n // Defer module loads until after Sentry.init is called.\n if (require(relConstantsPath).ENV.SOCKET_CLI_DEBUG) {\n logger.fail('[DEBUG] [Sentry onFatalError]:', error)\n }\n },\n dsn: 'https://66736701db8e4ffac046bd09fa6aaced@o555220.ingest.us.sentry.io/4508846967619585',\n enabled: true,\n integrations: []\n })\n Sentry.setTag(\n 'environment',\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\".\n process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\n ? 'pub'\n : // The NODE_ENV convention is used by apps to define the runtime environment.\n // https://nodejs.org/en/learn/getting-started/nodejs-the-difference-between-development-and-production\n process.env['NODE_ENV']\n )\n Sentry.setTag(\n 'version',\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_VERSION_HASH']\".\n process.env['INLINED_SOCKET_CLI_VERSION_HASH']\n )\n const constants = require(relConstantsPath)\n if (constants.ENV.SOCKET_CLI_DEBUG) {\n Sentry.setTag('debugging', true)\n logger.log('[DEBUG] Set up Sentry.')\n } else {\n Sentry.setTag('debugging', false)\n }\n const {\n kInternalsSymbol,\n [kInternalsSymbol as unknown as 'Symbol(kInternalsSymbol)']: { setSentry }\n } = constants\n setSentry(Sentry)\n} else if (require(relConstantsPath).ENV.SOCKET_CLI_DEBUG) {\n logger.log('[DEBUG] Sentry disabled explicitly.')\n}\n"],"names":["logger","dsn","enabled","integrations","process","Sentry","setSentry"],"mappings":";;;;;;;;;;;;;AAAA;AACA;;;AAIA;AACA;AACA;AACA;AACoD;AAClD;;;AAGI;;AAEEA;AACF;;AAEFC;AACAC;AACAC;AACF;;AAGE;AACAC;;AAQA;AACAA;AAEF;AACA;AACEC;AACAL;AACF;AACEK;AACF;;;AAGE;AAA+DC;AAAU;AAC3E;;AAEF","debugId":"7462b6a0-0ec4-4dd2-9b42-785f00a71795"}
@@ -915,7 +915,7 @@ function emitBanner(name) {
915
915
  logger.logger.error(getAsciiHeader(name))
916
916
  }
917
917
  function getAsciiHeader(command) {
918
- const cliVersion = '0.14.85:f285d45:d2e4291f:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
918
+ const cliVersion = '0.14.87:0330c30:e39f7589:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
919
919
  const nodeVersion = process$1.version
920
920
  const apiToken = shadowNpmInject.getDefaultToken()
921
921
  const shownToken = apiToken ? getLastFiveOfApiToken(apiToken) : 'no'
@@ -3903,7 +3903,6 @@ async function npmFix(
3903
3903
  const editablePkgJson = await packages.readPackageJson(cwd, {
3904
3904
  editable: true
3905
3905
  })
3906
- const { content: pkgJson } = editablePkgJson
3907
3906
  await arb.buildIdealTree()
3908
3907
  for (const { 0: name, 1: infos } of infoByPkg) {
3909
3908
  const hasUpgrade = !!registry.getManifestData(NPM$f, name)
@@ -3945,36 +3944,40 @@ async function npmFix(
3945
3944
  continue
3946
3945
  }
3947
3946
  const oldSpec = `${name}@${oldVersion}`
3947
+ let targetVersion
3948
+ let failed = false
3949
+ let installed = false
3950
+ let saved = false
3948
3951
  if (
3949
3952
  shadowNpmInject.updateNode(node, packument, vulnerableVersionRange)
3950
3953
  ) {
3951
- const targetVersion = node.package.version
3954
+ targetVersion = node.package.version
3952
3955
  const fixSpec = `${name}@^${targetVersion}`
3953
3956
  const revertData = {
3954
- ...(pkgJson.dependencies
3957
+ ...(editablePkgJson.content.dependencies
3955
3958
  ? {
3956
- dependencies: pkgJson.dependencies
3959
+ dependencies: editablePkgJson.content.dependencies
3957
3960
  }
3958
3961
  : undefined),
3959
- ...(pkgJson.optionalDependencies
3962
+ ...(editablePkgJson.content.optionalDependencies
3960
3963
  ? {
3961
- optionalDependencies: pkgJson.optionalDependencies
3964
+ optionalDependencies:
3965
+ editablePkgJson.content.optionalDependencies
3962
3966
  }
3963
3967
  : undefined),
3964
- ...(pkgJson.peerDependencies
3968
+ ...(editablePkgJson.content.peerDependencies
3965
3969
  ? {
3966
- peerDependencies: pkgJson.peerDependencies
3970
+ peerDependencies: editablePkgJson.content.peerDependencies
3967
3971
  }
3968
3972
  : undefined)
3969
3973
  }
3970
3974
  spinner?.info(`Installing ${fixSpec}`)
3971
- let saved = false
3972
- let installed = false
3973
3975
  try {
3974
3976
  shadowNpmInject.updatePackageJsonFromNode(
3975
3977
  editablePkgJson,
3976
3978
  arb.idealTree,
3977
3979
  node,
3980
+ targetVersion,
3978
3981
  rangeStyle
3979
3982
  )
3980
3983
  // eslint-disable-next-line no-await-in-loop
@@ -3996,20 +3999,8 @@ async function npmFix(
3996
3999
  }
3997
4000
  spinner?.successAndStop(`Fixed ${name}`)
3998
4001
  spinner?.start()
3999
- // Lazily access constants.ENV[CI].
4000
- if (constants.ENV[CI$1]) {
4001
- // eslint-disable-next-line no-await-in-loop
4002
- const prResponse = await openGitHubPullRequest(
4003
- name,
4004
- targetVersion,
4005
- cwd
4006
- )
4007
- if (autoMerge) {
4008
- // eslint-disable-next-line no-await-in-loop
4009
- await enableAutoMerge(prResponse.data)
4010
- }
4011
- }
4012
4002
  } catch {
4003
+ failed = true
4013
4004
  spinner?.error(`Reverting ${fixSpec}`)
4014
4005
  if (saved) {
4015
4006
  editablePkgJson.update(revertData)
@@ -4025,8 +4016,35 @@ async function npmFix(
4025
4016
  spinner?.failAndStop(`Failed to fix ${oldSpec}`)
4026
4017
  }
4027
4018
  } else {
4019
+ failed = true
4028
4020
  spinner?.failAndStop(`Could not patch ${oldSpec}`)
4029
4021
  }
4022
+ if (
4023
+ !failed &&
4024
+ // Check targetVersion to make TypeScript happy.
4025
+ targetVersion &&
4026
+ // Lazily access constants.ENV[CI].
4027
+ constants.ENV[CI$1]
4028
+ ) {
4029
+ let prResponse
4030
+ try {
4031
+ // eslint-disable-next-line no-await-in-loop
4032
+ prResponse = await openGitHubPullRequest(name, targetVersion, cwd)
4033
+ } catch (e) {
4034
+ logger.logger.error('Failed to open pull request', e)
4035
+ }
4036
+ if (prResponse && autoMerge) {
4037
+ try {
4038
+ // eslint-disable-next-line no-await-in-loop
4039
+ await enableAutoMerge(prResponse.data)
4040
+ } catch (e) {
4041
+ logger.logger.error(
4042
+ 'Failed to enable auto-merge in pull request',
4043
+ e
4044
+ )
4045
+ }
4046
+ }
4047
+ }
4030
4048
  }
4031
4049
  }
4032
4050
  }
@@ -4214,7 +4232,7 @@ function runAgentInstall(pkgEnvDetails, options) {
4214
4232
  ...options
4215
4233
  }
4216
4234
  const skipNodeHardenFlags =
4217
- pkgEnvDetails.agent === PNPM$a && pkgEnvDetails.agentVersion.major < 11
4235
+ agent === PNPM$a && pkgEnvDetails.agentVersion.major < 11
4218
4236
  return spawn.spawn(agentExecPath, ['install', ...args], {
4219
4237
  spinner,
4220
4238
  stdio: 'inherit',
@@ -4235,8 +4253,15 @@ function runAgentInstall(pkgEnvDetails, options) {
4235
4253
  }
4236
4254
 
4237
4255
  const { CI, NPM: NPM$c, OVERRIDES: OVERRIDES$2, PNPM: PNPM$9 } = constants
4238
- async function install(pkgEnvDetails, arb, options) {
4239
- const { spinner } = {
4256
+ async function getActualTree(cwd = process.cwd()) {
4257
+ const arb = new shadowNpmInject.SafeArborist({
4258
+ path: cwd,
4259
+ ...shadowNpmInject.SAFE_ARBORIST_REIFY_OPTIONS_OVERRIDES
4260
+ })
4261
+ return await arb.loadActual()
4262
+ }
4263
+ async function install(pkgEnvDetails, options) {
4264
+ const { cwd, spinner } = {
4240
4265
  __proto__: null,
4241
4266
  ...options
4242
4267
  }
@@ -4245,8 +4270,7 @@ async function install(pkgEnvDetails, arb, options) {
4245
4270
  spinner,
4246
4271
  stdio: debug.isDebug() ? 'inherit' : 'ignore'
4247
4272
  })
4248
- arb.actualTree = null
4249
- await arb.loadActual()
4273
+ return await getActualTree(cwd)
4250
4274
  }
4251
4275
  async function pnpmFix(
4252
4276
  pkgEnvDetails,
@@ -4275,12 +4299,7 @@ async function pnpmFix(
4275
4299
  const editablePkgJson = await packages.readPackageJson(cwd, {
4276
4300
  editable: true
4277
4301
  })
4278
- const { content: pkgJson } = editablePkgJson
4279
- const arb = new shadowNpmInject.SafeArborist({
4280
- path: cwd,
4281
- ...shadowNpmInject.SAFE_ARBORIST_REIFY_OPTIONS_OVERRIDES
4282
- })
4283
- await arb.loadActual()
4302
+ let actualTree = await getActualTree(cwd)
4284
4303
  for (const { 0: name, 1: infos } of infoByPkg) {
4285
4304
  if (registry.getManifestData(NPM$c, name)) {
4286
4305
  spinner?.info(`Skipping ${name}. Socket Optimize package exists.`)
@@ -4288,7 +4307,7 @@ async function pnpmFix(
4288
4307
  }
4289
4308
  const specs = arrays.arrayUnique(
4290
4309
  shadowNpmInject
4291
- .findPackageNodes(arb.actualTree, name)
4310
+ .findPackageNodes(actualTree, name)
4292
4311
  .map(n => `${n.name}@${n.version}`)
4293
4312
  )
4294
4313
  const packument =
@@ -4308,7 +4327,7 @@ async function pnpmFix(
4308
4327
  vulnerableVersionRange
4309
4328
  } of infos) {
4310
4329
  const node = shadowNpmInject.findPackageNode(
4311
- arb.actualTree,
4330
+ actualTree,
4312
4331
  name,
4313
4332
  oldVersion
4314
4333
  )
@@ -4325,15 +4344,22 @@ async function pnpmFix(
4325
4344
  const targetPackument = targetVersion
4326
4345
  ? packument.versions[targetVersion]
4327
4346
  : undefined
4347
+ let failed = false
4348
+ let installed = false
4349
+ let saved = false
4328
4350
  if (targetVersion && targetPackument) {
4329
- const oldPnpm = pkgJson[PNPM$9]
4330
- const pnpmKeyCount = oldPnpm ? Object.keys(oldPnpm).length : 0
4351
+ const oldPnpm = editablePkgJson.content[PNPM$9]
4352
+ const oldPnpmKeyCount = oldPnpm ? Object.keys(oldPnpm).length : 0
4331
4353
  const oldOverrides = oldPnpm?.[OVERRIDES$2]
4332
- const overridesCount = oldOverrides
4354
+ const oldOverridesCount = oldOverrides
4333
4355
  ? Object.keys(oldOverrides).length
4334
4356
  : 0
4335
4357
  const overrideKey = `${node.name}@${vulnerableVersionRange}`
4336
- const overrideRange = `^${targetVersion}`
4358
+ const overrideRange = shadowNpmInject.applyRange(
4359
+ oldOverrides?.[overrideKey] ?? targetVersion,
4360
+ targetVersion,
4361
+ rangeStyle
4362
+ )
4337
4363
  const fixSpec = `${name}@${overrideRange}`
4338
4364
  const updateData = {
4339
4365
  [PNPM$9]: {
@@ -4345,11 +4371,11 @@ async function pnpmFix(
4345
4371
  }
4346
4372
  }
4347
4373
  const revertData = {
4348
- [PNPM$9]: pnpmKeyCount
4374
+ [PNPM$9]: oldPnpmKeyCount
4349
4375
  ? {
4350
4376
  ...oldPnpm,
4351
4377
  [OVERRIDES$2]:
4352
- overridesCount === 1
4378
+ oldOverridesCount === 1
4353
4379
  ? undefined
4354
4380
  : {
4355
4381
  [overrideKey]: undefined,
@@ -4357,31 +4383,31 @@ async function pnpmFix(
4357
4383
  }
4358
4384
  }
4359
4385
  : undefined,
4360
- ...(pkgJson.dependencies
4386
+ ...(editablePkgJson.content.dependencies
4361
4387
  ? {
4362
- dependencies: pkgJson.dependencies
4388
+ dependencies: editablePkgJson.content.dependencies
4363
4389
  }
4364
4390
  : undefined),
4365
- ...(pkgJson.optionalDependencies
4391
+ ...(editablePkgJson.content.optionalDependencies
4366
4392
  ? {
4367
- optionalDependencies: pkgJson.optionalDependencies
4393
+ optionalDependencies:
4394
+ editablePkgJson.content.optionalDependencies
4368
4395
  }
4369
4396
  : undefined),
4370
- ...(pkgJson.peerDependencies
4397
+ ...(editablePkgJson.content.peerDependencies
4371
4398
  ? {
4372
- peerDependencies: pkgJson.peerDependencies
4399
+ peerDependencies: editablePkgJson.content.peerDependencies
4373
4400
  }
4374
4401
  : undefined)
4375
4402
  }
4376
4403
  spinner?.info(`Installing ${fixSpec}`)
4377
- let saved = false
4378
- let installed = false
4379
4404
  try {
4380
4405
  editablePkgJson.update(updateData)
4381
4406
  shadowNpmInject.updatePackageJsonFromNode(
4382
4407
  editablePkgJson,
4383
- arb.actualTree,
4408
+ actualTree,
4384
4409
  node,
4410
+ targetVersion,
4385
4411
  rangeStyle
4386
4412
  )
4387
4413
  // eslint-disable-next-line no-await-in-loop
@@ -4389,7 +4415,7 @@ async function pnpmFix(
4389
4415
  saved = true
4390
4416
 
4391
4417
  // eslint-disable-next-line no-await-in-loop
4392
- await install(pkgEnvDetails, arb, {
4418
+ actualTree = await install(pkgEnvDetails, {
4393
4419
  spinner
4394
4420
  })
4395
4421
  installed = true
@@ -4403,21 +4429,8 @@ async function pnpmFix(
4403
4429
  }
4404
4430
  spinner?.successAndStop(`Fixed ${name}`)
4405
4431
  spinner?.start()
4406
-
4407
- // Lazily access constants.ENV[CI].
4408
- if (constants.ENV[CI]) {
4409
- // eslint-disable-next-line no-await-in-loop
4410
- const prResponse = await openGitHubPullRequest(
4411
- name,
4412
- targetVersion,
4413
- cwd
4414
- )
4415
- if (autoMerge) {
4416
- // eslint-disable-next-line no-await-in-loop
4417
- await enableAutoMerge(prResponse.data)
4418
- }
4419
- }
4420
4432
  } catch (e) {
4433
+ failed = true
4421
4434
  spinner?.error(`Reverting ${fixSpec}`, e)
4422
4435
  if (saved) {
4423
4436
  editablePkgJson.update(revertData)
@@ -4426,15 +4439,42 @@ async function pnpmFix(
4426
4439
  }
4427
4440
  if (installed) {
4428
4441
  // eslint-disable-next-line no-await-in-loop
4429
- await install(pkgEnvDetails, arb, {
4442
+ actualTree = await install(pkgEnvDetails, {
4430
4443
  spinner
4431
4444
  })
4432
4445
  }
4433
4446
  spinner?.failAndStop(`Failed to fix ${oldSpec}`)
4434
4447
  }
4435
4448
  } else {
4449
+ failed = true
4436
4450
  spinner?.failAndStop(`Could not patch ${oldSpec}`)
4437
4451
  }
4452
+ if (
4453
+ !failed &&
4454
+ // Check targetVersion to make TypeScript happy.
4455
+ targetVersion &&
4456
+ // Lazily access constants.ENV[CI].
4457
+ constants.ENV[CI]
4458
+ ) {
4459
+ let prResponse
4460
+ try {
4461
+ // eslint-disable-next-line no-await-in-loop
4462
+ prResponse = await openGitHubPullRequest(name, targetVersion, cwd)
4463
+ } catch (e) {
4464
+ logger.logger.error('Failed to open pull request', e)
4465
+ }
4466
+ if (prResponse && autoMerge) {
4467
+ try {
4468
+ // eslint-disable-next-line no-await-in-loop
4469
+ await enableAutoMerge(prResponse.data)
4470
+ } catch (e) {
4471
+ logger.logger.error(
4472
+ 'Failed to enable auto-merge in pull request',
4473
+ e
4474
+ )
4475
+ }
4476
+ }
4477
+ }
4438
4478
  }
4439
4479
  }
4440
4480
  }
@@ -6366,13 +6406,13 @@ const depsIncludesByAgent = new Map([
6366
6406
  [YARN_CLASSIC$5, matchLsCmdViewHumanStdout]
6367
6407
  ])
6368
6408
 
6369
- function getDependencyEntries(pkgJson) {
6409
+ function getDependencyEntries(editablePkgJson) {
6370
6410
  const {
6371
6411
  dependencies,
6372
6412
  devDependencies,
6373
6413
  optionalDependencies,
6374
6414
  peerDependencies
6375
- } = pkgJson
6415
+ } = editablePkgJson.content
6376
6416
  return [
6377
6417
  [
6378
6418
  'dependencies',
@@ -6423,8 +6463,8 @@ const {
6423
6463
  YARN_BERRY: YARN_BERRY$3,
6424
6464
  YARN_CLASSIC: YARN_CLASSIC$4
6425
6465
  } = constants
6426
- function getOverridesDataBun(pkgJson) {
6427
- const overrides = pkgJson?.[RESOLUTIONS$1] ?? {}
6466
+ function getOverridesDataBun(editablePkgJson) {
6467
+ const overrides = editablePkgJson.content?.[RESOLUTIONS$1] ?? {}
6428
6468
  return {
6429
6469
  type: YARN_BERRY$3,
6430
6470
  overrides
@@ -6433,8 +6473,8 @@ function getOverridesDataBun(pkgJson) {
6433
6473
 
6434
6474
  // npm overrides documentation:
6435
6475
  // https://docs.npmjs.com/cli/v10/configuring-npm/package-json#overrides
6436
- function getOverridesDataNpm(pkgJson) {
6437
- const overrides = pkgJson?.[OVERRIDES$1] ?? {}
6476
+ function getOverridesDataNpm(editablePkgJson) {
6477
+ const overrides = editablePkgJson.content?.[OVERRIDES$1] ?? {}
6438
6478
  return {
6439
6479
  type: NPM$5,
6440
6480
  overrides
@@ -6443,15 +6483,15 @@ function getOverridesDataNpm(pkgJson) {
6443
6483
 
6444
6484
  // pnpm overrides documentation:
6445
6485
  // https://pnpm.io/package_json#pnpmoverrides
6446
- function getOverridesDataPnpm(pkgJson) {
6447
- const overrides = pkgJson?.pnpm?.[OVERRIDES$1] ?? {}
6486
+ function getOverridesDataPnpm(editablePkgJson) {
6487
+ const overrides = editablePkgJson.content?.[PNPM$5]?.[OVERRIDES$1] ?? {}
6448
6488
  return {
6449
6489
  type: PNPM$5,
6450
6490
  overrides
6451
6491
  }
6452
6492
  }
6453
- function getOverridesDataVlt(pkgJson) {
6454
- const overrides = pkgJson?.[OVERRIDES$1] ?? {}
6493
+ function getOverridesDataVlt(editablePkgJson) {
6494
+ const overrides = editablePkgJson.content?.[OVERRIDES$1] ?? {}
6455
6495
  return {
6456
6496
  type: VLT$3,
6457
6497
  overrides
@@ -6460,8 +6500,8 @@ function getOverridesDataVlt(pkgJson) {
6460
6500
 
6461
6501
  // Yarn resolutions documentation:
6462
6502
  // https://yarnpkg.com/configuration/manifest#resolutions
6463
- function getOverridesDataYarn(pkgJson) {
6464
- const overrides = pkgJson?.[RESOLUTIONS$1] ?? {}
6503
+ function getOverridesDataYarn(editablePkgJson) {
6504
+ const overrides = editablePkgJson.content?.[RESOLUTIONS$1] ?? {}
6465
6505
  return {
6466
6506
  type: YARN_BERRY$3,
6467
6507
  overrides
@@ -6470,8 +6510,8 @@ function getOverridesDataYarn(pkgJson) {
6470
6510
 
6471
6511
  // Yarn resolutions documentation:
6472
6512
  // https://classic.yarnpkg.com/en/docs/selective-version-resolutions
6473
- function getOverridesDataClassic(pkgJson) {
6474
- const overrides = pkgJson?.[RESOLUTIONS$1] ?? {}
6513
+ function getOverridesDataYarnClassic(editablePkgJson) {
6514
+ const overrides = editablePkgJson.content?.[RESOLUTIONS$1] ?? {}
6475
6515
  return {
6476
6516
  type: YARN_CLASSIC$4,
6477
6517
  overrides
@@ -6483,12 +6523,12 @@ const overridesDataByAgent = new Map([
6483
6523
  [PNPM$5, getOverridesDataPnpm],
6484
6524
  [VLT$3, getOverridesDataVlt],
6485
6525
  [YARN_BERRY$3, getOverridesDataYarn],
6486
- [YARN_CLASSIC$4, getOverridesDataClassic]
6526
+ [YARN_CLASSIC$4, getOverridesDataYarnClassic]
6487
6527
  ])
6488
6528
 
6489
6529
  const { PNPM: PNPM$4 } = constants
6490
6530
  const PNPM_WORKSPACE = `${PNPM$4}-workspace`
6491
- async function getWorkspaceGlobs(agent, pkgPath, pkgJson) {
6531
+ async function getWorkspaceGlobs(agent, pkgPath, editablePkgJson) {
6492
6532
  let workspacePatterns
6493
6533
  if (agent === PNPM$4) {
6494
6534
  for (const workspacePath of [
@@ -6507,7 +6547,7 @@ async function getWorkspaceGlobs(agent, pkgPath, pkgJson) {
6507
6547
  }
6508
6548
  }
6509
6549
  } else {
6510
- workspacePatterns = pkgJson['workspaces']
6550
+ workspacePatterns = editablePkgJson.content['workspaces']
6511
6551
  }
6512
6552
  return Array.isArray(workspacePatterns)
6513
6553
  ? workspacePatterns
@@ -6780,8 +6820,7 @@ function getHighestEntryIndex(entries, keys) {
6780
6820
  return getEntryIndexes(entries, keys).at(-1) ?? -1
6781
6821
  }
6782
6822
  function updatePkgJsonField(editablePkgJson, field, value) {
6783
- const { content: pkgJson } = editablePkgJson
6784
- const oldValue = pkgJson[field]
6823
+ const oldValue = editablePkgJson.content[field]
6785
6824
  if (oldValue) {
6786
6825
  // The field already exists so we simply update the field value.
6787
6826
  if (field === PNPM$1) {
@@ -6832,7 +6871,7 @@ function updatePkgJsonField(editablePkgJson, field, value) {
6832
6871
  // Since the field doesn't exist we want to insert it into the package.json
6833
6872
  // in a place that makes sense, e.g. close to the "dependencies" field. If
6834
6873
  // we can't find a place to insert the field we'll add it to the bottom.
6835
- const entries = Object.entries(pkgJson)
6874
+ const entries = Object.entries(editablePkgJson.content)
6836
6875
  let insertIndex = -1
6837
6876
  let isPlacingHigher = false
6838
6877
  if (field === OVERRIDES) {
@@ -6931,9 +6970,12 @@ async function addOverrides(pkgPath, pkgEnvDetails, options) {
6931
6970
  editable: true
6932
6971
  })
6933
6972
  }
6934
- const { content: pkgJson } = editablePkgJson
6935
6973
  const workspaceName = path$1.relative(rootPath, pkgPath)
6936
- const workspaceGlobs = await getWorkspaceGlobs(agent, pkgPath, pkgJson)
6974
+ const workspaceGlobs = await getWorkspaceGlobs(
6975
+ agent,
6976
+ pkgPath,
6977
+ editablePkgJson
6978
+ )
6937
6979
  const isRoot = pkgPath === rootPath
6938
6980
  const isLockScanned = isRoot && !prod
6939
6981
  const isWorkspace = !!workspaceGlobs
@@ -6953,19 +6995,19 @@ async function addOverrides(pkgPath, pkgEnvDetails, options) {
6953
6995
  )
6954
6996
  }
6955
6997
  const overridesDataObjects = []
6956
- if (pkgJson['private'] || isWorkspace) {
6957
- overridesDataObjects.push(overridesDataByAgent.get(agent)(pkgJson))
6998
+ if (editablePkgJson.content['private'] || isWorkspace) {
6999
+ overridesDataObjects.push(overridesDataByAgent.get(agent)(editablePkgJson))
6958
7000
  } else {
6959
7001
  overridesDataObjects.push(
6960
- overridesDataByAgent.get(NPM$1)(pkgJson),
6961
- overridesDataByAgent.get(YARN_CLASSIC)(pkgJson)
7002
+ overridesDataByAgent.get(NPM$1)(editablePkgJson),
7003
+ overridesDataByAgent.get(YARN_CLASSIC)(editablePkgJson)
6962
7004
  )
6963
7005
  }
6964
7006
  spinner?.setText(
6965
7007
  `Adding overrides${workspaceName ? ` to ${workspaceName}` : ''}...`
6966
7008
  )
6967
7009
  const depAliasMap = new Map()
6968
- const depEntries = getDependencyEntries(pkgJson)
7010
+ const depEntries = getDependencyEntries(editablePkgJson)
6969
7011
  const manifestEntries = manifestNpmOverrides.filter(({ 1: data }) =>
6970
7012
  semver.satisfies(
6971
7013
  // Roughly check Node range as semver.coerce will strip leading
@@ -11308,7 +11350,7 @@ void (async () => {
11308
11350
  await updateNotifier({
11309
11351
  name: SOCKET_CLI_BIN_NAME,
11310
11352
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
11311
- version: '0.14.85',
11353
+ version: '0.14.87',
11312
11354
  ttl: 86_400_000 /* 24 hours in milliseconds */
11313
11355
  })
11314
11356
  try {
@@ -11376,5 +11418,5 @@ void (async () => {
11376
11418
  await shadowNpmInject.captureException(e)
11377
11419
  }
11378
11420
  })()
11379
- //# debugId=4c5033d8-b51b-4e74-849f-37bf630f03a
11421
+ //# debugId=f5888d1f-c1df-495c-8ef8-bcef09e18680
11380
11422
  //# sourceMappingURL=cli.js.map