Skip to content

v1.20.1 — plugin admin screens, and upgrades that carry their own tests

Choose a tag to compare

@victorantos victorantos released this 09 Sep 10:09
· 6 commits to main since this release
16b53b8

Three versions' work — the last release was v1.18.0.

Plugins can add admin screens (1.19.0)

A plugin may now contribute its own screen to the admin. Declare it in
plugin.json and export a render function from admin.js; the build lists it
in api/site.json and the admin imports it on demand.

The screen receives { h, siteInfo, dataScreen, apiFetch, options } — and
deliberately not the user's token. dataScreen gives a plugin the same
fetch/render/error shape the built-in backend screens use, so a read-only view
over your own API is a few lines rather than a rewrite.

apiFetch — the write half (1.20.0)

dataScreen reads. apiFetch writes: it resolves a named entry from
services in site.config.json, attaches the stored bearer token, and turns a
401/403 into a message that says what to do about it. Endpoints stay in config
and secrets stay out of it (§5.1); credentials remain BYOK in localStorage
(§8.3).

tests/ is engine-owned (1.20.1)

The goldens assert what build.js emits, so shipping one without the other
strands a site the moment engine output changes — which is exactly what
1.19.0's new api/site.json key did. Upgrades now carry the code and the
fixtures asserting it together.

An ownership change can't deliver itself: the updater that runs an upgrade is
the one already installed, and to it every newly-claimed file looks like a
local edit. So:

  • tools/update.js treats a path missing from the installed manifest as newly
    engine-owned, takes upstream's copy, and lists it apart from routine updates
    so the diff is reviewed. This is the rule for future ownership changes.
  • migrations/001-adopt-engine-tests.js covers this one, running from upstream
    where the installed updater can't help. It replaces only paths upstream owns,
    so a test you wrote yourself survives.
  • update.yml no longer regenerates goldens before running them. That step was
    load-bearing only while tests/ was unowned; a real disagreement between
    build.js and its own fixtures should fail, not be written over.

Also fixed: admin-demo.test.js had been failing since it was written — its
temp dir sat outside the repo, so Node read the copied ESM as CommonJS. The
suite is green at 123/123.

Upgrading

Merge the PR your site's updater opens. If it was installed before 1.20.1,
expect migration 001 to adopt the engine's tests/ tree — the diff is in the
PR, and reverting rolls it back.

If you have deliberately customised a test at an upstream path, it will be
replaced.
Read that part of the diff before merging.