import { groupHandler } from "../../common/handler.js";
import setBlocking from "../../common/output.js";
import { identify } from "../../common/middleware/user-identification.js";
import { captureEvent } from "../../common/analytics/lib.js";
import { migrateDevPortal } from "./migrate/handler.js";
const commands = {
    describe: "Migration commands",
    command: "migrate",
    builder: (yargs) => yargs
        .command({
        describe: "Migrates legacy dev portal configuration to the new dev portal format",
        command: "dev-portal",
        builder: (yargs) => yargs
            .option("dir", {
            type: "string",
            describe: "The directory containing your Zuplo project and dev portal config",
            default: ".",
            normalize: true,
        })
            .option("force", {
            type: "boolean",
            describe: "Force overwrite of existing files",
            default: false,
        })
            .middleware([setBlocking, identify]),
        handler: async (argv) => {
            await captureEvent({
                argv,
                event: "zuplo source migrate dev-portal",
            });
            await migrateDevPortal(argv);
        },
    })
        .help(),
    handler: groupHandler,
};
export default commands;
//# sourceMappingURL=migrate.js.map