@astrojs/cloudflare 7.5.1 → 7.5.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.
package/README.md
CHANGED
|
@@ -169,7 +169,7 @@ default: `false`
|
|
|
169
169
|
|
|
170
170
|
Whether or not to import `.wasm` files [directly as ES modules](https://github.com/WebAssembly/esm-integration/tree/main/proposals/esm-integration) using the `.wasm?module` import syntax.
|
|
171
171
|
|
|
172
|
-
Add `wasmModuleImports: true` to `astro.config.mjs` to enable this functionality in both the Cloudflare build and the Astro dev server. Read more about [using Wasm modules](#use-wasm-modules)
|
|
172
|
+
Add `wasmModuleImports: true` to `astro.config.mjs` to enable this functionality in both the Cloudflare build and the Astro dev server. Read more about [using Wasm modules](#use-wasm-modules).
|
|
173
173
|
|
|
174
174
|
```diff lang="js"
|
|
175
175
|
// astro.config.mjs
|
|
@@ -221,7 +221,7 @@ Currently supported bindings:
|
|
|
221
221
|
- [Cloudflare Workers KV](https://developers.cloudflare.com/kv/)
|
|
222
222
|
- [Cloudflare Durable Objects](https://developers.cloudflare.com/durable-objects/)
|
|
223
223
|
|
|
224
|
-
You can access the runtime from Astro components through `Astro.locals` inside any
|
|
224
|
+
You can access the runtime from Astro components through `Astro.locals` inside any `.astro` file.
|
|
225
225
|
|
|
226
226
|
```astro
|
|
227
227
|
---
|
|
@@ -339,6 +339,7 @@ Astro's Cloudflare adapter allows you to use any Node.js runtime API supported b
|
|
|
339
339
|
- assert
|
|
340
340
|
- AsyncLocalStorage
|
|
341
341
|
- Buffer
|
|
342
|
+
- Crypto
|
|
342
343
|
- Diagnostics Channel
|
|
343
344
|
- EventEmitter
|
|
344
345
|
- path
|
|
@@ -357,6 +358,10 @@ import { Buffer } from 'node:buffer';
|
|
|
357
358
|
|
|
358
359
|
Additionally, you'll need to enable the Compatibility Flag in Cloudflare. The configuration for this flag may vary based on where you deploy your Astro site. For detailed guidance, please refer to the [Cloudflare documentation on enabling Node.js compatibility](https://developers.cloudflare.com/workers/runtime-apis/nodejs).
|
|
359
360
|
|
|
361
|
+
## Cloudflare module support
|
|
362
|
+
|
|
363
|
+
All Cloudflare namespaced packages (e.g. `cloudflare:sockets`) are allowlisted for use. Note that the package `cloudflare:sockets` does not work locally without using Wrangler dev mode.
|
|
364
|
+
|
|
360
365
|
## Preview with Wrangler
|
|
361
366
|
|
|
362
367
|
To use [`wrangler`](https://developers.cloudflare.com/workers/wrangler/) to run your application locally, update the preview script:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Request as CFRequest, ExecutionContext } from '@cloudflare/workers-types';
|
|
1
|
+
import type { Request as CFRequest, CacheStorage, ExecutionContext } from '@cloudflare/workers-types';
|
|
2
2
|
import type { SSRManifest } from 'astro';
|
|
3
3
|
type Env = {
|
|
4
4
|
ASSETS: {
|
|
@@ -10,7 +10,7 @@ export interface AdvancedRuntime<T extends object = object> {
|
|
|
10
10
|
waitUntil: (promise: Promise<any>) => void;
|
|
11
11
|
env: Env & T;
|
|
12
12
|
cf: CFRequest['cf'];
|
|
13
|
-
caches:
|
|
13
|
+
caches: CacheStorage;
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
export declare function createExports(manifest: SSRManifest): {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { Request as CFRequest, EventContext } from '@cloudflare/workers-types';
|
|
1
|
+
import type { Request as CFRequest, CacheStorage, EventContext } from '@cloudflare/workers-types';
|
|
2
2
|
import type { SSRManifest } from 'astro';
|
|
3
3
|
export interface DirectoryRuntime<T extends object = object> {
|
|
4
4
|
runtime: {
|
|
5
5
|
waitUntil: (promise: Promise<any>) => void;
|
|
6
6
|
env: EventContext<unknown, string, unknown>['env'] & T;
|
|
7
7
|
cf: CFRequest['cf'];
|
|
8
|
-
caches:
|
|
8
|
+
caches: CacheStorage;
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
export declare function createExports(manifest: SSRManifest): {
|
package/dist/index.js
CHANGED
|
@@ -211,13 +211,15 @@ function createIntegration(args) {
|
|
|
211
211
|
"node:assert",
|
|
212
212
|
"node:async_hooks",
|
|
213
213
|
"node:buffer",
|
|
214
|
+
"node:crypto",
|
|
214
215
|
"node:diagnostics_channel",
|
|
215
216
|
"node:events",
|
|
216
217
|
"node:path",
|
|
217
218
|
"node:process",
|
|
218
219
|
"node:stream",
|
|
219
220
|
"node:string_decoder",
|
|
220
|
-
"node:util"
|
|
221
|
+
"node:util",
|
|
222
|
+
"cloudflare:*"
|
|
221
223
|
],
|
|
222
224
|
entryPoints: pathsGroup,
|
|
223
225
|
outbase: absolutePagesDirname,
|
|
@@ -275,13 +277,15 @@ function createIntegration(args) {
|
|
|
275
277
|
"node:assert",
|
|
276
278
|
"node:async_hooks",
|
|
277
279
|
"node:buffer",
|
|
280
|
+
"node:crypto",
|
|
278
281
|
"node:diagnostics_channel",
|
|
279
282
|
"node:events",
|
|
280
283
|
"node:path",
|
|
281
284
|
"node:process",
|
|
282
285
|
"node:stream",
|
|
283
286
|
"node:string_decoder",
|
|
284
|
-
"node:util"
|
|
287
|
+
"node:util",
|
|
288
|
+
"cloudflare:*"
|
|
285
289
|
],
|
|
286
290
|
entryPoints: [entryPath],
|
|
287
291
|
outfile: buildPath,
|
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": "7.5.
|
|
4
|
+
"version": "7.5.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"author": "withastro",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@astrojs/underscore-redirects": "0.3.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"astro": "^3.
|
|
44
|
+
"astro": "^3.3.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/iarna__toml": "^2.0.2",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"cheerio": "1.0.0-rc.12",
|
|
50
50
|
"mocha": "^10.2.0",
|
|
51
51
|
"wrangler": "^3.5.1",
|
|
52
|
-
"astro": "3.
|
|
52
|
+
"astro": "3.3.0",
|
|
53
53
|
"astro-scripts": "0.0.14"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|