-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask-group.ts
More file actions
151 lines (146 loc) · 3.37 KB
/
task-group.ts
File metadata and controls
151 lines (146 loc) · 3.37 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
import { TaskHandler, TaskMetadata } from './task-handler';
/**
* The default task group that contains tasks that have not been assigned to a group.
*/
export const UNCATEGORIZED_TASK_GROUP: TaskGroup = {
name: 'uncategorized',
displayName: 'Uncategorized',
description: 'Tasks that have not been assigned to a group.',
};
/**
* The system task group that contains built-in tasks.
*/
export const SYSTEM_TASK_GROUP: TaskGroup = {
name: 'system',
displayName: 'System',
description: 'Built-in tasks that are provided by the system.',
keywords: ['built-in'],
};
/**
* A group of tasks that are related to each other.
*/
export interface TaskGroup {
/**
* The name of the task group.
* This name should be unique across all task groups.
* You can define group's name in the name field of package.json.
*
* @example
* ```json
* {
* "name": "my-task-group"
* ...
* }
* ```
*/
name: string;
/**
* The display name of the task group.
* If not provided, the name will be used as the display name.
* This name is used for displaying the task group in the UI such as the Studio.
* You can define group's display name in the letrun.displayName field of package.json.
*
* @example
* ```json
* {
* "letrun": {
* "displayName": "My Task Group"
* }
* ...
* }
* ```
*/
displayName?: string;
/**
* A brief description of the task group.
* This description will be shown in the help output.
* You can define group's description in the description field of package.json.
*
* @example
* ```json
* {
* "description": "This is an awesome task group"
* ...
* }
* ```
*/
description?: string;
/**
* The version of the task group.
* You can define group's version in the version field of package.json.
*
* @example
* ```json
* {
* "version": "1.0.0"
* ...
* }
* ```
*/
version?: string;
/**
* The author of the task group.
* You can define group's author in the author field of package.json.
*
* @example
* ```json
* {
* "author": "John Doe"
* ...
* }
* ```
*/
author?: string;
/**
* The icon url of the task group.
* You can define group's icon in the letrun.icon field of package.json.
*
* @example
* ```json
* {
* "letrun": {
* "icon": "https://example.com/icon.png"
* }
* ...
* }
* ```
*/
icon?: string;
/**
* Optional keywords to match against when filtering.
* You can define group's keywords in the keywords field of package.json.
*
* @example
* ```json
* {
* "keywords": ["awesome", "cool"]
* ...
* }
* ```
*/
keywords?: string[];
/**
* The tasks that belong to this group. This map contains the name of the task as the key and the task handler as the value.
*/
tasks?: Record<string, TaskHandler>;
/**
* The type of the task group.
* - `package`: A task group that is defined in a node package.
* - `script`: A task group that is defined in a standalone script file.
*/
type?: 'package' | 'script';
}
/**
* Metadata for describing a task group.
*/
export interface TaskGroupMetadata {
name: string;
displayName?: string;
description?: string;
version?: string;
author?: string;
icon?: string;
keywords?: string[];
type?: 'package' | 'script';
tasks: TaskMetadata[];
}