feat(cli): add alchemy and improve cli tooling and structure (#520)

This commit is contained in:
Aman Varshney
2025-08-20 23:43:58 +05:30
committed by GitHub
parent c5430ae4fd
commit 5788876c47
152 changed files with 5804 additions and 2264 deletions

View File

@@ -18,12 +18,18 @@ function getDeploymentDisplay(deployment: WebDeploy): {
label: string;
hint: string;
} {
if (deployment === "workers") {
if (deployment === "wrangler") {
return {
label: "Cloudflare Workers",
label: "Wrangler",
hint: "Deploy to Cloudflare Workers using Wrangler",
};
}
if (deployment === "alchemy") {
return {
label: "Alchemy",
hint: "Deploy to Cloudflare Workers using Alchemy",
};
}
return {
label: deployment,
hint: `Add ${deployment} deployment`,
@@ -41,14 +47,16 @@ export async function getDeploymentChoice(
return "none";
}
const options: DeploymentOption[] = [
{
value: "workers",
label: "Cloudflare Workers",
hint: "Deploy to Cloudflare Workers using Wrangler",
const options: DeploymentOption[] = ["wrangler", "alchemy", "none"].map(
(deploy) => {
const { label, hint } = getDeploymentDisplay(deploy as WebDeploy);
return {
value: deploy as WebDeploy,
label,
hint,
};
},
{ value: "none", label: "None", hint: "Manual setup" },
];
);
const response = await select<WebDeploy>({
message: "Select web deployment",
@@ -71,10 +79,19 @@ export async function getDeploymentToAdd(
const options: DeploymentOption[] = [];
if (existingDeployment !== "workers") {
const { label, hint } = getDeploymentDisplay("workers");
if (existingDeployment !== "wrangler") {
const { label, hint } = getDeploymentDisplay("wrangler");
options.push({
value: "workers",
value: "wrangler",
label,
hint,
});
}
if (existingDeployment !== "alchemy") {
const { label, hint } = getDeploymentDisplay("alchemy");
options.push({
value: "alchemy",
label,
hint,
});