feat: Rust rewrite with cross-compilation and npm distribution#30
feat: Rust rewrite with cross-compilation and npm distribution#30mikolalysenko merged 10 commits intomainfrom
Conversation
- 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>
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
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>
…ed 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>
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>
…ests 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>
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>
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>
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>
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>
Summary
crates/socket-patch-core+crates/socket-patch-cli) with 154 passing unit testsoptionalDependenciesplatform packages — no TypeScript fallback, pure native binariesrelease.ymlworkflow (tag-triggered): builds all targets, creates GitHub Release, publishes to npmci.ymlworkflow: cargo clippy + cargo test on PRs and pushes to mainpublish.ymlto bump versions across Cargo.toml and npm packages, then push tag to trigger release pipelinescripts/version-sync.shto keep versions in sync across all manifestsTest plan
cargo test --workspacepasses all 154 testscargo clippy --workspace -- -D warningsis cleancargo build --releaseproduces working binaryscripts/version-sync.sh 1.3.0updates all version fields consistentlynpm/*/package.jsonfiles have correctos/cpufieldsv*tag to verify the release workflow builds all 5 targets🤖 Generated with Claude Code