Skip to content

Commit fb04997

Browse files
fix: building platform binaries
1 parent d38cadb commit fb04997

9 files changed

Lines changed: 25 additions & 40 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ body:
7777
- macOS (Intel)
7878
- macOS (Apple Silicon)
7979
- Linux (x64)
80-
- Linux (ARM64)
8180
- Windows (x64)
8281
- Other
8382
validations:

.github/workflows/build.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ jobs:
2222
- host: ubuntu-latest
2323
target: x86_64-unknown-linux-gnu
2424
build: npm run build:rust -- --target x86_64-unknown-linux-gnu
25-
- host: ubuntu-latest
26-
target: aarch64-unknown-linux-gnu
27-
build: npm run build:rust -- --target aarch64-unknown-linux-gnu
2825
- host: windows-latest
2926
target: x86_64-pc-windows-msvc
3027
build: npm run build:rust -- --target x86_64-pc-windows-msvc
@@ -45,21 +42,11 @@ jobs:
4542
with:
4643
targets: ${{ matrix.settings.target }}
4744

48-
- name: Install cross-compilation toolchain (Linux ARM64)
49-
if: matrix.settings.target == 'aarch64-unknown-linux-gnu'
50-
run: |
51-
sudo apt-get update
52-
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
53-
5445
- name: Install dependencies
5546
run: npm install
5647

5748
- name: Build native module
5849
run: ${{ matrix.settings.build }}
59-
env:
60-
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
61-
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
62-
CXX_aarch64_unknown_linux_gnu: aarch64-linux-gnu-g++
6350

6451
- name: Upload artifacts
6552
uses: actions/upload-artifact@v4

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ node_modules/
44
# Build outputs
55
dist/
66
rust/target/
7-
rust/index.node
7+
rust/node-wreq.node
88
*.node
99

1010
# TypeScript

docs/PUBLISHING.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Supported platforms:
1414
- 🍎 macOS Intel (x64)
1515
- 🍎 macOS Apple Silicon (arm64)
1616
- 🐧 Linux x64
17-
- 🐧 Linux ARM64
1817
- 🪟 Windows x64
1918

2019
### Publishing Process

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,13 @@
5050
"rust/*.node"
5151
],
5252
"napi": {
53-
"name": "index",
53+
"name": "node-wreq",
5454
"triples": {
5555
"defaults": true,
5656
"additional": [
5757
"x86_64-apple-darwin",
5858
"aarch64-apple-darwin",
5959
"x86_64-unknown-linux-gnu",
60-
"aarch64-unknown-linux-gnu",
6160
"x86_64-pc-windows-msvc"
6261
]
6362
}

rust/Cargo.lock

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "browser-bypass"
2+
name = "node-wreq"
33
version = "0.1.0"
44
edition = "2021"
55
license = "MIT"

src/node-wreq.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ function loadNativeBinding() {
1818
},
1919
linux: {
2020
x64: 'linux-x64',
21-
arm64: 'linux-arm64',
2221
},
2322
win32: {
2423
x64: 'win32-x64',
@@ -29,23 +28,23 @@ function loadNativeBinding() {
2928
if (!platformArch) {
3029
throw new Error(
3130
`Unsupported platform: ${platform}-${arch}. ` +
32-
`Supported platforms: darwin-x64, darwin-arm64, linux-x64, linux-arm64, win32-x64`
31+
`Supported platforms: darwin-x64, darwin-arm64, linux-x64, win32-x64`
3332
);
3433
}
3534

3635
// Try to load platform-specific binary (napi naming convention)
37-
const binaryName = `index.${platformArch}.node`;
36+
const binaryName = `node-wreq.${platformArch}.node`;
3837

3938
try {
4039
return require(`../rust/${binaryName}`);
4140
} catch (e1) {
42-
// Fallback to index.node (for local development)
41+
// Fallback to node-wreq.node (for local development)
4342
try {
44-
return require('../rust/index.node');
43+
return require('../rust/node-wreq.node');
4544
} catch (e2) {
4645
throw new Error(
4746
`Failed to load native module for ${platform}-${arch}. ` +
48-
`Tried: ../rust/${binaryName} and ../rust/index.node. ` +
47+
`Tried: ../rust/${binaryName} and ../rust/node-wreq.node. ` +
4948
`Make sure the package is installed correctly and the native module is built for your platform.`
5049
);
5150
}

src/test/node-wreq.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ describe('node-wreq', () => {
1313
assert.ok(Array.isArray(profiles), 'Profiles should be an array');
1414
assert.ok(profiles.length > 0, 'Should have at least one profile');
1515
assert.ok(
16-
profiles.includes('chrome_137') || profiles.includes('firefox_139') || profiles.includes('safari_18'),
16+
profiles.includes('chrome_137') ||
17+
profiles.includes('firefox_139') ||
18+
profiles.includes('safari_18'),
1719
'Should include standard browser profiles'
1820
);
1921

0 commit comments

Comments
 (0)