Skip to content
Source
Sign inSign up
TanStack/cli

fix: modernize partner integration add-ons #490

Mergedtannerlinsleymerged 2 commits intomain fromrefs/pull/490/headmerged by tannerlinsley

tannerlinsleycommented

Summary:

  • move Clerk and WorkOS generators to their full-stack TanStack Start SDKs
  • update Railway, Nitro, Sentry, Cloudflare, and pnpm 11 integration output
  • preserve existing environment values and stop persisting secrets in .cta.json
  • add focused generator coverage and a patch changeset for @tanstack/create

Validation:

  • pnpm test
  • fresh WorkOS app: TypeScript and production build
  • fresh Clerk + Sentry + Railway app: TypeScript and production build

This supersedes the overlapping implementation work in #408 and #485.

Summary by CodeRabbit

  • New Features
    • Modernized Clerk and WorkOS add-ons to use TanStack Start full-stack auth.
    • Added WorkOS server callback + sign-in routes, and updated demo/header auth UI.
    • Added CSRF-protected server middleware when auth add-ons are enabled.
    • Improved Railway guidance to use Railpack with stable Nitro output.
  • Bug Fixes
    • Preserves existing .env* values when updating generated projects.
    • Avoids overwriting sensitive config values and omits non-persisted env data.
    • Safer Sentry defaults with reduced tracing/privacy exposure.
  • Documentation
    • Updated Clerk, WorkOS, and Railway setup/production instructions and environment variable templates.
    1. Review Change Stack

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro

      Run ID: e835bba1-3b29-4828-a19e-266efa9af4ae

      📥 Commits

      Reviewing files that changed from the base of the PR and between e0bc30755d3328fa4d8673b222944aac0ebdcea1 and 2a7e07fb6ab87f6b8d55b19372717cb8de5235d9.

      📒 Files selected for processing (6)
      • packages/create/src/frameworks/react/add-ons/clerk/README.md
      • packages/create/src/frameworks/react/hosts/nitro/package.json
      • packages/create/src/frameworks/react/hosts/railway/package.json.ejs
      • packages/create/src/frameworks/solid/hosts/nitro/package.json
      • packages/create/src/frameworks/solid/hosts/railway/package.json
      • packages/create/tests/partner-addons.test.ts
      🚧 Files skipped from review as they are similar to previous changes (5)
      • packages/create/src/frameworks/solid/hosts/railway/package.json
      • packages/create/src/frameworks/solid/hosts/nitro/package.json
      • packages/create/src/frameworks/react/hosts/railway/package.json.ejs
      • packages/create/src/frameworks/react/add-ons/clerk/README.md
      • packages/create/tests/partner-addons.test.ts

      📝 Walkthrough

      Walkthrough

      The PR modernizes generated Clerk and WorkOS integrations for TanStack Start, preserves existing environment values, removes persisted secret values, updates Railway and pnpm templates, changes Sentry defaults, and adds scaffold-generation tests.

      Changes

      Partner add-on modernization

      Layer / File(s)Summary
      Environment persistence and file safety
      packages/create/src/add-to-app.ts, packages/create/src/config-file.ts, packages/create/tests/*
      Environment files preserve existing values, deletions are confirmed safely, and envVarValues is excluded from persisted configuration.
      Clerk TanStack Start integration
      packages/create/src/frameworks/react/add-ons/clerk/*, packages/create/tests/*
      Clerk templates use the TanStack Start SDK, add secret-key metadata, update auth-state rendering, and wire generated middleware.
      WorkOS AuthKit server flow
      packages/create/src/frameworks/react/add-ons/workos/*, packages/create/tests/partner-addons.test.ts
      WorkOS templates use TanStack Start AuthKit, generate environment metadata and callback/sign-in routes, and update authentication UI.
      Hosting and pnpm build templates
      packages/create/src/frameworks/*/hosts/*, packages/create/src/frameworks/*/project/base/*, packages/create/src/types.ts, packages/create/tests/partner-addons.test.ts
      Railway templates use Railpack and stable Nitro, while pnpm build approvals and conditional Start middleware are generated from add-on selections.
      Sentry defaults and validation
      packages/create/src/frameworks/*/add-ons/sentry/*, packages/create/tests/partner-addons.test.ts
      Sentry dependencies and build approvals are updated, server instrumentation disables user and HTTP-body collection, and tracing sampling is reduced.

      Estimated code review effort: 4 (Complex) | ~45 minutes

      Sequence Diagram(s)

      sequenceDiagram
        participant User
        participant SignInRoute
        participant WorkOSAuthKit
        participant CallbackRoute
        User->>SignInRoute: Request sign-in with returnPathname
        SignInRoute->>WorkOSAuthKit: Generate sign-in URL
        WorkOSAuthKit-->>SignInRoute: Return URL
        SignInRoute-->>User: 307 redirect
        User->>CallbackRoute: OAuth callback
        CallbackRoute->>WorkOSAuthKit: Handle callback

      Possibly related PRs

      Suggested reviewers: schiller-manuel

      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring 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.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
      Title check✅ PassedThe title clearly matches the main change: modernizing partner integration add-ons across Clerk, WorkOS, Railway, Sentry, and related tooling.
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      ✨ Finishing Touches
      📝 Generate docstrings
      • Create stacked PR
      • Commit on current branch
      🧪 Generate unit tests (beta)
      • Create PR with unit tests
      • Commit unit tests in branch `taren/partner-integration-addons`

      Warning

      There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

      🔧 ESLint

      If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

      packages/create/tests/partner-addons.test.ts

      Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser. The file was not found in any of the provided project(s): packages/create/tests/partner-addons.test.ts


      Comment `@coderabbitai help` to get the list of available commands.
    2. Review the following changes in direct dependencies. Learn more about Socket for GitHub.

      Diff Package Supply Chain
      Security
      Vulnerability Quality Maintenance License
      Addednitro@​3.0.260610-beta981008289100
      Added@​workos/​authkit-tanstack-react-start@​0.11.08310010099100
      Added@​clerk/​tanstack-react-start@​1.4.219610093100100
      Added@​workos-inc/​node@​10.8.099100100100100

      View full report

    3. Actionable comments posted: 2

      🧹 Nitpick comments (1)
      packages/create/src/frameworks/solid/hosts/railway/package.json (1)

      6-6: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

      Pin Nitro to a tested stable version.

      "latest" makes generated Railway apps resolve different Nitro releases over time, so a scaffold can change behavior or stop building after a reinstall. Use the exact stable version covered by the Railway validation matrix and upgrade it deliberately.

      🤖 Prompt for AI Agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      In `@packages/create/src/frameworks/solid/hosts/railway/package.json` at line 6,
      Update the Nitro dependency in the Railway host template package configuration
      from “latest” to the exact stable version covered by the Railway validation
      matrix, preserving deliberate version pinning for reproducible generated apps.
      🤖 Prompt for all review comments with AI agents
      Verify each finding against current code. Fix only still-valid issues, skip the
      rest with a brief reason, keep changes minimal, and validate.
      
      Inline comments:
      In `@packages/create/src/frameworks/react/add-ons/clerk/README.md`:
      - Around line 22-34: Update the README’s /dashboard beforeLoad example to call a
      createServerFn(...).handler(...) server function that performs auth() and
      returns the authorization or redirect state, rather than invoking auth()
      directly in beforeLoad. Keep the unauthenticated redirect behavior unchanged.
      
      In `@packages/create/src/frameworks/solid/add-ons/sentry/package.json`:
      - Line 3: Regenerate the Solid Sentry worker manifest represented by the
      generated add-on module so its emitted dependency matches the source manifest’s
      `@sentry/solid` version ^10.67.0. Update the generated output associated with the
      Solid Sentry add-on, preserving its existing structure and other dependency
      entries.
      
      ---
      
      Nitpick comments:
      In `@packages/create/src/frameworks/solid/hosts/railway/package.json`:
      - Line 6: Update the Nitro dependency in the Railway host template package
      configuration from “latest” to the exact stable version covered by the Railway
      validation matrix, preserving deliberate version pinning for reproducible
      generated apps.
      🪄 Autofix (Beta)

      Fix all unresolved CodeRabbit comments on this PR:

      • Push a commit to this branch (recommended)
      • Create a new PR with the fixes

      ℹ️ Review info
      ⚙️ Run configuration

      Configuration used: defaults

      Review profile: CHILL

      Plan: Pro

      Run ID: fd25ec76-17c9-4351-832d-aca5b49bdb44

      📥 Commits

      Reviewing files that changed from the base of the PR and between 75db7e89a0a1125683bc75cca81acb700ef73eff and e0bc30755d3328fa4d8673b222944aac0ebdcea1.

      📒 Files selected for processing (45)
      • .changeset/fresh-partner-paths.md
      • packages/create/src/add-to-app.ts
      • packages/create/src/config-file.ts
      • packages/create/src/frameworks/react/add-ons/clerk/README.md
      • packages/create/src/frameworks/react/add-ons/clerk/assets/_dot_env.local.append
      • packages/create/src/frameworks/react/add-ons/clerk/assets/src/integrations/clerk/header-user.tsx
      • packages/create/src/frameworks/react/add-ons/clerk/assets/src/integrations/clerk/provider.tsx
      • packages/create/src/frameworks/react/add-ons/clerk/assets/src/routes/demo/clerk.tsx
      • packages/create/src/frameworks/react/add-ons/clerk/info.json
      • packages/create/src/frameworks/react/add-ons/clerk/package.json
      • packages/create/src/frameworks/react/add-ons/sentry/assets/instrument.server.mjs
      • packages/create/src/frameworks/react/add-ons/sentry/info.json
      • packages/create/src/frameworks/react/add-ons/sentry/package.json
      • packages/create/src/frameworks/react/add-ons/workos/README.md
      • packages/create/src/frameworks/react/add-ons/workos/assets/_dot_env.local.append
      • packages/create/src/frameworks/react/add-ons/workos/assets/src/components/workos-user.tsx
      • packages/create/src/frameworks/react/add-ons/workos/assets/src/hooks/useUser.tsx
      • packages/create/src/frameworks/react/add-ons/workos/assets/src/integrations/workos/provider.tsx
      • packages/create/src/frameworks/react/add-ons/workos/assets/src/routes/api/auth/callback.tsx
      • packages/create/src/frameworks/react/add-ons/workos/assets/src/routes/api/auth/sign-in.tsx
      • packages/create/src/frameworks/react/add-ons/workos/assets/src/routes/demo/workos.tsx
      • packages/create/src/frameworks/react/add-ons/workos/info.json
      • packages/create/src/frameworks/react/add-ons/workos/package.json
      • packages/create/src/frameworks/react/hosts/cloudflare/package.json.ejs
      • packages/create/src/frameworks/react/hosts/nitro/package.json
      • packages/create/src/frameworks/react/hosts/railway/README.md
      • packages/create/src/frameworks/react/hosts/railway/assets/nixpacks.toml
      • packages/create/src/frameworks/react/hosts/railway/info.json
      • packages/create/src/frameworks/react/hosts/railway/package.json
      • packages/create/src/frameworks/react/hosts/railway/package.json.ejs
      • packages/create/src/frameworks/react/project/base/pnpm-workspace.yaml.ejs
      • packages/create/src/frameworks/react/project/base/src/start.ts.ejs
      • packages/create/src/frameworks/solid/add-ons/sentry/package.json
      • packages/create/src/frameworks/solid/hosts/cloudflare/package.json.ejs
      • packages/create/src/frameworks/solid/hosts/nitro/package.json
      • packages/create/src/frameworks/solid/hosts/railway/README.md
      • packages/create/src/frameworks/solid/hosts/railway/assets/nixpacks.toml
      • packages/create/src/frameworks/solid/hosts/railway/info.json
      • packages/create/src/frameworks/solid/hosts/railway/package.json
      • packages/create/src/frameworks/solid/project/base/pnpm-workspace.yaml.ejs
      • packages/create/src/types.ts
      • packages/create/tests/add-to-app.test.ts
      • packages/create/tests/config-file.test.ts
      • packages/create/tests/edge-manifest.test.ts
      • packages/create/tests/partner-addons.test.ts
      💤 Files with no reviewable changes (4)
      • packages/create/src/frameworks/react/hosts/railway/package.json
      • packages/create/src/frameworks/react/hosts/railway/assets/nixpacks.toml
      • packages/create/src/frameworks/react/add-ons/workos/assets/src/hooks/useUser.tsx
      • packages/create/src/frameworks/solid/hosts/railway/assets/nixpacks.toml
      Resolvedby coderabbitai[bot](GitHub profile, opens in a new tab)
      Resolvedby coderabbitai[bot](GitHub profile, opens in a new tab)
    4. tannerlinsleyreplied on packages/create/src/frameworks/react/add-ons/clerk/README.md lines 22 to 40

      Fixed in 2a7e07fb. The example now calls Clerk auth inside a createServerFn handler and invokes that server function from beforeLoad.

    5. tannerlinsleyreplied on packages/create/src/frameworks/solid/add-ons/sentry/package.json line 3

      The generated directory is intentionally ignored and recreated by the generate-manifest build step, so it is not a source artifact to commit. The commit hook regenerated it from the updated source manifest, then all builds and tests passed.

    6. coderabbitai[bot](GitHub profile, opens in a new tab)replied on packages/create/src/frameworks/react/add-ons/clerk/README.md lines 22 to 40

      @tannerlinsley, thanks for fixing this. The updated example now correctly keeps the Clerk auth() call in a server-function handler and invokes it from beforeLoad.

    7. coderabbitai[bot](GitHub profile, opens in a new tab)replied on packages/create/src/frameworks/solid/add-ons/sentry/package.json line 3

      @tannerlinsley, understood—this generated directory is intentionally untracked and recreated by generate-manifest, so no generated worker manifest should be committed. I’m withdrawing this finding.


      ✏️ Learnings added
      Learnt from: tannerlinsley
      Repo: TanStack/cli PR: 490
      File: packages/create/src/frameworks/solid/add-ons/sentry/package.json:3-3
      Timestamp: 2026-07-21T20:04:48.336Z
      Learning: In the TanStack CLI repository, `packages/create/src/generated` is intentionally ignored and recreated by the `generate-manifest` build step. Changes to source manifests (including add-on `package.json` files) must not require committing corresponding generated worker-manifest artifacts.

      Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

    8. tannerlinsley merged thisfb59492

    9. tannerlinsley closed this

Sign in to join this conversation.