-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Support migrating projects with multiple config files #14863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RobinMalfait
commented
Nov 4, 2024
RobinMalfait
commented
Nov 4, 2024
adamwathan
reviewed
Nov 4, 2024
We now make sure that `@config` exists, then we start the migration per CSS file. This means that if the migration was successful that the `@config` is still present. In this case we can remove it.
The `@config` is injected when running the migrations via the `migrate` function. When running non-integration tests there is no file system and we migrate the stylesheet(s) via `migrateContents` directly. The integration tests ensure this is still working as intended.
Before this change, the output looked like this: ``` │ No input stylesheets provided. Searching for CSS files in the current directory and its subdirectories… │ Error: Cannot find a CSS file where Tailwind CSS is setup. Make sure to create a CSS file where Tailwind CSS is setup and try again. ``` After this change, it looks like this: ``` │ No input stylesheets provided. Searching for CSS files in the current directory and its subdirectories… │ Error: Cannot find a CSS file where Tailwind CSS is setup. │ Make sure to create a CSS file where Tailwind CSS is setup and try again. ```
8c55be9 to
d838c9c
Compare
adamwathan
approved these changes
Nov 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When migrating a project from Tailwind CSS v3 to Tailwind CSS v4, then we started the migration process in the following order:
contentoption)However, if you have a setup where you have multiple CSS root files (e.g.:
frontendandadminare separated), then that typically means that you have an@configdirective in your CSS files. These point to the Tailwind CSS config file.This PR changes the migration order to do the following:
@configdirective, migrate the JS/TS config fileIf a CSS file does not contain any
@configdirectives, then we start by filling in the@configdirective with the default Tailwind CSS config file (if found, or the one passed in). If no default config file or passed in config file can be found, then we will error out (just like we do now)