@bino0216/nitro-cloudflare-dev 0.2.11 → 0.2.14
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/dist/runtime/plugin.dev.mjs +10 -0
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getRequestURL, useRuntimeConfig } from "#imports";
|
|
2
|
+
import { wrapR2BucketForDev } from "openwrangler";
|
|
2
3
|
const _proxy = _getPlatformProxy().catch((error) => {
|
|
3
4
|
console.error("Failed to initialize wrangler bindings proxy", error);
|
|
4
5
|
return _createStubProxy();
|
|
@@ -84,6 +85,15 @@ async function _getPlatformProxy() {
|
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
}
|
|
88
|
+
} else if (!remote && remoteBindings.length > 0) {
|
|
89
|
+
for (const binding of remoteBindings) {
|
|
90
|
+
if (binding.type === "r2" && binding.name) {
|
|
91
|
+
const localR2 = proxy.env[binding.name];
|
|
92
|
+
if (localR2) {
|
|
93
|
+
proxy.env[binding.name] = wrapR2BucketForDev(localR2);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
87
97
|
}
|
|
88
98
|
return proxy;
|
|
89
99
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bino0216/nitro-cloudflare-dev",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.14",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "POC module to enable access to the Cloudflare runtime bindings in development server of Nitro and Nuxt",
|
|
7
7
|
"license": "MIT",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"consola": "^3.4.0",
|
|
27
27
|
"mlly": "^1.7.4",
|
|
28
28
|
"pkg-types": "^2.1.0",
|
|
29
|
-
"openwrangler": "0.0.
|
|
29
|
+
"openwrangler": "0.0.13"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@cloudflare/workers-types": "^4.20250303.0",
|