@b9g/platform-cloudflare 0.1.2 → 0.1.4

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.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/src/platform.js +2 -18
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b9g/platform-cloudflare",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Cloudflare Workers platform adapter for Shovel - already ServiceWorker-based!",
5
5
  "keywords": [
6
6
  "shovel",
@@ -11,13 +11,13 @@
11
11
  "serviceworker"
12
12
  ],
13
13
  "dependencies": {
14
- "@b9g/platform": "^0.1.1",
15
- "@b9g/cache": "^0.1.1",
16
- "@b9g/assets": "^0.1.1",
14
+ "@b9g/platform": "^0.1.4",
15
+ "@b9g/cache": "^0.1.3",
16
+ "@b9g/assets": "^0.1.4",
17
17
  "@cloudflare/workers-types": "^4.20241218.0"
18
18
  },
19
19
  "devDependencies": {
20
- "@b9g/libuild": "^0.1.10",
20
+ "@b9g/libuild": "^0.1.11",
21
21
  "bun-types": "latest"
22
22
  },
23
23
  "type": "module",
package/src/platform.js CHANGED
@@ -1,17 +1,9 @@
1
1
  /// <reference types="./platform.d.ts" />
2
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
- }) : x)(function(x) {
5
- if (typeof require !== "undefined")
6
- return require.apply(this, arguments);
7
- throw Error('Dynamic require of "' + x + '" is not supported');
8
- });
9
-
10
2
  // src/platform.ts
11
3
  import {
12
4
  BasePlatform
13
5
  } from "@b9g/platform";
14
- import { FileSystemRegistry, getFileSystemRoot, MemoryBucket } from "@b9g/filesystem";
6
+ import { FileSystemRegistry, getDirectoryHandle, MemoryBucket } from "@b9g/filesystem";
15
7
  var CloudflarePlatform = class extends BasePlatform {
16
8
  name = "cloudflare";
17
9
  options;
@@ -26,14 +18,6 @@ var CloudflarePlatform = class extends BasePlatform {
26
18
  ...options
27
19
  };
28
20
  FileSystemRegistry.register("memory", new MemoryBucket());
29
- if (this.options.r2Buckets?.default) {
30
- try {
31
- const { R2FileSystemAdapter } = __require("@b9g/filesystem-r2");
32
- FileSystemRegistry.register("r2", new R2FileSystemAdapter(this.options.r2Buckets.default));
33
- } catch {
34
- console.warn("[Cloudflare] R2 adapter not available, using memory filesystem");
35
- }
36
- }
37
21
  }
38
22
  /**
39
23
  * Get filesystem directory handle (memory-only in Workers runtime)
@@ -118,7 +102,7 @@ var CloudflarePlatform = class extends BasePlatform {
118
102
  * Get filesystem root for File System Access API
119
103
  */
120
104
  async getFileSystemRoot(name = "default") {
121
- return await getFileSystemRoot(name);
105
+ return await getDirectoryHandle(name);
122
106
  }
123
107
  /**
124
108
  * Dispose of platform resources