@socketsecurity/cli-with-sentry 1.1.19 → 1.1.20

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 (40) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/dist/cli.js +48 -24
  3. package/dist/cli.js.map +1 -1
  4. package/dist/constants.js +6 -3
  5. package/dist/constants.js.map +1 -1
  6. package/dist/shadow-pnpm-bin2.js +6 -2
  7. package/dist/shadow-pnpm-bin2.js.map +1 -1
  8. package/dist/shadow-yarn-bin.js +6 -2
  9. package/dist/shadow-yarn-bin.js.map +1 -1
  10. package/dist/tsconfig.dts.tsbuildinfo +1 -1
  11. package/dist/types/commands/analytics/cmd-analytics.d.mts.map +1 -1
  12. package/dist/types/commands/analytics/output-analytics.d.mts.map +1 -1
  13. package/dist/types/commands/audit-log/cmd-audit-log.d.mts.map +1 -1
  14. package/dist/types/commands/login/attempt-login.d.mts.map +1 -1
  15. package/dist/types/commands/optimize/ls-by-agent.d.mts.map +1 -1
  16. package/dist/types/commands/raw-npm/run-raw-npm.d.mts.map +1 -1
  17. package/dist/types/commands/raw-npx/run-raw-npx.d.mts.map +1 -1
  18. package/dist/types/commands/repository/cmd-repository-create.d.mts.map +1 -1
  19. package/dist/types/commands/repository/cmd-repository-del.d.mts.map +1 -1
  20. package/dist/types/commands/repository/cmd-repository-update.d.mts.map +1 -1
  21. package/dist/types/commands/repository/cmd-repository-view.d.mts.map +1 -1
  22. package/dist/types/commands/scan/cmd-scan-create.d.mts.map +1 -1
  23. package/dist/types/commands/scan/cmd-scan-list.d.mts.map +1 -1
  24. package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +1 -1
  25. package/dist/types/commands/scan/output-diff-scan.d.mts.map +1 -1
  26. package/dist/types/commands/scan/output-scan-view.d.mts.map +1 -1
  27. package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts.map +1 -1
  28. package/dist/types/constants.d.mts.map +1 -1
  29. package/dist/types/shadow/pnpm/bin.d.mts.map +1 -1
  30. package/dist/types/shadow/yarn/bin.d.mts.map +1 -1
  31. package/dist/types/utils/agent.d.mts.map +1 -1
  32. package/dist/types/utils/determine-org-slug.d.mts.map +1 -1
  33. package/dist/types/utils/package-environment.d.mts.map +1 -1
  34. package/dist/types/utils/terminal-link.d.mts +45 -0
  35. package/dist/types/utils/terminal-link.d.mts.map +1 -0
  36. package/dist/types/utils/yarn-version.d.mts.map +1 -1
  37. package/dist/utils.js +98 -4
  38. package/dist/utils.js.map +1 -1
  39. package/dist/vendor.js +372 -372
  40. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -10,6 +10,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
10
10
  - Testing infrastructure for malware detection with mock fixtures and API response utilities
11
11
  - Test fixtures for packages flagged with both `malware` and `gptMalware` alerts
12
12
 
13
+ ### Fixed
14
+ - Resolved Windows spawn errors for package managers by enabling shell execution for .cmd files
15
+
13
16
  ## [1.1.18](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.18) - 2025-09-18
14
17
 
15
18
  ### Fixed
package/dist/cli.js CHANGED
@@ -95,7 +95,7 @@ async function outputAnalytics(result, {
95
95
  try {
96
96
  await fs.writeFile(filepath, serialized, 'utf8');
97
97
  utils.debugFileOp('write', filepath);
98
- logger.logger.success(`Data successfully written to ${filepath}`);
98
+ logger.logger.success(`Data successfully written to ${utils.fileLink(filepath)}`);
99
99
  } catch (e) {
100
100
  utils.debugFileOp('write', filepath, e);
101
101
  process.exitCode = 1;
@@ -119,7 +119,7 @@ async function outputAnalytics(result, {
119
119
  try {
120
120
  await fs.writeFile(filepath, serialized, 'utf8');
121
121
  utils.debugFileOp('write', filepath);
122
- logger.logger.success(`Data successfully written to ${filepath}`);
122
+ logger.logger.success(`Data successfully written to ${utils.fileLink(filepath)}`);
123
123
  } catch (e) {
124
124
  utils.debugFileOp('write', filepath, e);
125
125
  logger.logger.error(e);
@@ -418,7 +418,7 @@ async function run$S(argv, importMeta, {
418
418
  const wasValidInput = utils.checkCommandInput(outputKind, {
419
419
  nook: true,
420
420
  test: noLegacy,
421
- message: `Legacy flags are no longer supported. See ${vendor.terminalLinkExports('v1 migration guide', constants.V1_MIGRATION_GUIDE_URL)}.`,
421
+ message: `Legacy flags are no longer supported. See the ${utils.webLink(constants.V1_MIGRATION_GUIDE_URL, 'v1 migration guide')}.`,
422
422
  fail: `received legacy flags`
423
423
  }, {
424
424
  nook: true,
@@ -793,7 +793,7 @@ async function run$R(argv, importMeta, {
793
793
  ${utils.getFlagApiRequirementsOutput(`${parentName}:${CMD_NAME$x}`)}
794
794
 
795
795
  This feature requires an Enterprise Plan. To learn more about getting access
796
- to this feature and many more, please visit ${constants.default.SOCKET_WEBSITE_URL}/pricing
796
+ to this feature and many more, please visit the ${utils.webLink(`${constants.default.SOCKET_WEBSITE_URL}/pricing`, 'Socket pricing page')}.
797
797
 
798
798
  The type FILTER arg is an enum. Defaults to any. It should be one of these:
799
799
  associateLabel, cancelInvitation, changeMemberRole, changePlanSubscriptionSeats,
@@ -841,7 +841,7 @@ async function run$R(argv, importMeta, {
841
841
  const wasValidInput = utils.checkCommandInput(outputKind, {
842
842
  nook: true,
843
843
  test: noLegacy,
844
- message: `Legacy flags are no longer supported. See ${vendor.terminalLinkExports('v1 migration guide', constants.V1_MIGRATION_GUIDE_URL)}.`,
844
+ message: `Legacy flags are no longer supported. See the ${utils.webLink(constants.V1_MIGRATION_GUIDE_URL, 'v1 migration guide')}.`,
845
845
  fail: `received legacy flags`
846
846
  }, {
847
847
  nook: true,
@@ -2214,7 +2214,7 @@ async function handleCreateNewScan({
2214
2214
  const wasValidInput = utils.checkCommandInput(outputKind, {
2215
2215
  nook: true,
2216
2216
  test: packagePaths.length > 0,
2217
- fail: `found no eligible files to scan. See supported manifest files at ${vendor.terminalLinkExports('docs.socket.dev', 'https://docs.socket.dev/docs/manifest-file-detection-in-socket')}`,
2217
+ fail: `found no eligible files to scan. See supported manifest files at ${utils.socketDocsLink('/docs/manifest-file-detection-in-socket', 'docs.socket.dev')}`,
2218
2218
  message: 'TARGET (file/dir) must contain matching / supported file types for a scan'
2219
2219
  });
2220
2220
  if (!wasValidInput) {
@@ -4427,7 +4427,7 @@ async function attemptLogin(apiBaseUrl, apiProxy) {
4427
4427
  apiBaseUrl ??= utils.getConfigValueOrUndef(constants.CONFIG_KEY_API_BASE_URL) ?? undefined;
4428
4428
  apiProxy ??= utils.getConfigValueOrUndef(constants.CONFIG_KEY_API_PROXY) ?? undefined;
4429
4429
  const apiTokenInput = await prompts.password({
4430
- message: `Enter your ${vendor.terminalLinkExports('Socket.dev API token', 'https://docs.socket.dev/docs/api-keys')} (leave blank to use a limited public token)`
4430
+ message: `Enter your ${utils.socketDocsLink('/docs/api-keys', 'Socket.dev API token')} (leave blank to use a limited public token)`
4431
4431
  });
4432
4432
  if (apiTokenInput === undefined) {
4433
4433
  logger.logger.fail('Canceled by user');
@@ -4685,7 +4685,7 @@ const {
4685
4685
  YARN_LOCK
4686
4686
  } = constants.default;
4687
4687
  const nodejsPlatformTypes = new Set(['javascript', 'js', 'nodejs', constants.NPM, constants.PNPM, 'ts', 'tsx', 'typescript']);
4688
- function argvToArray(argvObj) {
4688
+ function argvObjectToArray(argvObj) {
4689
4689
  if (argvObj['help']) {
4690
4690
  return [constants.FLAG_HELP];
4691
4691
  }
@@ -4733,7 +4733,7 @@ async function runCdxgen(argvObj) {
4733
4733
  stdio: 'inherit'
4734
4734
  };
4735
4735
 
4736
- // Detect package manager based on lockfiles
4736
+ // Detect package manager based on lockfiles.
4737
4737
  const pnpmLockPath = await utils.findUp(PNPM_LOCK_YAML, {
4738
4738
  onlyFiles: true
4739
4739
  });
@@ -4745,7 +4745,7 @@ async function runCdxgen(argvObj) {
4745
4745
  });
4746
4746
  const agent = pnpmLockPath ? constants.PNPM : yarnLockPath && utils.isYarnBerry() ? constants.YARN : constants.NPM;
4747
4747
  let cleanupPackageLock = false;
4748
- if (argvMutable['type'] !== constants.YARN && nodejsPlatformTypes.has(argvMutable['type']) && yarnLockPath) {
4748
+ if (yarnLockPath && argvMutable['type'] !== constants.YARN && nodejsPlatformTypes.has(argvMutable['type'])) {
4749
4749
  if (npmLockPath) {
4750
4750
  argvMutable['type'] = constants.NPM;
4751
4751
  } else {
@@ -4763,8 +4763,8 @@ async function runCdxgen(argvObj) {
4763
4763
  }
4764
4764
  }
4765
4765
 
4766
- // Use appropriate package manager for cdxgen
4767
- const shadowResult = await utils.spawnCdxgenDlx(argvToArray(argvMutable), {
4766
+ // Use appropriate package manager for cdxgen.
4767
+ const shadowResult = await utils.spawnCdxgenDlx(argvObjectToArray(argvMutable), {
4768
4768
  ...shadowOpts,
4769
4769
  agent
4770
4770
  });
@@ -6785,6 +6785,9 @@ async function npmQuery(npmExecPath, cwd) {
6785
6785
  try {
6786
6786
  stdout = (await spawn.spawn(npmExecPath, ['query', ':not(.dev)'], {
6787
6787
  cwd,
6788
+ // On Windows, npm is often a .cmd file that requires shell execution.
6789
+ // The spawn function from @socketsecurity/registry will handle this properly
6790
+ // when shell is true.
6788
6791
  shell: constants.default.WIN32
6789
6792
  })).stdout;
6790
6793
  } catch {}
@@ -6802,6 +6805,9 @@ async function lsBun(pkgEnvDetails, options) {
6802
6805
  // https://github.com/oven-sh/bun/issues/8283
6803
6806
  return (await spawn.spawn(pkgEnvDetails.agentExecPath, ['pm', 'ls', '--all'], {
6804
6807
  cwd,
6808
+ // On Windows, bun is often a .cmd file that requires shell execution.
6809
+ // The spawn function from @socketsecurity/registry will handle this properly
6810
+ // when shell is true.
6805
6811
  shell: constants.default.WIN32
6806
6812
  })).stdout;
6807
6813
  } catch {}
@@ -6837,6 +6843,9 @@ async function lsPnpm(pkgEnvDetails, options) {
6837
6843
  // https://en.wiktionary.org/wiki/parsable
6838
6844
  ['ls', '--parseable', constants.FLAG_PROD, '--depth', 'Infinity'], {
6839
6845
  cwd,
6846
+ // On Windows, pnpm is often a .cmd file that requires shell execution.
6847
+ // The spawn function from @socketsecurity/registry will handle this properly
6848
+ // when shell is true.
6840
6849
  shell: constants.default.WIN32
6841
6850
  })).stdout;
6842
6851
  } catch {}
@@ -6854,6 +6863,9 @@ async function lsVlt(pkgEnvDetails, options) {
6854
6863
  // See https://docs.vlt.sh/cli/commands/list#options.
6855
6864
  stdout = (await spawn.spawn(pkgEnvDetails.agentExecPath, ['ls', '--view', 'human', ':not(.dev)'], {
6856
6865
  cwd,
6866
+ // On Windows, pnpm is often a .cmd file that requires shell execution.
6867
+ // The spawn function from @socketsecurity/registry will handle this properly
6868
+ // when shell is true.
6857
6869
  shell: constants.default.WIN32
6858
6870
  })).stdout;
6859
6871
  } catch {}
@@ -6871,6 +6883,9 @@ async function lsYarnBerry(pkgEnvDetails, options) {
6871
6883
  // https://github.com/yarnpkg/berry/issues/5117
6872
6884
  return (await spawn.spawn(pkgEnvDetails.agentExecPath, ['info', '--recursive', '--name-only'], {
6873
6885
  cwd,
6886
+ // On Windows, yarn is often a .cmd file that requires shell execution.
6887
+ // The spawn function from @socketsecurity/registry will handle this properly
6888
+ // when shell is true.
6874
6889
  shell: constants.default.WIN32
6875
6890
  })).stdout;
6876
6891
  } catch {}
@@ -6890,6 +6905,9 @@ async function lsYarnClassic(pkgEnvDetails, options) {
6890
6905
  // environment is production
6891
6906
  return (await spawn.spawn(pkgEnvDetails.agentExecPath, ['list', constants.FLAG_PROD], {
6892
6907
  cwd,
6908
+ // On Windows, yarn is often a .cmd file that requires shell execution.
6909
+ // The spawn function from @socketsecurity/registry will handle this properly
6910
+ // when shell is true.
6893
6911
  shell: constants.default.WIN32
6894
6912
  })).stdout;
6895
6913
  } catch {}
@@ -9542,6 +9560,9 @@ async function run$l(argv, importMeta, context) {
9542
9560
  async function runRawNpm(argv) {
9543
9561
  process.exitCode = 1;
9544
9562
  const spawnPromise = spawn.spawn(utils.getNpmBinPath(), argv, {
9563
+ // On Windows, npm is often a .cmd file that requires shell execution.
9564
+ // The spawn function from @socketsecurity/registry will handle this properly
9565
+ // when shell is true.
9545
9566
  shell: constants.default.WIN32,
9546
9567
  stdio: 'inherit'
9547
9568
  });
@@ -9605,6 +9626,9 @@ async function run$k(argv, importMeta, {
9605
9626
  async function runRawNpx(argv) {
9606
9627
  process.exitCode = 1;
9607
9628
  const spawnPromise = spawn.spawn(utils.getNpxBinPath(), argv, {
9629
+ // On Windows, npx is often a .cmd file that requires shell execution.
9630
+ // The spawn function from @socketsecurity/registry will handle this properly
9631
+ // when shell is true.
9608
9632
  shell: constants.default.WIN32,
9609
9633
  stdio: 'inherit'
9610
9634
  });
@@ -9840,7 +9864,7 @@ async function run$i(argv, importMeta, {
9840
9864
  }, {
9841
9865
  nook: true,
9842
9866
  test: noLegacy,
9843
- message: `Legacy flags are no longer supported. See ${vendor.terminalLinkExports('v1 migration guide', constants.V1_MIGRATION_GUIDE_URL)}.`,
9867
+ message: `Legacy flags are no longer supported. See the ${utils.webLink(constants.V1_MIGRATION_GUIDE_URL, 'v1 migration guide')}.`,
9844
9868
  fail: `received legacy flags`
9845
9869
  }, {
9846
9870
  test: !!repoName,
@@ -9971,7 +9995,7 @@ async function run$h(argv, importMeta, {
9971
9995
  const wasValidInput = utils.checkCommandInput(outputKind, {
9972
9996
  nook: true,
9973
9997
  test: noLegacy,
9974
- message: `Legacy flags are no longer supported. See ${vendor.terminalLinkExports('v1 migration guide', constants.V1_MIGRATION_GUIDE_URL)}.`,
9998
+ message: `Legacy flags are no longer supported. See the ${utils.webLink(constants.V1_MIGRATION_GUIDE_URL, 'v1 migration guide')}.`,
9975
9999
  fail: `received legacy flags`
9976
10000
  }, {
9977
10001
  nook: true,
@@ -10462,7 +10486,7 @@ async function run$f(argv, importMeta, {
10462
10486
  const wasValidInput = utils.checkCommandInput(outputKind, {
10463
10487
  nook: true,
10464
10488
  test: noLegacy,
10465
- message: `Legacy flags are no longer supported. See ${vendor.terminalLinkExports('v1 migration guide', constants.V1_MIGRATION_GUIDE_URL)}.`,
10489
+ message: `Legacy flags are no longer supported. See the ${utils.webLink(constants.V1_MIGRATION_GUIDE_URL, 'v1 migration guide')}.`,
10466
10490
  fail: `received legacy flags`
10467
10491
  }, {
10468
10492
  nook: true,
@@ -10624,7 +10648,7 @@ async function run$e(argv, importMeta, {
10624
10648
  const wasValidInput = utils.checkCommandInput(outputKind, {
10625
10649
  nook: true,
10626
10650
  test: noLegacy,
10627
- message: `Legacy flags are no longer supported. See ${vendor.terminalLinkExports('v1 migration guide', constants.V1_MIGRATION_GUIDE_URL)}.`,
10651
+ message: `Legacy flags are no longer supported. See the ${utils.webLink(constants.V1_MIGRATION_GUIDE_URL, 'v1 migration guide')}.`,
10628
10652
  fail: `received legacy flags`
10629
10653
  }, {
10630
10654
  nook: true,
@@ -10876,7 +10900,7 @@ async function run$d(argv, importMeta, {
10876
10900
  Note: for a first run you probably want to set --default-branch to indicate
10877
10901
  the default branch name, like "main" or "master".
10878
10902
 
10879
- The "alerts page" (https://socket.dev/dashboard/org/YOURORG/alerts) will show
10903
+ The ${utils.socketDashboardLink('/org/YOURORG/alerts', '"alerts page"')} will show
10880
10904
  the results from the last scan designated as the "pending head" on the branch
10881
10905
  configured on Socket to be the "default branch". When creating a scan the
10882
10906
  --set-as-alerts-page flag will default to true to update this. You can prevent
@@ -11299,7 +11323,7 @@ async function handleJson(data, file, dashboardMessage) {
11299
11323
  logger.logger.fail(`Writing to \`${file}\` failed...`);
11300
11324
  logger.logger.error(err);
11301
11325
  } else {
11302
- logger.logger.success(`Data successfully written to \`${file}\``);
11326
+ logger.logger.success(`Data successfully written to \`${utils.fileLink(file)}\``);
11303
11327
  }
11304
11328
  logger.logger.error(dashboardMessage);
11305
11329
  });
@@ -12641,7 +12665,7 @@ async function run$9(argv, importMeta, {
12641
12665
  const wasValidInput = utils.checkCommandInput(outputKind, {
12642
12666
  nook: true,
12643
12667
  test: noLegacy,
12644
- message: `Legacy flags are no longer supported. See ${vendor.terminalLinkExports('v1 migration guide', constants.V1_MIGRATION_GUIDE_URL)}.`,
12668
+ message: `Legacy flags are no longer supported. See the ${utils.webLink(constants.V1_MIGRATION_GUIDE_URL, 'v1 migration guide')}.`,
12645
12669
  fail: `received legacy flags`
12646
12670
  }, {
12647
12671
  nook: true,
@@ -13613,7 +13637,7 @@ async function outputScanView(result, orgSlug, scanId, filePath, outputKind) {
13613
13637
  logger.logger.info('Writing json results to', filePath);
13614
13638
  try {
13615
13639
  await fs.writeFile(filePath, json, 'utf8');
13616
- logger.logger.info(`Data successfully written to ${filePath}`);
13640
+ logger.logger.info(`Data successfully written to ${utils.fileLink(filePath)}`);
13617
13641
  } catch (e) {
13618
13642
  process.exitCode = 1;
13619
13643
  logger.logger.fail('There was an error trying to write the markdown to disk');
@@ -13654,7 +13678,7 @@ View this report at: ${constants.default.SOCKET_WEBSITE_URL}/dashboard/org/${org
13654
13678
  if (filePath && filePath !== '-') {
13655
13679
  try {
13656
13680
  await fs.writeFile(filePath, report, 'utf8');
13657
- logger.logger.log(`Data successfully written to ${filePath}`);
13681
+ logger.logger.log(`Data successfully written to ${utils.fileLink(filePath)}`);
13658
13682
  } catch (e) {
13659
13683
  process.exitCode = 1;
13660
13684
  logger.logger.fail('There was an error trying to write the markdown to disk');
@@ -14090,7 +14114,7 @@ async function run$3(argv, importMeta, {
14090
14114
  - Special access
14091
14115
 
14092
14116
  This feature requires a Threat Feed license. Please contact
14093
- sales@socket.dev if you are interested in purchasing this access.
14117
+ ${utils.mailtoLink('sales@socket.dev')} if you are interested in purchasing this access.
14094
14118
 
14095
14119
  Options
14096
14120
  ${utils.getFlagListOutput(config.flags)}
@@ -14811,7 +14835,7 @@ void (async () => {
14811
14835
  version: constants.default.ENV.INLINED_SOCKET_CLI_VERSION,
14812
14836
  logCallback: (name, version, latest) => {
14813
14837
  logger.logger.log(`\n\nšŸ“¦ Update available for ${vendor.yoctocolorsCjsExports.cyan(name)}: ${vendor.yoctocolorsCjsExports.gray(version)} → ${vendor.yoctocolorsCjsExports.green(latest)}`);
14814
- logger.logger.log(`šŸ“ ${vendor.terminalLinkExports('View changelog', `https://socket.dev/npm/package/${name}/files/${latest}/CHANGELOG.md`)}`);
14838
+ logger.logger.log(`šŸ“ ${utils.socketPackageLink('npm', name, `files/${latest}/CHANGELOG.md`, 'View changelog')}`);
14815
14839
  }
14816
14840
  });
14817
14841
  try {
@@ -14878,5 +14902,5 @@ void (async () => {
14878
14902
  await utils.captureException(e);
14879
14903
  }
14880
14904
  })();
14881
- //# debugId=6d9d1b81-f05f-4bdf-ae16-71ba7e848b55
14905
+ //# debugId=c2710cf0-3d3a-46a7-8ead-88053b9e55be
14882
14906
  //# sourceMappingURL=cli.js.map