tailwindcss-rails 2.7.9 → 3.0.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -57
- data/lib/generators/tailwindcss/scaffold/templates/_form.html.erb.tt +2 -2
- data/lib/tailwindcss/commands.rb +2 -72
- data/lib/tailwindcss/upstream.rb +2 -13
- data/lib/tailwindcss/version.rb +1 -1
- data/lib/tailwindcss-rails.rb +0 -1
- metadata +18 -7
- data/exe/tailwindcss +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19d356e69cfad32729dca7d84903a96c0a08a472c56ad8d378964d2bf4fad437
|
4
|
+
data.tar.gz: 749be2aa984e18315877bc09ce9f1c1e8df5c2b3928ed015d0de4d14555fabdf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
39
|
+
This gem depends on the `tailwindcss-ruby` gem to install a working tailwind executable.
|
39
40
|
|
40
|
-
Supported platforms are:
|
41
41
|
|
42
|
-
|
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
|
-
|
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
|
-
|
58
|
-
|
49
|
+
# pin to tailwindcss version 3.4.13
|
50
|
+
gem "tailwindcss-ruby", "3.4.13"
|
59
51
|
```
|
60
52
|
|
61
|
-
|
53
|
+
### Using a local installation of `tailwindcss`
|
62
54
|
|
63
|
-
|
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
|
-
|
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).
|
@@ -26,9 +26,9 @@
|
|
26
26
|
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, multiple: true, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
27
27
|
<% else -%>
|
28
28
|
<%%= form.label :<%= attribute.column_name %> %>
|
29
|
-
<% if attribute.field_type == :
|
29
|
+
<% if attribute.field_type == :text_area -%>
|
30
30
|
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, rows: 4, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
31
|
-
<% elsif attribute.field_type == :
|
31
|
+
<% elsif attribute.field_type == :check_box -%>
|
32
32
|
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "block mt-2 h-5 w-5" %>
|
33
33
|
<% else -%>
|
34
34
|
<%%= form.<%= attribute.field_type %> :<%= attribute.column_name %>, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
data/lib/tailwindcss/commands.rb
CHANGED
@@ -1,81 +1,11 @@
|
|
1
|
-
|
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,
|
data/lib/tailwindcss/upstream.rb
CHANGED
@@ -1,17 +1,6 @@
|
|
1
1
|
module Tailwindcss
|
2
|
-
# constants describing the upstream tailwindcss project
|
3
2
|
module Upstream
|
4
|
-
VERSION =
|
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
|
data/lib/tailwindcss/version.rb
CHANGED
data/lib/tailwindcss-rails.rb
CHANGED
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:
|
4
|
+
version: 3.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
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
|
-
|
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,7 +64,6 @@ 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
|
57
68
|
- lib/generators/tailwindcss/authentication/templates/app/views/passwords/edit.html.erb
|
58
69
|
- lib/generators/tailwindcss/authentication/templates/app/views/passwords/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
|