Current Behavior
When sort: ["source-order"] is configured in typedoc.json, it only affects the ordering of items within groups, not the groups themselves. Groups are always ordered alphabetically.
Example configuration:
{
"sort": [
"source-order"
]
}
Source code order:
/**
* @group Comparators
*/
export function ascending() { }
/**
* @group Factories
*/
export function by() { }
/**
* @group Combinators
*/
export function reverse() { }
Generated docs show groups in alphabetical order:
- Combinators
- Comparators
- Factories
Expected Behavior
When sort: ["source-order"] is configured, groups whose order is not explicitly specified in groupOrder should be sorted by source order rather than alphabetically:
- Comparators (first
@group in source)
- Factories (second
@group in source)
- Combinators (third
@group in source)
Note: groupOrder should maintain precedence when explicitly specified. This is about the fallback behavior for unspecified groups.
Current Workaround
Must explicitly configure groupOrder:
{
"sort": [
"source-order"
],
"groupOrder": [
"Comparators",
"Factories",
"Combinators",
"*"
]
}
Proposed Solution
Modify group sorting behavior to respect the sort option when groupOrder doesn't explicitly specify all groups:
- Groups listed in
groupOrder maintain their explicit order (preserves existing behavior)
- Unlisted groups fall back to
sort: ["source-order"] if configured, alphabetically otherwise
- Update groupOrder documentation from "Groups whose order is not specified will be sorted alphabetically" to "Groups whose order is not specified will be sorted by source order if
sort: ["source-order"] is configured, alphabetically otherwise."
Current Behavior
When
sort: ["source-order"]is configured intypedoc.json, it only affects the ordering of items within groups, not the groups themselves. Groups are always ordered alphabetically.Example configuration:
{ "sort": [ "source-order" ] }Source code order:
Generated docs show groups in alphabetical order:
Expected Behavior
When
sort: ["source-order"]is configured, groups whose order is not explicitly specified ingroupOrdershould be sorted by source order rather than alphabetically:@groupin source)@groupin source)@groupin source)Note:
groupOrdershould maintain precedence when explicitly specified. This is about the fallback behavior for unspecified groups.Current Workaround
Must explicitly configure
groupOrder:{ "sort": [ "source-order" ], "groupOrder": [ "Comparators", "Factories", "Combinators", "*" ] }Proposed Solution
Modify group sorting behavior to respect the
sortoption whengroupOrderdoesn't explicitly specify all groups:groupOrdermaintain their explicit order (preserves existing behavior)sort: ["source-order"]if configured, alphabetically otherwisesort: ["source-order"]is configured, alphabetically otherwise."