this repo has no description
0
fork

Configure Feed

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

refactor: do not create a wrangler config when a custom one is passed (#948)

authored by

Victor Berchet and committed by
GitHub
0c655c3c 98f0dd3b

+16 -11
+5
.changeset/thick-seas-walk.md
··· 1 + --- 2 + "@opennextjs/cloudflare": patch 3 + --- 4 + 5 + refactor: do not create a wrangler config when a custom one is passed
-5
packages/cloudflare/src/cli/build/build.ts
··· 17 17 import { compileSkewProtection } from "./open-next/compile-skew-protection.js"; 18 18 import { compileDurableObjects } from "./open-next/compileDurableObjects.js"; 19 19 import { createServerBundle } from "./open-next/createServerBundle.js"; 20 - import { createWranglerConfigIfNotExistent } from "./utils/index.js"; 21 20 import { getVersion } from "./utils/version.js"; 22 21 23 22 /** ··· 86 85 await compileDurableObjects(options); 87 86 88 87 await bundleServer(options, projectOpts); 89 - 90 - if (!projectOpts.skipWranglerConfigCheck) { 91 - await createWranglerConfigIfNotExistent(projectOpts); 92 - } 93 88 94 89 logger.info("OpenNext build complete."); 95 90 }
+11 -6
packages/cloudflare/src/cli/commands/build.ts
··· 1 1 import type yargs from "yargs"; 2 2 3 3 import { build as buildImpl } from "../build/build.js"; 4 + import { createWranglerConfigIfNotExistent } from "../build/utils/index.js"; 4 5 import type { WithWranglerArgs } from "./utils.js"; 5 6 import { 6 7 compileConfig, ··· 30 31 const { config, buildDir } = await compileConfig(args.openNextConfigPath); 31 32 const options = getNormalizedOptions(config, buildDir); 32 33 34 + const projectOpts = { ...args, minify: !args.noMinify, sourceDir: nextAppDir }; 35 + 36 + // Ask whether a `wrangler.jsonc` should be created when no config file exists. 37 + // Note: We don't ask when a custom config file is specified via `--config` 38 + // nor when `--skipWranglerConfigCheck` is used. 39 + if (!projectOpts.wranglerConfigPath && !args.skipWranglerConfigCheck) { 40 + await createWranglerConfigIfNotExistent(projectOpts); 41 + } 42 + 33 43 const wranglerConfig = readWranglerConfig(args); 34 44 35 - await buildImpl( 36 - options, 37 - config, 38 - { ...args, minify: !args.noMinify, sourceDir: nextAppDir }, 39 - wranglerConfig 40 - ); 45 + await buildImpl(options, config, projectOpts, wranglerConfig); 41 46 } 42 47 43 48 /**