Skip to content

Commit a754f00

Browse files
committed
refactor(cli): move command type to types file
1 parent 0575ba9 commit a754f00

File tree

4 files changed

+21
-12
lines changed

4 files changed

+21
-12
lines changed

packages/@vuepress/cli/src/commands/build/createBuild.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,10 @@ import {
88
transformUserConfigToPlugin,
99
} from '../../config'
1010
import { resolveBuildAppConfig } from './resolveBuildAppConfig'
11-
import type { BuildCommandOptions } from './types'
11+
import type { BuildCommand } from './types'
1212

1313
const log = debug('vuepress:cli/build')
1414

15-
export type BuildCommand = (
16-
sourceDir?: string,
17-
commandOptions?: BuildCommandOptions
18-
) => Promise<void>
19-
2015
export const createBuild = (
2116
defaultAppConfig: Partial<AppConfig>
2217
): BuildCommand => async (

packages/@vuepress/cli/src/commands/build/types.ts

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/**
2+
* Type of `dev` command function
3+
*/
4+
export type BuildCommand = (
5+
sourceDir?: string,
6+
commandOptions?: BuildCommandOptions
7+
) => Promise<void>
8+
9+
/**
10+
* CLI options of `build` command
11+
*/
112
export interface BuildCommandOptions {
213
// app config
314
dest?: string

packages/@vuepress/cli/src/commands/dev/createDev.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,12 @@ import {
99
} from '../../config'
1010
import { resolveDevAppConfig } from './resolveDevAppConfig'
1111
import { resolveDevUserConfig } from './resolveDevUserConfig'
12-
import type { DevCommandOptions } from './types'
12+
import type { DevCommand } from './types'
1313
import { watchPageFiles } from './watchPageFiles'
1414
import { watchUserConfigFile } from './watchUserConfigFile'
1515

1616
const log = debug('vuepress:cli/dev')
1717

18-
export type DevCommand = (
19-
sourceDir?: string,
20-
commandOptions?: DevCommandOptions
21-
) => Promise<void>
22-
2318
export const createDev = (defaultAppConfig: Partial<AppConfig>): DevCommand => {
2419
const dev: DevCommand = async (
2520
sourceDir = '.',

packages/@vuepress/cli/src/commands/dev/types.ts

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
/**
2+
* Type of `dev` command function
3+
*/
4+
export type DevCommand = (
5+
sourceDir?: string,
6+
commandOptions?: DevCommandOptions
7+
) => Promise<void>
8+
19
/**
210
* CLI options of `dev` command
311
*/

0 commit comments

Comments
 (0)