import { captureEvent } from "../../common/analytics/lib.js";
import { identify } from "../../common/middleware/user-identification.js";
import setBlocking, { printWarningToConsole } from "../../common/output.js";
import { ZuploProjectValidator } from "../../common/validators/file-system-validator.js";
import { YargsChecker } from "../../common/validators/lib.js";
import { update } from "../../project/update/handler.js";
export default {
    desc: "Updates your project structure to the latest conventions",
    command: "update",
    builder: (yargs) => {
        return yargs
            .option("dir", {
            type: "string",
            describe: "The directory containing your Zuplo API",
            default: ".",
            normalize: true,
            hidden: true,
        })
            .middleware([setBlocking, identify])
            .check(async (argv) => {
            return await new YargsChecker(new ZuploProjectValidator()).check(argv);
        });
    },
    handler: async (argv) => {
        printWarningToConsole("⚠️  'zuplo project update' is deprecated. Use 'zuplo source upgrade' instead.");
        await captureEvent({ argv, event: "zuplo project update (deprecated)" });
        await update(argv);
    },
};
//# sourceMappingURL=update.js.map