socket 0.14.114 → 0.14.116

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:c3c69119:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
920
+ const cliVersion = '0.14.116:0dae31b:0be36591: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
@@ -3905,7 +3900,6 @@ async function doesPullRequestExistForBranch(owner, repo, branch) {
3905
3900
  head: `${owner}:${branch}`,
3906
3901
  state: 'open'
3907
3902
  })
3908
- debug.debugLog('doesPullRequestExistForBranch > prs', prs)
3909
3903
  return prs.length > 0
3910
3904
  } catch {}
3911
3905
  return false
@@ -4030,9 +4024,10 @@ async function npmFix(
4030
4024
  pkgEnvDetails,
4031
4025
  { autoMerge, cwd, purls, rangeStyle, spinner, test, testScript }
4032
4026
  ) {
4027
+ const { pkgPath: rootPath } = pkgEnvDetails
4033
4028
  spinner?.start()
4034
4029
  const arb = new shadowNpmInject.SafeArborist({
4035
- path: pkgEnvDetails.pkgPath,
4030
+ path: rootPath,
4036
4031
  ...shadowNpmInject.SAFE_ARBORIST_REIFY_OPTIONS_OVERRIDES
4037
4032
  })
4038
4033
  // Calling arb.reify() creates the arb.diff object and nulls-out arb.idealTree.
@@ -4057,14 +4052,14 @@ async function npmFix(
4057
4052
 
4058
4053
  // Lazily access constants.ENV[CI].
4059
4054
  const isCi = constants.ENV[CI$1]
4060
- const { pkgPath: rootPath } = pkgEnvDetails
4061
4055
  const { 0: isRepo, 1: workspacePkgJsonPaths } = await Promise.all([
4062
4056
  isInGitRepo(cwd),
4063
- shadowNpmPaths.globWorkspace(pkgEnvDetails)
4057
+ shadowNpmInject.globWorkspace(pkgEnvDetails.agent, rootPath)
4064
4058
  ])
4065
4059
  const pkgJsonPaths = [
4066
- pkgEnvDetails.editablePkgJson.filename,
4067
- ...workspacePkgJsonPaths
4060
+ ...workspacePkgJsonPaths,
4061
+ // Process the workspace root last since it will add an override to package.json.
4062
+ pkgEnvDetails.editablePkgJson.filename
4068
4063
  ]
4069
4064
  await arb.buildIdealTree()
4070
4065
  for (const { 0: name, 1: infos } of infoByPkg) {
@@ -4253,6 +4248,8 @@ async function npmFix(
4253
4248
  spinner?.error(`Reverting ${newSpec}${workspaceDetails}`, error)
4254
4249
  }
4255
4250
  }
4251
+ // eslint-disable-next-line no-await-in-loop
4252
+ await shadowNpmInject.removeNodeModules(cwd)
4256
4253
  if (isRepo) {
4257
4254
  // eslint-disable-next-line no-await-in-loop
4258
4255
  await gitHardReset(cwd)
@@ -4435,12 +4432,10 @@ async function pnpmFix(
4435
4432
  pkgEnvDetails,
4436
4433
  { autoMerge, cwd, purls, rangeStyle, spinner, test, testScript }
4437
4434
  ) {
4438
- const lockfile = await vendor.libExports$3.readWantedLockfile(
4439
- pkgEnvDetails.pkgPath,
4440
- {
4441
- ignoreIncompatible: false
4442
- }
4443
- )
4435
+ const { pkgPath: rootPath } = pkgEnvDetails
4436
+ const lockfile = await vendor.libExports$3.readWantedLockfile(rootPath, {
4437
+ ignoreIncompatible: false
4438
+ })
4444
4439
  if (!lockfile) {
4445
4440
  return
4446
4441
  }
@@ -4467,21 +4462,20 @@ async function pnpmFix(
4467
4462
 
4468
4463
  // Lazily access constants.ENV[CI].
4469
4464
  const isCi = constants.ENV[CI]
4470
- const { pkgPath: rootPath } = pkgEnvDetails
4471
4465
  const {
4472
4466
  0: isRepo,
4473
4467
  1: workspacePkgJsonPaths,
4474
4468
  2: initialTree
4475
4469
  } = await Promise.all([
4476
4470
  isInGitRepo(cwd),
4477
- shadowNpmPaths.globWorkspace(pkgEnvDetails),
4471
+ shadowNpmInject.globWorkspace(pkgEnvDetails.agent, rootPath),
4478
4472
  getActualTree(cwd)
4479
4473
  ])
4480
4474
  const pkgJsonPaths = [
4481
- pkgEnvDetails.editablePkgJson.filename,
4482
- ...workspacePkgJsonPaths
4475
+ ...workspacePkgJsonPaths,
4476
+ // Process the workspace root last since it will add an override to package.json.
4477
+ pkgEnvDetails.editablePkgJson.filename
4483
4478
  ]
4484
- debug.debugLog('workspacePkgJsonPaths', workspacePkgJsonPaths)
4485
4479
  let actualTree = initialTree
4486
4480
  for (const { 0: name, 1: infos } of infoByPkg) {
4487
4481
  if (registry.getManifestData(NPM$c, name)) {
@@ -4513,9 +4507,6 @@ async function pnpmFix(
4513
4507
  firstPatchedVersionIdentifier,
4514
4508
  vulnerableVersionRange
4515
4509
  } of infos) {
4516
- debug.debugLog('name', name)
4517
- debug.debugLog('oldVersion', oldVersion)
4518
- debug.debugLog('pkgJsonPath', pkgJsonPath)
4519
4510
  const node = shadowNpmInject.findPackageNode(
4520
4511
  actualTree,
4521
4512
  name,
@@ -4641,7 +4632,6 @@ async function pnpmFix(
4641
4632
  rangeStyle
4642
4633
  )
4643
4634
  debug.debugLog('updatePackageJsonFromNode', modded)
4644
- debug.debugLog(branch, editablePkgJson.filename)
4645
4635
  let error
4646
4636
  let errored = false
4647
4637
  let installed = false
@@ -4683,17 +4673,13 @@ async function pnpmFix(
4683
4673
  error = e
4684
4674
  errored = true
4685
4675
  }
4686
- debug.debugLog('check "shouldOpenPr":', shouldOpenPr)
4687
- debug.debugLog('check "errored":', errored)
4688
4676
  if (!errored && shouldOpenPr) {
4689
- debug.debugLog('1: gitCreateAndPushBranchIfNeeded')
4690
4677
  // eslint-disable-next-line no-await-in-loop
4691
4678
  await gitCreateAndPushBranchIfNeeded(
4692
4679
  branch,
4693
4680
  getSocketCommitMessage(oldPurl, newVersion, workspaceName),
4694
4681
  cwd
4695
4682
  )
4696
- debug.debugLog('2: openGitHubPullRequest')
4697
4683
  // eslint-disable-next-line no-await-in-loop
4698
4684
  const prResponse = await openGitHubPullRequest(
4699
4685
  owner,
@@ -4720,6 +4706,8 @@ async function pnpmFix(
4720
4706
  }
4721
4707
  }
4722
4708
  editablePkgJson.update(revertData)
4709
+ // eslint-disable-next-line no-await-in-loop
4710
+ await shadowNpmInject.removeNodeModules(cwd)
4723
4711
  if (isRepo) {
4724
4712
  // eslint-disable-next-line no-await-in-loop
4725
4713
  await gitHardReset(cwd)
@@ -7518,7 +7506,10 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
7518
7506
  updated: new Set(),
7519
7507
  updatedInWorkspaces: new Set(),
7520
7508
  warnedPnpmWorkspaceRequiresNpm: false,
7521
- workspacePkgJsonPaths: await shadowNpmPaths.globWorkspace(pkgEnvDetails)
7509
+ workspacePkgJsonPaths: await shadowNpmInject.globWorkspace(
7510
+ agent,
7511
+ rootPath
7512
+ )
7522
7513
  }
7523
7514
  } = {
7524
7515
  __proto__: null,
@@ -12311,7 +12302,7 @@ void (async () => {
12311
12302
  await vendor.updater({
12312
12303
  name: SOCKET_CLI_BIN_NAME,
12313
12304
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
12314
- version: '0.14.114',
12305
+ version: '0.14.116',
12315
12306
  ttl: 86_400_000 /* 24 hours in milliseconds */
12316
12307
  })
12317
12308
  try {
@@ -12379,5 +12370,5 @@ void (async () => {
12379
12370
  await shadowNpmInject.captureException(e)
12380
12371
  }
12381
12372
  })()
12382
- //# debugId=c9a1b3d7-691f-4424-8e65-e9bc8d0adfc7
12373
+ //# debugId=3e5ae09a-9e97-4ee4-afe7-c5b14260eb95
12383
12374
  //# sourceMappingURL=cli.js.map