Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/components/application-builder/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,15 @@ export type StarterPartnerButtonStyle = CSSProperties & {

const nextJsMigrationPattern =
/migrat(?:e|ing|ion).*(next(?:\.js)?)|(next(?:\.js)?).*(migrat(?:e|ing|ion))/i
const remixMigrationPattern =
/migrat(?:e|ing|ion).*(remix|react[\s-]?router)|(remix|react[\s-]?router).*(migrat(?:e|ing|ion))/i
const migrationRepositoryUrlPattern = /^(https?:\/\/\S+|git@\S+|ssh:\/\/\S+)$/i

export const STARTER_NEXTJS_MIGRATION_GUIDE_URL =
'https://tanstack.com/start/latest/docs/framework/react/migrate-from-next-js'
export const STARTER_REMIX_MIGRATION_GUIDE_URL =
'https://tanstack.com/router/latest/docs/guide/how-to/migrate-from-react-router'
Comment on lines +61 to +62
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify both URL variants and compare status/location.
set -euo pipefail

for u in \
  "https://tanstack.com/router/latest/docs/guide/how-to/migrate-from-react-router" \
  "https://tanstack.com/router/latest/docs/how-to/migrate-from-react-router"
do
  echo "=== $u ==="
  curl -sSIL "$u" | sed -n '1,8p'
  echo
done

Repository: TanStack/tanstack.com

Length of output: 849


🏁 Script executed:

#!/bin/bash
# Verify the URL constant exists in shared.ts
echo "=== Checking src/components/application-builder/shared.ts ==="
if [ -f "src/components/application-builder/shared.ts" ]; then
  sed -n '60,65p' "src/components/application-builder/shared.ts"
else
  echo "File not found. Searching for it..."
  find . -name "shared.ts" -type f 2>/dev/null | head -5
fi

Repository: TanStack/tanstack.com

Length of output: 391


🏁 Script executed:

#!/bin/bash
# Verify the URL usage in application-starter.server.ts
echo "=== Checking src/utils/application-starter.server.ts ==="
if [ -f "src/utils/application-starter.server.ts" ]; then
  sed -n '405,415p' "src/utils/application-starter.server.ts"
else
  echo "File not found. Searching for it..."
  find . -name "application-starter.server.ts" -type f 2>/dev/null | head -5
fi

Repository: TanStack/tanstack.com

Length of output: 869


🏁 Script executed:

#!/bin/bash
# Search for STARTER_REMIX_MIGRATION_GUIDE_URL in the codebase
echo "=== Searching for STARTER_REMIX_MIGRATION_GUIDE_URL ==="
rg "STARTER_REMIX_MIGRATION_GUIDE_URL" --max-count 10

Repository: TanStack/tanstack.com

Length of output: 304


Fix the Remix migration guide URL path.

The URL in src/components/application-builder/shared.ts (line 62) uses a stale path (/docs/guide/how-to/...). The current TanStack Router migration doc path is under /docs/how-to/.... The current URL returns HTTP 500 error, while the correct path returns HTTP 200. This broken URL is used to generate instructions for agents in src/utils/application-starter.server.ts, directing them to an invalid page.

🔧 Proposed fix
 export const STARTER_REMIX_MIGRATION_GUIDE_URL =
-  'https://tanstack.com/router/latest/docs/guide/how-to/migrate-from-react-router'
+  'https://tanstack.com/router/latest/docs/how-to/migrate-from-react-router'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const STARTER_REMIX_MIGRATION_GUIDE_URL =
'https://tanstack.com/router/latest/docs/guide/how-to/migrate-from-react-router'
export const STARTER_REMIX_MIGRATION_GUIDE_URL =
'https://tanstack.com/router/latest/docs/how-to/migrate-from-react-router'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/application-builder/shared.ts` around lines 61 - 62, Update
the constant STARTER_REMIX_MIGRATION_GUIDE_URL in shared.ts to point to the
correct TanStack Router migration doc path by replacing the stale
'/docs/guide/how-to/migrate-from-react-router' segment with
'/docs/how-to/migrate-from-react-router'; ensure any code that references
STARTER_REMIX_MIGRATION_GUIDE_URL (e.g., application-starter.server.ts) will now
generate agent instructions that link to the valid URL returning HTTP 200.


export const starterPinnedLibraryIds = [
'start',
'router',
Expand Down Expand Up @@ -142,6 +149,22 @@ export function isNextJsMigrationInput(input: string) {
return nextJsMigrationPattern.test(input)
}

export function isRemixMigrationInput(input: string) {
return remixMigrationPattern.test(input)
}

export function getStarterMigrationGuideUrl(input: string) {
if (isNextJsMigrationInput(input)) {
return STARTER_NEXTJS_MIGRATION_GUIDE_URL
}

if (isRemixMigrationInput(input)) {
return STARTER_REMIX_MIGRATION_GUIDE_URL
}

return null
}

export function normalizeMigrationRepositoryUrl(value: string) {
return value.trim()
}
Expand Down
10 changes: 9 additions & 1 deletion src/utils/application-starter.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ import {
type ApplicationStarterResult,
} from '~/utils/application-starter'
import type { LibraryId } from '~/libraries'
import { starterAddonLibraryIds } from '~/components/application-builder/shared'
import {
getStarterMigrationGuideUrl,
starterAddonLibraryIds,
} from '~/components/application-builder/shared'
import {
getApplicationStarterGuidanceLines,
getApplicationStarterPartnerSuggestions,
Expand Down Expand Up @@ -400,6 +403,10 @@ function buildPromptGenerationRequest({
].join('\n')
const userBrief = getApplicationStarterUserBrief(request.input)
const starterGuidanceLines = getApplicationStarterGuidanceLines(request.input)
const migrationGuideUrl = getStarterMigrationGuideUrl(request.input)
const migrationGuideInstruction = migrationGuideUrl
? `The prompt must instruct the agent to fetch ${migrationGuideUrl} and use it as the primary reference for the migration, following its steps in order.`
: null

return [
'Write a short, natural final prompt for a stronger coding agent.',
Expand All @@ -417,6 +424,7 @@ function buildPromptGenerationRequest({
'If the user says things like make it cool, keep it minimal, or do not include something, restate those instructions explicitly in the final prompt instead of compressing them away.',
'Use the resolved starter plan as fixed input. Do not redesign the stack unless the original brief requires sequencing work after scaffolding.',
'Keep the prompt concise and plain-English. Avoid internal process language like fixed input, resolved plan, objective, implementation notes, or deliverable.',
...(migrationGuideInstruction ? [migrationGuideInstruction] : []),
'',
`Context: ${request.context}`,
`User request: ${userBrief}`,
Expand Down
Loading