Commit cc267a6
feat: Rust rewrite with cross-compilation and npm distribution (#30)
* feat: add cross-compilation, npm distribution, and release workflows
- Add release.yml workflow triggered by v* tags: builds 5 targets
(darwin-arm64, darwin-x64, linux-x64-musl, linux-arm64, win32-x64),
creates GitHub Release, publishes npm platform packages
- Add ci.yml workflow for PRs/pushes: cargo clippy + cargo test
- Add npm/ directory with esbuild-style optionalDependencies pattern
(root wrapper + 5 platform packages with os/cpu fields)
- Add scripts/version-sync.sh to propagate versions across Cargo.toml
and all npm package.json files
- Update publish.yml to bump version, sync, and push tag to trigger
release pipeline
- Add rust-toolchain.toml pinning stable channel
- Update .gitignore for Rust target/ and npm platform binaries
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: pin all GitHub Actions to full commit SHAs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add explicit toolchain input for pinned rust-toolchain action
When dtolnay/rust-toolchain is pinned to a SHA instead of a branch
name, the toolchain version can't be inferred from the ref and must
be passed explicitly.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: consolidate npm distribution into single package with bundled binaries
Delete all TypeScript source, configs, and platform-specific npm packages.
The single @socketsecurity/socket-patch package now ships all 5 platform
binaries (~20MB total) instead of using optionalDependencies with 6 packages.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add Windows support for Python crawler and CI test matrix
Resolve runtime gaps on Windows: use find_python_command() to discover
python3/python/py, add USERPROFILE fallback for home dir, gate Unix-only
paths and add Windows Python install locations (APPDATA, LOCALAPPDATA,
Program Files), and add Windows uv tools path. CI now runs tests on both
ubuntu-latest and windows-latest.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add cargo publish, install script, clippy fixes, and expanded tests
Add crates.io publishing to release workflow, a one-line install script,
and README installation docs. Fix UTF-8 truncation bug in API client,
apply clippy suggestions (is_some_and, strip_prefix, div_ceil, derive
Default), and add comprehensive tests across API, package_json, and
blob_fetcher modules.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: fix Windows CI test failures for telemetry and Python crawler
Use home_dir_string() helper (which checks USERPROFILE on Windows) in
the sanitize_error_message test instead of only checking HOME. Use
platform-appropriate venv directory layout in test_crawl_all_python.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: merge telemetry env-var tests to prevent parallel race condition
The two tests (test_is_telemetry_disabled_default and
test_is_telemetry_disabled_when_set) mutated shared env vars and raced
when run in parallel on Windows CI. Merge them into a single test that
saves/restores the original values.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add e2e tests for npm and PyPI patch lifecycles
Add full end-to-end tests that exercise the CLI against the public
Socket API:
- npm: minimist@1.2.2 patch (CVE-2021-44906, prototype pollution)
- PyPI: pydantic-ai@0.0.36 patch (CVE-2026-25580, SSRF)
Each test covers the complete lifecycle: get → list → rollback → apply
→ remove, plus a dry-run test per ecosystem. Tests are gated with
#[ignore] and run in CI via a dedicated e2e job on ubuntu and macos.
Also fixes a bug where patches with no beforeHash (new files added by a
patch) were silently dropped from the manifest. The apply and rollback
engines now handle empty beforeHash correctly:
- apply: creates new files, skips beforeHash verification
- rollback: deletes patch-created files instead of restoring from blob
- get: includes files in manifest even when beforeHash is absent
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: use crates.io trusted publishing via OIDC instead of static token
Replace CRATES_IO_TOKEN secret with rust-lang/crates-io-auth-action,
which exchanges a GitHub OIDC token for a short-lived crates.io publish
token. This eliminates the need to manage long-lived API secrets.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 7f464f4 commit cc267a6
File tree
119 files changed
+14855
-15811
lines changed- .github/workflows
- crates
- socket-patch-cli
- src
- commands
- tests
- socket-patch-core
- src
- api
- crawlers
- hash
- manifest
- package_json
- patch
- utils
- npm/socket-patch
- bin
- scripts
- src
- commands
- crawlers
- hash
- manifest
- package-json
- patch
- schema
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
119 files changed
+14855
-15811
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | 14 | | |
28 | 15 | | |
29 | 16 | | |
30 | | - | |
31 | 17 | | |
32 | 18 | | |
33 | | - | |
| 19 | + | |
34 | 20 | | |
35 | | - | |
36 | | - | |
37 | 21 | | |
38 | 22 | | |
39 | 23 | | |
| |||
48 | 32 | | |
49 | 33 | | |
50 | 34 | | |
51 | | - | |
52 | | - | |
| 35 | + | |
53 | 36 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
58 | 51 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
This file was deleted.
0 commit comments