From 273a9943a1e9782503d22d6f45dd56460bdd9127 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 9 Apr 2025 21:25:48 +0100 Subject: [PATCH 1/3] docs(cloudflare): upload command --- pages/cloudflare/get-started.mdx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pages/cloudflare/get-started.mdx b/pages/cloudflare/get-started.mdx index 6b1c936..4c38006 100644 --- a/pages/cloudflare/get-started.mdx +++ b/pages/cloudflare/get-started.mdx @@ -122,11 +122,13 @@ Add the following to the scripts field of your `package.json` file: ```json "preview": "opennextjs-cloudflare build && opennextjs-cloudflare preview", "deploy": "opennextjs-cloudflare build && opennextjs-cloudflare deploy", +"upload": "opennextjs-cloudflare build && opennextjs-cloudflare upload", "cf-typegen": "wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts", ``` - `npm run preview`: Builds your app and serves it locally, allowing you to quickly preview your app running locally in the Workers runtime, via a single command. -- `npm run deploy`: Builds your app, and then deploys it to Cloudflare +- `npm run deploy`: Builds your app, and then deploys it to Cloudflare. +- `npm run upload`: Builds your app, and then uploads a new [version](https://developers.cloudflare.com/workers/configuration/versions-and-deployments/#versions) of it to Cloudflare. - `cf-typegen`: Generates a `cloudflare-env.d.ts` file at the root of your project containing [the types for the `env`](https://developers.cloudflare.com/workers/wrangler/commands/#types). ##### 7. Add caching with Cloudflare R2 From 054d2484af72837ef53948d6b6e7e86e81e15ebc Mon Sep 17 00:00:00 2001 From: James Date: Thu, 10 Apr 2025 12:16:04 +0100 Subject: [PATCH 2/3] caching docs --- pages/cloudflare/caching.mdx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pages/cloudflare/caching.mdx b/pages/cloudflare/caching.mdx index 3d46299..6032af7 100644 --- a/pages/cloudflare/caching.mdx +++ b/pages/cloudflare/caching.mdx @@ -502,12 +502,15 @@ export default defineCloudflareConfig({ In order for the cache to be properly initialised with the build-time revalidation data, you need to run a command as part of your deploy step. This should be run as part of each deployment to ensure that the cache is being populated with each build's data. -To populate remote bindings and deploy your application at the same time, you can use the `deploy` command. Similarly, the `preview` command will populate your local bindings and start a Wrangler dev server. +To populate remote bindings and create a new [version](https://developers.cloudflare.com/workers/configuration/versions-and-deployments/#versions) of your application at the same time, you can use either the `deploy` command or the `upload` command. Similarly, the `preview` command will populate your local bindings and start a Wrangler dev server. ```sh -# Populate remote and deploy. +# Populate remote and deploy the worker immediately. opennextjs-cloudflare deploy +# Populate remote and upload a new version of the worker. +opennextjs-cloudflare upload + # Populate local and start dev server. opennextjs-cloudflare preview ``` From 35c79aca102f0dc7f806a715e4c4db8ac3037efa Mon Sep 17 00:00:00 2001 From: James Date: Thu, 10 Apr 2025 12:17:04 +0100 Subject: [PATCH 3/3] tweak wording --- pages/cloudflare/get-started.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/cloudflare/get-started.mdx b/pages/cloudflare/get-started.mdx index 4c38006..7f3c0e5 100644 --- a/pages/cloudflare/get-started.mdx +++ b/pages/cloudflare/get-started.mdx @@ -127,7 +127,7 @@ Add the following to the scripts field of your `package.json` file: ``` - `npm run preview`: Builds your app and serves it locally, allowing you to quickly preview your app running locally in the Workers runtime, via a single command. -- `npm run deploy`: Builds your app, and then deploys it to Cloudflare. +- `npm run deploy`: Builds your app, and then immediately deploys it to Cloudflare. - `npm run upload`: Builds your app, and then uploads a new [version](https://developers.cloudflare.com/workers/configuration/versions-and-deployments/#versions) of it to Cloudflare. - `cf-typegen`: Generates a `cloudflare-env.d.ts` file at the root of your project containing [the types for the `env`](https://developers.cloudflare.com/workers/wrangler/commands/#types).