@socketsecurity/cli-with-sentry 1.1.66 → 1.1.68
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 +12 -1
- package/README.md +32 -0
- package/dist/cli.js +54 -15
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +4 -4
- package/dist/constants.js.map +1 -1
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/commands/patch/cmd-patch.d.mts.map +1 -1
- package/dist/vendor.js +915 -15026
- package/package.json +6 -6
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.68](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.68) - 2026-03-09
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- Updated the Coana CLI to v `14.12.191`.
|
|
11
|
+
|
|
12
|
+
## [1.1.67](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.67) - 2026-03-06
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- Updated `@socketsecurity/socket-patch` to v2.0.0, now powered by a native Rust binary for faster patch operations
|
|
16
|
+
- The `socket patch` command now directly invokes the platform-specific Rust binary instead of a Node.js wrapper
|
|
17
|
+
- Enhanced `socket patch` documentation with a complete subcommand reference and quick-start guide
|
|
18
|
+
|
|
7
19
|
## [1.1.66](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.66) - 2026-03-02
|
|
8
20
|
|
|
9
21
|
### Changed
|
|
@@ -52,7 +64,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
52
64
|
- Deprecated `--reach-disable-analysis-splitting` flag (now a no-op for backwards compatibility).
|
|
53
65
|
- Updated the Coana CLI to v `14.12.154`.
|
|
54
66
|
|
|
55
|
-
|
|
56
67
|
## [1.1.57](https://github.com/SocketDev/socket-cli/releases/tag/v1.1.57) - 2026-01-10
|
|
57
68
|
|
|
58
69
|
### 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 = '
|
|
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
|
-
//
|
|
9636
|
-
|
|
9637
|
-
|
|
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
|
-
|
|
9667
|
+
spawnEnv['SOCKET_API_URL'] = apiUrl;
|
|
9643
9668
|
}
|
|
9644
9669
|
if (ENV.SOCKET_CLI_API_TOKEN) {
|
|
9645
|
-
|
|
9670
|
+
spawnEnv['SOCKET_API_TOKEN'] = ENV.SOCKET_CLI_API_TOKEN;
|
|
9646
9671
|
}
|
|
9647
9672
|
if (ENV.SOCKET_CLI_ORG_SLUG) {
|
|
9648
|
-
|
|
9673
|
+
spawnEnv['SOCKET_ORG_SLUG'] = ENV.SOCKET_CLI_ORG_SLUG;
|
|
9649
9674
|
}
|
|
9650
9675
|
if (ENV.SOCKET_PATCH_PROXY_URL) {
|
|
9651
|
-
|
|
9676
|
+
spawnEnv['SOCKET_PATCH_PROXY_URL'] = ENV.SOCKET_PATCH_PROXY_URL;
|
|
9652
9677
|
}
|
|
9653
9678
|
if (ENV.SOCKET_CLI_API_PROXY) {
|
|
9654
|
-
|
|
9679
|
+
spawnEnv['HTTPS_PROXY'] = ENV.SOCKET_CLI_API_PROXY;
|
|
9655
9680
|
}
|
|
9656
9681
|
if (ENV.SOCKET_CLI_DEBUG) {
|
|
9657
|
-
|
|
9682
|
+
spawnEnv['SOCKET_PATCH_DEBUG'] = '1';
|
|
9658
9683
|
}
|
|
9659
9684
|
|
|
9660
|
-
//
|
|
9661
|
-
|
|
9662
|
-
|
|
9663
|
-
|
|
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=
|
|
15439
|
+
//# debugId=d5e3e146-9020-4771-aa72-2774939df8c7
|
|
15401
15440
|
//# sourceMappingURL=cli.js.map
|