New Meilisearch versions
MeiliOps targets the latest stable Meilisearch release. The API types are generated from the OpenAPI spec Meilisearch publishes with each release, so an update is mostly mechanical.
Steps
- Download the new release's
meilisearch-openapi.jsonintoapp/spec/. - Regenerate the types, the API console's operation catalog and the version table (
src/api/since.json):
npx openapi-typescript@7 spec/meilisearch-openapi.json -o src/api/schema.d.tsnpm run gen- Typecheck. Routes that were renamed or removed fail here, at every call site:
npm run typecheck- Check coverage. New stable operations without a screen fail here, and so do calls to new operations that aren't version-gated (see below):
npm run coverage -- --strict- Add screens for the new operations, gate them, and update the version mentioned in the docs.
The API console picks up every new operation automatically, so new routes are usable immediately, even before they get a dedicated screen.
Older Meilisearch versions
MeiliOps supports Meilisearch 1.18.0 and newer (MIN in app/scripts/gen-since.mjs). 1.18 is the first release that publishes an OpenAPI spec, so what each version serves is measured rather than guessed.
npm run genrunsscripts/gen-since.mjs, which downloads the spec of every minor release from 1.18 up (cached inapp/spec/history/, gitignored) and writessrc/api/since.json: each operation newer than 1.18 and the first version that serves it.- Older specs sometimes left out routes that already worked.
PRESENT_AT_MINin the script lists the ones a live 1.18 server was probed to serve. Check a new entry against a real server before adding it. src/lib/compat.tscompares the connected server's version with that table:supports(op),needs(op)(a tooltip for disabled controls) andsettingMissing(slug). Wrap a whole screen in<Requires op=… feature=…>(components/Requires.tsx).- Older than 1.18: a banner says some screens may not work. Local instances only offer 1.18 and newer.
Gating a new operation
Every call to an operation in since.json must be gated in the same file: a supports/missing/needs call or an op prop naming that operation, or one at least as new (a whole-screen <Requires> covers the screen's other calls). Settings sub-routes are gated by the Settings tab through settingMissing. coverage --strict fails on an ungated call, and when since.json was generated for a different spec version.
Prefer a fallback to hiding a feature when the data exists another way. For example, field capabilities come from POST /fields on 1.36+ and are worked out from the settings before that (lib/fieldCaps.ts).
Coverage script details
app/scripts/coverage.mjs finds calls by scanning the source for the literal "METHOD", "/path" pattern, plus the settings catalog in views/index/settingsCatalog.ts. It knows that some routes are equivalent (for example the GET and POST forms of search) and that the /network routes are Enterprise-only.