forked from vuejs/vue-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreateTestProject.d.ts
46 lines (44 loc) · 1.08 KB
/
createTestProject.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import execa = require('execa') // [email protected] needs @types/execa
import { Preset } from '@vue/cli'
/**
* create project at path `cwd`
*/
declare function createTestProject(
/**
* project name
*/
name: string,
/**
* manual preset used to generate project.
*
* Example:
* {
* plugins: {
* '@vue/cli-plugin-babel': {}
* }
* }
*/
preset: Preset,
/** `path.resolve(cwd, name)` will be the project's root directory */
cwd?: string | null,
/**
* if init git repo
*
* Default:`true`
*/
initGit?: boolean,
): Promise<{
/** test project's root path */
dir: string
/** test if project contains the file */
has: (file: string) => boolean
/** read the content for the file */
read: (file: string) => Promise<string>
/** write file to project */
write: (file: string, content: any) => Promise<void>
/** execa command at root path of project */
run: (command: string, args?: ReadonlyArray<string>) => execa.ExecaChildProcess
/** delete the file of project */
rm: (file: string) => Promise<void>
}>
export = createTestProject