-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathcreate-react-app.ts
98 lines (95 loc) · 2.59 KB
/
create-react-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
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",
yarn: "fig://icon?type=yarn",
};
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-app",
description: "Creates a new React project",
args: {
template: "folders",
name: "name",
},
options: [
// template
{
name: "--template",
description:
'Specify a template for the created project (a custom template on npm (search for "cra-template-*"), a relative path, or an archive (.tgz or .tar.gz))',
args: {
name: "name or url",
},
icon: ICONS.path,
priority: 76,
},
{
name: "--use-npm",
description:
"Use npm to install dependencies (default when Yarn is not installed)",
args: boolArg,
icon: ICONS.npm,
priority: 75,
},
{
name: "--use-pnp",
description: "Use Yarn Plug'n'Play to create the app",
args: boolArg,
icon: ICONS.yarn,
priority: 75,
},
{
name: "--scripts-version",
description:
"Use a non-standard version of react-scripts (a specific npm version or npm tag, a custom fork published on npm, a relative path, or an archive (.tgz or .tar.gz))",
args: {
name: "alternative package",
},
priority: 74,
},
// Info
{
name: "--verbose",
description: "Print additional logs",
priority: 1,
icon: ICONS.string,
},
{
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;