@visulima/vis 1.0.0-alpha.11 → 1.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +101 -0
- package/LICENSE.md +559 -186
- package/README.md +18 -0
- package/dist/bin.js +1 -9
- package/dist/config/index.d.ts +477 -556
- package/dist/config/index.js +1 -2
- package/dist/generate/index.js +1 -3
- package/dist/packem_chunks/applyDefaults.js +2 -336
- package/dist/packem_chunks/bin.js +234 -9552
- package/dist/packem_chunks/doctor-probe.js +2 -112
- package/dist/packem_chunks/fix.js +11 -234
- package/dist/packem_chunks/handler.js +1 -99
- package/dist/packem_chunks/handler10.js +2 -53
- package/dist/packem_chunks/handler11.js +1 -32
- package/dist/packem_chunks/handler12.js +5 -100
- package/dist/packem_chunks/handler13.js +1 -25
- package/dist/packem_chunks/handler14.js +18 -916
- package/dist/packem_chunks/handler15.js +15 -201
- package/dist/packem_chunks/handler16.js +1 -124
- package/dist/packem_chunks/handler17.js +1 -13
- package/dist/packem_chunks/handler18.js +1 -106
- package/dist/packem_chunks/handler19.js +1 -19
- package/dist/packem_chunks/handler2.js +2 -75
- package/dist/packem_chunks/handler20.js +5 -29
- package/dist/packem_chunks/handler21.js +1 -222
- package/dist/packem_chunks/handler22.js +1 -237
- package/dist/packem_chunks/handler23.js +5 -101
- package/dist/packem_chunks/handler24.js +1 -110
- package/dist/packem_chunks/handler25.js +3 -402
- package/dist/packem_chunks/handler26.js +1 -13
- package/dist/packem_chunks/handler27.js +1 -63
- package/dist/packem_chunks/handler28.js +7 -34
- package/dist/packem_chunks/handler29.js +21 -456
- package/dist/packem_chunks/handler3.js +4 -95
- package/dist/packem_chunks/handler30.js +3 -170
- package/dist/packem_chunks/handler31.js +1 -530
- package/dist/packem_chunks/handler32.js +2 -214
- package/dist/packem_chunks/handler33.js +25 -119
- package/dist/packem_chunks/handler34.js +2 -630
- package/dist/packem_chunks/handler35.js +3 -283
- package/dist/packem_chunks/handler36.js +22 -542
- package/dist/packem_chunks/handler37.js +410 -744
- package/dist/packem_chunks/handler38.js +22 -989
- package/dist/packem_chunks/handler39.js +22 -574
- package/dist/packem_chunks/handler4.js +2 -90
- package/dist/packem_chunks/handler40.js +22 -1685
- package/dist/packem_chunks/handler41.js +6 -1088
- package/dist/packem_chunks/handler42.js +5 -797
- package/dist/packem_chunks/handler43.js +10 -2658
- package/dist/packem_chunks/handler44.js +51 -3784
- package/dist/packem_chunks/handler45.js +25 -2574
- package/dist/packem_chunks/handler46.js +3 -3769
- package/dist/packem_chunks/handler47.js +21 -1485
- package/dist/packem_chunks/handler48.js +42 -0
- package/dist/packem_chunks/handler5.js +8 -174
- package/dist/packem_chunks/handler6.js +1 -95
- package/dist/packem_chunks/handler7.js +1 -115
- package/dist/packem_chunks/handler8.js +1 -12
- package/dist/packem_chunks/handler9.js +1 -29
- package/dist/packem_chunks/heal-accept.js +10 -522
- package/dist/packem_chunks/heal.js +14 -673
- package/dist/packem_chunks/index.js +7 -873
- package/dist/packem_chunks/loader.js +1 -23
- package/dist/packem_chunks/tar.js +3 -0
- package/dist/packem_shared/ai-analysis-hm8d2W7z.js +67 -0
- package/dist/packem_shared/ai-cache-DoiF80AR.js +1 -0
- package/dist/packem_shared/ai-fix-nn4zOE95.js +43 -0
- package/dist/packem_shared/cache-directory-CwHlJhgx.js +1 -0
- package/dist/packem_shared/dependency-scan-COr5n63B.js +2 -0
- package/dist/packem_shared/docker-D6OGr5_S.js +2 -0
- package/dist/packem_shared/failure-log-iUVLf6ts.js +2 -0
- package/dist/packem_shared/flakiness-D9wf0t56.js +1 -0
- package/dist/packem_shared/giget-CcEy_Elm.js +2 -0
- package/dist/packem_shared/index-DH-5hsrC.js +1 -0
- package/dist/packem_shared/otel-DxDUPJJH.js +6 -0
- package/dist/packem_shared/otelPlugin-CQq6poq8.js +1 -0
- package/dist/packem_shared/registry-CkubDdiY.js +2 -0
- package/dist/packem_shared/run-summary-utils-BfBvjzhY.js +1 -0
- package/dist/packem_shared/runtime-check-BXZ43CBW.js +1 -0
- package/dist/packem_shared/selectors-BylODRiM.js +3 -0
- package/dist/packem_shared/symbols-CQmER5MT.js +1 -0
- package/dist/packem_shared/toolchain-BgBOUHII.js +5 -0
- package/dist/packem_shared/typosquats-CcZl99B1.js +1 -0
- package/dist/packem_shared/use-measured-height-DjYgUOKk.js +1 -0
- package/dist/packem_shared/utils-DrNg0XTR.js +1 -0
- package/dist/packem_shared/verify-Baj5mFJ7.js +1 -0
- package/dist/packem_shared/vis-update-app-D1jl0UZZ.js +1 -0
- package/dist/packem_shared/xxh3-DrAUNq4n.js +1 -0
- package/index.js +556 -727
- package/package.json +19 -29
- package/schemas/project.schema.json +739 -297
- package/schemas/vis-config.schema.json +3365 -384
- package/templates/buildkite-ci/template.yml +20 -20
- package/dist/packem_shared/VisUpdateApp-D-Yz_wvg.js +0 -1316
- package/dist/packem_shared/_commonjsHelpers-BqLXS_qQ.js +0 -5
- package/dist/packem_shared/ai-analysis-CHeB1joD.js +0 -367
- package/dist/packem_shared/ai-cache-Be_jexe4.js +0 -142
- package/dist/packem_shared/ai-fix-B9iQVcD2.js +0 -379
- package/dist/packem_shared/cache-directory-2qvs4goY.js +0 -98
- package/dist/packem_shared/catalog-BJTtyi-O.js +0 -1371
- package/dist/packem_shared/dependency-scan-A0KSklpG.js +0 -188
- package/dist/packem_shared/docker-2iZzc280.js +0 -181
- package/dist/packem_shared/failure-log-Cz3Z4SKL.js +0 -100
- package/dist/packem_shared/flakiness-goTxXuCX.js +0 -180
- package/dist/packem_shared/otel-DCvqCTz_.js +0 -158
- package/dist/packem_shared/otelPlugin-DFaLDvJf.js +0 -3
- package/dist/packem_shared/registry-CbqXI0rc.js +0 -272
- package/dist/packem_shared/run-summary-utils-PVMl4aIh.js +0 -130
- package/dist/packem_shared/runtime-check-Cobi3p6l.js +0 -127
- package/dist/packem_shared/selectors-SM69TfqC.js +0 -194
- package/dist/packem_shared/symbols-Ta7g2nU-.js +0 -14
- package/dist/packem_shared/toolchain-BdZd9eBi.js +0 -975
- package/dist/packem_shared/typosquats-C-bCh3PX.js +0 -1210
- package/dist/packem_shared/use-measured-height-CNP0vT4M.js +0 -20
- package/dist/packem_shared/utils-CthVdBPS.js +0 -40
- package/dist/packem_shared/xxh3-Ck8mXNg1.js +0 -239
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import { createRequire as __cjs_createRequire } from "node:module";
|
|
2
|
-
|
|
3
|
-
const __cjs_require = __cjs_createRequire(import.meta.url);
|
|
4
|
-
|
|
5
|
-
const __cjs_getProcess = typeof globalThis !== "undefined" && typeof globalThis.process !== "undefined" ? globalThis.process : process;
|
|
6
|
-
|
|
7
|
-
const __cjs_getBuiltinModule = (module) => {
|
|
8
|
-
// Check if we're in Node.js and version supports getBuiltinModule
|
|
9
|
-
if (typeof __cjs_getProcess !== "undefined" && __cjs_getProcess.versions && __cjs_getProcess.versions.node) {
|
|
10
|
-
const [major, minor] = __cjs_getProcess.versions.node.split(".").map(Number);
|
|
11
|
-
// Node.js 20.16.0+ and 22.3.0+
|
|
12
|
-
if (major > 22 || (major === 22 && minor >= 3) || (major === 20 && minor >= 16)) {
|
|
13
|
-
return __cjs_getProcess.getBuiltinModule(module);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
// Fallback to createRequire
|
|
17
|
-
return __cjs_require(module);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const {
|
|
21
|
-
createInterface
|
|
22
|
-
} = __cjs_getBuiltinModule("node:readline");
|
|
23
|
-
import { relative } from '@visulima/path';
|
|
24
|
-
|
|
25
|
-
const TAG_PROJECT_RE = /^#([\w\-/]+):(.+)$/;
|
|
26
|
-
const NAMED_PROJECT_RE = /^([@\w\-/]+):(.+)$/;
|
|
27
|
-
const parseTargetSelector = (input) => {
|
|
28
|
-
if (input === "") {
|
|
29
|
-
return void 0;
|
|
30
|
-
}
|
|
31
|
-
if (input.startsWith(":")) {
|
|
32
|
-
return { kind: "all", target: input.slice(1) };
|
|
33
|
-
}
|
|
34
|
-
if (input.startsWith("~:")) {
|
|
35
|
-
return { kind: "closest", target: input.slice(2) };
|
|
36
|
-
}
|
|
37
|
-
const tagMatch = TAG_PROJECT_RE.exec(input);
|
|
38
|
-
if (tagMatch?.[1] && tagMatch[2]) {
|
|
39
|
-
return { kind: "tag", tag: tagMatch[1], target: tagMatch[2] };
|
|
40
|
-
}
|
|
41
|
-
const projectMatch = NAMED_PROJECT_RE.exec(input);
|
|
42
|
-
if (projectMatch?.[1] && projectMatch[2] && // Distinguish `pkg-name:target` from a bare `target` that happens to contain `:`.
|
|
43
|
-
(projectMatch[1].startsWith("@") || projectMatch[1].includes("/") || projectMatch[1].includes("-"))) {
|
|
44
|
-
return { kind: "project", projects: [projectMatch[1]], target: projectMatch[2] };
|
|
45
|
-
}
|
|
46
|
-
return { kind: "all", target: input };
|
|
47
|
-
};
|
|
48
|
-
const resolveSelector = async (input, workspace, cwd, workspaceRoot) => {
|
|
49
|
-
const parsed = parseTargetSelector(input);
|
|
50
|
-
if (!parsed) {
|
|
51
|
-
throw new Error(`Invalid target selector: "${input}"`);
|
|
52
|
-
}
|
|
53
|
-
const allProjects = Object.keys(workspace.projects);
|
|
54
|
-
if (parsed.kind === "all") {
|
|
55
|
-
return { projects: allProjects, target: parsed.target };
|
|
56
|
-
}
|
|
57
|
-
if (parsed.kind === "project") {
|
|
58
|
-
const projects = parsed.projects ?? [];
|
|
59
|
-
return { projects, target: parsed.target };
|
|
60
|
-
}
|
|
61
|
-
if (parsed.kind === "tag") {
|
|
62
|
-
const tag = parsed.tag;
|
|
63
|
-
const matched = allProjects.filter((name) => {
|
|
64
|
-
const project = workspace.projects[name];
|
|
65
|
-
return project?.tags?.includes(tag) ?? false;
|
|
66
|
-
});
|
|
67
|
-
return { projects: matched, target: parsed.target };
|
|
68
|
-
}
|
|
69
|
-
const relCwd = relative(workspaceRoot, cwd) || ".";
|
|
70
|
-
let bestProject;
|
|
71
|
-
let bestRootLength = -1;
|
|
72
|
-
for (const [name, project] of Object.entries(workspace.projects)) {
|
|
73
|
-
const projectRoot = project.root;
|
|
74
|
-
if (!projectRoot) {
|
|
75
|
-
continue;
|
|
76
|
-
}
|
|
77
|
-
const isMatch = relCwd === projectRoot || relCwd.startsWith(`${projectRoot}/`);
|
|
78
|
-
if (isMatch && projectRoot.length > bestRootLength) {
|
|
79
|
-
bestRootLength = projectRoot.length;
|
|
80
|
-
bestProject = name;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (!bestProject) {
|
|
84
|
-
if (process.stdout.isTTY) {
|
|
85
|
-
const rl = createInterface({ input: process.stdin, output: process.stderr });
|
|
86
|
-
const allNames = Object.keys(workspace.projects).sort();
|
|
87
|
-
process.stderr.write(`No project found at ${relCwd}. Pick one:
|
|
88
|
-
`);
|
|
89
|
-
for (const [i, allName] of allNames.entries()) {
|
|
90
|
-
process.stderr.write(` ${String(i + 1)}) ${allName}
|
|
91
|
-
`);
|
|
92
|
-
}
|
|
93
|
-
const answer = await new Promise((resolve) => {
|
|
94
|
-
rl.question("> ", resolve);
|
|
95
|
-
});
|
|
96
|
-
rl.close();
|
|
97
|
-
const idx = Number.parseInt(answer, 10) - 1;
|
|
98
|
-
if (idx >= 0 && idx < allNames.length) {
|
|
99
|
-
return { projects: [allNames[idx]], target: parsed.target };
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
throw new Error(`No project found at or above ${relCwd} for selector "${input}".`);
|
|
103
|
-
}
|
|
104
|
-
return { projects: [bestProject], target: parsed.target };
|
|
105
|
-
};
|
|
106
|
-
const QUERY_CLAUSE_RE = /^(\w+)\s*(!?=)\s*(.+)$/;
|
|
107
|
-
const parseQuery = (input) => {
|
|
108
|
-
const trimmed = input.trim();
|
|
109
|
-
if (trimmed === "") {
|
|
110
|
-
return void 0;
|
|
111
|
-
}
|
|
112
|
-
const andParts = trimmed.split("&&").map((part) => part.trim());
|
|
113
|
-
const orParts = trimmed.split("||").map((part) => part.trim());
|
|
114
|
-
const usingAnd = andParts.length > 1;
|
|
115
|
-
const usingOr = orParts.length > 1;
|
|
116
|
-
if (usingAnd && usingOr) {
|
|
117
|
-
throw new Error("Query language does not support mixed && / || — split into multiple --query flags or simplify.");
|
|
118
|
-
}
|
|
119
|
-
const parts = usingOr ? orParts : andParts;
|
|
120
|
-
const op = usingOr ? "||" : "&&";
|
|
121
|
-
const clauses = [];
|
|
122
|
-
for (const part of parts) {
|
|
123
|
-
const match = QUERY_CLAUSE_RE.exec(part);
|
|
124
|
-
if (!match) {
|
|
125
|
-
throw new Error(`Invalid query clause: "${part}". Expected <field>=<value> or <field>!=<value>.`);
|
|
126
|
-
}
|
|
127
|
-
const [, field, rawOp, rawValue] = match;
|
|
128
|
-
clauses.push({
|
|
129
|
-
field,
|
|
130
|
-
op: rawOp === "!=" ? "!=" : "=",
|
|
131
|
-
value: rawValue.trim().replaceAll(/^["']|["']$/g, "")
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
return { clauses, op };
|
|
135
|
-
};
|
|
136
|
-
const matchClause = (clause, name, project) => {
|
|
137
|
-
const { field, op, value } = clause;
|
|
138
|
-
const test = (actual) => {
|
|
139
|
-
const matched = actual === value;
|
|
140
|
-
return op === "=" ? matched : !matched;
|
|
141
|
-
};
|
|
142
|
-
const testList = (actuals) => {
|
|
143
|
-
const list = actuals ?? [];
|
|
144
|
-
const matched = list.includes(value);
|
|
145
|
-
return op === "=" ? matched : !matched;
|
|
146
|
-
};
|
|
147
|
-
switch (field) {
|
|
148
|
-
case "id":
|
|
149
|
-
case "project": {
|
|
150
|
-
return test(name);
|
|
151
|
-
}
|
|
152
|
-
case "language": {
|
|
153
|
-
return test(project.language);
|
|
154
|
-
}
|
|
155
|
-
case "layer": {
|
|
156
|
-
return test(project.layer);
|
|
157
|
-
}
|
|
158
|
-
case "projectType":
|
|
159
|
-
case "type": {
|
|
160
|
-
return test(project.projectType);
|
|
161
|
-
}
|
|
162
|
-
case "stack": {
|
|
163
|
-
return test(project.stack);
|
|
164
|
-
}
|
|
165
|
-
case "tag":
|
|
166
|
-
case "tags": {
|
|
167
|
-
return testList(project.tags);
|
|
168
|
-
}
|
|
169
|
-
default: {
|
|
170
|
-
return false;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
const filterProjectsByQuery = (projectNames, workspace, query) => {
|
|
175
|
-
if (!query || query.trim() === "") {
|
|
176
|
-
return projectNames;
|
|
177
|
-
}
|
|
178
|
-
const parsed = parseQuery(query);
|
|
179
|
-
if (!parsed) {
|
|
180
|
-
return projectNames;
|
|
181
|
-
}
|
|
182
|
-
return projectNames.filter((name) => {
|
|
183
|
-
const project = workspace.projects[name];
|
|
184
|
-
if (!project) {
|
|
185
|
-
return false;
|
|
186
|
-
}
|
|
187
|
-
if (parsed.op === "&&") {
|
|
188
|
-
return parsed.clauses.every((clause) => matchClause(clause, name, project));
|
|
189
|
-
}
|
|
190
|
-
return parsed.clauses.some((clause) => matchClause(clause, name, project));
|
|
191
|
-
});
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
export { filterProjectsByQuery as f, resolveSelector as r };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
const isUnicodeSupported = () => {
|
|
2
|
-
if (process.platform === "win32") {
|
|
3
|
-
return Boolean(process.env["WT_SESSION"]) || process.env["TERM_PROGRAM"] === "vscode" || process.env["TERM"] === "xterm-256color";
|
|
4
|
-
}
|
|
5
|
-
return process.env["TERM"] !== "linux";
|
|
6
|
-
};
|
|
7
|
-
const unicode = isUnicodeSupported();
|
|
8
|
-
const TICK = unicode ? "✓" : "√";
|
|
9
|
-
const CROSS = unicode ? "✖" : "×";
|
|
10
|
-
const ELLIPSIS = unicode ? "…" : "...";
|
|
11
|
-
const DASH = unicode ? "—" : "-";
|
|
12
|
-
const WARNING = unicode ? "⚠" : "!";
|
|
13
|
-
|
|
14
|
-
export { CROSS as C, DASH as D, ELLIPSIS as E, TICK as T, WARNING as W };
|