We noticed that in the current alpha 34 release, the package.json file of the @tailwindcss/node package only defines tailwindcss as a dev dependency. This makes it very easy for version mismatches to happen when a v3 version (or an earlier v4 alpha for that matter) was installed in the same project:
Furthermore, we were trying to fix issues where our integration test setup could not install tailwindcss@3 because of how we did pnpm overrides.
This PR fixes this by:
Ensuring every client that calls into tailwindcss core marks it as a version-pinned dependency. You are still required to install tailwindcss in your project along side a client (e.g. @tailwindcss/vite) but we now only use your installed version for importing the respective .css files. For the core logic, we are now requiring each package to use tailwindcss at the same version. This should help resolve issues like https://github.com/tailwindlabs/tailwindcss/discussions/14652
We tried to eliminate the dependency on tailwindcss from the @tailwindcss/upgrade package. Unfortunately this is not possible to do right now because we need to load the CSS files from v4 to create the right environment. In a future version we could bundle the required CSS files with @tailwidncss/upgrade but it doesn't seem necessary for now.
We then changed our integration test overrides to only override the tailwindcss package that are dependencies of the known list of packages that we have tailwindcss dependencies on: @tailwindcss/node and @tailwindcss/upgrade. This ensures that we can install v3 of tailwindcss in the integration tests and it will work. Something we want to do for some upgrade tests.
Test plan
Integration work again. Furthermore we added a quick setup with the CLI using the local tarballs and ensured it works:
We noticed that in the current alpha 34 release, the
package.json
file of the@tailwindcss/node
package only definestailwindcss
as a dev dependency. This makes it very easy for version mismatches to happen when a v3 version (or an earlier v4 alpha for that matter) was installed in the same project:Furthermore, we were trying to fix issues where our integration test setup could not install
tailwindcss@3
because of how we did pnpm overrides.This PR fixes this by:
tailwindcss
core marks it as a version-pinned dependency. You are still required to installtailwindcss
in your project along side a client (e.g.@tailwindcss/vite
) but we now only use your installed version for importing the respective.css
files. For the core logic, we are now requiring each package to usetailwindcss
at the same version. This should help resolve issues like https://github.com/tailwindlabs/tailwindcss/discussions/14652tailwindcss
from the@tailwindcss/upgrade
package. Unfortunately this is not possible to do right now because we need to load the CSS files from v4 to create the right environment. In a future version we could bundle the required CSS files with@tailwidncss/upgrade
but it doesn't seem necessary for now.tailwindcss
package that are dependencies of the known list of packages that we havetailwindcss
dependencies on:@tailwindcss/node
and@tailwindcss/upgrade
. This ensures that we can install v3 oftailwindcss
in the integration tests and it will work. Something we want to do for some upgrade tests.Test plan
Integration work again. Furthermore we added a quick setup with the CLI using the local tarballs and ensured it works: