Issue #2207: nikaia bind js writes the WebAssembly library’s .js and .d.ts

Open and answer this issue on GitHub.

targets, blocked · opened 2026-11-19 · updated 2026-11-19 · 0 comments

Goal

nikaia bind js writes the JavaScript binding of a library: the WebAssembly build’s <package>.js and <package>.d.ts (ADR-284 D26, D28). This is the only part of “A binding is a generated file over the C library” (#112) that is not built. #112 is closed, and this issue carries the rest.

Found while tidying up “A library for other languages” (#88). Needs #111

Today

Decision

ADR-284 D26: nikaia bind js is D22’s .js and .d.ts. D28: JavaScript is served by the WebAssembly build; nikaia bind node stays the native shim for file and socket access. D29: a binding never widens what the library exports. No new decision is needed.

To build

  1. cli_commands_bind_refusal accepts js. nikaia bind js on a c-library package builds the package for wasm32-unknown and leaves <package>.js and <package>.d.ts beside the .wasm in target/nikaia/c-library/, carrying the ledger hash as the header does (D26). Whether this sets the target itself or refuses without target = "wasm32-unknown" is the builder’s choice; the refusal, if chosen, names the setting. Test: tests/compiler/tests/bind_js_writes_the_wasm_librarys_js_and_dts.nika with .stdout, in the style of bind_java_writes_a_class_per_handle_and_a_record_per_struct.nika. It binds a small package and prints the exported names in the .d.ts.
  2. nikaia bind --help and the refusal text in cli_commands_bind_refusal name js among the built languages.

Done when

nikaia bind js on a c-library package writes <package>.js and <package>.d.ts with the package’s entry points, and the test in item 1 shows them. The commit of item 1 carries Fixes #N. The report gives one Found: line per finding.

Files

Back to Open Issues