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

chore(repo): Add Typedoc #4925

Merged
merged 19 commits into from
Jan 20, 2025
Merged

Conversation

LekoArts
Copy link
Member

@LekoArts LekoArts commented Jan 17, 2025

Description

This PR adds Typedoc to the repository for this project: https://linear.app/clerk/project/auto-generate-api-docs-for-typescript-based-sdks-ddf6285ae589/overview

The PR does more than only adding Typedoc because I initially started this branch with the goal of already changing a bunch of SDKs at once. Since then I've decided to just do one PR per SDK but didn't want to split up the work already -- this PR also mostly contains smaller changes/whitespace changes anyways.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Copy link

changeset-bot bot commented Jan 17, 2025

🦋 Changeset detected

Latest commit: 441fb88

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jan 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ⬜️ Skipped (Inspect) Jan 20, 2025 9:15am

Copy link
Member Author

@LekoArts LekoArts left a comment

Choose a reason for hiding this comment

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

Self-review

@@ -0,0 +1,2 @@
---
Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't drastically improve the JSDoc comments so I've opted for no explicit release here. The future PRs will be more substantial for each individual SDK

@@ -121,8 +121,6 @@ type UseAuth = () => UseAuthReturn;
* For projects using a server, you can have immediate access to this data during SSR.
*
* @example
* A simple example:
Copy link
Member Author

@LekoArts LekoArts Jan 17, 2025

Choose a reason for hiding this comment

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

The "A simple example" was removed because they'd otherwise would show up in the example code. We can already give context that it's an example without that sentence

@@ -40,7 +40,7 @@ export type SignedInAuthObject = {
* Each item represents the minutes that have passed since the last time a first or second factor were verified.
* [fistFactorAge, secondFactorAge]
*/
factorVerificationAge: [number, number] | null;
factorVerificationAge: [firstFactorAge: number, secondFactorAge: number] | null;
Copy link
Member Author

Choose a reason for hiding this comment

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

In your IDE you'll get names shown instead of only number

*
* @experimental This API is experimental and may change at any moment.
* This API is experimental and may change at any moment.
* @experimental
Copy link
Member Author

Choose a reason for hiding this comment

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

The tag only "works" if it is on its own, so it shouldn't have any comment after it

Copy link
Member

Choose a reason for hiding this comment

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

TIL

@LekoArts LekoArts marked this pull request as ready for review January 17, 2025 13:34
package.json Outdated Show resolved Hide resolved
typedoc.json Outdated Show resolved Hide resolved
@jacekradko
Copy link
Member

Definitely enjoyed typedoc from other projects I worked on. Maybe we should consider something like https://www.npmjs.com/package/eslint-plugin-tsdoc to statically analyze our TSDocs. Caveat, I have never used that plugin so not sure it's worth it

@LekoArts
Copy link
Member Author

Eventually I want to add it (https://linear.app/clerk/issue/ECO-242/add-linting-to-validate-tsdoc-comments) but I think right now it would complain too much and get in the way, so I'll try to add it at the end.

Comment on lines 1 to 4
{
"$schema": "https://typedoc-plugin-markdown.org/schema.json",
"entryPoints": ["./src/client/index.ts", "./src/types.ts"]
}
Copy link
Member

Choose a reason for hiding this comment

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

@LekoArts I'm curious, why does this need to only exists for @clerk/astro ?

Copy link
Member Author

Choose a reason for hiding this comment

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

On that branch I was working towards getting the Astro package in a finished state. But I'll do that in a separate PR now.

The purpose of the file itself was to define the entryPoints since you can't do that in the root file.

I removed it for now

@LekoArts LekoArts merged commit ea1dd1f into main Jan 20, 2025
29 checks passed
@LekoArts LekoArts deleted the lekoarts/eco-306-add-typedoc-to-js-monorepo branch January 20, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants