Skip to content

Docs Build Script #2041

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

Draft
wants to merge 128 commits into
base: main
Choose a base branch
from
Draft

Docs Build Script #2041

wants to merge 128 commits into from

Conversation

NWylynko
Copy link
Contributor

@NWylynko NWylynko commented Feb 20, 2025

Things this script does

Validates

  • The manifest
  • 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:

  1. 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
  2. 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
  3. 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.

…<SignIn /> component regardless of if they have an example
Copy link

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

Copy link

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

Copy link

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

Copy link

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

Copy link

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

1 similar comment
Copy link

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

Copy link

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

Copy link

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

Copy link

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

Copy link

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

Copy link

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

@clerk clerk deleted a comment from github-actions bot Apr 25, 2025
@clerk clerk deleted a comment from github-actions bot Apr 25, 2025
Copy link

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

Copy link

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

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.

2 participants