Skip to content

feat!: switch native bindings from Neon to napi-rs#19

Merged
mcarvin8 merged 1 commit into
mainfrom
cursor/switch-bindings-from-neon-to-napi-rs
May 13, 2026
Merged

feat!: switch native bindings from Neon to napi-rs#19
mcarvin8 merged 1 commit into
mainfrom
cursor/switch-bindings-from-neon-to-napi-rs

Conversation

@mcarvin8
Copy link
Copy Markdown
Owner

Migrate the Rust crate to napi-rs 3.x and adopt the canonical per-platform optional-dependency distribution model so the release workflow no longer hand-rolls cross-compile toolchains.

  • Rewrite src/lib.rs using #[napi] / #[napi(object)]; preserve the DisassembleXMLFileHandler / ReassembleXMLFileHandler / DisassembleConfigFileHandler / ReassembleConfigFileHandler class+method shape via js_name overrides so the public JS API is unchanged.
  • Drop the hand-written TS wrapper, resolveNativeDir helper, rollup config, cargo-cp-artifact, and scripts/build-native.js; index.js and index.d.ts are now generated by napi build at the repo root.
  • release.yml: one matrix entry per Rust triple, Linux cross via --use-napi-cross, publish via napi create-npm-dirs / artifacts / prepublish; new platforms now require only one matrix line and one napi.targets entry. Preserves release-please gating and the NODE_AUTH_TOKEN="" + --provenance npm publish pattern.
  • Replace linux-ia32 (i686-unknown-linux-gnu, not supported by napi-rs) with win32-ia32 (i686-pc-windows-msvc).
  • Update tests to import from package root; refresh vitest/tsconfig/.gitignore/.npmignore/README for the new layout.

Migrate the Rust crate to napi-rs 3.x and adopt the canonical
per-platform optional-dependency distribution model so the release
workflow no longer hand-rolls cross-compile toolchains.

- Rewrite src/lib.rs using #[napi] / #[napi(object)]; preserve the
  DisassembleXMLFileHandler / ReassembleXMLFileHandler /
  DisassembleConfigFileHandler / ReassembleConfigFileHandler
  class+method shape via js_name overrides so the public JS API is
  unchanged.
- Drop the hand-written TS wrapper, resolveNativeDir helper, rollup
  config, cargo-cp-artifact, and scripts/build-native.js; index.js
  and index.d.ts are now generated by `napi build` at the repo root.
- release.yml: one matrix entry per Rust triple, Linux cross via
  --use-napi-cross, publish via napi create-npm-dirs / artifacts /
  prepublish; new platforms now require only one matrix line and one
  napi.targets entry. Preserves release-please gating and the
  NODE_AUTH_TOKEN="" + --provenance npm publish pattern.
- Replace linux-ia32 (i686-unknown-linux-gnu, not supported by
  napi-rs) with win32-ia32 (i686-pc-windows-msvc).
- Update tests to import from package root; refresh
  vitest/tsconfig/.gitignore/.npmignore/README for the new layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
@mcarvin8 mcarvin8 merged commit a7233cb into main May 13, 2026
3 checks passed
@mcarvin8 mcarvin8 deleted the cursor/switch-bindings-from-neon-to-napi-rs branch May 13, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant