forked from openclaw/openclaw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.commands-light-paths.mjs
More file actions
69 lines (63 loc) · 2.2 KB
/
vitest.commands-light-paths.mjs
File metadata and controls
69 lines (63 loc) · 2.2 KB
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
const normalizeRepoPath = (value) => value.replaceAll("\\", "/");
const commandsLightEntries = [
{ source: "src/commands/cleanup-utils.ts", test: "src/commands/cleanup-utils.test.ts" },
{
source: "src/commands/dashboard.links.ts",
test: "src/commands/dashboard.links.test.ts",
},
{ source: "src/commands/doctor-browser.ts", test: "src/commands/doctor-browser.test.ts" },
{
source: "src/commands/doctor-gateway-auth-token.ts",
test: "src/commands/doctor-gateway-auth-token.test.ts",
},
{
source: "src/commands/gateway-status/helpers.ts",
test: "src/commands/gateway-status/helpers.test.ts",
},
{
source: "src/commands/sandbox-formatters.ts",
test: "src/commands/sandbox-formatters.test.ts",
},
{
source: "src/commands/status-json-command.ts",
test: "src/commands/status-json-command.test.ts",
},
{
source: "src/commands/status-json-payload.ts",
test: "src/commands/status-json-payload.test.ts",
},
{
source: "src/commands/status-json-runtime.ts",
test: "src/commands/status-json-runtime.test.ts",
},
{
source: "src/commands/status-overview-rows.ts",
test: "src/commands/status-overview-rows.test.ts",
},
{
source: "src/commands/status-overview-surface.ts",
test: "src/commands/status-overview-surface.test.ts",
},
{
source: "src/commands/status-overview-values.ts",
test: "src/commands/status-overview-values.test.ts",
},
{ source: "src/commands/text-format.ts", test: "src/commands/text-format.test.ts" },
];
const commandsLightIncludePatternByFile = new Map(
commandsLightEntries.flatMap(({ source, test }) => [
[source, test],
[test, test],
]),
);
export const commandsLightSourceFiles = commandsLightEntries.map(({ source }) => source);
export const commandsLightTestFiles = commandsLightEntries.map(({ test }) => test);
export function isCommandsLightTarget(file) {
return commandsLightIncludePatternByFile.has(normalizeRepoPath(file));
}
export function isCommandsLightTestFile(file) {
return commandsLightTestFiles.includes(normalizeRepoPath(file));
}
export function resolveCommandsLightIncludePattern(file) {
return commandsLightIncludePatternByFile.get(normalizeRepoPath(file)) ?? null;
}