Skip to content

Commit 834b775

Browse files
fix: update build command and improve docs
1 parent 0ce8f2f commit 834b775

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

README.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
# cel-typescript
22

33
A TypeScript binding for the Common Expression Language (CEL) using
4-
[cel-rust](https://github.com/clarkmcc/cel-rust). This project provides a
4+
[cel-rust][cel-rust]. This project provides a
55
Node.js native module that allows you to use CEL in your TypeScript/JavaScript
66
projects.
77

8+
[cel-spec]: https://github.com/google/cel-spec
9+
[cel-rust]: https://github.com/clarkmcc/cel-rust
10+
811
## What is CEL?
912

10-
[Common Expression Language (CEL)](https://github.com/google/cel-spec) is an
13+
[Common Expression Language (CEL)][cel-spec] is an
1114
expression language created by Google that implements common semantics for
1215
expression evaluation. It's a simple language for expressing boolean conditions,
1316
calculations, and variable substitutions. CEL is used in various Google products
@@ -20,17 +23,7 @@ business rule evaluation.
2023
npm install @kevinmichaelchen/cel-typescript
2124
```
2225

23-
**Requirements:**
24-
25-
- Node.js 18 or later
26-
27-
This package includes pre-compiled native binaries for the following platforms:
28-
- macOS (Apple Silicon and Intel)
29-
- Linux (x86_64 and ARM64)
30-
- Windows (x86_64)
31-
32-
The appropriate binary for your platform will be automatically loaded at
33-
runtime.
26+
Node.js 18 or later is required.
3427

3528
## Usage
3629

@@ -168,16 +161,20 @@ pre-compiled native binaries for all supported platforms:
168161
However, when you install this package, npm will only extract the `.node` file
169162
for your platform. For example:
170163

171-
- On an M1/M2 Mac, only `cel-typescript.darwin-arm64.node` (~7.4 MB) is used
164+
- On Apple Silicon, only `cel-typescript.darwin-arm64.node` (~7.4 MB) is used
172165
- On Windows, only `cel-typescript.win32-x64.node` is used
173166
- On Linux, only `cel-typescript.linux-x64.node` or
174167
`cel-typescript.linux-arm64.node` is used
175168

176-
This is a common pattern for packages with native bindings. For comparison:
169+
This is sometimes a pattern for packages with native bindings. For comparison:
170+
171+
- [`better-sqlite3`][better-sqlite3]: 10.2 MB unpacked
172+
- [`canvas`][canvas]: 408 kB unpacked
173+
- [`sharp`][sharp]: 522 kB unpacked
177174

178-
- `sharp` (image processing): 39.7 MB unpacked
179-
- `better-sqlite3`: 12.8 MB unpacked
180-
- `canvas`: 8.9 MB unpacked
175+
[better-sqlite3]: https://www.npmjs.com/package/better-sqlite3
176+
[canvas]: https://www.npmjs.com/package/canvas
177+
[sharp]: https://www.npmjs.com/package/sharp
181178

182179
#### A Note on Tree-Shaking
183180

project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"build:native": {
66
"executor": "nx:run-commands",
77
"options": {
8-
"command": "npx @napi-rs/cli build --target {args.target} --release"
8+
"command": "npx @napi-rs/cli build --platform --target {args.target} --release --zig"
99
},
1010
"outputs": [
1111
"{workspaceRoot}/cel-typescript.darwin-arm64.node",

0 commit comments

Comments
 (0)