socket 0.14.120 → 0.14.122

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.120:d9e8965:5c231098:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
920
+ const cliVersion = '0.14.122:30c1354:72c12a48: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
@@ -4245,9 +4250,13 @@ async function npmFix(
4245
4250
  workspaceName
4246
4251
  }
4247
4252
  )
4248
- if (prResponse && autoMerge) {
4249
- // eslint-disable-next-line no-await-in-loop
4250
- await enableAutoMerge(prResponse.data)
4253
+ if (prResponse) {
4254
+ const { data } = prResponse
4255
+ spinner?.info(`PR #${data.number} opened.`)
4256
+ if (autoMerge) {
4257
+ // eslint-disable-next-line no-await-in-loop
4258
+ await enableAutoMerge(data)
4259
+ }
4251
4260
  }
4252
4261
  }
4253
4262
  if (errored || isCi) {
@@ -4467,29 +4476,30 @@ async function pnpmFix(
4467
4476
 
4468
4477
  // Lazily access constants.ENV[CI].
4469
4478
  const isCi = constants.ENV[CI]
4470
- const {
4471
- 0: isRepo,
4472
- 1: workspacePkgJsonPaths,
4473
- 2: initialTree
4474
- } = await Promise.all([
4479
+ const { 0: isRepo, 1: workspacePkgJsonPaths } = await Promise.all([
4475
4480
  isInGitRepo(cwd),
4476
- shadowNpmInject.globWorkspace(pkgEnvDetails.agent, rootPath),
4477
- getActualTree(cwd)
4481
+ shadowNpmInject.globWorkspace(pkgEnvDetails.agent, rootPath)
4478
4482
  ])
4479
4483
  const pkgJsonPaths = [
4480
4484
  ...workspacePkgJsonPaths,
4481
4485
  // Process the workspace root last since it will add an override to package.json.
4482
4486
  pkgEnvDetails.editablePkgJson.filename
4483
4487
  ]
4484
- let actualTree = initialTree
4488
+ let actualTree
4485
4489
  for (const { 0: name, 1: infos } of infoByPkg) {
4486
4490
  if (registry.getManifestData(NPM$c, name)) {
4487
4491
  spinner?.info(`Skipping ${name}. Socket Optimize package exists.`)
4488
4492
  continue
4489
4493
  }
4494
+ // eslint-disable-next-line no-await-in-loop
4495
+ actualTree = await getActualTree(cwd)
4490
4496
  const oldVersions = arrays.arrayUnique(
4491
- shadowNpmInject.findPackageNodes(actualTree, name).map(n => n.version)
4497
+ shadowNpmInject
4498
+ .findPackageNodes(actualTree, name)
4499
+ .map(n => n.version)
4500
+ .filter(Boolean)
4492
4501
  )
4502
+ debug.debugLog(name, 'oldVersions', oldVersions)
4493
4503
  const packument =
4494
4504
  oldVersions.length && infos.length
4495
4505
  ? // eslint-disable-next-line no-await-in-loop
@@ -4706,9 +4716,13 @@ async function pnpmFix(
4706
4716
  workspaceName
4707
4717
  }
4708
4718
  )
4709
- if (prResponse && autoMerge) {
4710
- // eslint-disable-next-line no-await-in-loop
4711
- await enableAutoMerge(prResponse.data)
4719
+ if (prResponse) {
4720
+ const { data } = prResponse
4721
+ spinner?.info(`PR #${data.number} opened.`)
4722
+ if (autoMerge) {
4723
+ // eslint-disable-next-line no-await-in-loop
4724
+ await enableAutoMerge(data)
4725
+ }
4712
4726
  }
4713
4727
  }
4714
4728
  if (errored || isCi) {
@@ -12313,7 +12327,7 @@ void (async () => {
12313
12327
  await vendor.updater({
12314
12328
  name: SOCKET_CLI_BIN_NAME,
12315
12329
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
12316
- version: '0.14.120',
12330
+ version: '0.14.122',
12317
12331
  ttl: 86_400_000 /* 24 hours in milliseconds */
12318
12332
  })
12319
12333
  try {
@@ -12381,5 +12395,5 @@ void (async () => {
12381
12395
  await shadowNpmInject.captureException(e)
12382
12396
  }
12383
12397
  })()
12384
- //# debugId=776d94c4-537e-4ae8-824d-a4a612fa5e0f
12398
+ //# debugId=e703dfb8-7322-4ac4-9e54-b02c664bb4a2
12385
12399
  //# sourceMappingURL=cli.js.map