@alessandroraffa/tangyr 3.0.2 → 3.0.3
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/dist/index.js +55 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17329,6 +17329,18 @@ function collectAssessFindings(scope, projectRoot, toolFilter, assessOptions) {
|
|
|
17329
17329
|
scope,
|
|
17330
17330
|
scope === "project" ? projectRoot ?? process.cwd() : void 0
|
|
17331
17331
|
);
|
|
17332
|
+
const recorded = recordedArtifactPaths(scopePath);
|
|
17333
|
+
for (const finding of findings) {
|
|
17334
|
+
if (finding.classification !== "conflicting") {
|
|
17335
|
+
continue;
|
|
17336
|
+
}
|
|
17337
|
+
const resolved = path12.resolve(finding.path);
|
|
17338
|
+
const ours = recorded.has(resolved) || finding.type === "directory" && holdsOnlyRecorded(resolved, recorded);
|
|
17339
|
+
if (ours) {
|
|
17340
|
+
finding.classification = "compatible";
|
|
17341
|
+
finding.description = `${finding.description} (recorded by this installation)`;
|
|
17342
|
+
}
|
|
17343
|
+
}
|
|
17332
17344
|
if (fs11.existsSync(path12.join(scopePath, "manifest.json"))) {
|
|
17333
17345
|
findings.push({
|
|
17334
17346
|
path: path12.join(scopePath, "manifest.json"),
|
|
@@ -17524,6 +17536,49 @@ function resolveKitPath(config, configDir) {
|
|
|
17524
17536
|
});
|
|
17525
17537
|
return resolution?.kit.path ?? null;
|
|
17526
17538
|
}
|
|
17539
|
+
function recordedArtifactPaths(scopePath) {
|
|
17540
|
+
const paths = /* @__PURE__ */ new Set();
|
|
17541
|
+
try {
|
|
17542
|
+
const manifest = readManifest(scopePath);
|
|
17543
|
+
if (!manifest) {
|
|
17544
|
+
return paths;
|
|
17545
|
+
}
|
|
17546
|
+
for (const artifact of manifest.artifacts) {
|
|
17547
|
+
if (artifact.path) {
|
|
17548
|
+
paths.add(path12.resolve(artifact.path));
|
|
17549
|
+
}
|
|
17550
|
+
}
|
|
17551
|
+
for (const link of manifest.managedLinks) {
|
|
17552
|
+
paths.add(path12.resolve(link.path));
|
|
17553
|
+
}
|
|
17554
|
+
} catch {
|
|
17555
|
+
}
|
|
17556
|
+
return paths;
|
|
17557
|
+
}
|
|
17558
|
+
function holdsOnlyRecorded(dir, recorded) {
|
|
17559
|
+
let entries;
|
|
17560
|
+
try {
|
|
17561
|
+
entries = fs11.readdirSync(dir, { withFileTypes: true });
|
|
17562
|
+
} catch {
|
|
17563
|
+
return false;
|
|
17564
|
+
}
|
|
17565
|
+
if (entries.length === 0) {
|
|
17566
|
+
return [...recorded].some((p) => p.startsWith(`${dir}${path12.sep}`));
|
|
17567
|
+
}
|
|
17568
|
+
for (const entry of entries) {
|
|
17569
|
+
const full = path12.join(dir, entry.name);
|
|
17570
|
+
if (entry.isDirectory() && !entry.isSymbolicLink()) {
|
|
17571
|
+
if (!holdsOnlyRecorded(full, recorded)) {
|
|
17572
|
+
return false;
|
|
17573
|
+
}
|
|
17574
|
+
continue;
|
|
17575
|
+
}
|
|
17576
|
+
if (!recorded.has(full)) {
|
|
17577
|
+
return false;
|
|
17578
|
+
}
|
|
17579
|
+
}
|
|
17580
|
+
return true;
|
|
17581
|
+
}
|
|
17527
17582
|
|
|
17528
17583
|
// src/commands/auth.ts
|
|
17529
17584
|
import fs14 from "fs";
|