Registry / cms / emdash

emdash

JSON →
library0.17.2jsnpmunverified

emdash is an Astro-native CMS that integrates seamlessly with Astro sites, providing a visual editor, content management, and WordPress migration capabilities. Current stable version is 0.17.2, with frequent releases (weekly/biweekly). It requires Astro >=6.0.0-beta.0, React >=18, and @astrojs/react. Unlike traditional headless CMSs, it leverages Astro's islands architecture for live editing and supports multitenancy with AT Protocol authentication. Designed for teams migrating from WordPress to Astro.

npm install emdash
INSTALL
IMPORT
SIG · EMDASH
E
emdash
cmsjavascriptv0.17.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

useCollection
import { useCollection } from 'emdash'
import useCollection from 'emdash'
Named export, not default. ESM only.
ContentEditor
import { ContentEditor } from 'emdash'
const ContentEditor = require('emdash')
ESM-only since v0.16, CommonJS require may fail.
defineConfig (emdash config)
import { defineConfig } from 'emdash/config'
import { defineConfig } from 'emdash'
Config helper is under 'emdash/config' subpath export.

Shows how to define a content collection and use the editor component in an Astro project.

import { defineConfig } from 'emdash/config'; import { useCollection, ContentEditor } from 'emdash'; export default defineConfig({ collections: { posts: { type: 'content', schema: { title: { type: 'string', required: true }, publishedAt: { type: 'date', default: new Date() }, }, }, }, }); // In your Astro component: --- import { ContentEditor } from 'emdash'; const { data } = await useCollection('posts'); --- <ContentEditor />
Debug
Known issues
breakingESM-only requirement introduced in v0.16.0
fix
Ensure project uses ESM (type: module in package.json) and avoid require().
affects: >=0.16.0
breakingAstro >=6.0.0-beta.0 required as of v0.17.0
fix
Upgrade Astro to v6 beta or later.
affects: >=0.17.0
deprecatedWordPress migration plugin deprecated in favor of built-in migration
fix
Use new migration command: npx emdash migrate --from wordpress
affects: >=0.15.0
gotchaConfig helper must be imported from 'emdash/config', not 'emdash'
fix
Use import { defineConfig } from 'emdash/config'
affects: >=0.12.0
gotchauseCollection must be awaited inside Astro component frontmatter
fix
Use const { data } = await useCollection('name')
affects: <0.18.0
deprecatedLegacy ContentEditor import path deprecated
fix
Import from 'emdash' directly, not 'emdash/react'
affects: >=0.16.0
Errors
Common errors & fixes
Error: Cannot find module 'emdash/config'
Incorrect import path for config helper
fix
Use import { defineConfig } from 'emdash/config' (note subpath)
ReferenceError: require is not defined in ES module scope
Using CommonJS require() in ESM project
fix
Switch to import statements or add type:'commonjs' in package.json
TypeError: useCollection is not a function
Default import used instead of named import
fix
Use import { useCollection } from 'emdash' (named)
Upgrade
Version history
0.17.2latest on npm
Audit
Dependencies
astrorequiredCore integration requirement, peer dependency >=6.0.0-beta.0
reactrequiredUI components for the editor and admin panel, peer dependency >=18.0.0
react-domrequiredReact DOM rendering, peer dependency >=18.0.0
Agent activity
42 hits · last 30 days
node
38
Resources
packageemdash
emdash — npm install emdash · libregistry