Ground rules
- No dependencies. Plain ES modules, Node.js 22 or newer, no framework. Adding a build step is a decision to raise with the owner first.
- Tests come with the change. They run on Node's built-in test runner:
npm test. - Escape every string from data. Recipe files and looked-up video titles come from third parties. The dashboard passes each one through
esc()before it reaches the page. - Browser storage holds conveniences only. Each read and write is wrapped so that blocked storage never breaks a page.
- The recipe contract is the source of truth.
lib/recipe.mjsdecides what a valid recipe is.
Add a recipe
- Read the recipe format, or keep the cheat sheet next to you.
- Write
recipes/<id>.jsonfrom the video, by hand or with the Recipe Agent. Use the creator's amounts, your own words for the method, and reuse ingredient keys that exist. - Credit the creator by name and link, and link the original video.
- Run
npm run validate. - Remove the matching entry from
data/queue.jsonif there is one. - Keep captions, transcripts and frames out of the change.
Three recipes are shown on the home page of this website: cold-pan-chicken, air-fried-chicken-nuggets and banana-milk. After editing one of them, run npm run site:data, or npm test fails.
Add a platform
Everything the project knows about a video platform is in one file, lib/video.mjs, which the server, the validator and the browser share. It must stay free of dependencies and of browser-only code.
| Function | What to add |
|---|---|
parseVideoUrl | Recognise the platform's links and return its platform name, the video id and one canonical url. Return nothing for links that are not a video. |
embedUrl | The address of the platform's own player, or nothing when it has none. Videos are embedded from the platform, never re-hosted. |
thumbnailUrl | A poster image only when the platform has a stable public one. |
videoKey | Usually nothing: it builds the key that finds duplicates from the platform and the id. |
- Add cases to
test/video.test.mjsfor every link shape you accept, and for look-alike links you reject. - Add the platform's row to the
PLATFORMStable inlib/video.mjs. The validator's message that names the supported platforms, and the dashboard's platform labels, are built from that table. - Add the platform's label to the showcase of this website in
site/js/showcase-core.js, which keeps its own list. - If the platform has a public title lookup, the server can use it when a video is queued. A queue entry works without a title.
Shipped This is on the main branch today.
The note above is about support for Facebook, Pinterest, X and opted-in web pages. Look at how that work is laid out before you add another platform, so yours follows the same pattern: one row in the PLATFORMS table, the parsing in lib/video.mjs, and docs/PLATFORMS.md.
Add a feature module
Shipped This is on the main branch today.
The note above is about the redesigned dashboard, which is what makes feature modules possible: a feature plugs in without editing the dashboard's own code. The contract is written down in docs/design/MOUNT-POINTS.md; this is the short version.
- One module. A feature is one ES module in
public/features/that exportsinstall(rb), registered inpublic/features/index.js. A feature that fails to load is skipped, and the dashboard carries on. - Mount points. The dashboard renders empty, named elements and leaves them alone: in the header, above the grid, in the filter panel, on each card, and on the recipe page. A feature fills the ones it needs each time the view is drawn.
- Events. The dashboard announces what happens: a view was drawn, the grid was redrawn, the filters changed, an ingredient was ticked, cook mode opened.
- Filters and routes. A feature can register a recipe filter, and a page of its own with one of the three layout types: list, detail or message.
- Logic apart from the page. Pure logic goes in
lib/with tests, so it runs without a browser.
Rules a feature must keep:
- Use the design tokens and the existing components. Controls are at least 44 px on phones, and nothing depends on hover.
- Never change a recipe's data. A scaled amount is a display value, marked as scaled, with the creator's original still shown. An unstated amount never gets a number.
- Escape strings from recipes and the queue, and use the storage helper that never throws.
Change this website
The website lives in site/ and is separate from the dashboard. Its rules are in site/README.md. The two that matter most:
- Only true things. Every feature the site names is an entry in
site/data/features.jsonwith a status: shipped, next or planned. When something merges, change its status there and runnpm run site:sync. The home page and the status notes in these docs follow. - Every page works without JavaScript. Scripts add the filter, the theme switch and the animated mark. They never hold content.
Send it
- Run
npm run validateandnpm test. - Open a pull request on GitHub that says what changed and how you checked it.
- For a recipe, say what you looked at: the captions, the description, the frames.
The code and the recipe files are MIT licensed. The videos belong to their creators.
NextChangelog