Skip to content

v.1.2.0

Choose a tag to compare

@abiwab abiwab released this 22 Aug 14:48
· 235 commits to main since this release

✨ New Features

  • Parser & Kitchen: Introduced modular recipes and multi-file imports via the @use directive:
    • Import external base recipes directly into a recipe using @use "./bases/shortcrust-pastry.gram" as &shortcrust.
    • Imported steps seamlessly interleave into the global ALAP scheduling timeline, preserving resting times and dependencies.
    • Automatically scales imported base quantities when referenced with specific yields (e.g. &shortcrust{250g} halves a 500 g base recipe).
    • Supports destructured multi-yield imports (e.g. @use "./bases/tart-elements.gram" as { &crust, &frangipane }) scaling each component independently.
    • Supports multi-word bindings using bracket notation (e.g. @use "..." as &pastry dough{}).
    • Resolves project-root paths (@/bases/...) and custom path aliases defined under paths: in .gram/config.yaml.
    • Added --stock CLI flag to treat pre-made base imports as stock items (zero timeline overhead, single shopping list line, retaining full nutritional totals).
    • Supports retro-planning timeline offsets directly on @use import lines (e.g. @use "./bases/levain-starter.gram" as &starter ~{-2d}).
    • Spliced sections in HTML, Markdown, and print outputs display origin badges crediting their source module.
    • gram diff and gram watch now track import additions, removals, rebinding, rescaling, and dependency file changes.
    • Language Server and VS Code extension support live dependency composition, Go to Definition into base files, path auto-completion, and quick-fix diagnostics for missing exports.
    • Exported createMemoryHost from @gram-lang/modules for browser and in-memory module graph resolution.
    • Corrected whole-recipe mass and nutrition totals to accurately include spliced intermediate (-> &) masses.
    • Normalized rescaled ingredient quantities to one decimal place for display consistency across all outputs.
  • CLI: Added automatic update checking and a new gram upgrade command:
    • gram now checks npm in the background and prints a short "update available" notice after a command finishes (skipped in CI and non-interactive runs).
    • Added gram upgrade to check for and install the latest version on demand — it always performs a fresh check and asks for confirmation before running the install.
    • Added an updateCheck: false setting in config.yaml (or the GRAM_NO_UPDATE_CHECK environment variable for a single run) to opt out of the passive notice.
  • Parser & Kitchen: Composite ingredients written with a short, generic child name (like @juice<@lemon) are now protected against a silent ingredient-database mix-up:
    • The compiler now warns when the same short composite name (e.g. "juice") is drawn from two different parents within one recipe (lemon in one step, orange in another) — until now this went unnoticed and the two usages silently shared one entry in the ingredient database.
    • gram db sync reports the same conflict across your whole recipe collection, so two unrelated recipes that happen to use the same generic composite name don't overwrite each other's nutrition and density data.
    • The AI recipe importer (gram import) now writes composite ingredients with their full name (e.g. "lemon juice") instead of a short generic one, so newly imported recipes don't create this conflict in the first place.

🐛 Bug Fixes & Improvements

  • Parser & Kitchen: Fixed gram scale (and any other caller that re-scales an already-compiled recipe) silently leaving alternative ingredient groups (@butter|@margarine) and composite parent-draw quantities (@egg-yolks{2}<@eggs{3}) unscaled.
  • Parser & Kitchen: Improved clarity and tone for diagnostic messages and revised severity tiers:
    • Reworded compiler and module diagnostic messages to provide actionable guidance and avoid alarmist phrasing for standard culinary approximations.
    • Reclassified non-critical notices (MISSING_MACROS, UNKNOWN_MASS, TRACK_CONTENTION) to info severity so they do not clutter warning counters.
    • Enhanced Playground and editor diagnostic styling with dedicated color schemes for errors (red), warnings (amber), and notices (blue).
  • Language Server: Normalized error states and unified diagnostic handling across Playground and VSCode extensions:
    • Unified Playground diagnostics into a centralized full-width debug console with filter pills and interactive jump-to-location navigation.
    • Added mobile segmented tab navigation ([Editor] / [Preview]) and responsive single-row toolbar layout for mobile viewports.
    • Resolved nutrition diagnostics disconnection in the analyzer by merging physical and nutritional warnings into primary compiler warnings — the editor only turns these into squiggles when they carry a real position, so an incomplete-nutrition notice no longer misplaces itself at the top of the file.
    • Markdown and print HTML exports keep their explicit "incomplete data" note next to the affected nutrition figures; the interactive HTML preview conveys the same gap through its coverage badge instead.
    • A scale-target that fails to resolve (e.g. an unconvertible unit) now correctly turns the Playground's status badge and error panel red instead of being undersold as a warning, without marking the file tab as if the recipe itself had a syntax error.
    • The Playground diagnostics console no longer gets stuck filtered on a category that just emptied out (e.g. after fixing the warning it was showing).
    • Resolved silent compilation failures in the Language Server by capturing pipeline exceptions and pushing actionable error notifications to webviews — including when the thrown error carries no message, which previously slipped past the check silently.
    • A compile-time failure (parses fine, but compile()/analyze() throws) now also surfaces as an editor diagnostic, not only as a webview notification, so it's still visible with the preview panel closed.
    • Added bidirectional webview messaging in the VSCode extension to jump directly to error offsets in the active editor.
    • Localized the Playground diagnostics console's collapse/expand tooltip, previously hardcoded in French regardless of site locale.
  • Parser & Kitchen: Fixed a false circular reference warning when multiple sections used percentage-of formulas on same-named ingredients by scoping cycle detection per section.