@astrojs/cloudflare 10.0.2 → 10.0.3

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.
@@ -8,10 +8,10 @@ type Env = {
8
8
  };
9
9
  export interface Runtime<T extends object = object> {
10
10
  runtime: {
11
- waitUntil: (promise: Promise<any>) => void;
12
11
  env: Env & T;
13
12
  cf: CLOUDFLARE_REQUEST['cf'];
14
13
  caches: CLOUDFLARE_CACHESTORAGE;
14
+ ctx: ExecutionContext;
15
15
  };
16
16
  }
17
17
  export declare function createExports(manifest: SSRManifest): {
@@ -23,12 +23,13 @@ export function createExports(manifest) {
23
23
  })();
24
24
  const locals = {
25
25
  runtime: {
26
- waitUntil: (promise) => {
27
- context.waitUntil(promise);
28
- },
29
26
  env: env,
30
27
  cf: request.cf,
31
28
  caches: caches,
29
+ ctx: {
30
+ waitUntil: (promise) => context.waitUntil(promise),
31
+ passThroughOnException: () => context.passThroughOnException(),
32
+ },
32
33
  },
33
34
  };
34
35
  const response = await app.render(request, { routeData, locals });
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { AstroIntegration } from 'astro';
2
- export type { Runtime } from './entrypoints/server.advanced.js';
2
+ export type { Runtime } from './entrypoints/server.js';
3
3
  export type Options = {
4
4
  /** Options for handling images. */
5
5
  imageService?: 'passthrough' | 'cloudflare' | 'compile';
package/dist/index.js CHANGED
@@ -39,7 +39,7 @@ export default function createIntegration(args) {
39
39
  }
40
40
  setAdapter({
41
41
  name: '@astrojs/cloudflare',
42
- serverEntrypoint: '@astrojs/cloudflare/entrypoints/server.advanced.js',
42
+ serverEntrypoint: '@astrojs/cloudflare/entrypoints/server.js',
43
43
  exports: ['default'],
44
44
  adapterFeatures: {
45
45
  functionPerRoute: false,
@@ -72,7 +72,10 @@ export default function createIntegration(args) {
72
72
  env: platformProxy.env,
73
73
  cf: platformProxy.cf,
74
74
  caches: platformProxy.caches,
75
- ctx: platformProxy.ctx,
75
+ ctx: {
76
+ waitUntil: (promise) => platformProxy.ctx.waitUntil(promise),
77
+ passThroughOnException: () => platformProxy.ctx.passThroughOnException(),
78
+ },
76
79
  },
77
80
  });
78
81
  next();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@astrojs/cloudflare",
3
3
  "description": "Deploy your site to Cloudflare Workers/Pages",
4
- "version": "10.0.2",
4
+ "version": "10.0.3",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -19,8 +19,7 @@
19
19
  "homepage": "https://docs.astro.build/en/guides/integrations-guide/cloudflare/",
20
20
  "exports": {
21
21
  ".": "./dist/index.js",
22
- "./entrypoints/server.advanced.js": "./dist/entrypoints/server.advanced.js",
23
- "./entrypoints/server.directory.js": "./dist/entrypoints/server.directory.js",
22
+ "./entrypoints/server.js": "./dist/entrypoints/server.js",
24
23
  "./image-service": "./dist/entrypoints/image-service.js",
25
24
  "./image-endpoint": "./dist/entrypoints/image-endpoint.js",
26
25
  "./package.json": "./package.json"