-
Notifications
You must be signed in to change notification settings - Fork 4
Improve CodeDocDependencies for grouped functions and constants #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Improve CodeDocDependencies for grouped functions and constants #67
Conversation
…deDocDependencies Instead of adding ALL constantsInformation and functionsInformation to CodeDocDependencies of all files containing at least one constant or function, only add information of the groupBy aliases contained in that file.
| return ModuleResolutionKind.NodeJs; | ||
| case 'node16': | ||
| return ModuleResolutionKind.Node16; | ||
| case 'node10': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, because this was missing the warning was logged (see "default" case below). Because appearantly, if you don't specify moduleResolutionKind it falls back to "node10"
| return typeArguments[index]; | ||
| } | ||
|
|
||
| export function getCategoryFromEntityKind(entityKind: EntityKind): Category { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We were misusing EntityKind for Category. "Category" is the category label in the ArgTypes table and needs to be plural. I separated both types and used the proper "EntityKind"s everywhere.
| /** | ||
| * @exclude-docs | ||
| */ | ||
| hiddenProperty?: unknown; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that was a mistake. hiddenProperty was also added to "Item", but in "Item" it's mandatory. Because of that type error, storybook does not startup.
| return argsTableProps; | ||
| }; | ||
|
|
||
| function getCategoryPriority(category: Category) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Priorly, the categories in the ArgTypes table just followed a "random" order.
| collectedConstantsInformation.push(...constantsInformation); | ||
| } | ||
|
|
||
| for (const moduleWithFunctionsOrConstants of modulesWithFunctionsOrConstants) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably the most difficult change to understand.
Priorly, all information on constants and functions have been added as CodeDocDependencies to ALL modules (=files) that contained at least one constant or function with "@include-docs". That does not scale well at all.
Now, all aliases from "@include-docs" within a module are collected and then all grouped constants and functions for only the aliases contained in that file are added as CodeDocDependencies.
No description provided.