Skip to content

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

RobinBoers
Copy link

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.

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
Copy link
Member

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.

Copy link
Author

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.

RobinBoers and others added 7 commits April 25, 2025 14:17
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants