-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.ts
55 lines (48 loc) · 1.18 KB
/
index.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
47
48
49
50
51
52
53
54
55
type TaskSpecWithOptions = Record<string, Record<string, unknown>>
type TaskSpec = string | TaskSpecWithOptions
type InstallsSpec = {
entryPoint: string
managesFiles?: string[]
}
export const CURRENT_RC_FILE_VERSION = 2
export type RCFile = {
version?: typeof CURRENT_RC_FILE_VERSION
plugins: string[]
installs: { [id: string]: InstallsSpec }
tasks: { [id: string]: string }
commands: { [id: string]: TaskSpec | TaskSpec[] }
hooks?: { [id: string]: TaskSpec | TaskSpec[] }
options: {
plugins: { [id: string]: Record<string, unknown> }
tasks: { [id: string]: Record<string, unknown> }
hooks: { [id: string]: Record<string, unknown> }[]
}
optionsSchema?: string
init: string[]
}
export interface Plugin {
id: string
root: string
rcFile?: RCFile
parent?: Plugin
children?: Plugin[]
}
export interface CommandTask {
id: string
plugin: Plugin
tasks: OptionsForTask[]
}
export interface OptionsForPlugin {
options: Record<string, unknown>
plugin: Plugin
forPlugin: Plugin
}
export interface OptionsForTask {
options: Record<string, unknown>
plugin: Plugin
task: string
}
export interface EntryPoint {
plugin: Plugin
modulePath: string
}