Skip to content

Commit 5d3a166

Browse files
committed
Rename more things
1 parent 19b5e13 commit 5d3a166

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+367
-241
lines changed

.changeset/brave-paws-build.md

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

55
Turn on `wrangler.json(c)` support by default

packages/wrangler/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ $ npm install wrangler --save-dev
4343

4444
## Configuration:
4545

46-
Wrangler is configured via a `wrangler.toml` file in the project root. When utilizing the `wrangler init` command, a `wrangler.toml` file will be created for you.
46+
Wrangler is configured via a `wrangler.toml` or `wrangler.json` file in the project root. When utilizing the `wrangler init` command, a `wrangler.toml` file will be created for you.
4747

4848
Example:
4949

packages/wrangler/docs/how-to/add-a-binding.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# How to register a binding
22

3-
1. Register `wrangler.toml` section in: `packages/wrangler/src/config/environment.ts` [ref](https://github.com/cloudflare/workers-sdk/blob/ce7db9d9cb4f5bcd5a326b86dde051cb54b999fb/packages/wrangler/src/config/environment.ts#L431-L451)
3+
1. Register Wrangler configuration section in: `packages/wrangler/src/config/environment.ts` [ref](https://github.com/cloudflare/workers-sdk/blob/ce7db9d9cb4f5bcd5a326b86dde051cb54b999fb/packages/wrangler/src/config/environment.ts#L431-L451)
44
1. Register validation functions in: `packages/wrangler/src/config/validation.ts` [ref](https://github.com/cloudflare/workers-sdk/blob/ce7db9d9cb4f5bcd5a326b86dde051cb54b999fb/packages/wrangler/src/config/validation.ts#L1297-L1306)
55
1. Add empty state for bindings, as necessary (tip: use typescript to guide you -- either via your editor or run: `pnpm check:type` from within `packages/wrangler`)
66
1. Add type for deployment bundle to:
@@ -14,5 +14,5 @@
1414
- `convertBindingsToCfWorkerInitBindings` in: `packages/wrangler/src/api/startDevWorker/utils.ts` [ref](https://github.com/cloudflare/workers-sdk/blob/ce7db9d9cb4f5bcd5a326b86dde051cb54b999fb/packages/wrangler/src/api/startDevWorker/utils.ts#L303-L305)
1515
1. Test binding is deployed and printed in: `packages/wrangler/src/**tests**/deploy.test.ts` [ref](https://github.com/cloudflare/workers-sdk/blob/ce7db9d9cb4f5bcd5a326b86dde051cb54b999fb/packages/wrangler/src/__tests__/deploy.test.ts#L7604)
1616
1. Test your validation in: `packages/wrangler/src/**tests**/configuration.test.ts` [ref](https://github.com/cloudflare/workers-sdk/blob/ce7db9d9cb4f5bcd5a326b86dde051cb54b999fb/packages/wrangler/src/__tests__/configuration.test.ts#L2234)
17-
1. Enable `wrangler init --from-dash` to include your binding in the `wrangler.toml` it generates in: `packages/wrangler/src/init.ts` [ref](https://github.com/cloudflare/workers-sdk/blob/ce7db9d9cb4f5bcd5a326b86dde051cb54b999fb/packages/wrangler/src/init.ts#L1036-L1043)
17+
1. Enable `wrangler init --from-dash` to include your binding in the Wrangler configuration file it generates in: `packages/wrangler/src/init.ts` [ref](https://github.com/cloudflare/workers-sdk/blob/ce7db9d9cb4f5bcd5a326b86dde051cb54b999fb/packages/wrangler/src/init.ts#L1036-L1043)
1818
1. Enable `wrangler types` to emit your binding type in: `packages/src/type-generation/index.ts` [ref](https://github.com/cloudflare/workers-sdk/blob/ce7db9d9cb4f5bcd5a326b86dde051cb54b999fb/packages/wrangler/src/type-generation/index.ts#L115)

packages/wrangler/src/api/integrations/deprecated/getBindingsProxy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export type BindingsProxy<
1919
};
2020

2121
/**
22-
* By reading from a `wrangler.toml` file this function generates proxy binding objects that can be
22+
* By reading from a Wrangler configuration file this function generates proxy binding objects that can be
2323
* used to simulate the interaction with bindings during local development in a Node.js environment
2424
*
2525
* @deprecated use `getPlatformProxy` instead

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export type GetPlatformProxyOptions = {
3131
/**
3232
* The path to the config file to use.
3333
* If no path is specified the default behavior is to search from the
34-
* current directory up the filesystem for a `wrangler.toml` to use.
34+
* current directory up the filesystem for a Wrangler configuration file to use.
3535
*
3636
* Note: this field is optional but if a path is specified it must
3737
* point to a valid file on the filesystem
@@ -81,7 +81,7 @@ export type PlatformProxy<
8181
};
8282

8383
/**
84-
* By reading from a `wrangler.toml` file this function generates proxy objects that can be
84+
* By reading from a Wrangler configuration file this function generates proxy objects that can be
8585
* used to simulate the interaction with the Cloudflare platform during local development
8686
* in a Node.js environment
8787
*

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,15 @@ export class BundlerController extends Controller<BundlerControllerEventMap> {
5555
logger.log(`The file ${filePath} changed, restarting build...`);
5656
this.emitBundleStartEvent(config);
5757
try {
58-
await runCustomBuild(config.entrypoint, relativeFile, {
59-
cwd: config.build?.custom?.workingDirectory,
60-
command: config.build?.custom?.command,
61-
});
58+
await runCustomBuild(
59+
config.entrypoint,
60+
relativeFile,
61+
{
62+
cwd: config.build?.custom?.workingDirectory,
63+
command: config.build?.custom?.command,
64+
},
65+
config.config
66+
);
6267
if (buildAborter.signal.aborted) {
6368
return;
6469
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ async function resolveDevConfig(
119119
origin: {
120120
secure:
121121
input.dev?.origin?.secure ?? config.dev.upstream_protocol === "https",
122-
hostname: host ?? getInferredHost(routes),
122+
hostname: host ?? getInferredHost(routes, config.configPath),
123123
},
124124
liveReload: input.dev?.liveReload || false,
125125
testScheduled: input.dev?.testScheduled,
@@ -253,6 +253,7 @@ async function resolveConfig(
253253

254254
const resolved = {
255255
name: getScriptName({ name: input.name, env: input.env }, config),
256+
config: config.configPath,
256257
compatibilityDate: getDevCompatibilityDate(config, input.compatibilityDate),
257258
compatibilityFlags: input.compatibilityFlags ?? config.compatibility_flags,
258259
entrypoint: entry.file,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export class DevEnv extends EventEmitter {
117117
logger.debug(`Error in ${ev.source}: ${ev.reason}\n`, ev.cause);
118118
logger.debug("=> Error contextual data:", ev.data);
119119
}
120-
// Parse errors are recoverable by changing your `wrangler.toml` and saving
120+
// Parse errors are recoverable by changing your Wrangler configuration file and saving
121121
// All other errors from the ConfigController are non-recoverable
122122
else if (
123123
ev.source === "ConfigController" &&

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ export class RemoteRuntimeController extends RuntimeController {
8787
host: props.host,
8888
routes: props.routes,
8989
sendMetrics: props.sendMetrics,
90+
configPath: props.configPath,
9091
}
9192
);
9293
if (!this.#session) {
@@ -157,6 +158,7 @@ export class RemoteRuntimeController extends RuntimeController {
157158
host: config.dev.origin?.hostname,
158159
routes,
159160
sendMetrics: config.sendMetrics,
161+
configPath: config.config,
160162
});
161163

162164
const bindings = (
@@ -187,6 +189,7 @@ export class RemoteRuntimeController extends RuntimeController {
187189
routes,
188190
host: config.dev.origin?.hostname,
189191
sendMetrics: config.sendMetrics,
192+
configPath: config.config,
190193
});
191194

192195
// If we received a new `bundleComplete` event before we were able to

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export interface StartDevWorkerInput {
6060
name?: string;
6161
/**
6262
* The javascript or typescript entry-point of the worker.
63-
* This is the `main` property of a wrangler.toml.
63+
* This is the `main` property of a Wrangler configuration file.
6464
* You can specify a file path or provide the contents directly.
6565
*/
6666
entrypoint?: string;
@@ -173,7 +173,7 @@ export interface StartDevWorkerInput {
173173
}
174174

175175
export type StartDevWorkerOptions = Omit<StartDevWorkerInput, "assets"> & {
176-
/** A worker's directory. Usually where the wrangler.toml file is located */
176+
/** A worker's directory. Usually where the Wrangler configuration file is located */
177177
projectRoot: string;
178178
build: StartDevWorkerInput["build"] & {
179179
nodejsCompatMode: NodeJSCompatMode;
@@ -192,7 +192,7 @@ export type StartDevWorkerOptions = Omit<StartDevWorkerInput, "assets"> & {
192192
};
193193
dev: StartDevWorkerInput["dev"] & {
194194
persist: string;
195-
auth?: AsyncHook<CfAccount>; // redefine without config.account_id hook param (can only be provided by ConfigController with access to wrangler.toml, not by other controllers eg RemoteRuntimeContoller)
195+
auth?: AsyncHook<CfAccount>; // redefine without config.account_id hook param (can only be provided by ConfigController with access to the Wrangler configuration file, not by other controllers eg RemoteRuntimeContoller)
196196
};
197197
entrypoint: string;
198198
assets?: AssetsOptions;

0 commit comments

Comments
 (0)