mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
fix(cli): only prompt server deploy for hono+workers and restrict to wrangler/alchemy
This commit is contained in:
@@ -49,19 +49,19 @@ export async function getServerDeploymentChoice(
|
||||
|
||||
const options: DeploymentOption[] = [];
|
||||
|
||||
if (runtime === "workers") {
|
||||
["alchemy", "wrangler"].forEach((deploy) => {
|
||||
const { label, hint } = getDeploymentDisplay(deploy as ServerDeploy);
|
||||
options.unshift({
|
||||
value: deploy as ServerDeploy,
|
||||
label,
|
||||
hint,
|
||||
});
|
||||
});
|
||||
} else {
|
||||
options.push({ value: "none", label: "None", hint: "Manual setup" });
|
||||
if (runtime !== "workers") {
|
||||
return "none";
|
||||
}
|
||||
|
||||
["alchemy", "wrangler"].forEach((deploy) => {
|
||||
const { label, hint } = getDeploymentDisplay(deploy as ServerDeploy);
|
||||
options.unshift({
|
||||
value: deploy as ServerDeploy,
|
||||
label,
|
||||
hint,
|
||||
});
|
||||
});
|
||||
|
||||
const response = await select<ServerDeploy>({
|
||||
message: "Select server deployment",
|
||||
options,
|
||||
@@ -114,11 +114,6 @@ export async function getServerDeploymentToAdd(
|
||||
}
|
||||
|
||||
if (options.length > 0) {
|
||||
options.push({
|
||||
value: "none",
|
||||
label: "None",
|
||||
hint: "Skip deployment setup",
|
||||
});
|
||||
}
|
||||
|
||||
if (options.length === 0) {
|
||||
|
||||
@@ -283,6 +283,12 @@ export function validateFullConfig(
|
||||
|
||||
validateWorkersCompatibility(providedFlags, options, config);
|
||||
|
||||
if (config.runtime === "workers" && config.serverDeploy === "none") {
|
||||
exitWithError(
|
||||
"Cloudflare Workers runtime requires a server deployment. Please choose 'wrangler' or 'alchemy' for --server-deploy.",
|
||||
);
|
||||
}
|
||||
|
||||
if (config.addons && config.addons.length > 0) {
|
||||
validateAddonsAgainstFrontends(config.addons, config.frontend);
|
||||
config.addons = [...new Set(config.addons)];
|
||||
|
||||
Reference in New Issue
Block a user