Skip to content

Commit 2247ed4

Browse files
committed
add missing passthrough args
1 parent 64baa1a commit 2247ed4

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

packages/cloudflare/src/cli/deploy/deploy.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ import { OpenNextConfig } from "@opennextjs/aws/types/open-next.js";
44
import { populateCache } from "../populate-cache/populate-cache.js";
55
import { runWrangler } from "../utils/run-wrangler.js";
66

7-
export async function deploy(options: BuildOptions, config: OpenNextConfig) {
7+
export async function deploy(
8+
options: BuildOptions,
9+
config: OpenNextConfig,
10+
deployOptions: { passthroughArgs: string[] }
11+
) {
812
await populateCache(options, config, { target: "remote" });
9-
runWrangler(options, ["dev"], { logging: "all" });
13+
runWrangler(options, ["deploy", ...deployOptions.passthroughArgs], { logging: "all" });
1014
}

packages/cloudflare/src/cli/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ async function runCommand(args: Arguments) {
3838
case "build":
3939
return build(options, config, { ...args, sourceDir: baseDir });
4040
case "preview":
41-
return preview(options, config);
41+
return preview(options, config, args);
4242
case "deploy":
43-
return deploy(options, config);
43+
return deploy(options, config, args);
4444
case "populateCache":
45-
return populateCache(options, config, { target: args.target });
45+
return populateCache(options, config, args);
4646
}
4747
}
4848

packages/cloudflare/src/cli/preview/preview.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ import { OpenNextConfig } from "@opennextjs/aws/types/open-next.js";
44
import { populateCache } from "../populate-cache/populate-cache.js";
55
import { runWrangler } from "../utils/run-wrangler.js";
66

7-
export async function preview(options: BuildOptions, config: OpenNextConfig) {
7+
export async function preview(
8+
options: BuildOptions,
9+
config: OpenNextConfig,
10+
previewOptions: { passthroughArgs: string[] }
11+
) {
812
await populateCache(options, config, { target: "local" });
9-
runWrangler(options, ["dev"], { logging: "all" });
13+
runWrangler(options, ["dev", ...previewOptions.passthroughArgs], { logging: "all" });
1014
}

packages/cloudflare/src/cli/utils/run-wrangler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function runWrangler(
2626
);
2727

2828
if (result.status !== 0) {
29-
logger.error("Failed to populate cache");
29+
logger.error("Wrangler command failed");
3030
process.exit(1);
3131
}
3232
}

0 commit comments

Comments
 (0)