Skip to content

Commit 6eee14e

Browse files
committed
Upgrade debug provider to tailwind 4
1 parent d043caf commit 6eee14e

File tree

10 files changed

+26
-48
lines changed

10 files changed

+26
-48
lines changed

debug_fasp/Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ gem "turbo-rails"
1515
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
1616
gem "stimulus-rails"
1717
# Use Tailwind CSS [https://github.com/rails/tailwindcss-rails]
18-
gem "tailwindcss-rails", "~> 3.3.1"
18+
gem "tailwindcss-rails", "~> 4.1"
1919
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
2020
gem "jbuilder"
2121

debug_fasp/Gemfile.lock

+11-10
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ GEM
224224
raabro (1.4.0)
225225
racc (1.8.1)
226226
rack (3.1.13)
227-
rack-session (2.1.0)
227+
rack-session (2.1.1)
228228
base64 (>= 0.1.0)
229229
rack (>= 3.0.0)
230230
rack-test (2.2.0)
@@ -331,15 +331,16 @@ GEM
331331
stimulus-rails (1.3.4)
332332
railties (>= 6.0.0)
333333
stringio (3.1.7)
334-
tailwindcss-rails (3.3.2)
334+
tailwindcss-rails (4.2.3)
335335
railties (>= 7.0.0)
336-
tailwindcss-ruby (~> 3.0)
337-
tailwindcss-ruby (3.4.17)
338-
tailwindcss-ruby (3.4.17-aarch64-linux)
339-
tailwindcss-ruby (3.4.17-arm-linux)
340-
tailwindcss-ruby (3.4.17-arm64-darwin)
341-
tailwindcss-ruby (3.4.17-x86_64-darwin)
342-
tailwindcss-ruby (3.4.17-x86_64-linux)
336+
tailwindcss-ruby (~> 4.0)
337+
tailwindcss-ruby (4.1.5)
338+
tailwindcss-ruby (4.1.5-aarch64-linux-gnu)
339+
tailwindcss-ruby (4.1.5-aarch64-linux-musl)
340+
tailwindcss-ruby (4.1.5-arm64-darwin)
341+
tailwindcss-ruby (4.1.5-x86_64-darwin)
342+
tailwindcss-ruby (4.1.5-x86_64-linux-gnu)
343+
tailwindcss-ruby (4.1.5-x86_64-linux-musl)
343344
thor (1.3.2)
344345
thruster (0.1.13)
345346
thruster (0.1.13-aarch64-linux)
@@ -409,7 +410,7 @@ DEPENDENCIES
409410
solid_queue
410411
sqlite3 (>= 2.1)
411412
stimulus-rails
412-
tailwindcss-rails (~> 3.3.1)
413+
tailwindcss-rails (~> 4.1)
413414
thruster
414415
turbo-rails
415416
tzinfo-data

debug_fasp/app/assets/stylesheets/application.tailwind.css

-13
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@import "tailwindcss";
2+
@config "../../../config/tailwind.config.js";

debug_fasp/app/controllers/application_controller.rb

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ class ApplicationController < ActionController::Base
44
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
55
allow_browser versions: :modern
66

7+
default_form_builder FaspBase::FormBuilder
8+
79
private
810

911
# Currently ever user can only have one server but this will probably

debug_fasp/app/views/accounts/show.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
<b><%= Account.human_attribute_name(:full_object) %></b>
2525
</p>
2626

27-
<pre class="rounded bg-gray-100 p-2">
27+
<pre class="rounded-sm bg-gray-100 p-2">
2828
<%= JSON.pretty_generate(@account.full_object) %>
2929
</pre>

debug_fasp/app/views/contents/show.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
<b><%= Content.human_attribute_name(:full_object) %></b>
2727
</p>
2828

29-
<pre class="rounded bg-gray-100 p-2">
29+
<pre class="rounded-sm bg-gray-100 p-2">
3030
<%= JSON.pretty_generate(@content.full_object) %>
3131
</pre>

debug_fasp/app/views/layouts/application.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<link rel="icon" href="/icon.png" type="image/png">
1414
<link rel="icon" href="/icon.svg" type="image/svg+xml">
1515
<link rel="apple-touch-icon" href="/icon.png">
16-
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
16+
<%= stylesheet_link_tag "tailwind", "data-turbo-track": "reload" %>
1717
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
1818
<%= javascript_importmap_tags %>
1919
</head>

debug_fasp/config/tailwind.config.js

+2-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
const defaultTheme = require('tailwindcss/defaultTheme')
21
const execSync = require('child_process').execSync
32

43
let content = [
@@ -12,25 +11,12 @@ const gems = ['fasp_base']
1211

1312
gems.forEach((gem) => {
1413
const gemPath = execSync(`bundle show ${gem}`, { encoding: 'utf-8' }).trim()
14+
content.push(`${gemPath}/app/form_builder/**/*.rb`)
1515
content.push(`${gemPath}/app/helpers/**/*.rb`)
1616
content.push(`${gemPath}/app/javascript/**/*.js`)
1717
content.push(`${gemPath}/app/views/**/*.{erb,haml,html,slim}`)
1818
})
1919

20-
console.log(content)
21-
2220
module.exports = {
23-
content: content,
24-
theme: {
25-
extend: {
26-
fontFamily: {
27-
sans: ['Inter var', ...defaultTheme.fontFamily.sans],
28-
},
29-
},
30-
},
31-
plugins: [
32-
require('@tailwindcss/forms'),
33-
require('@tailwindcss/typography'),
34-
require('@tailwindcss/container-queries'),
35-
]
21+
content: content
3622
}

fasp_base/app/form_builder/fasp_base/form_builder.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
module FaspBase
22
class FormBuilder < ActionView::Helpers::FormBuilder
3-
INPUT_CLASSES = %w(px-2 py-1 border border-blue-400 text-base)
3+
INPUT_CLASSES = %w[px-2 py-1 border border-blue-400 text-base]
44

55
def text_field(method, options = {})
6-
options[:class] = [options[:class], INPUT_CLASSES].compact.join(" ")
6+
options[:class] = [ options[:class], INPUT_CLASSES ].compact.join(" ")
77
super
88
end
99

1010
def email_field(method, options = {})
11-
options[:class] = [options[:class], INPUT_CLASSES].compact.join(" ")
11+
options[:class] = [ options[:class], INPUT_CLASSES ].compact.join(" ")
1212
super
1313
end
1414

1515
def password_field(method, options = {})
16-
options[:class] = [options[:class], INPUT_CLASSES].compact.join(" ")
16+
options[:class] = [ options[:class], INPUT_CLASSES ].compact.join(" ")
1717
super
1818
end
1919

2020
def url_field(method, options = {})
21-
options[:class] = [options[:class], INPUT_CLASSES].compact.join(" ")
21+
options[:class] = [ options[:class], INPUT_CLASSES ].compact.join(" ")
2222
super
2323
end
2424
end

0 commit comments

Comments
 (0)