Skip to content

Commit bff94d3

Browse files
OxyjunRebeccaTamachiro
authored andcommitted
[Style Guide] Adding WranglerConfig, adding info on GitHubCode. (#21602)
* Adding WranglerConfig, adding info on GitHubCode. * Update src/content/docs/style-guide/components/wrangler-config.mdx
1 parent b78365b commit bff94d3

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

src/content/docs/style-guide/components/github-code.mdx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,24 @@ const baz = foo();
8989
**required**
9090
**type:** `string`
9191

92-
The owner and repository to pull from, for example `cloudflare/workers-rs`.
92+
The owner and repository to pull from, in the form of `cloudflare/<REPO-NAME>`
93+
94+
For example:
95+
96+
- `cloudflare/workers-rs`.
97+
- `cloudflare/templates`.
9398

9499
### `file`
95100

96101
**required**
97102
**type:** `string`
98103

99-
The file path to pull from, for example `templates/hello-world/src/lib.rs`.
104+
The file path to pull from, in the form of `path/to/filename-including-extensions`. This path excludes the repo name.
105+
106+
For example:
107+
108+
- `templates/hello-world/src/lib.rs`.
109+
- `d1-starter-sessions-api/src/index.ts`.
100110

101111
### `commit`
102112

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: WranglerConfig
3+
styleGuide:
4+
component: WranglerConfig
5+
---
6+
7+
This component can be used to automatically generate a `jsonc` version of the `toml` (or vice versa) for a Cloudflare [Wrangler configuration file](/workers/wrangler/configuration/).
8+
9+
## Import
10+
11+
```mdx
12+
import { WranglerConfig } from "~/components";
13+
```
14+
15+
## Usage
16+
17+
````mdx live
18+
import { WranglerConfig } from "~/components";
19+
20+
<WranglerConfig>
21+
```toml
22+
[[d1_databases]]
23+
binding = "DB" # available in your Worker on env.DB
24+
database_name = "prod-d1-tutorial"
25+
database_id = "<unique-ID-for-your-database>"
26+
```
27+
</WranglerConfig>
28+
29+
````

0 commit comments

Comments
 (0)