@socketsecurity/cli-with-sentry 1.1.65 → 1.1.67

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,18 @@ 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.67](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.67) - 2026-03-06
8
+
9
+ ### Changed
10
+ - Updated `@socketsecurity/socket-patch` to v2.0.0, now powered by a native Rust binary for faster patch operations
11
+ - The `socket patch` command now directly invokes the platform-specific Rust binary instead of a Node.js wrapper
12
+ - Enhanced `socket patch` documentation with a complete subcommand reference and quick-start guide
13
+
14
+ ## [1.1.66](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.66) - 2026-03-02
15
+
16
+ ### Changed
17
+ - Updated the Coana CLI to v `14.12.189`.
18
+
7
19
  ## [1.1.65](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.65) - 2026-02-26
8
20
 
9
21
  ### Changed
@@ -47,7 +59,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
47
59
  - Deprecated `--reach-disable-analysis-splitting` flag (now a no-op for backwards compatibility).
48
60
  - Updated the Coana CLI to v `14.12.154`.
49
61
 
50
-
51
62
  ## [1.1.57](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.57) - 2026-01-10
52
63
 
53
64
  ### Changed
package/README.md CHANGED
@@ -22,6 +22,38 @@ socket --help
22
22
 
23
23
  - `socket cdxgen [command]` - Run [cdxgen](https://cyclonedx.github.io/cdxgen/#/?id=getting-started) for SBOM generation
24
24
 
25
+ - `socket patch <command>` - Apply, manage, and rollback Socket security patches for vulnerable dependencies
26
+
27
+ ### Patch subcommands
28
+
29
+ | Command | Description |
30
+ |---------|-------------|
31
+ | `socket patch scan` | Scan installed packages for available security patches |
32
+ | `socket patch get <uuid> --org <slug>` | Download a patch by UUID and store it locally |
33
+ | `socket patch apply` | Apply downloaded patches to `node_modules` |
34
+ | `socket patch rollback [purl\|uuid]` | Rollback patches and restore original files |
35
+ | `socket patch list [--json]` | List all patches in the local manifest |
36
+ | `socket patch remove <purl\|uuid>` | Remove a patch from the manifest (rolls back by default) |
37
+ | `socket patch setup [--yes]` | Add `socket patch apply` to `postinstall` scripts |
38
+ | `socket patch repair` | Download missing blobs and clean up unused blobs |
39
+
40
+ **Quick start:**
41
+
42
+ ```bash
43
+ # Scan for available patches, download, and apply.
44
+ socket patch scan
45
+ socket patch apply
46
+
47
+ # Or download a specific patch by UUID.
48
+ socket patch get <uuid> --org <org-slug>
49
+ socket patch apply
50
+
51
+ # Add to postinstall so patches reapply on npm install.
52
+ socket patch setup --yes
53
+ ```
54
+
55
+ Free patches work without authentication. For paid patches, set `SOCKET_CLI_API_TOKEN` and `SOCKET_CLI_ORG_SLUG`.
56
+
25
57
  ## Aliases
26
58
 
27
59
  All aliases support the flags and arguments of the commands they alias.
package/dist/cli.js CHANGED
@@ -25,6 +25,7 @@ var registry = require('../external/@socketsecurity/registry');
25
25
  var packages = require('../external/@socketsecurity/registry/lib/packages');
26
26
  var require$$12 = require('../external/@socketsecurity/registry/lib/promises');
27
27
  var regexps = require('../external/@socketsecurity/registry/lib/regexps');
28
+ var childProcess = require('node:child_process');
28
29
  var require$$1 = require('node:util');
29
30
  var promises = require('node:stream/promises');
30
31
 
@@ -9620,47 +9621,85 @@ const cmdPackage = {
9620
9621
  }
9621
9622
  };
9622
9623
 
9623
- const description$k = 'Manage CVE patches for dependencies';
9624
+ const description$k = 'Apply, manage, and rollback Socket security patches for vulnerable dependencies';
9624
9625
  const hidden$h = false;
9625
9626
  const cmdPatch = {
9626
9627
  description: description$k,
9627
9628
  hidden: hidden$h,
9628
9629
  run: run$m
9629
9630
  };
9631
+
9632
+ // Resolve the path to the socket-patch binary.
9633
+ // The @socketsecurity/socket-patch package registers a bin entry that pnpm
9634
+ // links into node_modules/.bin/socket-patch. This launcher script finds and
9635
+ // executes the platform-specific Rust binary from the optionalDependencies.
9636
+ function resolveSocketPatchBin() {
9637
+ // Walk up from this file (or dist/) to find the closest node_modules/.bin.
9638
+ let dir = __dirname;
9639
+ for (let i = 0; i < 10; i += 1) {
9640
+ const candidate = path.join(dir, 'node_modules', '.bin', 'socket-patch');
9641
+ if (fs$1.existsSync(candidate)) {
9642
+ return candidate;
9643
+ }
9644
+ const parent = path.dirname(dir);
9645
+ if (parent === dir) {
9646
+ break;
9647
+ }
9648
+ dir = parent;
9649
+ }
9650
+ // Fallback: assume socket-patch is on PATH.
9651
+ return 'socket-patch';
9652
+ }
9630
9653
  async function run$m(argv, _importMeta, _context) {
9631
9654
  const {
9632
9655
  ENV
9633
9656
  } = constants.default;
9634
9657
 
9635
- // Map socket-cli environment to socket-patch options.
9636
- // Only include properties with defined values (exactOptionalPropertyTypes).
9637
- const options = {};
9658
+ // Build environment variables for the socket-patch binary.
9659
+ const spawnEnv = {
9660
+ ...process.env
9661
+ };
9638
9662
 
9663
+ // Map socket-cli environment to socket-patch environment variables.
9639
9664
  // Strip /v0/ suffix from API URL if present.
9640
9665
  const apiUrl = ENV.SOCKET_CLI_API_BASE_URL?.replace(/\/v0\/?$/, '');
9641
9666
  if (apiUrl) {
9642
- options.apiUrl = apiUrl;
9667
+ spawnEnv['SOCKET_API_URL'] = apiUrl;
9643
9668
  }
9644
9669
  if (ENV.SOCKET_CLI_API_TOKEN) {
9645
- options.apiToken = ENV.SOCKET_CLI_API_TOKEN;
9670
+ spawnEnv['SOCKET_API_TOKEN'] = ENV.SOCKET_CLI_API_TOKEN;
9646
9671
  }
9647
9672
  if (ENV.SOCKET_CLI_ORG_SLUG) {
9648
- options.orgSlug = ENV.SOCKET_CLI_ORG_SLUG;
9673
+ spawnEnv['SOCKET_ORG_SLUG'] = ENV.SOCKET_CLI_ORG_SLUG;
9649
9674
  }
9650
9675
  if (ENV.SOCKET_PATCH_PROXY_URL) {
9651
- options.patchProxyUrl = ENV.SOCKET_PATCH_PROXY_URL;
9676
+ spawnEnv['SOCKET_PATCH_PROXY_URL'] = ENV.SOCKET_PATCH_PROXY_URL;
9652
9677
  }
9653
9678
  if (ENV.SOCKET_CLI_API_PROXY) {
9654
- options.httpProxy = ENV.SOCKET_CLI_API_PROXY;
9679
+ spawnEnv['HTTPS_PROXY'] = ENV.SOCKET_CLI_API_PROXY;
9655
9680
  }
9656
9681
  if (ENV.SOCKET_CLI_DEBUG) {
9657
- options.debug = ENV.SOCKET_CLI_DEBUG;
9682
+ spawnEnv['SOCKET_PATCH_DEBUG'] = '1';
9658
9683
  }
9659
9684
 
9660
- // Forward all arguments to socket-patch.
9661
- const exitCode = await vendor.runExports.runPatch([...argv], options);
9662
- if (exitCode !== 0) {
9663
- process.exitCode = exitCode;
9685
+ // Resolve and spawn the socket-patch Rust binary.
9686
+ // On Windows, node_modules/.bin shims are .cmd scripts that require shell.
9687
+ const binPath = resolveSocketPatchBin();
9688
+ const result = childProcess.spawnSync(binPath, [...argv], {
9689
+ stdio: 'inherit',
9690
+ env: spawnEnv,
9691
+ shell: constants.default.WIN32
9692
+ });
9693
+ if (result.error) {
9694
+ throw result.error;
9695
+ }
9696
+ // Propagate signal if the child was killed (e.g. SIGTERM, SIGINT).
9697
+ if (result.signal) {
9698
+ process.kill(process.pid, result.signal);
9699
+ return;
9700
+ }
9701
+ if (result.status !== null && result.status !== 0) {
9702
+ process.exitCode = result.status;
9664
9703
  }
9665
9704
  }
9666
9705
 
@@ -15397,5 +15436,5 @@ process.on('unhandledRejection', async (reason, promise) => {
15397
15436
  // eslint-disable-next-line n/no-process-exit
15398
15437
  process.exit(1);
15399
15438
  });
15400
- //# debugId=cd9a03d7-376e-442c-bd72-438395900ecb
15439
+ //# debugId=d5e3e146-9020-4771-aa72-2774939df8c7
15401
15440
  //# sourceMappingURL=cli.js.map