Skip to content

feat(upgrade): improve generate-guide script for clerk-docs#7454

Merged
jacekradko merged 3 commits into
mainfrom
feat/improve-guide-generation
Feb 5, 2026
Merged

feat(upgrade): improve generate-guide script for clerk-docs#7454
jacekradko merged 3 commits into
mainfrom
feat/improve-guide-generation

Conversation

@jacekradko
Copy link
Copy Markdown
Member

@jacekradko jacekradko commented Dec 14, 2025

Summary

Improves the upgrade guide generation script with better multi-SDK support, expanded category handling, and optimized file output.

Changes

  • Multi-SDK generation: Can now generate guides for all SDKs at once when --sdk is omitted
  • Output directory support: New --output-dir flag writes files directly to a directory instead of stdout
  • Frontmatter generation: Generates proper MDX frontmatter with title and description
  • Accordion components: Breaking changes now render using <Accordion> components for better UX
  • SDK display names: Human-readable SDK names (e.g., "Next.js" instead of "nextjs")
  • Sorted output: Changes and files are sorted alphabetically for consistency
  • Expanded categories: Added support for behavior-change, deprecation, and version categories

Usage

# Generate guide for a single SDK (stdout)
pnpm run generate-guide --version=core-3 --sdk=nextjs

# Generate guides for all SDKs to a directory
pnpm run generate-guide --version=core-3 --output-dir=./guides

Example Output

Click to expand sample MDX output
---
title: "Upgrading to Clerk Core 3"
description: "Learn how to upgrade to Clerk Core 3 across all SDKs."
---

{/* WARNING: This file is generated. To update its contents, see the "upgrade" package in the clerk/javascript repo. */}

## Overview

Core 3 focuses on consistency and cleanup across Clerk's SDKs while keeping upgrade time short (usually under 30 minutes with the CLI).

- **Naming consistency:** `__unstable_*` APIs move to `__internal_*`, and experimental methods share the `__experimental_` prefix.
- **Package renaming:** `@clerk/clerk-react` becomes `@clerk/react`, `@clerk/clerk-expo` becomes `@clerk/expo`, `createTheme` moves to `@clerk/ui/themes/experimental`, and types consolidate under `@clerk/shared/types`.
- **Appearance updates:** `appearance.layout` is now `appearance.options`, `showOptionalFields` defaults to `false`, and color variables apply at full opacity.
- **Behavior alignment:** redirect props and legacy billing flags are removed in favor of the newer patterns.
- **Platform requirements:** Node.js 20.9.0+ is required across the updated packages.

Use `npx @clerk/upgrade` to scan your project and speed up the migration.

## Breaking changes

The following breaking changes apply to all Clerk SDKs.

<Accordion
  titles={[
    "<code>__unstable_*</code> methods renamed to <code>__internal_*</code>",
    "<code>appearance.layout</code> renamed to <code>appearance.options</code>",
    "<code>colorRing</code> and <code>colorModalBackdrop</code> now render at full opacity",
    ...
  ]}
>
  <AccordionPanel>
    All `__unstable_*` methods have been renamed to `__internal_*`. These are internal APIs not intended for public use.

    ### @clerk/clerk-js {{ toc: false }}

    - `__unstable__environment``__internal_environment`
    - `__unstable__updateProps``__internal_updateProps`
    - `__unstable__setEnvironment``__internal_setEnvironment`
    ...
  </AccordionPanel>

  <AccordionPanel>
    The `appearance.layout` property has been renamed to `appearance.options`. Update all instances in your codebase:

    ```diff
    <ClerkProvider
      appearance={{
    -   layout: {
    +   options: {
          socialButtonsPlacement: 'bottom',
          socialButtonsVariant: 'iconButton',
        }
      }}
    >
    ```
  </AccordionPanel>
  ...
</Accordion>

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:

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Dec 14, 2025

🦋 Changeset detected

Latest commit: 781a025

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

This PR includes changesets to release 1 package
Name Type
@clerk/upgrade 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

@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Feb 3, 2026 5:53pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Dec 14, 2025

📝 Walkthrough

Walkthrough

Updated the guide generation script to support multi-SDK output and MDX-compatible front matter. Added SDK normalization and display-name mapping, new CLI flags (--sdk, --output-dir), deterministic sorting of file lists, and new category labels (behavior-change, deprecation, version) with a safe fallback. Introduced per-SDK guide generation and file-writing helpers, accordion-style rendering for grouped changes, and more robust title sorting and indentation handling. Script now errors when multiple SDKs are requested without an output directory and skips SDKs with no changes.

🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ❓ Inconclusive The linked issue 'CORE-3: Something you probably wontfix' contains only a placeholder description 'We did this on purpose ya dingus' with no specific coding requirements. Provide a linked issue with clear, specific coding requirements and objectives to validate against the implementation.
✅ Passed checks (3 passed)
Check name Status Explanation
Out of Scope Changes check ✅ Passed All changes are directly related to improving the upgrade guide generation script with multi-SDK support, new flags, and enhanced rendering—all within the stated PR objectives.
Title check ✅ Passed The title clearly summarizes the main change: improving the generate-guide script for clerk-docs with multi-SDK support and enhanced output capabilities.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jan 24, 2026

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@7454

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@7454

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@7454

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@7454

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@7454

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@7454

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@7454

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@7454

@clerk/express

npm i https://pkg.pr.new/@clerk/express@7454

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@7454

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@7454

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@7454

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@7454

@clerk/react

npm i https://pkg.pr.new/@clerk/react@7454

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@7454

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@7454

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@7454

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@7454

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@7454

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@7454

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@7454

commit: 781a025

@jacekradko jacekradko changed the title feat: improve guides feat(upgrade): improve guides Jan 28, 2026
@jacekradko jacekradko changed the title feat(upgrade): improve guides feat(upgrade): improve Core 3 guides Jan 28, 2026
- Support generating guides for all SDKs at once with --output-dir
- Output MDX format with frontmatter compatible with clerk-docs
- Add Accordion component rendering for breaking changes
- Add display names for SDKs
- Sort changes alphabetically within categories
- Add support for additional categories (deprecation, version, behavior-change)
@jacekradko jacekradko force-pushed the feat/improve-guide-generation branch from f694f27 to 204bbe5 Compare January 28, 2026 01:30
@jacekradko jacekradko changed the title feat(upgrade): improve Core 3 guides feat(upgrade): improve generate-guide script for clerk-docs Jan 28, 2026
Copy link
Copy Markdown
Member

@brkalow brkalow left a comment

Choose a reason for hiding this comment

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

lgtm!

@jacekradko jacekradko merged commit d4057db into main Feb 5, 2026
39 of 40 checks passed
@jacekradko jacekradko deleted the feat/improve-guide-generation branch February 5, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants