You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The markdown files contents (including required frontmatter fields)
Links (including hashes) between docs are valid and point to existing headings
The sdk filtering in the manifest
The sdk filtering in the frontmatter
The sdk filtering in the <If /> component
Checks that the sdk is available in the manifest
Checks that the sdk is available in the frontmatter
Validates sdk values against the list of valid SDKs
URL encoding (prevents browser encoding issues)
File existence for both docs and partials
Path conflicts (prevents SDK name conflicts in paths)
Transforms
Embeds the partials in the markdown files
Updates the links in the content if they point to the sdk specific docs
Converts links to SDK-specific docs to use <SDKLink /> components
Copies over "core" docs to the dist folder
Generates "landing" pages for the sdk specific docs at the original url
Generates out the sdk specific docs to their respective folders
Stripping filtered out content based on SDK
Removes .mdx from the end of docs markdown links
Adds canonical links in frontmatter for SDK-specific docs
This is run on every push in a github action to help lint for authors and to build the dist package for clerk.com to use.
Authors can run npm run build locally to use it
This is all to enable sdk based filtering at a fine-grained control. The goal is:
Starting from the top:
the "sdk" key value pair in the manifest.json file
By setting the sdk key on a group of guides, it hides that group when a user is using a different sdk
the "sdk" key value pair in the frontmatter of a guide
This controls which sdks a specific guide is available to
If this is left unset, it will show up for all sdks
If the guide sits within a filtered group of the manifest but attempts to use a different sdk, it will throw an error
The component
This allows showing parts of the guide to a subset of sdks
If this guide is being filtered by 1 or 2, this will error if you attempt to use a sdk outside of the filter
There is no requirement to use filter 3 to use 2 or using 1 to use 3, all three should be optional tools to achieve the docs we are aiming for. But the filtering down should follow a logical order.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Things this script does
Validates
<If />
componentTransforms
<SDKLink />
components.mdx
from the end of docs markdown linksThis is run on every push in a github action to help lint for authors and to build the dist package for clerk.com to use.
Authors can run
npm run build
locally to use itThis is all to enable sdk based filtering at a fine-grained control. The goal is:
Starting from the top:
the "sdk" key value pair in the manifest.json file
the "sdk" key value pair in the frontmatter of a guide
The component
There is no requirement to use filter 3 to use 2 or using 1 to use 3, all three should be optional tools to achieve the docs we are aiming for. But the filtering down should follow a logical order.