-
Notifications
You must be signed in to change notification settings - Fork 300
fix: resolve Node.js 22.18.0 compatibility issues #6766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- 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
| "stream-browserify": "^3.0.0", | ||
| "stream-http": "^3.2.0", | ||
| "terser-webpack-plugin": "^5.3.3", | ||
| "ts-node": "10.8.0", |
There was a problem hiding this comment.
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`; |
There was a problem hiding this comment.
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?
c60ee34 to
a498aa3
Compare
Please review commit-by-commit.
Note, there is a breaking change in statics (removal of enums).
TICKET: WP-5599