-
Notifications
You must be signed in to change notification settings - Fork 70
Support configuring version per profile #123
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
base: main
Are you sure you want to change the base?
Conversation
lib/tailwind.ex
Outdated
@@ -163,8 +183,8 @@ defmodule Tailwind do | |||
Returns `{:ok, version_string}` on success or `:error` when the executable | |||
is not available. | |||
""" | |||
def bin_version do | |||
path = bin_path() | |||
def bin_version(profile \\ :default) do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you required to have a default profile? I don't think so... so this will likely be a breaking change in practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you do not have a default profile, this will now resolve to the path for the version configured 'globally' (aka configured_version/0
), so that shouldn't be a breaking change.
The only "problem" is that after updating, people will have to rerun mix tailwind.install
, because the path to the binary has changed to include the version string.
Co-authored-by: José Valim <[email protected]>
Co-authored-by: José Valim <[email protected]>
The `--if-missing` argument causes this test to be flaky. Previously, when you had downloaded another version, the newer version would automatically be missing and thus always be installed. Currently, that's no longer the case, because you can have multiple simultanous tailwind installs, so in this case (after the first test run), the newer version already exists.
In our project, we had a place where we were running multiple builds through multiple tailwind profiles, and one had already been updated to be compatible with v4 (and thus incompatible with v3), while the other is still stuck on v3 for now.
I added support to run a different version of the CLI for a profile. If no version is explicitly configured for the profile, it will fall back to the globally configured tailwind version.
This should be a backwards-compatible (aka non-breaking) change.