Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions blog-cloudflare/.agents/skills/building-emdash-site/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ Write `seed/seed.json` with collections, fields, taxonomies, menus, widgets, and
### 6. Run and verify

```bash
npx emdash dev # Start dev server (runs migrations + seeds, and generates types)
pnpm dev # Start the Astro dev server
```

The admin UI is at `http://localhost:4321/_emdash/admin`.
The runtime runs pending migrations on the first request and applies the bundled seed when the database is empty and setup has not been completed. The Astro integration generates `emdash-env.d.ts` when the server starts. The admin UI is at `http://localhost:4321/_emdash/admin`.

## Quick API Cheat Sheet

Expand Down Expand Up @@ -102,13 +102,12 @@ import { getByline, getBylineBySlug } from "emdash";
import {
PortableText,
Image,
Comments,
CommentForm,
WidgetArea,
EmDashHead,
EmDashBodyStart,
EmDashBodyEnd,
} from "emdash/ui";
import { Comments, CommentForm } from "emdash/ui/comments";
import LiveSearch from "emdash/ui/search";

// Page context (for plugin contributions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ For Cloudflare, replace `@astrojs/node` with `@astrojs/cloudflare` and add `@emd
## Dev Server

```bash
npx emdash dev # Start dev server (runs migrations, applies seed)
npx emdash dev --types # Start and generate types from schema
pnpm dev # Start the Astro dev server
npx emdash types # Refresh types from the running site
```

The admin UI is at `http://localhost:4321/_emdash/admin`. On first run, you'll go through setup to create an admin account.
The runtime runs pending migrations on the first request and applies the bundled seed when the database is empty and setup has not been completed. The Astro integration generates `emdash-env.d.ts` when the server starts. The admin UI is at `http://localhost:4321/_emdash/admin`. On first run, you'll go through setup to create an admin account.
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ Built-in comments system:

```astro
---
import { Comments, CommentForm } from "emdash/ui";
import { Comments, CommentForm } from "emdash/ui/comments";
---
<Comments collection="posts" contentId={post.data.id} threaded />
<CommentForm collection="posts" contentId={post.data.id} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ routes: {
{
"type": "section",
"text": "Configure your plugin settings below.",
"accessory": { "type": "button", "text": "Refresh", "action_id": "refresh" }
"accessory": { "type": "button", "label": "Refresh", "action_id": "refresh" }
}
```

Expand All @@ -132,13 +132,17 @@ routes: {
```json
{
"type": "stats",
"stats": [
{ "label": "Total", "value": "1,234", "trend": "+12%", "trend_direction": "up" },
"items": [
{ "label": "Total", "value": "1,234", "trend": "up", "description": "+12% vs last week" },
{ "label": "Active", "value": "567" }
]
}
```

- `items` — the array key is `items`, not `stats`
- `trend` — `"up"`, `"down"`, or `"neutral"`; renders an arrow icon next to the value
- `description` — secondary line beneath the value, for context such as "+12% vs last week"

### Table

```json
Expand All @@ -149,18 +153,24 @@ routes: {
{ "key": "status", "label": "Status" },
{ "key": "date", "label": "Date" }
],
"rows": [{ "name": "Item 1", "status": "Active", "date": "2025-01-01" }]
"rows": [{ "name": "Item 1", "status": "Active", "date": "2025-01-01" }],
"page_action_id": "browse_items",
"empty_text": "No items yet."
}
```

- `page_action_id` — required. The admin sends it as the `block_action` id when the user sorts a column or pages through results.
- `empty_text` — shown in place of the table when `rows` is empty
- `next_cursor` — set it to render a "Load more" control

### Actions

```json
{
"type": "actions",
"elements": [
{ "type": "button", "text": "Save", "action_id": "save", "style": "primary" },
{ "type": "button", "text": "Cancel", "action_id": "cancel" }
{ "type": "button", "label": "Save", "action_id": "save", "style": "primary" },
{ "type": "button", "label": "Cancel", "action_id": "cancel" }
]
}
```
Expand Down Expand Up @@ -196,12 +206,20 @@ routes: {
{
"type": "columns",
"columns": [
{ "blocks": [{ "type": "header", "text": "Left" }] },
{ "blocks": [{ "type": "header", "text": "Right" }] }
[
{ "type": "header", "text": "Usage" },
{ "type": "meter", "label": "Storage used", "value": 65 }
],
[
{ "type": "header", "text": "Activity" },
{ "type": "context", "text": "Last sync 2 hours ago" }
]
]
}
```

- `columns` — 2 or 3 columns, each one an array of blocks

### Chart (Timeseries)

```json
Expand Down Expand Up @@ -395,7 +413,7 @@ return {
```json
{
"type": "button",
"text": "Delete All",
"label": "Delete All",
"action_id": "delete_all",
"style": "danger",
"confirm": {
Expand Down
9 changes: 3 additions & 6 deletions blog-cloudflare/.agents/skills/emdash-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,11 @@ npx emdash login --url https://example.com -H "X-API-Key: secret123"

### Database Setup

Migrations and seed application happen automatically inside the runtime — there's no separate init/seed step. Just start the dev server (or deploy) and the first request runs pending migrations and applies the bundled seed if the database is empty.
For normal site startup, use the project's package script. The first request runs pending migrations and applies the bundled seed when the database is empty and setup has not been completed. The Astro integration generates `emdash-env.d.ts` when the server starts.

```bash
# Start dev server (runs migrations, applies seed on empty DB, starts Astro)
npx emdash dev

# Start dev server and generate types from remote
npx emdash dev --types
# Start the site with its package script
pnpm dev

# Export an existing database as a seed file
# (the runtime auto-discovers .emdash/seed.json on first boot;
Expand Down
4 changes: 2 additions & 2 deletions blog-cloudflare/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ This is an EmDash site -- a CMS built on Astro with a full admin UI.
## Commands

```bash
npx emdash dev # Start dev server (runs migrations, seeds, generates types)
npx emdash types # Regenerate TypeScript types from schema
pnpm dev # Start the Astro dev server
npx emdash types # Regenerate TypeScript types from a running site
```

The admin UI is at `http://localhost:4321/_emdash/admin`.
Expand Down
8 changes: 4 additions & 4 deletions blog-cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
"dependencies": {
"@astrojs/cloudflare": "^14.0.0",
"@astrojs/react": "^6.0.0",
"@emdash-cms/cloudflare": "^0.30.0",
"@emdash-cms/plugin-forms": "^0.2.4",
"@emdash-cms/cloudflare": "^0.34.0",
"@emdash-cms/plugin-forms": "^0.2.5",
"@emdash-cms/plugin-webhook-notifier": "^0.2.0",
"astro": "^7.0.0",
"emdash": "^0.30.0",
"emdash": "^0.34.0",
"react": "19.2.4",
"react-dom": "19.2.4"
},
"devDependencies": {
"@astrojs/check": "^0.9.7",
"@cloudflare/workers-types": "^4.20260305.1",
"wrangler": "^4.99.0"
"wrangler": "^4.123.0"
},
"packageManager": "pnpm@11.9.0+sha512.bd682d5d03fe525ef7c9fd6780c6884d1e756ac4c9c9fe00c538782824310dcf90e3ddc4f53835f06dfaebd5085e41855e0bcbb3b60de2ac5bbab89e5036f03b"
}
3 changes: 1 addition & 2 deletions blog-cloudflare/src/pages/posts/[slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import {
import {
Image,
PortableText,
Comments,
CommentForm,
WidgetArea,
} from "emdash/ui";
import { Comments, CommentForm } from "emdash/ui/comments";
import Base from "../../layouts/Base.astro";
import PostCard from "../../components/PostCard.astro";
import { getReadingTime } from "../../utils/reading-time";
Expand Down
12 changes: 8 additions & 4 deletions blog-cloudflare/src/worker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// Worker entry: Astro's fetch handler plus EmDash's scheduled() handler, which
// the Cron Trigger in wrangler.jsonc drives. PluginBridge is the sandbox
// Durable Object, re-exported here so its binding resolves.
export { default, PluginBridge } from "@emdash-cms/cloudflare/worker";
import handler, { createScheduledHandler, PluginBridge } from "@emdash-cms/cloudflare/worker";

export { PluginBridge };

export default {
...handler,
scheduled: createScheduledHandler(),
};
4 changes: 2 additions & 2 deletions blog-cloudflare/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"binding": "LOADER",
},
],
// Drives scheduled publishing, plugin cron, and maintenance (see src/worker.ts)
// General maintenance plus the bounded Media Usage lane (see src/worker.ts)
"triggers": {
"crons": ["* * * * *"],
"crons": ["* * * * *", "*/2 * * * *"],
},
}
7 changes: 3 additions & 4 deletions blog/.agents/skills/building-emdash-site/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ Write `seed/seed.json` with collections, fields, taxonomies, menus, widgets, and
### 6. Run and verify

```bash
npx emdash dev # Start dev server (runs migrations + seeds, and generates types)
pnpm dev # Start the Astro dev server
```

The admin UI is at `http://localhost:4321/_emdash/admin`.
The runtime runs pending migrations on the first request and applies the bundled seed when the database is empty and setup has not been completed. The Astro integration generates `emdash-env.d.ts` when the server starts. The admin UI is at `http://localhost:4321/_emdash/admin`.

## Quick API Cheat Sheet

Expand Down Expand Up @@ -102,13 +102,12 @@ import { getByline, getBylineBySlug } from "emdash";
import {
PortableText,
Image,
Comments,
CommentForm,
WidgetArea,
EmDashHead,
EmDashBodyStart,
EmDashBodyEnd,
} from "emdash/ui";
import { Comments, CommentForm } from "emdash/ui/comments";
import LiveSearch from "emdash/ui/search";

// Page context (for plugin contributions)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ For Cloudflare, replace `@astrojs/node` with `@astrojs/cloudflare` and add `@emd
## Dev Server

```bash
npx emdash dev # Start dev server (runs migrations, applies seed)
npx emdash dev --types # Start and generate types from schema
pnpm dev # Start the Astro dev server
npx emdash types # Refresh types from the running site
```

The admin UI is at `http://localhost:4321/_emdash/admin`. On first run, you'll go through setup to create an admin account.
The runtime runs pending migrations on the first request and applies the bundled seed when the database is empty and setup has not been completed. The Astro integration generates `emdash-env.d.ts` when the server starts. The admin UI is at `http://localhost:4321/_emdash/admin`. On first run, you'll go through setup to create an admin account.
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ Built-in comments system:

```astro
---
import { Comments, CommentForm } from "emdash/ui";
import { Comments, CommentForm } from "emdash/ui/comments";
---
<Comments collection="posts" contentId={post.data.id} threaded />
<CommentForm collection="posts" contentId={post.data.id} />
Expand Down
36 changes: 27 additions & 9 deletions blog/.agents/skills/creating-plugins/references/block-kit.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ routes: {
{
"type": "section",
"text": "Configure your plugin settings below.",
"accessory": { "type": "button", "text": "Refresh", "action_id": "refresh" }
"accessory": { "type": "button", "label": "Refresh", "action_id": "refresh" }
}
```

Expand All @@ -132,13 +132,17 @@ routes: {
```json
{
"type": "stats",
"stats": [
{ "label": "Total", "value": "1,234", "trend": "+12%", "trend_direction": "up" },
"items": [
{ "label": "Total", "value": "1,234", "trend": "up", "description": "+12% vs last week" },
{ "label": "Active", "value": "567" }
]
}
```

- `items` — the array key is `items`, not `stats`
- `trend` — `"up"`, `"down"`, or `"neutral"`; renders an arrow icon next to the value
- `description` — secondary line beneath the value, for context such as "+12% vs last week"

### Table

```json
Expand All @@ -149,18 +153,24 @@ routes: {
{ "key": "status", "label": "Status" },
{ "key": "date", "label": "Date" }
],
"rows": [{ "name": "Item 1", "status": "Active", "date": "2025-01-01" }]
"rows": [{ "name": "Item 1", "status": "Active", "date": "2025-01-01" }],
"page_action_id": "browse_items",
"empty_text": "No items yet."
}
```

- `page_action_id` — required. The admin sends it as the `block_action` id when the user sorts a column or pages through results.
- `empty_text` — shown in place of the table when `rows` is empty
- `next_cursor` — set it to render a "Load more" control

### Actions

```json
{
"type": "actions",
"elements": [
{ "type": "button", "text": "Save", "action_id": "save", "style": "primary" },
{ "type": "button", "text": "Cancel", "action_id": "cancel" }
{ "type": "button", "label": "Save", "action_id": "save", "style": "primary" },
{ "type": "button", "label": "Cancel", "action_id": "cancel" }
]
}
```
Expand Down Expand Up @@ -196,12 +206,20 @@ routes: {
{
"type": "columns",
"columns": [
{ "blocks": [{ "type": "header", "text": "Left" }] },
{ "blocks": [{ "type": "header", "text": "Right" }] }
[
{ "type": "header", "text": "Usage" },
{ "type": "meter", "label": "Storage used", "value": 65 }
],
[
{ "type": "header", "text": "Activity" },
{ "type": "context", "text": "Last sync 2 hours ago" }
]
]
}
```

- `columns` — 2 or 3 columns, each one an array of blocks

### Chart (Timeseries)

```json
Expand Down Expand Up @@ -395,7 +413,7 @@ return {
```json
{
"type": "button",
"text": "Delete All",
"label": "Delete All",
"action_id": "delete_all",
"style": "danger",
"confirm": {
Expand Down
9 changes: 3 additions & 6 deletions blog/.agents/skills/emdash-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,11 @@ npx emdash login --url https://example.com -H "X-API-Key: secret123"

### Database Setup

Migrations and seed application happen automatically inside the runtime — there's no separate init/seed step. Just start the dev server (or deploy) and the first request runs pending migrations and applies the bundled seed if the database is empty.
For normal site startup, use the project's package script. The first request runs pending migrations and applies the bundled seed when the database is empty and setup has not been completed. The Astro integration generates `emdash-env.d.ts` when the server starts.

```bash
# Start dev server (runs migrations, applies seed on empty DB, starts Astro)
npx emdash dev

# Start dev server and generate types from remote
npx emdash dev --types
# Start the site with its package script
pnpm dev

# Export an existing database as a seed file
# (the runtime auto-discovers .emdash/seed.json on first boot;
Expand Down
4 changes: 2 additions & 2 deletions blog/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ This is an EmDash site -- a CMS built on Astro with a full admin UI.
## Commands

```bash
npx emdash dev # Start dev server (runs migrations, seeds, generates types)
npx emdash types # Regenerate TypeScript types from schema
pnpm dev # Start the Astro dev server
npx emdash types # Regenerate TypeScript types from a running site
```

The admin UI is at `http://localhost:4321/_emdash/admin`.
Expand Down
Loading
Loading