Skip to content

Latest commit

 

History

History

emdash-before

README.md

emdash-before

The source side of the EmDash → TanStack CMS migration example: a real, runnable EmDash blog.

EmDash is Cloudflare's open-source, Astro-native, agent-ready TypeScript CMS — pitched as the "spiritual successor to WordPress." This app was scaffolded verbatim with its own tool:

npm create emdash@latest -- --platform node --template blog

so it's a faithful EmDash project (not a hand-built mock): content lives in a SQLite database, rich text is stored as Portable Text (structured JSON), and the whole content model — collections, fields, taxonomies, bylines, menus — is declared in seed/seed.json, EmDash's canonical, reproducible seed/export format.

Run it

This is a standalone npm project (its own lockfile + a large dependency tree), deliberately excluded from the repo's pnpm workspace — it's the external CMS we migrate from. Run it on its own:

cd examples/emdash-before
cp .env.example .env            # EmDash needs an encryption key
npm install
npm run dev                     # → http://localhost:3014  (admin at /_emdash/admin)

npm run dev seeds the SQLite db from seed/seed.json on first start.

What's in the seed

  • Collections: posts (title, featured_image, content, excerpt) and pages (title, content). content is a portableText field.
  • Content: 8 posts (7 published + 1 draft) and an about page, with Portable Text bodies (paragraphs + h2 headings), featured_image media refs, and category/tag taxonomies.

Why this is the migration's hard case

Like Payload's Lexical, EmDash's Portable Text is a structured JSON tree, not Markdown — so the port (../emdash-after) needs a Portable Text → Markdown converter. Unlike Payload, the content REST API requires auth, so the migration reads the auth-free seed/seed.json directly (no running server needed) — the same "read the source files off disk" approach as the Starlight example. The gaps are taxonomies, bylines, menus/widgets, and non-text Portable Text blocks (image/code/gallery).