@clearcms/admin@0.4.1
Patch Changes
-
#84
2d6eb06Thanks @slavasolutions! - Add update-available reminders toclear-admin.Adopters now learn about new versions of
@clearcms/adminvia two
complementary surfaces:Passive notifier — every
clear-admin <command>invocation kicks off
an async, non-blocking check against the npm registry. The result caches
at~/.cache/clear-admin/update-check.json(24h TTL). On the next
invocation, if a newer version is published, a one-line banner prints to
stderr at process exit:Update available 0.4.1 → 0.5.0 Run `npm i -g @clearcms/admin` to upgrade. Set NO_UPDATE_NOTIFIER=1 to silence.The check never blocks, never errors, never delays output. Failures
(offline, registry 5xx, timeout) are silent. Skipped when
NO_UPDATE_NOTIFIER=1orCIenv vars are set.Doctor check —
clear-admin doctornow includes anadmin-update
check that reports current vs latest @clearcms/admin. Reads the cache
file when fresh (24h); otherwise does a synchronous registry fetch with
a 1.5s timeout. WARN tier when behind, INFO when current or registry
unreachable. Skipped in CI / test environments / with NO_UPDATE_NOTIFIER.No new dependencies. Hand-rolled — built-in
fetch+ Node fs only. -
#82
6de9035Thanks @slavasolutions! - Fix Windowsclear-admin startspawning astro with ENOENT (#81).apps/admin/bin/clear-admin.js's dev-mode path resolved
node_modules/.bin/astroand calledspawn()withoutshell: true. On
Windows, pnpm/npm put shell wrappers at.bin/astro.cmdand.bin/astro.ps1,
not a bare.bin/astro— Node'schild_process.spawncannot resolve the
.cmdextension implicitly and threwENOENT. POSIX silently handled it
because the bare wrapper was directly executable.Now picks
astro.cmdonprocess.platform === 'win32'and bareastro
elsewhere. No shell, no quoting concerns. Adopters runningpnpm dev
on a Windows fresh clone of a@clearcms/createscaffold can boot the
admin alongside the site. -
#83
cbdc2ceThanks @slavasolutions! - Fix Windows SQLite teardown EBUSY in admin tests (#56).Test suites that exercised real libSQL (
pages-reindex, schemas[key]API,
preview[token]API) and the backup/restore CLI tests failed on Windows
fresh clones withEBUSY: resource busy or locked, unlink ...\clear.db. Two
compounding causes:- The cached libSQL singleton in
apps/admin/src/lib/db.tsis opened lazily
when a route is imported. Tests closed their own setup-time client but
never the route-side cached client, so the file handle persisted past
afterAll. - POSIX silently allows unlink-while-open. Windows doesn't, and the OS
sometimes needs a brief retry window even afterclose()returns.
This change adds:
- A new
closeDb()export fromapps/admin/src/lib/db.tsthat closes the
cached client and clears the singleton. Tests call it inafterAllbefore
removing tempdirs. - A new
safeRm(path)test helper inapps/admin/src/test/teardown.tsthat
retriesrmwith backoff on EBUSY (5 retries, linear 50ms backoff).
Wired into the affected suites:
pages-reindex.test.ts,schemas/[key].test.ts,
preview/[token].test.ts,backup.test.ts,restore.test.ts.Linux/macOS unaffected —
safeRmfalls through to a singlermcall when
no EBUSY occurs. - The cached libSQL singleton in