Skip to content
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

refactor(api-markdown-documenter): Unify "file-safe-name" helper utilities #23394

Conversation

Josmithr
Copy link
Contributor

Refactors a small collection of utility functions aimed at generating consistent, unique, and file-name-safe identifiers for API items (used for naming files, heading IDs, etc.). Unifies all of the exported functions aimed at providing this functionality into a single one, which also now captures package-name policy (previously duplicated in a few places).

Breaking change: publicly exposed function is now called getFileSafeNameForApiItem

@Josmithr Josmithr requested review from alexvy86, a team and Copilot December 20, 2024 22:43
@github-actions github-actions bot added public api change Changes to a public API base: main PRs targeted against main branch labels Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 9 changed files in this pull request and generated no comments.

Files not reviewed (4)
  • tools/api-markdown-documenter/src/api-item-transforms/ApiItemTransformUtilities.ts: Evaluated as low risk
  • tools/api-markdown-documenter/src/ApiItemUtilitiesModule.ts: Evaluated as low risk
  • tools/api-markdown-documenter/src/api-item-transforms/helpers/Helpers.ts: Evaluated as low risk
  • tools/api-markdown-documenter/src/api-item-transforms/configuration/DocumentationSuite.ts: Evaluated as low risk
* Accounts for method overloads by adding a suffix such as "myMethod_2".
* Converts invalid filename characters to underscores.
*/
function getFileSafeNameForName(apiItemName: string): string {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code that was previously using this helper directly were (incorrectly) not getting the qualified naming for cases like overloads.

Copy link
Contributor

@alexvy86 alexvy86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small thing, lgtm otherwise

Copy link
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  170142 links
    1596 destination URLs
    1825 URLs ignored
       0 warnings
       0 errors


Copy link
Contributor

@alexvy86 alexvy86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@Josmithr Josmithr merged commit ebbb0ff into microsoft:main Dec 20, 2024
36 checks passed
@Josmithr Josmithr deleted the api-markdown-documenter/qualified-name-helper-cleanup branch December 20, 2024 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
base: main PRs targeted against main branch public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants