Skip to content

Conversation

LekoArts
Copy link
Contributor

@LekoArts LekoArts commented Apr 10, 2025

Description

The changes in this PR are the result of the review of clerk/clerk-docs#2124.

In this PR:

  • The file structure of the Typedoc output is flattened to only have top-level folders. No sub folders.
  • Added two more link replacements
  • Adjusted the link replacement regex to account for anchors and direct links (without relative paths). Also limit the search for the pattern inside a string to its constraints
  • Add upstream changes from the markdown plugin
  • Update markdown and typedoc packages
  • Ensure that everything is wrapped inside a single <code>
  • Adjust JSDoc comments

Fixes ECO-569
Fixes ECO-534

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 Apr 10, 2025

🦋 Changeset detected

Latest commit: 0fb9ede

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

This PR includes changesets to release 22 packages
Name Type
@clerk/shared Patch
@clerk/clerk-react Patch
@clerk/types Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/chrome-extension Patch
@clerk/clerk-js Patch
@clerk/elements Patch
@clerk/expo-passkeys Patch
@clerk/clerk-expo Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/remix Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/vue Patch
@clerk/localizations Patch
@clerk/themes Patch

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 Apr 10, 2025

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

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 11, 2025 9:23am

Copy link
Contributor 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

pattern: new RegExp(`\\((?:\\.{1,2}\\/)+.*?${fileName}\\.mdx\\)`, 'g'),
replace: `(${newPath})`,
// Match both path and optional anchor
pattern: new RegExp(`\\((?:(?:\\.{1,2}\\/)+[^()]*?|)${fileName}\\.mdx(#[^)]+)?\\)`, 'g'),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new regex accounts for two bugs I saw:

  • A string contained multiple []() and previously it replaced parts outside of that link (until the next occurence)
  • [foo](bar.mdx) and [foo](bar.mdx#test) didn't work

@LekoArts LekoArts changed the title wip chore(repo): Improve Typedoc MDX output Apr 10, 2025
* @param {import('typedoc').SignatureReflection} model
* @param {{ headingLevel: number }} options
*/
signatureReturns: (model, options) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the same as default again, so I can remove it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I changed the approach to this file completely. Instead of copy/pasting the source and overriding individual parts, I modify the input and output of the default functions to not have to change the inner workings. And to keep it up to date...

@LekoArts LekoArts marked this pull request as ready for review April 10, 2025 13:35
@LekoArts LekoArts merged commit 48438b4 into main Apr 11, 2025
30 checks passed
@LekoArts LekoArts deleted the lekoarts/eco-534-first-review-pass branch April 11, 2025 09:42
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.

3 participants