import { captureEvent } from "../common/analytics/lib.js";
import { identify } from "../common/middleware/user-identification.js";
import setBlocking from "../common/output.js";
import { ZuploProjectValidator } from "../common/validators/file-system-validator.js";
import { YargsChecker } from "../common/validators/lib.js";
import { editor } from "../editor/handler.js";
export default {
    desc: "Starts a local Open API Designer",
    command: "editor",
    builder: (yargs) => {
        return yargs
            .option("dir", {
            type: "string",
            describe: "The directory containing your Zuplo API",
            default: ".",
            normalize: false,
            hidden: true,
        })
            .option("port", {
            type: "number",
            describe: "The port to run the route designer on",
            default: "9100",
        })
            .middleware([setBlocking, identify])
            .check(async (argv) => {
            return await new YargsChecker(new ZuploProjectValidator()).check(argv);
        });
    },
    handler: async (argv) => {
        await captureEvent({ argv, event: "zuplo editor" });
        await editor(argv);
    },
};
//# sourceMappingURL=editor.js.map