@@ -184,11 +184,16 @@ function ensureCloudflareConfig(config: OpenNextConfig) {
184
184
}
185
185
186
186
/**
187
- * Creates a `wrangler.jsonc ` file for the user if a wrangler config file doesn't already exist,
187
+ * Creates a `wrangler.json ` file for the user if a wrangler config file doesn't already exist,
188
188
* but only after asking for the user's confirmation.
189
189
*
190
190
* If the user refuses a warning is shown (which offers ways to opt out of this check to the user).
191
191
*
192
+ * Note: we generate a wrangler.json file with comments instead of using the jsonc extension,
193
+ * we decided to do that since json is more common than jsonc, wrangler also parses
194
+ * them in the same way and we also expect developers to associate `wrangler.json`
195
+ * files to the jsonc language
196
+ *
192
197
* @param projectOpts The options for the project
193
198
*/
194
199
async function createWranglerConfigIfNotExistent ( projectOpts : ProjectOptions ) : Promise < void > {
@@ -201,8 +206,6 @@ async function createWranglerConfigIfNotExistent(projectOpts: ProjectOptions): P
201
206
return ;
202
207
}
203
208
204
- const wranglerConfigPath = join ( projectOpts . sourceDir , "wrangler.jsonc" ) ;
205
-
206
209
const answer = await askConfirmation (
207
210
"No `wrangler.(toml|json|jsonc)` config file found, do you want to create one?"
208
211
) ;
@@ -238,7 +241,7 @@ async function createWranglerConfigIfNotExistent(projectOpts: ProjectOptions): P
238
241
) ;
239
242
}
240
243
241
- writeFileSync ( wranglerConfigPath , wranglerConfigContent ) ;
244
+ writeFileSync ( join ( projectOpts . sourceDir , "wrangler.json" ) , wranglerConfigContent ) ;
242
245
}
243
246
244
247
function getAppNameFromPackageJson ( sourceDir : string ) : string | undefined {
0 commit comments