tailwindcss/packages/@tailwindcss-upgrade/src
Philipp Spiess 317cf089b9
Upgrade: Migrate prefixed group and peer classes (#15208)
Resolves #15193

This PR fixes an issue where `group` and `peer` would not have their
prefixes migrated as part of the upgrade script. We do this by
registering `group` and `peer` as utilities during the codemods. This
way, `parseCandidate` will find these classes to be valid Tailwind
candidates and the prefix can be migrated just like any other utility.

## Test Plan

Tried it with the v3 upgrade playground in the repo and it worked fine: 

<img width="1257" alt="Screenshot 2024-11-27 at 12 17 25"
src="https://github.com/user-attachments/assets/1ee101e1-1d6a-4ce0-b0d4-8d51e5f6b0d2">

I've also added tests to our prefix upgrade integration test and the
prefix migration unit tests.
2024-11-27 11:34:27 -05:00
..
codemods Always add layer(…) as the first param to @import (#15102) 2024-11-22 14:09:26 +00:00
commands/help Add initial codemod tooling (#14434) 2024-09-18 16:45:43 +02:00
template Upgrade: Migrate prefixed group and peer classes (#15208) 2024-11-27 11:34:27 -05:00
utils Use resolveJsId when resolving tailwindcss/package.json (#15041) 2024-11-19 18:39:49 +01:00
index.test.ts Revert new default form styles (#15100) 2024-11-22 08:55:05 -05:00
index.ts Upgrade: Error when project is already using Tailwind CSS v4 (#15015) 2024-11-19 15:53:02 +01:00
migrate-js-config.ts Convert opacity keys to percentage values (#15067) 2024-11-21 19:06:58 +01:00
migrate-postcss.ts Improve PostCSS migration (#15046) 2024-11-19 22:56:29 +01:00
migrate-prettier.ts Improve robustness when upgrading (#15038) 2024-11-19 14:29:51 +01:00
migrate.ts Add color to form reset snippet (#15064) 2024-11-21 16:14:52 +01:00
stylesheet.ts Resolve imports from CSS file (#15010) 2024-11-15 22:06:52 +01:00