How Detection Scores Adapters
Detection runs every registered adapter's detect against your project directory, concurrently. Each returns a number. Adapters scoring zero are discarded, the rest are ranked, and the highest one resolves the project. You never have to know this to use the kit — pin framework if the wrong adapter is chosen. It is here for the case where you want to know why a particular one won.
The Signals
Scores are not percentages. They are sums of signals, and each adapter has its own ceiling:
| Adapter | Signals it adds up | Highest reachable |
|---|---|---|
generic | localeDirs and defaultLocale both declared in your project config — a flat 10, or 0 | 10 |
react | next (5) or react + react-dom (3); an i18n dependency (+2); a next.config alongside next (+1); a probed locale directory holding JSON (+2) | 10 |
vue | vue present (2); vue-i18n (+3); a probed locale directory holding JSON (+2) | 7 |
laravel | artisan (+2); laravel/framework in composer.json (+2); a lang/ directory with locale content (+1) | 5 |
nuxt | A Nuxt config mentioning i18n, or child Nuxt apps that do (2); a Nuxt config without either (1) | 2 |
Overlapping Frameworks Rule Each Other Out
Nuxt's ceiling of 2 never costs it a project, because the adapters that could outscore it exclude themselves first: the Vue adapter scores 0 when nuxt or @nuxt/kit is a dependency or a nuxt.config.{ts,js,mjs} exists, and the React adapter scores 0 on the same Nuxt signals plus vue. The numbers only ever compare adapters that could both be right.
Equal scores are broken by registration order, which is nuxt, laravel, generic, vue, react. The one tie that can actually happen — a Next.js project with every signal present, against a generic scoring its flat 10 — resolves to generic, so a declared localeDirs and defaultLocale still wins.
Failure Cases
If an adapter throws while detecting, the failure is logged as a warning and that adapter scores 0 — one broken package.json does not take the whole run down. If no adapter scores above zero, the command fails with an error naming the directory and listing the registered adapters.