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

Jsdoc annotations #6780

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

blakenetz
Copy link

@blakenetz blakenetz commented Sep 5, 2024

This is a POC for a quick way to add TS annotations to a component's functional declaration. This is intended to increase DX by providing a quick way to link back to the Mantine's docs. If you would like to move forward with this, there's a couple enhancements I would like to make:

  • Make it applicable to other @mantine packages
  • Add a check to make sure file doesn't already contain annotations
  • Iterate through components instead of specifying as an argv

I pulled the description from the Frontmatter data. I'm not sure how valuable this is to a developer, so we can scratch that.

The approach might be a little excessive because I'm reading the content of each file as utf-8 and then splitting and joining by linebreak. I figured since A. this is internal and B. it's a POC this small performance flaw wouldn't be too impactful.

Here's the command I used to run the script:

npx tsx scripts/utils/generate-annotation.ts [COMPONENT NAME]

@blakenetz
Copy link
Author

Hi @rtivital, what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant