Skip to content

Commit a317e5d

Browse files
committed
fix: update STACK_FALLBACK to 'unsupported' and enhance stack detection logic
1 parent d7e9d84 commit a317e5d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

data/stacks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@
108108
}
109109
]
110110
}
111-
]
111+
]

lib/scan-to-wizard.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { RepoScanSummary } from "@/types/repo-scan"
55
import type { LoadedConvention } from "@/types/conventions"
66
import type { WizardResponses } from "@/types/wizard"
77

8-
const STACK_FALLBACK = "react"
8+
const STACK_FALLBACK = "unsupported"
99

1010
const toLowerArray = (values: string[] | undefined | null) =>
1111
Array.isArray(values) ? values.map((value) => value.toLowerCase()) : []
@@ -49,6 +49,7 @@ const applyDetectedValue = <Key extends keyof WizardResponses>(
4949
const detectStack = (scan: RepoScanSummary): string => {
5050
const frameworks = toLowerArray(scan.frameworks)
5151
const languages = toLowerArray(scan.languages)
52+
const primaryLanguage = scan.language ? scan.language.trim().toLowerCase() : null
5253

5354
if (frameworks.some((name) => /next\.?js/.test(name))) return "nextjs"
5455
if (frameworks.includes("nuxt")) return "nuxt"
@@ -59,6 +60,8 @@ const detectStack = (scan: RepoScanSummary): string => {
5960
if (frameworks.includes("svelte")) return "svelte"
6061
if (frameworks.includes("react")) return "react"
6162
if (languages.includes("python")) return "python"
63+
64+
// No known framework detected; mark as unsupported instead of falling back
6265
return STACK_FALLBACK
6366
}
6467

0 commit comments

Comments
 (0)