Fix scope

This commit is contained in:
Matt Kane
2026-04-01 10:58:32 +01:00
parent 482a442f60
commit 2e863566b3
264 changed files with 578 additions and 578 deletions

View File

@@ -282,7 +282,7 @@ Extend EmDash with plugins that add hooks, storage, settings, and admin UI:
```ts title="astro.config.mjs"
import emdash from "emdash/astro";
import seoPlugin from "@emdashcms/plugin-seo";
import seoPlugin from "@emdash-cms/plugin-seo";
export default defineConfig({
integrations: [

View File

@@ -204,8 +204,8 @@ Plugins can extend the admin with pages and dashboard widgets. The integration g
```ts
// virtual:emdash/plugin-admins (generated)
import * as pluginAdmin0 from "@emdashcms/plugin-seo/admin";
import * as pluginAdmin1 from "@emdashcms/plugin-analytics/admin";
import * as pluginAdmin0 from "@emdash-cms/plugin-seo/admin";
import * as pluginAdmin1 from "@emdash-cms/plugin-analytics/admin";
export const pluginAdmins = {
seo: pluginAdmin0,
@@ -218,7 +218,7 @@ export const pluginAdmins = {
Plugin pages mount under `/_emdash/admin/plugins/:pluginId/*`:
```tsx
// @emdashcms/plugin-seo/src/admin.tsx
// @emdash-cms/plugin-seo/src/admin.tsx
export const pages = [
{
path: "settings",

View File

@@ -210,7 +210,7 @@ Plugins can run in two modes:
```ts
// astro.config.mjs
import { seoPlugin } from "@emdashcms/plugin-seo";
import { seoPlugin } from "@emdash-cms/plugin-seo";
emdash({
plugins: [seoPlugin({ maxTitleLength: 60 })],

View File

@@ -15,9 +15,9 @@ EmDash is a **pnpm monorepo** with multiple packages:
emdash/
├── packages/
│ ├── core/ # emdash — Astro integration, APIs, admin (main package)
│ ├── auth/ # @emdashcms/auth — Authentication (passkeys, OAuth, magic links)
│ ├── cloudflare/ # @emdashcms/cloudflare — Cloudflare adapter + sandbox runner
│ ├── admin/ # @emdashcms/admin — Admin React SPA
│ ├── auth/ # @emdash-cms/auth — Authentication (passkeys, OAuth, magic links)
│ ├── cloudflare/ # @emdash-cms/cloudflare — Cloudflare adapter + sandbox runner
│ ├── admin/ # @emdash-cms/admin — Admin React SPA
│ ├── create-emdash/ # create-emdash — project scaffolder
│ ├── gutenberg-to-portable-text/ # WordPress block → Portable Text converter
│ └── plugins/ # First-party plugins (each subdirectory is its own package)
@@ -279,7 +279,7 @@ Route files live in `packages/core/src/astro/routes/api/`. Follow these conventi
```ts
// packages/core/src/astro/routes/api/my-resource.ts
import type { APIRoute } from "astro";
import type { User } from "@emdashcms/auth";
import type { User } from "@emdash-cms/auth";
import { apiError, handleError } from "#api/error.js";
import { requirePerm } from "#api/authorize.js";
import { parseBody } from "#api/parse.js";
@@ -398,7 +398,7 @@ Use `import type` for type-only imports:
```ts
import type { Kysely } from "kysely";
import type { User } from "@emdashcms/auth";
import type { User } from "@emdash-cms/auth";
```
### Error Handling

View File

@@ -84,7 +84,7 @@ D1 supports [read replication](https://developers.cloudflare.com/d1/configuratio
EmDash uses the D1 Sessions API to manage this transparently. Enable it with the `session` option:
```js title="astro.config.mjs"
import { d1 } from "@emdashcms/cloudflare";
import { d1 } from "@emdash-cms/cloudflare";
export default defineConfig({
integrations: [

View File

@@ -349,7 +349,7 @@ In addition to local storage, EmDash supports external media providers for speci
```js title="astro.config.mjs"
import { defineConfig } from "astro/config";
import emdash from "emdash/astro";
import { cloudflareImages } from "@emdashcms/cloudflare";
import { cloudflareImages } from "@emdash-cms/cloudflare";
export default defineConfig({
integrations: [
@@ -381,7 +381,7 @@ export default defineConfig({
```js title="astro.config.mjs"
import { defineConfig } from "astro/config";
import emdash from "emdash/astro";
import { cloudflareStream } from "@emdashcms/cloudflare";
import { cloudflareStream } from "@emdash-cms/cloudflare";
export default defineConfig({
integrations: [
@@ -418,7 +418,7 @@ You can configure multiple providers. Each appears as a tab in the media picker:
```js title="astro.config.mjs"
import { defineConfig } from "astro/config";
import emdash from "emdash/astro";
import { cloudflareImages, cloudflareStream } from "@emdashcms/cloudflare";
import { cloudflareImages, cloudflareStream } from "@emdash-cms/cloudflare";
export default defineConfig({
integrations: [

View File

@@ -5,7 +5,7 @@ description: Monetize content with the x402 payment protocol — charge bots, no
import { Aside, Steps, Tabs, TabItem } from "@astrojs/starlight/components";
The `@emdashcms/x402` package adds [x402 payment protocol](https://www.x402.org/) support to any Astro site on Cloudflare. It works standalone — no dependency on EmDash core — but pairs well with EmDash's CMS fields for per-page pricing.
The `@emdash-cms/x402` package adds [x402 payment protocol](https://www.x402.org/) support to any Astro site on Cloudflare. It works standalone — no dependency on EmDash core — but pairs well with EmDash's CMS fields for per-page pricing.
x402 is an HTTP-native payment protocol. When a client requests a paid resource without payment, the server responds with `402 Payment Required` and machine-readable payment instructions. Agents and browsers that understand x402 can complete payment automatically and retry the request.
@@ -20,17 +20,17 @@ You can also enforce payment for all visitors, or check for payment headers with
<Tabs>
<TabItem label="pnpm">
```bash
pnpm add @emdashcms/x402
pnpm add @emdash-cms/x402
```
</TabItem>
<TabItem label="npm">
```bash
npm install @emdashcms/x402
npm install @emdash-cms/x402
```
</TabItem>
<TabItem label="yarn">
```bash
yarn add @emdashcms/x402
yarn add @emdash-cms/x402
```
</TabItem>
</Tabs>
@@ -41,7 +41,7 @@ Add the integration to your Astro config:
```js title="astro.config.mjs"
import { defineConfig } from "astro/config";
import { x402 } from "@emdashcms/x402";
import { x402 } from "@emdash-cms/x402";
export default defineConfig({
integrations: [
@@ -59,7 +59,7 @@ export default defineConfig({
Add the type reference so TypeScript knows about `Astro.locals.x402`:
```ts title="src/env.d.ts"
/// <reference types="@emdashcms/x402/locals" />
/// <reference types="@emdash-cms/x402/locals" />
```
## Basic Usage

View File

@@ -37,7 +37,7 @@ import { Card, CardGrid } from "@astrojs/starlight/components";
```bash
# Create a new EmDash site
npm create astro@latest -- --template @emdashcms/template-blog
npm create astro@latest -- --template @emdash-cms/template-blog
# Start the dev server
npm run dev

View File

@@ -83,7 +83,7 @@ Pages mount at `/_emdash/admin/plugins/<plugin-id>/<path>`.
```typescript title="src/components/SettingsPage.tsx"
import { useState, useEffect } from "react";
import { usePluginAPI } from "@emdashcms/admin";
import { usePluginAPI } from "@emdash-cms/admin";
export function SettingsPage() {
const api = usePluginAPI();
@@ -135,7 +135,7 @@ export function SettingsPage() {
Use `usePluginAPI()` to call your plugin's routes:
```typescript
import { usePluginAPI } from "@emdashcms/admin";
import { usePluginAPI } from "@emdash-cms/admin";
function MyComponent() {
const api = usePluginAPI();
@@ -177,7 +177,7 @@ admin: {
```typescript title="src/components/SEOWidget.tsx"
import { useState, useEffect } from "react";
import { usePluginAPI } from "@emdashcms/admin";
import { usePluginAPI } from "@emdash-cms/admin";
export function SEOWidget() {
const api = usePluginAPI();
@@ -253,7 +253,7 @@ import {
Pagination,
Alert,
Loading
} from "@emdashcms/admin";
} from "@emdash-cms/admin";
function SettingsPage() {
return (
@@ -309,7 +309,7 @@ export default {
},
format: "esm",
dts: true,
external: ["react", "react-dom", "emdash", "@emdashcms/admin"]
external: ["react", "react-dom", "emdash", "@emdash-cms/admin"]
};
```
</TabItem>
@@ -319,7 +319,7 @@ export default {
entry: ["src/index.ts", "src/admin.tsx"],
format: "esm",
dts: true,
external: ["react", "react-dom", "emdash", "@emdashcms/admin"]
external: ["react", "react-dom", "emdash", "@emdash-cms/admin"]
};
```
</TabItem>

View File

@@ -402,7 +402,7 @@ routes: {
Use the `usePluginAPI()` hook in admin components:
```typescript
import { usePluginAPI } from "@emdashcms/admin";
import { usePluginAPI } from "@emdash-cms/admin";
function SettingsPage() {
const api = usePluginAPI();

View File

@@ -89,10 +89,10 @@ routes: {
## Builder helpers
The `@emdashcms/blocks` package exports builder helpers for cleaner code:
The `@emdash-cms/blocks` package exports builder helpers for cleaner code:
```typescript
import { blocks, elements } from "@emdashcms/blocks";
import { blocks, elements } from "@emdash-cms/blocks";
const { header, form, section, stats } = blocks;
const { textInput, toggle, select, button } = elements;

View File

@@ -148,7 +148,7 @@ The `id` field must follow these rules:
// Valid IDs
"seo";
"audit-log";
"@emdashcms/plugin-forms";
"@emdash-cms/plugin-forms";
// Invalid IDs
"MyPlugin"; // No uppercase
@@ -445,7 +445,7 @@ export function myPlugin(options = {}): PluginDescriptor {
Plugin block components are automatically merged into `<PortableText>` — site authors don't need to import anything. User-provided components take precedence over plugin defaults.
<Aside type="tip">
The embeds plugin (`@emdashcms/plugin-embeds`) is a complete example of this pattern. It provides
The embeds plugin (`@emdash-cms/plugin-embeds`) is a complete example of this pattern. It provides
YouTube, Vimeo, Tweet, Bluesky, Mastodon, Gist, and Link Preview block types with both admin
editing fields and site-side Astro rendering components.
</Aside>

View File

@@ -102,7 +102,7 @@ For trusted plugins (your own code, or packages you install via npm), add them d
```typescript title="astro.config.mjs"
import { defineConfig } from "astro/config";
import { emdash } from "emdash/astro";
import seoPlugin from "@emdashcms/plugin-seo";
import seoPlugin from "@emdash-cms/plugin-seo";
export default defineConfig({
integrations: [

View File

@@ -135,8 +135,8 @@ Register plugins in your Astro configuration:
```typescript title="astro.config.mjs"
import { defineConfig } from "astro/config";
import { emdash } from "emdash/astro";
import seoPlugin from "@emdashcms/plugin-seo";
import auditLogPlugin from "@emdashcms/plugin-audit-log";
import seoPlugin from "@emdash-cms/plugin-seo";
import auditLogPlugin from "@emdash-cms/plugin-audit-log";
export default defineConfig({
integrations: [

View File

@@ -67,7 +67,7 @@ The bundle command finds your code through `package.json` exports:
| Export | Purpose | Built as |
| ------------ | ------- | -------- |
| `"."` | Main entry — used to extract the manifest | Externals: `emdash`, `@emdashcms/*` |
| `"."` | Main entry — used to extract the manifest | Externals: `emdash`, `@emdash-cms/*` |
| `"./sandbox"` | Backend code that runs in the sandbox | Fully self-contained (no externals) |
| `"./admin"` | Admin UI components | Fully self-contained |

View File

@@ -23,7 +23,7 @@ EmDash supports running plugins in two execution modes: **trusted** and **sandbo
Trusted plugins run in the same process as your Astro site. They are loaded from npm packages or local files and configured in `astro.config.mjs`:
```typescript title="astro.config.mjs"
import myPlugin from "@emdashcms/plugin-analytics";
import myPlugin from "@emdash-cms/plugin-analytics";
export default defineConfig({
integrations: [
@@ -54,7 +54,7 @@ To enable sandboxing, configure the sandbox runner in your Astro config:
export default defineConfig({
integrations: [
emdash({
sandboxRunner: "@emdashcms/cloudflare/sandbox",
sandboxRunner: "@emdash-cms/cloudflare/sandbox",
sandboxed: [
{
manifest: seoPluginManifest,

View File

@@ -49,7 +49,7 @@ database: libsql({
authToken: process.env.LIBSQL_AUTH_TOKEN,
});
// Cloudflare D1 (import from @emdashcms/cloudflare)
// Cloudflare D1 (import from @emdash-cms/cloudflare)
database: d1({ binding: "DB" });
```
@@ -90,7 +90,7 @@ See [Storage Options](/deployment/storage/) for details.
**Optional.** Array of EmDash plugins.
```js
import seoPlugin from "@emdashcms/plugin-seo";
import seoPlugin from "@emdash-cms/plugin-seo";
plugins: [seoPlugin()];
```
@@ -258,7 +258,7 @@ postgres({ connectionString: process.env.DATABASE_URL });
### `d1(config)`
Cloudflare D1 database. Import from `@emdashcms/cloudflare`.
Cloudflare D1 database. Import from `@emdash-cms/cloudflare`.
| Option | Type | Default | Description |
| ---------------- | -------- | -------------------- | --------------------------------------------------- |
@@ -417,7 +417,7 @@ EmDash generates types in `.emdash/types.ts`. Add to your `tsconfig.json`:
{
"compilerOptions": {
"paths": {
"@emdashcms/types": ["./.emdash/types.ts"]
"@emdash-cms/types": ["./.emdash/types.ts"]
}
}
}

View File

@@ -64,7 +64,7 @@ When you create a site from a theme, this happens:
Use `create-astro` with a template:
```bash
npm create astro@latest -- --template @emdashcms/template-blog
npm create astro@latest -- --template @emdash-cms/template-blog
```
Community themes work via GitHub:
@@ -125,18 +125,18 @@ EmDash provides official starter themes, each available in local (SQLite + files
| Theme | Description | Use Case |
| ----- | ----------- | -------- |
| `@emdashcms/template-blog` | Minimal blog with posts, pages, categories, and dark mode | Personal blogs, simple sites |
| `@emdashcms/template-portfolio` | Editorial-style portfolio with projects, serif typography (Playfair Display), and image-focused layouts | Freelancers, agencies, creatives |
| `@emdashcms/template-marketing` | Bold marketing site with custom Portable Text blocks (hero, features, testimonials, pricing, FAQ) | Landing pages, SaaS sites, product marketing |
| `@emdash-cms/template-blog` | Minimal blog with posts, pages, categories, and dark mode | Personal blogs, simple sites |
| `@emdash-cms/template-portfolio` | Editorial-style portfolio with projects, serif typography (Playfair Display), and image-focused layouts | Freelancers, agencies, creatives |
| `@emdash-cms/template-marketing` | Bold marketing site with custom Portable Text blocks (hero, features, testimonials, pricing, FAQ) | Landing pages, SaaS sites, product marketing |
### Cloudflare Variants
For deployment on Cloudflare Pages with D1 and R2, append `-cloudflare` to the template name:
```bash
npm create astro@latest -- --template @emdashcms/template-blog-cloudflare
npm create astro@latest -- --template @emdashcms/template-portfolio-cloudflare
npm create astro@latest -- --template @emdashcms/template-marketing-cloudflare
npm create astro@latest -- --template @emdash-cms/template-blog-cloudflare
npm create astro@latest -- --template @emdash-cms/template-portfolio-cloudflare
npm create astro@latest -- --template @emdash-cms/template-marketing-cloudflare
```
These variants include `wrangler.jsonc` for deployment configuration.