Skip to content

Conversation

@OttoAllmendinger
Copy link
Contributor

This PR adds ESM as the primary module format while maintaining CJS
compatibility for the wasm-utxo package. It also enhances TypeScript
configuration and improves the UI module by replacing utxolib dependencies.

Changes

  • Set "type": "module" in package.json with dual ESM/CJS output
  • Configure proper exports field for module resolution
  • Add .js extensions to imports for ESM compatibility
  • Update build scripts for both ESM and CJS outputs
  • Configure tests to work with ESM imports
  • Add bundler compatibility tests for both formats
  • Update mocha config for ESM testing
  • Emit compiled code directly to dist directory for both formats
  • Add composite flag for project references
  • Replace utxolib in UI package with wasm-utxo address functions
  • Update address generation to use fromOutputScriptWithCoin

Issue: esm-first.2

@OttoAllmendinger OttoAllmendinger force-pushed the BTC-2786.esm-first branch 2 times, most recently from ff64385 to 278ee57 Compare November 19, 2025 11:50
OttoAllmendinger and others added 2 commits November 19, 2025 12:55
This change migrates the package to use ESM as the primary format while
maintaining compatibility with CommonJS consumers. Key changes:

- Set "type": "module" in package.json
- Configure dual ESM/CJS output with proper exports field
- Add .js extensions to all imports for ESM compatibility
- Update build scripts to create both ESM and CJS outputs
- Configure tests to work with ESM imports
- Add bundler compatibility tests for both ESM and CJS usage
- Update mocha config for ESM testing

Issue: esm-first.2

Co-authored-by: llm-git <llm-git@ttll.de>
Replace utxolib dependency with address utilities from @bitgo/wasm-utxo,
simplifying the UI module by removing external dependency. Update address
generation to use fromOutputScriptWithCoin instead of fromOutputScript.

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger changed the title feat(wasm-utxo): add ESM support with TypeScript improvements feat(wasm-utxo): convert to esm-first package Nov 19, 2025
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review November 19, 2025 12:02
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner November 19, 2025 12:02
@lcovar lcovar merged commit 025da4c into master Nov 19, 2025
1 check passed
@lcovar lcovar deleted the BTC-2786.esm-first branch November 19, 2025 18:00
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.

3 participants