Skip to content

Commit 5d5cecc

Browse files
ndpvt-webclaude
andcommitted
fix: correct URL dep depth and add error handling
- Record child dependency depth instead of parent depth - Surface scan failures instead of silently returning empty array Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b10c55f commit 5d5cecc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

server/utils/dependency-analysis.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,19 +297,24 @@ async function scanUrlDependencies(
297297
...versionData.optionalDependencies,
298298
}
299299

300+
// URL dependencies are children of the current package, so their depth is one level deeper
301+
const dependencyDepth: DependencyDepth = depth === 'root' ? 'direct' : 'transitive'
302+
300303
for (const [depName, depUrl] of Object.entries(allDeps || {})) {
301304
if (isUrlDependency(depUrl)) {
302305
urlDeps.push({
303306
name: depName,
304307
url: depUrl,
305-
depth,
308+
depth: dependencyDepth,
306309
path: [...path, `${depName}@${depUrl}`],
307310
})
308311
}
309312
}
310313

311314
return urlDeps
312-
} catch {
315+
} catch (error) {
316+
// oxlint-disable-next-line no-console -- log URL dependency scan failures for debugging
317+
console.warn(`[dep-analysis] URL dependency scan failed for ${name}@${version}:`, error)
313318
return []
314319
}
315320
}

0 commit comments

Comments
 (0)