@socketsecurity/cli-with-sentry 0.14.121 → 0.14.123

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.121:002547b:1fdc0d88:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
920
+ const cliVersion = '0.14.123:ac83b62:6bf8f885: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')
@@ -4063,15 +4063,20 @@ async function npmFix(
4063
4063
  // Process the workspace root last since it will add an override to package.json.
4064
4064
  pkgEnvDetails.editablePkgJson.filename
4065
4065
  ]
4066
- await arb.buildIdealTree()
4067
4066
  for (const { 0: name, 1: infos } of infoByPkg) {
4068
4067
  const hasUpgrade = !!registry.getManifestData(NPM$f, name)
4069
4068
  if (hasUpgrade) {
4070
4069
  spinner?.info(`Skipping ${name}. Socket Optimize package exists.`)
4071
4070
  continue
4072
4071
  }
4072
+ arb.idealTree = null
4073
+ // eslint-disable-next-line no-await-in-loop
4074
+ await arb.buildIdealTree()
4073
4075
  const oldVersions = arrays.arrayUnique(
4074
- shadowNpmInject.findPackageNodes(arb.idealTree, name).map(n => n.version)
4076
+ shadowNpmInject
4077
+ .findPackageNodes(arb.idealTree, name)
4078
+ .map(n => n.version)
4079
+ .filter(Boolean)
4075
4080
  )
4076
4081
  const packument =
4077
4082
  oldVersions.length && infos.length
@@ -4475,28 +4480,35 @@ async function pnpmFix(
4475
4480
 
4476
4481
  // Lazily access constants.ENV[CI].
4477
4482
  const isCi = constants.ENV[CI]
4478
- const {
4479
- 0: isRepo,
4480
- 1: workspacePkgJsonPaths,
4481
- 2: initialTree
4482
- } = await Promise.all([
4483
+ const { 0: isRepo, 1: workspacePkgJsonPaths } = await Promise.all([
4483
4484
  isInGitRepo(cwd),
4484
- shadowNpmInject.globWorkspace(pkgEnvDetails.agent, rootPath),
4485
- getActualTree(cwd)
4485
+ shadowNpmInject.globWorkspace(pkgEnvDetails.agent, rootPath)
4486
4486
  ])
4487
4487
  const pkgJsonPaths = [
4488
4488
  ...workspacePkgJsonPaths,
4489
4489
  // Process the workspace root last since it will add an override to package.json.
4490
4490
  pkgEnvDetails.editablePkgJson.filename
4491
4491
  ]
4492
- let actualTree = initialTree
4492
+ let actualTree
4493
4493
  for (const { 0: name, 1: infos } of infoByPkg) {
4494
4494
  if (registry.getManifestData(NPM$c, name)) {
4495
4495
  spinner?.info(`Skipping ${name}. Socket Optimize package exists.`)
4496
4496
  continue
4497
4497
  }
4498
+ // eslint-disable-next-line no-await-in-loop
4499
+ await Promise.all([
4500
+ shadowNpmInject.removeNodeModules(cwd),
4501
+ ...(isRepo ? [gitHardReset(cwd)] : [])
4502
+ ])
4503
+ // eslint-disable-next-line no-await-in-loop
4504
+ actualTree = await install(pkgEnvDetails, {
4505
+ spinner
4506
+ })
4498
4507
  const oldVersions = arrays.arrayUnique(
4499
- shadowNpmInject.findPackageNodes(actualTree, name).map(n => n.version)
4508
+ shadowNpmInject
4509
+ .findPackageNodes(actualTree, name)
4510
+ .map(n => n.version)
4511
+ .filter(Boolean)
4500
4512
  )
4501
4513
  debug.debugLog(name, 'oldVersions', oldVersions)
4502
4514
  const packument =
@@ -4522,7 +4534,14 @@ async function pnpmFix(
4522
4534
  vulnerableVersionRange
4523
4535
  } of infos) {
4524
4536
  // eslint-disable-next-line no-await-in-loop
4525
- actualTree = await getActualTree()
4537
+ await Promise.all([
4538
+ shadowNpmInject.removeNodeModules(cwd),
4539
+ ...(isRepo ? [gitHardReset(cwd)] : [])
4540
+ ])
4541
+ // eslint-disable-next-line no-await-in-loop
4542
+ actualTree = await install(pkgEnvDetails, {
4543
+ spinner
4544
+ })
4526
4545
  const node = shadowNpmInject.findPackageNode(
4527
4546
  actualTree,
4528
4547
  name,
@@ -12326,7 +12345,7 @@ void (async () => {
12326
12345
  await vendor.updater({
12327
12346
  name: SOCKET_CLI_BIN_NAME,
12328
12347
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
12329
- version: '0.14.121',
12348
+ version: '0.14.123',
12330
12349
  ttl: 86_400_000 /* 24 hours in milliseconds */
12331
12350
  })
12332
12351
  try {
@@ -12394,5 +12413,5 @@ void (async () => {
12394
12413
  await shadowNpmInject.captureException(e)
12395
12414
  }
12396
12415
  })()
12397
- //# debugId=524536b6-4081-429c-a851-5e74eb74ccb7
12416
+ //# debugId=645892ec-7104-4af0-915a-c1219b90c91c
12398
12417
  //# sourceMappingURL=cli.js.map