Skip to content

Commit

Permalink
Revert "add support for assets bindings to getPlatformProxy (#7816)" (
Browse files Browse the repository at this point in the history
#7866)

This reverts commit f6cc029.
  • Loading branch information
penalosa authored Jan 22, 2025
1 parent a2f695b commit c3c193e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 33 deletions.
1 change: 0 additions & 1 deletion fixtures/get-platform-proxy/public/test.txt

This file was deleted.

18 changes: 1 addition & 17 deletions fixtures/get-platform-proxy/tests/get-platform-proxy.env.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ import path from "path";
import { D1Database, R2Bucket } from "@cloudflare/workers-types";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { getPlatformProxy } from "./shared";
import type {
Fetcher,
Hyperdrive,
KVNamespace,
} from "@cloudflare/workers-types";
import type { Hyperdrive, KVNamespace } from "@cloudflare/workers-types";
import type { Unstable_DevWorker } from "wrangler";

type Env = {
Expand All @@ -19,7 +15,6 @@ type Env = {
MY_BUCKET: R2Bucket;
MY_D1: D1Database;
MY_HYPERDRIVE: Hyperdrive;
ASSETS: Fetcher;
};

const wranglerTomlFilePath = path.join(__dirname, "..", "wrangler.toml");
Expand Down Expand Up @@ -120,17 +115,6 @@ describe("getPlatformProxy - env", () => {
}
});

it("correctly obtains functioning ASSETS bindings", async () => {
const { env, dispose } = await getPlatformProxy<Env>({
configPath: wranglerTomlFilePath,
});
const { ASSETS } = env;
const res = await ASSETS.fetch("https://0.0.0.0/test.txt");
const text = await res.text();
expect(text).toEqual("this is a test text file!\n");
await dispose();
});

it("correctly obtains functioning KV bindings", async () => {
const { env, dispose } = await getPlatformProxy<Env>({
configPath: wranglerTomlFilePath,
Expand Down
6 changes: 0 additions & 6 deletions fixtures/get-platform-proxy/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ MY_VAR = "my-var-value"
MY_VAR_A = "my-var-a"
MY_JSON_VAR = { test = true }

[assets]
directory = "./public"
binding = "ASSETS"
html_handling = "auto-trailing-slash"
not_found_handling = "none"

[[kv_namespaces]]
binding = "MY_KV"
id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Expand Down
9 changes: 0 additions & 9 deletions packages/wrangler/src/api/integrations/platform/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,6 @@ async function getMiniflareOptionsFromConfig(
migrations: rawConfig.migrations,
});

const processedAssetOptions = getAssetsOptions(
{ assets: undefined },
rawConfig
);
const assetOptions = processedAssetOptions
? buildAssetOptions({ assets: processedAssetOptions })
: {};

const persistOptions = getMiniflarePersistOptions(options.persist);

const serviceBindings = await getServiceBindings(bindings.services);
Expand All @@ -180,7 +172,6 @@ async function getMiniflareOptionsFromConfig(
...serviceBindings,
...bindingOptions.serviceBindings,
},
...assetOptions,
},
...externalWorkers,
],
Expand Down

0 comments on commit c3c193e

Please sign in to comment.