Bakery for code. Breads are features, unit tests are yeast, CI is the oven, croissants are premium features, stale bread is legacy.
  • JavaScript 100%
Find a file
2026-06-30 11:12:48 +00:00
node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709 fix: e2e tests now use CommonJS require for node --test compatibility 2026-06-30 11:12:45 +00:00
src feat(#1): bakery engine — recipes, dough, oven, display case, bakers, ASCII storefront 2026-06-14 23:14:36 +00:00
tests fix: e2e tests now use CommonJS require for node --test compatibility 2026-06-30 11:12:45 +00:00
package.json feat(#1): bakery engine — recipes, dough, oven, display case, bakers, ASCII storefront 2026-06-14 23:14:36 +00:00
README.md feat(#1): bakery engine — recipes, dough, oven, display case, bakers, ASCII storefront 2026-06-14 23:14:36 +00:00

code-bakery

Bakery for code. Breads are features, unit tests are yeast, CI is the oven, croissants are premium features, stale bread is legacy.

Usage

const { Bakery } = require('./src/bakery');

const bakery = new Bakery('Les Pains du Code');
bakery.hireBaker('Alice', 'sourdough');
bakery.addRecipe('chocolate-cake', { type: 'pastry', basePrice: 8.00, isPremium: true });

// Full pipeline: prepare -> knead -> bake -> stock
bakery.bakeRecipe('sourdough', 'Alice');

// Sell
bakery.sell('sourdough');

// View storefront
console.log(bakery.storefront());

// Reports
console.log(bakery.salesReport());
console.log(bakery.freshnessReport());

Components

  • RecipeBook — 7 default recipes (sourdough, baguette, croissant, rye, brioche, focaccia, ciabatta)
  • Dough — Kneading system with quality, yeast (tests), baker skill bonuses
  • Oven — Temperature-controlled baking with burn risk at high temps
  • DisplayCase — Freshness tracking, aging, stale eviction, 20-item capacity
  • Baker — 5 specialties, skill progression (apprentice -> master), experience system