Skip to content

Commit

Permalink
build wrangler
Browse files Browse the repository at this point in the history
  • Loading branch information
penalosa committed Oct 3, 2024
1 parent 6fd3a45 commit b8c8e32
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/wrangler/scripts/emit-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ const packageJson = JSON.parse(
const configObject = ExtractorConfig.loadFile(configObjectFullPath);

// include the dependencies we want to bundle
configObject.bundledPackages = BUNDLED_DEPENDENCIES;
configObject.bundledPackages = BUNDLED_DEPENDENCIES.filter(
(d) => d !== "cloudflare" && d !== "@iarna/toml"
);

const pkgRoot = path.resolve(__dirname, "..");

Expand Down
7 changes: 4 additions & 3 deletions packages/wrangler/src/cfetch/internal.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from "node:assert";
import Cloudflare from "cloudflare";
import Cloudflare, { ClientOptions } from "cloudflare";
import { fetch, File, FormData, Headers, Request, Response } from "undici";
import { version as wranglerVersion } from "../../package.json";
import { getCloudflareApiBaseUrl } from "../environment-variables/misc-variables";
Expand Down Expand Up @@ -120,17 +120,18 @@ export async function fetchInternal<ResponseType>(

export function getSdk() {
return new Cloudflare({
async fetch(info, init) {
fetch: (async (info, init) => {
const request = new Request(info, init);
const url = new URL(request.url);

return performApiFetch(
url.pathname.split("/client/v4")[1],
// @ts-ignore
{ ...request },
url.searchParams,
request.signal
);
},
}) as ClientOptions["fetch"],
});
}

Expand Down
1 change: 1 addition & 0 deletions packages/wrangler/src/deploy/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ async function ensureBindingsExist(
mtls_certificates: undefined,
logfwdr: undefined,
unsafe: undefined,
experimental_assets: undefined,
};

// First, figure out what bindings we need to create
Expand Down

0 comments on commit b8c8e32

Please sign in to comment.