socket 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:753db578:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
920
+ const cliVersion = '0.14.123:ac83b62:9fc01fd8: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
@@ -4471,28 +4476,35 @@ async function pnpmFix(
4471
4476
 
4472
4477
  // Lazily access constants.ENV[CI].
4473
4478
  const isCi = constants.ENV[CI]
4474
- const {
4475
- 0: isRepo,
4476
- 1: workspacePkgJsonPaths,
4477
- 2: initialTree
4478
- } = await Promise.all([
4479
+ const { 0: isRepo, 1: workspacePkgJsonPaths } = await Promise.all([
4479
4480
  isInGitRepo(cwd),
4480
- shadowNpmInject.globWorkspace(pkgEnvDetails.agent, rootPath),
4481
- getActualTree(cwd)
4481
+ shadowNpmInject.globWorkspace(pkgEnvDetails.agent, rootPath)
4482
4482
  ])
4483
4483
  const pkgJsonPaths = [
4484
4484
  ...workspacePkgJsonPaths,
4485
4485
  // Process the workspace root last since it will add an override to package.json.
4486
4486
  pkgEnvDetails.editablePkgJson.filename
4487
4487
  ]
4488
- let actualTree = initialTree
4488
+ let actualTree
4489
4489
  for (const { 0: name, 1: infos } of infoByPkg) {
4490
4490
  if (registry.getManifestData(NPM$c, name)) {
4491
4491
  spinner?.info(`Skipping ${name}. Socket Optimize package exists.`)
4492
4492
  continue
4493
4493
  }
4494
+ // eslint-disable-next-line no-await-in-loop
4495
+ await Promise.all([
4496
+ shadowNpmInject.removeNodeModules(cwd),
4497
+ ...(isRepo ? [gitHardReset(cwd)] : [])
4498
+ ])
4499
+ // eslint-disable-next-line no-await-in-loop
4500
+ actualTree = await install(pkgEnvDetails, {
4501
+ spinner
4502
+ })
4494
4503
  const oldVersions = arrays.arrayUnique(
4495
- shadowNpmInject.findPackageNodes(actualTree, name).map(n => n.version)
4504
+ shadowNpmInject
4505
+ .findPackageNodes(actualTree, name)
4506
+ .map(n => n.version)
4507
+ .filter(Boolean)
4496
4508
  )
4497
4509
  debug.debugLog(name, 'oldVersions', oldVersions)
4498
4510
  const packument =
@@ -4518,7 +4530,14 @@ async function pnpmFix(
4518
4530
  vulnerableVersionRange
4519
4531
  } of infos) {
4520
4532
  // eslint-disable-next-line no-await-in-loop
4521
- actualTree = await getActualTree()
4533
+ await Promise.all([
4534
+ shadowNpmInject.removeNodeModules(cwd),
4535
+ ...(isRepo ? [gitHardReset(cwd)] : [])
4536
+ ])
4537
+ // eslint-disable-next-line no-await-in-loop
4538
+ actualTree = await install(pkgEnvDetails, {
4539
+ spinner
4540
+ })
4522
4541
  const node = shadowNpmInject.findPackageNode(
4523
4542
  actualTree,
4524
4543
  name,
@@ -12322,7 +12341,7 @@ void (async () => {
12322
12341
  await vendor.updater({
12323
12342
  name: SOCKET_CLI_BIN_NAME,
12324
12343
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
12325
- version: '0.14.121',
12344
+ version: '0.14.123',
12326
12345
  ttl: 86_400_000 /* 24 hours in milliseconds */
12327
12346
  })
12328
12347
  try {
@@ -12390,5 +12409,5 @@ void (async () => {
12390
12409
  await shadowNpmInject.captureException(e)
12391
12410
  }
12392
12411
  })()
12393
- //# debugId=a9198775-d997-4ba2-a631-647708910271
12412
+ //# debugId=5bad9b77-6e22-4b32-a047-7f16520f50a3
12394
12413
  //# sourceMappingURL=cli.js.map