Skip to content

Commit c3c193e

Browse files
authored
Revert "add support for assets bindings to getPlatformProxy (#7816)" (#7866)
This reverts commit f6cc029.
1 parent a2f695b commit c3c193e

File tree

4 files changed

+1
-33
lines changed

4 files changed

+1
-33
lines changed

fixtures/get-platform-proxy/public/test.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

fixtures/get-platform-proxy/tests/get-platform-proxy.env.test.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@ import path from "path";
22
import { D1Database, R2Bucket } from "@cloudflare/workers-types";
33
import { beforeEach, describe, expect, it, vi } from "vitest";
44
import { getPlatformProxy } from "./shared";
5-
import type {
6-
Fetcher,
7-
Hyperdrive,
8-
KVNamespace,
9-
} from "@cloudflare/workers-types";
5+
import type { Hyperdrive, KVNamespace } from "@cloudflare/workers-types";
106
import type { Unstable_DevWorker } from "wrangler";
117

128
type Env = {
@@ -19,7 +15,6 @@ type Env = {
1915
MY_BUCKET: R2Bucket;
2016
MY_D1: D1Database;
2117
MY_HYPERDRIVE: Hyperdrive;
22-
ASSETS: Fetcher;
2318
};
2419

2520
const wranglerTomlFilePath = path.join(__dirname, "..", "wrangler.toml");
@@ -120,17 +115,6 @@ describe("getPlatformProxy - env", () => {
120115
}
121116
});
122117

123-
it("correctly obtains functioning ASSETS bindings", async () => {
124-
const { env, dispose } = await getPlatformProxy<Env>({
125-
configPath: wranglerTomlFilePath,
126-
});
127-
const { ASSETS } = env;
128-
const res = await ASSETS.fetch("https://0.0.0.0/test.txt");
129-
const text = await res.text();
130-
expect(text).toEqual("this is a test text file!\n");
131-
await dispose();
132-
});
133-
134118
it("correctly obtains functioning KV bindings", async () => {
135119
const { env, dispose } = await getPlatformProxy<Env>({
136120
configPath: wranglerTomlFilePath,

fixtures/get-platform-proxy/wrangler.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ MY_VAR = "my-var-value"
77
MY_VAR_A = "my-var-a"
88
MY_JSON_VAR = { test = true }
99

10-
[assets]
11-
directory = "./public"
12-
binding = "ASSETS"
13-
html_handling = "auto-trailing-slash"
14-
not_found_handling = "none"
15-
1610
[[kv_namespaces]]
1711
binding = "MY_KV"
1812
id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

packages/wrangler/src/api/integrations/platform/index.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,6 @@ async function getMiniflareOptionsFromConfig(
158158
migrations: rawConfig.migrations,
159159
});
160160

161-
const processedAssetOptions = getAssetsOptions(
162-
{ assets: undefined },
163-
rawConfig
164-
);
165-
const assetOptions = processedAssetOptions
166-
? buildAssetOptions({ assets: processedAssetOptions })
167-
: {};
168-
169161
const persistOptions = getMiniflarePersistOptions(options.persist);
170162

171163
const serviceBindings = await getServiceBindings(bindings.services);
@@ -180,7 +172,6 @@ async function getMiniflareOptionsFromConfig(
180172
...serviceBindings,
181173
...bindingOptions.serviceBindings,
182174
},
183-
...assetOptions,
184175
},
185176
...externalWorkers,
186177
],

0 commit comments

Comments
 (0)