import { types as allTypes } from '@pnpm/config' import pick from 'ramda/src/pick' import renderHelp from 'render-help' import { handler as run, IF_PRESENT_OPTION, IF_PRESENT_OPTION_HELP, type RunOpts, } from './run' export function rcOptionsTypes (): Record { return { ...pick([ 'npm-path', ], allTypes), } } export function cliOptionsTypes (): Record { return IF_PRESENT_OPTION } export const commandNames = ['restart'] export function help (): string { 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: [ IF_PRESENT_OPTION_HELP, ], }, ], usages: ['pnpm restart [-- ...]'], }) } export async function handler ( opts: RunOpts, params: string[] ): Promise { await run(opts, ['stop', ...params]) await run(opts, ['restart', ...params]) await run(opts, ['start', ...params]) }