@b9g/platform-cloudflare 0.1.13 → 0.1.15
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/package.json +11 -6
- package/src/directories.js +8 -4
- package/src/index.d.ts +1 -1
- package/src/index.js +4 -3
- package/src/platform.js +1 -1
- package/src/variables.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@b9g/platform-cloudflare",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "Cloudflare Workers platform adapter for Shovel - already ServiceWorker-based!",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"shovel",
|
|
@@ -10,12 +10,17 @@
|
|
|
10
10
|
"edge",
|
|
11
11
|
"serviceworker"
|
|
12
12
|
],
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/bikeshaving/shovel.git",
|
|
16
|
+
"directory": "packages/platform-cloudflare"
|
|
17
|
+
},
|
|
13
18
|
"dependencies": {
|
|
14
|
-
"@b9g/assets": "^0.2.
|
|
15
|
-
"@b9g/async-context": "^0.2.
|
|
16
|
-
"@b9g/cache": "^0.2.
|
|
17
|
-
"@b9g/filesystem": "^0.1.
|
|
18
|
-
"@b9g/platform": "^0.1.
|
|
19
|
+
"@b9g/assets": "^0.2.1",
|
|
20
|
+
"@b9g/async-context": "^0.2.1",
|
|
21
|
+
"@b9g/cache": "^0.2.2",
|
|
22
|
+
"@b9g/filesystem": "^0.1.10",
|
|
23
|
+
"@b9g/platform": "^0.1.17",
|
|
19
24
|
"@logtape/logtape": "^1.2.0",
|
|
20
25
|
"mime": "^4.0.4",
|
|
21
26
|
"miniflare": "^4.20251118.1"
|
package/src/directories.js
CHANGED
|
@@ -64,8 +64,10 @@ var R2FileSystemFileHandle = class _R2FileSystemFileHandle {
|
|
|
64
64
|
);
|
|
65
65
|
}
|
|
66
66
|
async isSameEntry(other) {
|
|
67
|
-
if (other.kind !== "file")
|
|
68
|
-
|
|
67
|
+
if (other.kind !== "file")
|
|
68
|
+
return false;
|
|
69
|
+
if (!(other instanceof _R2FileSystemFileHandle))
|
|
70
|
+
return false;
|
|
69
71
|
return this.#key === other.#key;
|
|
70
72
|
}
|
|
71
73
|
async queryPermission() {
|
|
@@ -184,8 +186,10 @@ var R2FileSystemDirectoryHandle = class _R2FileSystemDirectoryHandle {
|
|
|
184
186
|
}
|
|
185
187
|
}
|
|
186
188
|
async isSameEntry(other) {
|
|
187
|
-
if (other.kind !== "directory")
|
|
188
|
-
|
|
189
|
+
if (other.kind !== "directory")
|
|
190
|
+
return false;
|
|
191
|
+
if (!(other instanceof _R2FileSystemDirectoryHandle))
|
|
192
|
+
return false;
|
|
189
193
|
return this.#prefix === other.#prefix;
|
|
190
194
|
}
|
|
191
195
|
async queryPermission() {
|
package/src/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { type PlatformDefaults, type Handler, type Server, type ServerOptions, t
|
|
|
13
13
|
import { type ShovelConfig } from "@b9g/platform/runtime";
|
|
14
14
|
export type { Handler, Server, ServerOptions, ServiceWorkerOptions, ServiceWorkerInstance, } from "@b9g/platform";
|
|
15
15
|
export interface CloudflarePlatformOptions {
|
|
16
|
-
/** Port for development server (default:
|
|
16
|
+
/** Port for development server (default: 7777) */
|
|
17
17
|
port?: number;
|
|
18
18
|
/** Host for development server (default: localhost) */
|
|
19
19
|
host?: string;
|
package/src/index.js
CHANGED
|
@@ -92,7 +92,7 @@ var CloudflarePlatform = class {
|
|
|
92
92
|
assetsDirectory: options.assetsDirectory,
|
|
93
93
|
cwd,
|
|
94
94
|
config: options.config,
|
|
95
|
-
port: options.port ??
|
|
95
|
+
port: options.port ?? 7777,
|
|
96
96
|
host: options.host ?? "localhost"
|
|
97
97
|
};
|
|
98
98
|
}
|
|
@@ -269,8 +269,9 @@ export default { fetch: createFetchHandler(registration) };
|
|
|
269
269
|
getDefaults() {
|
|
270
270
|
return {
|
|
271
271
|
caches: {
|
|
272
|
-
|
|
273
|
-
module: "@b9g/platform-cloudflare/caches"
|
|
272
|
+
"*": {
|
|
273
|
+
module: "@b9g/platform-cloudflare/caches",
|
|
274
|
+
export: "CloudflareNativeCache"
|
|
274
275
|
}
|
|
275
276
|
},
|
|
276
277
|
directories: {
|
package/src/platform.js
CHANGED
package/src/variables.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Per-request storage for Cloudflare's env object.
|
|
9
9
|
* Set by createFetchHandler() via envStorage.run().
|
|
10
10
|
*/
|
|
11
|
-
export declare const envStorage:
|
|
11
|
+
export declare const envStorage: import("@b9g/async-context").AsyncVariable<Record<string, unknown>>;
|
|
12
12
|
/**
|
|
13
13
|
* Get the current Cloudflare env or throw if not in request context.
|
|
14
14
|
*/
|