"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.handler = exports.help = exports.commandNames = exports.cliOptionsTypes = exports.rcOptionsTypes = void 0;
const config_1 = require("@pnpm/config");
const R = require("ramda");
const renderHelp = require("render-help");
const run_1 = require("./run");
const start_1 = require("./start");
const stop_1 = require("./stop");
function rcOptionsTypes() {
    return {
        ...R.pick([
            'npm-path',
        ], config_1.types),
    };
}
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(opts, params) {
    await stop_1.handler(opts, params);
    await run_1.handler(opts, ['restart', ...params]);
    await start_1.handler(opts, params);
}
exports.handler = handler;
//# sourceMappingURL=restart.js.map