Skip to content
Merged
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
3 changes: 2 additions & 1 deletion src/utils/application-starter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1340,6 +1340,7 @@ function buildPrompt({

function detectMigrationSource(input: string) {
for (const source of migrationSources) {
if (source === 'next' && !isNextJsMigrationInput(input)) continue
Comment thread
coderabbitai[bot] marked this conversation as resolved.
if (input.toLowerCase().includes(source)) {
return source
}
Expand Down Expand Up @@ -1484,7 +1485,7 @@ export function buildDownloadUrl(recipe: ApplicationStarterRecipe) {
}

const nextJsMigrationPattern =
/migrat(?:e|ing|ion)[\s\S]*\bnext(?:\.?js|\s+(?:app|application|project))\b|\bnext(?:\.?js|\s+(?:app|application|project))\b[\s\S]*migrat(?:e|ing|ion)/i
/migrat(?:e|ing|ion)[\s\S]*\bnext(?:\.?js|\s+(?:app|application|project|site))\b|\bnext(?:\.?js|\s+(?:app|application|project|site))\b[\s\S]*migrat(?:e|ing|ion)/i
const remixMigrationPattern =
/migrat(?:e|ing|ion)[\s\S]*\b(remix|react[\s-]?router)\b|\b(remix|react[\s-]?router)\b[\s\S]*migrat(?:e|ing|ion)/i

Expand Down
26 changes: 26 additions & 0 deletions tests/application-starter-partners.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,3 +586,29 @@ test('migration guides distinguish framework names from timing and accept multil
'https://tanstack.com/router/latest/docs/how-to/migrate-from-react-router',
)
})

test('migration source ignores next week when the source is Remix', async () => {
const result = await resolveApplicationStarterDeterministically({
context: 'home',
input: 'Migrate my Remix app next week to TanStack Start.',
})
assert.ok(result.prompt.startsWith('Migrate remix into a fresh'))
assert.ok(
result.prompt.includes(
'https://tanstack.com/router/latest/docs/how-to/migrate-from-react-router',
),
)
})

test('migration source recognizes a Next site', async () => {
const result = await resolveApplicationStarterDeterministically({
context: 'home',
input: 'Migrate my Next site to TanStack Start.',
})
assert.ok(result.prompt.startsWith('Migrate next into a fresh'))
assert.ok(
result.prompt.includes(
'https://tanstack.com/start/latest/docs/framework/react/migrate-from-next-js',
),
)
})
Loading