tailwindlabs / tailwindcss

A utility-first CSS framework for rapid UI development.
https://tailwindcss.com/
MIT License
83.27k stars 4.22k forks source link

Improve PostCSS migration #15046

Closed RobinMalfait closed 2 days ago

RobinMalfait commented 2 days ago

If you have a PostCSS config file, that is not simple (has functions, requires, ...). In that case we don't migrate the PostCSS file. Because we don't migrate, the didMigrate is still false and we continue with the next migration.

The issue here is that there are 2 states encoded in the same variable and they should be two separate variables because there is a difference between:

  1. Not finding a file at all
  2. Finding a file, but not migrating it

Before this change, the output looks like this if you have a complex PostCSS file:

│ Migrating PostCSS configuration…

│ The PostCSS config contains dynamic JavaScript and can not be automatically migrated.

│ No PostCSS config found, skipping migration.

After this change, the output looks like this:

│ Migrating PostCSS configuration…

│ ↳ The PostCSS config contains dynamic JavaScript and can not be automatically migrated.

Also updated the output to include to be consistent with the other logs.