@socketsecurity/cli-with-sentry 0.14.113 → 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.113:753a37f:0c2e5474: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)) {
@@ -4523,6 +4518,7 @@ async function pnpmFix(
4523
4518
  oldVersion
4524
4519
  )
4525
4520
  if (!node) {
4521
+ debug.debugLog('skipping no node', pkgJsonPath)
4526
4522
  continue
4527
4523
  }
4528
4524
  const availableVersions = Object.keys(packument.versions)
@@ -4641,7 +4637,6 @@ async function pnpmFix(
4641
4637
  rangeStyle
4642
4638
  )
4643
4639
  debug.debugLog('updatePackageJsonFromNode', modded)
4644
- debug.debugLog(branch, editablePkgJson.filename)
4645
4640
  let error
4646
4641
  let errored = false
4647
4642
  let installed = false
@@ -4683,17 +4678,13 @@ async function pnpmFix(
4683
4678
  error = e
4684
4679
  errored = true
4685
4680
  }
4686
- debug.debugLog('check "shouldOpenPr":', shouldOpenPr)
4687
- debug.debugLog('check "errored":', errored)
4688
4681
  if (!errored && shouldOpenPr) {
4689
- debug.debugLog('1: gitCreateAndPushBranchIfNeeded')
4690
4682
  // eslint-disable-next-line no-await-in-loop
4691
4683
  await gitCreateAndPushBranchIfNeeded(
4692
4684
  branch,
4693
4685
  getSocketCommitMessage(oldPurl, newVersion, workspaceName),
4694
4686
  cwd
4695
4687
  )
4696
- debug.debugLog('2: openGitHubPullRequest')
4697
4688
  // eslint-disable-next-line no-await-in-loop
4698
4689
  const prResponse = await openGitHubPullRequest(
4699
4690
  owner,
@@ -4720,6 +4711,8 @@ async function pnpmFix(
4720
4711
  }
4721
4712
  }
4722
4713
  editablePkgJson.update(revertData)
4714
+ // eslint-disable-next-line no-await-in-loop
4715
+ await shadowNpmInject.removeNodeModules(cwd)
4723
4716
  if (isRepo) {
4724
4717
  // eslint-disable-next-line no-await-in-loop
4725
4718
  await gitHardReset(cwd)
@@ -7518,7 +7511,10 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
7518
7511
  updated: new Set(),
7519
7512
  updatedInWorkspaces: new Set(),
7520
7513
  warnedPnpmWorkspaceRequiresNpm: false,
7521
- workspacePkgJsonPaths: await shadowNpmPaths.globWorkspace(pkgEnvDetails)
7514
+ workspacePkgJsonPaths: await shadowNpmInject.globWorkspace(
7515
+ agent,
7516
+ rootPath
7517
+ )
7522
7518
  }
7523
7519
  } = {
7524
7520
  __proto__: null,
@@ -12311,7 +12307,7 @@ void (async () => {
12311
12307
  await vendor.updater({
12312
12308
  name: SOCKET_CLI_BIN_NAME,
12313
12309
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
12314
- version: '0.14.113',
12310
+ version: '0.14.115',
12315
12311
  ttl: 86_400_000 /* 24 hours in milliseconds */
12316
12312
  })
12317
12313
  try {
@@ -12379,5 +12375,5 @@ void (async () => {
12379
12375
  await shadowNpmInject.captureException(e)
12380
12376
  }
12381
12377
  })()
12382
- //# debugId=1f254f8b-5b98-4df3-b06d-39d2637bc819
12378
+ //# debugId=96cafc13-031a-4b82-add7-4bee8788d10
12383
12379
  //# sourceMappingURL=cli.js.map