@socketsecurity/cli-with-sentry 0.14.86 → 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.
@@ -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.86:69093e9:7f5177c3:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
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)
@@ -3952,19 +3951,20 @@ async function npmFix(
3952
3951
  targetVersion = node.package.version
3953
3952
  const fixSpec = `${name}@^${targetVersion}`
3954
3953
  const revertData = {
3955
- ...(pkgJson.dependencies
3954
+ ...(editablePkgJson.content.dependencies
3956
3955
  ? {
3957
- dependencies: pkgJson.dependencies
3956
+ dependencies: editablePkgJson.content.dependencies
3958
3957
  }
3959
3958
  : undefined),
3960
- ...(pkgJson.optionalDependencies
3959
+ ...(editablePkgJson.content.optionalDependencies
3961
3960
  ? {
3962
- optionalDependencies: pkgJson.optionalDependencies
3961
+ optionalDependencies:
3962
+ editablePkgJson.content.optionalDependencies
3963
3963
  }
3964
3964
  : undefined),
3965
- ...(pkgJson.peerDependencies
3965
+ ...(editablePkgJson.content.peerDependencies
3966
3966
  ? {
3967
- peerDependencies: pkgJson.peerDependencies
3967
+ peerDependencies: editablePkgJson.content.peerDependencies
3968
3968
  }
3969
3969
  : undefined)
3970
3970
  }
@@ -3974,6 +3974,7 @@ async function npmFix(
3974
3974
  editablePkgJson,
3975
3975
  arb.idealTree,
3976
3976
  node,
3977
+ targetVersion,
3977
3978
  rangeStyle
3978
3979
  )
3979
3980
  // eslint-disable-next-line no-await-in-loop
@@ -4295,7 +4296,6 @@ async function pnpmFix(
4295
4296
  const editablePkgJson = await packages.readPackageJson(cwd, {
4296
4297
  editable: true
4297
4298
  })
4298
- const { content: pkgJson } = editablePkgJson
4299
4299
  let actualTree = await getActualTree(cwd)
4300
4300
  for (const { 0: name, 1: infos } of infoByPkg) {
4301
4301
  if (registry.getManifestData(NPM$c, name)) {
@@ -4345,14 +4345,18 @@ async function pnpmFix(
4345
4345
  let installed = false
4346
4346
  let saved = false
4347
4347
  if (targetVersion && targetPackument) {
4348
- const oldPnpm = pkgJson[PNPM$9]
4349
- const pnpmKeyCount = oldPnpm ? Object.keys(oldPnpm).length : 0
4348
+ const oldPnpm = editablePkgJson.content[PNPM$9]
4349
+ const oldPnpmKeyCount = oldPnpm ? Object.keys(oldPnpm).length : 0
4350
4350
  const oldOverrides = oldPnpm?.[OVERRIDES$2]
4351
- const overridesCount = oldOverrides
4351
+ const oldOverridesCount = oldOverrides
4352
4352
  ? Object.keys(oldOverrides).length
4353
4353
  : 0
4354
4354
  const overrideKey = `${node.name}@${vulnerableVersionRange}`
4355
- const overrideRange = `^${targetVersion}`
4355
+ const overrideRange = shadowNpmInject.applyRange(
4356
+ oldOverrides?.[overrideKey] ?? targetVersion,
4357
+ targetVersion,
4358
+ rangeStyle
4359
+ )
4356
4360
  const fixSpec = `${name}@${overrideRange}`
4357
4361
  const updateData = {
4358
4362
  [PNPM$9]: {
@@ -4364,11 +4368,11 @@ async function pnpmFix(
4364
4368
  }
4365
4369
  }
4366
4370
  const revertData = {
4367
- [PNPM$9]: pnpmKeyCount
4371
+ [PNPM$9]: oldPnpmKeyCount
4368
4372
  ? {
4369
4373
  ...oldPnpm,
4370
4374
  [OVERRIDES$2]:
4371
- overridesCount === 1
4375
+ oldOverridesCount === 1
4372
4376
  ? undefined
4373
4377
  : {
4374
4378
  [overrideKey]: undefined,
@@ -4376,19 +4380,20 @@ async function pnpmFix(
4376
4380
  }
4377
4381
  }
4378
4382
  : undefined,
4379
- ...(pkgJson.dependencies
4383
+ ...(editablePkgJson.content.dependencies
4380
4384
  ? {
4381
- dependencies: pkgJson.dependencies
4385
+ dependencies: editablePkgJson.content.dependencies
4382
4386
  }
4383
4387
  : undefined),
4384
- ...(pkgJson.optionalDependencies
4388
+ ...(editablePkgJson.content.optionalDependencies
4385
4389
  ? {
4386
- optionalDependencies: pkgJson.optionalDependencies
4390
+ optionalDependencies:
4391
+ editablePkgJson.content.optionalDependencies
4387
4392
  }
4388
4393
  : undefined),
4389
- ...(pkgJson.peerDependencies
4394
+ ...(editablePkgJson.content.peerDependencies
4390
4395
  ? {
4391
- peerDependencies: pkgJson.peerDependencies
4396
+ peerDependencies: editablePkgJson.content.peerDependencies
4392
4397
  }
4393
4398
  : undefined)
4394
4399
  }
@@ -4399,6 +4404,7 @@ async function pnpmFix(
4399
4404
  editablePkgJson,
4400
4405
  actualTree,
4401
4406
  node,
4407
+ targetVersion,
4402
4408
  rangeStyle
4403
4409
  )
4404
4410
  // eslint-disable-next-line no-await-in-loop
@@ -6399,13 +6405,13 @@ const depsIncludesByAgent = new Map([
6399
6405
  [YARN_CLASSIC$5, matchLsCmdViewHumanStdout]
6400
6406
  ])
6401
6407
 
6402
- function getDependencyEntries(pkgJson) {
6408
+ function getDependencyEntries(editablePkgJson) {
6403
6409
  const {
6404
6410
  dependencies,
6405
6411
  devDependencies,
6406
6412
  optionalDependencies,
6407
6413
  peerDependencies
6408
- } = pkgJson
6414
+ } = editablePkgJson.content
6409
6415
  return [
6410
6416
  [
6411
6417
  'dependencies',
@@ -6456,8 +6462,8 @@ const {
6456
6462
  YARN_BERRY: YARN_BERRY$3,
6457
6463
  YARN_CLASSIC: YARN_CLASSIC$4
6458
6464
  } = constants
6459
- function getOverridesDataBun(pkgJson) {
6460
- const overrides = pkgJson?.[RESOLUTIONS$1] ?? {}
6465
+ function getOverridesDataBun(editablePkgJson) {
6466
+ const overrides = editablePkgJson.content?.[RESOLUTIONS$1] ?? {}
6461
6467
  return {
6462
6468
  type: YARN_BERRY$3,
6463
6469
  overrides
@@ -6466,8 +6472,8 @@ function getOverridesDataBun(pkgJson) {
6466
6472
 
6467
6473
  // npm overrides documentation:
6468
6474
  // https://docs.npmjs.com/cli/v10/configuring-npm/package-json#overrides
6469
- function getOverridesDataNpm(pkgJson) {
6470
- const overrides = pkgJson?.[OVERRIDES$1] ?? {}
6475
+ function getOverridesDataNpm(editablePkgJson) {
6476
+ const overrides = editablePkgJson.content?.[OVERRIDES$1] ?? {}
6471
6477
  return {
6472
6478
  type: NPM$5,
6473
6479
  overrides
@@ -6476,15 +6482,15 @@ function getOverridesDataNpm(pkgJson) {
6476
6482
 
6477
6483
  // pnpm overrides documentation:
6478
6484
  // https://pnpm.io/package_json#pnpmoverrides
6479
- function getOverridesDataPnpm(pkgJson) {
6480
- const overrides = pkgJson?.pnpm?.[OVERRIDES$1] ?? {}
6485
+ function getOverridesDataPnpm(editablePkgJson) {
6486
+ const overrides = editablePkgJson.content?.[PNPM$5]?.[OVERRIDES$1] ?? {}
6481
6487
  return {
6482
6488
  type: PNPM$5,
6483
6489
  overrides
6484
6490
  }
6485
6491
  }
6486
- function getOverridesDataVlt(pkgJson) {
6487
- const overrides = pkgJson?.[OVERRIDES$1] ?? {}
6492
+ function getOverridesDataVlt(editablePkgJson) {
6493
+ const overrides = editablePkgJson.content?.[OVERRIDES$1] ?? {}
6488
6494
  return {
6489
6495
  type: VLT$3,
6490
6496
  overrides
@@ -6493,8 +6499,8 @@ function getOverridesDataVlt(pkgJson) {
6493
6499
 
6494
6500
  // Yarn resolutions documentation:
6495
6501
  // https://yarnpkg.com/configuration/manifest#resolutions
6496
- function getOverridesDataYarn(pkgJson) {
6497
- const overrides = pkgJson?.[RESOLUTIONS$1] ?? {}
6502
+ function getOverridesDataYarn(editablePkgJson) {
6503
+ const overrides = editablePkgJson.content?.[RESOLUTIONS$1] ?? {}
6498
6504
  return {
6499
6505
  type: YARN_BERRY$3,
6500
6506
  overrides
@@ -6503,8 +6509,8 @@ function getOverridesDataYarn(pkgJson) {
6503
6509
 
6504
6510
  // Yarn resolutions documentation:
6505
6511
  // https://classic.yarnpkg.com/en/docs/selective-version-resolutions
6506
- function getOverridesDataClassic(pkgJson) {
6507
- const overrides = pkgJson?.[RESOLUTIONS$1] ?? {}
6512
+ function getOverridesDataYarnClassic(editablePkgJson) {
6513
+ const overrides = editablePkgJson.content?.[RESOLUTIONS$1] ?? {}
6508
6514
  return {
6509
6515
  type: YARN_CLASSIC$4,
6510
6516
  overrides
@@ -6516,12 +6522,12 @@ const overridesDataByAgent = new Map([
6516
6522
  [PNPM$5, getOverridesDataPnpm],
6517
6523
  [VLT$3, getOverridesDataVlt],
6518
6524
  [YARN_BERRY$3, getOverridesDataYarn],
6519
- [YARN_CLASSIC$4, getOverridesDataClassic]
6525
+ [YARN_CLASSIC$4, getOverridesDataYarnClassic]
6520
6526
  ])
6521
6527
 
6522
6528
  const { PNPM: PNPM$4 } = constants
6523
6529
  const PNPM_WORKSPACE = `${PNPM$4}-workspace`
6524
- async function getWorkspaceGlobs(agent, pkgPath, pkgJson) {
6530
+ async function getWorkspaceGlobs(agent, pkgPath, editablePkgJson) {
6525
6531
  let workspacePatterns
6526
6532
  if (agent === PNPM$4) {
6527
6533
  for (const workspacePath of [
@@ -6540,7 +6546,7 @@ async function getWorkspaceGlobs(agent, pkgPath, pkgJson) {
6540
6546
  }
6541
6547
  }
6542
6548
  } else {
6543
- workspacePatterns = pkgJson['workspaces']
6549
+ workspacePatterns = editablePkgJson.content['workspaces']
6544
6550
  }
6545
6551
  return Array.isArray(workspacePatterns)
6546
6552
  ? workspacePatterns
@@ -6813,8 +6819,7 @@ function getHighestEntryIndex(entries, keys) {
6813
6819
  return getEntryIndexes(entries, keys).at(-1) ?? -1
6814
6820
  }
6815
6821
  function updatePkgJsonField(editablePkgJson, field, value) {
6816
- const { content: pkgJson } = editablePkgJson
6817
- const oldValue = pkgJson[field]
6822
+ const oldValue = editablePkgJson.content[field]
6818
6823
  if (oldValue) {
6819
6824
  // The field already exists so we simply update the field value.
6820
6825
  if (field === PNPM$1) {
@@ -6865,7 +6870,7 @@ function updatePkgJsonField(editablePkgJson, field, value) {
6865
6870
  // Since the field doesn't exist we want to insert it into the package.json
6866
6871
  // in a place that makes sense, e.g. close to the "dependencies" field. If
6867
6872
  // we can't find a place to insert the field we'll add it to the bottom.
6868
- const entries = Object.entries(pkgJson)
6873
+ const entries = Object.entries(editablePkgJson.content)
6869
6874
  let insertIndex = -1
6870
6875
  let isPlacingHigher = false
6871
6876
  if (field === OVERRIDES) {
@@ -6964,9 +6969,12 @@ async function addOverrides(pkgPath, pkgEnvDetails, options) {
6964
6969
  editable: true
6965
6970
  })
6966
6971
  }
6967
- const { content: pkgJson } = editablePkgJson
6968
6972
  const workspaceName = path$1.relative(rootPath, pkgPath)
6969
- const workspaceGlobs = await getWorkspaceGlobs(agent, pkgPath, pkgJson)
6973
+ const workspaceGlobs = await getWorkspaceGlobs(
6974
+ agent,
6975
+ pkgPath,
6976
+ editablePkgJson
6977
+ )
6970
6978
  const isRoot = pkgPath === rootPath
6971
6979
  const isLockScanned = isRoot && !prod
6972
6980
  const isWorkspace = !!workspaceGlobs
@@ -6986,19 +6994,19 @@ async function addOverrides(pkgPath, pkgEnvDetails, options) {
6986
6994
  )
6987
6995
  }
6988
6996
  const overridesDataObjects = []
6989
- if (pkgJson['private'] || isWorkspace) {
6990
- overridesDataObjects.push(overridesDataByAgent.get(agent)(pkgJson))
6997
+ if (editablePkgJson.content['private'] || isWorkspace) {
6998
+ overridesDataObjects.push(overridesDataByAgent.get(agent)(editablePkgJson))
6991
6999
  } else {
6992
7000
  overridesDataObjects.push(
6993
- overridesDataByAgent.get(NPM$1)(pkgJson),
6994
- overridesDataByAgent.get(YARN_CLASSIC)(pkgJson)
7001
+ overridesDataByAgent.get(NPM$1)(editablePkgJson),
7002
+ overridesDataByAgent.get(YARN_CLASSIC)(editablePkgJson)
6995
7003
  )
6996
7004
  }
6997
7005
  spinner?.setText(
6998
7006
  `Adding overrides${workspaceName ? ` to ${workspaceName}` : ''}...`
6999
7007
  )
7000
7008
  const depAliasMap = new Map()
7001
- const depEntries = getDependencyEntries(pkgJson)
7009
+ const depEntries = getDependencyEntries(editablePkgJson)
7002
7010
  const manifestEntries = manifestNpmOverrides.filter(({ 1: data }) =>
7003
7011
  semver.satisfies(
7004
7012
  // Roughly check Node range as semver.coerce will strip leading
@@ -11341,7 +11349,7 @@ void (async () => {
11341
11349
  await vendor.updater({
11342
11350
  name: SOCKET_CLI_BIN_NAME,
11343
11351
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
11344
- version: '0.14.86',
11352
+ version: '0.14.87',
11345
11353
  ttl: 86_400_000 /* 24 hours in milliseconds */
11346
11354
  })
11347
11355
  try {
@@ -11409,5 +11417,5 @@ void (async () => {
11409
11417
  await shadowNpmInject.captureException(e)
11410
11418
  }
11411
11419
  })()
11412
- //# debugId=708624ad-8bb1-4c03-9aea-19bed2b49a26
11420
+ //# debugId=a4b7d441-5d8c-4b09-b5f2-ba36e572f667
11413
11421
  //# sourceMappingURL=cli.js.map