From b16444fc3ac17b6508167c2773cacab625f5cc7e Mon Sep 17 00:00:00 2001 From: Philipp Spiess Date: Fri, 27 Sep 2024 17:22:00 +0200 Subject: [PATCH] Add the bg-gradient migration to the default list of template migrations (#14538) Quick follow-up from #14537 as I forgot to add the new migration to the default list of migrations. --- integrations/upgrade/index.test.ts | 4 ++-- packages/@tailwindcss-upgrade/src/template/migrate.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/integrations/upgrade/index.test.ts b/integrations/upgrade/index.test.ts index aa2e344ee..6393fbaa8 100644 --- a/integrations/upgrade/index.test.ts +++ b/integrations/upgrade/index.test.ts @@ -19,7 +19,7 @@ test( `, 'src/index.html': html`

🤠👋

-
+
`, 'src/input.css': css` @tailwind base; @@ -35,7 +35,7 @@ test( 'src/index.html', html`

🤠👋

-
+
`, ) diff --git a/packages/@tailwindcss-upgrade/src/template/migrate.ts b/packages/@tailwindcss-upgrade/src/template/migrate.ts index c46be2afa..f1228cc81 100644 --- a/packages/@tailwindcss-upgrade/src/template/migrate.ts +++ b/packages/@tailwindcss-upgrade/src/template/migrate.ts @@ -3,6 +3,7 @@ import path from 'node:path' import type { Candidate } from '../../../tailwindcss/src/candidate' import type { DesignSystem } from '../../../tailwindcss/src/design-system' import { extractCandidates, printCandidate, replaceCandidateInContent } from './candidates' +import { bgGradient } from './codemods/bg-gradient' import { migrateImportant } from './codemods/migrate-important' export type Migration = (candidate: Candidate) => Candidate | null @@ -10,7 +11,7 @@ export type Migration = (candidate: Candidate) => Candidate | null export default async function migrateContents( designSystem: DesignSystem, contents: string, - migrations: Migration[] = [migrateImportant], + migrations: Migration[] = [migrateImportant, bgGradient], ): Promise { let candidates = await extractCandidates(designSystem, contents)