Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
390d5c9
fix(admin): prevent crash on array fields with media items (#838)
lane711 May 28, 2026
bb035e1
chore: release v2.19.0
lane711 May 29, 2026
d258264
docs(www): add v2.19.0 to changelog and homepage
lane711 May 29, 2026
41fa173
docs(www): add "Using Emdash with SonicJS" blog guide
lane711 May 30, 2026
a593e1b
fix(www): escape literal braces in authentication docs MDX
lane711 May 30, 2026
92ffbb5
Add headless CMS comparison matrix page (/compare) (#845)
lane711 Jun 2, 2026
ceca3d8
Add CMS comparison matrix page (#846)
lane711 Jun 3, 2026
8e5a34b
docs: add document model POC plan
lane711 Jun 5, 2026
03fd5ab
feat(document-model): implement Phase 1 schema and services POC
lane711 Jun 5, 2026
b8fec35
feat(document-model): implement Phase 2 API routes
lane711 Jun 5, 2026
3aef574
feat(document-model): implement Phase 3 admin UI
lane711 Jun 5, 2026
273d0cb
feat(document-model): register POC document types on bootstrap
lane711 Jun 6, 2026
b65bd54
chore: add document model demo content seed
lane711 Jun 6, 2026
9df79df
feat(document-model): migrate testimonials to document model
lane711 Jun 6, 2026
2482858
fix: add migrations 037/038 to app Wrangler migrations folder
lane711 Jun 6, 2026
5af9dea
fix: move /ui routes before /:id to fix 404 on /admin/documents/ui
lane711 Jun 6, 2026
6f91a16
feat(plugins): closeout — email-log nav, reconciliation cron, PluginB…
lane711 Jun 6, 2026
74158d1
feat(document-model): integrate documents into existing content admin
lane711 Jun 6, 2026
f24567b
fix(document-model): drop destructive 038, renumber migration 037->043
lane711 Jun 6, 2026
52235c4
fix(document-model): fix saveDraft INSERT + registry schema_version; …
lane711 Jun 6, 2026
fab2fa3
fix(document-model): fix dead unpublish and escape testimonials templ…
lane711 Jun 6, 2026
a4a21b3
docs(document-model): rewrite plan as remediation runbook; record bet…
lane711 Jun 6, 2026
c0f0d4f
feat(document-model): Phase 2 — wire ACL into public API; close fail-…
lane711 Jun 6, 2026
96e29db
refactor(document-model): Phase 3 — route lists through repository ch…
lane711 Jun 7, 2026
1513285
fix(document-model): Phase 4 — admin UI correctness
lane711 Jun 7, 2026
8733a45
fix(document-model): mount /admin/testimonials router (was unreachable)
lane711 Jun 7, 2026
0dc4dca
feat(document-model): add blog_posts document type + migration 044 (O…
lane711 Jun 7, 2026
a4788c9
feat(document-model): back the blog_posts collection with the documen…
lane711 Jun 7, 2026
963a604
feat(document-model): All-view union for doc-backed collections + blo…
lane711 Jun 7, 2026
cd689de
feat(document-model): Phase 2b — per-document ACL on admin mutations
lane711 Jun 7, 2026
7aad0a9
test(document-model): route-integration tests for admin document API …
lane711 Jun 7, 2026
dfbc772
test(document-model): full route-integration + e2e coverage for Optio…
lane711 Jun 7, 2026
15823d7
feat(document-model): Phase 6 foundation — media as documents
lane711 Jun 7, 2026
cb009a3
feat(document-model): Phase 6 slice 1 — mirror media uploads to media…
lane711 Jun 7, 2026
4f52fcc
feat(document-model): Phase 6 slice 2 — admin-media mirror, reference…
lane711 Jun 7, 2026
e1a8c7e
feat(document-model): Phase 6 slice 3 — MediaDocumentService.list() (…
lane711 Jun 7, 2026
7d642a5
feat(document-model): make ALL content collections document-backed (g…
lane711 Jun 7, 2026
81655a9
docs(document-model): legacy content/media decommission readiness + o…
lane711 Jun 7, 2026
05dc756
feat(document-model): decommission step 2a — dashboard content count …
lane711 Jun 7, 2026
f6de2b1
feat(document-model): decommission step 2b — public content API reads…
lane711 Jun 7, 2026
be2fa4c
feat(document-model): decommission step 2c — flip remaining content r…
lane711 Jun 8, 2026
b18aa10
feat(document-model): decouple workflow plugin schema from content; a…
lane711 Jun 8, 2026
82b2b5b
fix(document-model): new items default to DRAFT, not auto-published (…
lane711 Jun 8, 2026
2e502f9
fix(document-model): resolve §7 regression-audit defects (D29–D45)
lane711 Jun 8, 2026
cc958e7
fix(document-model): green the doc-model e2e on a fresh install (D44,…
lane711 Jun 8, 2026
2d2c65f
fix: consolidate greenfield document migrations
lane711 Jun 8, 2026
e976be8
script cleanup
lane711 Jun 8, 2026
a2df51e
fix(document-model): v3 greenfield schema reset — documents + auth only
lane711 Jun 8, 2026
484ae22
add codegraph
lane711 Jun 8, 2026
4667e1e
chore: untrack core/dist, publish via CI, doc token tooling
lane711 Jun 8, 2026
d2416bd
fix(admin-collections): migrate to document_types schema
lane711 Jun 8, 2026
05602e5
feat(admin): show code-defined collections alongside database types
lane711 Jun 8, 2026
3040cd3
fix(admin-content): load fields from code-defined collections
lane711 Jun 8, 2026
a3e7d68
fix: remove cache from getCollectionFields for code collections
lane711 Jun 8, 2026
6760c22
debug: add logging to getCollectionFields
lane711 Jun 8, 2026
aa75dcd
debug: add logging to getCollection/getCollectionByName
lane711 Jun 8, 2026
d32543d
fix(plugins): new plugins register as inactive, preserve admin status…
lane711 Jun 8, 2026
8f79e30
chore: remove remaining tracked dist files + gitignore codegraph index
lane711 Jun 8, 2026
96716bb
fix(admin): fix slug check and content creation for code-defined coll…
lane711 Jun 8, 2026
979216e
Merge lane711/document-data-model into v3
lane711 Jun 8, 2026
cf771e9
feat(v3-merge): integrate v3 document model branch + fix test suite
lane711 Jun 8, 2026
fe715cc
version bump
lane711 Jun 8, 2026
a7a7bfc
refactor(seed): keep only default blog post
lane711 Jun 8, 2026
3662e28
refactor(db): use D1 migration tracking
lane711 Jun 8, 2026
3daa432
fix(seed): register only blog post type
lane711 Jun 8, 2026
5e509a2
fix(collections): mark code sources
lane711 Jun 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 10 additions & 4 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
{
"hooks": {
"userPromptSubmitHook": {
"command": "echo '\n\n---\n\n📋 TESTING REMINDER: After completing this task, create and run E2E tests to verify the changes work correctly. Tests should go in tests/e2e/ using Playwright.\n\n---\n'",
"description": "Remind Claude to create E2E tests for all changes"
}
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "echo '\n\n---\n\n📋 TESTING REMINDER: After completing this task, create and run E2E tests to verify the changes work correctly. Tests should go in tests/e2e/ using Playwright.\n\n---\n'"
}
]
}
]
}
}
16 changes: 16 additions & 0 deletions .codegraph/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CodeGraph data files
# These are local to each machine and should not be committed

# Database
*.db
*.db-wal
*.db-shm

# Cache
cache/

# Logs
*.log

# Hook markers
.dirty
59 changes: 59 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Publish to npm

on:
release:
types: [published]
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run (npm publish --dry-run)'
required: false
default: false
type: boolean

jobs:
publish:
name: Build and Publish
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
registry-url: 'https://registry.npmjs.org/'

- name: Install dependencies
run: npm ci

- name: Build core
run: npm run build:core

- name: Type check
run: npm run type-check

- name: Publish @sonicjs-cms/core
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
if [ "${{ inputs.dry_run }}" = "true" ]; then
npm publish --workspace=@sonicjs-cms/core --provenance --access public --dry-run
else
npm publish --workspace=@sonicjs-cms/core --provenance --access public
fi

- name: Publish create-sonicjs
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
if [ "${{ inputs.dry_run }}" = "true" ]; then
npm publish --workspace=create-sonicjs --provenance --access public --dry-run
else
npm publish --workspace=create-sonicjs --provenance --access public
fi
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ node_modules/
/build
# Package dist artifacts — generated by build, never committed
packages/*/dist/
packages/*/build

# Development
.wrangler/
Expand Down Expand Up @@ -84,4 +85,7 @@ coverage/
test-install/my-sonicjs-app/node_modules/
test-install/my-sonicjs-app/.wrangler/
test-install/my-sonicjs-app/.dev.vars
test-install/my-sonicjs-app/package-lock.json
test-install/my-sonicjs-app/package-lock.json

# Codegraph index (local, auto-generated)
.codegraph/
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ npm run lint --workspace=@sonicjs-cms/core

echo "Running type checks..."
npm run type-check

echo "Running unit tests..."
npm test
43 changes: 43 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,49 @@

These instructions mirror the workflow Claude Code already follows in Conductor so every coding agent behaves consistently.

## Token-Efficient Tooling (use FIRST, before grep/Read sprees)

This repo is indexed by **codegraph** (684 files, 5693 nodes). Use it as the default code-lookup tool. Hook also rewrites shell commands via **rtk** for 60-90% bash savings. Default response mode is **caveman** for terse output.

### Decision tree — code exploration

| Intent | Tool | Why |
|--------|------|-----|
| "How does X work / where does X live / trace flow X→Y" | `mcp__codegraph__codegraph_explore` | ONE call returns verbatim source grouped by file. Replaces many Read/Grep. |
| "Just the location of symbol named X" | `mcp__codegraph__codegraph_search` | Cheapest — name + path only. |
| "What calls this / what does this call / blast radius" | `codegraph_callers` / `codegraph_callees` / `codegraph_impact` | Edges already indexed; grep can't follow dynamic dispatch. |
| Pinpoint known file edit | `Read` + `Edit` | Codegraph not needed for known path. |
| Truly open-ended cross-cutting search | `Agent` w/ `Explore` or `cavecrew-investigator` | Compressed output, protects main context. |

**Rule:** Before any 3+ Grep/Read combo for "where is X", call `codegraph_explore` first. Treat codegraph as a pre-built index — don't re-run searches it already answers.

### rtk (Rust Token Killer)

- Bash commands auto-rewritten by hook — transparent, 0 overhead. No action needed.
- `rtk gain` to audit savings; `rtk discover` to find missed opportunities.
- Don't bypass rtk with raw shell unless debugging.

### caveman mode

- Active by default (full). Drops articles/filler. Code blocks, commits, security warnings stay normal.
- Toggle: `/caveman lite|full|ultra`, off via "stop caveman".

### Delegation — cavecrew subagents

Use when scope is bounded AND output would bloat main context:
- `cavecrew-investigator` — read-only locator ("where is X / what calls Y / map this dir"). ~60% smaller tool result vs vanilla Explore.
- `cavecrew-builder` — surgical 1-2 file edit (typo, single-fn rewrite, mechanical rename). Refuses 3+ files.
- `cavecrew-reviewer` — diff/PR review, one line per finding.

Skip cavecrew for: known-path edits, multi-file features, anything codegraph answers in one call.

### Anti-patterns (token waste)

- ❌ Running `grep -r` across the repo when `codegraph_search` would answer.
- ❌ Reading 5+ files to understand a flow — `codegraph_explore` returns the relevant slice.
- ❌ Spawning a subagent just to read one known file.
- ❌ Verbose narration. Caveman mode handles that — keep updates to one sentence.

## Project Structure & Stack
- Monorepo managed with npm workspaces. Core Hono + Workers code, routes, middleware, templates, plugins, utils, and DB lives in `packages/core/src`.
- Shared templates/components: `packages/templates/`. CLI scaffolder: `packages/create-app/`. Helper scripts: `packages/scripts/`.
Expand Down
78 changes: 22 additions & 56 deletions docs/ai/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ This project is a Cloudflare-native headless CMS built with **Hono.js** and Type
- **Frontend**: HTMX + HTML for admin interface
- **Deployment**: Wrangler CLI

## Token-Efficient Tooling (REQUIRED before grep/Read sprees)

Repo indexed by **codegraph**. Bash auto-proxied by **rtk**. Default reply mode **caveman**.

- **Code lookup**: call `mcp__codegraph__codegraph_explore` FIRST for any "how does X work / trace flow / where is X used" question. ONE call returns verbatim source grouped by file — replaces 5-20 Grep/Read calls.
- **Symbol location only**: `codegraph_search`.
- **Call graph / impact**: `codegraph_callers`, `codegraph_callees`, `codegraph_impact`.
- **Bash**: hook rewrites to `rtk <cmd>` automatically. `rtk gain` to audit savings.
- **Replies**: caveman mode (full) — drop articles/filler. Code/commits/security warnings stay normal. Toggle `/caveman` or "stop caveman".
- **Subagent delegation** (compressed output, ~60% smaller results): `cavecrew-investigator` (locate), `cavecrew-builder` (1-2 file edit), `cavecrew-reviewer` (diff review).

Anti-patterns: `grep -r` across repo when codegraph answers; reading 5+ files to learn a flow; spawning subagent for a known file; verbose narration.

## Development Workflow

1. **Plan First**: Read the codebase, understand the problem, and write a plan to project-plan.md
Expand Down Expand Up @@ -57,59 +70,12 @@ This project uses Claude's memory MCP server to maintain context across sessions
- **Team Knowledge**: Shared memory means consistent AI assistance for all developers
- **Learning**: Memory improves over time as more context is added

## Recent Development Updates (December 2024)

### Glass Morphism Design System Implementation

The admin interface has been completely redesigned using a glass morphism design pattern for a modern, cohesive look.

#### Design Components
- **Backdrop Effects**: `backdrop-blur-md bg-black/20` for glass effect
- **Borders**: `border border-white/10` for subtle definition
- **Shadows**: `shadow-xl` for depth and layering
- **Corners**: `rounded-xl` for modern appearance
- **Spacing**: `space-y-6` for consistent layout rhythm

#### Implemented Pages
1. **Settings Page** (`admin-settings.template.ts`):
- Comprehensive tabbed interface (General, Appearance, Security, Notifications, Storage)
- Interactive JavaScript for tab switching and form handling
- Bulk save functionality and reset options
- Full glass morphism styling

2. **Collections Pages**:
- **List Page**: Glass header, enhanced table, improved empty state, quick actions section
- **Form Page**: Glass breadcrumbs, consistent form styling, updated action buttons

3. **Content List Page**: Updated with glass morphism styling and improved button interactions

4. **Media Library**: Already implemented with glass morphism design patterns

#### Navigation Updates
- Added Settings link to admin sidebar
- Updated icon consistency across navigation items
- Proper navigation highlighting for current page

#### Design Patterns Established
- **Headers**: Glass cards with title, description, and primary actions
- **Tables**: Glass containers with enhanced styling and hover effects
- **Forms**: Glass backgrounds with consistent input styling
- **Buttons**: Gradient buttons with glass hover effects
- **Empty States**: Centered content with gradient icons and compelling CTAs
- **Quick Actions**: Grid layouts with hover animations

### Development Approach

When working on new admin pages or components:
1. Follow the established glass morphism patterns
2. Use consistent spacing (`space-y-6`) between sections
3. Apply glass backgrounds to major containers
4. Use gradient buttons for primary actions
5. Include hover effects and transitions for interactivity
6. Maintain consistent typography and color usage

### File Structure for Glass Morphism
- All admin page templates in `src/templates/pages/admin-*.template.ts`
- Shared layout in `src/templates/layouts/admin-layout-v2.template.ts`
- Component templates in `src/templates/components/`
- Route handlers in `src/routes/admin.ts`
## Admin UI

Glass morphism design system. Reference existing admin templates for patterns:
- Pages: `packages/core/src/templates/pages/admin-*.template.ts`
- Layout: `packages/core/src/templates/layouts/admin-layout-v2.template.ts`
- Components: `packages/core/src/templates/components/`
- Routes: `packages/core/src/routes/admin.ts`

Use `codegraph_explore` to inspect current patterns before building new pages.
Loading