socket 0.14.104 → 0.14.105

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.
@@ -53,7 +53,7 @@ declare function updatePackageJsonFromNode(
53
53
  node: SafeNode,
54
54
  targetVersion: string,
55
55
  rangeStyle?: RangeStyle | undefined
56
- ): void
56
+ ): boolean
57
57
  export {
58
58
  Packument,
59
59
  findBestPatchVersion,
@@ -900,7 +900,7 @@ function emitBanner(name) {
900
900
  logger.logger.error(getAsciiHeader(name))
901
901
  }
902
902
  function getAsciiHeader(command) {
903
- const cliVersion = '0.14.104:da4a527:eb484e52:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
903
+ const cliVersion = '0.14.105:2179d68:b0be6037:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
904
904
  const nodeVersion = process$1.version
905
905
  const apiToken = shadowNpmInject.getDefaultToken()
906
906
  const shownToken = apiToken ? getLastFiveOfApiToken(apiToken) : 'no'
@@ -4088,19 +4088,6 @@ async function npmFix(
4088
4088
  )
4089
4089
  const newSpec = `${name}@${newVersionRange}`
4090
4090
  const newSpecKey = `${workspaceName ? `${workspaceName}>` : ''}${newSpec}`
4091
- const branch = isCi
4092
- ? getSocketBranchName(oldPurl, newVersion, workspaceName)
4093
- : ''
4094
- const { owner, repo } = isCi
4095
- ? getGitHubEnvRepoInfo()
4096
- : {
4097
- owner: '',
4098
- repo: ''
4099
- }
4100
- const shouldOpenPr = isCi
4101
- ? // eslint-disable-next-line no-await-in-loop
4102
- !(await doesPullRequestExistForBranch(owner, repo, branch))
4103
- : false
4104
4091
  const revertData = {
4105
4092
  ...(editablePkgJson.content.dependencies
4106
4093
  ? {
@@ -4119,30 +4106,45 @@ async function npmFix(
4119
4106
  }
4120
4107
  : undefined)
4121
4108
  }
4122
- if (!installedSpecs.has(newSpecKey)) {
4123
- testedSpecs.add(newSpecKey)
4124
- spinner?.info(`Installing ${newSpec}${workspaceDetails}`)
4109
+ const branch = isCi
4110
+ ? getSocketBranchName(oldPurl, newVersion, workspaceName)
4111
+ : ''
4112
+ const baseBranch = isCi ? getBaseGitBranch() : ''
4113
+ const { owner, repo } = isCi
4114
+ ? getGitHubEnvRepoInfo()
4115
+ : {
4116
+ owner: '',
4117
+ repo: ''
4118
+ }
4119
+ const shouldOpenPr = isCi
4120
+ ? // eslint-disable-next-line no-await-in-loop
4121
+ !(await doesPullRequestExistForBranch(owner, repo, branch))
4122
+ : false
4123
+ if (isCi) {
4124
+ // eslint-disable-next-line no-await-in-loop
4125
+ await gitCheckoutBaseBranchIfAvailable(baseBranch, cwd)
4125
4126
  }
4126
- const baseBranch = getBaseGitBranch()
4127
-
4128
- // eslint-disable-next-line no-await-in-loop
4129
- await gitCheckoutBaseBranchIfAvailable(baseBranch, cwd)
4127
+ shadowNpmInject.updatePackageJsonFromNode(
4128
+ editablePkgJson,
4129
+ arb.idealTree,
4130
+ node,
4131
+ newVersion,
4132
+ rangeStyle
4133
+ )
4130
4134
  let error
4131
4135
  let errored = false
4132
4136
  let installed = false
4133
4137
  let saved = false
4138
+
4139
+ // eslint-disable-next-line no-await-in-loop
4140
+ if (await editablePkgJson.save()) {
4141
+ saved = true
4142
+ }
4143
+ if (!installedSpecs.has(newSpecKey)) {
4144
+ testedSpecs.add(newSpecKey)
4145
+ spinner?.info(`Installing ${newSpec}${workspaceDetails}`)
4146
+ }
4134
4147
  try {
4135
- shadowNpmInject.updatePackageJsonFromNode(
4136
- editablePkgJson,
4137
- arb.idealTree,
4138
- node,
4139
- newVersion,
4140
- rangeStyle
4141
- )
4142
- // eslint-disable-next-line no-await-in-loop
4143
- if (await editablePkgJson.save()) {
4144
- saved = true
4145
- }
4146
4148
  // eslint-disable-next-line no-await-in-loop
4147
4149
  await install$1(arb.idealTree, {
4148
4150
  cwd
@@ -4509,20 +4511,6 @@ async function pnpmFix(
4509
4511
  )
4510
4512
  const newSpec = `${name}@${newVersionRange}`
4511
4513
  const newSpecKey = `${workspaceName ? `${workspaceName}>` : ''}${newSpec}`
4512
- const branch = isCi
4513
- ? getSocketBranchName(oldPurl, newVersion, workspaceName)
4514
- : ''
4515
- const baseBranch = isCi ? getBaseGitBranch() : ''
4516
- const { owner, repo } = isCi
4517
- ? getGitHubEnvRepoInfo()
4518
- : {
4519
- owner: '',
4520
- repo: ''
4521
- }
4522
- const shouldOpenPr = isCi
4523
- ? // eslint-disable-next-line no-await-in-loop
4524
- !(await doesPullRequestExistForBranch(owner, repo, branch))
4525
- : false
4526
4514
  const updateData = isWorkspaceRoot
4527
4515
  ? {
4528
4516
  [PNPM$8]: {
@@ -4533,7 +4521,7 @@ async function pnpmFix(
4533
4521
  }
4534
4522
  }
4535
4523
  }
4536
- : {}
4524
+ : undefined
4537
4525
  const revertData = {
4538
4526
  ...(isWorkspaceRoot
4539
4527
  ? {
@@ -4568,32 +4556,47 @@ async function pnpmFix(
4568
4556
  }
4569
4557
  : undefined)
4570
4558
  }
4571
- if (!installedSpecs.has(newSpecKey)) {
4572
- installedSpecs.add(newSpecKey)
4573
- spinner?.info(`Installing ${newSpec}${workspaceDetails}`)
4574
- }
4559
+ const branch = isCi
4560
+ ? getSocketBranchName(oldPurl, newVersion, workspaceName)
4561
+ : ''
4562
+ const baseBranch = isCi ? getBaseGitBranch() : ''
4563
+ const { owner, repo } = isCi
4564
+ ? getGitHubEnvRepoInfo()
4565
+ : {
4566
+ owner: '',
4567
+ repo: ''
4568
+ }
4569
+ const shouldOpenPr = isCi
4570
+ ? // eslint-disable-next-line no-await-in-loop
4571
+ !(await doesPullRequestExistForBranch(owner, repo, branch))
4572
+ : false
4575
4573
  if (isCi) {
4576
4574
  // eslint-disable-next-line no-await-in-loop
4577
4575
  await gitCheckoutBaseBranchIfAvailable(baseBranch, cwd)
4578
4576
  }
4577
+ if (updateData) {
4578
+ editablePkgJson.update(updateData)
4579
+ }
4580
+ shadowNpmInject.updatePackageJsonFromNode(
4581
+ editablePkgJson,
4582
+ actualTree,
4583
+ node,
4584
+ newVersion,
4585
+ rangeStyle
4586
+ )
4579
4587
  let error
4580
4588
  let errored = false
4581
4589
  let installed = false
4582
- let saved = false
4590
+
4591
+ // eslint-disable-next-line no-await-in-loop
4592
+ if (!(await editablePkgJson.save())) {
4593
+ continue
4594
+ }
4595
+ if (!installedSpecs.has(newSpecKey)) {
4596
+ installedSpecs.add(newSpecKey)
4597
+ spinner?.info(`Installing ${newSpec}${workspaceDetails}`)
4598
+ }
4583
4599
  try {
4584
- editablePkgJson.update(updateData)
4585
- shadowNpmInject.updatePackageJsonFromNode(
4586
- editablePkgJson,
4587
- actualTree,
4588
- node,
4589
- newVersion,
4590
- rangeStyle
4591
- )
4592
- // eslint-disable-next-line no-await-in-loop
4593
- if (!(await editablePkgJson.save())) {
4594
- continue
4595
- }
4596
- saved = true
4597
4600
  // eslint-disable-next-line no-await-in-loop
4598
4601
  actualTree = await install(pkgEnvDetails, {
4599
4602
  spinner
@@ -4651,21 +4654,15 @@ async function pnpmFix(
4651
4654
  spinner?.error(`Reverting ${newSpec}${workspaceDetails}`, error)
4652
4655
  }
4653
4656
  }
4657
+ editablePkgJson.update(revertData)
4654
4658
  if (isRepo) {
4655
4659
  // eslint-disable-next-line no-await-in-loop
4656
4660
  await gitHardReset(cwd)
4657
- }
4658
- if (saved) {
4659
- editablePkgJson.update(revertData)
4660
- if (!isRepo) {
4661
- // eslint-disable-next-line no-await-in-loop
4662
- await editablePkgJson.save()
4663
- }
4664
- }
4665
- if (isRepo) {
4666
4661
  // eslint-disable-next-line no-await-in-loop
4667
4662
  actualTree = await getActualTree(cwd)
4668
4663
  } else if (installed) {
4664
+ // eslint-disable-next-line no-await-in-loop
4665
+ await editablePkgJson.save()
4669
4666
  // eslint-disable-next-line no-await-in-loop
4670
4667
  actualTree = await install(pkgEnvDetails, {
4671
4668
  spinner
@@ -4857,11 +4854,12 @@ async function detectPackageEnvironment({
4857
4854
  editable: true
4858
4855
  })
4859
4856
  : undefined
4860
- const pkgJson = editablePkgJson?.content
4861
4857
  // Read Corepack `packageManager` field in package.json:
4862
4858
  // https://nodejs.org/api/packages.html#packagemanager
4863
- const pkgManager = strings.isNonEmptyString(pkgJson?.packageManager)
4864
- ? pkgJson.packageManager
4859
+ const pkgManager = strings.isNonEmptyString(
4860
+ editablePkgJson?.content?.packageManager
4861
+ )
4862
+ ? editablePkgJson.content.packageManager
4865
4863
  : undefined
4866
4864
  let agent
4867
4865
  let agentVersion
@@ -4909,8 +4907,8 @@ async function detectPackageEnvironment({
4909
4907
  let pkgNodeRange
4910
4908
  let pkgMinAgentVersion = minSupportedAgentVersion
4911
4909
  let pkgMinNodeVersion = minSupportedNodeVersion
4912
- if (pkgJson) {
4913
- const { engines } = pkgJson
4910
+ if (editablePkgJson?.content) {
4911
+ const { engines } = editablePkgJson.content
4914
4912
  const engineAgentRange = engines?.[agent]
4915
4913
  const engineNodeRange = engines?.['node']
4916
4914
  if (strings.isNonEmptyString(engineAgentRange)) {
@@ -4931,7 +4929,7 @@ async function detectPackageEnvironment({
4931
4929
  pkgMinNodeVersion = coerced.version
4932
4930
  }
4933
4931
  }
4934
- const browserslistQuery = pkgJson['browserslist']
4932
+ const browserslistQuery = editablePkgJson.content['browserslist']
4935
4933
  if (Array.isArray(browserslistQuery)) {
4936
4934
  // List Node targets in ascending version order.
4937
4935
  const browserslistNodeTargets = vendor
@@ -11936,7 +11934,7 @@ void (async () => {
11936
11934
  await vendor.updater({
11937
11935
  name: SOCKET_CLI_BIN_NAME,
11938
11936
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
11939
- version: '0.14.104',
11937
+ version: '0.14.105',
11940
11938
  ttl: 86_400_000 /* 24 hours in milliseconds */
11941
11939
  })
11942
11940
  try {
@@ -12004,5 +12002,5 @@ void (async () => {
12004
12002
  await shadowNpmInject.captureException(e)
12005
12003
  }
12006
12004
  })()
12007
- //# debugId=1ff2b705-0a33-4f3c-a683-796f4a562081
12005
+ //# debugId=355c3c9c-6359-4420-bd4f-783c50a21ad6
12008
12006
  //# sourceMappingURL=cli.js.map