Skip to content

Release core(0.16.0) rpc-streamer(0.1.0)#56

Merged
fazzatti merged 237 commits intomainfrom
dev
Feb 4, 2026
Merged

Release core(0.16.0) rpc-streamer(0.1.0)#56
fazzatti merged 237 commits intomainfrom
dev

Conversation

@fazzatti
Copy link
Owner

@fazzatti fazzatti commented Feb 4, 2026

This pull request introduces a new, feature-rich @memoize decorator for caching getter and method results in the codebase, along with its supporting types. It also makes several improvements to environment variable handling, test fixtures, and minor workflow corrections. The most significant changes are grouped below.

New Memoization Decorator:

  • Added a fully documented @memoize decorator in core/common/decorators/memoize/index.ts that supports per-instance caching for getters and methods, optional TTL (time-to-live), active eviction, custom key functions, and can be disabled for testing or debugging.
  • Introduced comprehensive type definitions for the memoize decorator in core/common/decorators/memoize/types.ts, enforcing correct option usage and improving type safety.
  • Re-exported the new decorator and its types from core/common/decorators/index.ts.

Environment Variable Handling:

  • Added QUASAR_API_KEY support for enhanced test rate limits, including documentation in .env.example, loading logic in _internal/env/loadEnv.ts, and export in _internal/env/index.ts. [1] [2] [3]
  • Updated the Deno test workflow to inject QUASAR_API_KEY from GitHub secrets.

Test and Utility Improvements:

  • Added // deno-coverage-ignore-file to various internal test and utility files to exclude them from coverage reports, reducing noise and improving coverage accuracy. [1] [2] [3] [4] [5] [6]
  • Introduced a new fixture loader for multi-version RPC ledger responses in _internal/tests/fixtures/rpc/get_ledgers/index.ts, supporting different LedgerCloseMeta versions and providing grouped fixture loading helpers.

Minor Corrections:

  • Fixed a package check in the publish workflow from event-streamer to rpc-streamer for accuracy.
  • Updated import in core/common/helpers/calculate-contract-id.ts to use the local StrKey implementation instead of the one from stellar-sdk.

…uthEntry functions for SorobanAuthorizationEntry handling
- Add `parseScVal` function to convert XDR ScVal to TypeScript-friendly values.
- Introduce utility functions: `getScValTypeName`, `isScValRecord`, `isScValMap`, and `asUnion` for type checking and parsing.
- Implement `parseScVals` for batch parsing of ScVal arrays.
- Create `softTryToXDR` utility to safely convert values to XDR format.
- Add comprehensive unit tests for ScVal parsing and utility functions.
- Remove redundant ScVal types from `core/common/scval/types.ts` and consolidate in `core/common/helpers/xdr/types.ts`.
- Added Transaction class to handle transaction metadata and operations parsing.
- Implemented factory methods for creating Transaction instances from metadata.
- Introduced memoization for performance optimization on frequently accessed properties.
- Added comprehensive unit tests for Transaction class covering various scenarios and envelope types.
- Created types for Ledger, Transaction, and Operation for better type safety and clarity.
- Updated module exports to include new ledger-parser functionalities.
- Implemented LedgerStreamer class to support live and historical ingestion of Stellar ledgers.
- Added methods for starting live, archive, and automatic streaming modes.
- Introduced configuration options for batch size, wait intervals, and error handling.
- Created type definitions for handlers and options related to ledger streaming.
feat: add Event Streamer variant with type definitions

- Introduced `EventStreamerOptions` and `EventStreamerConfig` interfaces for event streaming configuration.
- Created a new file `types.ts` under `rpc-streamer/src/variants/event/`.

feat: implement Ledger Streamer variant with integration and unit tests

- Added `createLedgerStreamer` function to handle live and archive ingestion of ledgers.
- Implemented integration tests for the Ledger Streamer in `index.integration.test.ts`.
- Created unit tests for the Ledger Streamer ingestors in `index.unit.test.ts`.
- Defined `LedgerStreamerOptions` and `LedgerStreamerConfig` interfaces for ledger streaming configuration.
- Added necessary mock helpers and test cases to ensure proper functionality and error handling.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR releases version 0.16.0 of @colibri/core and introduces version 0.1.0 of @colibri/rpc-streamer (previously @colibri/event-streamer). The changes include:

Changes:

  • Renamed and refactored event-streamer package to rpc-streamer with a generic streaming architecture
  • Added new ledger-parser module to core for lazy XDR parsing of ledgers, transactions, and operations
  • Refactored XDR helper functions from a monolithic file into modular, well-typed components with proper error handling

Reviewed changes

Copilot reviewed 100 out of 105 changed files in this pull request and generated no comments.

Show a summary per file
File Description
rpc-streamer/* New generic RPC streaming framework with ledger and event variants
core/ledger-parser/* New lazy XDR parser for ledgers, transactions, and operations
core/common/helpers/xdr/* Refactored XDR helpers into separate files with typed errors
core/common/decorators/memoize/* New memoize decorator for caching getter/method results
core/network/providers/* Updated network providers with archive RPC support
deno.json Updated workspace to reference rpc-streamer instead of event-streamer
.github/workflows/* Updated CI/CD to use new package names and API keys

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Feb 4, 2026

Codecov Report

❌ Patch coverage is 99.55090% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 99.51%. Comparing base (7441242) to head (fd162a8).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
core/common/helpers/xdr/ensure-xdr-type.ts 85.00% 3 Missing ⚠️
.../helpers/xdr/get-address-signer-from-auth-entry.ts 87.50% 3 Missing ⚠️
...on/helpers/xdr/get-address-type-from-auth-entry.ts 72.72% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #56      +/-   ##
==========================================
+ Coverage   99.42%   99.51%   +0.09%     
==========================================
  Files         162      174      +12     
  Lines        9350    10580    +1230     
  Branches     1028     1239     +211     
==========================================
+ Hits         9296    10529    +1233     
+ Misses         54       51       -3     
Flag Coverage Δ
unittests 99.51% <99.55%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
core/common/decorators/index.ts 100.00% <100.00%> (ø)
core/common/decorators/memoize/index.ts 100.00% <100.00%> (ø)
core/common/helpers/calculate-contract-id.ts 100.00% <100.00%> (ø)
core/common/helpers/get-transaction-response.ts 59.15% <100.00%> (ø)
core/common/helpers/transaction.ts 100.00% <100.00%> (ø)
core/common/helpers/xdr/error.ts 100.00% <100.00%> (ø)
core/common/helpers/xdr/index.ts 100.00% <100.00%> (ø)
core/common/helpers/xdr/parse-account-id.ts 100.00% <100.00%> (ø)
core/common/helpers/xdr/parse-asset.ts 100.00% <100.00%> (ø)
...ore/common/helpers/xdr/parse-change-trust-asset.ts 100.00% <100.00%> (ø)
... and 29 more

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fazzatti fazzatti merged commit e8e9d20 into main Feb 4, 2026
4 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.

2 participants