"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const renderHelp = require("render-help");
const run_1 = require("./run");
const start_1 = require("./start");
const stop_1 = require("./stop");
function rcOptionsTypes() {
    return {};
}
exports.rcOptionsTypes = rcOptionsTypes;
function cliOptionsTypes() {
    return run_1.IF_PRESENT_OPTION;
}
exports.cliOptionsTypes = cliOptionsTypes;
exports.commandNames = ['restart'];
function help() {
    return renderHelp({
        description: `Restarts a package. Runs a package's "stop", "restart", and "start" scripts, and associated pre- and post- scripts.`,
        descriptionLists: [
            {
                title: 'Options',
                list: [
                    run_1.IF_PRESENT_OPTION_HELP,
                ],
            },
        ],
        usages: ['pnpm restart [-- <args>...]'],
    });
}
exports.help = help;
async function handler(args, opts) {
    await stop_1.handler(args, opts);
    await run_1.handler(['restart', ...args], opts);
    await start_1.handler(args, opts);
}
exports.handler = handler;
