65 Commits
Author SHA1 Message Date
Kunthawat Greethong 55f7b3f75a Use official emdash with sed-based post-build patch
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.
2026-05-04 21:35:21 +07:00
Kunthawat GreethongandClaude Opus 4.6 a4b913fb96 Force clean rebuild of blog-template dist to fix config paths
- 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 <[email protected]>
2026-05-04 08:59:45 +07:00
Kunthawat GreethongandClaude Opus 4.6 6f23ea808b Simplify storage path: use ./uploads instead of ./storage/uploads
Since database is now at ./data.db, align uploads path similarly

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-05-04 07:48:30 +07:00
Kunthawat GreethongandClaude Opus 4.6 278fe56591 Ignore test-node-modules directory
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-05-04 07:33:49 +07:00
Kunthawat GreethongandClaude Opus 4.6 71e05f9d2c Fix SQLite database path to match emdash init location
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 <[email protected]>
2026-05-04 07:33:40 +07:00
Kunthawat GreethongandClaude Opus 4.6 88902c3b38 Fix Dockerfile for emdash monorepo workspace and package builds
- 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 <[email protected]>
2026-05-03 23:17:33 +07:00
Kunthawat GreethongandClaude Opus 4.6 ba717ceeff Dockerfile: enable pnpm hoisting so react/react-dom are at top-level
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 <[email protected]>
2026-05-03 17:38:07 +07:00
Kunthawat GreethongandClaude Opus 4.6 f05d518d7f Dockerfile: use single-stage build (deps does build AND provides artifacts)
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 <[email protected]>
2026-05-03 17:10:36 +07:00
Kunthawat GreethongandClaude Opus 4.6 c65f7facf6 Dockerfile: copy node_modules from builder stage instead of deps
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 <[email protected]>
2026-05-03 17:07:35 +07:00
Kunthawat GreethongandClaude Opus 4.6 249ca9613f Dockerfile: install deps before building packages (react is a workspace dep)
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 <[email protected]>
2026-05-03 16:57:16 +07:00
Kunthawat GreethongandClaude Opus 4.6 3e9ed743dc Dockerfile: copy node_modules from workspace root (pnpm hoists deps there)
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 <[email protected]>
2026-05-03 16:43:28 +07:00
Kunthawat GreethongandClaude Opus 4.6 f10263f99a Dockerfile: build blog template as part of emdash monorepo workspace
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 <[email protected]>
2026-05-03 16:17:10 +07:00
Kunthawat GreethongandClaude Opus 4.6 a06c72b9d1 Dockerfile: only copy dist/src/package.json from core (avoid circular symlinks)
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 <[email protected]>
2026-05-03 16:12:06 +07:00
Kunthawat GreethongandClaude Opus 4.6 0e0653aed9 Dockerfile: simplify - clone emdash source, build all packages, copy with -L flag
Changes:
- Build all packages (core, auth, blocks, admin) from source
- Copy packages with -L dereferencing symlinks so deps resolve properly
- Use [email protected] from npm (source packages include their own deps)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-05-03 15:47:30 +07:00
Kunthawat GreethongandClaude Opus 4.6 ddf47aff3a Dockerfile: reinstall after copying auth package to resolve its dependencies
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 <[email protected]>
2026-05-03 12:07:08 +07:00
Kunthawat GreethongandClaude Opus 4.6 b3c4abcf85 Dockerfile: copy full @emdash-cms/auth package not just dist/
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 <[email protected]>
2026-05-03 11:56:46 +07:00
Kunthawat GreethongandClaude Opus 4.6 e3dbfc44fa Dockerfile: build auth package and copy only dist folder
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 <[email protected]>
2026-05-03 11:51:19 +07:00
Kunthawat GreethongandClaude Opus 4.6 defc69be91 Dockerfile: also copy @emdash-cms/auth package from patched source
Resolves build error: Rollup failed to resolve import
"@emdash-cms/auth/adapters/kysely" from emdash middleware.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-05-03 11:48:14 +07:00
Kunthawat GreethongandClaude Opus 4.6 557ed9e2d0 Remove mysql export that doesn't exist in patched emdash 0.9.0
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 <[email protected]>
2026-05-03 11:37:01 +07:00
Kunthawat Greethong 55fecd15c5 Dockerfile: replace entire emdash package with patched source 2026-05-03 11:31:27 +07:00
Kunthawat Greethong 6210f9c5c5 Dockerfile: only replace emdash dist contents, not entire package 2026-05-03 11:19:20 +07:00
Kunthawat Greethong 7e69efae5b Dockerfile: build core package directly instead of using workspace filter 2026-05-03 11:15:43 +07:00
Kunthawat Greethong 9df25848dd Dockerfile: fix build filter to use 'emdash' package name 2026-05-03 11:09:24 +07:00
Kunthawat Greethong 7036f9ef42 Dockerfile: clone, build and install patched emdash source 2026-05-03 11:01:21 +07:00
Kunthawat Greethong c35ad1ecc3 Ignore .omc/ directory 2026-05-03 10:52:32 +07:00
Kunthawat Greethong 8d44199538 Remove .omc/ from tracking 2026-05-03 10:52:22 +07:00
Kunthawat Greethong f8e8e2207b Dockerfile: clone patched emdash from gitea instead of using npm
Patches visual editor image upload fix from:
https://git.moreminimore.com/kunthawat/emdash-patch-imageupload.git
2026-05-03 10:52:12 +07:00
Kunthawat GreethongandClaude Opus 4.6 13f775c57c Add DATABASE_URL env var support for EmDash
- 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 <[email protected]>
2026-05-02 16:31:43 +07:00
Kunthawat GreethongandClaude Opus 4.6 de5735bc8e fix: use Image component for post list featured images
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 <[email protected]>
2026-05-02 10:46:55 +07:00
Kunthawat GreethongandClaude Opus 4.6 49725b2fd0 refactor: move data.db and uploads to storage/ folder
- 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 <[email protected]>
2026-05-02 10:24:03 +07:00
Kunthawat GreethongandClaude Opus 4.6 30eeee186f fix: improve entrypoint.sh volume mount handling
- 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 <[email protected]>
2026-05-02 09:48:40 +07:00
Kunthawat GreethongandClaude Opus 4.6 3207dc8c46 fix: show hero image only, remove code fallback
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 <[email protected]>
2026-05-02 08:18:19 +07:00
Kunthawat GreethongandClaude Opus 4.6 a7ba7c81a1 fix: entrypoint seed check handles empty databases
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 <[email protected]>
2026-04-30 20:24:30 +07:00
Kunthawat GreethongandClaude Opus 4.6 f981f1fe4c fix: run emdash seed only on first launch via entrypoint.sh
- 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 <[email protected]>
2026-04-30 15:00:29 +07:00
Kunthawat GreethongandClaude Opus 4.6 cdf15f8988 feat: add hero_image display with Image component
Show actual hero image when available, fallback to code window otherwise.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-30 13:51:52 +07:00
Kunthawat GreethongandClaude Opus 4.6 6b77cc355e fix: use "portableText" instead of "richtext" field type
EmDash uses "portableText" as the field type name, not "richtext".

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-30 13:44:08 +07:00
Kunthawat GreethongandClaude Opus 4.6 be63c72048 fix: convert homepage text fields to richtext for live editing
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 <[email protected]>
2026-04-30 13:40:49 +07:00
Kunthawat GreethongandClaude Opus 4.6 8094cec877 fix: enable live editing on homepage with {...homepage.edit.field} attributes
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 <[email protected]>
2026-04-30 13:11:02 +07:00
Kunthawat GreethongandClaude Opus 4.6 07725f9023 fix: add hero_image live editing with Image component from emdash/ui
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 <[email protected]>
2026-04-30 11:45:22 +07:00
Kunthawat GreethongandClaude Opus 4.6 1c928a1217 fix: enable live editing on homepage with {...homepage.edit.field} attributes
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 <[email protected]>
2026-04-30 11:32:53 +07:00
Kunthawat GreethongandClaude Opus 4.6 d0868d000c fix: remove singleton flag from homepage collection
Singleton collections don't support live editing in EmDash.
Converting to regular collection enables live editing.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-30 11:16:56 +07:00
Kunthawat GreethongandClaude Opus 4.6 79465ae005 fix: use slug 'main' for homepage singleton entry
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-30 11:15:12 +07:00
Kunthawat GreethongandClaude Opus 4.6 1298e3c018 fix: show featured_image on posts list page
Use featured_image.src/alt instead of featuredImage. Add post-image CSS.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-30 10:31:16 +07:00
Kunthawat GreethongandClaude Opus 4.6 3c07db0406 fix: use {id, src, alt} format for image fields
EmDash image fields require {id, src, alt} not {url, alt}.
Runtime type: { id, src, alt, width?, height? }

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-30 10:27:41 +07:00
Kunthawat GreethongandClaude Opus 4.6 ea8a725e52 fix: add _key to all PortableText blocks and spans
PortableText blocks in EmDash require a _key field. Added
to widgetAreas, sections, and all content entries.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-30 10:19:11 +07:00
Kunthawat GreethongandClaude Opus 4.6 6327f87a4c chore: ensure uploads directory exists at container startup
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-30 09:25:54 +07:00
Kunthawat GreethongandClaude Opus 4.6 433af238cf fix: remove $media wrapper from image fields in seed content
Image fields in EmDash seed content use { url, alt } format directly,
not {$media: { url, alt, filename } }

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-30 09:25:03 +07:00
Kunthawat GreethongandClaude Opus 4.6 b861e3bab8 fix: add slug to homepage content entry
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-29 23:51:23 +07:00
Kunthawat GreethongandClaude Opus 4.6 734fad181e feat: enable full dynamic homepage content via EmDash
- 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 <[email protected]>
2026-04-29 23:44:37 +07:00
Kunthawat GreethongandClaude Opus 4.6 620c63951f Remove user creation and chown (Easypanel manages permissions differently)
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-29 20:45:47 +07:00