this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor: migrate to wrangler.json (#256)

authored by

Victor Berchet and committed by
GitHub
db578b71 b3976359

+57 -56
+13
examples/api/wrangler.json
··· 1 + { 2 + "main": ".open-next/worker.js", 3 + "name": "api", 4 + "compatibility_date": "2024-12-30", 5 + "compatibility_flags": ["nodejs_compat"], 6 + "assets": { 7 + "directory": ".open-next/assets", 8 + "binding": "ASSETS" 9 + }, 10 + "vars": { 11 + "hello": "Hello World from the cloudflare context!" 12 + } 13 + }
-10
examples/api/wrangler.toml
··· 1 - #:schema node_modules/wrangler/config-schema.json 2 - name = "api" 3 - main = ".open-next/worker.js" 4 - compatibility_date = "2024-09-23" 5 - compatibility_flags = ["nodejs_compat"] 6 - 7 - assets = { directory = ".open-next/assets", binding = "ASSETS" } 8 - 9 - [vars] 10 - hello = 'Hello World from the cloudflare context!'
+10
examples/create-next-app/wrangler.json
··· 1 + { 2 + "main": ".open-next/worker.js", 3 + "name": "create-next-app", 4 + "compatibility_date": "2024-12-30", 5 + "compatibility_flags": ["nodejs_compat"], 6 + "assets": { 7 + "directory": ".open-next/assets", 8 + "binding": "ASSETS" 9 + } 10 + }
-9
examples/create-next-app/wrangler.toml
··· 1 - #:schema node_modules/wrangler/config-schema.json 2 - name = "create-next-app" 3 - main = ".open-next/worker.js" 4 - 5 - compatibility_date = "2024-09-23" 6 - compatibility_flags = ["nodejs_compat"] 7 - 8 - # Use the new Workers + Assets to host the static frontend files 9 - assets = { directory = ".open-next/assets", binding = "ASSETS" }
+10
examples/middleware/wrangler.json
··· 1 + { 2 + "main": ".open-next/worker.js", 3 + "name": "middleware", 4 + "compatibility_date": "2024-12-30", 5 + "compatibility_flags": ["nodejs_compat"], 6 + "assets": { 7 + "directory": ".open-next/assets", 8 + "binding": "ASSETS" 9 + } 10 + }
-8
examples/middleware/wrangler.toml
··· 1 - #:schema node_modules/wrangler/config-schema.json 2 - name = "middleware" 3 - main = ".open-next/worker.js" 4 - compatibility_date = "2024-09-23" 5 - compatibility_flags = ["nodejs_compat"] 6 - 7 - # Use the new Workers + Assets to host the static frontend files 8 - assets = { directory = ".open-next/assets", binding = "ASSETS" }
+10
examples/vercel-blog-starter/wrangler.json
··· 1 + { 2 + "main": ".open-next/worker.js", 3 + "name": "vercel-blog-starter-on-workers", 4 + "compatibility_date": "2024-12-30", 5 + "compatibility_flags": ["nodejs_compat"], 6 + "assets": { 7 + "directory": ".open-next/assets", 8 + "binding": "ASSETS" 9 + } 10 + }
-9
examples/vercel-blog-starter/wrangler.toml
··· 1 - #:schema node_modules/wrangler/config-schema.json 2 - name = "vercel-blog-starter-on-workers" 3 - main = ".open-next/worker.js" 4 - 5 - compatibility_date = "2024-09-23" 6 - compatibility_flags = ["nodejs_compat"] 7 - 8 - # Use the new Workers + Assets to host the static frontend files 9 - assets = { directory = ".open-next/assets", binding = "ASSETS" }
+10
examples/vercel-commerce/wrangler.json
··· 1 + { 2 + "main": ".open-next/worker.js", 3 + "name": "vercel-commerce-on-workers", 4 + "compatibility_date": "2024-12-30", 5 + "compatibility_flags": ["nodejs_compat"], 6 + "assets": { 7 + "directory": ".open-next/assets", 8 + "binding": "ASSETS" 9 + } 10 + }
-9
examples/vercel-commerce/wrangler.toml
··· 1 - #:schema node_modules/wrangler/config-schema.json 2 - name = "vercel-commerce-on-workers" 3 - main = ".open-next/worker.js" 4 - 5 - compatibility_date = "2024-09-23" 6 - compatibility_flags = ["nodejs_compat"] 7 - 8 - # Use the new Workers + Assets to host the static frontend files 9 - assets = { directory = ".open-next/assets", binding = "ASSETS" }
+4 -11
packages/cloudflare/src/cli/build/index.ts
··· 220 220 return; 221 221 } 222 222 223 - const wranglerConfigTemplate = readFileSync( 224 - join(getPackageTemplatesDirPath(), "defaults", "wrangler.jsonc"), 225 - "utf8" 226 - ); 227 - let wranglerConfigContent = wranglerConfigTemplate; 223 + let wranglerConfig = readFileSync(join(getPackageTemplatesDirPath(), "defaults", "wrangler.json"), "utf8"); 228 224 229 225 const appName = getAppNameFromPackageJson(projectOpts.sourceDir) ?? "app-name"; 230 226 if (appName) { 231 - wranglerConfigContent = wranglerConfigContent.replace( 232 - '"app-name"', 233 - JSON.stringify(appName.replaceAll("_", "-")) 234 - ); 227 + wranglerConfig = wranglerConfig.replace('"app-name"', JSON.stringify(appName.replaceAll("_", "-"))); 235 228 } 236 229 237 230 const compatDate = await getLatestCompatDate(); 238 231 if (compatDate) { 239 - wranglerConfigContent = wranglerConfigContent.replace( 232 + wranglerConfig = wranglerConfig.replace( 240 233 /"compatibility_date": "\d{4}-\d{2}-\d{2}"/, 241 234 `"compatibility_date": ${JSON.stringify(compatDate)}` 242 235 ); 243 236 } 244 237 245 - writeFileSync(join(projectOpts.sourceDir, "wrangler.json"), wranglerConfigContent); 238 + writeFileSync(join(projectOpts.sourceDir, "wrangler.json"), wranglerConfig); 246 239 } 247 240 248 241 function getAppNameFromPackageJson(sourceDir: string): string | undefined {
packages/cloudflare/templates/defaults/wrangler.jsonc packages/cloudflare/templates/defaults/wrangler.json