@@ -153,28 +153,31 @@ export default class ComponentDetection {
153
153
private static addPackagesToManifests ( packages : Array < ComponentDetectionPackage > , manifests : Array < Manifest > , dependencyGraphs : DependencyGraphs ) : void {
154
154
packages . forEach ( ( pkg : ComponentDetectionPackage ) => {
155
155
pkg . locationsFoundAt . forEach ( ( location : any ) => {
156
- if ( ! manifests . find ( ( manifest : Manifest ) => manifest . name == location ) ) {
157
- const manifest = new Manifest ( location , location ) ;
156
+ // Use the normalized path (remove leading slash if present)
157
+ const normalizedLocation = location . startsWith ( '/' ) ? location . substring ( 1 ) : location ;
158
+
159
+ if ( ! manifests . find ( ( manifest : Manifest ) => manifest . name == normalizedLocation ) ) {
160
+ const manifest = new Manifest ( normalizedLocation , normalizedLocation ) ;
158
161
manifests . push ( manifest ) ;
159
162
}
160
163
161
- const depGraphEntry = dependencyGraphs [ location ] ;
164
+ const depGraphEntry = dependencyGraphs [ normalizedLocation ] ;
162
165
if ( ! depGraphEntry ) {
163
- core . warning ( `No dependency graph entry found for manifest location: ${ location } ` ) ;
166
+ core . warning ( `No dependency graph entry found for manifest location: ${ normalizedLocation } ` ) ;
164
167
return ; // Skip this location if not found in dependencyGraphs
165
168
}
166
169
167
170
const directDependencies = depGraphEntry . explicitlyReferencedComponentIds ;
168
171
if ( directDependencies . includes ( pkg . id ) ) {
169
172
manifests
170
- . find ( ( manifest : Manifest ) => manifest . name == location )
173
+ . find ( ( manifest : Manifest ) => manifest . name == normalizedLocation )
171
174
?. addDirectDependency (
172
175
pkg ,
173
176
ComponentDetection . getDependencyScope ( pkg )
174
177
) ;
175
178
} else {
176
179
manifests
177
- . find ( ( manifest : Manifest ) => manifest . name == location )
180
+ . find ( ( manifest : Manifest ) => manifest . name == normalizedLocation )
178
181
?. addIndirectDependency (
179
182
pkg ,
180
183
ComponentDetection . getDependencyScope ( pkg )
0 commit comments