Skip to content

Commit a11461c

Browse files
authored
refactor!: remove shamefullyPatchR2Buckets option (#47)
1 parent 996f57f commit a11461c

File tree

7 files changed

+11
-83
lines changed

7 files changed

+11
-83
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ You can configure additional options using `cloudflareDev: { }` in `nitro.config
4444
- `persistDir`: Sets the persist dir (default `.wrangler/state/v3`).
4545
- `configPath`: Sets a custom path for `wrangler.toml` file.
4646
- `silent`: Hide initial banner.
47-
- `shamefullyPatchR2Buckets`: Add workaround for https://github.com/cloudflare/workers-sdk/issues/5360
4847
- `environment`: Sets specific environment (useful for multi-environment configurations)
4948

5049
## Development

examples/nitro/nitro.config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,5 @@ import nitroCloudflareBindings from "nitro-cloudflare-dev";
22

33
// https://nitro.unjs.io/config
44
export default defineNitroConfig({
5-
modules: [nitroCloudflareBindings],
6-
cloudflareDev: {
7-
shamefullyPatchR2Buckets: true,
8-
},
5+
modules: [nitroCloudflareBindings]
96
});

examples/nuxt/nuxt.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// https://nuxt.com/docs/api/configuration/nuxt-config
22
export default defineNuxtConfig({
33
modules: ["nitro-cloudflare-dev"],
4-
});
4+
compatibilityDate: "2024-10-10",
5+
});

pnpm-lock.yaml

Lines changed: 8 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ declare module "nitropack" {
1616
environment?: string;
1717
persistDir?: string;
1818
silent?: boolean;
19-
/** workaround for https://github.com/cloudflare/workers-sdk/issues/5360 */
20-
shamefullyPatchR2Buckets?: boolean;
2119
};
2220
}
2321
}
@@ -71,8 +69,6 @@ async function nitroModule(nitro: Nitro) {
7169
// Share config to the runtime
7270
nitro.options.runtimeConfig.wrangler = {
7371
...nitro.options.runtimeConfig.wrangler,
74-
shamefullyPatchR2Buckets:
75-
nitro.options.cloudflareDev?.shamefullyPatchR2Buckets,
7672
configPath,
7773
persistDir,
7874
environment: nitro.options.cloudflareDev?.environment,

src/runtime/plugin.dev.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ async function _getPlatformProxy() {
6767
wrangler: {
6868
configPath: string;
6969
persistDir: string;
70-
shamefullyPatchR2Buckets?: boolean;
7170
environment?: string;
7271
};
7372
} = useRuntimeConfig();
@@ -78,16 +77,6 @@ async function _getPlatformProxy() {
7877
environment: runtimeConfig.wrangler.environment,
7978
});
8079

81-
if (runtimeConfig.wrangler.shamefullyPatchR2Buckets) {
82-
const { patchR2Bucket } = await import("./r2-patch");
83-
for (const [key, binding] of Object.entries(proxy.env) as [string, any][]) {
84-
if (binding.createMultipartUpload) {
85-
// console.log("Patching R2Bucket", key);
86-
proxy.env[key] = patchR2Bucket(binding);
87-
}
88-
}
89-
}
90-
9180
return proxy;
9281
}
9382

src/runtime/r2-patch.ts

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)