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

@@ -1,5 +1,5 @@
{
"name": "@emdashcms/admin",
"name": "@emdash-cms/admin",
"version": "0.0.0",
"description": "Admin UI for EmDash CMS",
"type": "module",
@@ -27,7 +27,7 @@
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@emdashcms/blocks": "workspace:*",
"@emdash-cms/blocks": "workspace:*",
"@floating-ui/react": "^0.27.16",
"@phosphor-icons/react": "catalog:",
"@tanstack/react-query": "catalog:",

View File

@@ -28,7 +28,7 @@ import { useHotkeys } from "react-hotkeys-hook";
import { apiFetch } from "../lib/api/client";
import { useCurrentUser } from "../lib/api/current-user";
// Role levels (matching @emdashcms/auth)
// Role levels (matching @emdash-cms/auth)
const ROLE_ADMIN = 50;
const ROLE_EDITOR = 40;

View File

@@ -1,5 +1,5 @@
import { Input, Switch } from "@cloudflare/kumo";
import type { Element } from "@emdashcms/blocks";
import type { Element } from "@emdash-cms/blocks";
import * as React from "react";
interface BlockKitFieldWidgetProps {

View File

@@ -69,7 +69,7 @@ import { SaveButton } from "./SaveButton";
import { SeoPanel } from "./SeoPanel";
import { TaxonomySidebar } from "./TaxonomySidebar";
// Editor role level (40) from @emdashcms/auth
// Editor role level (40) from @emdash-cms/auth
const ROLE_EDITOR = 40;
export interface FieldDescriptor {

View File

@@ -41,7 +41,7 @@ import {
type Icon,
} from "@phosphor-icons/react";
import { X } from "@phosphor-icons/react";
import type { Element } from "@emdashcms/blocks";
import type { Element } from "@emdash-cms/blocks";
import { Extension, type Range } from "@tiptap/core";
import CharacterCount from "@tiptap/extension-character-count";
import Focus from "@tiptap/extension-focus";

View File

@@ -6,8 +6,8 @@
*/
import { CircleNotch, WarningCircle } from "@phosphor-icons/react";
import { BlockRenderer } from "@emdashcms/blocks";
import type { Block, BlockInteraction, BlockResponse } from "@emdashcms/blocks";
import { BlockRenderer } from "@emdash-cms/blocks";
import type { Block, BlockInteraction, BlockResponse } from "@emdash-cms/blocks";
import { useCallback, useEffect, useState } from "react";
import { apiFetch, API_BASE } from "../lib/api/client.js";

View File

@@ -6,8 +6,8 @@
*/
import { CircleNotch } from "@phosphor-icons/react";
import { BlockRenderer } from "@emdashcms/blocks";
import type { Block, BlockInteraction, BlockResponse } from "@emdashcms/blocks";
import { BlockRenderer } from "@emdash-cms/blocks";
import type { Block, BlockInteraction, BlockResponse } from "@emdash-cms/blocks";
import { useCallback, useEffect, useState } from "react";
import { apiFetch, API_BASE } from "../lib/api/client.js";

View File

@@ -28,7 +28,7 @@ import { cn } from "../lib/utils";
// Re-export for Shell.tsx and Header.tsx
export { KumoSidebar as Sidebar, useSidebar };
// Role levels (matching @emdashcms/auth)
// Role levels (matching @emdash-cms/auth)
const ROLE_ADMIN = 50;
const ROLE_EDITOR = 40;

View File

@@ -24,7 +24,7 @@ import {
Cube,
ListBullets,
} from "@phosphor-icons/react";
import type { Element } from "@emdashcms/blocks";
import type { Element } from "@emdash-cms/blocks";
import { Node, mergeAttributes } from "@tiptap/core";
import type { NodeViewProps } from "@tiptap/react";
import { ReactNodeViewRenderer, NodeViewWrapper } from "@tiptap/react";

View File

@@ -2,7 +2,7 @@
* Base API client configuration and shared types
*/
import type { Element } from "@emdashcms/blocks";
import type { Element } from "@emdash-cms/blocks";
export const API_BASE = "/_emdash/api";
@@ -72,7 +72,7 @@ export interface AdminManifest {
{
name?: string;
version?: string;
/** Package name for dynamic import (e.g., "@emdashcms/plugin-audit-log") */
/** Package name for dynamic import (e.g., "@emdash-cms/plugin-audit-log") */
package?: string;
/** Whether the plugin is enabled */
enabled?: boolean;
@@ -97,7 +97,7 @@ export interface AdminManifest {
name: string;
label: string;
fieldTypes: string[];
elements?: import("@emdashcms/blocks").Element[];
elements?: import("@emdash-cms/blocks").Element[];
}>;
/** Block types for Portable Text editor */
portableTextBlocks?: Array<{

View File

@@ -469,7 +469,7 @@ const contentEditRoute = createRoute({
component: ContentEditPage,
});
// Editor role level from @emdashcms/auth
// Editor role level from @emdash-cms/auth
const ROLE_EDITOR = 40;
function ContentEditPage() {
@@ -889,7 +889,7 @@ const commentsRoute = createRoute({
component: CommentsPage,
});
// Admin role level from @emdashcms/auth
// Admin role level from @emdash-cms/auth
const ROLE_ADMIN = 50;
function CommentsPage() {

View File

@@ -1,5 +1,5 @@
{
"name": "@emdashcms/auth",
"name": "@emdash-cms/auth",
"version": "0.0.0",
"description": "Passkey-first authentication for EmDash",
"type": "module",

View File

@@ -1,5 +1,5 @@
/**
* Kysely database adapter for @emdashcms/auth
* Kysely database adapter for @emdash-cms/auth
*/
import type { Kysely, Insertable, Selectable, Updateable } from "kysely";

View File

@@ -1,5 +1,5 @@
/**
* Configuration schema for @emdashcms/auth
* Configuration schema for @emdash-cms/auth
*/
import { z } from "zod";

View File

@@ -1,5 +1,5 @@
/**
* @emdashcms/auth - Passkey-first authentication for EmDash
* @emdash-cms/auth - Passkey-first authentication for EmDash
*
* Email is now handled by the plugin email pipeline (see PLUGIN-EMAIL.md).
* Auth functions accept an optional `email` send function instead of a
@@ -8,7 +8,7 @@
*
* @example
* ```ts
* import { auth } from '@emdashcms/auth'
* import { auth } from '@emdash-cms/auth'
*
* export default defineConfig({
* integrations: [

View File

@@ -1,5 +1,5 @@
/**
* Core types for @emdashcms/auth
* Core types for @emdash-cms/auth
*/
// ============================================================================

View File

@@ -1,5 +1,5 @@
{
"name": "@emdashcms/blocks",
"name": "@emdash-cms/blocks",
"version": "0.0.0",
"description": "Declarative plugin UI blocks for EmDash CMS",
"type": "module",

View File

@@ -1,5 +1,5 @@
{
"name": "@emdashcms/blocks-playground",
"name": "@emdash-cms/blocks-playground",
"version": "0.0.0",
"private": true,
"type": "module",
@@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
"@emdashcms/blocks": "workspace:*",
"@emdash-cms/blocks": "workspace:*",
"@cloudflare/kumo": "^1.1.0",
"@phosphor-icons/react": "catalog:",
"react": "catalog:",

View File

@@ -1,6 +1,6 @@
import { Sun, Moon, Share, Check, Trash, CaretDown, Warning, Plus } from "@phosphor-icons/react";
import { BlockRenderer, validateBlocks } from "@emdashcms/blocks";
import type { Block, BlockInteraction } from "@emdashcms/blocks";
import { BlockRenderer, validateBlocks } from "@emdash-cms/blocks";
import type { Block, BlockInteraction } from "@emdash-cms/blocks";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { blockCatalog } from "./block-defaults";

View File

@@ -1,4 +1,4 @@
import type { Block } from "@emdashcms/blocks";
import type { Block } from "@emdash-cms/blocks";
interface BlockCatalogEntry {
type: Block["type"];

View File

@@ -1,4 +1,4 @@
import type { Block, ChartSeries } from "@emdashcms/blocks";
import type { Block, ChartSeries } from "@emdash-cms/blocks";
export interface Template {
name: string;
@@ -508,7 +508,7 @@ export const templates: Template[] = [
},
{
type: "code",
code: 'import { blocks } from "@emdashcms/blocks";\n\nconst page = [\n\tblocks.header("Hello"),\n\tblocks.section("Welcome to EmDash."),\n];',
code: 'import { blocks } from "@emdash-cms/blocks";\n\nconst page = [\n\tblocks.header("Hello"),\n\tblocks.section("Welcome to EmDash."),\n];',
language: "ts",
},
{ type: "divider" },

View File

@@ -6,8 +6,8 @@ export default defineConfig({
plugins: [react(), tailwindcss()],
resolve: {
alias: {
// Resolve @emdashcms/blocks from source for HMR
"@emdashcms/blocks": new URL("../src/index.ts", import.meta.url).pathname,
// Resolve @emdash-cms/blocks from source for HMR
"@emdash-cms/blocks": new URL("../src/index.ts", import.meta.url).pathname,
},
},
});

View File

@@ -1,5 +1,5 @@
/**
* Server-safe exports for @emdashcms/blocks.
* Server-safe exports for @emdash-cms/blocks.
*
* Use this entry point in plugin route handlers and other server-side code
* that doesn't have React available. Provides builders, validation, and types

View File

@@ -1,5 +1,5 @@
{
"name": "@emdashcms/cloudflare",
"name": "@emdash-cms/cloudflare",
"version": "0.0.0",
"description": "Cloudflare adapters for EmDash - D1, R2, Access, and Worker Loader sandbox",
"type": "module",

View File

@@ -4,7 +4,7 @@
* This module is loaded at runtime when authenticating requests.
* It exports the `authenticate` function required by the auth provider interface.
*
* For config-time usage, import { access } from "@emdashcms/cloudflare" instead.
* For config-time usage, import { access } from "@emdash-cms/cloudflare" instead.
*/
export { authenticate } from "./cloudflare-access.js";

View File

@@ -4,7 +4,7 @@
* This is the config-time helper. Import it in your astro.config.mjs:
*
* ```ts
* import { cloudflareCache } from "@emdashcms/cloudflare";
* import { cloudflareCache } from "@emdash-cms/cloudflare";
*
* export default defineConfig({
* experimental: {
@@ -49,7 +49,7 @@ export type { CloudflareCacheConfig };
* ```ts
* import { defineConfig } from "astro/config";
* import cloudflare from "@astrojs/cloudflare";
* import { cloudflareCache } from "@emdashcms/cloudflare";
* import { cloudflareCache } from "@emdash-cms/cloudflare";
*
* export default defineConfig({
* adapter: cloudflare(),
@@ -75,7 +75,7 @@ export function cloudflareCache(
): CacheProviderConfig<CloudflareCacheConfig> {
return {
// Resolved by Vite/Astro at build time — points to the runtime module
entrypoint: "@emdashcms/cloudflare/cache",
entrypoint: "@emdash-cms/cloudflare/cache",
config,
};
}

View File

@@ -15,7 +15,7 @@
* headers from the response that next() returns.
*
* Do NOT import this at config time. Use cloudflareCache() from
* "@emdashcms/cloudflare" or "@emdashcms/cloudflare/cache/config" instead.
* "@emdash-cms/cloudflare" or "@emdash-cms/cloudflare/cache/config" instead.
*/
import type { CacheProviderFactory } from "astro";
@@ -41,7 +41,7 @@ const SWR_REGEX = /stale-while-revalidate=(\d+)/;
/** Internal headers to strip before returning responses to the client */
const INTERNAL_HEADERS = [STORED_AT_HEADER, MAX_AGE_HEADER, SWR_HEADER];
/** Default D1 bookmark cookie name (from @emdashcms/cloudflare d1 config) */
/** Default D1 bookmark cookie name (from @emdash-cms/cloudflare d1 config) */
const DEFAULT_BOOKMARK_COOKIE = "__ec_d1_bookmark";
export interface CloudflareCacheConfig {

View File

@@ -5,7 +5,7 @@
* Loaded at runtime via virtual module when database queries are needed.
*
* This module imports directly from cloudflare:workers to access the D1 binding.
* Do NOT import this at config time - use { d1 } from "@emdashcms/cloudflare" instead.
* Do NOT import this at config time - use { d1 } from "@emdash-cms/cloudflare" instead.
*/
import { env } from "cloudflare:workers";

View File

@@ -11,7 +11,7 @@
* @example
* ```ts
* // src/middleware.ts (in the preview Worker)
* import { createPreviewMiddleware } from "@emdashcms/cloudflare/db/do";
* import { createPreviewMiddleware } from "@emdash-cms/cloudflare/db/do";
*
* export const onRequest = createPreviewMiddleware({
* binding: "PREVIEW_DB",

View File

@@ -320,7 +320,7 @@ export const onRequest = defineMiddleware(async (context, next) => {
// Stash the DO database and user on locals so downstream middleware
// (runtime init, request-context) can use them. We can't use ALS directly
// because this middleware is in @emdashcms/cloudflare and resolves to a
// because this middleware is in @emdash-cms/cloudflare and resolves to a
// different AsyncLocalStorage instance than the emdash core package
// (workerd loads dist modules separately from Vite's source modules).
// The request-context middleware (same module context as the loader)

View File

@@ -1,5 +1,5 @@
/**
* @emdashcms/cloudflare
* @emdash-cms/cloudflare
*
* Cloudflare adapters for EmDash:
* - D1 database adapter
@@ -12,13 +12,13 @@
*
* For runtime exports (PluginBridge, authenticate), import from the specific
* runtime entrypoints:
* - @emdashcms/cloudflare/sandbox (PluginBridge, createSandboxRunner)
* - @emdashcms/cloudflare/auth (authenticate)
* - @emdash-cms/cloudflare/sandbox (PluginBridge, createSandboxRunner)
* - @emdash-cms/cloudflare/auth (authenticate)
*
* @example
* ```ts
* import emdash from "emdash/astro";
* import { d1, r2, access, sandbox } from "@emdashcms/cloudflare";
* import { d1, r2, access, sandbox } from "@emdash-cms/cloudflare";
*
* export default defineConfig({
* integrations: [
@@ -160,7 +160,7 @@ export interface AccessConfig {
*/
export function d1(config: D1Config): DatabaseDescriptor {
return {
entrypoint: "@emdashcms/cloudflare/db/d1",
entrypoint: "@emdash-cms/cloudflare/db/d1",
config,
type: "sqlite",
};
@@ -183,7 +183,7 @@ export type { PreviewDOConfig } from "./db/do-types.js";
*/
export function previewDatabase(config: PreviewDOConfig): DatabaseDescriptor {
return {
entrypoint: "@emdashcms/cloudflare/db/do",
entrypoint: "@emdash-cms/cloudflare/db/do",
config,
type: "sqlite",
};
@@ -205,7 +205,7 @@ export function previewDatabase(config: PreviewDOConfig): DatabaseDescriptor {
*/
export function playgroundDatabase(config: PreviewDOConfig): DatabaseDescriptor {
return {
entrypoint: "@emdashcms/cloudflare/db/playground",
entrypoint: "@emdash-cms/cloudflare/db/playground",
config,
type: "sqlite",
};
@@ -231,7 +231,7 @@ export function playgroundDatabase(config: PreviewDOConfig): DatabaseDescriptor
*/
export function r2(config: R2StorageConfig): StorageDescriptor {
return {
entrypoint: "@emdashcms/cloudflare/storage/r2",
entrypoint: "@emdash-cms/cloudflare/storage/r2",
config: { binding: config.binding, publicUrl: config.publicUrl },
};
}
@@ -257,7 +257,7 @@ export function r2(config: R2StorageConfig): StorageDescriptor {
export function access(config: AccessConfig): AuthDescriptor {
return {
type: "cloudflare-access",
entrypoint: "@emdashcms/cloudflare/auth",
entrypoint: "@emdash-cms/cloudflare/auth",
config,
};
}
@@ -274,7 +274,7 @@ export function access(config: AccessConfig): AuthDescriptor {
* ```
*/
export function sandbox(): string {
return "@emdashcms/cloudflare/sandbox";
return "@emdash-cms/cloudflare/sandbox";
}
// Re-export media providers (config-time)

View File

@@ -79,7 +79,7 @@ const IMAGES_ICON = `data:image/svg+xml,${encodeURIComponent('<svg xmlns="http:/
*
* @example
* ```ts
* import { cloudflareImages } from "@emdashcms/cloudflare";
* import { cloudflareImages } from "@emdash-cms/cloudflare";
*
* emdash({
* mediaProviders: [
@@ -102,7 +102,7 @@ export function cloudflareImages(
id: "cloudflare-images",
name: "Cloudflare Images",
icon: IMAGES_ICON,
entrypoint: "@emdashcms/cloudflare/media/images-runtime",
entrypoint: "@emdash-cms/cloudflare/media/images-runtime",
capabilities: {
browse: true,
search: false, // Images API doesn't support search

View File

@@ -83,7 +83,7 @@ const STREAM_ICON = `data:image/svg+xml,${encodeURIComponent('<svg xmlns="http:/
*
* @example
* ```ts
* import { cloudflareStream } from "@emdashcms/cloudflare";
* import { cloudflareStream } from "@emdash-cms/cloudflare";
*
* emdash({
* mediaProviders: [
@@ -106,7 +106,7 @@ export function cloudflareStream(
id: "cloudflare-stream",
name: "Cloudflare Stream",
icon: STREAM_ICON,
entrypoint: "@emdashcms/cloudflare/media/stream-runtime",
entrypoint: "@emdash-cms/cloudflare/media/stream-runtime",
capabilities: {
browse: true,
search: true,

View File

@@ -14,7 +14,7 @@
* ```typescript
* // astro.config.mjs
* import emdash from "emdash/astro";
* import { vectorizeSearch } from "@emdashcms/cloudflare/plugins";
* import { vectorizeSearch } from "@emdash-cms/cloudflare/plugins";
*
* export default defineConfig({
* integrations: [

View File

@@ -4,7 +4,7 @@
* This module is loaded at runtime when plugins need to be sandboxed.
* It imports cloudflare:workers and should NOT be imported at config time.
*
* For config-time usage, import { sandbox } from "@emdashcms/cloudflare" instead.
* For config-time usage, import { sandbox } from "@emdash-cms/cloudflare" instead.
*
*/

View File

@@ -7,7 +7,7 @@
*
* This module imports directly from cloudflare:workers to access
* the LOADER binding and PluginBridge export. It's only loaded
* when the user configures `sandboxRunner: "@emdashcms/cloudflare/sandbox"`.
* when the user configures `sandboxRunner: "@emdash-cms/cloudflare/sandbox"`.
*
*/

View File

@@ -39,7 +39,7 @@ export function generatePluginWrapper(manifest: PluginManifest, options?: Wrappe
return `
// =============================================================================
// Sandboxed Plugin Wrapper
// Generated by @emdashcms/cloudflare
// Generated by @emdash-cms/cloudflare
// Plugin: ${sanitizeComment(manifest.id)}@${sanitizeComment(manifest.version)}
// =============================================================================

View File

@@ -5,7 +5,7 @@
* This avoids the AWS SDK overhead and works with the native R2 API.
*
* This module imports directly from cloudflare:workers to access R2 bindings.
* Do NOT import this at config time - use { r2 } from "@emdashcms/cloudflare" instead.
* Do NOT import this at config time - use { r2 } from "@emdash-cms/cloudflare" instead.
*
* For Astro 6 / Cloudflare adapter v13+:
* - Bindings are accessed via `import { env } from 'cloudflare:workers'`

View File

@@ -6,7 +6,7 @@ describe("previewDatabase()", () => {
it("returns a sqlite DatabaseDescriptor with the DO entrypoint", () => {
const result = previewDatabase({ binding: "PREVIEW_DB" });
expect(result).toEqual({
entrypoint: "@emdashcms/cloudflare/db/do",
entrypoint: "@emdash-cms/cloudflare/db/do",
config: { binding: "PREVIEW_DB" },
type: "sqlite",
});
@@ -22,7 +22,7 @@ describe("playgroundDatabase()", () => {
it("returns a sqlite DatabaseDescriptor with the playground entrypoint", () => {
const result = playgroundDatabase({ binding: "PLAYGROUND_DB" });
expect(result).toEqual({
entrypoint: "@emdashcms/cloudflare/db/playground",
entrypoint: "@emdash-cms/cloudflare/db/playground",
config: { binding: "PLAYGROUND_DB" },
type: "sqlite",
});

View File

@@ -5,7 +5,7 @@
* Referenced via triple-slash directive in the generated emdash-env.d.ts.
*/
import type { User } from "@emdashcms/auth";
import type { User } from "@emdash-cms/auth";
import type { EmDashHandlers, EmDashManifest } from "./dist/types.d.mts";
@@ -30,7 +30,7 @@ declare global {
/**
* Per-session Durable Object database for playground mode.
*
* Set by the playground middleware (@emdashcms/cloudflare). Read by
* Set by the playground middleware (@emdash-cms/cloudflare). Read by
* the runtime middleware and request-context middleware to set the
* database in ALS for the current request.
*

View File

@@ -152,9 +152,9 @@
"test": "vitest"
},
"dependencies": {
"@emdashcms/admin": "workspace:*",
"@emdashcms/auth": "workspace:*",
"@emdashcms/gutenberg-to-portable-text": "workspace:*",
"@emdash-cms/admin": "workspace:*",
"@emdash-cms/auth": "workspace:*",
"@emdash-cms/gutenberg-to-portable-text": "workspace:*",
"@floating-ui/react": "^0.27.16",
"@modelcontextprotocol/sdk": "^1.26.0",
"@portabletext/toolkit": "^5.0.1",
@@ -205,7 +205,7 @@
"devDependencies": {
"@apidevtools/swagger-parser": "^12.1.0",
"@arethetypeswrong/cli": "catalog:",
"@emdashcms/blocks": "workspace:*",
"@emdash-cms/blocks": "workspace:*",
"@types/better-sqlite3": "^7.6.12",
"@types/pg": "^8.16.0",
"@types/sanitize-html": "^2.16.0",

View File

@@ -1,12 +1,12 @@
/**
* Authorization helpers for API routes
*
* Thin wrappers around @emdashcms/auth RBAC that return HTTP responses.
* Thin wrappers around @emdash-cms/auth RBAC that return HTTP responses.
* Auth middleware handles authentication; these handle authorization.
*/
import type { Permission, RoleLevel } from "@emdashcms/auth";
import { hasPermission, canActOnOwn } from "@emdashcms/auth";
import type { Permission, RoleLevel } from "@emdash-cms/auth";
import { hasPermission, canActOnOwn } from "@emdash-cms/auth";
import { apiError } from "./error.js";

View File

@@ -6,11 +6,11 @@
* The user opens a browser, logs in, enters the code, and the CLI gets
* an access + refresh token pair.
*
* Uses arctic for code generation and @emdashcms/auth for token utilities.
* Uses arctic for code generation and @emdash-cms/auth for token utilities.
*/
import { clampScopes } from "@emdashcms/auth";
import type { RoleLevel } from "@emdashcms/auth";
import { clampScopes } from "@emdash-cms/auth";
import type { RoleLevel } from "@emdash-cms/auth";
import { generateCodeVerifier } from "arctic";
import type { Kysely } from "kysely";

View File

@@ -4,12 +4,12 @@
* Implements the server side of the authorization code grant for MCP clients
* (Claude Desktop, VS Code, etc.) per the MCP authorization spec (draft).
*
* Uses arctic for PKCE challenge generation and @emdashcms/auth for token
* Uses arctic for PKCE challenge generation and @emdash-cms/auth for token
* utilities. Token infrastructure is shared with the device flow.
*/
import { clampScopes, computeS256Challenge } from "@emdashcms/auth";
import type { RoleLevel } from "@emdashcms/auth";
import { clampScopes, computeS256Challenge } from "@emdash-cms/auth";
import type { RoleLevel } from "@emdash-cms/auth";
import { generateCodeVerifier } from "arctic";
import type { Kysely } from "kysely";

View File

@@ -6,7 +6,7 @@
* role and reject disabled users.
*/
import { toRoleLevel, type RoleLevel } from "@emdashcms/auth";
import { toRoleLevel, type RoleLevel } from "@emdash-cms/auth";
import type { Kysely } from "kysely";
import type { Database } from "../../database/types.js";

View File

@@ -3,7 +3,7 @@ import { z } from "zod";
import { roleLevel } from "./common.js";
// ---------------------------------------------------------------------------
// WebAuthn credential schemas (matching @emdashcms/auth/passkey types)
// WebAuthn credential schemas (matching @emdash-cms/auth/passkey types)
// ---------------------------------------------------------------------------
const authenticatorTransport = z.enum(["usb", "nfc", "ble", "internal", "hybrid"]);

View File

@@ -4,7 +4,7 @@
* Astro integration for EmDash CMS (build-time only)
*
* For runtime APIs (loader, query functions, dialects), import from "emdash" directly.
* For Cloudflare-specific adapters (d1, r2, access), import from "@emdashcms/cloudflare".
* For Cloudflare-specific adapters (d1, r2, access), import from "@emdash-cms/cloudflare".
*/
// Locals types (for typing Astro.locals in API routes)
@@ -17,7 +17,7 @@ export type {
} from "./types.js";
// Storage adapters (for integration config)
// Note: For R2 bindings, use `r2()` from `@emdashcms/cloudflare`
// Note: For R2 bindings, use `r2()` from `@emdash-cms/cloudflare`
export { local, s3 } from "./storage/index.js";
export type { StorageDescriptor, LocalStorageConfig, S3StorageConfig } from "./storage/index.js";

View File

@@ -67,7 +67,7 @@ export interface PluginDescriptor<TOptions = Record<string, unknown>> {
id: string;
/** Plugin version (semver) */
version: string;
/** Module specifier to import (e.g., "@emdashcms/plugin-api-test") */
/** Module specifier to import (e.g., "@emdash-cms/plugin-api-test") */
entrypoint: string;
/**
* Options to pass to createPlugin(). Native format only.
@@ -87,7 +87,7 @@ export interface PluginDescriptor<TOptions = Record<string, unknown>> {
*
*/
format?: "standard" | "native";
/** Admin UI module specifier (e.g., "@emdashcms/plugin-audit-log/admin") */
/** Admin UI module specifier (e.g., "@emdash-cms/plugin-audit-log/admin") */
adminEntry?: string;
/** Module specifier for site-side Astro rendering components (must export `blockComponents`) */
componentsEntry?: string;
@@ -153,8 +153,8 @@ export interface EmDashConfig {
*
* @example
* ```ts
* import { auditLogPlugin } from "@emdashcms/plugin-audit-log";
* import { webhookNotifierPlugin } from "@emdashcms/plugin-webhook-notifier";
* import { auditLogPlugin } from "@emdash-cms/plugin-audit-log";
* import { webhookNotifierPlugin } from "@emdash-cms/plugin-webhook-notifier";
*
* emdash({
* plugins: [
@@ -178,7 +178,7 @@ export interface EmDashConfig {
* emdash({
* plugins: [trustedPlugin()], // runs in host
* sandboxed: [untrustedPlugin()], // runs in isolate
* sandboxRunner: "@emdashcms/sandbox-cloudflare",
* sandboxRunner: "@emdash-cms/sandbox-cloudflare",
* })
* ```
*/
@@ -190,7 +190,7 @@ export interface EmDashConfig {
* @example
* ```ts
* emdash({
* sandboxRunner: "@emdashcms/sandbox-cloudflare",
* sandboxRunner: "@emdash-cms/sandbox-cloudflare",
* })
* ```
*/
@@ -200,13 +200,13 @@ export interface EmDashConfig {
* Authentication configuration
*
* Use an auth adapter function from a platform package:
* - `access({ teamDomain: "..." })` from `@emdashcms/cloudflare`
* - `access({ teamDomain: "..." })` from `@emdash-cms/cloudflare`
*
* When an external auth provider is configured, passkey auth is disabled.
*
* @example
* ```ts
* import { access } from "@emdashcms/cloudflare";
* import { access } from "@emdash-cms/cloudflare";
*
* emdash({
* auth: access({
@@ -256,7 +256,7 @@ export interface EmDashConfig {
* ```ts
* emdash({
* marketplace: "https://marketplace.emdashcms.com",
* sandboxRunner: "@emdashcms/sandbox-cloudflare",
* sandboxRunner: "@emdash-cms/sandbox-cloudflare",
* })
* ```
*/
@@ -273,7 +273,7 @@ export interface EmDashConfig {
*
* Setup and auth middleware are skipped (the playground handles both).
*
* Requires `@emdashcms/cloudflare` as a dependency and a DO binding
* Requires `@emdash-cms/cloudflare` as a dependency and a DO binding
* in wrangler.jsonc.
*
* @example
@@ -281,7 +281,7 @@ export interface EmDashConfig {
* emdash({
* database: playgroundDatabase({ binding: "PLAYGROUND_DB" }),
* playground: {
* middlewareEntrypoint: "@emdashcms/cloudflare/db/playground-middleware",
* middlewareEntrypoint: "@emdash-cms/cloudflare/db/playground-middleware",
* },
* })
* ```
@@ -300,8 +300,8 @@ export interface EmDashConfig {
*
* @example
* ```ts
* import { cloudflareImages, cloudflareStream } from "@emdashcms/cloudflare";
* import { unsplash } from "@emdashcms/provider-unsplash";
* import { cloudflareImages, cloudflareStream } from "@emdash-cms/cloudflare";
* import { unsplash } from "@emdash-cms/provider-unsplash";
*
* emdash({
* mediaProviders: [

View File

@@ -55,19 +55,19 @@ import {
*/
function resolveAdminDist(): string {
const require = createRequire(import.meta.url);
const adminPath = require.resolve("@emdashcms/admin");
const adminPath = require.resolve("@emdash-cms/admin");
// Return the directory containing the built package (dist/)
return dirname(adminPath);
}
/**
* Resolve path to the admin package source directory.
* In dev mode, we alias @emdashcms/admin to the source so Vite processes it
* In dev mode, we alias @emdash-cms/admin to the source so Vite processes it
* directly — giving instant HMR instead of requiring a rebuild + restart.
*/
function resolveAdminSource(): string | undefined {
const require = createRequire(import.meta.url);
const adminPath = require.resolve("@emdashcms/admin");
const adminPath = require.resolve("@emdash-cms/admin");
// dist/index.js -> go up to package root, then into src/
const packageRoot = resolve(dirname(adminPath), "..");
const srcEntry = resolve(packageRoot, "src", "index.ts");
@@ -244,16 +244,16 @@ export function createViteConfig(
return {
resolve: {
dedupe: ["@emdashcms/admin", "react", "react-dom"],
dedupe: ["@emdash-cms/admin", "react", "react-dom"],
// Array form so more-specific entries are checked first.
// The styles.css alias must come before the package alias, otherwise
// Vite's prefix matching on "@emdashcms/admin" would resolve
// "@emdashcms/admin/styles.css" through the source directory.
// Vite's prefix matching on "@emdash-cms/admin" would resolve
// "@emdash-cms/admin/styles.css" through the source directory.
alias: [
// CSS: always dist (pre-compiled by @tailwindcss/cli)
{ find: "@emdashcms/admin/styles.css", replacement: resolve(adminDistPath, "styles.css") },
{ find: "@emdash-cms/admin/styles.css", replacement: resolve(adminDistPath, "styles.css") },
// JS: source in dev (HMR), dist in build
{ find: "@emdashcms/admin", replacement: useSource ? adminSourcePath : adminDistPath },
{ find: "@emdash-cms/admin", replacement: useSource ? adminSourcePath : adminDistPath },
],
},
// eslint-disable-next-line typescript-eslint(no-unsafe-type-assertion) -- Monorepo has both vite 6 (docs) and vite 7 (core). tsgo resolves correctly.
@@ -264,7 +264,7 @@ export function createViteConfig(
// ssr.external conflicts with @cloudflare/vite-plugin's resolve.external validation.
ssr: cloudflare
? {
noExternal: ["emdash", "@emdashcms/admin"],
noExternal: ["emdash", "@emdash-cms/admin"],
// Pre-bundle EmDash's runtime deps for workerd. Without this,
// Vite discovers them one-by-one on first request, causing workerd
// to enter "worker cancelled" state on cold cache.
@@ -288,10 +288,10 @@ export function createViteConfig(
"emdash > sax",
// Deeper transitive deps
"emdash > sanitize-html > parse5",
"emdash > @emdashcms/gutenberg-to-portable-text > @wordpress/block-serialization-default-parser",
"emdash > @emdashcms/auth > @oslojs/crypto/ecdsa",
"emdash > @emdashcms/auth > @oslojs/crypto/sha2",
"emdash > @emdashcms/auth > @oslojs/webauthn",
"emdash > @emdash-cms/gutenberg-to-portable-text > @wordpress/block-serialization-default-parser",
"emdash > @emdash-cms/auth > @oslojs/crypto/ecdsa",
"emdash > @emdash-cms/auth > @oslojs/crypto/sha2",
"emdash > @emdash-cms/auth > @oslojs/webauthn",
// React (commonly used, may be hoisted)
"react",
"react/jsx-dev-runtime",
@@ -301,7 +301,7 @@ export function createViteConfig(
// Top-level deps (use astro > path for pnpm compat)
"astro > zod/v4",
"astro > zod/v4/core",
"@emdashcms/cloudflare > kysely-d1",
"@emdash-cms/cloudflare > kysely-d1",
// Astro internal deps not covered by @astrojs/cloudflare adapter
"astro/virtual-modules/middleware.js",
"astro/virtual-modules/live-config",
@@ -314,14 +314,14 @@ export function createViteConfig(
}
: {
external: NODE_NATIVE_EXTERNALS,
noExternal: ["emdash", "@emdashcms/admin"],
noExternal: ["emdash", "@emdash-cms/admin"],
},
optimizeDeps: {
// When using source, don't pre-bundle JS — let Vite transform on the fly for HMR.
// When using dist, pre-bundle to avoid re-optimization on first hydration.
include: useSource
? ["@astrojs/react/client.js"]
: ["@emdashcms/admin", "@astrojs/react/client.js"],
: ["@emdash-cms/admin", "@astrojs/react/client.js"],
exclude: cloudflare ? [] : NODE_NATIVE_EXTERNALS,
},
};

View File

@@ -10,8 +10,8 @@
* we know setup is complete and users exist.
*/
import type { User, RoleLevel } from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import type { User, RoleLevel } from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { defineMiddleware } from "astro:middleware";
import { ulid } from "ulidx";
// Import auth provider via virtual module (statically bundled)
@@ -47,7 +47,7 @@ declare global {
}
}
// Role level constants (matching @emdashcms/auth)
// Role level constants (matching @emdash-cms/auth)
const ROLE_ADMIN = 50;
/**

View File

@@ -46,7 +46,7 @@ export const onRequest = defineMiddleware(async (context, next) => {
const { user } = context.locals;
const isEditor = !!user && user.role >= 30;
// Playground mode: the playground middleware (from @emdashcms/cloudflare) stashes
// Playground mode: the playground middleware (from @emdash-cms/cloudflare) stashes
// the per-session DO database on locals.__playgroundDb. We set it via ALS here
// (same module instance as the loader) so getDb() picks it up correctly.
const playgroundDb = context.locals.__playgroundDb;

View File

@@ -6,7 +6,7 @@
* together with the admin app and available via React context.
*/
import { AdminApp } from "@emdashcms/admin";
import { AdminApp } from "@emdash-cms/admin";
// @ts-ignore - virtual module generated by integration
import { pluginAdmins } from "virtual:emdash/admin-registry";

View File

@@ -5,7 +5,7 @@
* This page serves the EmDash admin React SPA.
* AdminWrapper imports plugin admin modules and passes them to AdminApp.
*/
import "@emdashcms/admin/styles.css";
import "@emdash-cms/admin/styles.css";
// Use package-qualified import so Astro generates a proper module URL
// (relative imports resolve to absolute paths which break client hydration)
import AdminWrapper from "emdash/routes/PluginRegistry";

View File

@@ -10,8 +10,8 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { Role, roleFromLevel } from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { Role, roleFromLevel } from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { apiError, apiSuccess, handleError } from "#api/error.js";
import { isParseError, parseBody } from "#api/parse.js";

View File

@@ -10,8 +10,8 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { Role, roleFromLevel } from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { Role, roleFromLevel } from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { apiError, apiSuccess, handleError } from "#api/error.js";
import { isParseError, parseBody } from "#api/parse.js";

View File

@@ -4,7 +4,7 @@
* DELETE /_emdash/api/admin/api-tokens/:id — Revoke a token
*/
import { Role } from "@emdashcms/auth";
import { Role } from "@emdash-cms/auth";
import type { APIRoute } from "astro";
import { apiError, handleError, unwrapResult } from "#api/error.js";

View File

@@ -5,7 +5,7 @@
* POST /_emdash/api/admin/api-tokens — Create a new token
*/
import { Role } from "@emdashcms/auth";
import { Role } from "@emdash-cms/auth";
import type { APIRoute } from "astro";
import { z } from "zod";

View File

@@ -1,4 +1,4 @@
import { Role } from "@emdashcms/auth";
import { Role } from "@emdash-cms/auth";
import type { APIRoute } from "astro";
import { requirePerm } from "#api/authorize.js";

View File

@@ -1,4 +1,4 @@
import { Role } from "@emdashcms/auth";
import { Role } from "@emdash-cms/auth";
import type { APIRoute } from "astro";
import { requirePerm } from "#api/authorize.js";

View File

@@ -6,7 +6,7 @@
* DELETE /_emdash/api/admin/oauth-clients/:id — Delete a client
*/
import { Role } from "@emdashcms/auth";
import { Role } from "@emdash-cms/auth";
import type { APIRoute } from "astro";
import { z } from "zod";

View File

@@ -5,7 +5,7 @@
* POST /_emdash/api/admin/oauth-clients — Register a new OAuth client
*/
import { Role } from "@emdashcms/auth";
import { Role } from "@emdash-cms/auth";
import type { APIRoute } from "astro";
import { z } from "zod";

View File

@@ -4,8 +4,8 @@
* POST /_emdash/api/admin/users/:id/disable - Soft-disable a user
*/
import { Role } from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { Role } from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import type { APIRoute } from "astro";
import { apiError, apiSuccess, handleError } from "#api/error.js";

View File

@@ -4,8 +4,8 @@
* POST /_emdash/api/admin/users/:id/enable - Re-enable a disabled user
*/
import { Role } from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { Role } from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import type { APIRoute } from "astro";
import { apiError, apiSuccess, handleError } from "#api/error.js";

View File

@@ -5,8 +5,8 @@
* PUT /_emdash/api/admin/users/:id - Update user
*/
import { Role } from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { Role } from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import type { APIRoute } from "astro";
import { apiError, apiSuccess, handleError } from "#api/error.js";

View File

@@ -6,8 +6,8 @@
* Admin-initiated account recovery — sends a recovery magic link to the user's email.
*/
import { Role, sendMagicLink, type MagicLinkConfig } from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { Role, sendMagicLink, type MagicLinkConfig } from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import type { APIRoute } from "astro";
import { apiError, apiSuccess, handleError } from "#api/error.js";

View File

@@ -4,8 +4,8 @@
* GET /_emdash/api/admin/users - List users with search, filter, pagination
*/
import { Role } from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { Role } from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import type { APIRoute } from "astro";
import { apiError, apiSuccess, handleError } from "#api/error.js";

View File

@@ -29,7 +29,7 @@ import { runMigrations } from "#db/migrations/runner.js";
const DEV_USER_EMAIL = "dev@emdash.local";
const DEV_USER_NAME = "Dev Admin";
// RBAC role levels (matching @emdashcms/auth)
// RBAC role levels (matching @emdash-cms/auth)
const ROLE_ADMIN = 50;
async function handleDevBypass(context: Parameters<APIRoute>[0]): Promise<Response> {
@@ -49,7 +49,7 @@ async function handleDevBypass(context: Parameters<APIRoute>[0]): Promise<Respon
// Ensure migrations are run
await runMigrations(emdash.db);
// Find or create dev user (direct DB access to avoid @emdashcms/auth import issues in dev)
// Find or create dev user (direct DB access to avoid @emdash-cms/auth import issues in dev)
const existingUser = await emdash.db
.selectFrom("users")
.selectAll()

View File

@@ -9,8 +9,8 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { validateInvite, InviteError, roleFromLevel } from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { validateInvite, InviteError, roleFromLevel } from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { apiError, apiSuccess, handleError } from "#api/error.js";

View File

@@ -9,9 +9,9 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { completeInvite, InviteError } from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { verifyRegistrationResponse, registerPasskey } from "@emdashcms/auth/passkey";
import { completeInvite, InviteError } from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { verifyRegistrationResponse, registerPasskey } from "@emdash-cms/auth/passkey";
import { apiError, apiSuccess, handleError } from "#api/error.js";
import { isParseError, parseBody } from "#api/parse.js";

View File

@@ -13,8 +13,8 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { createInvite, InviteError, Role } from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { createInvite, InviteError, Role } from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { apiError, apiSuccess, handleError } from "#api/error.js";
import { isParseError, parseBody } from "#api/parse.js";

View File

@@ -11,8 +11,8 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { sendMagicLink, type MagicLinkConfig } from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { sendMagicLink, type MagicLinkConfig } from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { apiError, apiSuccess } from "#api/error.js";
import { isParseError, parseBody } from "#api/parse.js";

View File

@@ -9,8 +9,8 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { verifyMagicLink, MagicLinkError } from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { verifyMagicLink, MagicLinkError } from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { apiError } from "#api/error.js";
import { isSafeRedirect } from "#api/redirect.js";

View File

@@ -8,7 +8,7 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { createAuthorizationUrl, type OAuthConsumerConfig } from "@emdashcms/auth";
import { createAuthorizationUrl, type OAuthConsumerConfig } from "@emdash-cms/auth";
import { createOAuthStateStore } from "#auth/oauth-state-store.js";

View File

@@ -14,8 +14,8 @@ import {
Role,
type OAuthConsumerConfig,
type RoleLevel,
} from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
} from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { createOAuthStateStore } from "#auth/oauth-state-store.js";

View File

@@ -8,7 +8,7 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { apiError, apiSuccess, handleError } from "#api/error.js";
import { isParseError, parseBody } from "#api/parse.js";

View File

@@ -8,7 +8,7 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { apiError, apiSuccess, handleError } from "#api/error.js";

View File

@@ -10,8 +10,8 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { generateAuthenticationOptions } from "@emdashcms/auth/passkey";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { generateAuthenticationOptions } from "@emdash-cms/auth/passkey";
import { apiError, apiSuccess, handleError } from "#api/error.js";
import { isParseError, parseOptionalBody } from "#api/parse.js";

View File

@@ -8,8 +8,8 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { generateRegistrationOptions } from "@emdashcms/auth/passkey";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { generateRegistrationOptions } from "@emdash-cms/auth/passkey";
import { apiError, apiSuccess, handleError } from "#api/error.js";
import { isParseError, parseOptionalBody } from "#api/parse.js";

View File

@@ -8,8 +8,8 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { verifyRegistrationResponse, registerPasskey } from "@emdashcms/auth/passkey";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { verifyRegistrationResponse, registerPasskey } from "@emdash-cms/auth/passkey";
import { apiError, apiSuccess } from "#api/error.js";
import { isParseError, parseBody } from "#api/parse.js";

View File

@@ -8,8 +8,8 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { authenticateWithPasskey } from "@emdashcms/auth/passkey";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { authenticateWithPasskey } from "@emdash-cms/auth/passkey";
import { apiError, apiSuccess, handleError } from "#api/error.js";
import { isParseError, parseBody } from "#api/parse.js";

View File

@@ -9,9 +9,9 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { completeSignup, SignupError } from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { verifyRegistrationResponse, registerPasskey } from "@emdashcms/auth/passkey";
import { completeSignup, SignupError } from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { verifyRegistrationResponse, registerPasskey } from "@emdash-cms/auth/passkey";
import { apiError, apiSuccess, handleError } from "#api/error.js";
import { isParseError, parseBody } from "#api/parse.js";

View File

@@ -9,8 +9,8 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { requestSignup } from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { requestSignup } from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { apiError, apiSuccess } from "#api/error.js";
import { isParseError, parseBody } from "#api/parse.js";

View File

@@ -9,8 +9,8 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { validateSignupToken, SignupError, roleFromLevel } from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { validateSignupToken, SignupError, roleFromLevel } from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { apiError, apiSuccess, handleError } from "#api/error.js";

View File

@@ -6,7 +6,7 @@
* DELETE /_emdash/api/content/{collection}/{id} - Delete content
*/
import { hasPermission, type Permission } from "@emdashcms/auth";
import { hasPermission, type Permission } from "@emdash-cms/auth";
import type { APIRoute } from "astro";
import { requirePerm, requireOwnerPerm } from "#api/authorize.js";

View File

@@ -6,7 +6,7 @@
* Accepts WXR file and import configuration, imports content into the database.
*/
import { gutenbergToPortableText } from "@emdashcms/gutenberg-to-portable-text";
import { gutenbergToPortableText } from "@emdash-cms/gutenberg-to-portable-text";
import type { APIRoute } from "astro";
import {
parseWxrString,

View File

@@ -5,7 +5,7 @@
* POST /_emdash/api/settings/email/test — send a test email through the full pipeline
*/
import { escapeHtml } from "@emdashcms/auth";
import { escapeHtml } from "@emdash-cms/auth";
import type { APIRoute } from "astro";
import { z } from "zod";

View File

@@ -8,9 +8,9 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { Role } from "@emdashcms/auth";
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { verifyRegistrationResponse, registerPasskey } from "@emdashcms/auth/passkey";
import { Role } from "@emdash-cms/auth";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { verifyRegistrationResponse, registerPasskey } from "@emdash-cms/auth/passkey";
import { apiError, apiSuccess, handleError } from "#api/error.js";
import { isParseError, parseBody } from "#api/parse.js";

View File

@@ -8,8 +8,8 @@ import type { APIRoute } from "astro";
export const prerender = false;
import { createKyselyAdapter } from "@emdashcms/auth/adapters/kysely";
import { generateRegistrationOptions } from "@emdashcms/auth/passkey";
import { createKyselyAdapter } from "@emdash-cms/auth/adapters/kysely";
import { generateRegistrationOptions } from "@emdash-cms/auth/passkey";
import { apiError, apiSuccess, handleError } from "#api/error.js";
import { isParseError, parseBody } from "#api/parse.js";

View File

@@ -31,7 +31,7 @@ import { applySeed } from "#seed/apply.js";
import { loadSeed } from "#seed/load.js";
import { validateSeed } from "#seed/validate.js";
// RBAC role levels (matching @emdashcms/auth)
// RBAC role levels (matching @emdash-cms/auth)
const ROLE_ADMIN = 50;
const DEV_USER_EMAIL = "dev@emdash.local";
@@ -72,7 +72,7 @@ async function handleDevBypass(context: Parameters<APIRoute>[0]): Promise<Respon
const options = new OptionsRepository(emdash.db);
// Find or create dev user (direct DB access to avoid @emdashcms/auth import issues in dev)
// Find or create dev user (direct DB access to avoid @emdash-cms/auth import issues in dev)
const existingUser = await emdash.db
.selectFrom("users")
.selectAll()

View File

@@ -24,7 +24,7 @@
* });
* ```
*
* For Cloudflare R2 bindings, use `r2()` from `@emdashcms/cloudflare`.
* For Cloudflare R2 bindings, use `r2()` from `@emdash-cms/cloudflare`.
*/
import type { StorageDescriptor, S3StorageConfig, LocalStorageConfig } from "./types.js";

View File

@@ -4,7 +4,7 @@
* Re-exports config-time adapter functions and types.
* Runtime entrypoints are in the emdash core package.
*
* For Cloudflare R2 bindings, use `r2()` from `@emdashcms/cloudflare`.
* For Cloudflare R2 bindings, use `r2()` from `@emdash-cms/cloudflare`.
*/
// Config-time adapter functions

View File

@@ -6,7 +6,7 @@
* - Runtime loads entrypoint and calls createStorage(config)
*
* Each adapter is responsible for accessing its own bindings.
* For Cloudflare (R2), use `@emdashcms/cloudflare` package.
* For Cloudflare (R2), use `@emdash-cms/cloudflare` package.
*/
import type { Storage } from "../../index.js";
@@ -27,7 +27,7 @@ export interface StorageDescriptor {
* Each adapter accesses its own bindings directly:
* - S3: uses credentials from config
* - Local: uses filesystem path from config
* - R2: use @emdashcms/cloudflare package
* - R2: use @emdash-cms/cloudflare package
*/
export type CreateStorageFn = (config: Record<string, unknown>) => Storage;

View File

@@ -5,7 +5,7 @@
* the locals interface that the middleware provides.
*/
import type { Element } from "@emdashcms/blocks";
import type { Element } from "@emdash-cms/blocks";
import type { Kysely } from "kysely";
// Re-export core types
@@ -45,7 +45,7 @@ export interface ManifestCollection {
*/
export interface ManifestPlugin {
version?: string;
/** Package name for dynamic import (e.g., "@emdashcms/plugin-audit-log") */
/** Package name for dynamic import (e.g., "@emdash-cms/plugin-audit-log") */
package?: string;
/** Whether the plugin is currently enabled */
enabled?: boolean;

View File

@@ -1,7 +1,7 @@
/**
* API token generation and hashing utilities.
*
* Re-exports from @emdashcms/auth which owns the implementations.
* Re-exports from @emdash-cms/auth which owns the implementations.
* Uses Oslo.js (@oslojs/crypto, @oslojs/encoding) for all crypto.
*
* Token format: `ec_pat_<base64url>` (Personal Access Tokens)
@@ -22,4 +22,4 @@ export {
hasScope,
computeS256Challenge,
type ApiTokenScope,
} from "@emdashcms/auth";
} from "@emdash-cms/auth";

View File

@@ -4,7 +4,7 @@
* Stores WebAuthn challenges in a dedicated table with automatic expiration.
*/
import type { ChallengeStore, ChallengeData } from "@emdashcms/auth/passkey";
import type { ChallengeStore, ChallengeData } from "@emdash-cms/auth/passkey";
import type { Kysely } from "kysely";
import type { Database } from "../database/types.js";

View File

@@ -5,7 +5,7 @@
* Uses the existing table but with type="oauth" to distinguish from WebAuthn challenges.
*/
import type { StateStore, OAuthState } from "@emdashcms/auth";
import type { StateStore, OAuthState } from "@emdash-cms/auth";
import type { Kysely } from "kysely";
import type { Database } from "../database/types.js";

View File

@@ -37,7 +37,7 @@ export interface AuthDescriptor {
/**
* Module specifier to import at runtime
* The module must export an `authenticate` function.
* @example "@emdashcms/cloudflare/auth"
* @example "@emdash-cms/cloudflare/auth"
*/
entrypoint: string;

View File

@@ -9,7 +9,7 @@
* rest still run. Failures are logged but never surface to callers.
*/
import { createKyselyAdapter, type AuthTables } from "@emdashcms/auth/adapters/kysely";
import { createKyselyAdapter, type AuthTables } from "@emdash-cms/auth/adapters/kysely";
import { sql, type Kysely } from "kysely";
import { cleanupExpiredChallenges } from "./auth/challenge-store.js";

View File

@@ -40,7 +40,7 @@ import {
const TS_EXT_RE = /\.tsx?$/;
const SLASH_RE = /\//g;
const LEADING_AT_RE = /^@/;
const emdash_SCOPE_RE = /^@emdashcms\//;
const emdash_SCOPE_RE = /^@emdash-cms\//;
export const bundleCommand = defineCommand({
meta: {
@@ -179,7 +179,7 @@ export const bundleCommand = defineCommand({
});
// Symlink plugin's node_modules so the built module can resolve
// external dependencies (emdash, @emdashcms/*, etc.)
// external dependencies (emdash, @emdash-cms/*, etc.)
const pluginNodeModules = join(pluginDir, "node_modules");
const tmpNodeModules = join(mainOutDir, "node_modules");
if (await fileExists(pluginNodeModules)) {

View File

@@ -10,7 +10,7 @@ import { createReadStream } from "node:fs";
import { readFile, writeFile, mkdir } from "node:fs/promises";
import { dirname, join, resolve } from "node:path";
import { gutenbergToPortableText } from "@emdashcms/gutenberg-to-portable-text";
import { gutenbergToPortableText } from "@emdash-cms/gutenberg-to-portable-text";
import pc from "picocolors";
import { slugify } from "#utils/slugify.js";

Some files were not shown because too many files have changed in this diff Show More