Architecture
The repository
text
dwa-platform/
├── apps/
│ ├── extension/ VS Code extension + language server (TypeScript, LSP)
│ ├── theme-hub/ Theme portal (Cloudflare Workers, D1, R2, Better Auth, React)
│ ├── mcp/ MCP server (to be built)
│ └── site/ This documentation site (VitePress)
├── packages/
│ └── core/ Core v1 catalog and theme validator, shared
├── theme/
│ ├── DWA.css Reference theme (@theme DWA)
│ └── archive/ Old versions — do not modify or save
├── docs/language/ Language guide (reference), naming, visual catalog
├── examples/ Sample presentations
└── scripts/ test-changed.mjs: e2e journeys affected by a changeHow the pieces fit together
text
┌──────────────── Author's machine ─────────────────┐
│ │
Markdown ──┤ VS Code ── DWA extension ── Language server │
│ │ │ │
│ │ └── Chromium render (measure) │
│ └────── PPTX export │
│ │ │
└─────────────────┼──────────────────────────────────┘
│ HTTPS, revocable token
▼
Theme portal (Worker)
├── D1: permissions, themes, versions, reports
├── R2 or organization storage: private CSS
└── Claude API (optional): editor assistant- The shared core (
packages/core/) contains the language catalog (src/catalog.ts) and the theme validator (src/theme-rules/). The extension, the portal (server and editor) and this site import it as source: a rule is written only once. - The rest of the language core (
apps/extension/src/language/,render/,export/) does not depend on VS Code. It will be extracted when the MCP server needs it. - The extension calls the portal's extension API (
src/hub/↔apps/theme-hub/worker/routes/device.ts,/device-api/v2). Any API change keeps both sides compatible. - This site imports the shared catalog and the extension's
package.jsonto generate the class reference and the commands and settings; slide examples are rendered with Marp Core andtheme/DWA.cssat build time.
The portal in detail
text
apps/theme-hub/
├── worker/ API (Cloudflare Worker)
│ ├── routes/ account, orgs, themes, device (extension API)
│ ├── auth.ts Better Auth: email code + OIDC SSO
│ ├── storage.ts multicloud storage (R2, S3 compatible, Azure)
│ └── ai.ts editor assistant (Claude)
├── web/ React + shadcn/ui + Tailwind (Vite) interface, served by the Worker
│ └── src/editor/ editor, validation in a Web Worker, geometry measurement in an isolated iframe
├── migrations/ D1 database (SQLite)
└── tests/ e2e journeys: API, integrations, interface (Chromium)The extension in detail
| File | Role |
|---|---|
src/extension.ts | VS Code integration (commands, inline suggestions, export) |
src/server.ts | Language server: completion, hover, diagnostics, fixes |
src/language/catalog.ts | Re-exports the catalog from packages/core |
src/language/language.ts | Markdown parsing and rules |
src/language/activation.ts | Theme detection and activation |
src/language/transitions.ts | Space reserved for titles and legends (experimental) |
src/render/renderer.ts | Render measurement, in a separate process |
src/render/callout-fit.ts | Automatic callout sizing |
src/export/pptx.ts | PowerPoint export, independent of VS Code |
src/hub/hub.ts | Organization themes: sign-in, selection, verification, status bar, validation |
src/hub/hub-client.ts | Extension API client, independent of VS Code |
src/hub/store.ts | Themes installed in global storage, one active version per theme |
src/hub/theme-server.ts | 127.0.0.1 server that exposes installed themes to Marp |