5 Commits
Author SHA1 Message Date
stefan-gorules 73c8fda788 fix: nodejs wasm root package (#545)
* build(nodejs): declare the wasm32-wasip1 package as an optional dependency

cli 3.10 drops WASI packages from the root optionalDependencies when native targets exist, which would leave browser.js importing an uninstalled package. Ignore and clear the root facades pre-publish now generates.

* build(nodejs): keep the root package free of the threadless wasm facade

napi prepublish copies the 15.6MB wasm into the root package and rewrites files and exports for workerd consumers. Run it through prepublish.mjs, which keeps its optionalDependencies but restores files and exports and removes the generated root files, so the root tarball is back to ~20kB.
2026-10-13 13:54:44 +02:00
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
stefan-gorules b4b59eb7c5 feat: policy dictionary (#479)
* feat: policy dictionary

* remove enum references

* improve tests

* reset index.js and package.json
2026-07-08 13:21:03 +02:00
stefan-gorules 6858c1bd04 feat: natural language (#477)
* feat: natural language

* fix cargo fmt
2026-07-07 13:12:46 +02:00
stefan-gorulesandIvan Miletic 922a262e98 feat: wasm support (#404)
* feat: wasm support

* add http callback

* streamline structs

* fix: wasm workflow

* fix: wasi path

* fix: wasm

* fix: wasm path

* fix: clang dev

* fix: libclang static

* fix: build

* fix: node

* fix: wasm

* fix: wasm wasi

* fix: npm dirs

* fix: node workflow

* fix: testing

* fix: test

* update version

* fix: targets

* fix: wasm fix

* fix: commit files

---------

Co-authored-by: Ivan Miletic <vnmiletic@gmail.com>
2025-11-13 12:36:59 +01:00