Skip to content

Commit 9c71790

Browse files
committed
Pin the npm upgrade task to @tailwindcss/[email protected]
because the 4.1.5 upgrade tool introduced a dependency on tailwind that I can't figure out how to resolve. Gah, this entire experience has been entirely frustrating as a downstream maintainer, FML
1 parent 3fbc5ca commit 9c71790

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Then, run `bin/rails tailwindcss:upgrade`. Among other things, this will try to
124124
- If present, moves `app/assets/stylesheets/application.tailwind.css` to `app/assets/tailwind/application.css`.
125125
- Removes unnecessary `stylesheet_link_tag "tailwindcss"` tags from the application layout.
126126
- Removes references to the Inter font from the application layout.
127-
- Runs the upstream upgrader (note: requires `npx` to run the one-time upgrade, but highly recommended).
127+
- Runs v4.1.4 of the upstream upgrader (note: requires `npx` to run the one-time upgrade, but highly recommended).
128128

129129
</details>
130130

@@ -145,7 +145,7 @@ $ bin/rails tailwindcss:upgrade
145145
remove app/assets/stylesheets/application.tailwind.css
146146
10.9.0
147147
Running the upstream Tailwind CSS upgrader
148-
run npx @tailwindcss/upgrade --force --config /home/user/myapp/config/tailwind.config.js from "."
148+
run npx @tailwindcss/upgrade@4.1.4 --force --config /home/user/myapp/config/tailwind.config.js from "."
149149
≈ tailwindcss v4.0.0
150150
│ Searching for CSS files in the current directory and its subdirectories…
151151
│ ↳ Linked `./config/tailwind.config.js` to `./app/assets/tailwind/application.css`

lib/install/upgrade_tailwindcss.rb

+7-1
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,14 @@
4545
end
4646

4747
if system("npx --version")
48+
# We're pinning to v4.1.4 because v4.1.5 of the upgrade tool introduces a dependency version check
49+
# on tailwind and I haven't been able to figure out how to get that to work reliably and I am
50+
# extremely frustrated with the whole thing. See #544
51+
#
52+
# At some point we will probably need to unpin this at which point I am sincerely hoping that
53+
# someone else will do it.
4854
say "Running the upstream Tailwind CSS upgrader"
49-
command = Shellwords.join(["npx", "@tailwindcss/upgrade", "--force", "--config", TAILWIND_CONFIG_PATH.to_s])
55+
command = Shellwords.join(["npx", "@tailwindcss/upgrade@4.1.4", "--force", "--config", TAILWIND_CONFIG_PATH.to_s])
5056
success = run(command, abort_on_failure: false)
5157
unless success
5258
say "The upgrade tool failed!", :red

0 commit comments

Comments
 (0)