Fix scope
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user