11 KiB
@gram-lang/i18n
1.0.0
Major Changes
-
Gram v1.0.0 Official Launch! 🎉
This milestone release marks the official 1.0.0 launch of Gram:
- Brand-New Website & Documentation: Rebuilt using Astro and Starlight with refined guides and an integrated blog.
- Refreshed Visual Identity: Brand-new logo.
- Infrastructure & Stability: Monorepo stability, test coverage, and migration to self-hosted Forgejo (
git.gram-lang.org) mirrored to GitHub and Codeberg.
1.0.0-beta.5
Minor Changes
b1aa8db:@gram-lang/i18nnow also owns the numeric conversion factors for units (grams, milliliters, etc.) and time (minutes, hours, etc.), exported asUNIT_CONVERSIONSandTIME_TO_MINUTES— previously split across@gram-lang/analyzerand hardcoded inside@gram-lang/kitchen. No behavior changes; this just puts everything about units and time in one place.79d835c: Food categories now have stable, language-independent keys (CATEGORY_KEYS,CategoryKey,getCategoryLabels,isCategoryKey) instead of only translated display labels. This meansgram db enrichnow stores a category identity that stays consistent regardless of your configured language, rather than a French or English label baked in at write time.
Patch Changes
-
68a2a45: Fixed several French unit words silently resolving to the wrong physical quantity:quart/quartsno longer resolves to the US liquid quart (946 mL) in French recipes — it's a false friend ("un quart d'heure" means "a quarter of an hour", not a unit of volume). It's now reported as an unknown unit instead of silently misinterpreted. The English wordquart/quartsstill works in English recipes; only the spelled-out alias was removed,qtstill works everywhere.livrenow converts using the French "livre métrique" (500 g) instead of being silently treated as the imperial pound (453.592 g) — a ~10% error.tassenow converts using the French cup (250 mL) instead of being silently treated as the US cup (236.588 mL) — a ~6% error.pinteno longer resolves at all: the historical French pinte has no single reliable modern value, so an explicit "unknown unit" is better than a confident-looking wrong number.gallon/gallonsnow resolve correctly (previously only the abbreviationgalworked).
1.0.0-beta.4
Minor Changes
68365c4: Section retro-planning (e.g.## Section ~{-2h}) now enforces a strict signed-duration syntax instead of accepting arbitrary free text, preventing invalid timeline calculations. Added support for thed(day) time unit.
Patch Changes
fc47a86: Renamed thecookTimemetric toidleTimeacross the ecosystem to better reflect hands-off wait time. Additionally, passive timers sharing the same name are now automatically sequenced one after another on the same background track.55430e4: Added detailed per-contribution time breakdowns (Active, Prep, Total) to compiled recipe metrics, and surfaced them as explanatory tooltips on the time summary badges in the HTML renderer.
1.0.0-beta.3
Patch Changes
- Updated deployment configuration to automate npmjs packages publication
1.0.0-beta.2
Minor Changes
a46c24f: Upgraded all monorepo dependencies to their latest versions and implemented a TypeScript 7 dual setup for faster typechecking while preserving compilation toolchain compatibility. Fixed type errors arising from Node 26 and VS Code LSP v10 updates.
Patch Changes
-
f5f1efe: chore: declaresideEffects: falseso bundlers can tree-shake unused exports from these packagesNo package previously declared this, so third-party bundlers had to assume every module might have side effects and couldn't safely drop unused code.
1.0.0-beta.1
Minor Changes
-
a244341: Major overhaul of the documentation and playground infrastructure:- Documentation Rewrite & i18n: The documentation has been completely rewritten, thoroughly verified, and is now fully translated into French (in addition to the English version).
- Advanced Vue 3 Playground: The legacy playground has been removed and rebuilt from the ground up using Vue 3. This new version is directly integrated into the documentation and introduces powerful new features, including recipe scaling and baker's math.
1.0.0-beta.0
Major Changes
-
2dcd766: Introduction of the official GRAM CLI (@gram-lang/cli), a comprehensive command-line tool to manage, compile, and interact with your recipes.Project & Recipe Management:
- Project Setup:
gram initsafely scaffolds a.gramenvironment, including interactive AI provider setup (Google, OpenAI, Anthropic, Ollama) and secret management. - Automated Import:
gram importscrapes recipes from any URL and uses AI to flawlessly translate and convert them into native.gramsyntax. - Validation & Compilation:
gram checkinstantly validates syntax and database integrity.gram buildcompiles recipes to robust JSON with full physical and nutritional enrichment. - Smart Scaling & Diff:
gram scaledynamically resizes recipes (e.g.,--scale flour=300g) with a visual before/after comparison.gram diffprovides a semantic "git diff" for cooking, tracking changes in quantities, timings, and steps. - Export & Print:
gram printgenerates a beautifully typeset A4 HTML recipe card.gram exportconverts recipes to clean Markdown or static HTML. - Auto-formatting & Watcher:
gram formatautomatically enforces.gramlanguage styling standards.gram watchprovides real-time validation upon saving.
Interactive Cooking & Daily Use:
- Terminal Cooking Assistant (
gram cook): A step-by-step interactive TUI (Terminal User Interface) that guides you through the recipe, featuring a dynamic ingredient checklist and live background timers. - Smart Shopping List (
gram shop): Aggregates ingredients across multiple recipes, automatically converting volumes to masses and sorting them by supermarket aisle. - Recipe Search (
gram suggest): An alias-aware search engine to find recipes based on your available ingredients (e.g.,--with "butter, eggs" --without "milk"). - Rich Terminal Preview (
gram view): Renders recipes directly in the terminal with color coding, active timers, and nutritional tables.
AI-Powered Database Management (
gram db):- Smart Database Sync & Enrichment:
gram db syncautomatically tracks new ingredients across your project.gram db enrichuses AI to automatically fill in missing densities, unit weights, categories, and nutrition facts. - Semantic Linting & Conflict Resolution:
gram db lintuses AI to detect plural mistakes and semantic duplicates (e.g.,scallionvsgreen onion).gram db mergehandles conflicts when integrating external community databases.
- Project Setup:
Minor Changes
-
79105ce: Complete overhaul of the VS Code Extension with Language Server, Live Preview, and advanced assistanceMajor New Features:
- Full Language Server (LSP): The extension now ships with a complete language server. All advanced features activate instantly upon opening a
.gramfile. - Dynamic Live Preview: A side-by-side WebView panel displaying the real-time HTML render of the recipe as you type.
- Gracefully handles syntax errors via a visual fallback.
- Integrates the official Playground styles for perfect consistency.
- CodeLens & Inlay Hints:
- Inlay Hints: Displays the cumulative total time in gray next to section titles.
- CodeLens: Clickable buttons
▶ Previewand📊 Macrosabove the main recipe title for quick access.
Ingredient Database & Nutrition:
- Automatic Loading: Automatically detects and loads
.gram/ingredients.yamlfrom the workspace root (or via the path configured ingram.ingredientDatabase.pathsettings). Optimized indexing (O(1)) for maximum performance. - Seamless Plural Management: The extension silently handles plurals (e.g.,
@carrots{3}will automatically matchcarrot). No error diagnostics are raised, everything is transparent. - Nutritional Hover & Macros Panel:
- Hovering over an ingredient displays a complete nutritional table (calories, proteins, carbs, fats, etc.).
- The Live Preview integrates a Macros panel (hidden by default) that can be shown via CodeLens, featuring clear visual alerts for ingredients missing data.
- Fuzzy Matching "Did you mean?": Levenshtein algorithm (distance ≤ 2) suggests corrections if an ingredient is misspelled (e.g.,
@tomaatosuggests@tomato). Directly integrated into Quick Fix code actions. - On-Hover Unit Conversion: Automatically converts volumes (ml, tbsp, etc.) to grams when hovering over an ingredient if its density is known in the database.
Editing Assistance & Navigation:
- Advanced Contextual Autocompletion:
- After
@: Suggests ingredients and their aliases from the YAML database. Automatically adds curly braces{}for multi-word names. - After
&: Suggests only the existing intermediate declarations in the document. - Inside
{}: Suggests canonical units (mass, volume, time) and their aliases (French/English) as soon as a digit is typed.
- After
- Smart Navigation:
- Go to Definition (
Ctrl+Click/F12) on a&refreference to jump to its->&refdeclaration. - Find All References (
Shift+F12) to list all usages of an intermediate. - Rename Symbol (
F2) to atomically rename an intermediate (declaration + references). - Outline Panel showing the hierarchy of sections and elements, with foldable code in the gutter.
- Go to Definition (
- Intermediate Hover: Displays the full text of the step where the intermediate was created.
Diagnostics & Code Actions (Quick Fixes):
- Real-Time Diagnostics:
- Red underline for an orphaned
&refreference. - Warning for an unused
->&refdeclaration. - Warning if the frontmatter (title) is missing.
- Red underline for an orphaned
- Code Actions (💡):
- Quick Fix: Insert the missing
title:in the frontmatter. - Quick Fix: Remove an unused intermediate declaration.
- Quick Fix: Declare a missing intermediate for an existing reference.
- Refactor: Convert a volume quantity to mass directly in the code.
- Refactor: Replace a misspelled ingredient with the closest Fuzzy match suggestion.
- Quick Fix: Insert the missing
Semantic Highlighting, Formatting & Snippets:
- Semantic Tokens: Regex-based syntax highlighting (TextMate) is replaced by AST-driven highlighting. Offers surgical precision for ingredients, timers, temperatures, comments, and nested units (e.g., precise separation of value and unit in
{10g}). - Auto-formatting (
Alt+Shift+F):- Normalization of spaces inside curly braces (
{ 200 g }→{200g}). - Normalization of composite ingredients (
@a < @b→@a<@b). - Alignment of section titles and tab-to-space conversions.
- Normalization of spaces inside curly braces (
- Built-in Snippets: Keyboard shortcuts for the basic structure (frontmatter, sections, steps), ingredient variants (
@ing,@?,@-), cookware (#cw), and timers/temperatures.
- Full Language Server (LSP): The extension now ships with a complete language server. All advanced features activate instantly upon opening a
-
caf1630: Major architecture refactoring, ESM Migration, performance optimizations and code cleanup
0.10.1
Patch Changes
- Cleaned up and updated dependencies.
- Implemented Turborepo to optimize and simplify project building.
0.10.0
Minor Changes
cfda9e1: Refactored unit translation and normalization into a new centralized @gram-lang/i18n package to remove redundancy between the compiler and analyzer.
Patch Changes
3720644: Added Zod to automatically catch invalid data and prevent crashes.