-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathswc.ts
143 lines (143 loc) · 3.96 KB
/
swc.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
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
const completionSpec: Fig.Spec = {
name: "swc",
description:
"SWC is a super-fast compiler written in rust; producing widely-supported javascript from modern standards and typescript",
options: [
{
name: ["--filename", "-f"],
description:
"Filename to use when reading from stdin. This will be used in source maps and errors",
args: {
name: "FILE",
description: "Path to the file",
template: ["filepaths"],
},
},
{
name: "--config-file",
description: "Path to a .swcrc file to use",
args: {
name: "CONFIG_FILE",
description: "Path to a .swcrc file to use",
template: ["filepaths"],
},
},
{
name: "--env-name",
description:
"The name of the 'env' to use when loading configs and plugins. Defaults to the value of SWC_ENV, or else NODE_ENV, or else development",
args: {
name: "ENV_NAME",
suggestions: ["production", "development", "test"],
description:
"The name of the 'env' to use when loading configs and plugins. Defaults to the value of SWC_ENV, or else NODE_ENV, or else development",
},
},
{
name: "--no-swcrc",
description: "Whether or not to look up .swcrc files",
},
{
name: "--ignore",
description: "List of glob paths to not compile",
args: {
name: "PATH",
description: "A glob path to not compile",
template: ["filepaths", "folders"],
},
},
{
name: "--only",
description: "List of glob paths to only compile",
args: {
name: "PATH",
description: "A glob path to only compile",
template: ["filepaths", "folders"],
},
},
{
name: ["--watch", "-w"],
description: "Watch for changes and recompile",
},
{
name: ["--quiet", "-q"],
description: "Suppress compilation output",
},
{
name: ["--source-maps", "-s"],
description: "Generate source maps",
args: {
name: "SOURCE_MAP",
description: "Source map type",
suggestions: ["true", "false", "inline", "both"],
},
},
{
name: "--source-map-target",
description: "Define the file for the source map",
args: {
name: "FILE",
description: "The file for the source map",
template: ["filepaths"],
},
},
{
name: "--source-file-name",
description: "Set sources[0] on returned source map",
},
{
name: "--source-root",
description: "The root from which all sources are relative",
},
{
name: ["--out-file", "-o"],
description: "Compile all input files into a single file",
args: {
name: "OUTPUT_FILE",
description: "The output file",
template: ["filepaths"],
},
},
{
name: ["--out-dir", "-d"],
description:
"Compile an input directory of modules into an output directory",
args: {
name: "OUTPUT_DIR",
description: "The output directory",
template: ["folders"],
},
},
{
name: ["--copy-files", "-D"],
description: "When compiling a directory, copy over non-compilable files",
},
{
name: "--include-dotfiles",
description:
"Include dotfiles when compiling and copying non-compilable files",
},
{
name: ["--config", "-C"],
description: "Override a config from .swcrc file",
args: {
name: "CONFIG_FILE",
description: "Path to .swcrc file",
template: ["filepaths"],
},
},
{
name: "--sync",
description: "Invoke swc synchronously. Useful for debugging",
},
{
name: "--log-watch-compilation",
description: "Log a message when a watched file is successfully compiled",
},
{
name: "--extensions",
description: "Log a message when a watched file is successfully compiled",
},
],
};
export default completionSpec;