-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathtsx.ts
64 lines (59 loc) · 1.41 KB
/
tsx.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
import { filepaths } from "@fig/autocomplete-generators";
const scriptPathArgs: Fig.Arg = {
name: "script path",
isScript: true,
generators: filepaths({
extensions: ["ts"],
editFileSuggestions: { priority: 76 },
editFolderSuggestions: { priority: 70 },
}),
};
const completionSpec: Fig.Spec = {
name: "tsx",
description: "Run TypeScript file using tsx",
subcommands: [
{
name: "watch",
description: "Run the script and watch for changes",
args: scriptPathArgs,
},
],
options: [
{
name: ["--help", "-h"],
description: "Show help for tsx",
isPersistent: true,
},
{
name: "--no-cache",
description: "Disable caching",
isPersistent: true,
},
{
name: "--clear-screen",
description: "Disable clearing the screen on rerun",
isPersistent: true,
insertValue: "--clear-screen=false",
dependsOn: ["watch"],
args: scriptPathArgs,
},
{
name: ["-v", "--version"],
description: "Show version",
},
{
name: "--tsconfig",
description: "Custom tsconfig.json path",
args: {
name: "tsconfig.json path",
generators: filepaths({
extensions: ["json"],
editFileSuggestions: { priority: 76 },
editFolderSuggestions: { priority: 70 },
}),
},
},
],
args: scriptPathArgs,
};
export default completionSpec;