Skip to content

Commit 68a7e71

Browse files
fix: fix native import
1 parent ca3b242 commit 68a7e71

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ calculations, and variable substitutions. CEL is used in various Google products
1414
and open-source projects for policy enforcement, configuration validation, and
1515
business rule evaluation.
1616

17+
## Installation
18+
19+
```bash
20+
npm install cel-typescript
21+
```
22+
23+
This package includes pre-compiled native binaries for multiple platforms:
24+
- macOS (x64, arm64)
25+
- Linux (x64, arm64)
26+
- Windows (x64)
27+
- Android (arm64, armv7)
28+
29+
The appropriate binary for your platform will be automatically loaded at runtime.
30+
1731
## Usage
1832

1933
See the full [language definition][lang-def] for a complete overview of CEL.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
".": {
77
"import": "./dist/src/index.js",
88
"types": "./dist/src/index.d.ts"
9+
},
10+
"./native": {
11+
"import": "./index.js"
912
}
1013
},
1114
"types": "./dist/src/index.d.ts",

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class CelProgram {
3333
static async compile(source: string): Promise<CelProgram> {
3434
if (!CelProgram.nativeModule) {
3535
// Use the NAPI-RS generated loader which handles platform detection
36-
const nativeBinding = await import("../index.js");
36+
const nativeBinding = await import("cel-typescript/native");
3737
CelProgram.nativeModule = nativeBinding.CelProgram;
3838
console.log("Imported native CelProgram:", CelProgram.nativeModule);
3939
}

0 commit comments

Comments
 (0)