@socketsecurity/cli-with-sentry 0.14.114 → 0.14.115

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.
@@ -917,7 +917,7 @@ function emitBanner(name) {
917
917
  logger.logger.error(getAsciiHeader(name))
918
918
  }
919
919
  function getAsciiHeader(command) {
920
- const cliVersion = '0.14.114:6709538:d8784340:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
920
+ const cliVersion = '0.14.115:b2d12c7:07656ade:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
921
921
  const nodeVersion = process$1.version
922
922
  const apiToken = shadowNpmInject.getDefaultToken()
923
923
  const defaultOrg = shadowNpmInject.getConfigValue('defaultOrg')
@@ -3831,11 +3831,6 @@ async function gitCreateAndPushBranchIfNeeded(
3831
3831
  basename === 'pnpm-lock.yaml'
3832
3832
  )
3833
3833
  })
3834
- debug.debugLog('branch', branch)
3835
- debug.debugLog(
3836
- 'gitCreateAndPushBranchIfNeeded > moddedFilepaths',
3837
- moddedFilepaths
3838
- )
3839
3834
  if (moddedFilepaths.length) {
3840
3835
  await spawn.spawn('git', ['add', ...moddedFilepaths], {
3841
3836
  cwd
@@ -4030,9 +4025,10 @@ async function npmFix(
4030
4025
  pkgEnvDetails,
4031
4026
  { autoMerge, cwd, purls, rangeStyle, spinner, test, testScript }
4032
4027
  ) {
4028
+ const { pkgPath: rootPath } = pkgEnvDetails
4033
4029
  spinner?.start()
4034
4030
  const arb = new shadowNpmInject.SafeArborist({
4035
- path: pkgEnvDetails.pkgPath,
4031
+ path: rootPath,
4036
4032
  ...shadowNpmInject.SAFE_ARBORIST_REIFY_OPTIONS_OVERRIDES
4037
4033
  })
4038
4034
  // Calling arb.reify() creates the arb.diff object and nulls-out arb.idealTree.
@@ -4057,14 +4053,14 @@ async function npmFix(
4057
4053
 
4058
4054
  // Lazily access constants.ENV[CI].
4059
4055
  const isCi = constants.ENV[CI$1]
4060
- const { pkgPath: rootPath } = pkgEnvDetails
4061
4056
  const { 0: isRepo, 1: workspacePkgJsonPaths } = await Promise.all([
4062
4057
  isInGitRepo(cwd),
4063
- shadowNpmPaths.globWorkspace(pkgEnvDetails)
4058
+ shadowNpmInject.globWorkspace(pkgEnvDetails.agent, rootPath)
4064
4059
  ])
4065
4060
  const pkgJsonPaths = [
4066
- pkgEnvDetails.editablePkgJson.filename,
4067
- ...workspacePkgJsonPaths
4061
+ ...workspacePkgJsonPaths,
4062
+ // Process the workspace root last since it will add an override to package.json.
4063
+ pkgEnvDetails.editablePkgJson.filename
4068
4064
  ]
4069
4065
  await arb.buildIdealTree()
4070
4066
  for (const { 0: name, 1: infos } of infoByPkg) {
@@ -4253,6 +4249,8 @@ async function npmFix(
4253
4249
  spinner?.error(`Reverting ${newSpec}${workspaceDetails}`, error)
4254
4250
  }
4255
4251
  }
4252
+ // eslint-disable-next-line no-await-in-loop
4253
+ await shadowNpmInject.removeNodeModules(cwd)
4256
4254
  if (isRepo) {
4257
4255
  // eslint-disable-next-line no-await-in-loop
4258
4256
  await gitHardReset(cwd)
@@ -4439,12 +4437,10 @@ async function pnpmFix(
4439
4437
  pkgEnvDetails,
4440
4438
  { autoMerge, cwd, purls, rangeStyle, spinner, test, testScript }
4441
4439
  ) {
4442
- const lockfile = await vendor.libExports$3.readWantedLockfile(
4443
- pkgEnvDetails.pkgPath,
4444
- {
4445
- ignoreIncompatible: false
4446
- }
4447
- )
4440
+ const { pkgPath: rootPath } = pkgEnvDetails
4441
+ const lockfile = await vendor.libExports$3.readWantedLockfile(rootPath, {
4442
+ ignoreIncompatible: false
4443
+ })
4448
4444
  if (!lockfile) {
4449
4445
  return
4450
4446
  }
@@ -4471,21 +4467,20 @@ async function pnpmFix(
4471
4467
 
4472
4468
  // Lazily access constants.ENV[CI].
4473
4469
  const isCi = constants.ENV[CI]
4474
- const { pkgPath: rootPath } = pkgEnvDetails
4475
4470
  const {
4476
4471
  0: isRepo,
4477
4472
  1: workspacePkgJsonPaths,
4478
4473
  2: initialTree
4479
4474
  } = await Promise.all([
4480
4475
  isInGitRepo(cwd),
4481
- shadowNpmPaths.globWorkspace(pkgEnvDetails),
4476
+ shadowNpmInject.globWorkspace(pkgEnvDetails.agent, rootPath),
4482
4477
  getActualTree(cwd)
4483
4478
  ])
4484
4479
  const pkgJsonPaths = [
4485
- pkgEnvDetails.editablePkgJson.filename,
4486
- ...workspacePkgJsonPaths
4480
+ ...workspacePkgJsonPaths,
4481
+ // Process the workspace root last since it will add an override to package.json.
4482
+ pkgEnvDetails.editablePkgJson.filename
4487
4483
  ]
4488
- debug.debugLog('workspacePkgJsonPaths', workspacePkgJsonPaths)
4489
4484
  let actualTree = initialTree
4490
4485
  for (const { 0: name, 1: infos } of infoByPkg) {
4491
4486
  if (registry.getManifestData(NPM$c, name)) {
@@ -4517,9 +4512,6 @@ async function pnpmFix(
4517
4512
  firstPatchedVersionIdentifier,
4518
4513
  vulnerableVersionRange
4519
4514
  } of infos) {
4520
- debug.debugLog('name', name)
4521
- debug.debugLog('oldVersion', oldVersion)
4522
- debug.debugLog('pkgJsonPath', pkgJsonPath)
4523
4515
  const node = shadowNpmInject.findPackageNode(
4524
4516
  actualTree,
4525
4517
  name,
@@ -4645,7 +4637,6 @@ async function pnpmFix(
4645
4637
  rangeStyle
4646
4638
  )
4647
4639
  debug.debugLog('updatePackageJsonFromNode', modded)
4648
- debug.debugLog(branch, editablePkgJson.filename)
4649
4640
  let error
4650
4641
  let errored = false
4651
4642
  let installed = false
@@ -4687,17 +4678,13 @@ async function pnpmFix(
4687
4678
  error = e
4688
4679
  errored = true
4689
4680
  }
4690
- debug.debugLog('check "shouldOpenPr":', shouldOpenPr)
4691
- debug.debugLog('check "errored":', errored)
4692
4681
  if (!errored && shouldOpenPr) {
4693
- debug.debugLog('1: gitCreateAndPushBranchIfNeeded')
4694
4682
  // eslint-disable-next-line no-await-in-loop
4695
4683
  await gitCreateAndPushBranchIfNeeded(
4696
4684
  branch,
4697
4685
  getSocketCommitMessage(oldPurl, newVersion, workspaceName),
4698
4686
  cwd
4699
4687
  )
4700
- debug.debugLog('2: openGitHubPullRequest')
4701
4688
  // eslint-disable-next-line no-await-in-loop
4702
4689
  const prResponse = await openGitHubPullRequest(
4703
4690
  owner,
@@ -4724,6 +4711,8 @@ async function pnpmFix(
4724
4711
  }
4725
4712
  }
4726
4713
  editablePkgJson.update(revertData)
4714
+ // eslint-disable-next-line no-await-in-loop
4715
+ await shadowNpmInject.removeNodeModules(cwd)
4727
4716
  if (isRepo) {
4728
4717
  // eslint-disable-next-line no-await-in-loop
4729
4718
  await gitHardReset(cwd)
@@ -7522,7 +7511,10 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
7522
7511
  updated: new Set(),
7523
7512
  updatedInWorkspaces: new Set(),
7524
7513
  warnedPnpmWorkspaceRequiresNpm: false,
7525
- workspacePkgJsonPaths: await shadowNpmPaths.globWorkspace(pkgEnvDetails)
7514
+ workspacePkgJsonPaths: await shadowNpmInject.globWorkspace(
7515
+ agent,
7516
+ rootPath
7517
+ )
7526
7518
  }
7527
7519
  } = {
7528
7520
  __proto__: null,
@@ -12315,7 +12307,7 @@ void (async () => {
12315
12307
  await vendor.updater({
12316
12308
  name: SOCKET_CLI_BIN_NAME,
12317
12309
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
12318
- version: '0.14.114',
12310
+ version: '0.14.115',
12319
12311
  ttl: 86_400_000 /* 24 hours in milliseconds */
12320
12312
  })
12321
12313
  try {
@@ -12383,5 +12375,5 @@ void (async () => {
12383
12375
  await shadowNpmInject.captureException(e)
12384
12376
  }
12385
12377
  })()
12386
- //# debugId=79766fe4-6a25-4f10-93af-69276e4074ab
12378
+ //# debugId=96cafc13-031a-4b82-add7-4bee8788d10
12387
12379
  //# sourceMappingURL=cli.js.map