Conversation
Sajjon
commented
Feb 24, 2026
- merge render-pdf into render-typst
- refactor, moving logic from core-invoice which need not be there, into foundation instead
- refactor more file system code into foundation from core-invoice
- move encryption and rate fetcher into foundation
- move more models into foundation
There was a problem hiding this comment.
Pull request overview
This PR performs a major crate reorganization to consolidate functionality and reduce dependencies:
Purpose: Merge render-pdf into render-typst and move reusable logic from core-invoice into foundation to create a cleaner separation of concerns.
Changes:
- Merges the
render-pdfcrate intorender-typst, eliminating the intermediate dependency - Moves encryption, exchange rate fetching, calendar logic, and common models from
core-invoicetofoundation - Refactors file system utilities and RON serialization helpers into
foundation
Reviewed changes
Copilot reviewed 75 out of 89 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
crates/render-typst/src/* |
Absorbs PDF rendering logic from render-pdf, adds typst context modules |
crates/foundation/src/encryption/* |
Encryption utilities moved from core-invoice |
crates/foundation/src/exchange_rates.rs |
Exchange rate fetching moved from core-invoice |
crates/foundation/src/calendar_logic.rs |
Calendar calculations moved from core-invoice |
crates/foundation/src/models/* |
Common models (Date, Day, Month, Year, etc.) moved from core-invoice |
crates/foundation/src/ron.rs |
RON serialization utilities extracted |
crates/foundation/src/runtime.rs |
Runtime/filesystem utilities extracted |
crates/core-invoice/src/* |
Updated to use foundation types with error mapping |
crates/cli/src/migration_guides.rs |
Migration guide logic extracted into separate module |
Cargo.toml |
Removed render-pdf workspace member |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #42 +/- ##
==========================================
+ Coverage 95.06% 96.88% +1.82%
==========================================
Files 101 102 +1
Lines 2207 2217 +10
==========================================
+ Hits 2098 2148 +50
+ Misses 109 69 -40 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
… and functions from `core-invoice` which arent invoice specific into `foundation` crate, including encryption and rate fetching, which are put behind feature flag
1b8ad4a to
03eb3d4
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 76 out of 89 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
crates/foundation/src/models/decimal.rs:56
TryFrom<Decimal> for f64now usesexpect(...)onto_f64(), which can legitimately returnNonefor values outside the representablef64range. This introduces a potential panic in normal code paths (includingSerialize), and also makesModelError::InvalidDecimalToF64Conversioneffectively unused. Prefer returningErr(ModelError::InvalidDecimalToF64Conversion { ... })whento_f64()returnsNoneinstead of panicking.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
crates/render-typst/Cargo.toml
Outdated
| bon.workspace = true | ||
| chrono.workspace = true | ||
| derive_more.workspace = true | ||
| indexmap.workspace = true | ||
| log.workspace = true | ||
| serde_json.workspace = true | ||
| getset.workspace = true | ||
| dirs-next.workspace = true | ||
| thiserror.workspace = true | ||
| typst = "0.13.1" | ||
| typst-kit = "0.13.1" | ||
| typst-pdf = "0.13.1" | ||
| image = { version = "0.25", default-features = false, features = ["png"] } | ||
| image-compare = "0.4.2" |
There was a problem hiding this comment.
Several dependencies appear to be test-only or unused in this crate: image/image-compare are only referenced from src/compare_images.rs (compiled under #[cfg(test)] via lib.rs), and typst-kit, serde_json, bon, and dirs-next don't appear to be referenced in src/. Consider moving image-related crates (and any other test-only crates) to [dev-dependencies] and removing genuinely unused deps to keep the dependency graph minimal for consumers.