@astrojs/cloudflare 7.1.0 → 7.1.1

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
@@ -115,8 +115,12 @@ If you're using the `advanced` runtime, you can type the `runtime` object as fol
115
115
  /// <reference types="astro/client" />
116
116
  import type { AdvancedRuntime } from '@astrojs/cloudflare';
117
117
 
118
+ type ENV = {
119
+ SERVER_URL: string;
120
+ };
121
+
118
122
  declare namespace App {
119
- interface Locals extends AdvancedRuntime {
123
+ interface Locals extends AdvancedRuntime<ENV> {
120
124
  user: {
121
125
  name: string;
122
126
  surname: string;
@@ -132,8 +136,12 @@ If you're using the `directory` runtime, you can type the `runtime` object as fo
132
136
  /// <reference types="astro/client" />
133
137
  import type { DirectoryRuntime } from '@astrojs/cloudflare';
134
138
 
139
+ type ENV = {
140
+ SERVER_URL: string;
141
+ };
142
+
135
143
  declare namespace App {
136
- interface Locals extends DirectoryRuntime {
144
+ interface Locals extends DirectoryRuntime<ENV> {
137
145
  user: {
138
146
  name: string;
139
147
  surname: string;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { AstroAdapter, AstroIntegration } from 'astro';
2
- export type { AdvancedRuntime } from './server.advanced';
3
- export type { DirectoryRuntime } from './server.directory';
2
+ export type { AdvancedRuntime } from './server.advanced.js';
3
+ export type { DirectoryRuntime } from './server.directory.js';
4
4
  type Options = {
5
5
  mode?: 'directory' | 'advanced';
6
6
  functionPerRoute?: boolean;
@@ -4,12 +4,11 @@ type Env = {
4
4
  ASSETS: {
5
5
  fetch: (req: Request) => Promise<Response>;
6
6
  };
7
- name: string;
8
7
  };
9
- export interface AdvancedRuntime {
8
+ export interface AdvancedRuntime<T extends object = object> {
10
9
  runtime: {
11
10
  waitUntil: (promise: Promise<any>) => void;
12
- env: Env;
11
+ env: Env & T;
13
12
  cf: CFRequest['cf'];
14
13
  caches: typeof caches;
15
14
  };
@@ -1,9 +1,9 @@
1
1
  import type { Request as CFRequest, EventContext } from '@cloudflare/workers-types';
2
2
  import type { SSRManifest } from 'astro';
3
- export interface DirectoryRuntime {
3
+ export interface DirectoryRuntime<T extends object = object> {
4
4
  runtime: {
5
5
  waitUntil: (promise: Promise<any>) => void;
6
- env: EventContext<unknown, string, unknown>['env'];
6
+ env: EventContext<unknown, string, unknown>['env'] & T;
7
7
  cf: CFRequest['cf'];
8
8
  caches: typeof caches;
9
9
  };
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.1.0",
4
+ "version": "7.1.1",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
7
  "author": "withastro",
@@ -33,26 +33,27 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@cloudflare/workers-types": "^4.20230821.0",
36
- "esbuild": "^0.19.2",
37
- "tiny-glob": "^0.2.9",
38
- "find-up": "^6.3.0",
39
36
  "@iarna/toml": "^2.2.5",
40
- "dotenv": "^16.3.1",
41
37
  "@miniflare/cache": "^2.14.1",
42
38
  "@miniflare/shared": "^2.14.1",
43
39
  "@miniflare/storage-memory": "^2.14.1",
40
+ "dotenv": "^16.3.1",
41
+ "esbuild": "^0.19.2",
42
+ "find-up": "^6.3.0",
43
+ "tiny-glob": "^0.2.9",
44
44
  "@astrojs/underscore-redirects": "0.3.0"
45
45
  },
46
46
  "peerDependencies": {
47
- "astro": "^3.0.13"
47
+ "astro": "^3.1.1"
48
48
  },
49
49
  "devDependencies": {
50
+ "@types/iarna__toml": "^2.0.2",
50
51
  "chai": "^4.3.7",
51
52
  "cheerio": "1.0.0-rc.12",
52
53
  "kill-port": "^2.0.1",
53
54
  "mocha": "^10.2.0",
54
55
  "wrangler": "^3.5.1",
55
- "astro": "3.0.13",
56
+ "astro": "3.1.1",
56
57
  "astro-scripts": "0.0.14"
57
58
  },
58
59
  "scripts": {