socket 1.1.11 → 1.1.13

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.
Files changed (95) hide show
  1. package/CHANGELOG.md +49 -28
  2. package/bin/cli.js +2 -1
  3. package/bin/npm-cli.js +2 -1
  4. package/bin/npx-cli.js +2 -1
  5. package/bin/pnpm-cli.js +29 -0
  6. package/bin/yarn-cli.js +29 -0
  7. package/dist/cli.js +728 -532
  8. package/dist/cli.js.map +1 -1
  9. package/dist/constants.js +27 -5
  10. package/dist/constants.js.map +1 -1
  11. package/dist/npm-cli.js +26 -0
  12. package/dist/npm-cli.js.map +1 -0
  13. package/dist/npx-cli.js +26 -0
  14. package/dist/npx-cli.js.map +1 -0
  15. package/dist/pnpm-cli.js +26 -0
  16. package/dist/pnpm-cli.js.map +1 -0
  17. package/dist/shadow-npm-inject.js +2 -2
  18. package/dist/shadow-npm-inject.js.map +1 -1
  19. package/dist/shadow-pnpm-bin.js +235 -0
  20. package/dist/shadow-pnpm-bin.js.map +1 -0
  21. package/dist/shadow-yarn-bin.js +200 -0
  22. package/dist/shadow-yarn-bin.js.map +1 -0
  23. package/dist/tsconfig.dts.tsbuildinfo +1 -1
  24. package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -1
  25. package/dist/types/commands/fix/coana-fix.d.mts.map +1 -1
  26. package/dist/types/commands/fix/handle-fix.d.mts +3 -1
  27. package/dist/types/commands/fix/handle-fix.d.mts.map +1 -1
  28. package/dist/types/commands/fix/pull-request.d.mts.map +1 -1
  29. package/dist/types/commands/fix/types.d.mts +2 -0
  30. package/dist/types/commands/fix/types.d.mts.map +1 -1
  31. package/dist/types/commands/json/cmd-json.d.mts.map +1 -1
  32. package/dist/types/commands/manifest/cmd-manifest-conda.d.mts.map +1 -1
  33. package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts.map +1 -1
  34. package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts.map +1 -1
  35. package/dist/types/commands/manifest/cmd-manifest-setup.d.mts.map +1 -1
  36. package/dist/types/commands/manifest/cmd-manifest.d.mts.map +1 -1
  37. package/dist/types/commands/manifest/detect-manifest-actions.d.mts.map +1 -1
  38. package/dist/types/commands/manifest/generate_auto_manifest.d.mts.map +1 -1
  39. package/dist/types/commands/manifest/output-requirements.d.mts.map +1 -1
  40. package/dist/types/commands/manifest/run-cdxgen.d.mts.map +1 -1
  41. package/dist/types/commands/manifest/setup-manifest-config.d.mts.map +1 -1
  42. package/dist/types/commands/npm/cmd-npm.d.mts.map +1 -1
  43. package/dist/types/commands/npx/cmd-npx.d.mts.map +1 -1
  44. package/dist/types/commands/pnpm/cmd-pnpm.d.mts +10 -0
  45. package/dist/types/commands/pnpm/cmd-pnpm.d.mts.map +1 -0
  46. package/dist/types/commands/scan/cmd-scan-setup.d.mts.map +1 -1
  47. package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts +1 -1
  48. package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts.map +1 -1
  49. package/dist/types/commands/yarn/cmd-yarn.d.mts +10 -0
  50. package/dist/types/commands/yarn/cmd-yarn.d.mts.map +1 -0
  51. package/dist/types/commands.d.mts +10 -0
  52. package/dist/types/commands.d.mts.map +1 -1
  53. package/dist/types/constants.d.mts +15 -1
  54. package/dist/types/constants.d.mts.map +1 -1
  55. package/dist/types/npm-cli.d.mts +3 -0
  56. package/dist/types/npm-cli.d.mts.map +1 -0
  57. package/dist/types/npx-cli.d.mts +3 -0
  58. package/dist/types/npx-cli.d.mts.map +1 -0
  59. package/dist/types/pnpm-cli.d.mts +3 -0
  60. package/dist/types/pnpm-cli.d.mts.map +1 -0
  61. package/dist/types/shadow/npm/install.d.mts +1 -1
  62. package/dist/types/shadow/npm/install.d.mts.map +1 -1
  63. package/dist/types/shadow/pnpm/bin.d.mts +10 -0
  64. package/dist/types/shadow/pnpm/bin.d.mts.map +1 -0
  65. package/dist/types/shadow/pnpm/link.d.mts +2 -0
  66. package/dist/types/shadow/pnpm/link.d.mts.map +1 -0
  67. package/dist/types/shadow/yarn/bin.d.mts +10 -0
  68. package/dist/types/shadow/yarn/bin.d.mts.map +1 -0
  69. package/dist/types/shadow/yarn/link.d.mts +2 -0
  70. package/dist/types/shadow/yarn/link.d.mts.map +1 -0
  71. package/dist/types/utils/alerts-map.d.mts.map +1 -1
  72. package/dist/types/utils/coana.d.mts.map +1 -1
  73. package/dist/types/utils/github.d.mts.map +1 -1
  74. package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
  75. package/dist/types/utils/package-environment.d.mts.map +1 -1
  76. package/dist/types/utils/pnpm-paths.d.mts +5 -0
  77. package/dist/types/utils/pnpm-paths.d.mts.map +1 -0
  78. package/dist/types/utils/socket-json.d.mts +3 -0
  79. package/dist/types/utils/socket-json.d.mts.map +1 -1
  80. package/dist/types/utils/yarn-paths.d.mts +5 -0
  81. package/dist/types/utils/yarn-paths.d.mts.map +1 -0
  82. package/dist/types/utils/yarn-version.d.mts +2 -0
  83. package/dist/types/utils/yarn-version.d.mts.map +1 -0
  84. package/dist/types/yarn-cli.d.mts +3 -0
  85. package/dist/types/yarn-cli.d.mts.map +1 -0
  86. package/dist/utils.js +242 -63
  87. package/dist/utils.js.map +1 -1
  88. package/dist/vendor.js +3622 -1386
  89. package/dist/yarn-cli.js +26 -0
  90. package/dist/yarn-cli.js.map +1 -0
  91. package/package.json +6 -2
  92. package/shadow-bin/npm +1 -1
  93. package/shadow-bin/npx +1 -1
  94. package/shadow-bin/pnpm +27 -0
  95. package/shadow-bin/yarn +27 -0
package/dist/cli.js CHANGED
@@ -68,7 +68,7 @@ async function fetchRepoAnalyticsData(repo, time, options) {
68
68
 
69
69
  // Note: Widgets does not seem to actually work as code :'(
70
70
 
71
- const require$5 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
71
+ const require$8 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
72
72
  const METRICS = ['total_critical_alerts', 'total_high_alerts', 'total_medium_alerts', 'total_low_alerts', 'total_critical_added', 'total_medium_added', 'total_low_added', 'total_high_added', 'total_critical_prevented', 'total_high_prevented', 'total_medium_prevented', 'total_low_prevented'];
73
73
 
74
74
  // Note: This maps `new Date(date).getMonth()` to English three letters
@@ -147,11 +147,11 @@ ${utils.mdTableStringNumber('Name', 'Counts', data['top_five_alert_types'])}
147
147
  `.trim() + '\n';
148
148
  }
149
149
  function displayAnalyticsScreen(data) {
150
- const ScreenWidget = /*@__PURE__*/require$5('../external/blessed/lib/widgets/screen.js');
150
+ const ScreenWidget = /*@__PURE__*/require$8('../external/blessed/lib/widgets/screen.js');
151
151
  const screen = new ScreenWidget({
152
152
  ...constants.default.blessedOptions
153
153
  });
154
- const GridLayout = /*@__PURE__*/require$5('../external/blessed-contrib/lib/layout/grid.js');
154
+ const GridLayout = /*@__PURE__*/require$8('../external/blessed-contrib/lib/layout/grid.js');
155
155
  const grid = new GridLayout({
156
156
  rows: 5,
157
157
  cols: 4,
@@ -165,7 +165,7 @@ function displayAnalyticsScreen(data) {
165
165
  renderLineCharts(grid, screen, 'Total high alerts prevented from the main branch', [2, 2, 1, 2], data['total_high_prevented']);
166
166
  renderLineCharts(grid, screen, 'Total medium alerts prevented from the main branch', [3, 0, 1, 2], data['total_medium_prevented']);
167
167
  renderLineCharts(grid, screen, 'Total low alerts prevented from the main branch', [3, 2, 1, 2], data['total_low_prevented']);
168
- const BarChart = /*@__PURE__*/require$5('../external/blessed-contrib/lib/widget/charts/bar.js');
168
+ const BarChart = /*@__PURE__*/require$8('../external/blessed-contrib/lib/widget/charts/bar.js');
169
169
  const bar = grid.set(4, 0, 1, 2, BarChart, {
170
170
  label: 'Top 5 alert types',
171
171
  barWidth: 10,
@@ -265,7 +265,7 @@ function formatDate(date) {
265
265
  return `${Months[new Date(date).getMonth()]} ${new Date(date).getDate()}`;
266
266
  }
267
267
  function renderLineCharts(grid, screen, title, coords, data) {
268
- const LineChart = /*@__PURE__*/require$5('../external/blessed-contrib/lib/widget/charts/line.js');
268
+ const LineChart = /*@__PURE__*/require$8('../external/blessed-contrib/lib/widget/charts/line.js');
269
269
  const line = grid.set(...coords, LineChart, {
270
270
  style: {
271
271
  line: 'cyan',
@@ -323,21 +323,21 @@ async function handleAnalytics({
323
323
  });
324
324
  }
325
325
 
326
- const CMD_NAME$w = 'analytics';
327
- const description$D = 'Look up analytics data';
328
- const hidden$v = false;
326
+ const CMD_NAME$y = 'analytics';
327
+ const description$F = 'Look up analytics data';
328
+ const hidden$x = false;
329
329
  const cmdAnalytics = {
330
- description: description$D,
331
- hidden: hidden$v,
332
- run: run$Q
330
+ description: description$F,
331
+ hidden: hidden$x,
332
+ run: run$S
333
333
  };
334
- async function run$Q(argv, importMeta, {
334
+ async function run$S(argv, importMeta, {
335
335
  parentName
336
336
  }) {
337
337
  const config = {
338
- commandName: CMD_NAME$w,
339
- description: description$D,
340
- hidden: hidden$v,
338
+ commandName: CMD_NAME$y,
339
+ description: description$F,
340
+ hidden: hidden$x,
341
341
  flags: {
342
342
  ...flags.commonFlags,
343
343
  ...flags.outputFlags,
@@ -354,7 +354,7 @@ async function run$Q(argv, importMeta, {
354
354
  $ ${command} [options] [ "org" | "repo" <reponame>] [TIME]
355
355
 
356
356
  API Token Requirements
357
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$w}`)}
357
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$y}`)}
358
358
 
359
359
  The scope is either org or repo level, defaults to org.
360
360
 
@@ -500,7 +500,7 @@ async function fetchAuditLog(config, options) {
500
500
  });
501
501
  }
502
502
 
503
- const require$4 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
503
+ const require$7 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
504
504
  async function outputAuditLog(result, {
505
505
  logType,
506
506
  orgSlug,
@@ -628,7 +628,7 @@ async function outputWithBlessed(data, orgSlug) {
628
628
  const headers = [' Event id', ' Created at', ' Event type', ' User email', ' IP address', ' User agent'];
629
629
 
630
630
  // Note: this temporarily takes over the terminal (just like `man` does).
631
- const ScreenWidget = /*@__PURE__*/require$4('../external/blessed/lib/widgets/screen.js');
631
+ const ScreenWidget = /*@__PURE__*/require$7('../external/blessed/lib/widgets/screen.js');
632
632
  const screen = new ScreenWidget({
633
633
  ...constants.default.blessedOptions
634
634
  });
@@ -637,7 +637,7 @@ async function outputWithBlessed(data, orgSlug) {
637
637
  // node process just to exit it. That's very bad UX.
638
638
  // eslint-disable-next-line n/no-process-exit
639
639
  screen.key(['escape', 'q', 'C-c'], () => process.exit(0));
640
- const TableWidget = /*@__PURE__*/require$4('../external/blessed-contrib/lib/widget/table.js');
640
+ const TableWidget = /*@__PURE__*/require$7('../external/blessed-contrib/lib/widget/table.js');
641
641
  const tipsBoxHeight = 1; // 1 row for tips box
642
642
  const detailsBoxHeight = 20; // bottom N rows for details box. 20 gives 4 lines for condensed payload before it scrolls out of view
643
643
 
@@ -667,7 +667,7 @@ async function outputWithBlessed(data, orgSlug) {
667
667
  columnSpacing: 4,
668
668
  truncate: '_'
669
669
  });
670
- const BoxWidget = /*@__PURE__*/require$4('../external/blessed/lib/widgets/box.js');
670
+ const BoxWidget = /*@__PURE__*/require$7('../external/blessed/lib/widgets/box.js');
671
671
  const tipsBox = new BoxWidget({
672
672
  bottom: detailsBoxHeight,
673
673
  // sits just above the details box
@@ -748,21 +748,21 @@ async function handleAuditLog({
748
748
  });
749
749
  }
750
750
 
751
- const CMD_NAME$v = 'audit-log';
752
- const description$C = 'Look up the audit log for an organization';
753
- const hidden$u = false;
751
+ const CMD_NAME$x = 'audit-log';
752
+ const description$E = 'Look up the audit log for an organization';
753
+ const hidden$w = false;
754
754
  const cmdAuditLog = {
755
- description: description$C,
756
- hidden: hidden$u,
757
- run: run$P
755
+ description: description$E,
756
+ hidden: hidden$w,
757
+ run: run$R
758
758
  };
759
- async function run$P(argv, importMeta, {
759
+ async function run$R(argv, importMeta, {
760
760
  parentName
761
761
  }) {
762
762
  const config = {
763
- commandName: CMD_NAME$v,
764
- description: description$C,
765
- hidden: hidden$u,
763
+ commandName: CMD_NAME$x,
764
+ description: description$E,
765
+ hidden: hidden$w,
766
766
  flags: {
767
767
  ...flags.commonFlags,
768
768
  ...flags.outputFlags,
@@ -790,7 +790,7 @@ async function run$P(argv, importMeta, {
790
790
  $ ${command} [options] [FILTER]
791
791
 
792
792
  API Token Requirements
793
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$v}`)}
793
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$x}`)}
794
794
 
795
795
  This feature requires an Enterprise Plan. To learn more about getting access
796
796
  to this feature and many more, please visit ${constants.default.SOCKET_WEBSITE_URL}/pricing
@@ -1574,7 +1574,7 @@ async function performReachabilityAnalysis(options) {
1574
1574
  return {
1575
1575
  ok: false,
1576
1576
  message: 'Tier 1 Reachability analysis requires an enterprise plan',
1577
- cause: `Please ${vendor.terminalLinkExports('upgrade your plan', 'https://socket.dev/pricing')}. This feature is only available for organizations with an enterprise plan.`
1577
+ cause: `Please ${vendor.terminalLinkExports('upgrade your plan', `${constants.SOCKET_WEBSITE_URL}/pricing`)}. This feature is only available for organizations with an enterprise plan.`
1578
1578
  };
1579
1579
  }
1580
1580
  const wasSpinning = !!spinner?.isSpinning;
@@ -1671,25 +1671,25 @@ sockJson, cwd = process.cwd()) {
1671
1671
  sbt: false
1672
1672
  };
1673
1673
  if (sockJson?.defaults?.manifest?.sbt?.disabled) {
1674
- require$$9.debugLog('notice', '[DEBUG] - sbt auto-detection is disabled in socket.json');
1674
+ require$$9.debugLog('notice', `[DEBUG] - sbt auto-detection is disabled in ${constants.SOCKET_JSON}`);
1675
1675
  } else if (fs$1.existsSync(path.join(cwd, 'build.sbt'))) {
1676
1676
  require$$9.debugLog('notice', '[DEBUG] - Detected a Scala sbt build file');
1677
1677
  output.sbt = true;
1678
1678
  output.count += 1;
1679
1679
  }
1680
1680
  if (sockJson?.defaults?.manifest?.gradle?.disabled) {
1681
- require$$9.debugLog('notice', '[DEBUG] - gradle auto-detection is disabled in socket.json');
1681
+ require$$9.debugLog('notice', `[DEBUG] - gradle auto-detection is disabled in ${constants.SOCKET_JSON}`);
1682
1682
  } else if (fs$1.existsSync(path.join(cwd, 'gradlew'))) {
1683
1683
  require$$9.debugLog('notice', '[DEBUG] - Detected a gradle build file');
1684
1684
  output.gradle = true;
1685
1685
  output.count += 1;
1686
1686
  }
1687
1687
  if (sockJson?.defaults?.manifest?.conda?.disabled) {
1688
- require$$9.debugLog('notice', '[DEBUG] - conda auto-detection is disabled in socket.json');
1688
+ require$$9.debugLog('notice', `[DEBUG] - conda auto-detection is disabled in ${constants.SOCKET_JSON}`);
1689
1689
  } else {
1690
- const envyml = path.join(cwd, 'environment.yml');
1690
+ const envyml = path.join(cwd, constants.ENVIRONMENT_YML);
1691
1691
  const hasEnvyml = fs$1.existsSync(envyml);
1692
- const envyaml = path.join(cwd, 'environment.yaml');
1692
+ const envyaml = path.join(cwd, constants.ENVIRONMENT_YAML);
1693
1693
  const hasEnvyaml = !hasEnvyml && fs$1.existsSync(envyaml);
1694
1694
  if (hasEnvyml || hasEnvyaml) {
1695
1695
  require$$9.debugLog('notice', '[DEBUG] - Detected an environment.yml Conda file');
@@ -2057,9 +2057,9 @@ async function outputRequirements(result, outputKind, out) {
2057
2057
  const arr = [];
2058
2058
  arr.push('# Converted Conda file');
2059
2059
  arr.push('');
2060
- arr.push('This is the Conda `environment.yml` file converted to python `requirements.txt`:');
2060
+ arr.push(`This is the Conda \`environment.yml\` file converted to python \`${constants.REQUIREMENTS_TXT}\`:`);
2061
2061
  arr.push('');
2062
- arr.push('```file=requirements.txt');
2062
+ arr.push(`\`\`\`file=${constants.REQUIREMENTS_TXT}`);
2063
2063
  arr.push(result.data.pip);
2064
2064
  arr.push('```');
2065
2065
  arr.push('');
@@ -2098,7 +2098,7 @@ async function generateAutoManifest({
2098
2098
  }) {
2099
2099
  const sockJson = utils.readOrDefaultSocketJson(cwd);
2100
2100
  if (verbose) {
2101
- logger.logger.info('Using this socket.json for defaults:', sockJson);
2101
+ logger.logger.info(`Using this ${constants.SOCKET_JSON} for defaults:`, sockJson);
2102
2102
  }
2103
2103
  if (!sockJson?.defaults?.manifest?.sbt?.disabled && detected.sbt) {
2104
2104
  logger.logger.log('Detected a Scala sbt build, generating pom files with sbt...');
@@ -2129,7 +2129,7 @@ async function generateAutoManifest({
2129
2129
  cwd,
2130
2130
  filename: sockJson.defaults?.manifest?.conda?.infile ?? 'environment.yml',
2131
2131
  outputKind,
2132
- out: sockJson.defaults?.manifest?.conda?.outfile ?? 'requirements.txt',
2132
+ out: sockJson.defaults?.manifest?.conda?.outfile ?? constants.REQUIREMENTS_TXT,
2133
2133
  verbose: Boolean(sockJson.defaults?.manifest?.conda?.verbose)
2134
2134
  });
2135
2135
  }
@@ -2369,9 +2369,9 @@ const config$k = {
2369
2369
  const cmdCI = {
2370
2370
  description: config$k.description,
2371
2371
  hidden: config$k.hidden,
2372
- run: run$O
2372
+ run: run$Q
2373
2373
  };
2374
- async function run$O(argv, importMeta, {
2374
+ async function run$Q(argv, importMeta, {
2375
2375
  parentName
2376
2376
  }) {
2377
2377
  const cli = utils.meowOrExit({
@@ -2613,21 +2613,21 @@ async function handleConfigAuto({
2613
2613
  await outputConfigAuto(key, result, outputKind);
2614
2614
  }
2615
2615
 
2616
- const CMD_NAME$u = 'auto';
2617
- const description$B = 'Automatically discover and set the correct value config item';
2618
- const hidden$t = false;
2616
+ const CMD_NAME$w = 'auto';
2617
+ const description$D = 'Automatically discover and set the correct value config item';
2618
+ const hidden$v = false;
2619
2619
  const cmdConfigAuto = {
2620
- description: description$B,
2621
- hidden: hidden$t,
2622
- run: run$N
2620
+ description: description$D,
2621
+ hidden: hidden$v,
2622
+ run: run$P
2623
2623
  };
2624
- async function run$N(argv, importMeta, {
2624
+ async function run$P(argv, importMeta, {
2625
2625
  parentName
2626
2626
  }) {
2627
2627
  const config = {
2628
- commandName: CMD_NAME$u,
2629
- description: description$B,
2630
- hidden: hidden$t,
2628
+ commandName: CMD_NAME$w,
2629
+ description: description$D,
2630
+ hidden: hidden$v,
2631
2631
  flags: {
2632
2632
  ...flags.commonFlags,
2633
2633
  ...flags.outputFlags
@@ -2757,9 +2757,9 @@ ${utils.getSupportedConfigEntries().map(({
2757
2757
  const cmdConfigGet = {
2758
2758
  description: config$j.description,
2759
2759
  hidden: config$j.hidden,
2760
- run: run$M
2760
+ run: run$O
2761
2761
  };
2762
- async function run$M(argv, importMeta, {
2762
+ async function run$O(argv, importMeta, {
2763
2763
  parentName
2764
2764
  }) {
2765
2765
  const cli = utils.meowOrExit({
@@ -2893,9 +2893,9 @@ const config$i = {
2893
2893
  const cmdConfigList = {
2894
2894
  description: config$i.description,
2895
2895
  hidden: config$i.hidden,
2896
- run: run$L
2896
+ run: run$N
2897
2897
  };
2898
- async function run$L(argv, importMeta, {
2898
+ async function run$N(argv, importMeta, {
2899
2899
  parentName
2900
2900
  }) {
2901
2901
  const cli = utils.meowOrExit({
@@ -2969,21 +2969,21 @@ async function handleConfigSet({
2969
2969
  await outputConfigSet(result, outputKind);
2970
2970
  }
2971
2971
 
2972
- const CMD_NAME$t = 'set';
2973
- const description$A = 'Update the value of a local CLI config item';
2974
- const hidden$s = false;
2972
+ const CMD_NAME$v = 'set';
2973
+ const description$C = 'Update the value of a local CLI config item';
2974
+ const hidden$u = false;
2975
2975
  const cmdConfigSet = {
2976
- description: description$A,
2977
- hidden: hidden$s,
2978
- run: run$K
2976
+ description: description$C,
2977
+ hidden: hidden$u,
2978
+ run: run$M
2979
2979
  };
2980
- async function run$K(argv, importMeta, {
2980
+ async function run$M(argv, importMeta, {
2981
2981
  parentName
2982
2982
  }) {
2983
2983
  const config = {
2984
- commandName: CMD_NAME$t,
2985
- description: description$A,
2986
- hidden: hidden$s,
2984
+ commandName: CMD_NAME$v,
2985
+ description: description$C,
2986
+ hidden: hidden$u,
2987
2987
  flags: {
2988
2988
  ...flags.commonFlags,
2989
2989
  ...flags.outputFlags
@@ -3096,21 +3096,21 @@ async function handleConfigUnset({
3096
3096
  await outputConfigUnset(updateResult, outputKind);
3097
3097
  }
3098
3098
 
3099
- const CMD_NAME$s = 'unset';
3100
- const description$z = 'Clear the value of a local CLI config item';
3101
- const hidden$r = false;
3099
+ const CMD_NAME$u = 'unset';
3100
+ const description$B = 'Clear the value of a local CLI config item';
3101
+ const hidden$t = false;
3102
3102
  const cmdConfigUnset = {
3103
- description: description$z,
3104
- hidden: hidden$r,
3105
- run: run$J
3103
+ description: description$B,
3104
+ hidden: hidden$t,
3105
+ run: run$L
3106
3106
  };
3107
- async function run$J(argv, importMeta, {
3107
+ async function run$L(argv, importMeta, {
3108
3108
  parentName
3109
3109
  }) {
3110
3110
  const config = {
3111
- commandName: CMD_NAME$s,
3112
- description: description$z,
3113
- hidden: hidden$r,
3111
+ commandName: CMD_NAME$u,
3112
+ description: description$B,
3113
+ hidden: hidden$t,
3114
3114
  flags: {
3115
3115
  ...flags.commonFlags,
3116
3116
  ...flags.outputFlags
@@ -3172,9 +3172,9 @@ ${utils.getSupportedConfigEntries().map(({
3172
3172
  });
3173
3173
  }
3174
3174
 
3175
- const description$y = 'Manage Socket CLI configuration';
3175
+ const description$A = 'Manage Socket CLI configuration';
3176
3176
  const cmdConfig = {
3177
- description: description$y,
3177
+ description: description$A,
3178
3178
  hidden: false,
3179
3179
  async run(argv, importMeta, {
3180
3180
  parentName
@@ -3187,7 +3187,7 @@ const cmdConfig = {
3187
3187
  unset: cmdConfigUnset
3188
3188
  }, {
3189
3189
  argv,
3190
- description: description$y,
3190
+ description: description$A,
3191
3191
  importMeta,
3192
3192
  name: `${parentName} config`
3193
3193
  });
@@ -3442,7 +3442,9 @@ async function coanaFix(fixConfig) {
3442
3442
  cwd,
3443
3443
  ghsas,
3444
3444
  limit,
3445
+ onlyCompute,
3445
3446
  orgSlug,
3447
+ outputFile,
3446
3448
  spinner
3447
3449
  } = fixConfig;
3448
3450
  const fixEnv = await getFixEnv();
@@ -3494,7 +3496,7 @@ async function coanaFix(fixConfig) {
3494
3496
  }
3495
3497
  };
3496
3498
  }
3497
- const fixCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...(isAll ? ['all'] : ghsas), ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3499
+ const fixCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...(isAll ? ['all'] : ghsas), ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...fixConfig.unknownFlags, ...(onlyCompute ? ['--dry-run'] : []), ...(outputFile ? ['--output-file', outputFile] : [])], fixConfig.orgSlug, {
3498
3500
  cwd,
3499
3501
  spinner,
3500
3502
  stdio: 'inherit'
@@ -3769,7 +3771,9 @@ async function handleFix({
3769
3771
  ghsas,
3770
3772
  limit,
3771
3773
  minSatisfying,
3774
+ onlyCompute,
3772
3775
  orgSlug,
3776
+ outputFile,
3773
3777
  outputKind,
3774
3778
  prCheck,
3775
3779
  rangeStyle,
@@ -3785,18 +3789,20 @@ async function handleFix({
3785
3789
  orgSlug,
3786
3790
  rangeStyle,
3787
3791
  spinner,
3788
- unknownFlags
3792
+ unknownFlags,
3793
+ onlyCompute,
3794
+ outputFile
3789
3795
  }), outputKind);
3790
3796
  }
3791
3797
 
3792
- const CMD_NAME$r = 'fix';
3798
+ const CMD_NAME$t = 'fix';
3793
3799
  const DEFAULT_LIMIT = 10;
3794
- const description$x = 'Update dependencies with "fixable" Socket alerts';
3795
- const hidden$q = false;
3800
+ const description$z = 'Update dependencies with "fixable" Socket alerts';
3801
+ const hidden$s = false;
3796
3802
  const cmdFix = {
3797
- description: description$x,
3798
- hidden: hidden$q,
3799
- run: run$I
3803
+ description: description$z,
3804
+ hidden: hidden$s,
3805
+ run: run$K
3800
3806
  };
3801
3807
  const generalFlags$2 = {
3802
3808
  autopilot: {
@@ -3828,6 +3834,16 @@ Available styles:
3828
3834
  * pin - Use the exact version (e.g. 1.2.3)
3829
3835
  * preserve - Retain the existing version range style as-is
3830
3836
  `.trim()
3837
+ },
3838
+ onlyCompute: {
3839
+ type: 'boolean',
3840
+ default: false,
3841
+ description: 'Compute fixes only, do not apply them. Logs what upgrades would be applied. If combined with --output-file, the output file will contain the upgrades that would be applied.'
3842
+ },
3843
+ outputFile: {
3844
+ type: 'string',
3845
+ default: '',
3846
+ description: 'Path to store upgrades as a JSON file at this path.'
3831
3847
  }
3832
3848
  };
3833
3849
  const hiddenFlags = {
@@ -3878,13 +3894,13 @@ const hiddenFlags = {
3878
3894
  hidden: true
3879
3895
  }
3880
3896
  };
3881
- async function run$I(argv, importMeta, {
3897
+ async function run$K(argv, importMeta, {
3882
3898
  parentName
3883
3899
  }) {
3884
3900
  const config = {
3885
- commandName: CMD_NAME$r,
3886
- description: description$x,
3887
- hidden: hidden$q,
3901
+ commandName: CMD_NAME$t,
3902
+ description: description$z,
3903
+ hidden: hidden$s,
3888
3904
  flags: {
3889
3905
  ...flags.commonFlags,
3890
3906
  ...flags.outputFlags,
@@ -3896,14 +3912,14 @@ async function run$I(argv, importMeta, {
3896
3912
  $ ${command} [options] [CWD=.]
3897
3913
 
3898
3914
  API Token Requirements
3899
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$r}`)}
3915
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$t}`)}
3900
3916
 
3901
3917
  Options
3902
3918
  ${utils.getFlagListOutput(config.flags)}
3903
3919
 
3904
3920
  Examples
3905
3921
  $ ${command}
3906
- $ ${command} ./proj/tree --auto-merge
3922
+ $ ${command} ./path/to/project --range-style pin
3907
3923
  `
3908
3924
  };
3909
3925
  const cli = utils.meowOrExit({
@@ -3919,6 +3935,8 @@ async function run$I(argv, importMeta, {
3919
3935
  limit,
3920
3936
  markdown,
3921
3937
  maxSatisfying,
3938
+ onlyCompute,
3939
+ outputFile,
3922
3940
  prCheck,
3923
3941
  rangeStyle,
3924
3942
  // We patched in this feature with `npx custompatch meow` at
@@ -3971,7 +3989,9 @@ async function run$I(argv, importMeta, {
3971
3989
  outputKind,
3972
3990
  rangeStyle,
3973
3991
  spinner,
3974
- unknownFlags
3992
+ unknownFlags,
3993
+ onlyCompute,
3994
+ outputFile
3975
3995
  });
3976
3996
  }
3977
3997
 
@@ -4128,9 +4148,9 @@ const config$h = {
4128
4148
  const cmdInstallCompletion = {
4129
4149
  description: config$h.description,
4130
4150
  hidden: config$h.hidden,
4131
- run: run$H
4151
+ run: run$J
4132
4152
  };
4133
- async function run$H(argv, importMeta, {
4153
+ async function run$J(argv, importMeta, {
4134
4154
  parentName
4135
4155
  }) {
4136
4156
  const cli = utils.meowOrExit({
@@ -4148,9 +4168,9 @@ async function run$H(argv, importMeta, {
4148
4168
  await handleInstallCompletion(String(targetName));
4149
4169
  }
4150
4170
 
4151
- const description$w = 'Install Socket CLI tab completion';
4171
+ const description$y = 'Install Socket CLI tab completion';
4152
4172
  const cmdInstall = {
4153
- description: description$w,
4173
+ description: description$y,
4154
4174
  hidden: false,
4155
4175
  async run(argv, importMeta, {
4156
4176
  parentName
@@ -4159,7 +4179,7 @@ const cmdInstall = {
4159
4179
  completion: cmdInstallCompletion
4160
4180
  }, {
4161
4181
  argv,
4162
- description: description$w,
4182
+ description: description$y,
4163
4183
  importMeta,
4164
4184
  name: `${parentName} install`
4165
4185
  });
@@ -4168,7 +4188,7 @@ const cmdInstall = {
4168
4188
 
4169
4189
  async function outputCmdJson(cwd) {
4170
4190
  logger.logger.info('Target cwd:', constants.default.ENV.VITEST ? '<redacted>' : utils.tildify(cwd));
4171
- const sockJsonPath = path.join(cwd, 'socket.json');
4191
+ const sockJsonPath = path.join(cwd, constants.SOCKET_JSON);
4172
4192
  const tildeSockJsonPath = constants.default.ENV.VITEST ? '<redacted>' : utils.tildify(sockJsonPath);
4173
4193
  if (!fs$1.existsSync(sockJsonPath)) {
4174
4194
  logger.logger.fail(`Not found: ${tildeSockJsonPath}`);
@@ -4192,7 +4212,7 @@ async function handleCmdJson(cwd) {
4192
4212
 
4193
4213
  const config$g = {
4194
4214
  commandName: 'json',
4195
- description: 'Display the `socket.json` that would be applied for target folder',
4215
+ description: `Display the \`${constants.SOCKET_JSON}\` that would be applied for target folder`,
4196
4216
  hidden: true,
4197
4217
  flags: {
4198
4218
  ...flags.commonFlags
@@ -4201,7 +4221,7 @@ const config$g = {
4201
4221
  Usage
4202
4222
  $ ${command} [options] [CWD=.]
4203
4223
 
4204
- Display the \`socket.json\` file that would apply when running relevant commands
4224
+ Display the \`${constants.SOCKET_JSON}\` file that would apply when running relevant commands
4205
4225
  in the target directory.
4206
4226
 
4207
4227
  Examples
@@ -4211,9 +4231,9 @@ const config$g = {
4211
4231
  const cmdJson = {
4212
4232
  description: config$g.description,
4213
4233
  hidden: config$g.hidden,
4214
- run: run$G
4234
+ run: run$I
4215
4235
  };
4216
- async function run$G(argv, importMeta, {
4236
+ async function run$I(argv, importMeta, {
4217
4237
  parentName
4218
4238
  }) {
4219
4239
  const cli = utils.meowOrExit({
@@ -4367,21 +4387,21 @@ async function attemptLogin(apiBaseUrl, apiProxy) {
4367
4387
  }
4368
4388
  }
4369
4389
 
4370
- const CMD_NAME$q = 'login';
4371
- const description$v = 'Setup Socket CLI with an API token and defaults';
4372
- const hidden$p = false;
4390
+ const CMD_NAME$s = 'login';
4391
+ const description$x = 'Setup Socket CLI with an API token and defaults';
4392
+ const hidden$r = false;
4373
4393
  const cmdLogin = {
4374
- description: description$v,
4375
- hidden: hidden$p,
4376
- run: run$F
4394
+ description: description$x,
4395
+ hidden: hidden$r,
4396
+ run: run$H
4377
4397
  };
4378
- async function run$F(argv, importMeta, {
4398
+ async function run$H(argv, importMeta, {
4379
4399
  parentName
4380
4400
  }) {
4381
4401
  const config = {
4382
- commandName: CMD_NAME$q,
4383
- description: description$v,
4384
- hidden: hidden$p,
4402
+ commandName: CMD_NAME$s,
4403
+ description: description$x,
4404
+ hidden: hidden$r,
4385
4405
  flags: {
4386
4406
  ...flags.commonFlags,
4387
4407
  apiBaseUrl: {
@@ -4400,7 +4420,7 @@ async function run$F(argv, importMeta, {
4400
4420
  $ ${command} [options]
4401
4421
 
4402
4422
  API Token Requirements
4403
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$q}`)}
4423
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$s}`)}
4404
4424
 
4405
4425
  Logs into the Socket API by prompting for an API token
4406
4426
 
@@ -4473,9 +4493,9 @@ const config$f = {
4473
4493
  const cmdLogout = {
4474
4494
  description: config$f.description,
4475
4495
  hidden: config$f.hidden,
4476
- run: run$E
4496
+ run: run$G
4477
4497
  };
4478
- async function run$E(argv, importMeta, {
4498
+ async function run$G(argv, importMeta, {
4479
4499
  parentName
4480
4500
  }) {
4481
4501
  const cli = utils.meowOrExit({
@@ -4492,8 +4512,10 @@ async function run$E(argv, importMeta, {
4492
4512
  attemptLogout();
4493
4513
  }
4494
4514
 
4515
+ const require$6 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
4495
4516
  const {
4496
4517
  PACKAGE_LOCK_JSON,
4518
+ PNPM_LOCK_YAML,
4497
4519
  YARN,
4498
4520
  YARN_LOCK
4499
4521
  } = constants.default;
@@ -4545,24 +4567,58 @@ async function runCdxgen(argvObj) {
4545
4567
  },
4546
4568
  stdio: 'inherit'
4547
4569
  };
4570
+
4571
+ // Detect package manager based on lockfiles
4572
+ const pnpmLockPath = await utils.findUp(PNPM_LOCK_YAML, {
4573
+ onlyFiles: true
4574
+ });
4575
+ const npmLockPath = pnpmLockPath ? undefined : await utils.findUp(PACKAGE_LOCK_JSON, {
4576
+ onlyFiles: true
4577
+ });
4578
+ const yarnLockPath = pnpmLockPath || npmLockPath ? undefined : await utils.findUp(YARN_LOCK, {
4579
+ onlyFiles: true
4580
+ });
4548
4581
  let cleanupPackageLock = false;
4549
- if (argvMutable['type'] !== YARN && nodejsPlatformTypes.has(argvMutable['type']) && fs$1.existsSync(`./${YARN_LOCK}`)) {
4550
- if (fs$1.existsSync(`./${PACKAGE_LOCK_JSON}`)) {
4582
+ if (argvMutable['type'] !== YARN && nodejsPlatformTypes.has(argvMutable['type']) && yarnLockPath) {
4583
+ if (npmLockPath) {
4551
4584
  argvMutable['type'] = constants.NPM;
4552
4585
  } else {
4553
4586
  // Use synp to create a package-lock.json from the yarn.lock,
4554
4587
  // based on the node_modules folder, for a more accurate SBOM.
4555
4588
  try {
4556
- const {
4557
- spawnPromise: synpPromise
4558
- } = await shadowNpmBin('npx', ['--yes', `synp@${constants.default.ENV.INLINED_SOCKET_CLI_SYNP_VERSION}`, '--source-file', `./${YARN_LOCK}`], shadowOpts);
4589
+ const useYarnBerry = utils.isYarnBerry();
4590
+ let args;
4591
+ let synpPromise;
4592
+ if (pnpmLockPath) {
4593
+ args = ['dlx', `synp@${constants.default.ENV.INLINED_SOCKET_CLI_SYNP_VERSION}`, '--source-file', `./${YARN_LOCK}`];
4594
+ const shadowPnpmBin = /*@__PURE__*/require$6(constants.default.shadowPnpmBinPath);
4595
+ synpPromise = (await shadowPnpmBin(args, shadowOpts)).spawnPromise;
4596
+ } else if (useYarnBerry) {
4597
+ args = ['dlx', `synp@${constants.default.ENV.INLINED_SOCKET_CLI_SYNP_VERSION}`, '--source-file', `./${YARN_LOCK}`];
4598
+ const shadowYarnBin = /*@__PURE__*/require$6(constants.default.shadowYarnBinPath);
4599
+ synpPromise = (await shadowYarnBin(args, shadowOpts)).spawnPromise;
4600
+ } else {
4601
+ args = ['exec', '--yes', `synp@${constants.default.ENV.INLINED_SOCKET_CLI_SYNP_VERSION}`, '--source-file', `./${YARN_LOCK}`];
4602
+ synpPromise = (await shadowNpmBin('npm', args, shadowOpts)).spawnPromise;
4603
+ }
4559
4604
  await synpPromise;
4560
4605
  argvMutable['type'] = constants.NPM;
4561
4606
  cleanupPackageLock = true;
4562
4607
  } catch {}
4563
4608
  }
4564
4609
  }
4565
- const shadowResult = await shadowNpmBin('npx', ['--yes', `@cyclonedx/cdxgen@${constants.default.ENV.INLINED_SOCKET_CLI_CYCLONEDX_CDXGEN_VERSION}`, ...argvToArray(argvMutable)], shadowOpts);
4610
+
4611
+ // Use appropriate package manager for cdxgen
4612
+ let shadowResult;
4613
+ if (pnpmLockPath) {
4614
+ const shadowPnpmBin = /*@__PURE__*/require$6(constants.default.shadowPnpmBinPath);
4615
+ shadowResult = await shadowPnpmBin(['dlx', '--silent', `@cyclonedx/cdxgen@${constants.default.ENV.INLINED_SOCKET_CLI_CYCLONEDX_CDXGEN_VERSION}`, ...argvToArray(argvMutable)], shadowOpts);
4616
+ } else if (yarnLockPath && utils.isYarnBerry()) {
4617
+ const shadowYarnBin = /*@__PURE__*/require$6(constants.default.shadowYarnBinPath);
4618
+ shadowResult = await shadowYarnBin(['dlx', '--quiet', `@cyclonedx/cdxgen@${constants.default.ENV.INLINED_SOCKET_CLI_CYCLONEDX_CDXGEN_VERSION}`, ...argvToArray(argvMutable)], shadowOpts);
4619
+ } else {
4620
+ shadowResult = await shadowNpmBin('npm', ['exec', '--silent', '--yes', `@cyclonedx/cdxgen@${constants.default.ENV.INLINED_SOCKET_CLI_CYCLONEDX_CDXGEN_VERSION}`, '--', ...argvToArray(argvMutable)], shadowOpts);
4621
+ }
4566
4622
  shadowResult.spawnPromise.process.on('exit', () => {
4567
4623
  if (cleanupPackageLock) {
4568
4624
  try {
@@ -4785,9 +4841,9 @@ const config$e = {
4785
4841
  const cmdManifestCdxgen = {
4786
4842
  description: config$e.description,
4787
4843
  hidden: config$e.hidden,
4788
- run: run$D
4844
+ run: run$F
4789
4845
  };
4790
- async function run$D(argv, importMeta, context) {
4846
+ async function run$F(argv, importMeta, context) {
4791
4847
  const {
4792
4848
  parentName
4793
4849
  } = {
@@ -4805,7 +4861,7 @@ async function run$D(argv, importMeta, context) {
4805
4861
  dryRun
4806
4862
  } = cli.flags;
4807
4863
 
4808
- // Filter Socket flags from argv but keep --no-banner and --help for cdxgen
4864
+ // Filter Socket flags from argv but keep --no-banner and --help for cdxgen.
4809
4865
  const argsToProcess = utils.filterFlags(argv, {
4810
4866
  ...flags.commonFlags,
4811
4867
  ...flags.outputFlags
@@ -4905,9 +4961,9 @@ const config$d = {
4905
4961
  const cmdManifestAuto = {
4906
4962
  description: config$d.description,
4907
4963
  hidden: config$d.hidden,
4908
- run: run$C
4964
+ run: run$E
4909
4965
  };
4910
- async function run$C(argv, importMeta, {
4966
+ async function run$E(argv, importMeta, {
4911
4967
  parentName
4912
4968
  }) {
4913
4969
  const cli = utils.meowOrExit({
@@ -4966,14 +5022,15 @@ async function run$C(argv, importMeta, {
4966
5022
 
4967
5023
  const config$c = {
4968
5024
  commandName: 'conda',
4969
- description: '[beta] Convert a Conda environment.yml file to a python requirements.txt',
5025
+ description: `[beta] Convert a Conda ${constants.ENVIRONMENT_YML} file to a python ${constants.REQUIREMENTS_TXT}`,
4970
5026
  hidden: false,
4971
5027
  flags: {
4972
5028
  ...flags.commonFlags,
4973
5029
  ...flags.outputFlags,
4974
5030
  file: {
4975
5031
  type: 'string',
4976
- description: 'Input file name (by default for Conda this is "environment.yml"), relative to cwd'
5032
+ default: '',
5033
+ description: `Input file name (by default for Conda this is "${constants.ENVIRONMENT_YML}"), relative to cwd`
4977
5034
  },
4978
5035
  stdin: {
4979
5036
  type: 'boolean',
@@ -4981,11 +5038,12 @@ const config$c = {
4981
5038
  },
4982
5039
  out: {
4983
5040
  type: 'string',
5041
+ default: '',
4984
5042
  description: 'Output path (relative to cwd)'
4985
5043
  },
4986
5044
  stdout: {
4987
5045
  type: 'boolean',
4988
- description: 'Print resulting requirements.txt to stdout (supersedes --out)'
5046
+ description: `Print resulting ${constants.REQUIREMENTS_TXT} to stdout (supersedes --out)`
4989
5047
  },
4990
5048
  verbose: {
4991
5049
  type: 'boolean',
@@ -4997,8 +5055,8 @@ const config$c = {
4997
5055
  $ ${command} [options] [CWD=.]
4998
5056
 
4999
5057
  Warning: While we don't support Conda necessarily, this tool extracts the pip
5000
- block from an environment.yml and outputs it as a requirements.txt
5001
- which you can scan as if it were a pypi package.
5058
+ block from an ${constants.ENVIRONMENT_YML} and outputs it as a ${constants.REQUIREMENTS_TXT}
5059
+ which you can scan as if it were a PyPI package.
5002
5060
 
5003
5061
  USE AT YOUR OWN RISK
5004
5062
 
@@ -5011,15 +5069,15 @@ const config$c = {
5011
5069
  Examples
5012
5070
 
5013
5071
  $ ${command}
5014
- $ ${command} ./project/foo --file environment.yaml
5072
+ $ ${command} ./project/foo --file ${constants.ENVIRONMENT_YAML}
5015
5073
  `
5016
5074
  };
5017
5075
  const cmdManifestConda = {
5018
5076
  description: config$c.description,
5019
5077
  hidden: config$c.hidden,
5020
- run: run$B
5078
+ run: run$D
5021
5079
  };
5022
- async function run$B(argv, importMeta, {
5080
+ async function run$D(argv, importMeta, {
5023
5081
  parentName
5024
5082
  }) {
5025
5083
  const cli = utils.meowOrExit({
@@ -5029,10 +5087,10 @@ async function run$B(argv, importMeta, {
5029
5087
  parentName
5030
5088
  });
5031
5089
  const {
5032
- json = false,
5033
- markdown = false
5090
+ dryRun,
5091
+ json,
5092
+ markdown
5034
5093
  } = cli.flags;
5035
- const dryRun = !!cli.flags['dryRun'];
5036
5094
  let [cwd = '.'] = cli.input;
5037
5095
  // Note: path.resolve vs .join:
5038
5096
  // If given path is absolute then cwd should not affect it.
@@ -5049,35 +5107,35 @@ async function run$B(argv, importMeta, {
5049
5107
  // Set defaults for any flag/arg that is not given. Check socket.json first.
5050
5108
  if (stdin === undefined && sockJson.defaults?.manifest?.conda?.stdin !== undefined) {
5051
5109
  stdin = sockJson.defaults?.manifest?.conda?.stdin;
5052
- logger.logger.info('Using default --stdin from socket.json:', stdin);
5110
+ logger.logger.info(`Using default --stdin from ${constants.SOCKET_JSON}:`, stdin);
5053
5111
  }
5054
5112
  if (stdin) {
5055
5113
  filename = '-';
5056
5114
  } else if (!filename) {
5057
5115
  if (sockJson.defaults?.manifest?.conda?.infile) {
5058
5116
  filename = sockJson.defaults?.manifest?.conda?.infile;
5059
- logger.logger.info('Using default --file from socket.json:', filename);
5117
+ logger.logger.info(`Using default --file from ${constants.SOCKET_JSON}:`, filename);
5060
5118
  } else {
5061
- filename = 'environment.yml';
5119
+ filename = constants.ENVIRONMENT_YML;
5062
5120
  }
5063
5121
  }
5064
5122
  if (stdout === undefined && sockJson.defaults?.manifest?.conda?.stdout !== undefined) {
5065
5123
  stdout = sockJson.defaults?.manifest?.conda?.stdout;
5066
- logger.logger.info('Using default --stdout from socket.json:', stdout);
5124
+ logger.logger.info(`Using default --stdout from ${constants.SOCKET_JSON}:`, stdout);
5067
5125
  }
5068
5126
  if (stdout) {
5069
5127
  out = '-';
5070
5128
  } else if (!out) {
5071
5129
  if (sockJson.defaults?.manifest?.conda?.outfile) {
5072
5130
  out = sockJson.defaults?.manifest?.conda?.outfile;
5073
- logger.logger.info('Using default --out from socket.json:', out);
5131
+ logger.logger.info(`Using default --out from ${constants.SOCKET_JSON}:`, out);
5074
5132
  } else {
5075
- out = 'requirements.txt';
5133
+ out = constants.REQUIREMENTS_TXT;
5076
5134
  }
5077
5135
  }
5078
5136
  if (verbose === undefined && sockJson.defaults?.manifest?.conda?.verbose !== undefined) {
5079
5137
  verbose = sockJson.defaults?.manifest?.conda?.verbose;
5080
- logger.logger.info('Using default --verbose from socket.json:', verbose);
5138
+ logger.logger.info(`Using default --verbose from ${constants.SOCKET_JSON}:`, verbose);
5081
5139
  } else if (verbose === undefined) {
5082
5140
  verbose = false;
5083
5141
  }
@@ -5111,10 +5169,10 @@ async function run$B(argv, importMeta, {
5111
5169
  }
5112
5170
  await handleManifestConda({
5113
5171
  cwd,
5114
- filename: String(filename),
5115
- out: String(out || ''),
5172
+ filename,
5173
+ out,
5116
5174
  outputKind,
5117
- verbose: Boolean(verbose)
5175
+ verbose
5118
5176
  });
5119
5177
  }
5120
5178
 
@@ -5149,7 +5207,7 @@ const config$b = {
5149
5207
  global \`gradle\` binary but that may not work (hard to predict).
5150
5208
 
5151
5209
  The \`pom.xml\` is a manifest file similar to \`package.json\` for npm or
5152
- or requirements.txt for PyPi), but specifically for Maven, which is Java's
5210
+ or ${constants.REQUIREMENTS_TXT} for PyPi), but specifically for Maven, which is Java's
5153
5211
  dependency repository. Languages like Kotlin and Scala piggy back on it too.
5154
5212
 
5155
5213
  There are some caveats with the gradle to \`pom.xml\` conversion:
@@ -5173,9 +5231,9 @@ const config$b = {
5173
5231
  const cmdManifestGradle = {
5174
5232
  description: config$b.description,
5175
5233
  hidden: config$b.hidden,
5176
- run: run$A
5234
+ run: run$C
5177
5235
  };
5178
- async function run$A(argv, importMeta, {
5236
+ async function run$C(argv, importMeta, {
5179
5237
  parentName
5180
5238
  }) {
5181
5239
  const cli = utils.meowOrExit({
@@ -5197,7 +5255,7 @@ async function run$A(argv, importMeta, {
5197
5255
  // If given path is absolute then cwd should not affect it.
5198
5256
  cwd = path.resolve(process.cwd(), cwd);
5199
5257
  const sockJson = utils.readOrDefaultSocketJson(cwd);
5200
- require$$9.debugFn('inspect', 'override: socket.json gradle', sockJson?.defaults?.manifest?.gradle);
5258
+ require$$9.debugFn('inspect', `override: ${constants.SOCKET_JSON} gradle`, sockJson?.defaults?.manifest?.gradle);
5201
5259
  let {
5202
5260
  bin,
5203
5261
  gradleOpts,
@@ -5208,7 +5266,7 @@ async function run$A(argv, importMeta, {
5208
5266
  if (!bin) {
5209
5267
  if (sockJson.defaults?.manifest?.gradle?.bin) {
5210
5268
  bin = sockJson.defaults?.manifest?.gradle?.bin;
5211
- logger.logger.info('Using default --bin from socket.json:', bin);
5269
+ logger.logger.info(`Using default --bin from ${constants.SOCKET_JSON}:`, bin);
5212
5270
  } else {
5213
5271
  bin = path.join(cwd, 'gradlew');
5214
5272
  }
@@ -5216,7 +5274,7 @@ async function run$A(argv, importMeta, {
5216
5274
  if (!gradleOpts) {
5217
5275
  if (sockJson.defaults?.manifest?.gradle?.gradleOpts) {
5218
5276
  gradleOpts = sockJson.defaults?.manifest?.gradle?.gradleOpts;
5219
- logger.logger.info('Using default --gradle-opts from socket.json:', gradleOpts);
5277
+ logger.logger.info(`Using default --gradle-opts from ${constants.SOCKET_JSON}:`, gradleOpts);
5220
5278
  } else {
5221
5279
  gradleOpts = '';
5222
5280
  }
@@ -5224,7 +5282,7 @@ async function run$A(argv, importMeta, {
5224
5282
  if (verbose === undefined) {
5225
5283
  if (sockJson.defaults?.manifest?.gradle?.verbose !== undefined) {
5226
5284
  verbose = sockJson.defaults?.manifest?.gradle?.verbose;
5227
- logger.logger.info('Using default --verbose from socket.json:', verbose);
5285
+ logger.logger.info(`Using default --verbose from ${constants.SOCKET_JSON}:`, verbose);
5228
5286
  } else {
5229
5287
  verbose = false;
5230
5288
  }
@@ -5304,7 +5362,7 @@ const config$a = {
5304
5362
  global \`gradle\` binary but that may not work (hard to predict).
5305
5363
 
5306
5364
  The \`pom.xml\` is a manifest file similar to \`package.json\` for npm or
5307
- or requirements.txt for PyPi), but specifically for Maven, which is Java's
5365
+ or ${constants.REQUIREMENTS_TXT} for PyPi), but specifically for Maven, which is Java's
5308
5366
  dependency repository. Languages like Kotlin and Scala piggy back on it too.
5309
5367
 
5310
5368
  There are some caveats with the gradle to \`pom.xml\` conversion:
@@ -5328,9 +5386,9 @@ const config$a = {
5328
5386
  const cmdManifestKotlin = {
5329
5387
  description: config$a.description,
5330
5388
  hidden: config$a.hidden,
5331
- run: run$z
5389
+ run: run$B
5332
5390
  };
5333
- async function run$z(argv, importMeta, {
5391
+ async function run$B(argv, importMeta, {
5334
5392
  parentName
5335
5393
  }) {
5336
5394
  const cli = utils.meowOrExit({
@@ -5352,7 +5410,7 @@ async function run$z(argv, importMeta, {
5352
5410
  // If given path is absolute then cwd should not affect it.
5353
5411
  cwd = path.resolve(process.cwd(), cwd);
5354
5412
  const sockJson = utils.readOrDefaultSocketJson(cwd);
5355
- require$$9.debugFn('inspect', 'override: socket.json gradle', sockJson?.defaults?.manifest?.gradle);
5413
+ require$$9.debugFn('inspect', `override: ${constants.SOCKET_JSON} gradle`, sockJson?.defaults?.manifest?.gradle);
5356
5414
  let {
5357
5415
  bin,
5358
5416
  gradleOpts,
@@ -5363,7 +5421,7 @@ async function run$z(argv, importMeta, {
5363
5421
  if (!bin) {
5364
5422
  if (sockJson.defaults?.manifest?.gradle?.bin) {
5365
5423
  bin = sockJson.defaults?.manifest?.gradle?.bin;
5366
- logger.logger.info('Using default --bin from socket.json:', bin);
5424
+ logger.logger.info(`Using default --bin from ${constants.SOCKET_JSON}:`, bin);
5367
5425
  } else {
5368
5426
  bin = path.join(cwd, 'gradlew');
5369
5427
  }
@@ -5371,7 +5429,7 @@ async function run$z(argv, importMeta, {
5371
5429
  if (!gradleOpts) {
5372
5430
  if (sockJson.defaults?.manifest?.gradle?.gradleOpts) {
5373
5431
  gradleOpts = sockJson.defaults?.manifest?.gradle?.gradleOpts;
5374
- logger.logger.info('Using default --gradle-opts from socket.json:', gradleOpts);
5432
+ logger.logger.info(`Using default --gradle-opts from ${constants.SOCKET_JSON}:`, gradleOpts);
5375
5433
  } else {
5376
5434
  gradleOpts = '';
5377
5435
  }
@@ -5379,7 +5437,7 @@ async function run$z(argv, importMeta, {
5379
5437
  if (verbose === undefined) {
5380
5438
  if (sockJson.defaults?.manifest?.gradle?.verbose !== undefined) {
5381
5439
  verbose = sockJson.defaults?.manifest?.gradle?.verbose;
5382
- logger.logger.info('Using default --verbose from socket.json:', verbose);
5440
+ logger.logger.info(`Using default --verbose from ${constants.SOCKET_JSON}:`, verbose);
5383
5441
  } else {
5384
5442
  verbose = false;
5385
5443
  }
@@ -5459,7 +5517,7 @@ const config$9 = {
5459
5517
 
5460
5518
  Uses \`sbt makePom\` to generate a \`pom.xml\` from your \`build.sbt\` file.
5461
5519
  This xml file is the dependency manifest (like a package.json
5462
- for Node.js or requirements.txt for PyPi), but specifically for Scala.
5520
+ for Node.js or ${constants.REQUIREMENTS_TXT} for PyPi), but specifically for Scala.
5463
5521
 
5464
5522
  There are some caveats with \`build.sbt\` to \`pom.xml\` conversion:
5465
5523
 
@@ -5491,9 +5549,9 @@ const config$9 = {
5491
5549
  const cmdManifestScala = {
5492
5550
  description: config$9.description,
5493
5551
  hidden: config$9.hidden,
5494
- run: run$y
5552
+ run: run$A
5495
5553
  };
5496
- async function run$y(argv, importMeta, {
5554
+ async function run$A(argv, importMeta, {
5497
5555
  parentName
5498
5556
  }) {
5499
5557
  const cli = utils.meowOrExit({
@@ -5515,7 +5573,7 @@ async function run$y(argv, importMeta, {
5515
5573
  // TODO: Implement json/md further.
5516
5574
  const outputKind = utils.getOutputKind(json, markdown);
5517
5575
  const sockJson = utils.readOrDefaultSocketJson(cwd);
5518
- require$$9.debugFn('inspect', 'override: socket.json sbt', sockJson?.defaults?.manifest?.sbt);
5576
+ require$$9.debugFn('inspect', `override: ${constants.SOCKET_JSON} sbt`, sockJson?.defaults?.manifest?.sbt);
5519
5577
  let {
5520
5578
  bin,
5521
5579
  out,
@@ -5528,21 +5586,21 @@ async function run$y(argv, importMeta, {
5528
5586
  if (!bin) {
5529
5587
  if (sockJson.defaults?.manifest?.sbt?.bin) {
5530
5588
  bin = sockJson.defaults?.manifest?.sbt?.bin;
5531
- logger.logger.info('Using default --bin from socket.json:', bin);
5589
+ logger.logger.info(`Using default --bin from ${constants.SOCKET_JSON}:`, bin);
5532
5590
  } else {
5533
5591
  bin = 'sbt';
5534
5592
  }
5535
5593
  }
5536
5594
  if (stdout === undefined && sockJson.defaults?.manifest?.sbt?.stdout !== undefined) {
5537
5595
  stdout = sockJson.defaults?.manifest?.sbt?.stdout;
5538
- logger.logger.info('Using default --stdout from socket.json:', stdout);
5596
+ logger.logger.info(`Using default --stdout from ${constants.SOCKET_JSON}:`, stdout);
5539
5597
  }
5540
5598
  if (stdout) {
5541
5599
  out = '-';
5542
5600
  } else if (!out) {
5543
5601
  if (sockJson.defaults?.manifest?.sbt?.outfile) {
5544
5602
  out = sockJson.defaults?.manifest?.sbt?.outfile;
5545
- logger.logger.info('Using default --out from socket.json:', out);
5603
+ logger.logger.info(`Using default --out from ${constants.SOCKET_JSON}:`, out);
5546
5604
  } else {
5547
5605
  out = './socket.pom.xml';
5548
5606
  }
@@ -5550,14 +5608,14 @@ async function run$y(argv, importMeta, {
5550
5608
  if (!sbtOpts) {
5551
5609
  if (sockJson.defaults?.manifest?.sbt?.sbtOpts) {
5552
5610
  sbtOpts = sockJson.defaults?.manifest?.sbt?.sbtOpts;
5553
- logger.logger.info('Using default --sbt-opts from socket.json:', sbtOpts);
5611
+ logger.logger.info(`Using default --sbt-opts from ${constants.SOCKET_JSON}:`, sbtOpts);
5554
5612
  } else {
5555
5613
  sbtOpts = '';
5556
5614
  }
5557
5615
  }
5558
5616
  if (verbose === undefined && sockJson.defaults?.manifest?.sbt?.verbose !== undefined) {
5559
5617
  verbose = sockJson.defaults?.manifest?.sbt?.verbose;
5560
- logger.logger.info('Using default --verbose from socket.json:', verbose);
5618
+ logger.logger.info(`Using default --verbose from ${constants.SOCKET_JSON}:`, verbose);
5561
5619
  } else if (verbose === undefined) {
5562
5620
  verbose = false;
5563
5621
  }
@@ -5625,18 +5683,18 @@ async function setupManifestConfig(cwd, defaultOnReadError = false) {
5625
5683
  // - each target will have its own specific options
5626
5684
  // - record them to the socket.yml (or socket-cli.yml ? or just socket.json ?)
5627
5685
 
5628
- const jsonPath = path.join(cwd, `socket.json`);
5686
+ const jsonPath = path.join(cwd, constants.SOCKET_JSON);
5629
5687
  if (fs$1.existsSync(jsonPath)) {
5630
- logger.logger.info(`Found socket.json at ${jsonPath}`);
5688
+ logger.logger.info(`Found ${constants.SOCKET_JSON} at ${jsonPath}`);
5631
5689
  } else {
5632
- logger.logger.info(`No socket.json found at ${cwd}, will generate a new one`);
5690
+ logger.logger.info(`No ${constants.SOCKET_JSON} found at ${cwd}, will generate a new one`);
5633
5691
  }
5634
5692
  logger.logger.log('');
5635
5693
  logger.logger.log('Note: This tool will set up flag and argument defaults for certain');
5636
5694
  logger.logger.log(' CLI commands. You can still override them by explicitly');
5637
5695
  logger.logger.log(' setting the flag. It is meant to be a convenience tool.');
5638
5696
  logger.logger.log('');
5639
- logger.logger.log('This command will generate a socket.json file in the target cwd.');
5697
+ logger.logger.log(`This command will generate a ${constants.SOCKET_JSON} file in the target cwd.`);
5640
5698
  logger.logger.log('You can choose to add this file to your repo (handy for collaboration)');
5641
5699
  logger.logger.log('or to add it to the ignored files, or neither. This file is only');
5642
5700
  logger.logger.log('used in CLI workflows.');
@@ -5644,7 +5702,7 @@ async function setupManifestConfig(cwd, defaultOnReadError = false) {
5644
5702
  const choices = [{
5645
5703
  name: 'Conda'.padEnd(30, ' '),
5646
5704
  value: 'conda',
5647
- description: 'Generate requirements.txt from a Conda environment.yml'
5705
+ description: `Generate ${constants.REQUIREMENTS_TXT} from a Conda environment.yml`
5648
5706
  }, {
5649
5707
  name: 'Gradle'.padEnd(30, ' '),
5650
5708
  value: 'gradle',
@@ -5737,7 +5795,7 @@ async function setupManifestConfig(cwd, defaultOnReadError = false) {
5737
5795
  return result;
5738
5796
  }
5739
5797
  logger.logger.log('');
5740
- logger.logger.log('Setup complete. Writing socket.json');
5798
+ logger.logger.log(`Setup complete. Writing ${constants.SOCKET_JSON}`);
5741
5799
  logger.logger.log('');
5742
5800
  if (await prompts.select({
5743
5801
  message: `Do you want to write the new config to ${jsonPath} ?`,
@@ -5788,7 +5846,7 @@ async function setupConda(config) {
5788
5846
  delete config.stdout;
5789
5847
  }
5790
5848
  if (!config.stdout) {
5791
- const out = await askForOutputFile(config.outfile || 'requirements.txt');
5849
+ const out = await askForOutputFile(config.outfile || constants.REQUIREMENTS_TXT);
5792
5850
  if (out === undefined) {
5793
5851
  return canceledByUser$1();
5794
5852
  } else if (out === '-') {
@@ -6015,7 +6073,7 @@ const config$8 = {
6015
6073
  ...flags.commonFlags,
6016
6074
  defaultOnReadError: {
6017
6075
  type: 'boolean',
6018
- description: 'If reading the socket.json fails, just use a default config? Warning: This might override the existing json file!'
6076
+ description: `If reading the ${constants.SOCKET_JSON} fails, just use a default config? Warning: This might override the existing json file!`
6019
6077
  }
6020
6078
  },
6021
6079
  help: (command, config) => `
@@ -6028,7 +6086,7 @@ const config$8 = {
6028
6086
  This command will try to detect all supported ecosystems in given CWD. Then
6029
6087
  it starts a configurator where you can setup default values for certain flags
6030
6088
  when creating manifest files in that dir. These configuration details are
6031
- then stored in a local \`socket.json\` file (which you may or may not commit
6089
+ then stored in a local \`${constants.SOCKET_JSON}\` file (which you may or may not commit
6032
6090
  to the repo). Next time you run \`socket manifest ...\` it will load this
6033
6091
  json file and any flags which are not explicitly set in the command but which
6034
6092
  have been registered in the json file will get the default value set to that
@@ -6052,9 +6110,9 @@ const config$8 = {
6052
6110
  const cmdManifestSetup = {
6053
6111
  description: config$8.description,
6054
6112
  hidden: config$8.hidden,
6055
- run: run$x
6113
+ run: run$z
6056
6114
  };
6057
- async function run$x(argv, importMeta, {
6115
+ async function run$z(argv, importMeta, {
6058
6116
  parentName
6059
6117
  }) {
6060
6118
  const cli = utils.meowOrExit({
@@ -6088,9 +6146,9 @@ const config$7 = {
6088
6146
  const cmdManifest = {
6089
6147
  description: config$7.description,
6090
6148
  hidden: config$7.hidden,
6091
- run: run$w
6149
+ run: run$y
6092
6150
  };
6093
- async function run$w(argv, importMeta, {
6151
+ async function run$y(argv, importMeta, {
6094
6152
  parentName
6095
6153
  }) {
6096
6154
  await utils.meowWithSubcommands({
@@ -6117,16 +6175,16 @@ async function run$w(argv, importMeta, {
6117
6175
  });
6118
6176
  }
6119
6177
 
6120
- const require$3 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
6121
- const CMD_NAME$p = constants.NPM;
6122
- const description$u = 'Run npm with the Socket wrapper';
6123
- const hidden$o = false;
6178
+ const require$5 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
6179
+ const CMD_NAME$r = constants.NPM;
6180
+ const description$w = 'Run npm with the Socket wrapper';
6181
+ const hidden$q = false;
6124
6182
  const cmdNpm = {
6125
- description: description$u,
6126
- hidden: hidden$o,
6127
- run: run$v
6183
+ description: description$w,
6184
+ hidden: hidden$q,
6185
+ run: run$x
6128
6186
  };
6129
- async function run$v(argv, importMeta, context) {
6187
+ async function run$x(argv, importMeta, context) {
6130
6188
  const {
6131
6189
  parentName
6132
6190
  } = {
@@ -6134,9 +6192,9 @@ async function run$v(argv, importMeta, context) {
6134
6192
  ...context
6135
6193
  };
6136
6194
  const config = {
6137
- commandName: CMD_NAME$p,
6138
- description: description$u,
6139
- hidden: hidden$o,
6195
+ commandName: CMD_NAME$r,
6196
+ description: description$w,
6197
+ hidden: hidden$q,
6140
6198
  flags: {
6141
6199
  ...flags.commonFlags
6142
6200
  },
@@ -6145,7 +6203,7 @@ async function run$v(argv, importMeta, context) {
6145
6203
  $ ${command} ...
6146
6204
 
6147
6205
  API Token Requirements
6148
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$p}`)}
6206
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$r}`)}
6149
6207
 
6150
6208
  Note: Everything after "npm" is passed to the npm command.
6151
6209
  Only the \`--dry-run\` and \`--help\` flags are caught here.
@@ -6155,6 +6213,7 @@ async function run$v(argv, importMeta, context) {
6155
6213
  Examples
6156
6214
  $ ${command}
6157
6215
  $ ${command} install -g cowsay
6216
+ $ ${command} exec cowsay
6158
6217
  `
6159
6218
  };
6160
6219
  const cli = utils.meowOrExit({
@@ -6168,10 +6227,10 @@ async function run$v(argv, importMeta, context) {
6168
6227
  logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
6169
6228
  return;
6170
6229
  }
6171
- const shadowBin = /*@__PURE__*/require$3(constants.default.shadowNpmBinPath);
6230
+ const shadowBin = /*@__PURE__*/require$5(constants.default.shadowNpmBinPath);
6172
6231
  process.exitCode = 1;
6173
6232
 
6174
- // Filter Socket flags from argv but keep --json for npm
6233
+ // Filter Socket flags from argv but keep --json for npm.
6175
6234
  const argsToForward = utils.filterFlags(argv, {
6176
6235
  ...flags.commonFlags,
6177
6236
  ...flags.outputFlags
@@ -6194,22 +6253,22 @@ async function run$v(argv, importMeta, context) {
6194
6253
  await spawnPromise;
6195
6254
  }
6196
6255
 
6197
- const require$2 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
6198
- const CMD_NAME$o = constants.NPX;
6199
- const description$t = 'Run npx with the Socket wrapper';
6200
- const hidden$n = false;
6256
+ const require$4 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
6257
+ const CMD_NAME$q = constants.NPX;
6258
+ const description$v = 'Run npx with the Socket wrapper';
6259
+ const hidden$p = false;
6201
6260
  const cmdNpx = {
6202
- description: description$t,
6203
- hidden: hidden$n,
6204
- run: run$u
6261
+ description: description$v,
6262
+ hidden: hidden$p,
6263
+ run: run$w
6205
6264
  };
6206
- async function run$u(argv, importMeta, {
6265
+ async function run$w(argv, importMeta, {
6207
6266
  parentName
6208
6267
  }) {
6209
6268
  const config = {
6210
- commandName: CMD_NAME$o,
6211
- description: description$t,
6212
- hidden: hidden$n,
6269
+ commandName: CMD_NAME$q,
6270
+ description: description$v,
6271
+ hidden: hidden$p,
6213
6272
  flags: {
6214
6273
  ...flags.commonFlags
6215
6274
  },
@@ -6218,7 +6277,7 @@ async function run$u(argv, importMeta, {
6218
6277
  $ ${command} ...
6219
6278
 
6220
6279
  API Token Requirements
6221
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$o}`)}
6280
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$q}`)}
6222
6281
 
6223
6282
  Note: Everything after "npx" is passed to the npx command.
6224
6283
  Only the \`--dry-run\` and \`--help\` flags are caught here.
@@ -6227,6 +6286,7 @@ async function run$u(argv, importMeta, {
6227
6286
 
6228
6287
  Examples
6229
6288
  $ ${command} cowsay
6289
+ $ ${command} cowsay@1.6.0 hello
6230
6290
  `
6231
6291
  };
6232
6292
  const cli = utils.meowOrExit({
@@ -6240,7 +6300,7 @@ async function run$u(argv, importMeta, {
6240
6300
  logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
6241
6301
  return;
6242
6302
  }
6243
- const shadowBin = /*@__PURE__*/require$2(constants.default.shadowNpmBinPath);
6303
+ const shadowBin = /*@__PURE__*/require$4(constants.default.shadowNpmBinPath);
6244
6304
  process.exitCode = 1;
6245
6305
  const {
6246
6306
  spawnPromise
@@ -6283,9 +6343,9 @@ const config$6 = {
6283
6343
  const cmdOops = {
6284
6344
  description: config$6.description,
6285
6345
  hidden: config$6.hidden,
6286
- run: run$t
6346
+ run: run$v
6287
6347
  };
6288
- async function run$t(argv, importMeta, {
6348
+ async function run$v(argv, importMeta, {
6289
6349
  parentName
6290
6350
  }) {
6291
6351
  const cli = utils.meowOrExit({
@@ -6317,7 +6377,7 @@ async function run$t(argv, importMeta, {
6317
6377
  logger.logger.fail(utils.failMsgWithBadge('Oops', 'This error was intentionally left blank'));
6318
6378
  return;
6319
6379
  }
6320
- throw new Error('This error was intentionally left blank');
6380
+ throw new Error('This error was intentionally left blank.');
6321
6381
  }
6322
6382
 
6323
6383
  const {
@@ -6702,7 +6762,7 @@ async function listPackages(pkgEnvDetails, options) {
6702
6762
  }
6703
6763
  }
6704
6764
 
6705
- const CMD_NAME$n = 'socket optimize';
6765
+ const CMD_NAME$p = 'socket optimize';
6706
6766
 
6707
6767
  const {
6708
6768
  BUN,
@@ -6874,7 +6934,7 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
6874
6934
  npmExecPath === constants.NPM && !state.warnedPnpmWorkspaceRequiresNpm) {
6875
6935
  state.warnedPnpmWorkspaceRequiresNpm = true;
6876
6936
  spinner?.stop();
6877
- logger?.warn(utils.cmdPrefixMessage(CMD_NAME$n, `${agent} workspace support requires \`npm ls\`, falling back to \`${agent} list\``));
6937
+ logger?.warn(utils.cmdPrefixMessage(CMD_NAME$p, `${agent} workspace support requires \`npm ls\`, falling back to \`${agent} list\``));
6878
6938
  spinner?.start();
6879
6939
  }
6880
6940
  const overridesDataObjects = [];
@@ -7104,7 +7164,7 @@ async function applyOptimization(pkgEnvDetails, {
7104
7164
  const pkgJsonChanged = addedCount > 0 || updatedCount > 0;
7105
7165
  if (pkgJsonChanged || pkgEnvDetails.features.npmBuggyOverrides) {
7106
7166
  const result = await updateLockfile(pkgEnvDetails, {
7107
- cmdName: CMD_NAME$n,
7167
+ cmdName: CMD_NAME$p,
7108
7168
  logger: logger.logger,
7109
7169
  spinner
7110
7170
  });
@@ -7166,7 +7226,7 @@ async function handleOptimize({
7166
7226
  prod
7167
7227
  }) {
7168
7228
  const pkgEnvCResult = await utils.detectAndValidatePackageEnvironment(cwd, {
7169
- cmdName: CMD_NAME$n,
7229
+ cmdName: CMD_NAME$p,
7170
7230
  logger: logger.logger,
7171
7231
  prod
7172
7232
  });
@@ -7191,7 +7251,7 @@ async function handleOptimize({
7191
7251
  await outputOptimizeResult({
7192
7252
  ok: false,
7193
7253
  message: 'Unsupported',
7194
- cause: utils.cmdPrefixMessage(CMD_NAME$n, `${agent} v${agentVersion} does not support overrides.`)
7254
+ cause: utils.cmdPrefixMessage(CMD_NAME$p, `${agent} v${agentVersion} does not support overrides.`)
7195
7255
  }, outputKind);
7196
7256
  return;
7197
7257
  }
@@ -7202,21 +7262,21 @@ async function handleOptimize({
7202
7262
  }), outputKind);
7203
7263
  }
7204
7264
 
7205
- const CMD_NAME$m = 'optimize';
7206
- const description$s = 'Optimize dependencies with @socketregistry overrides';
7207
- const hidden$m = false;
7265
+ const CMD_NAME$o = 'optimize';
7266
+ const description$u = 'Optimize dependencies with @socketregistry overrides';
7267
+ const hidden$o = false;
7208
7268
  const cmdOptimize = {
7209
- description: description$s,
7210
- hidden: hidden$m,
7211
- run: run$s
7269
+ description: description$u,
7270
+ hidden: hidden$o,
7271
+ run: run$u
7212
7272
  };
7213
- async function run$s(argv, importMeta, {
7273
+ async function run$u(argv, importMeta, {
7214
7274
  parentName
7215
7275
  }) {
7216
7276
  const config = {
7217
- commandName: CMD_NAME$m,
7218
- description: description$s,
7219
- hidden: hidden$m,
7277
+ commandName: CMD_NAME$o,
7278
+ description: description$u,
7279
+ hidden: hidden$o,
7220
7280
  flags: {
7221
7281
  ...flags.commonFlags,
7222
7282
  pin: {
@@ -7235,14 +7295,14 @@ async function run$s(argv, importMeta, {
7235
7295
  $ ${command} [options] [CWD=.]
7236
7296
 
7237
7297
  API Token Requirements
7238
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$m}`)}
7298
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$o}`)}
7239
7299
 
7240
7300
  Options
7241
7301
  ${utils.getFlagListOutput(config.flags)}
7242
7302
 
7243
7303
  Examples
7244
7304
  $ ${command}
7245
- $ ${command} ./proj/tree --pin
7305
+ $ ${command} ./path/to/project --pin
7246
7306
  `
7247
7307
  };
7248
7308
  const cli = utils.meowOrExit({
@@ -7378,21 +7438,21 @@ async function handleDependencies({
7378
7438
  });
7379
7439
  }
7380
7440
 
7381
- const CMD_NAME$l = 'dependencies';
7382
- const description$r = 'Search for any dependency that is being used in your organization';
7383
- const hidden$l = false;
7441
+ const CMD_NAME$n = 'dependencies';
7442
+ const description$t = 'Search for any dependency that is being used in your organization';
7443
+ const hidden$n = false;
7384
7444
  const cmdOrganizationDependencies = {
7385
- description: description$r,
7386
- hidden: hidden$l,
7387
- run: run$r
7445
+ description: description$t,
7446
+ hidden: hidden$n,
7447
+ run: run$t
7388
7448
  };
7389
- async function run$r(argv, importMeta, {
7449
+ async function run$t(argv, importMeta, {
7390
7450
  parentName
7391
7451
  }) {
7392
7452
  const config = {
7393
- commandName: CMD_NAME$l,
7394
- description: description$r,
7395
- hidden: hidden$l,
7453
+ commandName: CMD_NAME$n,
7454
+ description: description$t,
7455
+ hidden: hidden$n,
7396
7456
  flags: {
7397
7457
  ...flags.commonFlags,
7398
7458
  limit: {
@@ -7412,7 +7472,7 @@ async function run$r(argv, importMeta, {
7412
7472
  ${command} [options]
7413
7473
 
7414
7474
  API Token Requirements
7415
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$l}`)}
7475
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$n}`)}
7416
7476
 
7417
7477
  Options
7418
7478
  ${utils.getFlagListOutput(config.flags)}
@@ -7512,21 +7572,21 @@ async function handleLicensePolicy(orgSlug, outputKind) {
7512
7572
  await outputLicensePolicy(data, outputKind);
7513
7573
  }
7514
7574
 
7515
- const CMD_NAME$k = 'license';
7516
- const description$q = 'Retrieve the license policy of an organization';
7517
- const hidden$k = false;
7575
+ const CMD_NAME$m = 'license';
7576
+ const description$s = 'Retrieve the license policy of an organization';
7577
+ const hidden$m = false;
7518
7578
  const cmdOrganizationPolicyLicense = {
7519
- description: description$q,
7520
- hidden: hidden$k,
7521
- run: run$q
7579
+ description: description$s,
7580
+ hidden: hidden$m,
7581
+ run: run$s
7522
7582
  };
7523
- async function run$q(argv, importMeta, {
7583
+ async function run$s(argv, importMeta, {
7524
7584
  parentName
7525
7585
  }) {
7526
7586
  const config = {
7527
- commandName: CMD_NAME$k,
7528
- description: description$q,
7529
- hidden: hidden$k,
7587
+ commandName: CMD_NAME$m,
7588
+ description: description$s,
7589
+ hidden: hidden$m,
7530
7590
  flags: {
7531
7591
  ...flags.commonFlags,
7532
7592
  ...flags.outputFlags,
@@ -7545,7 +7605,7 @@ async function run$q(argv, importMeta, {
7545
7605
  $ ${command} [options]
7546
7606
 
7547
7607
  API Token Requirements
7548
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$k}`)}
7608
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$m}`)}
7549
7609
 
7550
7610
  Options
7551
7611
  ${utils.getFlagListOutput(config.flags)}
@@ -7648,21 +7708,21 @@ async function handleSecurityPolicy(orgSlug, outputKind) {
7648
7708
  await outputSecurityPolicy(data, outputKind);
7649
7709
  }
7650
7710
 
7651
- const CMD_NAME$j = 'security';
7652
- const description$p = 'Retrieve the security policy of an organization';
7653
- const hidden$j = true;
7711
+ const CMD_NAME$l = 'security';
7712
+ const description$r = 'Retrieve the security policy of an organization';
7713
+ const hidden$l = true;
7654
7714
  const cmdOrganizationPolicySecurity = {
7655
- description: description$p,
7656
- hidden: hidden$j,
7657
- run: run$p
7715
+ description: description$r,
7716
+ hidden: hidden$l,
7717
+ run: run$r
7658
7718
  };
7659
- async function run$p(argv, importMeta, {
7719
+ async function run$r(argv, importMeta, {
7660
7720
  parentName
7661
7721
  }) {
7662
7722
  const config = {
7663
- commandName: CMD_NAME$j,
7664
- description: description$p,
7665
- hidden: hidden$j,
7723
+ commandName: CMD_NAME$l,
7724
+ description: description$r,
7725
+ hidden: hidden$l,
7666
7726
  flags: {
7667
7727
  ...flags.commonFlags,
7668
7728
  ...flags.outputFlags,
@@ -7681,7 +7741,7 @@ async function run$p(argv, importMeta, {
7681
7741
  $ ${command} [options]
7682
7742
 
7683
7743
  API Token Requirements
7684
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$j}`)}
7744
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$l}`)}
7685
7745
 
7686
7746
  Options
7687
7747
  ${utils.getFlagListOutput(config.flags)}
@@ -7785,21 +7845,21 @@ async function handleOrganizationList(outputKind = 'text') {
7785
7845
  await outputOrganizationList(data, outputKind);
7786
7846
  }
7787
7847
 
7788
- const CMD_NAME$i = 'list';
7789
- const description$o = 'List organizations associated with the Socket API token';
7790
- const hidden$i = false;
7848
+ const CMD_NAME$k = 'list';
7849
+ const description$q = 'List organizations associated with the Socket API token';
7850
+ const hidden$k = false;
7791
7851
  const cmdOrganizationList = {
7792
- description: description$o,
7793
- hidden: hidden$i,
7794
- run: run$o
7852
+ description: description$q,
7853
+ hidden: hidden$k,
7854
+ run: run$q
7795
7855
  };
7796
- async function run$o(argv, importMeta, {
7856
+ async function run$q(argv, importMeta, {
7797
7857
  parentName
7798
7858
  }) {
7799
7859
  const config = {
7800
- commandName: CMD_NAME$i,
7801
- description: description$o,
7802
- hidden: hidden$i,
7860
+ commandName: CMD_NAME$k,
7861
+ description: description$q,
7862
+ hidden: hidden$k,
7803
7863
  flags: {
7804
7864
  ...flags.commonFlags,
7805
7865
  ...flags.outputFlags
@@ -7809,7 +7869,7 @@ async function run$o(argv, importMeta, {
7809
7869
  $ ${command} [options]
7810
7870
 
7811
7871
  API Token Requirements
7812
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$i}`)}
7872
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$k}`)}
7813
7873
 
7814
7874
  Options
7815
7875
  ${utils.getFlagListOutput(config.flags)}
@@ -7853,9 +7913,9 @@ async function run$o(argv, importMeta, {
7853
7913
  await handleOrganizationList(outputKind);
7854
7914
  }
7855
7915
 
7856
- const description$n = 'Organization policy details';
7916
+ const description$p = 'Organization policy details';
7857
7917
  const cmdOrganizationPolicy = {
7858
- description: description$n,
7918
+ description: description$p,
7859
7919
  // Hidden because it was broken all this time (nobody could be using it)
7860
7920
  // and we're not sure if it's useful to anyone in its current state.
7861
7921
  // Until we do, we'll hide this to keep the help tidier.
@@ -7869,7 +7929,7 @@ const cmdOrganizationPolicy = {
7869
7929
  license: cmdOrganizationPolicyLicense
7870
7930
  }, {
7871
7931
  argv,
7872
- description: description$n,
7932
+ description: description$p,
7873
7933
  defaultSub: 'list',
7874
7934
  // Backwards compat
7875
7935
  importMeta,
@@ -7946,9 +8006,9 @@ const config$5 = {
7946
8006
  const cmdOrganizationQuota = {
7947
8007
  description: config$5.description,
7948
8008
  hidden: config$5.hidden,
7949
- run: run$n
8009
+ run: run$p
7950
8010
  };
7951
- async function run$n(argv, importMeta, {
8011
+ async function run$p(argv, importMeta, {
7952
8012
  parentName
7953
8013
  }) {
7954
8014
  const cli = utils.meowOrExit({
@@ -7983,9 +8043,9 @@ async function run$n(argv, importMeta, {
7983
8043
  await handleQuota(outputKind);
7984
8044
  }
7985
8045
 
7986
- const description$m = 'Manage Socket organization account details';
8046
+ const description$o = 'Manage Socket organization account details';
7987
8047
  const cmdOrganization = {
7988
- description: description$m,
8048
+ description: description$o,
7989
8049
  hidden: false,
7990
8050
  async run(argv, importMeta, {
7991
8051
  parentName
@@ -8014,7 +8074,7 @@ const cmdOrganization = {
8014
8074
  }
8015
8075
  },
8016
8076
  argv,
8017
- description: description$m,
8077
+ description: description$o,
8018
8078
  importMeta,
8019
8079
  name: `${parentName} organization`
8020
8080
  });
@@ -8239,21 +8299,21 @@ function parsePackageSpecifiers(ecosystem, pkgs) {
8239
8299
  };
8240
8300
  }
8241
8301
 
8242
- const CMD_NAME$h = 'score';
8243
- const description$l = 'Look up score for one package which reflects all of its transitive dependencies as well';
8244
- const hidden$h = false;
8302
+ const CMD_NAME$j = 'score';
8303
+ const description$n = 'Look up score for one package which reflects all of its transitive dependencies as well';
8304
+ const hidden$j = false;
8245
8305
  const cmdPackageScore = {
8246
- description: description$l,
8247
- hidden: hidden$h,
8248
- run: run$m
8306
+ description: description$n,
8307
+ hidden: hidden$j,
8308
+ run: run$o
8249
8309
  };
8250
- async function run$m(argv, importMeta, {
8310
+ async function run$o(argv, importMeta, {
8251
8311
  parentName
8252
8312
  }) {
8253
8313
  const config = {
8254
- commandName: CMD_NAME$h,
8255
- description: description$l,
8256
- hidden: hidden$h,
8314
+ commandName: CMD_NAME$j,
8315
+ description: description$n,
8316
+ hidden: hidden$j,
8257
8317
  flags: {
8258
8318
  ...flags.commonFlags,
8259
8319
  ...flags.outputFlags
@@ -8263,7 +8323,7 @@ async function run$m(argv, importMeta, {
8263
8323
  $ ${command} [options] <<ECOSYSTEM> <NAME> | <PURL>>
8264
8324
 
8265
8325
  API Token Requirements
8266
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$h}`)}
8326
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$j}`)}
8267
8327
 
8268
8328
  Options
8269
8329
  ${utils.getFlagListOutput(config.flags)}
@@ -8470,7 +8530,7 @@ function getAlertString(alerts, options) {
8470
8530
  return `${colorless}${padding}${arrays.joinAnd([...bad.map(a => `[${a.severity}] ${a.type}`), ...mid.map(a => `[${a.severity}] ${a.type}`), ...low.map(a => `[${a.severity}] ${a.type}`)])}`;
8471
8531
  }
8472
8532
  function preProcess(artifacts, requestedPurls) {
8473
- // Dedupe results (for example, pypi will emit one package for each system release (win/mac/cpu) even if it's
8533
+ // Dedupe results (for example, PyPI will emit one package for each system release (win/mac/cpu) even if it's
8474
8534
  // the same package version with same results. The duplication is irrelevant and annoying to the user.
8475
8535
 
8476
8536
  // Make some effort to match the requested data with the response
@@ -8621,28 +8681,28 @@ async function handlePurlsShallowScore({
8621
8681
  outputPurlsShallowScore(purls, packageData, outputKind);
8622
8682
  }
8623
8683
 
8624
- const CMD_NAME$g = 'shallow';
8625
- const description$k = 'Look up info regarding one or more packages but not their transitives';
8626
- const hidden$g = false;
8684
+ const CMD_NAME$i = 'shallow';
8685
+ const description$m = 'Look up info regarding one or more packages but not their transitives';
8686
+ const hidden$i = false;
8627
8687
  const cmdPackageShallow = {
8628
- description: description$k,
8629
- hidden: hidden$g,
8688
+ description: description$m,
8689
+ hidden: hidden$i,
8630
8690
  alias: {
8631
8691
  shallowScore: {
8632
- description: description$k,
8692
+ description: description$m,
8633
8693
  hidden: true,
8634
8694
  argv: []
8635
8695
  }
8636
8696
  },
8637
- run: run$l
8697
+ run: run$n
8638
8698
  };
8639
- async function run$l(argv, importMeta, {
8699
+ async function run$n(argv, importMeta, {
8640
8700
  parentName
8641
8701
  }) {
8642
8702
  const config = {
8643
- commandName: CMD_NAME$g,
8644
- description: description$k,
8645
- hidden: hidden$g,
8703
+ commandName: CMD_NAME$i,
8704
+ description: description$m,
8705
+ hidden: hidden$i,
8646
8706
  flags: {
8647
8707
  ...flags.commonFlags,
8648
8708
  ...flags.outputFlags
@@ -8652,7 +8712,7 @@ async function run$l(argv, importMeta, {
8652
8712
  $ ${command} [options] <<ECOSYSTEM> <PKGNAME> [<PKGNAME> ...] | <PURL> [<PURL> ...]>
8653
8713
 
8654
8714
  API Token Requirements
8655
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$g}`)}
8715
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$i}`)}
8656
8716
 
8657
8717
  Options
8658
8718
  ${utils.getFlagListOutput(config.flags)}
@@ -8726,9 +8786,9 @@ async function run$l(argv, importMeta, {
8726
8786
  });
8727
8787
  }
8728
8788
 
8729
- const description$j = 'Look up published package details';
8789
+ const description$l = 'Look up published package details';
8730
8790
  const cmdPackage = {
8731
- description: description$j,
8791
+ description: description$l,
8732
8792
  hidden: false,
8733
8793
  async run(argv, importMeta, {
8734
8794
  parentName
@@ -8739,13 +8799,13 @@ const cmdPackage = {
8739
8799
  }, {
8740
8800
  aliases: {
8741
8801
  deep: {
8742
- description: description$j,
8802
+ description: description$l,
8743
8803
  hidden: true,
8744
8804
  argv: ['score']
8745
8805
  }
8746
8806
  },
8747
8807
  argv,
8748
- description: description$j,
8808
+ description: description$l,
8749
8809
  importMeta,
8750
8810
  name: `${parentName} package`
8751
8811
  });
@@ -8799,7 +8859,7 @@ async function outputPatchResult(result, outputKind) {
8799
8859
  }
8800
8860
  logger.logger.groupEnd();
8801
8861
  } else {
8802
- logger.logger.warn('No packages found requiring patches');
8862
+ logger.logger.warn('No packages found requiring patches.');
8803
8863
  }
8804
8864
  logger.logger.log('');
8805
8865
  logger.logger.success('Patch command completed!');
@@ -9115,21 +9175,21 @@ async function handlePatch({
9115
9175
  }
9116
9176
  }
9117
9177
 
9118
- const CMD_NAME$f = 'patch';
9119
- const description$i = 'Apply CVE patches to dependencies';
9120
- const hidden$f = true;
9178
+ const CMD_NAME$h = 'patch';
9179
+ const description$k = 'Apply CVE patches to dependencies';
9180
+ const hidden$h = true;
9121
9181
  const cmdPatch = {
9122
- description: description$i,
9123
- hidden: hidden$f,
9124
- run: run$k
9182
+ description: description$k,
9183
+ hidden: hidden$h,
9184
+ run: run$m
9125
9185
  };
9126
- async function run$k(argv, importMeta, {
9186
+ async function run$m(argv, importMeta, {
9127
9187
  parentName
9128
9188
  }) {
9129
9189
  const config = {
9130
- commandName: CMD_NAME$f,
9131
- description: description$i,
9132
- hidden: hidden$f,
9190
+ commandName: CMD_NAME$h,
9191
+ description: description$k,
9192
+ hidden: hidden$h,
9133
9193
  flags: {
9134
9194
  ...flags.commonFlags,
9135
9195
  ...flags.outputFlags,
@@ -9146,7 +9206,7 @@ async function run$k(argv, importMeta, {
9146
9206
  $ ${command} [options] [CWD=.]
9147
9207
 
9148
9208
  API Token Requirements
9149
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$f}`)}
9209
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$h}`)}
9150
9210
 
9151
9211
  Options
9152
9212
  ${utils.getFlagListOutput(config.flags)}
@@ -9154,7 +9214,7 @@ async function run$k(argv, importMeta, {
9154
9214
  Examples
9155
9215
  $ ${command}
9156
9216
  $ ${command} --package lodash
9157
- $ ${command} ./proj/tree --package lodash,react
9217
+ $ ${command} ./path/to/project --package lodash,react
9158
9218
  `
9159
9219
  };
9160
9220
  const cli = utils.meowOrExit({
@@ -9206,6 +9266,71 @@ async function run$k(argv, importMeta, {
9206
9266
  });
9207
9267
  }
9208
9268
 
9269
+ const require$3 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
9270
+ const CMD_NAME$g = constants.PNPM;
9271
+ const description$j = 'Run pnpm with the Socket wrapper';
9272
+ const hidden$g = true;
9273
+ const cmdPnpm = {
9274
+ description: description$j,
9275
+ hidden: hidden$g,
9276
+ run: run$l
9277
+ };
9278
+ async function run$l(argv, importMeta, context) {
9279
+ const {
9280
+ parentName
9281
+ } = {
9282
+ __proto__: null,
9283
+ ...context
9284
+ };
9285
+ const config = {
9286
+ commandName: CMD_NAME$g,
9287
+ description: description$j,
9288
+ hidden: hidden$g,
9289
+ flags: {
9290
+ ...flags.commonFlags
9291
+ },
9292
+ help: command => `
9293
+ Usage
9294
+ $ ${command} ...
9295
+
9296
+ API Token Requirements
9297
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$g}`)}
9298
+
9299
+ Note: Everything after "pnpm" is passed to the pnpm command.
9300
+ Only the \`--dry-run\` and \`--help\` flags are caught here.
9301
+
9302
+ Use \`socket wrapper on\` to alias this command as \`pnpm\`.
9303
+
9304
+ Examples
9305
+ $ ${command}
9306
+ $ ${command} install
9307
+ $ ${command} add package-name
9308
+ $ ${command} dlx package-name
9309
+ `
9310
+ };
9311
+ const cli = utils.meowOrExit({
9312
+ argv,
9313
+ config,
9314
+ importMeta,
9315
+ parentName
9316
+ });
9317
+ const dryRun = !!cli.flags['dryRun'];
9318
+ if (dryRun) {
9319
+ logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
9320
+ return;
9321
+ }
9322
+ const shadowBin = /*@__PURE__*/require$3(constants.default.shadowPnpmBinPath);
9323
+ process.exitCode = 1;
9324
+
9325
+ // Filter Socket flags from argv.
9326
+ const filteredArgv = utils.filterFlags(argv, config.flags);
9327
+ const {
9328
+ spawnPromise
9329
+ } = await shadowBin(filteredArgv);
9330
+ await spawnPromise;
9331
+ process.exitCode = 0;
9332
+ }
9333
+
9209
9334
  async function runRawNpm(argv) {
9210
9335
  process.exitCode = 1;
9211
9336
  const spawnPromise = spawn.spawn(utils.getNpmBinPath(), argv, {
@@ -9250,9 +9375,9 @@ const config$4 = {
9250
9375
  const cmdRawNpm = {
9251
9376
  description: config$4.description,
9252
9377
  hidden: config$4.hidden,
9253
- run: run$j
9378
+ run: run$k
9254
9379
  };
9255
- async function run$j(argv, importMeta, {
9380
+ async function run$k(argv, importMeta, {
9256
9381
  parentName
9257
9382
  }) {
9258
9383
  const cli = utils.meowOrExit({
@@ -9313,9 +9438,9 @@ const config$3 = {
9313
9438
  const cmdRawNpx = {
9314
9439
  description: config$3.description,
9315
9440
  hidden: config$3.hidden,
9316
- run: run$i
9441
+ run: run$j
9317
9442
  };
9318
- async function run$i(argv, importMeta, {
9443
+ async function run$j(argv, importMeta, {
9319
9444
  parentName
9320
9445
  }) {
9321
9446
  const cli = utils.meowOrExit({
@@ -9400,21 +9525,21 @@ async function handleCreateRepo({
9400
9525
  outputCreateRepo(data, repoName, outputKind);
9401
9526
  }
9402
9527
 
9403
- const CMD_NAME$e = 'create';
9404
- const description$h = 'Create a repository in an organization';
9405
- const hidden$e = false;
9528
+ const CMD_NAME$f = 'create';
9529
+ const description$i = 'Create a repository in an organization';
9530
+ const hidden$f = false;
9406
9531
  const cmdRepositoryCreate = {
9407
- description: description$h,
9408
- hidden: hidden$e,
9409
- run: run$h
9532
+ description: description$i,
9533
+ hidden: hidden$f,
9534
+ run: run$i
9410
9535
  };
9411
- async function run$h(argv, importMeta, {
9536
+ async function run$i(argv, importMeta, {
9412
9537
  parentName
9413
9538
  }) {
9414
9539
  const config = {
9415
- commandName: CMD_NAME$e,
9416
- description: description$h,
9417
- hidden: hidden$e,
9540
+ commandName: CMD_NAME$f,
9541
+ description: description$i,
9542
+ hidden: hidden$f,
9418
9543
  flags: {
9419
9544
  ...flags.commonFlags,
9420
9545
  ...flags.outputFlags,
@@ -9453,7 +9578,7 @@ async function run$h(argv, importMeta, {
9453
9578
  $ ${command} [options] <REPO>
9454
9579
 
9455
9580
  API Token Requirements
9456
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$e}`)}
9581
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$f}`)}
9457
9582
 
9458
9583
  The REPO name should be a "slug". Follows the same naming convention as GitHub.
9459
9584
 
@@ -9559,21 +9684,21 @@ async function handleDeleteRepo(orgSlug, repoName, outputKind) {
9559
9684
  await outputDeleteRepo(data, repoName, outputKind);
9560
9685
  }
9561
9686
 
9562
- const CMD_NAME$d = 'del';
9563
- const description$g = 'Delete a repository in an organization';
9564
- const hidden$d = false;
9687
+ const CMD_NAME$e = 'del';
9688
+ const description$h = 'Delete a repository in an organization';
9689
+ const hidden$e = false;
9565
9690
  const cmdRepositoryDel = {
9566
- description: description$g,
9567
- hidden: hidden$d,
9568
- run: run$g
9691
+ description: description$h,
9692
+ hidden: hidden$e,
9693
+ run: run$h
9569
9694
  };
9570
- async function run$g(argv, importMeta, {
9695
+ async function run$h(argv, importMeta, {
9571
9696
  parentName
9572
9697
  }) {
9573
9698
  const config = {
9574
- commandName: CMD_NAME$d,
9575
- description: description$g,
9576
- hidden: hidden$d,
9699
+ commandName: CMD_NAME$e,
9700
+ description: description$h,
9701
+ hidden: hidden$e,
9577
9702
  flags: {
9578
9703
  ...flags.commonFlags,
9579
9704
  ...flags.outputFlags,
@@ -9592,7 +9717,7 @@ async function run$g(argv, importMeta, {
9592
9717
  $ ${command} [options] <REPO>
9593
9718
 
9594
9719
  API Token Requirements
9595
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$d}`)}
9720
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$e}`)}
9596
9721
 
9597
9722
  Options
9598
9723
  ${utils.getFlagListOutput(config.flags)}
@@ -9822,21 +9947,21 @@ async function handleListRepos({
9822
9947
  }
9823
9948
  }
9824
9949
 
9825
- const CMD_NAME$c = 'list';
9826
- const description$f = 'List repositories in an organization';
9827
- const hidden$c = false;
9950
+ const CMD_NAME$d = 'list';
9951
+ const description$g = 'List repositories in an organization';
9952
+ const hidden$d = false;
9828
9953
  const cmdRepositoryList = {
9829
- description: description$f,
9830
- hidden: hidden$c,
9831
- run: run$f
9954
+ description: description$g,
9955
+ hidden: hidden$d,
9956
+ run: run$g
9832
9957
  };
9833
- async function run$f(argv, importMeta, {
9958
+ async function run$g(argv, importMeta, {
9834
9959
  parentName
9835
9960
  }) {
9836
9961
  const config = {
9837
- commandName: CMD_NAME$c,
9838
- description: description$f,
9839
- hidden: hidden$c,
9962
+ commandName: CMD_NAME$d,
9963
+ description: description$g,
9964
+ hidden: hidden$d,
9840
9965
  flags: {
9841
9966
  ...flags.commonFlags,
9842
9967
  ...flags.outputFlags,
@@ -9884,7 +10009,7 @@ async function run$f(argv, importMeta, {
9884
10009
  $ ${command} [options]
9885
10010
 
9886
10011
  API Token Requirements
9887
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$c}`)}
10012
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$d}`)}
9888
10013
 
9889
10014
  Options
9890
10015
  ${utils.getFlagListOutput(config.flags)}
@@ -10025,21 +10150,21 @@ async function handleUpdateRepo({
10025
10150
  await outputUpdateRepo(data, repoName, outputKind);
10026
10151
  }
10027
10152
 
10028
- const CMD_NAME$b = 'update';
10029
- const description$e = 'Update a repository in an organization';
10030
- const hidden$b = false;
10153
+ const CMD_NAME$c = 'update';
10154
+ const description$f = 'Update a repository in an organization';
10155
+ const hidden$c = false;
10031
10156
  const cmdRepositoryUpdate = {
10032
- description: description$e,
10033
- hidden: hidden$b,
10034
- run: run$e
10157
+ description: description$f,
10158
+ hidden: hidden$c,
10159
+ run: run$f
10035
10160
  };
10036
- async function run$e(argv, importMeta, {
10161
+ async function run$f(argv, importMeta, {
10037
10162
  parentName
10038
10163
  }) {
10039
10164
  const config = {
10040
- commandName: CMD_NAME$b,
10041
- description: description$e,
10042
- hidden: hidden$b,
10165
+ commandName: CMD_NAME$c,
10166
+ description: description$f,
10167
+ hidden: hidden$c,
10043
10168
  flags: {
10044
10169
  ...flags.commonFlags,
10045
10170
  ...flags.outputFlags,
@@ -10082,7 +10207,7 @@ async function run$e(argv, importMeta, {
10082
10207
  $ ${command} [options] <REPO>
10083
10208
 
10084
10209
  API Token Requirements
10085
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$b}`)}
10210
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$c}`)}
10086
10211
 
10087
10212
  Options
10088
10213
  ${utils.getFlagListOutput(config.flags)}
@@ -10211,21 +10336,21 @@ async function handleViewRepo(orgSlug, repoName, outputKind) {
10211
10336
  await outputViewRepo(data, outputKind);
10212
10337
  }
10213
10338
 
10214
- const CMD_NAME$a = 'view';
10215
- const description$d = 'View repositories in an organization';
10216
- const hidden$a = false;
10339
+ const CMD_NAME$b = 'view';
10340
+ const description$e = 'View repositories in an organization';
10341
+ const hidden$b = false;
10217
10342
  const cmdRepositoryView = {
10218
- description: description$d,
10219
- hidden: hidden$a,
10220
- run: run$d
10343
+ description: description$e,
10344
+ hidden: hidden$b,
10345
+ run: run$e
10221
10346
  };
10222
- async function run$d(argv, importMeta, {
10347
+ async function run$e(argv, importMeta, {
10223
10348
  parentName
10224
10349
  }) {
10225
10350
  const config = {
10226
- commandName: CMD_NAME$a,
10227
- description: description$d,
10228
- hidden: hidden$a,
10351
+ commandName: CMD_NAME$b,
10352
+ description: description$e,
10353
+ hidden: hidden$b,
10229
10354
  flags: {
10230
10355
  ...flags.commonFlags,
10231
10356
  ...flags.outputFlags,
@@ -10244,7 +10369,7 @@ async function run$d(argv, importMeta, {
10244
10369
  $ ${command} [options] <REPO>
10245
10370
 
10246
10371
  API Token Requirements
10247
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$a}`)}
10372
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$b}`)}
10248
10373
 
10249
10374
  Options
10250
10375
  ${utils.getFlagListOutput(config.flags)}
@@ -10309,9 +10434,9 @@ async function run$d(argv, importMeta, {
10309
10434
  await handleViewRepo(orgSlug, String(repoName), outputKind);
10310
10435
  }
10311
10436
 
10312
- const description$c = 'Manage registered repositories';
10437
+ const description$d = 'Manage registered repositories';
10313
10438
  const cmdRepository = {
10314
- description: description$c,
10439
+ description: description$d,
10315
10440
  async run(argv, importMeta, {
10316
10441
  parentName
10317
10442
  }) {
@@ -10323,7 +10448,7 @@ const cmdRepository = {
10323
10448
  update: cmdRepositoryUpdate
10324
10449
  }, {
10325
10450
  argv,
10326
- description: description$c,
10451
+ description: description$d,
10327
10452
  importMeta,
10328
10453
  name: `${parentName} repository`
10329
10454
  });
@@ -10381,9 +10506,9 @@ async function suggestTarget() {
10381
10506
  return proceed ? ['.'] : [];
10382
10507
  }
10383
10508
 
10384
- const CMD_NAME$9 = 'create';
10385
- const description$b = 'Create a new Socket scan and report';
10386
- const hidden$9 = false;
10509
+ const CMD_NAME$a = 'create';
10510
+ const description$c = 'Create a new Socket scan and report';
10511
+ const hidden$a = false;
10387
10512
  const generalFlags$1 = {
10388
10513
  ...flags.commonFlags,
10389
10514
  ...flags.outputFlags,
@@ -10479,17 +10604,17 @@ const generalFlags$1 = {
10479
10604
  }
10480
10605
  };
10481
10606
  const cmdScanCreate = {
10482
- description: description$b,
10483
- hidden: hidden$9,
10484
- run: run$c
10607
+ description: description$c,
10608
+ hidden: hidden$a,
10609
+ run: run$d
10485
10610
  };
10486
- async function run$c(argv, importMeta, {
10611
+ async function run$d(argv, importMeta, {
10487
10612
  parentName
10488
10613
  }) {
10489
10614
  const config = {
10490
- commandName: CMD_NAME$9,
10491
- description: description$b,
10492
- hidden: hidden$9,
10615
+ commandName: CMD_NAME$a,
10616
+ description: description$c,
10617
+ hidden: hidden$a,
10493
10618
  flags: {
10494
10619
  ...generalFlags$1,
10495
10620
  ...reachabilityFlags
@@ -10500,7 +10625,7 @@ async function run$c(argv, importMeta, {
10500
10625
  $ ${command} [options] [TARGET...]
10501
10626
 
10502
10627
  API Token Requirements
10503
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$9}`)}
10628
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$a}`)}
10504
10629
 
10505
10630
  Options
10506
10631
  ${utils.getFlagListOutput(generalFlags$1)}
@@ -10509,7 +10634,7 @@ async function run$c(argv, importMeta, {
10509
10634
  ${utils.getFlagListOutput(reachabilityFlags)}
10510
10635
 
10511
10636
  Uploads the specified dependency manifest files for Go, Gradle, JavaScript,
10512
- Kotlin, Python, and Scala. Files like "package.json" and "requirements.txt".
10637
+ Kotlin, Python, and Scala. Files like "package.json" and "${constants.REQUIREMENTS_TXT}".
10513
10638
  If any folder is specified, the ones found in there recursively are uploaded.
10514
10639
 
10515
10640
  Details on TARGET:
@@ -10519,7 +10644,7 @@ async function run$c(argv, importMeta, {
10519
10644
  - If a target is a file, only that file is checked
10520
10645
  - If it is a dir, the dir is scanned for any supported manifest files
10521
10646
  - Dirs MUST be within the current dir (cwd), you can use --cwd to change it
10522
- - Supports globbing such as "**/package.json", "**/requirements.txt", etc.
10647
+ - Supports globbing such as "**/package.json", "**/${constants.REQUIREMENTS_TXT}", etc.
10523
10648
  - Ignores any file specified in your project's ".gitignore"
10524
10649
  - Also a sensible set of default ignores from the "ignore-by-default" module
10525
10650
 
@@ -10594,13 +10719,13 @@ async function run$c(argv, importMeta, {
10594
10719
  } = await utils.determineOrgSlug(String(orgFlag || ''), interactive, dryRun);
10595
10720
  const processCwd = process.cwd();
10596
10721
  const cwd = cwdOverride && cwdOverride !== '.' && cwdOverride !== processCwd ? path.resolve(processCwd, cwdOverride) : processCwd;
10597
- const sockJson = utils.readOrDefaultSocketJson(cwd);
10722
+ const sockJson = await utils.readOrDefaultSocketJsonUp(cwd);
10598
10723
 
10599
10724
  // Note: This needs meow booleanDefault=undefined.
10600
10725
  if (typeof autoManifest !== 'boolean') {
10601
10726
  if (sockJson.defaults?.scan?.create?.autoManifest !== undefined) {
10602
10727
  autoManifest = sockJson.defaults.scan.create.autoManifest;
10603
- logger.logger.info('Using default --auto-manifest from socket.json:', autoManifest);
10728
+ logger.logger.info(`Using default --auto-manifest from ${constants.SOCKET_JSON}:`, autoManifest);
10604
10729
  } else {
10605
10730
  autoManifest = false;
10606
10731
  }
@@ -10608,7 +10733,7 @@ async function run$c(argv, importMeta, {
10608
10733
  if (!branchName) {
10609
10734
  if (sockJson.defaults?.scan?.create?.branch) {
10610
10735
  branchName = sockJson.defaults.scan.create.branch;
10611
- logger.logger.info('Using default --branch from socket.json:', branchName);
10736
+ logger.logger.info(`Using default --branch from ${constants.SOCKET_JSON}:`, branchName);
10612
10737
  } else {
10613
10738
  branchName = (await utils.gitBranch(cwd)) || (await utils.detectDefaultBranch(cwd));
10614
10739
  }
@@ -10616,7 +10741,7 @@ async function run$c(argv, importMeta, {
10616
10741
  if (!repoName) {
10617
10742
  if (sockJson.defaults?.scan?.create?.repo) {
10618
10743
  repoName = sockJson.defaults.scan.create.repo;
10619
- logger.logger.info('Using default --repo from socket.json:', repoName);
10744
+ logger.logger.info(`Using default --repo from ${constants.SOCKET_JSON}:`, repoName);
10620
10745
  } else {
10621
10746
  repoName = await utils.getRepoName(cwd);
10622
10747
  }
@@ -10624,7 +10749,7 @@ async function run$c(argv, importMeta, {
10624
10749
  if (typeof report !== 'boolean') {
10625
10750
  if (sockJson.defaults?.scan?.create?.report !== undefined) {
10626
10751
  report = sockJson.defaults.scan.create.report;
10627
- logger.logger.info('Using default --report from socket.json:', report);
10752
+ logger.logger.info(`Using default --report from ${constants.SOCKET_JSON}:`, report);
10628
10753
  } else {
10629
10754
  report = false;
10630
10755
  }
@@ -10681,7 +10806,7 @@ async function run$c(argv, importMeta, {
10681
10806
  logger.logger.error(` socket scan create [other flags...] ${orgSlug} ${targets.join(' ')}`);
10682
10807
  logger.logger.error('```');
10683
10808
  logger.logger.error('');
10684
- logger.logger.info('You can also run `socket scan setup` to persist these flag defaults to a socket.json file.');
10809
+ logger.logger.info(`You can also run \`socket scan setup\` to persist these flag defaults to a ${constants.SOCKET_JSON} file.`);
10685
10810
  logger.logger.error('');
10686
10811
  }
10687
10812
  const reachExcludePaths = utils.cmdFlagValueToArray(cli.flags['reachExcludePaths']);
@@ -10803,21 +10928,21 @@ async function handleDeleteScan(orgSlug, scanId, outputKind) {
10803
10928
  await outputDeleteScan(data, outputKind);
10804
10929
  }
10805
10930
 
10806
- const CMD_NAME$8 = 'del';
10807
- const description$a = 'Delete a scan';
10808
- const hidden$8 = false;
10931
+ const CMD_NAME$9 = 'del';
10932
+ const description$b = 'Delete a scan';
10933
+ const hidden$9 = false;
10809
10934
  const cmdScanDel = {
10810
- description: description$a,
10811
- hidden: hidden$8,
10812
- run: run$b
10935
+ description: description$b,
10936
+ hidden: hidden$9,
10937
+ run: run$c
10813
10938
  };
10814
- async function run$b(argv, importMeta, {
10939
+ async function run$c(argv, importMeta, {
10815
10940
  parentName
10816
10941
  }) {
10817
10942
  const config = {
10818
- commandName: CMD_NAME$8,
10819
- description: description$a,
10820
- hidden: hidden$8,
10943
+ commandName: CMD_NAME$9,
10944
+ description: description$b,
10945
+ hidden: hidden$9,
10821
10946
  flags: {
10822
10947
  ...flags.commonFlags,
10823
10948
  ...flags.outputFlags,
@@ -10836,7 +10961,7 @@ async function run$b(argv, importMeta, {
10836
10961
  $ ${command} [options] <SCAN_ID>
10837
10962
 
10838
10963
  API Token Requirements
10839
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$8}`)}
10964
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$9}`)}
10840
10965
 
10841
10966
  Options
10842
10967
  ${utils.getFlagListOutput(config.flags)}
@@ -11080,21 +11205,21 @@ async function handleDiffScan({
11080
11205
  });
11081
11206
  }
11082
11207
 
11083
- const CMD_NAME$7 = 'diff';
11084
- const description$9 = 'See what changed between two Scans';
11085
- const hidden$7 = false;
11208
+ const CMD_NAME$8 = 'diff';
11209
+ const description$a = 'See what changed between two Scans';
11210
+ const hidden$8 = false;
11086
11211
  const cmdScanDiff = {
11087
- description: description$9,
11088
- hidden: hidden$7,
11089
- run: run$a
11212
+ description: description$a,
11213
+ hidden: hidden$8,
11214
+ run: run$b
11090
11215
  };
11091
- async function run$a(argv, importMeta, {
11216
+ async function run$b(argv, importMeta, {
11092
11217
  parentName
11093
11218
  }) {
11094
11219
  const config = {
11095
- commandName: CMD_NAME$7,
11096
- description: description$9,
11097
- hidden: hidden$7,
11220
+ commandName: CMD_NAME$8,
11221
+ description: description$a,
11222
+ hidden: hidden$8,
11098
11223
  flags: {
11099
11224
  ...flags.commonFlags,
11100
11225
  ...flags.outputFlags,
@@ -11124,7 +11249,7 @@ async function run$a(argv, importMeta, {
11124
11249
  $ ${command} [options] <SCAN_ID1> <SCAN_ID2>
11125
11250
 
11126
11251
  API Token Requirements
11127
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$7}`)}
11252
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$8}`)}
11128
11253
 
11129
11254
  This command displays the package changes between two scans. The full output
11130
11255
  can be pretty large depending on the size of your repo and time range. It is
@@ -11868,22 +11993,22 @@ async function handleCreateGithubScan({
11868
11993
  await outputScanGithub(ghScanCResult, outputKind);
11869
11994
  }
11870
11995
 
11871
- const CMD_NAME$6 = 'github';
11996
+ const CMD_NAME$7 = 'github';
11872
11997
  const DEFAULT_GITHUB_URL = 'https://api.github.com';
11873
- const description$8 = 'Create a scan for given GitHub repo';
11874
- const hidden$6 = true;
11998
+ const description$9 = 'Create a scan for given GitHub repo';
11999
+ const hidden$7 = true;
11875
12000
  const cmdScanGithub = {
11876
- description: description$8,
11877
- hidden: hidden$6,
11878
- run: run$9
12001
+ description: description$9,
12002
+ hidden: hidden$7,
12003
+ run: run$a
11879
12004
  };
11880
- async function run$9(argv, importMeta, {
12005
+ async function run$a(argv, importMeta, {
11881
12006
  parentName
11882
12007
  }) {
11883
12008
  const config = {
11884
- commandName: CMD_NAME$6,
11885
- description: description$8,
11886
- hidden: hidden$6,
12009
+ commandName: CMD_NAME$7,
12010
+ description: description$9,
12011
+ hidden: hidden$7,
11887
12012
  flags: {
11888
12013
  ...flags.commonFlags,
11889
12014
  ...flags.outputFlags,
@@ -11927,7 +12052,7 @@ async function run$9(argv, importMeta, {
11927
12052
  $ ${command} [options] [CWD=.]
11928
12053
 
11929
12054
  API Token Requirements
11930
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$6}`)}
12055
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$7}`)}
11931
12056
 
11932
12057
  This is similar to the \`socket scan create\` command except it pulls the files
11933
12058
  from GitHub. See the help for that command for more details.
@@ -12184,21 +12309,21 @@ async function handleListScans({
12184
12309
  await outputListScans(data, outputKind);
12185
12310
  }
12186
12311
 
12187
- const CMD_NAME$5 = 'list';
12188
- const description$7 = 'List the scans for an organization';
12189
- const hidden$5 = false;
12312
+ const CMD_NAME$6 = 'list';
12313
+ const description$8 = 'List the scans for an organization';
12314
+ const hidden$6 = false;
12190
12315
  const cmdScanList = {
12191
- description: description$7,
12192
- hidden: hidden$5,
12193
- run: run$8
12316
+ description: description$8,
12317
+ hidden: hidden$6,
12318
+ run: run$9
12194
12319
  };
12195
- async function run$8(argv, importMeta, {
12320
+ async function run$9(argv, importMeta, {
12196
12321
  parentName
12197
12322
  }) {
12198
12323
  const config = {
12199
- commandName: CMD_NAME$5,
12200
- description: description$7,
12201
- hidden: hidden$5,
12324
+ commandName: CMD_NAME$6,
12325
+ description: description$8,
12326
+ hidden: hidden$6,
12202
12327
  flags: {
12203
12328
  ...flags.commonFlags,
12204
12329
  ...flags.outputFlags,
@@ -12257,7 +12382,7 @@ async function run$8(argv, importMeta, {
12257
12382
  $ ${command} [options] [REPO [BRANCH]]
12258
12383
 
12259
12384
  API Token Requirements
12260
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$5}`)}
12385
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$6}`)}
12261
12386
 
12262
12387
  Optionally filter by REPO. If you specify a repo, you can also specify a
12263
12388
  branch to filter by. (Note: If you don't specify a repo then you must use
@@ -12393,21 +12518,21 @@ async function handleOrgScanMetadata(orgSlug, scanId, outputKind) {
12393
12518
  await outputScanMetadata(data, scanId, outputKind);
12394
12519
  }
12395
12520
 
12396
- const CMD_NAME$4 = 'metadata';
12397
- const description$6 = "Get a scan's metadata";
12398
- const hidden$4 = false;
12521
+ const CMD_NAME$5 = 'metadata';
12522
+ const description$7 = "Get a scan's metadata";
12523
+ const hidden$5 = false;
12399
12524
  const cmdScanMetadata = {
12400
- description: description$6,
12401
- hidden: hidden$4,
12402
- run: run$7
12525
+ description: description$7,
12526
+ hidden: hidden$5,
12527
+ run: run$8
12403
12528
  };
12404
- async function run$7(argv, importMeta, {
12529
+ async function run$8(argv, importMeta, {
12405
12530
  parentName
12406
12531
  }) {
12407
12532
  const config = {
12408
- commandName: CMD_NAME$4,
12409
- description: description$6,
12410
- hidden: hidden$4,
12533
+ commandName: CMD_NAME$5,
12534
+ description: description$7,
12535
+ hidden: hidden$5,
12411
12536
  flags: {
12412
12537
  ...flags.commonFlags,
12413
12538
  ...flags.outputFlags,
@@ -12426,7 +12551,7 @@ async function run$7(argv, importMeta, {
12426
12551
  $ ${command} [options] <SCAN_ID>
12427
12552
 
12428
12553
  API Token Requirements
12429
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$4}`)}
12554
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$5}`)}
12430
12555
 
12431
12556
  Options
12432
12557
  ${utils.getFlagListOutput(config.flags)}
@@ -12560,9 +12685,9 @@ async function handleScanReach({
12560
12685
  });
12561
12686
  }
12562
12687
 
12563
- const CMD_NAME$3 = 'reach';
12564
- const description$5 = 'Compute tier 1 reachability';
12565
- const hidden$3 = true;
12688
+ const CMD_NAME$4 = 'reach';
12689
+ const description$6 = 'Compute tier 1 reachability';
12690
+ const hidden$4 = true;
12566
12691
  const generalFlags = {
12567
12692
  ...flags.commonFlags,
12568
12693
  ...flags.outputFlags,
@@ -12578,17 +12703,17 @@ const generalFlags = {
12578
12703
  }
12579
12704
  };
12580
12705
  const cmdScanReach = {
12581
- description: description$5,
12582
- hidden: hidden$3,
12583
- run: run$6
12706
+ description: description$6,
12707
+ hidden: hidden$4,
12708
+ run: run$7
12584
12709
  };
12585
- async function run$6(argv, importMeta, {
12710
+ async function run$7(argv, importMeta, {
12586
12711
  parentName
12587
12712
  }) {
12588
12713
  const config = {
12589
- commandName: CMD_NAME$3,
12590
- description: description$5,
12591
- hidden: hidden$3,
12714
+ commandName: CMD_NAME$4,
12715
+ description: description$6,
12716
+ hidden: hidden$4,
12592
12717
  flags: {
12593
12718
  ...generalFlags,
12594
12719
  ...reachabilityFlags
@@ -12598,7 +12723,7 @@ async function run$6(argv, importMeta, {
12598
12723
  $ ${command} [options] [CWD=.]
12599
12724
 
12600
12725
  API Token Requirements
12601
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$3}`)}
12726
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$4}`)}
12602
12727
 
12603
12728
  Options
12604
12729
  ${utils.getFlagListOutput(generalFlags)}
@@ -12706,21 +12831,21 @@ async function run$6(argv, importMeta, {
12706
12831
  });
12707
12832
  }
12708
12833
 
12709
- const CMD_NAME$2 = 'report';
12710
- const description$4 = 'Check whether a scan result passes the organizational policies (security, license)';
12711
- const hidden$2 = false;
12834
+ const CMD_NAME$3 = 'report';
12835
+ const description$5 = 'Check whether a scan result passes the organizational policies (security, license)';
12836
+ const hidden$3 = false;
12712
12837
  const cmdScanReport = {
12713
- description: description$4,
12714
- hidden: hidden$2,
12715
- run: run$5
12838
+ description: description$5,
12839
+ hidden: hidden$3,
12840
+ run: run$6
12716
12841
  };
12717
- async function run$5(argv, importMeta, {
12842
+ async function run$6(argv, importMeta, {
12718
12843
  parentName
12719
12844
  }) {
12720
12845
  const config = {
12721
- commandName: CMD_NAME$2,
12722
- description: description$4,
12723
- hidden: hidden$2,
12846
+ commandName: CMD_NAME$3,
12847
+ description: description$5,
12848
+ hidden: hidden$3,
12724
12849
  flags: {
12725
12850
  ...flags.commonFlags,
12726
12851
  ...flags.outputFlags,
@@ -12759,7 +12884,7 @@ async function run$5(argv, importMeta, {
12759
12884
  $ ${command} [options] <SCAN_ID> [OUTPUT_PATH]
12760
12885
 
12761
12886
  API Token Requirements
12762
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$2}`)}
12887
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$3}`)}
12763
12888
 
12764
12889
  Options
12765
12890
  ${utils.getFlagListOutput(config.flags)}
@@ -12870,18 +12995,18 @@ async function outputScanConfigResult(result) {
12870
12995
  }
12871
12996
 
12872
12997
  async function setupScanConfig(cwd, defaultOnReadError = false) {
12873
- const jsonPath = path.join(cwd, `socket.json`);
12998
+ const jsonPath = path.join(cwd, constants.SOCKET_JSON);
12874
12999
  if (fs$1.existsSync(jsonPath)) {
12875
- logger.logger.info(`Found socket.json at ${jsonPath}`);
13000
+ logger.logger.info(`Found ${constants.SOCKET_JSON} at ${jsonPath}`);
12876
13001
  } else {
12877
- logger.logger.info(`No socket.json found at ${cwd}, will generate a new one`);
13002
+ logger.logger.info(`No ${constants.SOCKET_JSON} found at ${cwd}, will generate a new one`);
12878
13003
  }
12879
13004
  logger.logger.log('');
12880
13005
  logger.logger.log('Note: This tool will set up flag and argument defaults for certain');
12881
13006
  logger.logger.log(' CLI commands. You can still override them by explicitly');
12882
13007
  logger.logger.log(' setting the flag. It is meant to be a convenience tool.');
12883
13008
  logger.logger.log('');
12884
- logger.logger.log('This command will generate a `socket.json` file in the target cwd.');
13009
+ logger.logger.log(`This command will generate a \`${constants.SOCKET_JSON}\` file in the target cwd.`);
12885
13010
  logger.logger.log('You can choose to add this file to your repo (handy for collab)');
12886
13011
  logger.logger.log('or to add it to the ignored files, or neither. This file is only');
12887
13012
  logger.logger.log('used in CLI workflows.');
@@ -12942,7 +13067,7 @@ async function setupScanConfig(cwd, defaultOnReadError = false) {
12942
13067
  }
12943
13068
  }
12944
13069
  logger.logger.log('');
12945
- logger.logger.log('Setup complete. Writing socket.json');
13070
+ logger.logger.log(`Setup complete. Writing ${constants.SOCKET_JSON}`);
12946
13071
  logger.logger.log('');
12947
13072
  if (await prompts.select({
12948
13073
  message: `Do you want to write the new config to ${jsonPath} ?`,
@@ -13158,7 +13283,7 @@ const config$2 = {
13158
13283
  ...flags.commonFlags,
13159
13284
  defaultOnReadError: {
13160
13285
  type: 'boolean',
13161
- description: 'If reading the socket.json fails, just use a default config? Warning: This might override the existing json file!'
13286
+ description: `If reading the ${constants.SOCKET_JSON} fails, just use a default config? Warning: This might override the existing json file!`
13162
13287
  }
13163
13288
  },
13164
13289
  help: (command, config) => `
@@ -13188,9 +13313,9 @@ const config$2 = {
13188
13313
  const cmdScanSetup = {
13189
13314
  description: config$2.description,
13190
13315
  hidden: config$2.hidden,
13191
- run: run$4
13316
+ run: run$5
13192
13317
  };
13193
- async function run$4(argv, importMeta, {
13318
+ async function run$5(argv, importMeta, {
13194
13319
  parentName
13195
13320
  }) {
13196
13321
  const cli = utils.meowOrExit({
@@ -13346,21 +13471,21 @@ async function streamScan(orgSlug, scanId, options) {
13346
13471
  });
13347
13472
  }
13348
13473
 
13349
- const CMD_NAME$1 = 'view';
13350
- const description$3 = 'View the raw results of a scan';
13351
- const hidden$1 = false;
13474
+ const CMD_NAME$2 = 'view';
13475
+ const description$4 = 'View the raw results of a scan';
13476
+ const hidden$2 = false;
13352
13477
  const cmdScanView = {
13353
- description: description$3,
13354
- hidden: hidden$1,
13355
- run: run$3
13478
+ description: description$4,
13479
+ hidden: hidden$2,
13480
+ run: run$4
13356
13481
  };
13357
- async function run$3(argv, importMeta, {
13482
+ async function run$4(argv, importMeta, {
13358
13483
  parentName
13359
13484
  }) {
13360
13485
  const config = {
13361
- commandName: CMD_NAME$1,
13362
- description: description$3,
13363
- hidden: hidden$1,
13486
+ commandName: CMD_NAME$2,
13487
+ description: description$4,
13488
+ hidden: hidden$2,
13364
13489
  flags: {
13365
13490
  ...flags.commonFlags,
13366
13491
  ...flags.outputFlags,
@@ -13384,7 +13509,7 @@ async function run$3(argv, importMeta, {
13384
13509
  $ ${command} [options] <SCAN_ID> [OUTPUT_FILE]
13385
13510
 
13386
13511
  API Token Requirements
13387
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$1}`)}
13512
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$2}`)}
13388
13513
 
13389
13514
  When no output path is given the contents is sent to stdout.
13390
13515
 
@@ -13457,9 +13582,9 @@ async function run$3(argv, importMeta, {
13457
13582
  }
13458
13583
  }
13459
13584
 
13460
- const description$2 = 'Manage Socket scans';
13585
+ const description$3 = 'Manage Socket scans';
13461
13586
  const cmdScan = {
13462
- description: description$2,
13587
+ description: description$3,
13463
13588
  async run(argv, importMeta, {
13464
13589
  parentName
13465
13590
  }) {
@@ -13488,7 +13613,7 @@ const cmdScan = {
13488
13613
  }
13489
13614
  },
13490
13615
  argv,
13491
- description: description$2,
13616
+ description: description$3,
13492
13617
  importMeta,
13493
13618
  name: `${parentName} scan`
13494
13619
  });
@@ -13509,7 +13634,7 @@ async function fetchThreatFeed({
13509
13634
  return await utils.queryApiSafeJson(`orgs/${orgSlug}/threat-feed?${queryParams}`, 'the Threat Feed data');
13510
13635
  }
13511
13636
 
13512
- const require$1 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
13637
+ const require$2 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
13513
13638
  async function outputThreatFeed(result, outputKind) {
13514
13639
  if (!result.ok) {
13515
13640
  process.exitCode = result.code ?? 1;
@@ -13523,14 +13648,14 @@ async function outputThreatFeed(result, outputKind) {
13523
13648
  return;
13524
13649
  }
13525
13650
  if (!result.data?.results?.length) {
13526
- logger.logger.warn('Did not receive any data to display...');
13651
+ logger.logger.warn('Did not receive any data to display.');
13527
13652
  return;
13528
13653
  }
13529
13654
  const formattedOutput = formatResults(result.data.results);
13530
13655
  const descriptions = result.data.results.map(d => d.description);
13531
13656
 
13532
13657
  // Note: this temporarily takes over the terminal (just like `man` does).
13533
- const ScreenWidget = /*@__PURE__*/require$1('../external/blessed/lib/widgets/screen.js');
13658
+ const ScreenWidget = /*@__PURE__*/require$2('../external/blessed/lib/widgets/screen.js');
13534
13659
  const screen = new ScreenWidget({
13535
13660
  ...constants.default.blessedOptions
13536
13661
  });
@@ -13539,7 +13664,7 @@ async function outputThreatFeed(result, outputKind) {
13539
13664
  // node process just to exit it. That's very bad UX.
13540
13665
  // eslint-disable-next-line n/no-process-exit
13541
13666
  screen.key(['escape', 'q', 'C-c'], () => process.exit(0));
13542
- const TableWidget = /*@__PURE__*/require$1('../external/blessed-contrib/lib/widget/table.js');
13667
+ const TableWidget = /*@__PURE__*/require$2('../external/blessed-contrib/lib/widget/table.js');
13543
13668
  const detailsBoxHeight = 20; // bottom N rows for details box
13544
13669
  const tipsBoxHeight = 1; // 1 row for tips box
13545
13670
 
@@ -13563,7 +13688,7 @@ async function outputThreatFeed(result, outputKind) {
13563
13688
  columnSpacing: 1,
13564
13689
  truncate: '_'
13565
13690
  });
13566
- const BoxWidget = /*@__PURE__*/require$1('../external/blessed/lib/widgets/box.js');
13691
+ const BoxWidget = /*@__PURE__*/require$2('../external/blessed/lib/widgets/box.js');
13567
13692
  const tipsBox = new BoxWidget({
13568
13693
  bottom: detailsBoxHeight,
13569
13694
  // sits just above the details box
@@ -13670,23 +13795,23 @@ async function handleThreatFeed({
13670
13795
  await outputThreatFeed(data, outputKind);
13671
13796
  }
13672
13797
 
13673
- const CMD_NAME = 'threat-feed';
13798
+ const CMD_NAME$1 = 'threat-feed';
13674
13799
  const ECOSYSTEMS = new Set(['gem', 'golang', 'maven', constants.NPM, 'nuget', 'pypi']);
13675
13800
  const TYPE_FILTERS = new Set(['anom', 'c', 'fp', 'joke', 'mal', 'secret', 'spy', 'tp', 'typo', 'u', 'vuln']);
13676
- const description$1 = '[Beta] View the threat-feed';
13677
- const hidden = false;
13801
+ const description$2 = '[Beta] View the threat-feed';
13802
+ const hidden$1 = false;
13678
13803
  const cmdThreatFeed = {
13679
- description: description$1,
13680
- hidden,
13681
- run: run$2
13804
+ description: description$2,
13805
+ hidden: hidden$1,
13806
+ run: run$3
13682
13807
  };
13683
- async function run$2(argv, importMeta, {
13808
+ async function run$3(argv, importMeta, {
13684
13809
  parentName
13685
13810
  }) {
13686
13811
  const config = {
13687
- commandName: CMD_NAME,
13688
- description: description$1,
13689
- hidden,
13812
+ commandName: CMD_NAME$1,
13813
+ description: description$2,
13814
+ hidden: hidden$1,
13690
13815
  flags: {
13691
13816
  ...flags.commonFlags,
13692
13817
  ...flags.outputFlags,
@@ -13741,7 +13866,7 @@ async function run$2(argv, importMeta, {
13741
13866
  $ ${command} [options] [ECOSYSTEM] [TYPE_FILTER]
13742
13867
 
13743
13868
  API Token Requirements
13744
- ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME}`)}
13869
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$1}`)}
13745
13870
  - Special access
13746
13871
 
13747
13872
  This feature requires a Threat Feed license. Please contact
@@ -14007,9 +14132,9 @@ const config$1 = {
14007
14132
  const cmdUninstallCompletion = {
14008
14133
  description: config$1.description,
14009
14134
  hidden: config$1.hidden,
14010
- run: run$1
14135
+ run: run$2
14011
14136
  };
14012
- async function run$1(argv, importMeta, {
14137
+ async function run$2(argv, importMeta, {
14013
14138
  parentName
14014
14139
  }) {
14015
14140
  const cli = utils.meowOrExit({
@@ -14027,9 +14152,9 @@ async function run$1(argv, importMeta, {
14027
14152
  await handleUninstallCompletion(String(targetName));
14028
14153
  }
14029
14154
 
14030
- const description = 'Uninstall Socket CLI tab completion';
14155
+ const description$1 = 'Uninstall Socket CLI tab completion';
14031
14156
  const cmdUninstall = {
14032
- description,
14157
+ description: description$1,
14033
14158
  hidden: false,
14034
14159
  async run(argv, importMeta, {
14035
14160
  parentName
@@ -14038,7 +14163,7 @@ const cmdUninstall = {
14038
14163
  completion: cmdUninstallCompletion
14039
14164
  }, {
14040
14165
  argv,
14041
- description,
14166
+ description: description$1,
14042
14167
  importMeta,
14043
14168
  name: `${parentName} uninstall`
14044
14169
  });
@@ -14203,9 +14328,9 @@ const config = {
14203
14328
  const cmdWrapper = {
14204
14329
  description: config.description,
14205
14330
  hidden: config.hidden,
14206
- run
14331
+ run: run$1
14207
14332
  };
14208
- async function run(argv, importMeta, {
14333
+ async function run$1(argv, importMeta, {
14209
14334
  parentName
14210
14335
  }) {
14211
14336
  // I don't think meow would mess with this but ...
@@ -14278,6 +14403,71 @@ async function run(argv, importMeta, {
14278
14403
  }
14279
14404
  }
14280
14405
 
14406
+ const require$1 = require$$5.createRequire((typeof document === 'undefined' ? require$$0.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli.js', document.baseURI).href)));
14407
+ const CMD_NAME = constants.YARN;
14408
+ const description = 'Run yarn with the Socket wrapper';
14409
+ const hidden = true;
14410
+ const cmdYarn = {
14411
+ description,
14412
+ hidden,
14413
+ run
14414
+ };
14415
+ async function run(argv, importMeta, context) {
14416
+ const {
14417
+ parentName
14418
+ } = {
14419
+ __proto__: null,
14420
+ ...context
14421
+ };
14422
+ const config = {
14423
+ commandName: CMD_NAME,
14424
+ description,
14425
+ hidden,
14426
+ flags: {
14427
+ ...flags.commonFlags
14428
+ },
14429
+ help: command => `
14430
+ Usage
14431
+ $ ${command} ...
14432
+
14433
+ API Token Requirements
14434
+ ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME}`)}
14435
+
14436
+ Note: Everything after "yarn" is passed to the yarn command.
14437
+ Only the \`--dry-run\` and \`--help\` flags are caught here.
14438
+
14439
+ Use \`socket wrapper on\` to alias this command as \`yarn\`.
14440
+
14441
+ Examples
14442
+ $ ${command}
14443
+ $ ${command} install
14444
+ $ ${command} add package-name
14445
+ $ ${command} dlx package-name
14446
+ `
14447
+ };
14448
+ const cli = utils.meowOrExit({
14449
+ argv,
14450
+ config,
14451
+ importMeta,
14452
+ parentName
14453
+ });
14454
+ const dryRun = !!cli.flags['dryRun'];
14455
+ if (dryRun) {
14456
+ logger.logger.log(constants.default.DRY_RUN_BAILING_NOW);
14457
+ return;
14458
+ }
14459
+ const shadowBin = /*@__PURE__*/require$1(constants.default.shadowYarnBinPath);
14460
+ process.exitCode = 1;
14461
+
14462
+ // Filter Socket flags from argv.
14463
+ const filteredArgv = utils.filterFlags(argv, config.flags);
14464
+ const {
14465
+ spawnPromise
14466
+ } = await shadowBin(filteredArgv);
14467
+ await spawnPromise;
14468
+ process.exitCode = 0;
14469
+ }
14470
+
14281
14471
  const rootCommands = {
14282
14472
  analytics: cmdAnalytics,
14283
14473
  'audit-log': cmdAuditLog,
@@ -14294,6 +14484,7 @@ const rootCommands = {
14294
14484
  manifest: cmdManifest,
14295
14485
  npm: cmdNpm,
14296
14486
  npx: cmdNpx,
14487
+ pnpm: cmdPnpm,
14297
14488
  oops: cmdOops,
14298
14489
  optimize: cmdOptimize,
14299
14490
  organization: cmdOrganization,
@@ -14306,7 +14497,8 @@ const rootCommands = {
14306
14497
  security: cmdOrganizationPolicySecurity,
14307
14498
  'threat-feed': cmdThreatFeed,
14308
14499
  uninstall: cmdUninstall,
14309
- wrapper: cmdWrapper
14500
+ wrapper: cmdWrapper,
14501
+ yarn: cmdYarn
14310
14502
  };
14311
14503
  const rootAliases = {
14312
14504
  audit: {
@@ -14396,7 +14588,11 @@ void (async () => {
14396
14588
  name: constants.default.SOCKET_CLI_BIN_NAME,
14397
14589
  registryUrl,
14398
14590
  ttl: 86_400_000 /* 24 hours in milliseconds */,
14399
- version: constants.default.ENV.INLINED_SOCKET_CLI_VERSION
14591
+ version: constants.default.ENV.INLINED_SOCKET_CLI_VERSION,
14592
+ logCallback: (name, version, latest) => {
14593
+ logger.logger.log(`\n\nšŸ“¦ Update available for ${vendor.yoctocolorsCjsExports.cyan(name)}: ${vendor.yoctocolorsCjsExports.gray(version)} → ${vendor.yoctocolorsCjsExports.green(latest)}`);
14594
+ logger.logger.log(`šŸ“ ${vendor.terminalLinkExports('View changelog', `https://socket.dev/npm/package/${name}/files/${latest}/CHANGELOG.md`)}`);
14595
+ }
14400
14596
  });
14401
14597
  try {
14402
14598
  await utils.meowWithSubcommands(rootCommands, {
@@ -14464,5 +14660,5 @@ void (async () => {
14464
14660
  await utils.captureException(e);
14465
14661
  }
14466
14662
  })();
14467
- //# debugId=d42a0267-36a6-4b2d-a161-8a78c8038a13
14663
+ //# debugId=5d651596-3967-43af-9860-99f4bc7ab867
14468
14664
  //# sourceMappingURL=cli.js.map