Skip to content

Commit 762b126

Browse files
committed
chore: fix lint and formatting errors
1 parent 7d58c2c commit 762b126

File tree

8 files changed

+26
-24
lines changed

8 files changed

+26
-24
lines changed

.changeset/angry-keys-dance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"wrangler": minor
33
---
44

5-
Added new [[pipelines]] bindings. This creates a new binding that allows sending events to
5+
Added new [[pipelines]] bindings. This creates a new binding that allows sending events to
66
the specified pipeline.
77

88
Example:

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ packages/create-cloudflare/templates/**/*.*
2424
# but still exclude the worker-configuration.d.ts file, since it's generated
2525
!packages/create-cloudflare/templates/hello-world/**/*.*
2626
packages/create-cloudflare/templates/hello-world/**/worker-configuration.d.ts
27+
# dist-functions are generated in the fixtures/vitest-pool-workers-examples/pages-functions-unit-integration-self folder
28+
dist-functions
2729

2830
vscode.d.ts
2931
vscode.*.d.ts

packages/wrangler/src/__tests__/type-generation.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ const bindingsConfigMock: Omit<
217217
},
218218
{ type: "CompiledWasm", globs: ["**/*.wasm"], fallthrough: true },
219219
],
220+
pipelines: [],
220221
};
221222

222223
describe("generateTypes()", () => {

packages/wrangler/src/api/startDevWorker/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ export async function convertBindingsToCfWorkerInitBindings(
288288
logfwdr: undefined,
289289
unsafe: undefined,
290290
experimental_assets: undefined,
291-
pipelines: undefined
291+
pipelines: undefined,
292292
};
293293

294294
const fetchers: Record<string, ServiceFetch> = {};

packages/wrangler/src/config/index.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
1+
import fs from "node:fs";
12
import dotenv from "dotenv";
23
import { findUpSync } from "find-up";
3-
import fs from "node:fs";
4-
import type { CfWorkerInit } from "../deployment-bundle/worker";
54
import { FatalError, UserError } from "../errors";
65
import { getFlag } from "../experimental-flags";
76
import { logger } from "../logger";
87
import { EXIT_CODE_INVALID_PAGES_CONFIG } from "../pages/errors";
98
import { parseJSONC, parseTOML, readFileSync } from "../parse";
9+
import { isPagesConfig, normalizeAndValidateConfig } from "./validation";
10+
import { validatePagesConfig } from "./validation-pages";
11+
import type { CfWorkerInit } from "../deployment-bundle/worker";
1012
import type { CommonYargsOptions } from "../yargs-types";
1113
import type { Config, OnlyCamelCase, RawConfig } from "./config";
1214
import type { NormalizeAndValidateConfigArgs } from "./validation";
13-
import { isPagesConfig, normalizeAndValidateConfig } from "./validation";
14-
import { validatePagesConfig } from "./validation-pages";
1515

1616
export type {
17-
Config, ConfigFields,
18-
DevConfig, RawConfig, RawDevConfig
17+
Config,
18+
ConfigFields,
19+
DevConfig,
20+
RawConfig,
21+
RawDevConfig,
1922
} from "./config";
2023
export type {
21-
ConfigModuleRuleType, Environment,
22-
RawEnvironment
24+
ConfigModuleRuleType,
25+
Environment,
26+
RawEnvironment,
2327
} from "./environment";
2428

2529
type ReadConfigCommandArgs = NormalizeAndValidateConfigArgs & {
@@ -446,8 +450,8 @@ export function printBindings(bindings: CfWorkerInit["bindings"]) {
446450
entries: pipelines.map(({ binding, pipeline }) => ({
447451
key: binding,
448452
value: pipeline,
449-
}))
450-
})
453+
})),
454+
});
451455
}
452456

453457
if (version_metadata !== undefined) {

packages/wrangler/src/config/validation.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3117,9 +3117,7 @@ const validateConsumer: ValidatorFn = (diagnostics, field, value, _config) => {
31173117
const validatePipelineBinding: ValidatorFn = (diagnostics, field, value) => {
31183118
if (typeof value !== "object" || value === null) {
31193119
diagnostics.errors.push(
3120-
`"pipeline" bindings should be objects, but got ${JSON.stringify(
3121-
value
3122-
)}`
3120+
`"pipeline" bindings should be objects, but got ${JSON.stringify(value)}`
31233121
);
31243122
return false;
31253123
}
@@ -3150,8 +3148,6 @@ const validatePipelineBinding: ValidatorFn = (diagnostics, field, value) => {
31503148
return isValid;
31513149
};
31523150

3153-
3154-
31553151
function normalizeAndValidateLimits(
31563152
diagnostics: Diagnostics,
31573153
topLevelEnv: Environment | undefined,

packages/wrangler/src/deployment-bundle/create-worker-upload-form.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ export type WorkerMetadataBinding =
109109
params?: { name: string }[];
110110
};
111111
}
112-
| { type: "mtls_certificate"; name: string; certificate_id: string }
113-
| { type: "pipelines"; name: string; id: string }
114-
| {
112+
| { type: "mtls_certificate"; name: string; certificate_id: string }
113+
| { type: "pipelines"; name: string; id: string }
114+
| {
115115
type: "logfwdr";
116116
name: string;
117117
destination: string;
@@ -320,10 +320,10 @@ export function createWorkerUploadForm(worker: CfWorkerInit): FormData {
320320
bindings.pipelines?.forEach(({ binding, pipeline }) => {
321321
metadataBindings.push({
322322
name: binding,
323-
type: 'pipelines',
323+
type: "pipelines",
324324
id: pipeline,
325-
})
326-
})
325+
});
326+
});
327327

328328
bindings.logfwdr?.bindings.forEach(({ name, destination }) => {
329329
metadataBindings.push({

packages/wrangler/src/dev.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ import type {
7171
} from "./yargs-types";
7272
import type { Json } from "miniflare";
7373
import type React from "react";
74-
import { pipeline } from "node:stream";
7574

7675
export function devOptions(yargs: CommonYargsArgv) {
7776
return (

0 commit comments

Comments
 (0)