tailwindcss-rails 2.7.6 → 3.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a157d6841bfb30c1b315cd8d6813e11593b375c00f7e10ce17fb41e9ab722554
4
- data.tar.gz: 0cb80ed07a9a82d75513142adf5b7b93448c253dc9c68a69ec07c0aa71b481f9
3
+ metadata.gz: 19d356e69cfad32729dca7d84903a96c0a08a472c56ad8d378964d2bf4fad437
4
+ data.tar.gz: 749be2aa984e18315877bc09ce9f1c1e8df5c2b3928ed015d0de4d14555fabdf
5
5
  SHA512:
6
- metadata.gz: 41ba1c2fe8231537403bf155fd9bcc4b8550c0ee221991db9442196dcbf42604ab67811c40e7a86e0b337586bafc6e5a5827de5baea349fd1cdb724bebd28802
7
- data.tar.gz: 503566ec51c9bdee4e4ed2573c2c7a8717f5e25895005c2eb0b3399c90a7c887241ba29034fb4e4dc955216e374e5c771845acb06afa459bb09ece59274a697a
6
+ metadata.gz: 6d45b7493d63aa3977eeb579ba4268fd807c9a7ed2321302d9433353808d464248b8b2d611afb46a74fdfc020762e389cfeb74b679502f5f38b43b466e093210
7
+ data.tar.gz: b0985425b30bcbf90b79c87db6dcdc67b2fb95232b1389a831557dfa21b84d0a93c2f3ae6ebc959006c3cb06614a794fa19b1d260807303871d6694724c4048f
data/README.md CHANGED
@@ -7,6 +7,7 @@
7
7
  <!-- toc -->
8
8
 
9
9
  - [Installation](#installation)
10
+ * [Choosing a specific version of `tailwindcss`](#choosing-a-specific-version-of-tailwindcss)
10
11
  * [Using a local installation of `tailwindcss`](#using-a-local-installation-of-tailwindcss)
11
12
  - [Developing with Tailwindcss](#developing-with-tailwindcss)
12
13
  * [Configuration and commands](#configuration-and-commands)
@@ -17,7 +18,7 @@
17
18
  * [Using with PostCSS](#using-with-postcss)
18
19
  * [Custom inputs or outputs](#custom-inputs-or-outputs)
19
20
  - [Troubleshooting](#troubleshooting)
20
- * [Lost keystrokes or hanging when using `ruby/debug` with the Puma plugin](#lost-keystrokes-or-hanging-when-using-rubydebug-with-the-puma-plugin)
21
+ * [Lost keystrokes or hanging when using terminal-based debugging tools (e.g. IRB, Pry, `ruby/debug`...etc.) with the Puma plugin](#lost-keystrokes-or-hanging-when-using-terminal-based-debugging-tools-eg-irb-pry-rubydebugetc-with-the-puma-plugin)
21
22
  * [Running in a docker container exits prematurely](#running-in-a-docker-container-exits-prematurely)
22
23
  * [Conflict with sassc-rails](#conflict-with-sassc-rails)
23
24
  * [Class names must be spelled out](#class-names-must-be-spelled-out)
@@ -35,34 +36,23 @@ With Rails 7 you can generate a new application preconfigured with Tailwind by u
35
36
  1. Run `./bin/bundle add tailwindcss-rails`
36
37
  2. Run `./bin/rails tailwindcss:install`
37
38
 
38
- This gem wraps [the standalone executable version](https://tailwindcss.com/blog/standalone-cli) of the Tailwind CSS v3 framework. These executables are platform specific, so there are actually separate underlying gems per platform, but the correct gem will automatically be picked for your platform.
39
+ This gem depends on the `tailwindcss-ruby` gem to install a working tailwind executable.
39
40
 
40
- Supported platforms are:
41
41
 
42
- - arm64-darwin (macos-arm64)
43
- - x64-mingw32 (windows-x64)
44
- - x64-mingw-ucr (windows-x64)
45
- - x86_64-darwin (macos-x64)
46
- - x86_64-linux (linux-x64)
47
- - aarch64-linux (linux-arm64)
48
- - arm-linux (linux-armv7)
42
+ ### Choosing a specific version of `tailwindcss`
49
43
 
44
+ The `tailwindcss-ruby` gem is declared as a floating dependency of this gem, so by default you will get the most recent stable version. However, you can select a specific version of tailwind by pinning that gem to the analogous version in your application's `Gemfile`. For example,
50
45
 
51
- ### Using a local installation of `tailwindcss`
52
-
53
- If you are not able to use the vendored standalone executables (for example, if you're on an unsupported platform), you can use a local installation of the `tailwindcss` executable by setting an environment variable named `TAILWINDCSS_INSTALL_DIR` to the directory path containing the executable.
54
-
55
- For example, if you've installed `tailwindcss` so that the executable is found at `/path/to/node_modules/bin/tailwindcss`, then you should set your environment variable like so:
46
+ ``` ruby
47
+ gem "tailwindcss-rails"
56
48
 
57
- ``` sh
58
- TAILWINDCSS_INSTALL_DIR=/path/to/node_modules/bin
49
+ # pin to tailwindcss version 3.4.13
50
+ gem "tailwindcss-ruby", "3.4.13"
59
51
  ```
60
52
 
61
- or, for relative paths like `./node_modules/.bin/tailwindcss`:
53
+ ### Using a local installation of `tailwindcss`
62
54
 
63
- ``` sh
64
- TAILWINDCSS_INSTALL_DIR=node_modules/.bin
65
- ```
55
+ You can also use a local (npm-based) installation if you prefer, please go to https://github.com/flavorjones/tailwindcss-ruby for more information.
66
56
 
67
57
 
68
58
  ## Developing with Tailwindcss
@@ -206,41 +196,7 @@ For Tailwind to work, your class names need to be spelled out. If you need to ma
206
196
 
207
197
  ### `ERROR: Cannot find the tailwindcss executable` for supported platform
208
198
 
209
- Some users are reporting this error even when running on one of the supported native platforms:
210
-
211
- - arm64-darwin
212
- - x64-mingw32
213
- - x64-mingw-ucrt
214
- - x86_64-darwin
215
- - x86_64-linux
216
- - aarch64-linux
217
-
218
- #### Check Bundler PLATFORMS
219
-
220
- A possible cause of this is that Bundler has not been told to include native gems for your current platform. Please check your `Gemfile.lock` file to see whether your native platform is included in the `PLATFORMS` section. If necessary, run:
221
-
222
- ``` sh
223
- bundle lock --add-platform <platform-name>
224
- ```
225
-
226
- and re-bundle.
227
-
228
-
229
- #### Check BUNDLE_FORCE_RUBY_PLATFORM
230
-
231
- Another common cause of this is that bundler is configured to always use the "ruby" platform via the
232
- `BUNDLE_FORCE_RUBY_PLATFORM` config parameter being set to `true`. Please remove this configuration:
233
-
234
- ``` sh
235
- bundle config unset force_ruby_platform
236
- # or
237
- bundle config set --local force_ruby_platform false
238
- ```
239
-
240
- and re-bundle.
241
-
242
- See https://bundler.io/man/bundle-config.1.html for more information.
243
-
199
+ See https://github.com/flavorjones/tailwindcss-ruby for help.
244
200
 
245
201
  ### Using asset-pipeline assets
246
202
 
@@ -280,5 +236,4 @@ Or, if you do want to keep using the asset pipeline in parallel, make sure to re
280
236
  ## License
281
237
 
282
238
  Tailwind for Rails is released under the [MIT License](https://opensource.org/licenses/MIT).
283
- Tailwind CSS is released under the [MIT License](https://opensource.org/licenses/MIT).
284
239
  The Inter font is released under the [SIL Open Font License, Version 1.1](https://github.com/rsms/inter/blob/master/LICENSE.txt).
@@ -0,0 +1,21 @@
1
+ <div class="mx-auto md:w-2/3 w-full">
2
+ <%% if alert = flash[:alert] %>
3
+ <p class="py-2 px-3 bg-red-50 mb-5 text-red-500 font-medium rounded-lg inline-block" id="alert"><%%= alert %></p>
4
+ <%% end %>
5
+
6
+ <h1 class="font-bold text-4xl">Update your password</h1>
7
+
8
+ <%%= form_with url: password_path(params[:token]), method: :put, class: "contents" do |form| %>
9
+ <div class="my-5">
10
+ <%%= form.password_field :password, required: true, autocomplete: "new-password", placeholder: "Enter new password", maxlength: 72, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
11
+ </div>
12
+
13
+ <div class="my-5">
14
+ <%%= form.password_field :password_confirmation, required: true, autocomplete: "new-password", placeholder: "Repeat new password", maxlength: 72, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
15
+ </div>
16
+
17
+ <div class="inline">
18
+ <%%= form.submit "Save", class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %>
19
+ </div>
20
+ <%% end %>
21
+ </div>
@@ -0,0 +1,17 @@
1
+ <div class="mx-auto md:w-2/3 w-full">
2
+ <%% if alert = flash[:alert] %>
3
+ <p class="py-2 px-3 bg-red-50 mb-5 text-red-500 font-medium rounded-lg inline-block" id="alert"><%%= alert %></p>
4
+ <%% end %>
5
+
6
+ <h1 class="font-bold text-4xl">Forgot your password?</h1>
7
+
8
+ <%%= form_with url: passwords_path, class: "contents" do |form| %>
9
+ <div class="my-5">
10
+ <%%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address], class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
11
+ </div>
12
+
13
+ <div class="inline">
14
+ <%%= form.submit "Email reset instructions", class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %>
15
+ </div>
16
+ <%% end %>
17
+ </div>
@@ -0,0 +1,31 @@
1
+ <div class="mx-auto md:w-2/3 w-full">
2
+ <%% if alert = flash[:alert] %>
3
+ <p class="py-2 px-3 bg-red-50 mb-5 text-red-500 font-medium rounded-lg inline-block" id="alert"><%%= alert %></p>
4
+ <%% end %>
5
+
6
+ <%% if notice = flash[:notice] %>
7
+ <p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%%= notice %></p>
8
+ <%% end %>
9
+
10
+ <h1 class="font-bold text-4xl">Sign in</h1>
11
+
12
+ <%%= form_with url: session_url, class: "contents" do |form| %>
13
+ <div class="my-5">
14
+ <%%= form.email_field :email_address, required: true, autofocus: true, autocomplete: "username", placeholder: "Enter your email address", value: params[:email_address], class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
15
+ </div>
16
+
17
+ <div class="my-5">
18
+ <%%= form.password_field :password, required: true, autocomplete: "current-password", placeholder: "Enter your password", maxlength: 72, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
19
+ </div>
20
+
21
+ <div class="col-span-6 sm:flex sm:items-center sm:gap-4">
22
+ <div class="inline">
23
+ <%%= form.submit "Sign in", class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %>
24
+ </div>
25
+
26
+ <div class="mt-4 text-sm text-gray-500 sm:mt-0">
27
+ <%%= link_to "Forgot password?", new_password_path, class: "text-gray-700 underline" %>
28
+ </div>
29
+ </div>
30
+ <%% end %>
31
+ </div>
@@ -1,81 +1,11 @@
1
- require_relative "upstream"
1
+ require "tailwindcss/ruby"
2
2
 
3
3
  module Tailwindcss
4
4
  module Commands
5
- DEFAULT_DIR = File.expand_path(File.join(__dir__, "..", "..", "exe"))
6
- GEM_NAME = "tailwindcss-rails"
7
-
8
- # raised when the host platform is not supported by upstream tailwindcss's binary releases
9
- class UnsupportedPlatformException < StandardError
10
- end
11
-
12
- # raised when the tailwindcss executable could not be found where we expected it to be
13
- class ExecutableNotFoundException < StandardError
14
- end
15
-
16
- # raised when TAILWINDCSS_INSTALL_DIR does not exist
17
- class DirectoryNotFoundException < StandardError
18
- end
19
-
20
5
  class << self
21
- def platform
22
- [:cpu, :os].map { |m| Gem::Platform.local.send(m) }.join("-")
23
- end
24
-
25
- def executable(exe_path: DEFAULT_DIR)
26
- tailwindcss_install_dir = ENV["TAILWINDCSS_INSTALL_DIR"]
27
- if tailwindcss_install_dir
28
- if File.directory?(tailwindcss_install_dir)
29
- warn "NOTE: using TAILWINDCSS_INSTALL_DIR to find tailwindcss executable: #{tailwindcss_install_dir}"
30
- exe_path = tailwindcss_install_dir
31
- exe_file = File.expand_path(File.join(tailwindcss_install_dir, "tailwindcss"))
32
- else
33
- raise DirectoryNotFoundException, <<~MESSAGE
34
- TAILWINDCSS_INSTALL_DIR is set to #{tailwindcss_install_dir}, but that directory does not exist.
35
- MESSAGE
36
- end
37
- else
38
- if Tailwindcss::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match_gem?(Gem::Platform.new(p), GEM_NAME) }
39
- raise UnsupportedPlatformException, <<~MESSAGE
40
- tailwindcss-rails does not support the #{platform} platform
41
- Please install tailwindcss following instructions at https://tailwindcss.com/docs/installation
42
- MESSAGE
43
- end
44
-
45
- exe_file = Dir.glob(File.expand_path(File.join(exe_path, "*", "tailwindcss"))).find do |f|
46
- Gem::Platform.match_gem?(Gem::Platform.new(File.basename(File.dirname(f))), GEM_NAME)
47
- end
48
- end
49
-
50
- if exe_file.nil? || !File.exist?(exe_file)
51
- raise ExecutableNotFoundException, <<~MESSAGE
52
- Cannot find the tailwindcss executable for #{platform} in #{exe_path}
53
-
54
- If you're using bundler, please make sure you're on the latest bundler version:
55
-
56
- gem install bundler
57
- bundle update --bundler
58
-
59
- Then make sure your lock file includes this platform by running:
60
-
61
- bundle lock --add-platform #{platform}
62
- bundle install
63
-
64
- See `bundle lock --help` output for details.
65
-
66
- If you're still seeing this message after taking those steps, try running
67
- `bundle config` and ensure `force_ruby_platform` isn't set to `true`. See
68
- https://github.com/rails/tailwindcss-rails#check-bundle_force_ruby_platform
69
- for more details.
70
- MESSAGE
71
- end
72
-
73
- exe_file
74
- end
75
-
76
6
  def compile_command(debug: false, **kwargs)
77
7
  command = [
78
- executable(**kwargs),
8
+ Tailwindcss::Ruby.executable(**kwargs),
79
9
  "-i", Rails.root.join("app/assets/stylesheets/application.tailwind.css").to_s,
80
10
  "-o", Rails.root.join("app/assets/builds/tailwind.css").to_s,
81
11
  "-c", Rails.root.join("config/tailwind.config.js").to_s,
@@ -1,17 +1,6 @@
1
1
  module Tailwindcss
2
- # constants describing the upstream tailwindcss project
3
2
  module Upstream
4
- VERSION = "v3.4.13"
5
-
6
- # rubygems platform name => upstream release filename
7
- NATIVE_PLATFORMS = {
8
- "arm64-darwin" => "tailwindcss-macos-arm64",
9
- "x64-mingw32" => "tailwindcss-windows-x64.exe",
10
- "x64-mingw-ucrt" => "tailwindcss-windows-x64.exe",
11
- "x86_64-darwin" => "tailwindcss-macos-x64",
12
- "x86_64-linux" => "tailwindcss-linux-x64",
13
- "aarch64-linux" => "tailwindcss-linux-arm64",
14
- "arm-linux" => "tailwindcss-linux-armv7",
15
- }
3
+ VERSION = Tailwindcss::Ruby::Upstream::VERSION
4
+ deprecate_constant :VERSION
16
5
  end
17
6
  end
@@ -1,3 +1,3 @@
1
1
  module Tailwindcss
2
- VERSION = "2.7.6"
2
+ VERSION = "3.0.0.rc1"
3
3
  end
@@ -1,7 +1,6 @@
1
1
  module Tailwindcss
2
2
  end
3
3
 
4
- require_relative "tailwindcss/upstream"
5
4
  require_relative "tailwindcss/version"
6
5
  require_relative "tailwindcss/engine"
7
6
  require_relative "tailwindcss/commands"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tailwindcss-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.6
4
+ version: 3.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-23 00:00:00.000000000 Z
11
+ date: 2024-10-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -24,11 +24,23 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 7.0.0
27
- force_ruby_platform: false
27
+ - !ruby/object:Gem::Dependency
28
+ name: tailwindcss-ruby
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
28
41
  description:
29
42
  email: david@loudthinking.com
30
- executables:
31
- - tailwindcss
43
+ executables: []
32
44
  extensions: []
33
45
  extra_rdoc_files: []
34
46
  files:
@@ -52,8 +64,10 @@ files:
52
64
  - app/assets/fonts/Inter-roman.symbols.var.woff2
53
65
  - app/assets/fonts/Inter-roman.vietnamese.var.woff2
54
66
  - app/assets/stylesheets/inter-font.css
55
- - exe/tailwindcss
56
67
  - lib/generators/tailwindcss/authentication/authentication_generator.rb
68
+ - lib/generators/tailwindcss/authentication/templates/app/views/passwords/edit.html.erb
69
+ - lib/generators/tailwindcss/authentication/templates/app/views/passwords/new.html.erb
70
+ - lib/generators/tailwindcss/authentication/templates/app/views/sessions/new.html.erb
57
71
  - lib/generators/tailwindcss/authentication/templates/views/passwords/edit.html.erb
58
72
  - lib/generators/tailwindcss/authentication/templates/views/passwords/new.html.erb
59
73
  - lib/generators/tailwindcss/authentication/templates/views/sessions/new.html.erb
data/exe/tailwindcss DELETED
@@ -1,19 +0,0 @@
1
- #! /usr/bin/env ruby
2
- # because rubygems shims assume a gem's executables are Ruby
3
-
4
- require "tailwindcss/commands"
5
-
6
- begin
7
- command = [Tailwindcss::Commands.executable, *ARGV]
8
- puts command.inspect
9
- if Gem.win_platform?
10
- # use system rather than exec as exec inexplicably fails to find the executable on Windows
11
- # see related https://github.com/rubys/sprockets-esbuild/pull/4
12
- system(*command, exception: true)
13
- else
14
- exec(*command)
15
- end
16
- rescue Tailwindcss::Commands::UnsupportedPlatformException, Tailwindcss::Commands::ExecutableNotFoundException => e
17
- STDERR.puts("ERROR: " + e.message)
18
- exit 1
19
- end