Instead of cloning emdash-patch repo, clone official emdash and apply
4-line sed patch to built virtual_astro_middleware.mjs. This avoids
workspace:* dependency issues that were breaking the backend.
The sed patch fixes apiSuccess() wrapper mismatch for media browser
and image upload in the visual editor toolbar.
- Add rm -rf dist before pnpm build for blog-template
- Ensure db.ts and astro.config changes are picked up
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The emdash CLI creates the database at ./data.db relative to the
workspace root (/app/emdash/data.db), but the Astro config was
pointing to ./storage/data.db. This caused getEmDashEntry() to
return null since the database used at runtime was empty.
Change db.ts to use file:./data.db instead of file:./storage/data.db
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add build steps for audit-log and gutenberg-to-portable-text
- Change WORKDIR to /app/emdash so workspace symlinks resolve
- Adapt entrypoint.sh paths for /app/emdash workspace
- Copy seed file and create storage directory
- Copy audit-log and gutenberg-to-portable-text to node_modules
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The pnpm isolated linker puts packages deep in .pnpm/store. Adding
node-linker=hoisted to .npmrc makes pnpm hoist packages like npm, so
react is accessible at /app/node_modules/react.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The "insufficient_scope: authorization failed" error meant the "builder" stage
name didn't exist. Using single stage where deps builds AND provides artifacts
via --from=0.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Builder stage has /app/emdash/node_modules with all workspace deps
including react. Deps stage only has blog-template deps.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Dependencies like react and react-dom come from the workspace root catalog,
not from individual packages. Need to install all workspace packages
first so the root node_modules is populated.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The monorepo workspace roots node_modules at /app/emdash/node_modules,
not in individual packages. Copy from workspace root to get all deps.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Clones full emdash monorepo (with image upload fix), adds blog template
as a workspace package, builds everything together. No package copying
required - workspace resolution handles everything.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The -L flag on cp still follows symlinks deeply in this monorepo.
Instead copy only dist/ and src/ and package.json directly without -L.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Changes:
- Build all packages (core, auth, blocks, admin) from source
- Copy packages with -L dereferencing symlinks so deps resolve properly
- Use emdash@0.9.0 from npm (source packages include their own deps)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The @emdash-cms/auth package needs its node_modules (ulidx, etc.) to be
linked. Running pnpm install after copying it restores the proper links.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The exports map in package.json is needed at build time to resolve
"@emdash-cms/auth/adapters/kysely". Copying just dist/ loses the
exports field in package.json causing resolution to fail.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The @emdash-cms/auth package needs its built dist/ folder copied,
not the raw src. Also builds auth package after core.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Resolves build error: Rollup failed to resolve import
"@emdash-cms/auth/adapters/kysely" from emdash middleware.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The blog template's db.ts imported 'mysql' from 'emdash/db' but the
patched source only exports sqlite, libsql, and postgres adapters.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add .env.example documenting SQLite/PostgreSQL/MySQL config
- Add src/lib/db.ts with getDatabaseConfig() helper that parses
DATABASE_URL and returns the appropriate db config
- Update astro.config.mjs to use getDatabaseConfig() instead of
hardcoded sqlite path
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Changed from plain <img> to <Image> component so locally
uploaded images display correctly on the posts list page.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Changed database path to ./storage/data.db
- Changed uploads path to ./storage/uploads
- Updated Dockerfile to create storage/uploads dir (not uploads)
- Updated entrypoint.sh to check /app/storage/data.db
- Removed COPY of uploads from builder to runner
Now all persistent data is in /app/storage/:
- /app/storage/data.db (SQLite database)
- /app/storage/uploads/ (uploaded media)
Easypanel mount: emdash-storage → /app/storage
To update EmDash: change version in package.json → push → redeploy
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add 3 second delay to wait for Easypanel volume mount
- Check file size as backup (seeded DB > 1KB, empty < 1KB)
- Check content table count as primary validation
- Safer fallback if any check fails
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change ternary src check to simple truthy check so image
displays when set, otherwise shows nothing instead of code window.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Check for content entries, not just file existence. If data.db
exists but has no content, still run seed to populate.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Remove emdash seed from Dockerfile build stage (no longer overwrites DB)
- Add entrypoint.sh that checks if data.db exists before seeding
- First launch: seed runs to populate DB
- Subsequent redeploys: DB exists, seed skipped, data preserved
- Also remove COPY data.db from runner stage (volume mount handles persistence)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change field types from "text" to "richtext" and wrap content in PortableText
components. This enables proper inline live editing instead of jumping to backend.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds content binding on Base component for homepage live editing navigation.
Uses homepage.id (entry ULID) not homepage.data.id (not in homepage schema).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use Image component instead of img tag. Add hero_image to hero-visual
container with {...homepage.edit.hero_image} for live editing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Added {...homepage.edit.X} spread attributes to all editable elements
(hero, features, comparison, CTA sections). This is what the live
editing UI needs to enable inline editing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Singleton collections don't support live editing in EmDash.
Converting to regular collection enables live editing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PortableText blocks in EmDash require a _key field. Added
to widgetAreas, sections, and all content entries.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Image fields in EmDash seed content use { url, alt } format directly,
not {$media: { url, alt, filename } }
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add homepage singleton collection with 30+ editable fields
- Update index.astro to fetch from getEmDashEntry("homepage", "homepage-main")
- Update Base.astro footer tagline/copyright from EmDash
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>