Skip to content

Commit

Permalink
fix(core): handle duplicate files when tagged in same group (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
tgreyuk committed May 30, 2024
1 parent 64a149f commit 469467d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ export function buildUrls(theme: MarkdownTheme, project: ProjectReflection) {

const duplicateUrls = urls.filter(
(urlMapping) =>
urlMapping.url.toLowerCase().replace(/-\d+$/, '') ===
url.toLowerCase(),
urlMapping.url.toLowerCase() === url.toLowerCase() &&
urlMapping.url !== url,
);

if (duplicateUrls.length > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@ class ClassA {}
class ClassB {}

export { ClassA as SomeClass, ClassB as someClass };

/**
* @group group1
* @group group2
*/
export function someFunction() {}
Original file line number Diff line number Diff line change
Expand Up @@ -2268,6 +2268,11 @@ exports[`Navigation should gets Navigation Json for multiple entry points: (Outp
"title": "someClass",
"kind": 128,
"path": "has-same-exports/classes/someClass-1.md"
},
{
"title": "someFunction",
"kind": 64,
"path": "has-same-exports/functions/someFunction.md"
}
]
},
Expand Down Expand Up @@ -2619,6 +2624,26 @@ exports[`Navigation should gets Navigation Json for multiple entry points: (Outp
"path": "has-same-exports/classes/someClass-1.md"
}
]
},
{
"title": "group1",
"children": [
{
"title": "someFunction",
"kind": 64,
"path": "has-same-exports/functions/someFunction.md"
}
]
},
{
"title": "group2",
"children": [
{
"title": "someFunction",
"kind": 64,
"path": "has-same-exports/functions/someFunction.md"
}
]
}
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ exports[`Urls should gets Urls for multiple entry points: outputFileStrategy: me
"has-references/index.md",
"has-same-exports/classes/SomeClass.md",
"has-same-exports/classes/someClass-1.md",
"has-same-exports/functions/someFunction.md",
"has-same-exports/index.md",
"index/classes/SomeClass.md",
"index/index.md",
Expand Down Expand Up @@ -298,6 +299,7 @@ exports[`Urls should gets Urls for multiple entry points: outputFileStrategy: me
"has-references/index.md",
"has-same-exports/classes/SomeClass.md",
"has-same-exports/classes/someClass-1.md",
"has-same-exports/functions/someFunction.md",
"has-same-exports/index.md",
"index/classes/SomeClass.md",
"index/index.md",
Expand Down

0 comments on commit 469467d

Please sign in to comment.