tailwindcss/packages/@tailwindcss-upgrade/src/template
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 Upgrade: Migrate prefixed group and peer classes (#15208) 2024-11-27 11:34:27 -05:00
candidates.test.ts Re-introduce automatic var injection shorthand (#15020) 2024-11-18 15:47:48 +01:00
candidates.ts Re-introduce automatic var injection shorthand (#15020) 2024-11-18 15:47:48 +01:00
is-safe-migration.ts Do not migrate legacy classes with custom values (#14976) 2024-11-14 11:31:05 +01:00
migrate.ts Disallow empty arbitrary values (#15055) 2024-11-21 13:47:13 +01:00
prepare-config.ts Improve robustness when upgrading (#15038) 2024-11-19 14:29:51 +01:00
splice-changes-into-string.ts Speed up template migrations (#14679) 2024-10-16 13:13:48 +02:00