Changelog
All notable changes to @xtandard/kit are documented here. The project uses ZeroVer (0.x): a
MINOR bump is breaking, a PATCH bump is a fix or a backwards-compatible addition (ADR 0007). Each
entry names the products it affects: wh = webhooks, fl = flags, au = audit, li = links,
en = entitlements.
v0.1.1
Section titled “v0.1.1”Fixes and additions found by migrating the five products onto the kit. Backwards compatible.
- file storage,
legacy: "read-through"(fl): a key whose raw segments are valid encoded names (x/a%25/k,x/^a) could read or delete another key’s file (x/a%/k,x/A). The read-through path is now used only when it is unambiguous, and the conformance suite also runs in read-through mode. - server, Node 20.0–20.15 (wh, fl, au, li, en;
enginesallow Node 20): the panel served the “UI not built” fallback page instead of the SPA, becauseprocess.getBuiltinModuleis missing there.resolveUiDirandisMainModulenow work without it. - cli:
isMainModulecompares a path it can’t resolve as written, instead of returningfalse. - cli:
parseArgskeeps negative numbers and a bare-as values (--value -5,--limit -1,--reason -). Only--…and configured short flags start a new flag (en). - ui:
SectionCardis a named region: a stringtitlelabels the<section>(aria-label), as entitlements’ card did. It gainsflush,idandaria-labelprops, and its header wraps. - storage/mongodb:
isDuplicateKeyalso recognises E11000 inside bulk-writewriteErrors. - tokens, util:
createScopedTokensandcreateIdGeneratorread the clock late, so fake timers that swap the globalDate(vi.setSystemTime) move token expiry and id time. - site: the sync overwrites only the listed public assets, instead of deleting
site/public/(li commits files there). - workflows:
ci.ymlstarts ClickHouse with a CI-only password and a health check, and exportsCLICKHOUSE_URL,CLICKHOUSE_USERandCLICKHOUSE_PASSWORD(li). - workflows:
kit-release.ymland the productrelease.ymltemplate indocs/WORKFLOWS.mdpublish./pack/<tarball>. A barepack/<tarball>is read by npm as a GitHub repo, so the publish failed (wh, fl, au, li, en: fixed in each product’s migration PR). - tokens:
create()signs the claimsvalidateClaimsreturns, soverifyyields exactly what was signed (a normalising validator was ignored at mint time).
- storage: a
subpathoption on the sqlite, libsql, postgres, mongodb, redis and drizzle factories, so errors (a missing peer, a missingclient/url…) name the product’s import path. - cli:
storageRegistryFrom(loaders)builds a CLI storage registry over a product’s own entry modules, so capability layers and persisted defaults survive.isMainModule(import.meta.url)accepts a URL (a bareimport.metawarns in CJS builds). - util:
validateKeySegment(value, path, { maxLength }). - util:
@xtandard/kit/util/core, the dependency-free part ofutil(durations, ids, canonical JSON, types), which never loadsvalibot(en). - server/router:
readonlyMessagemay be a function of the route (en). - cli:
storageFromEnvandresolveStorageConfigtake adriveroverride, e.g. from a--storageflag (en). - storage/drizzle internals:
DrizzleLikeDatabasehas optionalexecuteandtransaction(en’s counters). - build: the example runner gets a
seedstep, anddemois optional. - storage/testing: a
padSpaceKeyscapability, so the trailing-space case expectsKeyCollisionErroron a PAD SPACE MySQL key column (the products’ default) instead of failing. - storage internals:
SqliteExecutor.atomic(statements)runs multi-statement writes all or nothing (BEGIN IMMEDIATEon bun:sqlite, a writebatchon libSQL), for product tables (au’s event log, en’s counters).LibsqlClientLikegains an optionalbatch. - util:
canonicalStringifyacceptsundefinedmembers and items, likeJSON.stringify(CanonicalInput).
v0.1.0
Section titled “v0.1.0”The first release: one implementation of the infrastructure the five xtandard products copied from
each other. It takes the best piece of each copy and every bug fix from every copy. See
docs/research/inventory.md for what it replaces, and
PLAN.md and docs/ADR/ for the design. All five products are affected.
Storage
Section titled “Storage”-
@xtandard/kit/storage. The neutralKvStoragecontract with thewatchandcompareAndSwapcapabilities and their guards.TransactionalKvStorageis kept as a deprecated type only. Also:withWatch(spread-safe) andpgListenNotify(the channel is a parameter);- escaping, canonical-JSON and key-segment helpers.
-
Ten drivers, with compare-and-swap on every one except Cloudflare KV and unstorage:
- memory (
onWritehook); - file: atomic writes, empty-segment encoding, legacy
ignore/warn/read-throughmodes,migrateFileStorage; bun:sqliteand libSQL: one shared core,GLOBprefixes;- Postgres:
COLLATE "C"on new tables,postgresStorageSchema; - MongoDB:
$expr/$literalCAS; - Redis and RedisJSON: SCAN results de-duplicated, glob-escaped
PSUBSCRIBE, anonWritehook, sorted-set commands onRedisLike; - Cloudflare KV;
- unstorage: trailing-
$and empty-segment encoding, with legacy read-through; - Drizzle on Postgres, MySQL and SQLite: dialect detection,
KeyCollisionError.
Peers load lazily, and
…/internalssubpaths expose connections, executors and codecs for product capabilities (ADR 0004). - memory (
-
Drizzle table factories
drizzle/{pg,mysql,sqlite}:pgKvTable,mysqlKvTable,sqliteKvTablewith a requiredname,textC,binVarchar, andkeyCollationoptions. These keep existing schemas stable. -
Stored data stays compatible (ADR 0005):
- writes are canonical JSON;
- compare-and-swap still works on legacy non-canonical rows, documents and values;
- new-table DDL only;
- permanent stored-data fixtures for every product’s legacy representations.
-
@xtandard/kit/storage/testing:- the runner-injected conformance suite (vitest or
bun:test): the union of every copy’s cases plus new regression cases; - declared capabilities are checked against the storage, so cases are never skipped silently;
fakeRedis()with anevalhook for a product’s own Lua scripts.
- the runner-injected conformance suite (vitest or
-
Fixed in every copy:
- MySQL:
getKeysskipped keys with supplementary characters such as emoji, because an indexedLIKEonutf8mb4_binmisses them. It now uses a range scan plusstartsWith. - MySQL: keys that differ only by trailing spaces collided on a
utf8mb4_binkey, which is PAD SPACE. Reads, removes and swaps are now byte-exact, and a colliding write throwsKeyCollisionErrorwith migration SQL. NO PAD collations are opt-in. - unstorage, Postgres and Drizzle: stored strings that look like JSON (
"123") came back parsed (123). - Redis CAS treated
{}and[]as equal. - A failed connection or DDL is retried instead of being cached forever.
- MySQL:
-
Fixed in some copies (inventory §3.2), now everywhere:
- file-watch removals and atomic file writes;
- escaped Redis
PSUBSCRIBEand SCAN de-duplication; - empty key segments;
- unstorage
$; - Postgres
COLLATE "C", SQLiteGLOB, the MongostartsWithpost-filter; - canonical JSON;
- Mongo CAS with
$-prefixed keys, MySQL Drizzle CAS; deepEqualown-properties check.
Server
Section titled “Server”auth:none,basicanddelegated, with a parameterised realm.authorization:defineActions(typed action lists → sets and predicates);- the role engine with readonly
RolePolicyarrays,noneanddelegated.
hooks: the generic before/after runner,isNamedfor cross-bundle errors, andhooks/logwithjson,sourceanddescribe.tokens:createScopedTokens. It verifies every product’s existing portal and viewer tokens, rejects an empty secret, supports secret rotation and takes an injectable clock.util:- durations, including weeks, and
parseDurationList; - id generators in the three persisted formats (monotonic, integer milliseconds);
- the validation core: finite JSON values, no trailing
.in root issue paths,validateKeySegment,validateUrl,parseInput.
- durations, including weeks, and
testing:createTestClockandcollectingSink.server:createPanelHandler: in-panel/healthcheck,no-cacheSPA HTML,close()for background tasks;renderIndexHtmlescapes the title, base href and U+2028;match()treats a malformed%escape as no match (404), not a 500;- name-based
mapError, including*TokenError→ 401 across bundles; - a throwing auth provider is a 500, not a 401;
- scoped tokens never fall back to host auth;
node:fsloads lazily, for Workers.
server/router: a declarative router with405+Allowand a parameterised readonly status, plus OpenAPI generated from the route table with an explicit version.- Adapters:
- one Fetch↔Node bridge for Express and the CLI: it keeps every
Set-Cookie, streams with backpressure, appends multi-value headers and re-serialises parsed bodies; - Elysia
createPass(PATCH/DELETE, stalecontent-length, multi-mount, arawroute) on Elysia 1 and 2; - Hono
mountPanel/waitUntilOf; - Next
toNextHandler.
- one Fetch↔Node bridge for Express and the CLI: it keeps every
cli:AUTH_MODEandSTORAGE_DRIVERfail closed on unknown values, and empty variables count as unset;storageFromEnvis generic over product roles, with per-role table names;- connection strings stay out of the startup banner;
isMainModuleis the self-run guard.
@xtandard/kit/ui,/ui/embed,/ui/styles.css: the shared admin shell:- primitives, a theme store keyed per product,
createApiClient,takeTokenFromUrl,bootSpa; ShellFrame+useShellConfig, bits, format helpers,BrandMark;createEmbed;- a base stylesheet with
@sourcefor Tailwind.
- primitives, a theme store keyed per product,
- UI fixes carried over:
- the portal waits for
/config, and a token means portal (wh lacked this); - the token is stripped from the URL (wh, au, li lacked this);
- memory routing keeps the query string, and swapping the token refetches (wh, au, en lacked this);
- the host-theme watcher guards a missing
MutationObserver(fl lacked this).
- the portal waits for
Tooling
Section titled “Tooling”-
@xtandard/kit/buildand thextandard-kitbin:scope-embed-css,fix-elysia2-types;api-surface [--diff], the no-removals gate for migrations and kit patches;- config factories for vite-plus, the UI, the embed and Playwright;
- the example runner, reusable embed-CSS and theme test suites,
tsconfig/{base,react}.json.
-
@xtandard/kit/site: the docs-site tooling (manifest, sync with one pending-guide design, the TypeDoc plugin naming each entry after its subpath, API overviews,defineXtandardSite). -
Reusable GitHub workflows:
ci.yml: optional services, and redis:8 so RedisJSON runs;pages.yml;docker.yml: smoke-tested before push,refresh-kitfor kit patches;release-prepare.yml:npm publishstays in each repo’s own workflow, for trusted publishing.
The kit’s own site is live at https://me.xantiagoma.com/xtandard-kit/.