From 0b64f3a3f23b4ab919cbb79748f557c63ff43cf8 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Tue, 21 Jan 2025 08:41:15 +0100 Subject: [PATCH 1/2] refactor: add wrangler schema, fix CLERK error --- examples/api/wrangler.json | 1 + examples/create-next-app/wrangler.json | 1 + examples/middleware/wrangler.json | 5 +++++ examples/vercel-blog-starter/wrangler.json | 1 + examples/vercel-commerce/wrangler.json | 1 + packages/cloudflare/templates/defaults/wrangler.json | 1 + 6 files changed, 10 insertions(+) diff --git a/examples/api/wrangler.json b/examples/api/wrangler.json index ed0a8de0..29a8ced6 100644 --- a/examples/api/wrangler.json +++ b/examples/api/wrangler.json @@ -1,4 +1,5 @@ { + "$schema": "node_modules/wrangler/config-schema.json", "main": ".open-next/worker.js", "name": "api", "compatibility_date": "2024-12-30", diff --git a/examples/create-next-app/wrangler.json b/examples/create-next-app/wrangler.json index 8ca92cb6..cf2723f8 100644 --- a/examples/create-next-app/wrangler.json +++ b/examples/create-next-app/wrangler.json @@ -1,4 +1,5 @@ { + "$schema": "node_modules/wrangler/config-schema.json", "main": ".open-next/worker.js", "name": "create-next-app", "compatibility_date": "2024-12-30", diff --git a/examples/middleware/wrangler.json b/examples/middleware/wrangler.json index a0fb8497..52db6dc7 100644 --- a/examples/middleware/wrangler.json +++ b/examples/middleware/wrangler.json @@ -1,4 +1,5 @@ { + "$schema": "node_modules/wrangler/config-schema.json", "main": ".open-next/worker.js", "name": "middleware", "compatibility_date": "2024-12-30", @@ -6,5 +7,9 @@ "assets": { "directory": ".open-next/assets", "binding": "ASSETS" + }, + "vars": { + // Note: Do not define keys in wrangler config. + "CLERK_ENCRYPTION_KEY": "key" } } diff --git a/examples/vercel-blog-starter/wrangler.json b/examples/vercel-blog-starter/wrangler.json index 24fcaedb..74d21555 100644 --- a/examples/vercel-blog-starter/wrangler.json +++ b/examples/vercel-blog-starter/wrangler.json @@ -1,4 +1,5 @@ { + "$schema": "node_modules/wrangler/config-schema.json", "main": ".open-next/worker.js", "name": "vercel-blog-starter-on-workers", "compatibility_date": "2024-12-30", diff --git a/examples/vercel-commerce/wrangler.json b/examples/vercel-commerce/wrangler.json index 7539894c..cc1ed96c 100644 --- a/examples/vercel-commerce/wrangler.json +++ b/examples/vercel-commerce/wrangler.json @@ -1,4 +1,5 @@ { + "$schema": "node_modules/wrangler/config-schema.json", "main": ".open-next/worker.js", "name": "vercel-commerce-on-workers", "compatibility_date": "2024-12-30", diff --git a/packages/cloudflare/templates/defaults/wrangler.json b/packages/cloudflare/templates/defaults/wrangler.json index 40ab59b9..c7036e0e 100644 --- a/packages/cloudflare/templates/defaults/wrangler.json +++ b/packages/cloudflare/templates/defaults/wrangler.json @@ -1,4 +1,5 @@ { + "$schema": "node_modules/wrangler/config-schema.json", "main": ".open-next/worker.js", "name": "app-name", "compatibility_date": "2024-12-30", From d6766c55807058f8e64f33384a360f0685a0e334 Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Tue, 21 Jan 2025 09:17:40 +0100 Subject: [PATCH 2/2] fixup! move CLERK_ENCRYPTION_KEY to .env --- examples/middleware/.env | 1 + examples/middleware/wrangler.json | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) create mode 100644 examples/middleware/.env diff --git a/examples/middleware/.env b/examples/middleware/.env new file mode 100644 index 00000000..f55ebca8 --- /dev/null +++ b/examples/middleware/.env @@ -0,0 +1 @@ +CLERK_ENCRYPTION_KEY = "key" \ No newline at end of file diff --git a/examples/middleware/wrangler.json b/examples/middleware/wrangler.json index 52db6dc7..b9cced50 100644 --- a/examples/middleware/wrangler.json +++ b/examples/middleware/wrangler.json @@ -7,9 +7,5 @@ "assets": { "directory": ".open-next/assets", "binding": "ASSETS" - }, - "vars": { - // Note: Do not define keys in wrangler config. - "CLERK_ENCRYPTION_KEY": "key" } }