devflare 1.0.0-next.28 → 1.0.0-next.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LLM.md CHANGED
@@ -3515,8 +3515,8 @@ This is also why strict runtime helpers throwing outside context is healthy: it
3515
3515
  | API | What it reads | Failure behavior | Mutation |
3516
3516
  | --- | --- | --- | --- |
3517
3517
  | Handler parameters | The explicit event object Devflare passes to the handler boundary. | No lookup needed at the boundary. | `event.locals` is mutable. |
3518
- | Per-surface getters like `getFetchEvent()` | The stored `context.event` after Devflare verifies the active surface type. | Throws `ContextUnavailableError`, while `.safe()` returns `null`. | Readonly event view. |
3519
- | `getContext()` | The full active `RequestContext` object for the current handler trail. | Throws `ContextUnavailableError` outside an active handler trail. | Use this mostly for debugging or advanced infrastructure helpers. |
3518
+ | Per-surface getters like `getFetchEvent()` | The stored `context.event` after Devflare verifies the active surface type. | Throws `ContextAccessError`, while `.safe()` returns `null`. | Readonly event view. |
3519
+ | `getContext()` | The full active `RequestContext` object for the current handler trail. | Throws `ContextAccessError` outside an active handler trail. | Use this mostly for debugging or advanced infrastructure helpers. |
3520
3520
  | `env`, `ctx`, `event` proxies | `getContextOrNull()` through readonly proxy wrappers. | Property access throws `ContextAccessError` outside an active handler trail. | Readonly. |
3521
3521
  | `locals` proxy | `getContextOrNull()?.locals` through the mutable context proxy. | Property access throws `ContextAccessError` outside an active handler trail. | Mutable and shared with `event.locals`. |
3522
3522
 
@@ -3582,7 +3582,7 @@ export const handle = sequence(requestId)
3582
3582
  - Module top-level code runs at cold start, not inside a request or job, so strict runtime helpers are unavailable there.
3583
3583
  - Callbacks that run after the handler trail ends should take explicit inputs instead of assuming context is still alive.
3584
3584
  - Timer callbacks like `setTimeout()` and `setInterval()` are outside the normal Devflare-managed handler trail.
3585
- - Per-surface getters and `getContext()` throw `ContextUnavailableError`, while proxy property access such as `env.DB` or `locals.userId` throws `ContextAccessError` naming the missing property.
3585
+ - Per-surface getters and `getContext()` throw `ContextAccessError` describing the unavailable context, while proxy property access such as `env.DB` or `locals.userId` throws `ContextAccessError` naming the missing property.
3586
3586
  - If you are unsure whether the matching surface is active, prefer `.safe()` accessors such as `getFetchEvent.safe()` over catching thrown errors.
3587
3587
  - If runtime context access fails unexpectedly while bypassing Devflare-generated config or harnesses, open the runtime context internals page and verify the Worker still includes the compatibility flags Devflare normally adds for you.
3588
3588
 
package/README.md CHANGED
@@ -124,6 +124,11 @@ Runtime import rule of thumb:
124
124
  - Use `devflare/test` in tests.
125
125
  - Use bare `devflare` for Node-side package tooling and the unified env proxy only when that is intentional.
126
126
 
127
+ The authoritative frozen-entrypoint list and the stability guarantee on it live
128
+ in [API Stability Policy](https://github.com/Refzlund/devflare/blob/next/docs/API_STABILITY.md);
129
+ the semver, prerelease lane, and release mechanics live in
130
+ [Versioning & Release Policy](https://github.com/Refzlund/devflare/blob/next/docs/VERSIONING_AND_RELEASE.md).
131
+
127
132
  ## Config Map
128
133
 
129
134
  The most important top-level keys are:
package/dist/browser.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  env,
6
6
  vars
7
- } from "./index-stzx8nc4.js";
7
+ } from "./index-vfh0ctjw.js";
8
8
  import {
9
9
  durableObject,
10
10
  getDurableObjectOptions
@@ -15,7 +15,7 @@ import {
15
15
  getClient,
16
16
  initEnv,
17
17
  setBindingHints
18
- } from "./index-c1cj9085.js";
18
+ } from "./index-a6cbcsyp.js";
19
19
  import"./index-hpwa6vsw.js";
20
20
  import {
21
21
  defineConfig,
@@ -6,8 +6,8 @@ import {
6
6
  class ContextAccessError extends Error {
7
7
  contextName;
8
8
  propertyName;
9
- constructor(contextName, propertyName) {
10
- super(`Cannot access ${contextName}.${propertyName} outside of an active Devflare handler trail.
9
+ constructor(contextName, propertyName, message) {
10
+ super(message ?? `Cannot access ${contextName}.${propertyName} outside of an active Devflare handler trail.
11
11
 
12
12
  ` + `This typically happens when:
13
13
  ` + ` 1. Accessing ${contextName} at module top-level (during import)
@@ -19,6 +19,18 @@ class ContextAccessError extends Error {
19
19
  this.contextName = contextName;
20
20
  this.propertyName = propertyName;
21
21
  }
22
+ static contextUnavailable(message) {
23
+ return new ContextAccessError("context", "<unavailable>", message ?? `Context not available. Devflare uses AsyncLocalStorage to carry the active event through fetch, queue, scheduled, email, tail, and Durable Object handler call chains.
24
+
25
+ ` + `This usually means one of:
26
+
27
+ ` + `1. Accessing context at module top-level (runs at cold start, not per-request)
28
+ ` + `2. Accessing context in setTimeout/setInterval callbacks
29
+ ` + `3. Missing 'nodejs_compat' compatibility flag in your worker config
30
+
31
+ ` + `Fix: Move the access inside your handler, middleware, or a helper called from that handler trail.
32
+ ` + `Learn more: https://devflare.dev/docs/context-errors`);
33
+ }
22
34
  }
23
35
  function createContextProxy(getter, name, options = {}) {
24
36
  const mutable = options.mutable ?? true;
@@ -295,7 +307,7 @@ function runWithEventContext(event, fn) {
295
307
  function getContext() {
296
308
  const context = storage.getStore();
297
309
  if (!context) {
298
- throw new ContextUnavailableError;
310
+ throw ContextAccessError.contextUnavailable();
299
311
  }
300
312
  return context;
301
313
  }
@@ -316,10 +328,10 @@ function createEventAccessor(name, matcher) {
316
328
  const accessor = () => {
317
329
  const currentEvent = getEventContextOrNull();
318
330
  if (!currentEvent) {
319
- throw new ContextUnavailableError;
331
+ throw ContextAccessError.contextUnavailable();
320
332
  }
321
333
  if (!matcher(currentEvent)) {
322
- throw new ContextUnavailableError(`${name} is not available in the current '${currentEvent.type}' context.
334
+ throw ContextAccessError.contextUnavailable(`${name} is not available in the current '${currentEvent.type}' context.
323
335
 
324
336
  Devflare stores event objects in AsyncLocalStorage so helpers called within a handler can reach the active event.
325
337
  Use ${name}.safe() to return null instead of throwing, or call the getter that matches the active surface.`);
@@ -377,28 +389,6 @@ var getDurableObjectWebSocketMessageEvent = createEventAccessor("getDurableObjec
377
389
  var getDurableObjectWebSocketCloseEvent = createEventAccessor("getDurableObjectWebSocketCloseEvent()", isDurableObjectWebSocketCloseEvent);
378
390
  var getDurableObjectWebSocketErrorEvent = createEventAccessor("getDurableObjectWebSocketErrorEvent()", isDurableObjectWebSocketErrorEvent);
379
391
 
380
- class ContextUnavailableError extends ContextAccessError {
381
- code = "CONTEXT_UNAVAILABLE";
382
- constructor(message) {
383
- super("context", "<unavailable>");
384
- if (message !== undefined) {
385
- this.message = message;
386
- } else {
387
- this.message = `Context not available. Devflare uses AsyncLocalStorage to carry the active event through fetch, queue, scheduled, email, tail, and Durable Object handler call chains.
388
-
389
- ` + `This usually means one of:
390
-
391
- ` + `1. Accessing context at module top-level (runs at cold start, not per-request)
392
- ` + `2. Accessing context in setTimeout/setInterval callbacks
393
- ` + `3. Missing 'nodejs_compat' compatibility flag in your worker config
394
-
395
- ` + `Fix: Move the access inside your handler, middleware, or a helper called from that handler trail.
396
- ` + `Learn more: https://devflare.dev/docs/context-errors`;
397
- }
398
- this.name = "ContextUnavailableError";
399
- }
400
- }
401
-
402
392
  // src/bridge/v2/wire.ts
403
393
  var BinaryKind = {
404
394
  StreamChunk: 1,
@@ -2247,4 +2237,4 @@ function setBindingHints(hints) {
2247
2237
  globalEnvProxy = null;
2248
2238
  }
2249
2239
 
2250
- export { ContextAccessError, createContextProxy, createFetchEvent, createQueueEvent, createScheduledEvent, createEmailEvent, createTailEvent, createDurableObjectFetchEvent, createDurableObjectAlarmEvent, createDurableObjectWebSocketMessageEvent, createDurableObjectWebSocketCloseEvent, createDurableObjectWebSocketErrorEvent, runWithContext, runWithEventContext, getContext, getContextOrNull, getEventContext, getEventContextOrNull, hasContext, getFetchEvent, getQueueEvent, getScheduledEvent, getEmailEvent, getTailEvent, getDurableObjectEvent, getDurableObjectFetchEvent, getDurableObjectAlarmEvent, getDurableObjectWebSocketMessageEvent, getDurableObjectWebSocketCloseEvent, getDurableObjectWebSocketErrorEvent, ContextUnavailableError, BridgeClient, getClient, createEnvProxy, bridgeEnv, initEnv, setBindingHints };
2240
+ export { ContextAccessError, createContextProxy, createFetchEvent, createQueueEvent, createScheduledEvent, createEmailEvent, createTailEvent, createDurableObjectFetchEvent, createDurableObjectAlarmEvent, createDurableObjectWebSocketMessageEvent, createDurableObjectWebSocketCloseEvent, createDurableObjectWebSocketErrorEvent, runWithContext, runWithEventContext, getContext, getContextOrNull, getEventContext, getEventContextOrNull, hasContext, getFetchEvent, getQueueEvent, getScheduledEvent, getEmailEvent, getTailEvent, getDurableObjectEvent, getDurableObjectFetchEvent, getDurableObjectAlarmEvent, getDurableObjectWebSocketMessageEvent, getDurableObjectWebSocketCloseEvent, getDurableObjectWebSocketErrorEvent, BridgeClient, getClient, createEnvProxy, bridgeEnv, initEnv, setBindingHints };
@@ -3,7 +3,7 @@ import {
3
3
  createFetchEvent,
4
4
  getContextOrNull,
5
5
  runWithEventContext
6
- } from "./index-c1cj9085.js";
6
+ } from "./index-a6cbcsyp.js";
7
7
 
8
8
  // src/runtime/exports.ts
9
9
  function createReadonlyProxy(getter, name) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  bridgeEnv,
3
3
  getContextOrNull
4
- } from "./index-c1cj9085.js";
4
+ } from "./index-a6cbcsyp.js";
5
5
 
6
6
  // src/env.ts
7
7
  var testContextEnv = null;
package/dist/index.js CHANGED
@@ -11,12 +11,12 @@ import"./index-3t6rypgc.js";
11
11
  import {
12
12
  env,
13
13
  vars
14
- } from "./index-stzx8nc4.js";
14
+ } from "./index-vfh0ctjw.js";
15
15
  import {
16
16
  durableObject,
17
17
  getDurableObjectOptions
18
18
  } from "./index-a855bdsx.js";
19
- import"./index-c1cj9085.js";
19
+ import"./index-a6cbcsyp.js";
20
20
  import"./index-hpwa6vsw.js";
21
21
  import {
22
22
  compileConfig,
@@ -1,4 +1,3 @@
1
- import { ContextAccessError } from './validation';
2
1
  import type { DurableObjectAlarmEvent, DurableObjectEvent, DurableObjectFetchEvent, DurableObjectWebSocketCloseEvent, DurableObjectWebSocketErrorEvent, DurableObjectWebSocketMessageEvent, EmailEvent, EventAccessor, EventContext, FetchEvent, QueueEvent, RequestContext, ScheduledEvent, TailEvent } from './context-types';
3
2
  export { createFetchEvent, createQueueEvent, createScheduledEvent, createEmailEvent, createTailEvent, createDurableObjectFetchEvent, createDurableObjectAlarmEvent, createDurableObjectWebSocketMessageEvent, createDurableObjectWebSocketCloseEvent, createDurableObjectWebSocketErrorEvent } from './context-events';
4
3
  export type { AnyEvent, DurableObjectAlarmEvent, DurableObjectEvent, DurableObjectEventContext, DurableObjectFetchEvent, DurableObjectWebSocketCloseEvent, DurableObjectWebSocketErrorEvent, DurableObjectWebSocketMessageEvent, EmailEvent, EventContext, EventInitOptions, FetchEvent, FetchEventInit, QueueEvent, RequestContext, RuntimeContextValue, RuntimeEventType, ScheduledEvent, TailEvent, WorkerEvent } from './context-types';
@@ -20,14 +19,4 @@ export declare const getDurableObjectAlarmEvent: EventAccessor<DurableObjectAlar
20
19
  export declare const getDurableObjectWebSocketMessageEvent: EventAccessor<DurableObjectWebSocketMessageEvent<unknown, Record<string, unknown>>>;
21
20
  export declare const getDurableObjectWebSocketCloseEvent: EventAccessor<DurableObjectWebSocketCloseEvent<unknown, Record<string, unknown>>>;
22
21
  export declare const getDurableObjectWebSocketErrorEvent: EventAccessor<DurableObjectWebSocketErrorEvent<unknown, Record<string, unknown>>>;
23
- /**
24
- * @deprecated Prefer {@link ContextAccessError} from `./validation`. This name
25
- * is retained as a subclass for backward compatibility — both names refer to
26
- * the same context-unavailable failure mode and `instanceof ContextAccessError`
27
- * is true for any instance.
28
- */
29
- export declare class ContextUnavailableError extends ContextAccessError {
30
- readonly code = "CONTEXT_UNAVAILABLE";
31
- constructor(message?: string);
32
- }
33
22
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/runtime/context.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAcjD,OAAO,KAAK,EACX,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,gC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B;IAC9D,QAAQ,CAAC,IAAI,yBAAwB;IAErC,YAAY,OAAO,CAAC,EAAE,MAAM,EAe3B;CACD"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/runtime/context.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EACX,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,gCAAgC,EAChC,gCAAgC,EAChC,kCAAkC,EAClC,UAAU,EACV,aAAa,EACb,YAAY,EACZ,UAAU,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,SAAS,EACT,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,6BAA6B,EAC7B,6BAA6B,EAC7B,wCAAwC,EACxC,sCAAsC,EACtC,sCAAsC,EACtC,MAAM,kBAAkB,CAAA;AAEzB,YAAY,EACX,QAAQ,EACR,uBAAuB,EACvB,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,gCAAgC,EAChC,gCAAgC,EAChC,kCAAkC,EAClC,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,cAAc,EACd,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,WAAW,EACX,MAAM,iBAAiB,CAAA;AAQxB,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,GAAG,OAAO,EAC/C,GAAG,EAAE,IAAI,EACT,GAAG,EAAE,gBAAgB,GAAG,kBAAkB,GAAG,IAAI,EACjD,OAAO,EAAE,OAAO,GAAG,IAAI,EACvB,EAAE,EAAE,MAAM,CAAC,EACX,IAAI,GAAE,cAAc,CAAC,MAAM,CAAW,GACpC,CAAC,CAKH;AAED,wBAAgB,mBAAmB,CAClC,CAAC,EACD,IAAI,GAAG,OAAO,EACd,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM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A0G,CAAA;AACjJ,eAAO,MAAM,0BAA0B,0EAA0G,CAAA;AACjJ,eAAO,MAAM,qCAAqC,qFAA2I,CAAA;AAC7L,eAAO,MAAM,mCAAmC,mFAAqI,CAAA;AACrL,eAAO,MAAM,mCAAmC,mFAAqI,CAAA"}
@@ -1,6 +1,6 @@
1
1
  export { env, vars, ctx, event, locals } from './exports';
2
2
  export type { EventContext } from './context';
3
- export { createFetchEvent, createQueueEvent, createScheduledEvent, createEmailEvent, createTailEvent, createDurableObjectFetchEvent, createDurableObjectAlarmEvent, createDurableObjectWebSocketMessageEvent, createDurableObjectWebSocketCloseEvent, createDurableObjectWebSocketErrorEvent, runWithContext, runWithEventContext, getContext, getContextOrNull, getEventContext, getEventContextOrNull, getFetchEvent, getQueueEvent, getScheduledEvent, getEmailEvent, getTailEvent, getDurableObjectEvent, getDurableObjectFetchEvent, getDurableObjectAlarmEvent, getDurableObjectWebSocketMessageEvent, getDurableObjectWebSocketCloseEvent, getDurableObjectWebSocketErrorEvent, hasContext, ContextUnavailableError, type RuntimeEventType, type RuntimeContextValue, type RequestContext } from './context';
3
+ export { createFetchEvent, createQueueEvent, createScheduledEvent, createEmailEvent, createTailEvent, createDurableObjectFetchEvent, createDurableObjectAlarmEvent, createDurableObjectWebSocketMessageEvent, createDurableObjectWebSocketCloseEvent, createDurableObjectWebSocketErrorEvent, runWithContext, runWithEventContext, getContext, getContextOrNull, getEventContext, getEventContextOrNull, getFetchEvent, getQueueEvent, getScheduledEvent, getEmailEvent, getTailEvent, getDurableObjectEvent, getDurableObjectFetchEvent, getDurableObjectAlarmEvent, getDurableObjectWebSocketMessageEvent, getDurableObjectWebSocketCloseEvent, getDurableObjectWebSocketErrorEvent, hasContext, type RuntimeEventType, type RuntimeContextValue, type RequestContext } from './context';
4
4
  export type { FetchEvent, QueueEvent, ScheduledEvent, EmailEvent, TailEvent, DurableObjectEvent, DurableObjectFetchEvent, DurableObjectAlarmEvent, DurableObjectWebSocketMessageEvent, DurableObjectWebSocketCloseEvent, DurableObjectWebSocketErrorEvent, WorkerEvent, AnyEvent } from './context';
5
5
  export { createContextProxy, ContextAccessError } from './validation';
6
6
  export { sequence, resolveFetchHandler, invokeFetchHandler, createResolveFetch, invokeFetchModule, defineFetchHandler, defineQueueHandler, defineScheduledHandler, markResolveStyle, markWorkerStyle, assertExplicitQueueHandlerStyle, assertExplicitScheduledHandlerStyle, type Awaitable, type ResolveFetch, type FetchMiddleware } from './middleware';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACN,GAAG,EACH,IAAI,EACJ,GAAG,EACH,KAAK,EACL,MAAM,EACN,MAAM,WAAW,CAAA;AAElB,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAG7C,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,6BAA6B,EAC7B,6BAA6B,EAC7B,wCAAwC,EACxC,sCAAsC,EACtC,sCAAsC,EACtC,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,0BAA0B,EAC1B,0BAA0B,EAC1B,qCAAqC,EACrC,mCAAmC,EACnC,mCAAmC,EACnC,UAAU,EACV,uBAAuB,EACvB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,MAAM,WAAW,CAAA;AAElB,YAAY,EACX,UAAU,EACV,UAAU,EACV,cAAc,EACd,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,WAAW,EACX,QAAQ,EACR,MAAM,WAAW,CAAA;AAGlB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAGrE,OAAO,EACN,QAAQ,EACR,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,+BAA+B,EAC/B,mCAAmC,EACnC,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,MAAM,cAAc,CAAA;AAErB,OAAO,EACN,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,MAAM,UAAU,CAAA;AAEjB,YAAY,EACX,YAAY,EACZ,qBAAqB,EACrB,gBAAgB,EAChB,MAAM,gBAAgB,CAAA;AAGvB,OAAO,EACN,aAAa,EACb,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,MAAM,eAAe,CAAA;AAKtB,OAAO,EACN,yBAAyB,EACzB,2BAA2B,EAC3B,KAAK,2BAA2B,EAChC,MAAM,qBAAqB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACN,GAAG,EACH,IAAI,EACJ,GAAG,EACH,KAAK,EACL,MAAM,EACN,MAAM,WAAW,CAAA;AAElB,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAG7C,OAAO,EACN,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,6BAA6B,EAC7B,6BAA6B,EAC7B,wCAAwC,EACxC,sCAAsC,EACtC,sCAAsC,EACtC,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,qBAAqB,EACrB,0BAA0B,EAC1B,0BAA0B,EAC1B,qCAAqC,EACrC,mCAAmC,EACnC,mCAAmC,EACnC,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,MAAM,WAAW,CAAA;AAElB,YAAY,EACX,UAAU,EACV,UAAU,EACV,cAAc,EACd,UAAU,EACV,SAAS,EACT,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,kCAAkC,EAClC,gCAAgC,EAChC,gCAAgC,EAChC,WAAW,EACX,QAAQ,EACR,MAAM,WAAW,CAAA;AAGlB,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAA;AAGrE,OAAO,EACN,QAAQ,EACR,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,+BAA+B,EAC/B,mCAAmC,EACnC,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,MAAM,cAAc,CAAA;AAErB,OAAO,EACN,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,MAAM,UAAU,CAAA;AAEjB,YAAY,EACX,YAAY,EACZ,qBAAqB,EACrB,gBAAgB,EAChB,MAAM,gBAAgB,CAAA;AAGvB,OAAO,EACN,aAAa,EACb,uBAAuB,EACvB,KAAK,oBAAoB,EACzB,MAAM,eAAe,CAAA;AAKtB,OAAO,EACN,yBAAyB,EACzB,2BAA2B,EAC3B,KAAK,2BAA2B,EAChC,MAAM,qBAAqB,CAAA"}
@@ -19,15 +19,14 @@ import {
19
19
  resolveFetchHandler,
20
20
  sequence,
21
21
  vars
22
- } from "../index-3tkzn06q.js";
23
- import"../index-stzx8nc4.js";
22
+ } from "../index-kecy9p48.js";
23
+ import"../index-vfh0ctjw.js";
24
24
  import {
25
25
  durableObject,
26
26
  getDurableObjectOptions
27
27
  } from "../index-a855bdsx.js";
28
28
  import {
29
29
  ContextAccessError,
30
- ContextUnavailableError,
31
30
  createContextProxy,
32
31
  createDurableObjectAlarmEvent,
33
32
  createDurableObjectFetchEvent,
@@ -57,7 +56,7 @@ import {
57
56
  hasContext,
58
57
  runWithContext,
59
58
  runWithEventContext
60
- } from "../index-c1cj9085.js";
59
+ } from "../index-a6cbcsyp.js";
61
60
  import {
62
61
  clearLocalSendEmailBindings,
63
62
  setLocalSendEmailBindings
@@ -117,6 +116,5 @@ export {
117
116
  clearLocalSendEmailBindings,
118
117
  assertExplicitScheduledHandlerStyle,
119
118
  assertExplicitQueueHandlerStyle,
120
- ContextUnavailableError,
121
119
  ContextAccessError
122
120
  };
@@ -4,7 +4,13 @@
4
4
  export declare class ContextAccessError extends Error {
5
5
  readonly contextName: string;
6
6
  readonly propertyName: string;
7
- constructor(contextName: string, propertyName: string);
7
+ constructor(contextName: string, propertyName: string, message?: string);
8
+ /**
9
+ * Builds a `ContextAccessError` for the "no active handler trail" failure mode
10
+ * (no AsyncLocalStorage store), with guidance toward the most common causes.
11
+ * Pass `message` to override the default `nodejs_compat`-mentioning guidance.
12
+ */
13
+ static contextUnavailable(message?: string): ContextAccessError;
8
14
  }
9
15
  /**
10
16
  * Creates a proxy that validates context is available before access
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/runtime/validation.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC5C,SAAgB,WAAW,EAAE,MAAM,CAAA;IACnC,SAAgB,YAAY,EAAE,MAAM,CAAA;IAEpC,YAAY,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAYpD;CACD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,yBAAyB;IACzC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,EAClD,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,EAClC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,yBAA8B,GACrC,CAAC,CAsEH"}
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/runtime/validation.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK;IAC5C,SAAgB,WAAW,EAAE,MAAM,CAAA;IACnC,SAAgB,YAAY,EAAE,MAAM,CAAA;IAEpC,YAAY,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAatE;IAED;;;;OAIG;IACH,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAa9D;CACD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,yBAAyB;IACzC;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,EAClD,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS,EAClC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,yBAA8B,GACrC,CAAC,CAsEH"}
@@ -16,7 +16,7 @@ import {
16
16
  getClient,
17
17
  runWithEventContext,
18
18
  setBindingHints
19
- } from "../index-c1cj9085.js";
19
+ } from "../index-a6cbcsyp.js";
20
20
  import {
21
21
  createLocalSendEmailBinding
22
22
  } from "../index-hpwa6vsw.js";
@@ -14,12 +14,12 @@ import {
14
14
  invokeFetchModule,
15
15
  matchFetchRoute,
16
16
  resolveFetchHandler
17
- } from "../index-3tkzn06q.js";
17
+ } from "../index-kecy9p48.js";
18
18
  import {
19
19
  __clearTestContext,
20
20
  __setTestContext,
21
21
  env
22
- } from "../index-stzx8nc4.js";
22
+ } from "../index-vfh0ctjw.js";
23
23
  import"../index-a855bdsx.js";
24
24
  import {
25
25
  buildHyperdrivesConfig,
@@ -60,7 +60,7 @@ import {
60
60
  runWithContext,
61
61
  runWithEventContext,
62
62
  setBindingHints
63
- } from "../index-c1cj9085.js";
63
+ } from "../index-a6cbcsyp.js";
64
64
  import {
65
65
  createLocalSendEmailBinding,
66
66
  wrapEnvSendEmailBindings
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devflare",
3
- "version": "1.0.0-next.28",
3
+ "version": "1.0.0-next.29",
4
4
  "description": "Devflare is a developer-first toolkit for Cloudflare Workers that sits on top of Miniflare and Wrangler-compatible config",
5
5
  "repository": {
6
6
  "type": "git",