import { registerRecipeSource } from "../lib/recipe-sources/recipe-source-registry.js"; import { sevenFiftyGAdapter } from "./750g.js"; import { mangerBougerAdapter } from "./manger-bouger.js"; import { marmitonAdapter } from "./marmiton.js"; import { theMealDbAdapter } from "./the-meal-db.js"; /** * Registers every concrete, *browsable* `RecipeSourceAdapter` this app * ships with into the shared in-memory registry (`recipe-source-registry.ts`) * — `theMealDbAdapter`, `marmitonAdapter`, `sevenFiftyGAdapter` and * `mangerBougerAdapter`. Called once, explicitly, by the two real entry * points that need the registry populated: * * - `server.ts` — the running API process, before it starts listening. * - `prisma/seed.ts` — so `syncRecipeSources` has something to mirror into * the `sources` table (`Source`, household-toggleable — see * `HouseSource`). * * Deliberately **not** imported by `app.ts`: `createApp()` is what every * test file gets via supertest, and registering a real adapter there would * make its presence in the registry depend on test *order* (once * registered at module load, nothing re-registers it after a test's * `clearRecipeSources()` clears it out) instead of each test's own * explicit setup. Tests that need a source in the registry register their * own throwaway fake instead (see e.g. `test/recipe-source-sync.test.ts`). * * `jsonLdRecipeAdapter` (json-ld-recipe.ts) itself is deliberately **not** * registered here — it's a generic schema.org-JSON-LD parser meant to be * specialized per scraped website, not a household-toggleable `Source` in * its own right: nobody can meaningfully "trust" or "enable" a generic * parsing mechanism the way they can a named website. `marmitonAdapter` * (marmiton.ts), `sevenFiftyGAdapter` (750g.ts) and `mangerBougerAdapter` * (manger-bouger.ts) are exactly that specialization, one per site — the * concrete adapters its own doc comment anticipated ("a concrete adapter * for a specific site would use it internally"). */ export function registerAllRecipeSources(): void { registerRecipeSource(theMealDbAdapter); registerRecipeSource(marmitonAdapter); registerRecipeSource(sevenFiftyGAdapter); registerRecipeSource(mangerBougerAdapter); }