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

Open
wants to merge 153 commits into
base: main
Choose a base branch
from
Open

Docs Build Script #2041

wants to merge 153 commits into from

Conversation

NWylynko
Copy link
Contributor

@NWylynko NWylynko commented Feb 20, 2025

Things this script does

Validates

  • The manifest structure and its contents
  • Markdown files and their required frontmatter fields:
    • Ensures title is present (required)
    • Warns if description is missing (optional)
    • Validates SDK declarations in frontmatter
  • Validates internal doc links exist
  • Validates hash links point to headings
  • SDK filtering in three contexts:
    1. Manifest: Ensures SDK scoping is properly defined and inherited
    2. Frontmatter: Validates SDK declarations in document metadata
    3. <If /> components: Ensures:
      • Referenced SDKs exist in the manifest
      • SDKs are available in the frontmatter
      • SDK values match the list of valid SDKs
      • Parent group SDK compatibility
  • Unique headings within documents
  • Typedoc content structure and references
  • Validates all embedded content (partials, typedocs) exists and is properly formatted

Transforms

  • Content Integration:
    • Embeds partial content into markdown files
    • Embeds typedoc content where referenced
    • Handles special character encoding in typedoc tables
  • Link Processing:
    • Updates links to SDK-specific docs to use <SDKLink /> components
    • Removes .mdx extensions from doc links
  • SDK-Specific Processing:
    • Generates SDK-specific versions of docs in their respective folders
    • Creates "landing" pages for SDK-specific docs at original URLs
    • Strips out content filtered by SDKs
  • Manifest Processing:
    • Generates processed manifest.json with SDK scoping
    • Applies inheritance rules for SDK scoping in the navigation tree

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 <If /> 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
  • tanstack-react-start.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

Copy link

⚠️ Changes found in the following quickstarts:

  • overview.mdx
  • tanstack-react-start.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

Copy link

⚠️ Changes found in the following quickstarts:

  • overview.mdx
  • tanstack-react-start.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

@NWylynko NWylynko marked this pull request as ready for review April 30, 2025 00:46
@NWylynko NWylynko requested a review from a team as a code owner April 30, 2025 00:46
Copy link

github-actions bot commented May 1, 2025

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

Copy link

github-actions bot commented May 1, 2025

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

Copy link

github-actions bot commented May 1, 2025

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

Copy link

github-actions bot commented May 1, 2025

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

Copy link

github-actions bot commented May 2, 2025

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

---
title: `'<ClerkProvider>'`
description: Lorem ipsum...
+ sdk: nextjs, react
Copy link
Member

Choose a reason for hiding this comment

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

we should list here the list of supported keys

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We already have the list under the <If /> component section, I don't think it makes sense to duplicate it, but maybe move it somewhere relevant to both?

Copy link

github-actions bot commented May 2, 2025

⚠️ Changes found in the following quickstarts:

  • overview.mdx

⚠️ Please update the corresponding quickstarts in the Dashboard

@NWylynko NWylynko requested a review from jescalan May 2, 2025 22:24
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.

3 participants