@socketsecurity/cli-with-sentry 1.1.27 → 1.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
+ ## [1.1.28](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.28) - 2025-11-13
8
+
9
+ ### Added
10
+ - Backported `socket fix` with `--json` improvements
11
+
7
12
  ## [1.1.27](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.27) - 2025-11-12
8
13
 
9
14
  ### Added
package/dist/cli.js CHANGED
@@ -18,6 +18,7 @@ var prompts = require('../external/@socketsecurity/registry/lib/prompts');
18
18
  var spawn = require('../external/@socketsecurity/registry/lib/spawn');
19
19
  var fs$2 = require('../external/@socketsecurity/registry/lib/fs');
20
20
  var strings = require('../external/@socketsecurity/registry/lib/strings');
21
+ var os = require('node:os');
21
22
  var path$1 = require('../external/@socketsecurity/registry/lib/path');
22
23
  var require$$11 = require('../external/@socketsecurity/registry/lib/objects');
23
24
  var registry = require('../external/@socketsecurity/registry');
@@ -26,7 +27,6 @@ var require$$12 = require('../external/@socketsecurity/registry/lib/promises');
26
27
  var regexps = require('../external/@socketsecurity/registry/lib/regexps');
27
28
  var require$$0$1 = require('node:crypto');
28
29
  var require$$1 = require('node:util');
29
- var os = require('node:os');
30
30
  var promises = require('node:stream/promises');
31
31
 
32
32
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
@@ -3631,18 +3631,47 @@ async function coanaFix(fixConfig) {
3631
3631
  }
3632
3632
  };
3633
3633
  }
3634
- const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...(isAll ? ['all'] : ghsas), ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(minimumReleaseAge ? ['--minimum-release-age', minimumReleaseAge] : []), ...(include.length ? ['--include', ...include] : []), ...(exclude.length ? ['--exclude', ...exclude] : []), ...(!applyFixes ? [constants.FLAG_DRY_RUN] : []), ...(outputFile ? ['--output-file', outputFile] : []), ...(disableMajorUpdates ? ['--disable-major-updates'] : []), ...(showAffectedDirectDependencies ? ['--show-affected-direct-dependencies'] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3635
- cwd,
3636
- spinner,
3637
- stdio: 'inherit'
3638
- });
3639
- spinner?.stop();
3640
- return fixCResult.ok ? {
3641
- ok: true,
3642
- data: {
3643
- fixed: true
3634
+
3635
+ // Create a temporary file for the output.
3636
+ const tmpDir = os.tmpdir();
3637
+ const tmpFile = path.join(tmpDir, `socket-fix-${Date.now()}.json`);
3638
+ try {
3639
+ const fixCResult = await utils.spawnCoanaDlx(['compute-fixes-and-upgrade-purls', cwd, '--manifests-tar-hash', tarHash, '--apply-fixes-to', ...(isAll ? ['all'] : ghsas), ...(fixConfig.rangeStyle ? ['--range-style', fixConfig.rangeStyle] : []), ...(minimumReleaseAge ? ['--minimum-release-age', minimumReleaseAge] : []), ...(include.length ? ['--include', ...include] : []), ...(exclude.length ? ['--exclude', ...exclude] : []), ...(!applyFixes ? [constants.FLAG_DRY_RUN] : []), '--output-file', tmpFile, ...(disableMajorUpdates ? ['--disable-major-updates'] : []), ...(showAffectedDirectDependencies ? ['--show-affected-direct-dependencies'] : []), ...fixConfig.unknownFlags], fixConfig.orgSlug, {
3640
+ cwd,
3641
+ spinner,
3642
+ stdio: 'inherit'
3643
+ });
3644
+ spinner?.stop();
3645
+ if (!fixCResult.ok) {
3646
+ return fixCResult;
3647
+ }
3648
+
3649
+ // Read the temporary file to get the actual fixes result.
3650
+ const fixesResultJson = fs$2.readJsonSync(tmpFile, {
3651
+ throws: false
3652
+ });
3653
+
3654
+ // Copy to outputFile if provided.
3655
+ if (outputFile) {
3656
+ logger.logger.info(`Copying fixes result to ${outputFile}`);
3657
+ const tmpContent = await fs$1.promises.readFile(tmpFile, 'utf8');
3658
+ await fs$1.promises.writeFile(outputFile, tmpContent, 'utf8');
3644
3659
  }
3645
- } : fixCResult;
3660
+ return {
3661
+ ok: true,
3662
+ data: {
3663
+ data: fixesResultJson,
3664
+ fixed: true
3665
+ }
3666
+ };
3667
+ } finally {
3668
+ // Clean up the temporary file.
3669
+ try {
3670
+ await fs$1.promises.unlink(tmpFile);
3671
+ } catch (e) {
3672
+ // Ignore cleanup errors.
3673
+ }
3674
+ }
3646
3675
  }
3647
3676
 
3648
3677
  // Adjust limit based on open Socket Fix PRs.
@@ -3967,8 +3996,10 @@ async function handleFix({
3967
3996
  include,
3968
3997
  limit,
3969
3998
  minimumReleaseAge,
3999
+ minSatisfying,
3970
4000
  orgSlug,
3971
4001
  outputFile,
4002
+ prCheck,
3972
4003
  rangeStyle,
3973
4004
  showAffectedDirectDependencies,
3974
4005
  spinner,
@@ -15060,5 +15091,5 @@ void (async () => {
15060
15091
  await utils.captureException(e);
15061
15092
  }
15062
15093
  })();
15063
- //# debugId=ede65737-8f7f-42fe-be24-d7339a0b3189
15094
+ //# debugId=13d5a945-42af-4203-b65f-268cf102639c
15064
15095
  //# sourceMappingURL=cli.js.map