Skip to content

feat(wasm): add JavaScript/WASM bindings and npm publish pipeline#13

Merged
Alex-Wengg merged 1 commit intoFluidInference:mainfrom
damageboy:feat/wasm-js-bindings
Mar 18, 2026
Merged

feat(wasm): add JavaScript/WASM bindings and npm publish pipeline#13
Alex-Wengg merged 1 commit intoFluidInference:mainfrom
damageboy:feat/wasm-js-bindings

Conversation

@damageboy
Copy link
Contributor

@damageboy damageboy commented Mar 18, 2026

Summary

  • Fixes Build a wasm+js for node and web packages out of the rust code #12
  • Add wasm-bindgen bindings exposing all ITN/TN normalize functions + custom rules API to JavaScript
  • Add wasm:build:node, wasm:build:web, wasm:ci, wasm:pack, wasm:publish npm scripts
  • Add CI job to build and smoke-test the WASM target on every push/PR
  • Add npm-publish.yml workflow that publishes @fluidinference/text-processing-rs to npm on v* tags
  • Build artifacts (pkg/, pkg-web/, pkg-node/) are gitignored — CI builds from source

Publishing setup

After merging, one secret needs to be configured for automated npm publishing to work:

1. Create an npm access token

  1. Log in to npmjs.com
  2. Ensure the @fluidinference scope/org exists (or create it under Organizations)
  3. Go to Access TokensGenerate New Token → choose Granular Access Token
    • Expiration: pick a reasonable window (e.g. 1 year)
    • Packages and scopes: select Read and write, scoped to @fluidinference
  4. Copy the token

2. Add the secret to GitHub

  1. Go to repo SettingsSecrets and variablesActions
  2. Click New repository secret
    • Name: NPM_TOKEN
    • Value: paste the token from step 1

3. Publish a release

# Bump version in Cargo.toml and package.json, then:
git tag v0.1.0
git push origin v0.1.0

The Publish WASM Package workflow will build from source, run smoke tests, and npm publish --access public to the registry.

Test plan

  • npm run wasm:ci builds both targets and smoke tests pass locally
  • npm run wasm:pack produces correct tarball contents
  • CI wasm job passes on this PR
  • After merging + configuring NPM_TOKEN, push a v* tag and verify the package appears on npmjs.com

Open with Devin

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 4 additional findings.

Open in Devin Review

@Alex-Wengg Alex-Wengg merged commit 225de85 into FluidInference:main Mar 18, 2026
3 checks passed
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.

Build a wasm+js for node and web packages out of the rust code

2 participants