-
Notifications
You must be signed in to change notification settings - Fork 381
chore(repo): Improve Typedoc MDX output #5578
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
Conversation
🦋 Changeset detectedLatest commit: 0fb9ede The changes in this PR will be included in the next version bump. This PR includes changesets to release 22 packages
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 |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
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'), |
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.
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
* @param {import('typedoc').SignatureReflection} model | ||
* @param {{ headingLevel: number }} options | ||
*/ | ||
signatureReturns: (model, options) => { |
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 was the same as default again, so I can remove it
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 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...
Description
The changes in this PR are the result of the review of clerk/clerk-docs#2124.
In this PR:
<code>
Fixes ECO-569
Fixes ECO-534
Checklist
pnpm test
runs as expected.pnpm build
runs as expected.Type of change