CMS / foldkit-cms

Main exports

CallMeaning
Cms.roles({ label?, slug?, published? })Pipe step: the members of an Entity that play a CMS part.
Cms.rolesOf(entity)Those roles as Fields; undefined for an unnamed part.
Cms.published(entity)Published-row predicate for queries and Read rules (needs published role).
Cms.content(name, { entity, form, publish, words, preview? })Declares a content type: Entity, form, publish mutations, and words.
Cms.editor(name, { content, rest?, version?, untitled? })Authoring editor Bundle: bundle, Message, and at({ data, model }).
Cms.newEntryId()Generates an EntryId for a new entry.
Cms.editorView(view)Adapts a form's Submodel view for Bundle.withView.
Cms.Display.{State, Moment}Display kinds for entry state and timestamps (.of(data), .is(x)).
Cms.displayRenderers()Renderers for Cms.Display, to spread beside your own.
Cms.state(facts, now)Derives an entry's state and schedule from facts and a clock.
Cms.offers(facts, now, content)Lists the transitions currently offered for an entry.
Cms.Entities, Cms.Operations, Cms.operationsBuilt-in Entities and Remote mutations for CMS operations.
Cms.EntriesWorklist query: one content type's entries, by label or archived state.
Cms.bySlug(content)Query <name>BySlug returning one or none at a slug (needs slug role).
Cms.refusalServer refusal constructors (field(key, reason), conflict).

Cms.bySlug(content) accepts any ContentReader ({ name, entity, roles }, which every Content satisfies), so a public site can query by slug without importing the authoring form.

Limits

  • A revision list is a Crud.list you declare over Cms.Entities.Revision.
  • Preview is for the author, in their own session; shareable preview links for external reviewers are not built yet.
  • Form layout and status controls come from foldkit-mixins-form and your own view slots.
  • Cms.addressFree('posts') (added via Form.checks) advises authors while typing; put a unique index on the database column to enforce uniqueness on concurrent publishes.
  • One working draft per entry, not one per author.
  • Media, rich text, localization, and multi-step review workflows beyond who may publish are not built yet.

Next

  • Store drafts in Drizzle and enforce visitor visibility on the server: foldkit-cms-drizzle.
  • Run a complete post lifecycle over SQLite and in the browser: the CMS example.
  • Build and validate the forms that back each draft: foldkit-form.