Skip to content

Commit 0e63a6e

Browse files
Oxyjunmarciocloudflare
authored andcommitted
[All] Cleaning up references to wrangler.toml. (#19403)
* Cleaning up references to wrangler.toml. * Removing erroneous import line. * Making sure all imports are at the top of the page. * Catching more instances of wrangler.toml. * Fixing typo * Update src/content/docs/workers/platform/pricing.mdx Co-authored-by: marciocloudflare <[email protected]> * Update src/content/docs/workers/languages/python/index.mdx Co-authored-by: marciocloudflare <[email protected]> * Syntax formatting and edit for accuracy. * Updating language to `wrangler.toml / wrangler.json` --------- Co-authored-by: marciocloudflare <[email protected]>
1 parent 04c1b15 commit 0e63a6e

File tree

210 files changed

+830
-1015
lines changed

Some content is hidden

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

210 files changed

+830
-1015
lines changed

src/content/changelogs/queues.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ entries:
6464
description: |-
6565
Queue consumers will soon automatically scale up concurrently as a queues' backlog grows in order to keep overall message processing latency down. Concurrency will be enabled on all existing queues by 2023-03-28.
6666
67-
**To opt-out, or to configure a fixed maximum concurrency**, set `max_concurrency = 1` in your `wrangler.toml` file or via [the queues dashboard](https://dash.cloudflare.com/?to=/:account/queues).
67+
**To opt-out, or to configure a fixed maximum concurrency**, set `max_concurrency = 1` in your `wrangler.toml / wrangler.json` file or via [the queues dashboard](https://dash.cloudflare.com/?to=/:account/queues).
6868
6969
**To opt-in, you do not need to take any action**: your consumer will begin to scale out as needed to keep up with your message backlog. It will scale back down as the backlog shrinks, and/or if a consumer starts to generate a higher rate of errors. To learn more about how consumers scale, refer to the [consumer concurrency](/queues/configuration/consumer-concurrency/) documentation.
7070
- publish_date: "2023-03-02"

src/content/docs/ai-gateway/integrations/aig-workers-ai-binding.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pcx_content_type: tutorial
44
updated: 2024-10-17
55
---
66

7-
import { Render, PackageManagers } from "~/components";
7+
import { Render, PackageManagers, WranglerConfig } from "~/components";
88

99
This guide will walk you through setting up and deploying a Workers AI project. You will use [Workers](/workers/), an AI Gateway binding, and a large language model (LLM), to deploy your first AI-powered application on the Cloudflare global network.
1010

@@ -35,7 +35,7 @@ Running `npm create cloudflare@latest` will prompt you to install the create-clo
3535
This will create a new `hello-ai` directory. Your new `hello-ai` directory will include:
3636

3737
- A "Hello World" Worker at `src/index.ts`.
38-
- A `wrangler.toml` configuration file.
38+
- A `wrangler.json` configuration file.
3939

4040
Go to your application directory:
4141

@@ -47,9 +47,7 @@ cd hello-ai
4747

4848
You must create an AI binding for your Worker to connect to Workers AI. Bindings allow your Workers to interact with resources, like Workers AI, on the Cloudflare Developer Platform.
4949

50-
To bind Workers AI to your Worker, add the following to the end of your `wrangler.toml` file:
51-
52-
import { WranglerConfig } from "~/components";
50+
To bind Workers AI to your Worker, add the following to the end of your `wrangler.json` file:
5351

5452
<WranglerConfig>
5553

@@ -72,7 +70,7 @@ Update the `index.ts` file in your `hello-ai` application directory with the fol
7270

7371
```typescript title="src/index.ts" {78-81}
7472
export interface Env {
75-
// If you set another name in wrangler.toml as the value for 'binding',
73+
// If you set another name in the `wrangler.toml / wrangler.json` file as the value for 'binding',
7674
// replace "AI" with the variable name you defined.
7775
AI: Ai;
7876
}

src/content/docs/analytics/analytics-engine/get-started.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,11 @@ head:
99

1010
---
1111

12-
import { DirectoryListing } from "~/components"
12+
import { DirectoryListing, WranglerConfig } from "~/components"
1313

1414
## 1. Name your dataset and add it to your Worker
1515

16-
Add the following to your `wrangler.toml` file to create a [binding](/workers/runtime-apis/bindings/) to a Workers Analytics Engine dataset. A dataset is like a table in SQL: the rows and columns should have consistent meaning.
17-
18-
import { WranglerConfig } from "~/components";
16+
Add the following to your `wrangler.toml / wrangler.json` file to create a [binding](/workers/runtime-apis/bindings/) to a Workers Analytics Engine dataset. A dataset is like a table in SQL: the rows and columns should have consistent meaning.
1917

2018
<WranglerConfig>
2119

src/content/docs/analytics/analytics-engine/worker-querying.mdx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ head:
88
content: Querying Workers Analytics Engine from a Worker
99
---
1010

11+
12+
import { WranglerConfig } from "~/components";
13+
1114
If you want to access Analytics Engine data from within a Worker you can use `fetch` to access the SQL API. The API can return JSON data that is easy to interact with in JavaScript.
1215

1316
## Authentication
@@ -46,9 +49,7 @@ The following is a sample Worker which executes a query against a dataset of wea
4649

4750
First the environment variables are set up with the account ID and API token.
4851

49-
The account ID is set in `wrangler.toml`:
50-
51-
import { WranglerConfig } from "~/components";
52+
The account ID is set in the `wrangler.toml / wrangler.json` file:
5253

5354
<WranglerConfig>
5455

src/content/docs/browser-rendering/get-started/browser-rendering-with-DO.mdx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ sidebar:
1414
order: 2
1515
---
1616

17-
import { Render, PackageManagers } from "~/components";
17+
import { Render, PackageManagers, WranglerConfig } from "~/components";
1818

1919
By following this guide, you will create a Worker that uses the Browser Rendering API along with [Durable Objects](/durable-objects/) to take screenshots from web pages and store them in [R2](/r2/).
2020

@@ -69,13 +69,11 @@ wrangler r2 bucket list
6969

7070
After running the `list` command, you will see all bucket names, including the ones you have just created.
7171

72-
## 5. Configure `wrangler.toml`
72+
## 5. Configure your Wrangler configuration file
7373

74-
Configure your `browser-worker` project's [`wrangler.toml`](/workers/wrangler/configuration/) file by adding a browser [binding](/workers/runtime-apis/bindings/) and a [Node.js compatibility flag](/workers/configuration/compatibility-flags/#nodejs-compatibility-flag). Browser bindings allow for communication between a Worker and a headless browser which allows you to do actions such as taking a screenshot, generating a PDF and more.
74+
Configure your `browser-worker` project's [`wrangler.toml / wrangler.json` file](/workers/wrangler/configuration/) by adding a browser [binding](/workers/runtime-apis/bindings/) and a [Node.js compatibility flag](/workers/configuration/compatibility-flags/#nodejs-compatibility-flag). Browser bindings allow for communication between a Worker and a headless browser which allows you to do actions such as taking a screenshot, generating a PDF and more.
7575

76-
Update your `wrangler.toml` configuration file with the Browser Rendering API binding, the R2 bucket you created and a Durable Object:
77-
78-
import { WranglerConfig } from "~/components";
76+
Update your `wrangler.toml / wrangler.json` file with the Browser Rendering API binding, the R2 bucket you created and a Durable Object:
7977

8078
<WranglerConfig>
8179

src/content/docs/browser-rendering/get-started/reuse-sessions.mdx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
order: 3
66
---
77

8-
import { Render, PackageManagers } from "~/components";
8+
import { Render, PackageManagers, WranglerConfig } from "~/components";
99

1010
The best way to improve the performance of your browser rendering worker is to reuse sessions. One way to do that is via [Durable Objects](/browser-rendering/get-started/browser-rendering-with-do/), which allows you to keep a long running connection from a worker to a browser. Another way is to keep the browser open after you've finished with it, and connect to that session each time you have a new request.
1111

@@ -35,22 +35,24 @@ Create a new Worker project named `browser-worker` by running:
3535

3636
## 2. Install Puppeteer
3737

38-
In your `browser-worker` directory, install Cloudflares [fork of Puppeteer](/browser-rendering/platform/puppeteer/):
38+
In your `browser-worker` directory, install Cloudflare's [fork of Puppeteer](/browser-rendering/platform/puppeteer/):
3939

4040
```sh
4141
npm install @cloudflare/puppeteer --save-dev
4242
```
4343

44-
## 3. Configure `wrangler.toml`
44+
## 3. Configure the `wrangler.toml / wrangler.json` file
4545

46-
```
46+
<WranglerConfig>
47+
```toml
4748
name = "browser-worker"
4849
main = "src/index.ts"
4950
compatibility_date = "2023-03-14"
5051
compatibility_flags = [ "nodejs_compat" ]
5152

5253
browser = { binding = "MYBROWSER" }
5354
```
55+
</WranglerConfig>
5456

5557
## 4. Code
5658

src/content/docs/browser-rendering/get-started/screenshots.mdx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
order: 1
66
---
77

8-
import { Render, TabItem, Tabs, PackageManagers } from "~/components";
8+
import { Render, TabItem, Tabs, PackageManagers, WranglerConfig } from "~/components";
99

1010
By following this guide, you will create a Worker that uses the Browser Rendering API to take screenshots from web pages. This is a common use case for browser automation.
1111

@@ -56,17 +56,15 @@ npx wrangler kv:namespace create BROWSER_KV_DEMO --preview
5656

5757
Take note of the IDs for the next step.
5858

59-
## 4. Configure `wrangler.toml`
59+
## 4. Configure the `wrangler.toml / wrangler.json` file
6060

61-
Configure your `browser-worker` project's [`wrangler.toml`](/workers/wrangler/configuration/) file by adding a browser [binding](/workers/runtime-apis/bindings/) and a [Node.js compatibility flag](/workers/configuration/compatibility-flags/#nodejs-compatibility-flag). Bindings allow your Workers to interact with resources on the Cloudflare developer platform. Your browser `binding` name is set by you, this guide uses the name `MYBROWSER`. Browser bindings allow for communication between a Worker and a headless browser which allows you to do actions such as taking a screenshot, generating a PDF and more.
61+
Configure your `browser-worker` project's [`wrangler.toml / wrangler.json` file](/workers/wrangler/configuration/) by adding a browser [binding](/workers/runtime-apis/bindings/) and a [Node.js compatibility flag](/workers/configuration/compatibility-flags/#nodejs-compatibility-flag). Bindings allow your Workers to interact with resources on the Cloudflare developer platform. Your browser `binding` name is set by you, this guide uses the name `MYBROWSER`. Browser bindings allow for communication between a Worker and a headless browser which allows you to do actions such as taking a screenshot, generating a PDF and more.
6262

63-
Update your `wrangler.toml` configuration file with the Browser Rendering API binding and the KV namespaces you created:
64-
65-
import { WranglerConfig } from "~/components";
63+
Update your `wrangler.toml / wrangler.json` file with the Browser Rendering API binding and the KV namespaces you created:
6664

6765
<WranglerConfig>
6866

69-
```toml
67+
```toml title="wrangler.toml"
7068
name = "browser-worker"
7169
main = "src/index.js"
7270
compatibility_date = "2023-03-14"

src/content/docs/browser-rendering/how-to/ai.mdx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ sidebar:
44
order: 2
55
---
66

7-
import { Aside } from "~/components";
7+
import { Aside, WranglerConfig } from "~/components";
88

9-
The ability to browse websites can be crucial when building workflows with AI. Here, we provide an example where we use Browser Rendering to visit
9+
The ability to browse websites can be crucial when building workflows with AI. Here, we provide an example where we use Browser Rendering to visit
1010
`https://news.ycombinator.com/` and then, using a machine learning model available in [Workers AI](/workers-ai/), extract the first post as JSON with a specified schema.
1111

1212
## Prerequisites
@@ -30,16 +30,20 @@ npm i zod
3030
npm i zod-to-json-schema
3131
```
3232

33-
3. Activate the nodejs compatibility flag and add your Browser Rendering binding to your new `wrangler.toml` configuration:
33+
3. Activate the nodejs compatibility flag and add your Browser Rendering binding to your new Wrangler configuration:
3434

35+
<WranglerConfig>
3536
```toml
3637
compatibility_flags = [ "nodejs_compat" ]
3738
```
39+
</WranglerConfig>
3840

41+
<WranglerConfig>
3942
```toml
4043
[browser]
4144
binding = "MY_BROWSER"
4245
```
46+
</WranglerConfig>
4347

4448
4. In order to use [Workers AI](/workers-ai/), you need to get your [Account ID and API token](/workers-ai/get-started/rest-api/#1-get-api-token-and-account-id).
4549
Once you have those, create a [`.dev.vars`](/workers/configuration/environment-variables/#add-environment-variables-via-wrangler) file and set them there:

src/content/docs/browser-rendering/how-to/pdf-generation.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ sidebar:
55
order: 1
66
---
77

8-
import { Aside } from "~/components";
8+
import { Aside, WranglerConfig } from "~/components";
99

1010
As seen in the [Getting Started guide](/browser-rendering/get-started/screenshots/), Browser Rendering can be used to generate screenshots for any given URL. Alongside screenshots, you can also generate full PDF documents for a given webpage, and can also provide the webpage markup and style ourselves.
1111

@@ -23,11 +23,13 @@ npm create cloudflare@latest -- browser-worker
2323
npm install @cloudflare/puppeteer --save-dev
2424
```
2525

26-
3. Add your Browser Rendering binding to your new `wrangler.toml` configuration:
26+
3. Add your Browser Rendering binding to your new Wrangler configuration:
2727

28+
<WranglerConfig>
2829
```toml
2930
browser = { binding = "BROWSER" }
3031
```
32+
</WranglerConfig>
3133

3234
4. Replace the contents of `src/index.ts` (or `src/index.js` for JavaScript projects) with the following skeleton script:
3335

src/content/docs/browser-rendering/platform/wrangler.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ To install Wrangler, refer to [Install and Update Wrangler](/workers/wrangler/in
1919

2020
[Bindings](/workers/runtime-apis/bindings/) allow your Workers to interact with resources on the Cloudflare developer platform. A browser binding will provide your Worker with an authenticated endpoint to interact with a dedicated Chromium browser instance.
2121

22-
To deploy a Browser Rendering Worker, you must declare a [browser binding](/workers/runtime-apis/bindings/) in your Worker's `wrangler.toml` configuration file.
22+
To deploy a Browser Rendering Worker, you must declare a [browser binding](/workers/runtime-apis/bindings/) in your Worker's Wrangler configuration file.
2323

2424
<Render file="nodejs-compat-howto" product="workers" />
2525

0 commit comments

Comments
 (0)