Skip to content

Conversation

@zahin-mohammad
Copy link
Contributor

@zahin-mohammad zahin-mohammad commented Aug 20, 2025

Please review commit-by-commit.

Note, there is a breaking change in statics (removal of enums).

TICKET: WP-5599

- Replace TypeScript import equals syntax with standard ES6 imports
- Convert parameter property constructors to standard syntax
- Fix fastpriorityqueue import for CommonJS compatibility

Resolves CI failures when Node.js 22.x automatically enables experimental
TypeScript support and encounters unsupported syntax patterns.
Please enter the commit message for your changes. Lines starting

TICKET: WP-5599
- Replace ts-node with tsx in mocharc configuration for better Node.js
22.x compatibility
- Fix JSON import in deps test to work with module resolution
- Add tsx as dev dependency

TICKET: WP-5599
- Convert CoinKind, CoinFamily, CoinFeature, and UnderlyingAsset from
enums to const objects
- Add explicit type casts for array operations to maintain type safety
- Update all enum references to use const object pattern
- Required for node 22 strip-only mode

BREAKING CHANGE: CoinKind, CoinFamily, CoinFeature, and UnderlyingAsset
are no longer TypeScript enums. They are now const objects with
corresponding type definitions. This requires consumers to update
their imports if they were using these as enum types.

TICKET: WP-5599
@zahin-mohammad zahin-mohammad changed the title fix(utxo-lib): resolve Node.js 22.x strip-only mode compatibility issues fix: resolve Node.js 22.x compatibility issues Aug 20, 2025
@zahin-mohammad zahin-mohammad changed the title fix: resolve Node.js 22.x compatibility issues fix: resolve Node.js 22.18.0 compatibility issues Aug 20, 2025
"stream-browserify": "^3.0.0",
"stream-http": "^3.2.0",
"terser-webpack-plugin": "^5.3.3",
"ts-node": "10.8.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We should gradually phase out the use of ts-node. Lots of issues stemming from this with recent node versions and ts-node is not actively maintained anymore.

// As returned by https://babylon.nodes.guru/api#/Query/BTCDelegation
const BtcDelegationResponse = t.type({ btc_delegation: BtcDelegation }, 'BtcDelegationResponse');
const filename = __dirname + `/../../../../test/fixtures/babylon/rpc/btc_delegation/testnet.${txid}.json`;
const filename = __dirname + `/../../fixtures/babylon/rpc/btc_delegation/testnet.${txid}.json`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess these tests where not running in CI before this? Or at some point have stopped running in CI?

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.

2 participants