forked from oven-sh/bun
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlist-of-yarn-commands.zig
107 lines (100 loc) · 1.87 KB
/
list-of-yarn-commands.zig
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
const std = @import("std");
// yarn v2.3 commands
const yarn_v2 = [_][]const u8{
"add",
"bin",
"cache",
"config",
"dedupe",
"dlx",
"exec",
"explain",
"info",
"init",
"install",
"link",
"node",
"npm",
"pack",
"patch",
"plugin",
"rebuild",
"remove",
"run",
"set",
"unplug",
"up",
"why",
"workspace",
"workspaces",
};
// yarn v1 commands
const yarn_v1 = [_][]const u8{
"access",
"add",
"audit",
"autoclean",
"bin",
"cache",
"check",
"config",
"create",
"exec",
"generate-lock-entry",
"generateLockEntry",
"global",
"help",
"import",
"info",
"init",
"install",
"licenses",
"link",
"list",
"login",
"logout",
"node",
"outdated",
"owner",
"pack",
"policies",
"publish",
"remove",
"run",
"tag",
"team",
"unlink",
"unplug",
"upgrade",
"upgrade-interactive",
"upgradeInteractive",
"version",
"versions",
"why",
"workspace",
"workspaces",
};
pub const all_yarn_commands = brk: {
@setEvalBranchQuota(9999);
var array: [yarn_v2.len + yarn_v1.len]u64 = undefined;
var array_i: usize = 0;
for (yarn_v2) |yarn| {
const hash = std.hash.Wyhash.hash(0, yarn);
@setEvalBranchQuota(9999);
if (std.mem.indexOfScalar(u64, array[0..array_i], hash) == null) {
@setEvalBranchQuota(9999);
array[array_i] = hash;
array_i += 1;
}
}
for (yarn_v1) |yarn| {
@setEvalBranchQuota(9999);
const hash = std.hash.Wyhash.hash(0, yarn);
if (std.mem.indexOfScalar(u64, array[0..array_i], hash) == null) {
@setEvalBranchQuota(9999);
array[array_i] = hash;
array_i += 1;
}
}
break :brk array[0..array_i];
};