mirror of
https://github.com/Egonex-AI/Understand-Anything.git
synced 2026-06-22 10:58:03 +08:00
fix(core): add __tests__ pattern and handle filePath-less nodes in applyLLMLayers
Add __tests__ and __specs__ (plural inside underscores) to Test Layer patterns for the common convention. Also assign file nodes without filePath to "Other" layer in applyLLMLayers for consistency. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
305fb4055b
commit
839166b229
@@ -45,7 +45,7 @@ const LAYER_PATTERNS: Array<{ patterns: string[]; layerName: string; description
|
||||
description: "Shared utilities, helpers, and common libraries",
|
||||
},
|
||||
{
|
||||
patterns: ["test", "spec", "__test__", "__spec__"],
|
||||
patterns: ["test", "spec", "__test__", "__spec__", "__tests__", "__specs__"],
|
||||
layerName: "Test Layer",
|
||||
description: "Test files and test utilities",
|
||||
},
|
||||
@@ -227,7 +227,13 @@ export function applyLLMLayers(
|
||||
|
||||
for (const node of graph.nodes) {
|
||||
if (node.type !== "file") continue;
|
||||
if (!node.filePath) continue;
|
||||
|
||||
if (!node.filePath) {
|
||||
const other = layerMap.get("Other") ?? [];
|
||||
other.push(node.id);
|
||||
layerMap.set("Other", other);
|
||||
continue;
|
||||
}
|
||||
|
||||
const normalizedPath = node.filePath.replace(/\\/g, "/");
|
||||
let assigned = false;
|
||||
|
||||
Reference in New Issue
Block a user