Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/content/docs/style-guide/components/github-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,24 @@ const baz = foo();
**required**
**type:** `string`

The owner and repository to pull from, for example `cloudflare/workers-rs`.
The owner and repository to pull from, in the form of `cloudflare/<REPO-NAME>`

For example:

- `cloudflare/workers-rs`.
- `cloudflare/templates`.

### `file`

**required**
**type:** `string`

The file path to pull from, for example `templates/hello-world/src/lib.rs`.
The file path to pull from, in the form of `path/to/filename-including-extensions`. This path excludes the repo name.

For example:

- `templates/hello-world/src/lib.rs`.
- `d1-starter-sessions-api/src/index.ts`.

### `commit`

Expand Down
29 changes: 29 additions & 0 deletions src/content/docs/style-guide/components/wrangler-config.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
title: WranglerConfig
styleGuide:
component: WranglerConfig
---

This component can be used to automatically generate a `jsonc` version of the `toml` for a Cloudflare [Wrangler configuration file](/workers/wrangler/configuration/).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will actually do the other way too - give TOML, get JSONC & get JSONC, get TOML.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did NOT realise that, I'll edit.


## Import

```mdx
import { WranglerConfig } from "~/components";
```

## Usage

````mdx live
import { WranglerConfig } from "~/components";

<WranglerConfig>
```toml
[[d1_databases]]
binding = "DB" # available in your Worker on env.DB
database_name = "prod-d1-tutorial"
database_id = "<unique-ID-for-your-database>"
```
</WranglerConfig>

````