Skip to content

Commit 10dee6e

Browse files
mikolalysenkoclaude
andcommitted
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>
1 parent 9030590 commit 10dee6e

73 files changed

Lines changed: 40 additions & 15980 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,16 @@ jobs:
3434
3535
- name: Bump version and sync
3636
run: |
37-
npm version ${{ inputs.version-bump }} --no-git-tag-version
38-
VERSION=$(node -p "require('./package.json').version")
37+
CURRENT=$(node -p "require('./npm/socket-patch/package.json').version")
38+
VERSION=$(node -e "
39+
const [major, minor, patch] = '$CURRENT'.split('.').map(Number);
40+
const bump = '${{ inputs.version-bump }}';
41+
if (bump === 'major') console.log((major+1)+'.0.0');
42+
else if (bump === 'minor') console.log(major+'.'+(minor+1)+'.0');
43+
else console.log(major+'.'+minor+'.'+(patch+1));
44+
")
3945
bash scripts/version-sync.sh "$VERSION"
40-
git add Cargo.toml package.json npm/
46+
git add Cargo.toml npm/
4147
git commit -m "v$VERSION"
4248
git tag "v$VERSION"
4349

.github/workflows/release.yml

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -129,41 +129,22 @@ jobs:
129129
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
130130
bash scripts/version-sync.sh "$VERSION"
131131
132-
- name: Stage darwin-arm64 binary
132+
- name: Stage binaries
133133
run: |
134-
tar xzf artifacts/socket-patch-aarch64-apple-darwin.tar.gz -C npm/socket-patch-darwin-arm64/bin/
135-
136-
- name: Stage darwin-x64 binary
137-
run: |
138-
tar xzf artifacts/socket-patch-x86_64-apple-darwin.tar.gz -C npm/socket-patch-darwin-x64/bin/
139-
140-
- name: Stage linux-x64 binary
141-
run: |
142-
tar xzf artifacts/socket-patch-x86_64-unknown-linux-musl.tar.gz -C npm/socket-patch-linux-x64/bin/
143-
144-
- name: Stage linux-arm64 binary
145-
run: |
146-
tar xzf artifacts/socket-patch-aarch64-unknown-linux-gnu.tar.gz -C npm/socket-patch-linux-arm64/bin/
147-
148-
- name: Stage win32-x64 binary
149-
run: |
150-
cd npm/socket-patch-win32-x64/bin
134+
mkdir -p npm/socket-patch/bin
135+
tar xzf artifacts/socket-patch-aarch64-apple-darwin.tar.gz -C npm/socket-patch/bin/
136+
mv npm/socket-patch/bin/socket-patch npm/socket-patch/bin/socket-patch-darwin-arm64
137+
tar xzf artifacts/socket-patch-x86_64-apple-darwin.tar.gz -C npm/socket-patch/bin/
138+
mv npm/socket-patch/bin/socket-patch npm/socket-patch/bin/socket-patch-darwin-x64
139+
tar xzf artifacts/socket-patch-x86_64-unknown-linux-musl.tar.gz -C npm/socket-patch/bin/
140+
mv npm/socket-patch/bin/socket-patch npm/socket-patch/bin/socket-patch-linux-x64
141+
tar xzf artifacts/socket-patch-aarch64-unknown-linux-gnu.tar.gz -C npm/socket-patch/bin/
142+
mv npm/socket-patch/bin/socket-patch npm/socket-patch/bin/socket-patch-linux-arm64
143+
cd npm/socket-patch/bin
151144
unzip ../../../artifacts/socket-patch-x86_64-pc-windows-msvc.zip
145+
mv socket-patch.exe socket-patch-win32-x64.exe
152146
153-
- name: Publish platform packages
154-
env:
155-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
156-
run: |
157-
for pkg in \
158-
npm/socket-patch-darwin-arm64 \
159-
npm/socket-patch-darwin-x64 \
160-
npm/socket-patch-linux-x64 \
161-
npm/socket-patch-linux-arm64 \
162-
npm/socket-patch-win32-x64; do
163-
npm publish "$pkg" --provenance --access public
164-
done
165-
166-
- name: Publish root package
147+
- name: Publish package
167148
env:
168149
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
169150
run: npm publish npm/socket-patch --provenance --access public

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,5 @@ vite.config.ts.timestamp-*
141141
# Rust
142142
target/
143143

144-
# npm platform binaries (populated at publish time)
145-
npm/*/bin/socket-patch
146-
npm/*/bin/socket-patch.exe
147-
!npm/socket-patch/bin/socket-patch
144+
# npm binaries (populated at publish time)
145+
npm/socket-patch/bin/socket-patch-*

.npmignore

Lines changed: 0 additions & 33 deletions
This file was deleted.

.oxlintrc.json

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)