-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathcreate-react-native-app.ts
100 lines (96 loc) · 2.47 KB
/
create-react-native-app.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
97
98
99
100
const ICONS = {
help: "https://raw.githubusercontent.com/expo/expo-cli/master/assets/fig/help.png",
version:
"https://raw.githubusercontent.com/expo/expo-cli/master/assets/fig/info.png",
true: "https://raw.githubusercontent.com/expo/expo-cli/master/assets/fig/true.png",
false:
"https://raw.githubusercontent.com/expo/expo-cli/master/assets/fig/false.png",
skip: "https://raw.githubusercontent.com/expo/expo-cli/master/assets/fig/skip.png",
path: "https://raw.githubusercontent.com/expo/expo-cli/master/assets/fig/path.png",
string:
"https://raw.githubusercontent.com/expo/expo-cli/master/assets/fig/string.png",
template:
"https://raw.githubusercontent.com/expo/expo-cli/master/assets/fig/export.png",
npm: "fig://icon?type=npm",
};
const boolArg: Fig.Arg = {
name: "boolean",
isOptional: true,
suggestions: [
{
name: "true",
icon: ICONS.true,
},
{
name: "false",
icon: ICONS.false,
},
],
};
const completionSpec: Fig.Spec = {
name: "create-react-native-app",
description: "Creates a new React Native project",
args: {
template: "folders",
name: "name",
},
options: [
// template
{
name: "--template",
description:
"The name of a template from expo/examples or URL to a GitHub repo that contains an example",
args: {
name: "template",
},
icon: ICONS.template,
priority: 76,
},
{
name: "--template-path",
description: "The path inside of a GitHub repo where the example lives",
args: {
name: "name",
},
icon: ICONS.path,
priority: 76,
},
// bool
{
name: "--yes",
description: "Use the default options for creating a project",
args: boolArg,
icon: ICONS.skip,
priority: 76,
},
{
name: "--no-install",
description: "Skip installing npm packages or CocoaPods",
args: boolArg,
icon: ICONS.skip,
priority: 76,
},
{
name: "--use-npm",
description:
"Use npm to install dependencies. (default when Yarn is not installed)",
args: boolArg,
icon: ICONS.npm,
priority: 76,
},
// Info
{
name: ["-h", "--help"],
description: "Output usage information",
icon: ICONS.help,
priority: 1,
},
{
name: ["-V", "--version"],
description: "Output the version number",
icon: ICONS.version,
priority: 1,
},
],
};
export default completionSpec;