From 4bb38ef9ed7142c18ff6014e79a358bef2a86178 Mon Sep 17 00:00:00 2001 From: Huzaifa Iftikhar Date: Fri, 28 Aug 2026 04:05:14 +0500 Subject: [PATCH 01/15] do not migrate a variant literal behind a conditional the shadcn variant guard only looked at the text right before the literal so any ternary or nullish branch between variant and the string defeated it and the upgrade rewrote a react prop value as if it were a class braces and commas stay excluded from the new part so the match cannot run past its own value into a neighbouring prop like className --- .../src/codemods/template/is-safe-migration.test.ts | 13 +++++++++++++ .../src/codemods/template/is-safe-migration.ts | 6 ++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.test.ts b/packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.test.ts index 7cfb16c7597e..92b1eed36181 100644 --- a/packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.test.ts +++ b/packages/@tailwindcss-upgrade/src/codemods/template/is-safe-migration.test.ts @@ -119,6 +119,10 @@ describe('is-safe-migration', async () => { [`function Button({ variant='outline' }) {}`, 'outline'], [`Button({ variant: "outline" })`, 'outline'], [`Button({ variant: 'outline' })`, 'outline'], + [`Button({ variant: isActive ? "outline" : "ghost" })`, 'outline'], + [`