Repository navigation
Releases
Releases · xantiagoma/xtandard-flags
v0.3.0
Changed
@xtandard/kitis now a dependency. The storage drivers, drizzle table factories, auth and
authorization providers, the hooks runner, the validation core, the panel and API plumbing, the
framework adapters, the CLI plumbing, the admin shell, the React embed, the build configs and the
docs-site tooling come from@xtandard/kit. Every subpath and exported name of
@xtandard/flagsis unchanged (the API-surface diff has no removals); users never install or
configure the kit.- Every SQL, document, Redis, memory and file adapter now has
compareAndSwap(memory, file,
Redis/RedisJSON, Postgres, Drizzle on pg/MySQL/SQLite, MongoDB, SQLite, libSQL). Only unstorage
and Cloudflare KV lack it. Comparisons are structural (object key order is ignored). - Values are written as canonical JSON (sorted object keys) by every adapter. Data written by
earlier releases reads, lists and swaps as before; no migration. - unstorage writes string values JSON-encoded (
"hello"is stored as"\"hello\""). An older
release still reads them, and strings stored by earlier releases read back as before. - New Postgres tables get
key text COLLATE "C"(bytewise, index-usable prefixes). Existing
tables are untouched and keep working; the optionalALTERis in the kit's storage guide.
pgFlagsTablekeeps the plaintextkey (no drizzle-kit diff for existing schemas). mysqlFlagsTabletakeskeyCollation(utf8mb4_bindefault;utf8mb4_0900_binon MySQL
8.0+ orutf8mb4_nopad_binon MariaDB for new tables). See "MySQL PAD SPACE" under Fixed.createFetchHandler:sourceStorageis optional when a prebuiltcoreis given (one of the
two is required, checked at construction). The result, and every adapter helper (flagsPanelfor
Bun, Hono, Express and Elysia), gainsclose(), which stops the OFREP SSE poller.- Every panel answers
GET {basePath}/healthcheckwith{ "ok": true }, and serves the SPA's
index.htmlwithcache-control: no-cache(an upgrade no longer serves a stale page that points at
deleted hashed assets). The standalone server andservekeep their{ status, title }
healthcheck at/healthcheckand{basePath}/healthcheck. - A non-GET request outside the API gets
405with anAllow: GET, HEADheader. - The OpenAPI document's
info.versionis the package version (it was a hard-coded0.1.0). - CLI:
AUTH_ROLEsets the basic-auth user's role (adminby default, as before).SOURCE_SQLITE_TABLE/RUNTIME_SQLITE_TABLEset the SQLite table (defaultxtandard_flags,
as before).UI_DIRoverrides the bundled UI directory (the standalone image already honoured it).bun src/cli.ts <command>runs the CLI directly (a self-run guard); importing the module never
runs it.
- The standalone app delegates to the CLI's
serve, with its own defaults unchanged (memory
storage,./data/{source,runtime}and./data/{source,runtime}.sqlite). - Optional-peer error messages read
@xtandard/flags/storage/redis requires the optional peer "redis". Install it with: bun add redis (or npm install redis). - Validation:
ValidationErrorandValidationResult(@xtandard/flags) are now type aliases
of the kit'sValidationIssue/ValidationResult, with the same shape. - Admin UI: the header is the kit's shell. The unpublished-changes badge and the Discard and
Publish buttons sit before the read-only badge; an embedded dashboard whose/configrequest fails
(and that has no server bootstrap) shows a "Could not load the panel configuration" message instead
of an empty shell. - React embed:
@xtandard/flags/reactalso exports theFetchLiketype. - New exports (additions only):
MemoryFlagsStorage(./storage/memory);
FileFlagsStorage,FileLegacyModeandmigrateFileStorage(./storage/file);
KeyCollisionError(./storage/drizzle); theFetchLiketype (./react). - Docs site, CI and release run on the kit's tooling and reusable workflows (
@v0.1). CI now
usesredis:8, so the RedisJSON conformance cases run. The Docker image is smoke-tested before it
is pushed, anddocker.ymlhas arefresh-kitdispatch input. Release notes come from the tag's
CHANGELOG section.
Fixed
Inherited from @xtandard/kit (inventory §3; each has a permanent regression test in the kit).
Server and API
- Node 20.0–20.15 served the "UI not built" page instead of the admin SPA
(process.getBuiltinModuleis missing there); the UI directory now resolves on every Node 20
thatenginesallows (kit 0.1.1). - A throwing auth provider is a
500, not a401. A broken identity provider no longer looks
like bad credentials (flags lacked wh 543e1fa). - The panel requires
sourceStorageor a prebuiltcoreand says so at construction, instead
of failing on the first request (wh 5b151c1). - Domain errors are mapped by name (
ReadonlyError,NotFoundError,SnapshotProtectedError,
the validation errors), so a class copy from another bundle no longer turns into a500. - A malformed
%escape in a path is a404, not a500(URIError). - Key-shaped path parameters are re-validated before they reach storage (MySQL PAD SPACE,
inventory §5). Flag, segment and snapshot keys must match[a-zA-Z0-9._-]+; project and
environment keys (path and the OFREPprojectKey/environmentKeyquery) may not be empty,
./.., contain/, or have leading/trailing whitespace. Example:DELETE …/snapshots/v1%20passed the "active snapshot is protected" check ("v1 " !== "v1") and then
deleted thev1row on MySQL; it is now a404. - The panel title is HTML-escaped in the served page, and so are the
<base href>and the
bootstrap JSON (<,>, U+2028/U+2029);$sequences in the config are kept. - Express keeps every
Set-Cookieheader and multi-value request headers, re-serialises
pre-parsed bodies (JSON, string, bytes, urlencoded) without a stalecontent-length, and
streams responses with backpressure, so the OFREP SSE stream now works under Express (it was
buffered). - The CLI's Node server (
npx … serve) keeps everySet-Cookie, streams every response (not
only SSE) and cancels the body when the client disconnects. - Elysia:
PATCHandDELETEbodies reach the panel (onlyPOST/PUTwere rebuilt), a stale
content-lengthis dropped, and two mounts with different prefixes are no longer deduplicated by
the plugin name. - The OpenAPI
info.versionis the package version, not0.1.0.
CLI
- Negative numbers and a bare
-are values (--value -5,--reason -), not new flags
(kit 0.1.1parseArgs). bun src/cli.tsruns the CLI even when its path can't be resolved as written (kit 0.1.1
isMainModule).- An unknown
SOURCE_STORAGE_DRIVER/RUNTIME_STORAGE_DRIVERfails instead of silently using
thefiledriver. - An empty environment variable counts as unset (
TITLE=in a.envfile kept an empty
title). - (Unknown
AUTH_MODEalready fails since v0.2.1's hotfix; the kit now enforces it.)
Storage
- file
legacy: "read-through"(the flags default) could delete another key's file. The raw
legacy path ofx/a%25/kis the encoded path ofx/a%/k, so writing or removingx/a%25/k
deletedx/a%/k, and reading a missingx/a%25/kreturnedx/a%/k's value (same for^
escapes). Present in every earlier flags release; fixed in the kit (#18), and the conformance
suite now runs in read-through mode. - file: a write is atomic (temporary file + rename), so a crash never leaves a half-written
value;watchreports arenameasremoveonly when the file is gone (writes were reported as
removals); empty key segments are distinct (a//b≠a/b); on a case-insensitive file system a
read-through never opens a legacyAcme/foracme(realpathcheck). - Redis:
getKeysde-duplicates SCAN results (SCAN may return a key twice);watchescapes
glob characters in the watched prefix (PSUBSCRIBE), so it no longer misses or over-matches events. - unstorage: keys ending in
$are no longer hidden (unstorage treats them as meta keys), empty
key segments are kept, and a stored string that looks like JSON reads back as that string ("123"
came back as the number123). Older spellings still read. - MySQL (drizzle):
getKeysno longer skips keys containing supplementary characters (emoji):
an indexedLIKE 'p%'onutf8mb4_binmisses them on MySQL 8.4; it is now a range scan plus an
exactstartsWith. - MySQL PAD SPACE:
utf8mb4_binignores trailing spaces, sosetItem("flags/a ")overwrote
"flags/a", and reads, removes and swaps acted on the other spelling. Reads, removes and swaps now
match keys byte-exactly, and a colliding write throwsKeyCollisionErrorinstead of overwriting.
New tables can opt into a NO PAD collation (keyCollation). - Postgres / Drizzle: a stored JSON string that looks like JSON (
"123") reads back as the
string (it was parsed twice); a failed connect or table creation is retried on the next call
instead of being cached (Postgres, libSQL). - SQLite / libSQL: prefix listing uses
GLOB(case-sensitive, index-usable); MongoDB re-checks
prefixes withstartsWith, so a case-insensitive collection collation never leaks keys from
another prefix. @xtandard/flags/storage/sqlitecan be imported under Node (bun:sqliteloads on first
use; opening a database still needs Bun). The SQLite table is created on first use.withWatchresults survive an object spread ({ ...withWatch(s, sub) }kept no methods).
Validation
- JSON values must be finite: a
jsonvariant (or condition value) containingNaNor
...
v0.2.1
What's Changed
- fix(auth): reject unknown AUTH_MODE instead of serving an open panel by @xantiagoma in #23
Full Changelog: v0.2.0...v0.2.1
v0.2.0
What's Changed
- docs(readme): add "The xtandard ecosystem" section by @xantiagoma in #11
- docs: documentation site (Starlight) on GitHub Pages by @xantiagoma in #12
- docs(api): readable Elysia adapter types; /elysia2 documented against Elysia 2 by @xantiagoma in #13
- fix(docs): only export … from statements count as re-exporting another entry point by @xantiagoma in #14
- fix(storage): exact keys and literal prefixes on every backend by @xantiagoma in #15
- fix(site): serve og:url, og:image and sitemap URLs over https by @xantiagoma in #16
- feat(brand): vector brand kit in the xtandard family system by @xantiagoma in #17
- feat(brand): SVG only wherever the brand is shown by @xantiagoma in #18
- chore(brand): no tile on any page; audit, links and entitlements in the ecosystem by @xantiagoma in #19
- fix(brand): centre the symbol on the wordmark in the horizontal lockups by @xantiagoma in #20
- docs: link @xtandard/entitlements on npm in the ecosystem table by @xantiagoma in #21
- chore: staged fmt skips .mdx and tolerates fmt-ignored-only commits by @xantiagoma in #22
Full Changelog: v0.1.11...v0.2.0
v0.1.11
v0.1.10
v0.1.9
🚀 Enhancements
- elysia: Elysia 2 support via @xtandard/flags/elysia2 (b5405ef)
❤️ Contributors
- Santiago Montoya xantiagoma@gmail.com
v0.1.8
What's Changed
- fix(react): scope the embed stylesheet so it can't leak into the host app by @xantiagoma in #10
Full Changelog: v0.1.7...v0.1.8
v0.1.7
What's Changed
- feat(snapshots): guarded deletion + configurable retention (count and/or age) by @xantiagoma in #7
- feat(storage): createRedisJSONStorage — native RedisJSON documents by @xantiagoma in #8
- feat(react): initialProjectKey/initialEnvironmentKey on FlagsDashboard by @xantiagoma in #9
Full Changelog: v0.1.6...v0.1.7
v0.1.6
What's Changed
- fix(storage): drizzle-orm 1.0 beta compatibility for the Drizzle exports by @xantiagoma in #6
Full Changelog: v0.1.5...v0.1.6
v0.1.5
What's Changed
- feat(hooks): control-plane before/after hooks on the admin core by @xantiagoma in #1
- feat(hooks): pinned flag tests that gate publishing by @xantiagoma in #2
- feat(eval): onEvaluation runtime-plane observer by @xantiagoma in #3
- feat(embed): cross-origin support for the embedded dashboard by @xantiagoma in #4
- feat(storage): Drizzle adapter, pg/mysql/sqlite factories + composable withWatch by @xantiagoma in #5
New Contributors
- @xantiagoma made their first contribution in #1
Full Changelog: v0.1.4...v0.1.5