2021-07-26 14:04:35 +00:00
|
|
|
import type { Argv } from 'mri'
|
|
|
|
|
2021-04-09 15:52:45 +00:00
|
|
|
export const commands = {
|
|
|
|
dev: () => import('./dev'),
|
|
|
|
build: () => import('./build'),
|
2021-07-26 14:46:19 +00:00
|
|
|
prepare: () => import('./prepare'),
|
2021-09-07 13:17:17 +00:00
|
|
|
usage: () => import('./usage'),
|
|
|
|
info: () => import('./info')
|
2021-04-09 15:52:45 +00:00
|
|
|
}
|
2021-07-26 14:04:35 +00:00
|
|
|
|
|
|
|
export type Command = keyof typeof commands
|
|
|
|
|
|
|
|
export interface NuxtCommandMeta {
|
|
|
|
name: string;
|
|
|
|
usage: string;
|
|
|
|
description: string;
|
|
|
|
[key: string]: any;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface NuxtCommand {
|
|
|
|
invoke(args: Argv): Promise<void> | void
|
|
|
|
meta: NuxtCommandMeta
|
|
|
|
}
|
|
|
|
|
|
|
|
export function defineNuxtCommand (command: NuxtCommand): NuxtCommand {
|
|
|
|
return command
|
|
|
|
}
|