Skip to content

Commit 1a630aa

Browse files
author
Juul
committed
chore: enhance changeset docs & jsdoc
1 parent b22548a commit 1a630aa

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.changeset/shaggy-bobcats-battle.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"@opennextjs/cloudflare": patch
33
---
44

5-
Adds support for passing options to initOpenNextCloudflareForDev().
5+
Adds support for passing options to `initOpenNextCloudflareForDev()`. This allows you to configure how your Cloudflare bindings will behave during [local development](https://opennext.js.org/cloudflare/get-started#11-develop-locally).
66

7-
For example:
7+
For example, the below configuration will persist the local state of bindings to a custom directory. Which can be useful if you want to share the state between different apps that reuse the same bindings in a monorepo.
88

99
```ts
1010
initOpenNextCloudflareForDev({
@@ -13,3 +13,5 @@ initOpenNextCloudflareForDev({
1313
},
1414
});
1515
```
16+
17+
You can find the type with the available options [here](https://github.com/cloudflare/workers-sdk/blob/main/packages/wrangler/src/api/integrations/platform/index.ts#L32) in the Wrangler source code. Please note that the `environment` field is not customizable as it's used internally by OpenNext.js. If you have a use case where overriding `environment` is necessary, please let us know by opening a [feature request](https://github.com/cloudflare/workers-sdk/issues).

packages/cloudflare/src/api/cloudflare-context.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ async function getCloudflareContextAsync<
193193
* with the open-next Cloudflare adapter
194194
*
195195
* Note: this function should only be called inside the Next.js config file, and although async it doesn't need to be `await`ed
196-
* @param options options how the function should operate and if/where to persist the platform data
196+
* @param options options on how the function should operate and if/where to persist the platform data
197197
*/
198198
export async function initOpenNextCloudflareForDev(options?: Omit<GetPlatformProxyOptions, "environment">) {
199199
const shouldInitializationRun = shouldContextInitializationRun();

0 commit comments

Comments
 (0)