Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: convert versions list to defineCommand #7293

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 19 additions & 17 deletions packages/wrangler/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ import { initHandler, initOptions } from "./init";
import "./docs";
import "./dev";
import "./kv";
import "./versions";
import "./versions/deploy";
import "./versions/list";
import "./versions/upload";
import "./versions/view";
import "./versions/deployments";
import "./versions/deployments/list";
import "./versions/deployments/status";
import "./versions/deployments/view";
import "./versions/rollback";
import "./versions/secrets";
import "./versions/secrets/bulk";
import "./versions/secrets/delete";
import "./versions/secrets/list";
import "./versions/secrets/put";
import "./workflows";
import "./user/commands";
import { demandSingleValue } from "./core";
Expand Down Expand Up @@ -74,9 +89,6 @@ import { getAuthFromEnv } from "./user";
import { whoami } from "./user/whoami";
import { debugLogFilepath } from "./utils/log-file";
import { vectorize } from "./vectorize/index";
import registerVersionsSubcommands from "./versions";
import registerVersionsDeploymentsSubcommands from "./versions/deployments";
import registerVersionsRollbackCommand from "./versions/rollback";
import { asJson } from "./yargs-types";
import type { Config } from "./config";
import type { LoggerLevel } from "./logger";
Expand Down Expand Up @@ -344,11 +356,7 @@ export function createCLIParser(argv: string[]) {
"🚢 List and view the current and past deployments for your Worker";

if (experimentalGradualRollouts) {
wrangler.command(
"deployments",
deploymentsDescription,
registerVersionsDeploymentsSubcommands
);
register.registerNamespace("deployments");
} else {
wrangler.command("deployments", deploymentsDescription, (yargs) =>
yargs
Expand Down Expand Up @@ -395,7 +403,7 @@ export function createCLIParser(argv: string[]) {
const rollbackDescription = "🔙 Rollback a deployment for a Worker";

if (experimentalGradualRollouts) {
registerVersionsRollbackCommand(wrangler, rollbackDescription);
register.registerNamespace("rollback");
} else {
wrangler.command(
"rollback [deployment-id]",
Expand Down Expand Up @@ -433,15 +441,9 @@ export function createCLIParser(argv: string[]) {
);
}

// versions
// versions/versions deployments/versions rollback/versions secrets
if (experimentalGradualRollouts) {
wrangler.command(
"versions",
"🫧 List, view, upload and deploy Versions of your Worker to Cloudflare",
(yargs) => {
return registerVersionsSubcommands(yargs.command(subHelp), subHelp);
}
);
register.registerNamespace("versions");
}

// triggers
Expand Down
Loading
Loading