Skip to content

Commit 359e5ab

Browse files
petebacondarwinmrbbot
authored andcommitted
remove unused d1 stuff from Pages bundling
1 parent 4ae98b2 commit 359e5ab

File tree

4 files changed

+0
-22
lines changed

4 files changed

+0
-22
lines changed

packages/wrangler/src/api/pages/deploy.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,6 @@ export async function deploy({
157157
// Routing configuration displayed in the Functions tab of a deployment in Dash
158158
let filepathRoutingConfig: string | undefined;
159159

160-
const d1Databases = Object.keys(
161-
project.deployment_configs[isProduction ? "production" : "preview"]
162-
.d1_databases ?? {}
163-
);
164-
165160
if (!_workerJS && existsSync(functionsDirectory)) {
166161
const outputConfigPath = join(
167162
tmpdir(),
@@ -176,7 +171,6 @@ export async function deploy({
176171
buildOutputDirectory: directory,
177172
routesOutputPath,
178173
local: false,
179-
d1Databases,
180174
nodejsCompat,
181175
});
182176

@@ -254,7 +248,6 @@ export async function deploy({
254248
workerBundle = await traverseAndBuildWorkerJSDirectory({
255249
workerJSDirectory: _workerPath,
256250
buildOutputDirectory: directory,
257-
d1Databases,
258251
nodejsCompat,
259252
});
260253
} else if (_workerJS) {

packages/wrangler/src/pages/build.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -186,20 +186,9 @@ export const Handler = async (args: PagesBuildArgs) => {
186186
buildOutputDirectory,
187187
nodejsCompat,
188188
legacyNodeCompat,
189-
bindings,
190189
workerScriptPath,
191190
} = validatedArgs;
192191

193-
let d1Databases: string[] | undefined = undefined;
194-
if (bindings) {
195-
try {
196-
const decodedBindings = JSON.parse(bindings);
197-
d1Databases = Object.keys(decodedBindings?.d1_databases || {});
198-
} catch {
199-
throw new FatalError("Could not parse a valid set of 'bindings'.", 1);
200-
}
201-
}
202-
203192
/**
204193
* prioritize building `_worker.js` over Pages Functions, if both exist
205194
* and if we were able to resolve _worker.js
@@ -209,7 +198,6 @@ export const Handler = async (args: PagesBuildArgs) => {
209198
bundle = await traverseAndBuildWorkerJSDirectory({
210199
workerJSDirectory: workerScriptPath,
211200
buildOutputDirectory,
212-
d1Databases,
213201
nodejsCompat,
214202
});
215203
} else {
@@ -251,7 +239,6 @@ export const Handler = async (args: PagesBuildArgs) => {
251239
nodejsCompat,
252240
routesOutputPath,
253241
local: false,
254-
d1Databases,
255242
});
256243
} catch (e) {
257244
if (e instanceof FunctionsNoRoutesError) {

packages/wrangler/src/pages/buildFunctions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export async function buildFunctions({
5353
onEnd?: () => void;
5454
routesOutputPath?: PagesBuildArgs["outputRoutesPath"];
5555
local: boolean;
56-
d1Databases?: string[];
5756
legacyNodeCompat?: boolean;
5857
nodejsCompat?: boolean;
5958
}) {

packages/wrangler/src/pages/functions/buildWorker.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ export async function traverseAndBuildWorkerJSDirectory({
262262
}: {
263263
workerJSDirectory: string;
264264
buildOutputDirectory: string;
265-
d1Databases?: string[];
266265
nodejsCompat?: boolean;
267266
}): Promise<BundleResult> {
268267
const entrypoint = resolve(join(workerJSDirectory, "index.js"));

0 commit comments

Comments
 (0)