Skip to content

Commit cfa835c

Browse files
Wanderererclaude
andcommitted
fix: auto-discover embedded sub-projects (Tauri src-tauri, etc.)
When a directory already has a project signature (e.g. svelte.config.js), also scan its immediate children for additional project signatures. This catches hybrid projects like Tauri where the frontend (SvelteKit) and backend (Rust/Cargo.toml) coexist under the same parent directory. Generic approach: no framework-specific hardcoding — any sub-directory with a build file (Cargo.toml, package.json, pom.xml, etc.) inside an already-detected project is added as a separate project entry. Before: desktop (sveltekit) — Tauri Rust backend silently ignored After: desktop (sveltekit) + src-tauri (tauri, 162 commands, 39 entities) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3a35afa commit cfa835c

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

codebeacon/discover/detector.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ def _detect_language_from_files(directory: Path) -> str:
228228
}
229229

230230

231+
231232
def _iter_subdirs(directory: Path) -> list[Path]:
232233
"""Return immediate subdirectories, skipping common non-project dirs."""
233234
try:
@@ -268,13 +269,22 @@ def discover_projects(paths: list[str]) -> list[ProjectInfo]:
268269
# Level 2: if a subdir has no signature itself, scan its children
269270
# (e.g. WaveLog/server, aptscore/frontend, murmur/landing)
270271
subprojects: list[ProjectInfo] = []
272+
seen_paths: set[str] = set()
271273
for subdir in _iter_subdirs(single_path):
272274
if _has_project_signature(subdir):
273275
subprojects.append(_build_project_info(subdir, multi=True))
276+
seen_paths.add(str(subdir))
277+
# Scan children for embedded sub-projects with their own signature
278+
# (e.g. Tauri: desktop/ has svelte.config.js + desktop/src-tauri/ has Cargo.toml)
279+
for nested in _iter_subdirs(subdir):
280+
if str(nested) not in seen_paths and _has_project_signature(nested):
281+
subprojects.append(_build_project_info(nested, multi=True))
282+
seen_paths.add(str(nested))
274283
else:
275284
for nested in _iter_subdirs(subdir):
276-
if _has_project_signature(nested):
285+
if str(nested) not in seen_paths and _has_project_signature(nested):
277286
subprojects.append(_build_project_info(nested, multi=True))
287+
seen_paths.add(str(nested))
278288

279289
if subprojects:
280290
return subprojects

0 commit comments

Comments
 (0)