Minor Changes
-
#1258
28432b9Thanks @MohamedH1998! - Adds custom fields to bylines. Sites can define site-specific byline metadata (Twitter handle, pronouns, company, localised job title, etc.) via the new/byline-schemaadmin screen, accessed from the Byline schema link button at the top of the Bylines admin page (admin-only).Per-field
translatableflag picks whether values are stored per-locale (one value per locale row in atranslation_group) or shared across every locale variant of the same byline identity. Schema management is gated byschema:manage; value editing bybylines:manage.Custom-field values can be set at both create and update time.
POSTandPUTon/_emdash/api/admin/bylinesaccept the samecustomFieldsmap; the row write and the custom-field writes share a single transaction on Node/PG so a partial failure rolls both back. On D1 (no transactions), a retry POST is treated as completing an abandoned create iff three checks all pass: (a) every fixed column on the existing row matches the new payload (displayName,bio,avatarMediaId,websiteUrl,userId,isGuest, effective locale — null-vs-undefined normalised); (b) the existing row'stranslationGroupmatches what a fresh create with the same input would produce (sourceGroupwhentranslationOfis present,existing.idwhen it isn't); (c) every custom-field value already stored on the row appears in the input payload with an equal value (subset-match, so partial mid-loop crashes can be completed). The recovery branch is conservative on every axis: any fixed-column mismatch, any translation-group mismatch, any overlapping custom-field value mismatch, an input that omits a key the existing row stores, or an input with no custom fields at all → standardCONFLICT. Validation runs before any DB write so a bad value (unknown slug, type mismatch, select-choice miss, non-URL or non-http(s) URL for aurlfield) returns 400VALIDATION_ERRORwithout leaving partial state behind. In the admin, registered fields render inline with Name, Bio, etc. — no separate section header — and are available in the New byline dialog as well as edit.BylineSummarygains an optionalcustomFields: Record<string, CustomFieldValue>property. Existing object-literal consumers stay source-compatible because the property is optional and runtime always returns{}when no fields are registered.Hydration is symmetric with writes: rows are only applied to a byline when they live in the table matching the field's current
translatableflag, so stale rows from atranslatableflip can't leak into hydrated output. Schema mutations on/byline-schemainvalidate the samebyline-fieldsquery the byline form reads, so newly-registered fields appear in the editor without a page reload.urlfield values are parsed withnew URL(...)AND restricted tohttp:/https:schemes at write time so they can't shipjavascript:/data:/mailto:payloads to link rendering. TheBylineFieldEditor"Save" button stays disabled until aselectfield has at least one option; and select-option lists are accumulated on a null-prototype object so option values that collide withObject.prototypekeys render correctly.The field-definitions cache uses parity on
options.byline_fields_versionas a dirty bit: schema mutations flip the counter to odd before the write lands and to a new even value after, with the cache treating any odd version as "bypass the global holder, read fresh from the DB".markVersionDirtyis parity-aware (ensures odd, no-op if already odd) so a crashed prior attempt's leftover dirty state can't get inverted.markVersionCleanis always-advance (+2when starting even,+1when starting odd) so two concurrent mutators can't collapse on the same even key and pin the cache on a partial-set snapshot — every committed mutation produces an observable counter change for cache readers. Idempotent-retry exits (FIELD_EXISTSon create,FIELD_NOT_FOUNDon update/delete, no-op input on update) callmarkVersionCleantoo, which doubles as both the dirty-crash recovery and the false-clean recovery. All version writes useINSERT … ON CONFLICT DO UPDATEso a missing options row can't silently turn invalidation into a no-op.Implements #1174. Builds on the bylines-i18n foundation from #1146.
-
#1215
590b2f9Thanks @scottbuscemi! - First-class HTML block in the admin editor. The existinghtmlBlockPortable Text type (produced by the WordPress and Contentful importers) is now a fully editable block in the rich-text editor. Authors can insert an HTML block via the/htmlslash command and edit raw HTML in a textarea. ImportedhtmlBlockcontent that previously fell through to an opaquepluginBlockplaceholder is now rendered in the same editable UI. The inline (visual-editing) editor preserves HTML blocks as read-only placeholders to prevent data loss.
Patch Changes
-
#1298
cd2dcc6Thanks @ascorbic! - Byline hydration now resolves the author avatar's storage key in the same query.getEmDashCollection/getEmDashEntrypopulateentry.data.bylines[].byline.avatarStorageKey(andavatarAlt) via aLEFT JOINon the media table, so list pages can build a direct avatar URL without a per-bylineMediaRepository.findById. Previously the byline summary exposed onlyavatarMediaId(a bare ULID with no file extension), forcing sites that want direct storage URLs into an N+1 media lookup. A page rendering 20 posts by distinct authors paid ~20 extra queries. The new fields are additive and null on the plain byline finders (findById,findBySlug), which do not join media; rely on the content-credit hydration path for them. -
#1197
62c170fThanks @scottbuscemi! - Persist welcome-dismissed flag in database instead of session. Previously the welcome modal would be shown every time a user logged-in. -
#1295
ee67273Thanks @emdashbot! - fix(core/redirects): match exact redirects regardless of trailing slash (#1271)Exact redirect rules now match requests with or without a trailing slash. A redirect stored with source
/old/will also match a request for/old, and a redirect stored with source/oldwill also match/old/. The stored source is preserved unchanged; the fallback happens at lookup time. -
#1226
9422d6aThanks @scottbuscemi! - Make content list search work on large collections (#1219). The admin content list previously filtered only the rows already loaded on the current page, so an entry far back in a big collection could not be found until you navigated near it. The list endpoint now accepts aqparameter and performs a case-insensitive substring search across the collection's title/name/slug columns server-side (LIKE wildcards in the query are escaped), and the admin search box drives that query (debounced) instead of filtering in memory. Also adds locale-aware composite indexes (idx_{table}_loc_upd/idx_{table}_loc_crt) so locale-filtered content lists stay index-served on large, i18n-enabled tables. -
#1302
1f8190dThanks @WellDunDun! - Fixes locale-aware content updates so REST, CLI, client, and MCP callers can safely update content by slug when multiple locales share the same slug. -
#1224
67f5992Thanks @scottbuscemi! - Fix taxonomy terms not being locale-aware in the content editor (#1218). Term assignments are stored against the per-locale content row while the term'stranslation_groupspans every locale, so resolving terms for an entry must scope to the entry's locale. The content terms endpoint (/content/:collection/:id/terms/:taxonomy) now derives the entry's locale server-side and passes it togetTermsForEntry, and the adminTaxonomySidebarthreads the entry locale through its fetch/save calls (and into its React Query keys, so switching translations refetches). Previously a localized post showed and applied every locale variant of a tag instead of just the variant for its own locale. -
#1227
a40e455Thanks @scottbuscemi! - Add search and filtering to the media library (#1221). The media list endpoint now accepts aqparameter for a case-insensitive filename substring search (which also matches extensions, with LIKE wildcards escaped), alongside the existingmimeTypefilter. The Media Library page gains a filename search box and a type filter (images / video / audio / documents), and the media picker in the content editor now searches the local library by filename too. Previously neither surface could search or filter local media, which made large libraries hard to navigate. -
#1319
69bdc97Thanks @ascorbic! - Fixrequire is not definedcrash on every EmDash API route underastro devon Cloudflare Workers (#1292).@emdash-cms/registry-clientlistedsemver(CommonJS) independencies, which the build externalizes -- so consumers loaded a nested CJS copy. Vite's SSR module runner (workerd) evaluates modules with norequirebinding, so semver's internalrequire()threw and took down any route whose import graph reached registry-client (schema, plugins, env compatibility checks). semver is now bundled into the ESM output, so nothing CommonJS reaches the worker. -
#1285
5e7f835Thanks @ascorbic! - Fix SEO fields (noindex toggle, canonical URL) not affecting rendered pages. The content loader now surfaces per-entry SEO metadata onentry.data.seo, sogetSeoMeta()reflects values set in the admin SEO panel. SEO is folded into the existing entry query via a LEFT JOIN, adding no extra database round-trips. -
#1298
cd2dcc6Thanks @ascorbic! - Seed files can now attach an avatar to a byline.bylines[].avatartakes astorageKey(plus optionalalt,filename,mimeType,width,height) for a file that already exists in the configured storage; applying the seed creates amediarow and links it to the byline viaavatarMediaId. Unlike a content$mediareference, nothing is downloaded or uploaded, which suits seeding bylines alongside a media migration. -
Updated dependencies [
cccf4f2,28432b9,886f2d1,a5dafb3,9422d6a,67f5992,a40e455,69bdc97,34afc14,590b2f9,019d9e4,ba0f3d4,aacdf20,7d55db6]:- @emdash-cms/admin@0.17.0
- @emdash-cms/registry-client@0.3.1
- @emdash-cms/auth@0.17.0
- @emdash-cms/gutenberg-to-portable-text@0.17.0