Skip to content

Commit 19b2132

Browse files
chore: remove Android targets\n\n- Remove Android from build and test matrices\n- Remove Android from target triples\n- Update README to remove Android from platform list
1 parent 8da1ea8 commit 19b2132

File tree

3 files changed

+40
-30
lines changed

3 files changed

+40
-30
lines changed

.github/workflows/CI.yml

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,7 @@ jobs:
5757
npm install &&
5858
npx @napi-rs/cli build --target aarch64-unknown-linux-gnu &&
5959
aarch64-unknown-linux-gnu-strip *.node
60-
- host: ubuntu-latest
61-
target: aarch64-linux-android
62-
build: |
63-
npm install
64-
npx @napi-rs/cli build --target aarch64-linux-android
65-
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node
66-
- host: ubuntu-latest
67-
target: armv7-linux-androideabi
68-
build: |
69-
npm install
70-
npx @napi-rs/cli build --target armv7-linux-androideabi
71-
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node
60+
7261
7362
name: stable - ${{ matrix.settings.target }} - node@18
7463
runs-on: ${{ matrix.settings.host }}
@@ -204,20 +193,7 @@ jobs:
204193
name: macOS ARM64
205194
runner: macos-latest
206195
target: aarch64-apple-darwin
207-
- if: startsWith(github.ref, 'refs/tags/v')
208-
node: 18
209-
platform:
210-
name: Android ARM64
211-
runner: ubuntu-latest
212-
target: aarch64-linux-android
213-
android: true
214-
- if: startsWith(github.ref, 'refs/tags/v')
215-
node: 18
216-
platform:
217-
name: Android ARM v7
218-
runner: ubuntu-latest
219-
target: armv7-linux-androideabi
220-
android: true
196+
221197
runs-on: ${{ matrix.platform.runner }}
222198

223199
steps:
@@ -360,9 +336,11 @@ jobs:
360336
ls -la
361337
echo "\nNode files:"
362338
find . -maxdepth 1 -name '*.node'
363-
find . -name "*.node"
364339
shell: bash
365340

341+
- name: Link local package
342+
run: npm link
343+
366344
- name: Build TypeScript
367345
run: npm run build:ts
368346

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ npm install cel-typescript
2121
```
2222

2323
**Requirements:**
24+
2425
- Node.js 18 or later
2526

2627
This package includes pre-compiled native binaries for multiple platforms:
2728

2829
- macOS (x64, arm64)
2930
- Linux (x64, arm64)
3031
- Windows (x64)
31-
- Android (arm64, armv7)
3232

3333
The appropriate binary for your platform will be automatically loaded at
3434
runtime.
@@ -156,6 +156,40 @@ The native module is built using NAPI-RS and provides cross-platform support:
156156
- This structure allows for seamless cross-platform distribution while
157157
maintaining platform-specific optimizations
158158

159+
### Package Size and Platform Support
160+
161+
The npm package is relatively large (~37 MB unpacked) because it includes
162+
pre-compiled native binaries for all supported platforms:
163+
164+
- macOS (x64, arm64)
165+
- Linux (x64, arm64)
166+
- Windows (x64)
167+
168+
However, when you install this package, npm will only extract the `.node` file
169+
for your platform. For example:
170+
171+
- On an M1/M2 Mac, only `cel-typescript.darwin-arm64.node` (~7.4 MB) is used
172+
- On Windows, only `cel-typescript.win32-x64.node` is used
173+
- On Linux, only `cel-typescript.linux-x64.node` or
174+
`cel-typescript.linux-arm64.node` is used
175+
176+
This is a common pattern for packages with native bindings. For comparison:
177+
178+
- `sharp` (image processing): 39.7 MB unpacked
179+
- `better-sqlite3`: 12.8 MB unpacked
180+
- `canvas`: 8.9 MB unpacked
181+
182+
#### A Note on Tree-Shaking
183+
184+
Tree-shaking (dead code elimination) primarily works with JavaScript modules and
185+
doesn't affect native binaries. The `.node` files are loaded dynamically at
186+
runtime based on the platform, so tree-shaking can't eliminate unused platform
187+
binaries during build time.
188+
189+
However, the JavaScript/TypeScript portion of this package is tree-shakeable.
190+
For example, if you only use `evaluate()` and not `CelProgram`, a bundler like
191+
webpack or Rollup can exclude the unused code.
192+
159193
### How it Works
160194

161195
When you build this project:

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,8 @@
4747
"defaults": true,
4848
"additional": [
4949
"aarch64-apple-darwin",
50-
"aarch64-linux-android",
5150
"aarch64-unknown-linux-gnu",
5251
"aarch64-pc-windows-msvc",
53-
"armv7-linux-androideabi",
5452
"x86_64-unknown-linux-gnu",
5553
"x86_64-apple-darwin",
5654
"x86_64-pc-windows-msvc"

0 commit comments

Comments
 (0)