Files
zen/bindings/nodejs/package.json
T
stefan-gorules c8692c401d fix: threadless wasm (#543)
* feat(nodejs): replace the threaded wasm build with threadless wasm32-wasip1

The browser binding no longer needs SharedArrayBuffer or cross-origin isolation. napi moves to 3.14 / cli 3.10.8 with emnapi 2.0.0-alpha.6; the wasm build registers napi-async-runtime's current-thread backend and spawns each evaluation as a runtime task. console.sleep goes through a sleep provider so the wasm build waits on the host timer instead of tokio. CI and the Makefile build and publish @gorules/zen-engine-wasm32-wasip1 in place of the threaded package.

* ci(nodejs): test the wasm32-wasip1 binding and load test binaries in place

cli 3.10 rejects napi artifacts when any configured target is missing, so test jobs download their binary next to index.js instead of building npm dirs. A wasm test job runs the suite against the threadless binding and gates the release.

* chore(nodejs): stop tracking generated wasip1 loaders

napi build writes them alongside the wasm and CI ships them through the wasm artifact, like index.d.ts.

* ci(nodejs): build the glibc legs with cargo zigbuild directly

cli 3.10 runs cargo metadata with the requested target, which rejects the zigbuild glibc suffix. Matches the go and uniffi workflows.

* build(nodejs): keep dev dependencies installable on node 20

@octokit/request 10.0.16 (via @napi-rs/cli) pulls content-type 3, which requires node 22; pin the cli's copy to 10.0.14.
2026-10-13 12:30:29 +02:00

112 lines
3.0 KiB
JSON

{
"name": "@gorules/zen-engine",
"description": "Open-source Business Rules Engine for Node.js, powered by Rust",
"version": "2.1.4",
"main": "index.js",
"browser": "browser.js",
"types": "./index.d.ts",
"license": "MIT",
"typings": "index.d.ts",
"files": [
"index.js",
"index.d.ts",
"browser.js",
"ts-support.js",
"ts-support.d.ts",
"README.md"
],
"packageManager": "yarn@1.22.22",
"napi": {
"binaryName": "zen-engine",
"targets": [
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-musl",
"x86_64-pc-windows-msvc",
"aarch64-unknown-linux-gnu",
"aarch64-unknown-linux-musl",
"aarch64-apple-darwin",
"wasm32-wasip1"
],
"dtsHeaderFile": "./dts-header.d.ts",
"npmClient": "yarn",
"wasm": {
"initialMemory": 1024,
"maximumMemory": 16384,
"browser": {
"fs": false,
"asyncInit": true
},
"asyncRuntime": true
}
},
"keywords": [
"gorules",
"zen-engine",
"business rules engine",
"rules engine",
"rule engine",
"bre",
"rule",
"rules",
"engine",
"decision",
"decision table",
"rust",
"N-API",
"napi-rs",
"node-rs"
],
"author": "GoRules <hi@gorules.io> (https://gorules.io)",
"homepage": "https://gorules.io",
"engines": {
"node": ">= 14"
},
"devDependencies": {
"@emnapi/core": "2.0.0-alpha.6",
"@emnapi/runtime": "2.0.0-alpha.6",
"@jest/globals": "^30.2.0",
"@napi-rs/async-runtime": "^0.2.0",
"@napi-rs/cli": "^3.10.8",
"@napi-rs/wasm-runtime": "^1.2.5",
"@types/express": "^5.0.5",
"@types/node": "^24.10.0",
"babel-jest": "^30.2.0",
"cross-env": "^10.1.0",
"emnapi": "2.0.0-alpha.6",
"express": "^5.1.0",
"jest": "^30.2.0",
"lerna": "6.6.2",
"ts-jest": "^29.4.5",
"ts-node": "^10.9.2",
"tslib": "^2.8.1",
"typescript": "^5.9.3"
},
"bugs": {
"url": "https://github.com/gorules/zen/issues"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"repository": {
"type": "git",
"url": "git+https://github.com/gorules/zen.git"
},
"scripts": {
"build": "napi build --platform --release --dts index.d.ts",
"build:debug": "napi build --platform --js index.js --dts index.d.ts",
"watch": "cargo watch --ignore '{index.js,index.d.ts}' -- npm run build:debug",
"test": "cross-env __ZEN_MOCK_UTC_TIME=2025-08-19T16:55:02.078Z jest",
"test:wasm": "cross-env NAPI_RS_FORCE_WASI=error NAPI_RS_WASI_FLAVOR=wasm32-wasip1 __ZEN_MOCK_UTC_TIME=2025-08-19T16:55:02.078Z jest -c jest.wasm.config.js",
"artifacts": "napi artifacts -d ../../artifacts",
"createNpmDirs": "napi create-npm-dirs && node enrich-npm-dirs.mjs",
"prepublishOnly": "napi prepublish --no-gh-release",
"version": "napi version"
},
"resolutions": {
"form-data@^4.0.0": "4.0.4",
"@napi-rs/cli/**/@octokit/request": "10.0.14"
}
}