forked from nrwl/nx-console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
96 lines (81 loc) · 1.96 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
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
import { Option as CliOption, OptionType } from '@angular/cli/models/interface';
export interface Option extends Omit<CliOption, 'default'> {
tooltip?: string;
itemTooltips?: ItemTooltips;
items?: string[] | ItemsWithEnum;
default?: string[] | string | number | boolean | undefined;
}
export interface ItemTooltips {
[itemValue: string]: string;
}
export interface ItemsWithEnum {
enum: string[];
type: OptionType;
}
export type XPrompt = string | LongFormXPrompt;
export interface LongFormXPrompt {
message: string;
type: 'confirmation' | 'input' | 'list';
multiselect?: boolean;
items?: (string | OptionItemLabelValue)[];
}
export interface OptionItemLabelValue {
label: string;
value: string;
}
export interface TaskExecutionMessage {
command: string;
positional: string;
flags: string[];
}
export interface TaskExecutionSchema {
name: string;
command: string;
positional: string;
cliName: 'nx' | 'ng';
builder?: string;
description: string;
configurations?: TargetConfiguration[];
options: Option[];
contextValues?: Record<string, string | number | boolean | undefined>;
}
export interface GeneratorCollection {
name: string;
generators: Generator[];
}
export enum GeneratorType {
Application = 'application',
Library = 'library',
Other = 'other',
}
export interface Generator {
collection: string;
name: string;
description: string;
options?: Option[];
type: GeneratorType;
}
export interface DefaultValue {
name: string;
defaultValue: string | undefined;
}
export interface TargetConfiguration {
name: string;
defaultValues: DefaultValue[];
}
export interface Project {
name: string;
root: string;
projectType: string;
targets: Targets[];
}
export interface Targets {
name: string;
project: string;
builder: string;
description: string;
configurations: TargetConfiguration[];
options: CliOption[];
}
export const WORKSPACE_GENERATOR_NAME_REGEX =
/^workspace-(schematic|generator):(.+)/;