@socketsecurity/cli-with-sentry 1.0.6 → 1.0.8

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 (144) hide show
  1. package/dist/cli.js +55 -34
  2. package/dist/cli.js.map +1 -1
  3. package/dist/constants.js +8 -3
  4. package/dist/constants.js.map +1 -1
  5. package/dist/shadow-npm-bin.js +5 -5
  6. package/dist/shadow-npm-bin.js.map +1 -1
  7. package/dist/shadow-npm-inject.js.map +1 -1
  8. package/dist/socket-completion.bash +23 -7
  9. package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -1
  10. package/dist/types/commands/fix/handle-fix.d.mts +2 -1
  11. package/dist/types/commands/fix/handle-fix.d.mts.map +1 -1
  12. package/dist/types/commands/fix/npm-fix.d.mts.map +1 -1
  13. package/dist/types/commands/install/setup-tab-completion.d.mts.map +1 -1
  14. package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +1 -1
  15. package/dist/types/commands/npm/cmd-npm.d.mts.map +1 -1
  16. package/dist/types/commands/npx/cmd-npx.d.mts.map +1 -1
  17. package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts.map +1 -1
  18. package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts.map +1 -1
  19. package/dist/types/constants.d.mts.map +1 -1
  20. package/dist/types/shadow/npm/arborist/types.d.mts +5 -1
  21. package/dist/types/shadow/npm/arborist/types.d.mts.map +1 -1
  22. package/dist/types/utils/alerts-map.d.mts.map +1 -1
  23. package/dist/types/utils/api.d.mts.map +1 -1
  24. package/dist/types/utils/meow-with-subcommands.d.mts +2 -3
  25. package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
  26. package/dist/utils.js +34 -45
  27. package/dist/utils.js.map +1 -1
  28. package/dist/vendor.js +27 -24
  29. package/external/@coana-tech/cli/cli.mjs +1 -1
  30. package/external/@socketsecurity/registry/lib/constants/npm-real-exec-path.js +2 -40
  31. package/external/@socketsecurity/registry/lib/npm.js +102 -71
  32. package/external/@socketsecurity/registry/lib/spinner.js +6 -0
  33. package/external/blessed-contrib/lib/widget/charts/bar.js +4 -3
  34. package/external/blessed-contrib/lib/widget/charts/line.js +4 -3
  35. package/external/blessed-contrib/lib/widget/table.js +3 -3
  36. package/package.json +11 -12
  37. package/external/node-gyp/.release-please-manifest.json +0 -3
  38. package/external/node-gyp/CHANGELOG.md +0 -1053
  39. package/external/node-gyp/CODE_OF_CONDUCT.md +0 -4
  40. package/external/node-gyp/CONTRIBUTING.md +0 -34
  41. package/external/node-gyp/LICENSE +0 -24
  42. package/external/node-gyp/README.md +0 -273
  43. package/external/node-gyp/SECURITY.md +0 -2
  44. package/external/node-gyp/addon.gypi +0 -204
  45. package/external/node-gyp/bin/node-gyp.js +0 -137
  46. package/external/node-gyp/eslint.config.js +0 -3
  47. package/external/node-gyp/gyp/.release-please-manifest.json +0 -3
  48. package/external/node-gyp/gyp/LICENSE +0 -28
  49. package/external/node-gyp/gyp/data/ninja/build.ninja +0 -4
  50. package/external/node-gyp/gyp/data/win/large-pdb-shim.cc +0 -12
  51. package/external/node-gyp/gyp/docs/GypVsCMake.md +0 -116
  52. package/external/node-gyp/gyp/docs/Hacking.md +0 -46
  53. package/external/node-gyp/gyp/docs/InputFormatReference.md +0 -1083
  54. package/external/node-gyp/gyp/docs/LanguageSpecification.md +0 -430
  55. package/external/node-gyp/gyp/docs/README.md +0 -27
  56. package/external/node-gyp/gyp/docs/Testing.md +0 -450
  57. package/external/node-gyp/gyp/docs/UserDocumentation.md +0 -965
  58. package/external/node-gyp/gyp/gyp +0 -8
  59. package/external/node-gyp/gyp/gyp.bat +0 -5
  60. package/external/node-gyp/gyp/gyp_main.py +0 -45
  61. package/external/node-gyp/gyp/pylib/gyp/MSVSNew.py +0 -365
  62. package/external/node-gyp/gyp/pylib/gyp/MSVSProject.py +0 -206
  63. package/external/node-gyp/gyp/pylib/gyp/MSVSSettings.py +0 -1272
  64. package/external/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +0 -1547
  65. package/external/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +0 -59
  66. package/external/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +0 -152
  67. package/external/node-gyp/gyp/pylib/gyp/MSVSUtil.py +0 -270
  68. package/external/node-gyp/gyp/pylib/gyp/MSVSVersion.py +0 -574
  69. package/external/node-gyp/gyp/pylib/gyp/__init__.py +0 -704
  70. package/external/node-gyp/gyp/pylib/gyp/common.py +0 -709
  71. package/external/node-gyp/gyp/pylib/gyp/common_test.py +0 -173
  72. package/external/node-gyp/gyp/pylib/gyp/easy_xml.py +0 -169
  73. package/external/node-gyp/gyp/pylib/gyp/easy_xml_test.py +0 -113
  74. package/external/node-gyp/gyp/pylib/gyp/flock_tool.py +0 -55
  75. package/external/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
  76. package/external/node-gyp/gyp/pylib/gyp/generator/analyzer.py +0 -805
  77. package/external/node-gyp/gyp/pylib/gyp/generator/android.py +0 -1172
  78. package/external/node-gyp/gyp/pylib/gyp/generator/cmake.py +0 -1319
  79. package/external/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +0 -128
  80. package/external/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +0 -104
  81. package/external/node-gyp/gyp/pylib/gyp/generator/eclipse.py +0 -462
  82. package/external/node-gyp/gyp/pylib/gyp/generator/gypd.py +0 -89
  83. package/external/node-gyp/gyp/pylib/gyp/generator/gypsh.py +0 -56
  84. package/external/node-gyp/gyp/pylib/gyp/generator/make.py +0 -2745
  85. package/external/node-gyp/gyp/pylib/gyp/generator/msvs.py +0 -3976
  86. package/external/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +0 -44
  87. package/external/node-gyp/gyp/pylib/gyp/generator/ninja.py +0 -2965
  88. package/external/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +0 -67
  89. package/external/node-gyp/gyp/pylib/gyp/generator/xcode.py +0 -1391
  90. package/external/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +0 -26
  91. package/external/node-gyp/gyp/pylib/gyp/input.py +0 -3112
  92. package/external/node-gyp/gyp/pylib/gyp/input_test.py +0 -99
  93. package/external/node-gyp/gyp/pylib/gyp/mac_tool.py +0 -767
  94. package/external/node-gyp/gyp/pylib/gyp/msvs_emulation.py +0 -1260
  95. package/external/node-gyp/gyp/pylib/gyp/ninja_syntax.py +0 -174
  96. package/external/node-gyp/gyp/pylib/gyp/simple_copy.py +0 -61
  97. package/external/node-gyp/gyp/pylib/gyp/win_tool.py +0 -373
  98. package/external/node-gyp/gyp/pylib/gyp/xcode_emulation.py +0 -1939
  99. package/external/node-gyp/gyp/pylib/gyp/xcode_emulation_test.py +0 -54
  100. package/external/node-gyp/gyp/pylib/gyp/xcode_ninja.py +0 -303
  101. package/external/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +0 -3196
  102. package/external/node-gyp/gyp/pylib/gyp/xml_fix.py +0 -65
  103. package/external/node-gyp/gyp/pylib/packaging/LICENSE +0 -3
  104. package/external/node-gyp/gyp/pylib/packaging/LICENSE.APACHE +0 -177
  105. package/external/node-gyp/gyp/pylib/packaging/LICENSE.BSD +0 -23
  106. package/external/node-gyp/gyp/pylib/packaging/__init__.py +0 -15
  107. package/external/node-gyp/gyp/pylib/packaging/_elffile.py +0 -108
  108. package/external/node-gyp/gyp/pylib/packaging/_manylinux.py +0 -252
  109. package/external/node-gyp/gyp/pylib/packaging/_musllinux.py +0 -83
  110. package/external/node-gyp/gyp/pylib/packaging/_parser.py +0 -359
  111. package/external/node-gyp/gyp/pylib/packaging/_structures.py +0 -61
  112. package/external/node-gyp/gyp/pylib/packaging/_tokenizer.py +0 -192
  113. package/external/node-gyp/gyp/pylib/packaging/markers.py +0 -252
  114. package/external/node-gyp/gyp/pylib/packaging/metadata.py +0 -825
  115. package/external/node-gyp/gyp/pylib/packaging/py.typed +0 -0
  116. package/external/node-gyp/gyp/pylib/packaging/requirements.py +0 -90
  117. package/external/node-gyp/gyp/pylib/packaging/specifiers.py +0 -1030
  118. package/external/node-gyp/gyp/pylib/packaging/tags.py +0 -553
  119. package/external/node-gyp/gyp/pylib/packaging/utils.py +0 -172
  120. package/external/node-gyp/gyp/pylib/packaging/version.py +0 -563
  121. package/external/node-gyp/gyp/pyproject.toml +0 -115
  122. package/external/node-gyp/gyp/release-please-config.json +0 -11
  123. package/external/node-gyp/gyp/test_gyp.py +0 -261
  124. package/external/node-gyp/lib/Find-VisualStudio.cs +0 -250
  125. package/external/node-gyp/lib/build.js +0 -230
  126. package/external/node-gyp/lib/clean.js +0 -15
  127. package/external/node-gyp/lib/configure.js +0 -328
  128. package/external/node-gyp/lib/create-config-gypi.js +0 -153
  129. package/external/node-gyp/lib/download.js +0 -41
  130. package/external/node-gyp/lib/find-node-directory.js +0 -63
  131. package/external/node-gyp/lib/find-python.js +0 -310
  132. package/external/node-gyp/lib/find-visualstudio.js +0 -600
  133. package/external/node-gyp/lib/install.js +0 -415
  134. package/external/node-gyp/lib/list.js +0 -26
  135. package/external/node-gyp/lib/log.js +0 -168
  136. package/external/node-gyp/lib/node-gyp.js +0 -188
  137. package/external/node-gyp/lib/process-release.js +0 -148
  138. package/external/node-gyp/lib/rebuild.js +0 -12
  139. package/external/node-gyp/lib/remove.js +0 -43
  140. package/external/node-gyp/lib/util.js +0 -81
  141. package/external/node-gyp/macOS_Catalina_acid_test.sh +0 -21
  142. package/external/node-gyp/package.json +0 -52
  143. package/external/node-gyp/release-please-config.json +0 -40
  144. package/external/node-gyp/src/win_delay_load_hook.cc +0 -41
package/dist/cli.js CHANGED
@@ -1606,7 +1606,7 @@ async function execGradleWithSpinner(bin, commandArgs, cwd) {
1606
1606
  try {
1607
1607
  logger.logger.info('(Running gradle can take a while, it depends on how long gradlew has to run)');
1608
1608
  logger.logger.info('(It will show no output, you can use --verbose to see its output)');
1609
- spinner.start(`Running gradlew`);
1609
+ spinner.start(`Running gradlew...`);
1610
1610
  const output = await spawn.spawn(bin, commandArgs, {
1611
1611
  // We can pipe the output through to have the user see the result
1612
1612
  // of running gradlew, but then we can't (easily) gather the output
@@ -3944,7 +3944,7 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
3944
3944
  if (test) {
3945
3945
  spinner?.info(`Testing ${newId} in ${workspace}.`);
3946
3946
  // eslint-disable-next-line no-await-in-loop
3947
- await npm.runScript(testScript, [], {
3947
+ await npm.runNpmScript(testScript, [], {
3948
3948
  spinner,
3949
3949
  stdio: 'ignore'
3950
3950
  });
@@ -4250,11 +4250,18 @@ async function npmFix(pkgEnvDetails, options) {
4250
4250
  shorthands: vendor.definitionsExports.shorthands
4251
4251
  });
4252
4252
  await config.load();
4253
- debug.debugFn('npm config:', config);
4253
+ const flatConfig = {
4254
+ __proto__: null,
4255
+ ...config.flat
4256
+ };
4257
+ flatConfig.nodeVersion = constants.NODE_VERSION;
4258
+ flatConfig.npmVersion = pkgEnvDetails.agentVersion.toString();
4259
+ flatConfig.npmCommand = 'install';
4260
+ debug.debugFn('npm config:', flatConfig);
4254
4261
  const arb = new shadowNpmInject.Arborist({
4255
4262
  path: pkgEnvDetails.pkgPath,
4256
- ...shadowNpmInject.SAFE_ARBORIST_REIFY_OPTIONS_OVERRIDES,
4257
- config
4263
+ ...flatConfig,
4264
+ ...shadowNpmInject.SAFE_ARBORIST_REIFY_OPTIONS_OVERRIDES
4258
4265
  });
4259
4266
  actualTree = await arb.reify();
4260
4267
  // Calling arb.reify() creates the arb.diff object, nulls-out arb.idealTree,
@@ -4487,7 +4494,7 @@ const {
4487
4494
  NPM: NPM$7,
4488
4495
  PNPM: PNPM$6
4489
4496
  } = constants;
4490
- async function handleFix(argv, {
4497
+ async function handleFix({
4491
4498
  autoMerge,
4492
4499
  cwd,
4493
4500
  ghsas,
@@ -4496,37 +4503,51 @@ async function handleFix(argv, {
4496
4503
  purls,
4497
4504
  rangeStyle,
4498
4505
  test,
4499
- testScript
4506
+ testScript,
4507
+ unknownFlags
4500
4508
  }) {
4509
+ // Lazily access constants.spinner.
4510
+ const {
4511
+ spinner
4512
+ } = constants;
4501
4513
  let {
4502
4514
  length: ghsasCount
4503
4515
  } = ghsas;
4504
4516
  if (ghsasCount) {
4505
- // Lazily access constants.spinner.
4506
- const {
4507
- spinner
4508
- } = constants;
4509
4517
  spinner.start('Fetching GHSA IDs...');
4510
4518
  if (ghsasCount === 1 && ghsas[0] === 'auto') {
4511
4519
  const autoCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd], {
4512
4520
  cwd,
4513
4521
  spinner
4514
4522
  });
4523
+ spinner.stop();
4515
4524
  if (autoCResult.ok) {
4516
4525
  ghsas = utils.cmdFlagValueToArray(/(?<=Vulnerabilities found: )[^\n]+/.exec(autoCResult.data)?.[0]);
4517
4526
  ghsasCount = ghsas.length;
4518
4527
  } else {
4528
+ debug.debugFn('coana fail:', {
4529
+ message: autoCResult.message,
4530
+ cause: autoCResult.cause
4531
+ });
4519
4532
  ghsas = [];
4520
4533
  ghsasCount = 0;
4521
4534
  }
4535
+ spinner.start();
4522
4536
  }
4523
4537
  if (ghsasCount) {
4524
4538
  spinner.info(`Found ${ghsasCount} GHSA ${words.pluralize('ID', ghsasCount)}.`);
4525
- await outputFixResult(await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd, '--apply-fixes-to', ...ghsas, ...argv], {
4539
+ const applyFixesCResult = await utils.spawnCoana(['compute-fixes-and-upgrade-purls', cwd, '--apply-fixes-to', ...ghsas, ...unknownFlags], {
4526
4540
  cwd,
4527
4541
  spinner
4528
- }), outputKind);
4542
+ });
4529
4543
  spinner.stop();
4544
+ if (!applyFixesCResult.ok) {
4545
+ debug.debugFn('coana fail:', {
4546
+ message: applyFixesCResult.message,
4547
+ cause: applyFixesCResult.cause
4548
+ });
4549
+ }
4550
+ await outputFixResult(applyFixesCResult, outputKind);
4530
4551
  return;
4531
4552
  }
4532
4553
  spinner.infoAndStop('No GHSA IDs found.');
@@ -4567,11 +4588,6 @@ async function handleFix(argv, {
4567
4588
  }, outputKind);
4568
4589
  return;
4569
4590
  }
4570
-
4571
- // Lazily access spinner.
4572
- const {
4573
- spinner
4574
- } = constants;
4575
4591
  const fixer = agent === NPM$7 ? npmFix : pnpmFix;
4576
4592
  await outputFixResult(await fixer(pkgEnvDetails, {
4577
4593
  autoMerge,
@@ -4712,7 +4728,10 @@ async function run$H(argv, importMeta, {
4712
4728
  const limit = (cli.flags['limit'] ? parseInt(String(cli.flags['limit'] || ''), 10) : Infinity) || Infinity;
4713
4729
  const purls = utils.cmdFlagValueToArray(cli.flags['purl']);
4714
4730
  const testScript = String(cli.flags['testScript'] || 'test');
4715
- await handleFix(argv, {
4731
+ const {
4732
+ unknownFlags
4733
+ } = cli;
4734
+ await handleFix({
4716
4735
  autoMerge,
4717
4736
  cwd,
4718
4737
  ghsas,
@@ -4721,7 +4740,8 @@ async function run$H(argv, importMeta, {
4721
4740
  purls,
4722
4741
  rangeStyle,
4723
4742
  test,
4724
- testScript
4743
+ testScript,
4744
+ unknownFlags
4725
4745
  });
4726
4746
  }
4727
4747
 
@@ -4811,7 +4831,7 @@ function getTabCompletionScriptRaw() {
4811
4831
  if (!fs$1.existsSync(sourcePath)) {
4812
4832
  return {
4813
4833
  ok: false,
4814
- message: 'Source not found',
4834
+ message: 'Source not found.',
4815
4835
  cause: `Unable to find the source tab completion bash script that Socket should ship. Expected to find it in \`${sourcePath}\` but it was not there.`
4816
4836
  };
4817
4837
  }
@@ -4826,12 +4846,11 @@ function updateInstalledTabCompletionScript(targetPath) {
4826
4846
  return content;
4827
4847
  }
4828
4848
 
4829
- // Lazily access constants.ENV.INLINED_SOCKET_CLI_VERSION_HASH.
4830
- const CLI_VERSION = constants.ENV.INLINED_SOCKET_CLI_VERSION_HASH;
4831
-
4832
4849
  // When installing set the current package.json version.
4833
4850
  // Later, we can call _socket_completion_version to get the installed version.
4834
- fs$1.writeFileSync(targetPath, content.data.replaceAll('SOCKET_VERSION_TOKEN', CLI_VERSION), 'utf8');
4851
+ fs$1.writeFileSync(targetPath, content.data.replaceAll('%SOCKET_VERSION_TOKEN%',
4852
+ // Lazily access constants.ENV.INLINED_SOCKET_CLI_VERSION_HASH.
4853
+ constants.ENV.INLINED_SOCKET_CLI_VERSION_HASH), 'utf8');
4835
4854
  return {
4836
4855
  ok: true,
4837
4856
  data: undefined
@@ -9202,7 +9221,9 @@ const config$j = {
9202
9221
  commandName: 'raw-npm',
9203
9222
  description: `Temporarily disable the Socket ${NPM} wrapper`,
9204
9223
  hidden: false,
9205
- flags: {},
9224
+ flags: {
9225
+ ...utils.commonFlags
9226
+ },
9206
9227
  help: command => `
9207
9228
  Usage
9208
9229
  $ ${command} ...
@@ -9265,7 +9286,9 @@ const config$i = {
9265
9286
  commandName: 'raw-npx',
9266
9287
  description: `Temporarily disable the Socket ${NPX} wrapper`,
9267
9288
  hidden: false,
9268
- flags: {},
9289
+ flags: {
9290
+ ...utils.commonFlags
9291
+ },
9269
9292
  help: command => `
9270
9293
  Usage
9271
9294
  $ ${command} ...
@@ -14092,18 +14115,16 @@ void (async () => {
14092
14115
  debug.debugFn('Uncaught error (BAD!):');
14093
14116
  debug.debugFn(e);
14094
14117
 
14095
- // Try to parse the flags, find out if --json or --markdown is set
14118
+ // Try to parse the flags, find out if --json or --markdown is set.
14096
14119
  let isJson = false;
14097
14120
  try {
14098
14121
  const cli = vendor.meow(``, {
14099
14122
  argv: process.argv.slice(2),
14123
+ autoHelp: false,
14124
+ flags: {},
14100
14125
  importMeta: {
14101
14126
  url: `${require$$0.pathToFileURL(__filename$1)}`
14102
- },
14103
- flags: {},
14104
- // Do not strictly check for flags here.
14105
- allowUnknownFlags: true,
14106
- autoHelp: false
14127
+ }
14107
14128
  });
14108
14129
  isJson = !!cli.flags['json'];
14109
14130
  } catch {}
@@ -14141,5 +14162,5 @@ void (async () => {
14141
14162
  await utils.captureException(e);
14142
14163
  }
14143
14164
  })();
14144
- //# debugId=bac54bf5-401a-488b-a2bb-65fdb17e2e2c
14165
+ //# debugId=fa52588f-cff8-4914-9a1b-357283f4db17
14145
14166
  //# sourceMappingURL=cli.js.map