• v.0.10.0-alpha 498f234812

    v.0.10.0-alpha Pre-release

    abiwab released this 2026-06-14 15:06:01 +02:00 | 451 commits to main since this release

    Release Notes - v0.10.0

    Building a Solid Foundation: Bun, Zod, and Safety First

    This release focuses on reinforcing the core architecture before expanding the feature set any further. If v0.9.0 was about cleaning up the codebase, v0.10.0 is about making sure the system is robust, strictly typed, and safe from runtime crashes.

    Going All-In on Bun

    I have fully committed to the Bun ecosystem. The entire project has been migrated to a full Bun workspace environment (using workspace:* dependencies). To ensure the compiler output remains absolutely predictable as we evolve, I've also introduced Bun snapshot testing. We'll now know immediately if a future code change inadvertently alters the output structure.

    Say Hello to Zod

    I've added Zod to the stack to strictly validate data at runtime. Previously, if you fed the system some questionable or malformed data, it might crash spectacularly deep down the compilation pipeline. Now, Zod acts as a strict bouncer at the door: it catches invalid data early, ensures strict AST typing, and prevents silent failures.

    Expanding the @gram Ecosystem

    The architectural split I started in the previous release continues. Keeping the core lean is the goal, so I've created two new packages:

    • @gram/i18n: Unit translations and normalizations used to be awkwardly duplicated between the compiler and the analyzer. They now live in their own centralized internationalization package.
    • @gram/renderer: HTML and Markdown generation have been extracted into this new dedicated package. The core compiler shouldn't be the one worrying about DOM elements and formatting tags.

    What's New & what's Fixed

    Mathematics & Fractions

    • Aggregation Bug Fixed: There was a pesky bug where composite child ingredients using fractions (e.g., @zest{1/2}) were aggressively aggregating to a flat 0 in the final shopping list. A new unified getNumericQty utility now safely extracts numeric values across the entire codebase to prevent this.
    • Smart Fractions Formatting: Decimal values strictly below 1 (e.g., 0.5, 0.25) will now format cleanly as standard fractions (1/2, 1/4) in the shopping list. Meanwhile, values 1 and above will keep their standard decimal formatting (like 1.5 kg).

    Under the Hood Improvements

    • AST Refactoring: The Abstract Syntax Tree (AST) processing has been significantly refactored. Recipe elements are now identified via standardized constants across the system to prevent typos and improve maintainability.
    • Consistent Warnings: The warning system has been entirely standardized to provide reliable and helpful error messages across all tools.
    • Cleaner Build Pipeline: Improved parser stability and stripped out some complex, legacy build workarounds that were previously required for web environments.
    Downloads