socket 1.0.80 → 1.0.81

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.
package/dist/cli.js CHANGED
@@ -3044,8 +3044,8 @@ async function coanaFix(fixConfig) {
3044
3044
  spinner?.stop();
3045
3045
  return lastCResult;
3046
3046
  }
3047
- const isAuto = ghsas.length === 1 && (ghsas[0] === 'all' || ghsas[0] === 'auto');
3048
- const ids = isAuto ? ['all'] : ghsas;
3047
+ const isAllOrAuto = ghsas.length === 1 && (ghsas[0] === 'all' || ghsas[0] === 'auto');
3048
+ const ids = isAllOrAuto ? ['all'] : ghsas;
3049
3049
  const fixCResult = ids.length ? await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...ids, ...fixConfig.unknownFlags], {
3050
3050
  cwd,
3051
3051
  spinner,
@@ -4148,7 +4148,7 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
4148
4148
  return {
4149
4149
  ok: false,
4150
4150
  message: 'Update failed',
4151
- cause: `Update failed for ${oldId} in ${workspace}${error ? '; ' + error : ''}`
4151
+ cause: `Update failed for ${oldId} in ${workspace}${error ? `; ${error}` : ''}`
4152
4152
  };
4153
4153
  } else {
4154
4154
  changed = true;
@@ -4687,6 +4687,7 @@ async function handleFix({
4687
4687
  const {
4688
4688
  DRY_RUN_NOT_SAVING
4689
4689
  } = constants;
4690
+ const DEFAULT_LIMIT = 10;
4690
4691
  const config$H = {
4691
4692
  commandName: 'fix',
4692
4693
  description: 'Update dependencies with "fixable" Socket alerts',
@@ -4712,8 +4713,8 @@ const config$H = {
4712
4713
  },
4713
4714
  limit: {
4714
4715
  type: 'number',
4715
- default: Infinity,
4716
- description: 'The number of fixes to attempt at a time'
4716
+ default: DEFAULT_LIMIT,
4717
+ description: `The number of fixes to attempt at a time (default ${DEFAULT_LIMIT})`
4717
4718
  },
4718
4719
  maxSatisfying: {
4719
4720
  type: 'boolean',
@@ -4735,7 +4736,7 @@ const config$H = {
4735
4736
  purl: {
4736
4737
  type: 'string',
4737
4738
  default: [],
4738
- description: `Provide a list of ${vendor.terminalLinkExports('PURLs', 'https://github.com/package-url/purl-spec?tab=readme-ov-file#purl')} to compute fixes for, as either a comma separated value or as multiple flags,\n instead of querying the Socket API`,
4739
+ description: `Provide a list of ${vendor.terminalLinkExports('PURLs', 'https://github.com/package-url/purl-spec?tab=readme-ov-file#purl')} to compute fixes for, as either a comma separated value or as\n multiple flags, instead of querying the Socket API`,
4739
4740
  isMultiple: true,
4740
4741
  shortFlag: 'p'
4741
4742
  },
@@ -4743,7 +4744,7 @@ const config$H = {
4743
4744
  type: 'string',
4744
4745
  default: 'preserve',
4745
4746
  description: `
4746
- Define how updated dependency versions should be written in package.json.
4747
+ Define how dependency version ranges are updated in package.json (default 'preserve').
4747
4748
  Available styles:
4748
4749
  * caret - Use ^ range for compatible updates (e.g. ^1.2.3)
4749
4750
  * gt - Use > to allow any newer version (e.g. >1.2.3)
@@ -4763,7 +4764,7 @@ const config$H = {
4763
4764
  testScript: {
4764
4765
  type: 'string',
4765
4766
  default: 'test',
4766
- description: 'The test script to run for each fix attempt'
4767
+ description: "The test script to run for fix attempts (default 'test')"
4767
4768
  }
4768
4769
  },
4769
4770
  help: (command, config) => `
@@ -4855,7 +4856,7 @@ async function run$H(argv, importMeta, {
4855
4856
  // socket-cli/patches/meow#13.2.0.patch.
4856
4857
  const unknownFlags = cli.unknownFlags ?? [];
4857
4858
  const ghsas = utils.cmdFlagValueToArray(cli.flags['ghsa']);
4858
- const limit = (cli.flags['limit'] ? parseInt(String(cli.flags['limit'] || ''), 10) : Infinity) || Infinity;
4859
+ const limit = Number(cli.flags['limit']) || DEFAULT_LIMIT;
4859
4860
  const maxSatisfying = Boolean(cli.flags['maxSatisfying']);
4860
4861
  const minSatisfying = Boolean(cli.flags['minSatisfying']) || !maxSatisfying;
4861
4862
  const prCheck = Boolean(cli.flags['prCheck']);
@@ -7891,10 +7892,10 @@ async function applyOptimization(pkgEnvDetails, {
7891
7892
  ok: true,
7892
7893
  data: {
7893
7894
  addedCount,
7894
- updatedCount,
7895
+ addedInWorkspaces: state.addedInWorkspaces.size,
7895
7896
  pkgJsonChanged,
7896
- updatedInWorkspaces: state.updatedInWorkspaces.size,
7897
- addedInWorkspaces: state.addedInWorkspaces.size
7897
+ updatedCount,
7898
+ updatedInWorkspaces: state.updatedInWorkspaces.size
7898
7899
  }
7899
7900
  };
7900
7901
  }
@@ -7964,7 +7965,7 @@ async function handleOptimize({
7964
7965
  await outputOptimizeResult({
7965
7966
  ok: false,
7966
7967
  message: 'Unsupported',
7967
- cause: utils.cmdPrefixMessage(CMD_NAME, `${agent} v${agentVersion} does not support overrides. Soon, though ⚡`)
7968
+ cause: utils.cmdPrefixMessage(CMD_NAME, `${agent} v${agentVersion} does not support overrides.`)
7968
7969
  }, outputKind);
7969
7970
  return;
7970
7971
  }
@@ -14629,5 +14630,5 @@ void (async () => {
14629
14630
  await utils.captureException(e);
14630
14631
  }
14631
14632
  })();
14632
- //# debugId=6fe85e04-7139-46a4-be64-93d64600371
14633
+ //# debugId=8579bbdd-d381-460b-9333-6759b277974a
14633
14634
  //# sourceMappingURL=cli.js.map