tailwindcss-rails 2.0.3-arm64-darwin → 2.0.7-arm64-darwin

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fb2d763f5ad964d7aabf816c8248fb012e09de69c4322da317d08e22f1e363ba
4
- data.tar.gz: d27545da3a82f5bce55855a9ef44ee70b7b0304fa8bbad413691b4ea99bba6d3
3
+ metadata.gz: b324461ac63e38f0188c936e92cdf66328409f30d6f51b2929ff74ed8d11fc55
4
+ data.tar.gz: db3f76b02068eb258d567175396a21cef6926cf3a3aa1fd60f673ca1b6305023
5
5
  SHA512:
6
- metadata.gz: f921680b9ac1812c587836d4a126463e7040b0ec9f31e04082492ab01915f2947a402a0a0def9949ac844fe73657749fc1c0bdaefccf0ad4e2682715eb31ca5b
7
- data.tar.gz: 0a2974ad76b0a953bca5ca4e07f0859147c50d57a0b4a681f0b6810cc8acf8acd061ed20a2c35f7394e1cb98d9776e224a70995346cd0086fd745ce854531d35
6
+ metadata.gz: 85862d45962c516e591c7d10a8abb97e1a8965ddc5b7b55fff5768310161600e3451f56ee5ab48e90571d25986f1842168341a7fab4836f3d9a9ac02d137c1e3
7
+ data.tar.gz: 607516eab8fa24a8f716551fd2017613d340ef964cff47c05ba6a79e5ffd69ce40e5ee898f657e38bf367e906041d98741d10db34b65836cb3f4179b8ff0d0dc
data/README.md CHANGED
@@ -25,11 +25,74 @@ With Rails 7 you can generate a new application preconfigured with Tailwind by u
25
25
 
26
26
  The `tailwindcss:build` is automatically attached to `assets:precompile`, so before the asset pipeline digests the files, the Tailwind output will be generated.
27
27
 
28
+ ## Building for testing
29
+
30
+ The `tailwindcss:build` is automatically attached to `test:prepare`, which runs before Rails tests. (Note that this currently only applies to rails `test:*` tasks (like `test:all` or `test:controllers`), not "rails test", as that doesn't load `test:prepare`).
28
31
 
29
32
  ## Conflict with sassc-rails
30
33
 
31
34
  Tailwind uses modern CSS features that are not recognized by the `sassc-rails` extension that was included by default in the Gemfile for Rails 6. In order to avoid any errors like `SassC::SyntaxError`, you must remove that gem from your Gemfile.
32
35
 
36
+ ## Class names must be spelled out
37
+
38
+ For Tailwind to work, your class names need to be spelled out. They can't be programmatically composed. So no "text-gray-#{grade}", only "text-gray-500".
39
+
40
+ ## Troubleshooting
41
+
42
+ Some common problems experienced by users ...
43
+
44
+ ### ERROR: Cannot find the tailwindcss executable for <supported platform>
45
+
46
+ Some users are reporting this error even when running on one of the supported native platforms:
47
+
48
+ - arm64-darwin
49
+ - x64-mingw32
50
+ - x86_64-darwin
51
+ - x86_64-linux
52
+ - aarch64-linux
53
+
54
+ #### Check Bundler PLATFORMS
55
+
56
+ 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:
57
+
58
+ ``` sh
59
+ bundle lock --add-platform <platform-name>
60
+ ```
61
+
62
+ and re-bundle.
63
+
64
+
65
+ #### Check BUNDLE_FORCE_RUBY_PLATFORM
66
+
67
+ Another common cause of this is that bundler is configured to always use the "ruby" platform via the
68
+ `BUNDLE_FORCE_RUBY_PLATFORM` config parameter being set to `true`. Please remove this configuration:
69
+
70
+ ``` sh
71
+ bundle config unset force_ruby_platform
72
+ # or
73
+ bundle config set --local force_ruby_platform false
74
+ ```
75
+
76
+ and re-bundle.
77
+
78
+ See https://bundler.io/man/bundle-config.1.html for more information.
79
+
80
+
81
+ ### "No such file or directory" running on Alpine (musl)
82
+
83
+ When running `tailwindcss` on an Alpine system, some users report a "No such file or directory" error message.
84
+
85
+
86
+ #### Install gnu libc compatibility
87
+
88
+ The cause of this is the upstream `tailwindcss` binary executables being built on a gnu libc system, making them incompatible with standard musl libc systems.
89
+
90
+ A fix for this has been proposed upstream at https://github.com/tailwindlabs/tailwindcss/discussions/6785, but in the meantime a workaround is to install compatibility libraries:
91
+
92
+ ``` sh
93
+ apk add build-base gcompat
94
+ ```
95
+
33
96
 
34
97
  ## License
35
98
 
Binary file
data/exe/tailwindcss CHANGED
@@ -32,6 +32,11 @@ if exe_path.nil?
32
32
  bundle install
33
33
 
34
34
  See `bundle lock --help` output for details.
35
+
36
+ If you're still seeing this message after taking those steps, try running
37
+ `bundle config` and ensure `force_ruby_platform` isn't set to `true`. See
38
+ https://github.com/rails/tailwindcss-rails#check-bundle_force_ruby_platform
39
+ for more details.
35
40
  ERRMSG
36
41
  exit 1
37
42
  end
@@ -1,2 +1,2 @@
1
1
  web: bin/rails server -p 3000
2
- css: rails tailwindcss:watch
2
+ css: bin/rails tailwindcss:watch
@@ -1,12 +1,16 @@
1
- APPLICATION_LAYOUT_PATH = Rails.root.join("app/views/layouts/application.html.erb")
1
+ APPLICATION_LAYOUT_PATH = Rails.root.join("app/views/layouts/application.html.erb")
2
+ CENTERING_CONTAINER_INSERTION_POINT = /^\s*<%= yield %>/.freeze
2
3
 
3
4
  if APPLICATION_LAYOUT_PATH.exist?
4
5
  say "Add Tailwindcss include tags and container element in application layout"
5
6
  insert_into_file APPLICATION_LAYOUT_PATH.to_s, <<~ERB.indent(4), before: /^\s*<%= stylesheet_link_tag/
6
7
  <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
7
8
  ERB
8
- insert_into_file APPLICATION_LAYOUT_PATH.to_s, %( <main class="container mx-auto mt-28 px-5 flex">\n ), before: /^\s*<%= yield/
9
- insert_into_file APPLICATION_LAYOUT_PATH.to_s, %(\n </main>), after: /^\s*<%= yield %>/
9
+
10
+ if File.open(APPLICATION_LAYOUT_PATH).read =~ /<body>\n\s*<%= yield %>\n\s*<\/body>/
11
+ insert_into_file APPLICATION_LAYOUT_PATH.to_s, %( <main class="container mx-auto mt-28 px-5 flex">\n ), before: CENTERING_CONTAINER_INSERTION_POINT
12
+ insert_into_file APPLICATION_LAYOUT_PATH.to_s, %(\n </main>), after: CENTERING_CONTAINER_INSERTION_POINT
13
+ end
10
14
  else
11
15
  say "Default application.html.erb is missing!", :red
12
16
  say %( Add <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %> within the <head> tag in your custom layout.)
@@ -35,7 +39,7 @@ unless Rails.root.join("app/assets/stylesheets/application.tailwind.css").exist?
35
39
  end
36
40
 
37
41
  if Rails.root.join("Procfile.dev").exist?
38
- append_to_file "Procfile.dev", "css: rails tailwindcss:watch\n"
42
+ append_to_file "Procfile.dev", "css: bin/rails tailwindcss:watch\n"
39
43
  else
40
44
  say "Add default Procfile.dev"
41
45
  copy_file "#{__dir__}/Procfile.dev", "Procfile.dev"
@@ -10,8 +10,8 @@ module Tailwindcss
10
10
  Rails.application.config.generators.stylesheets = false
11
11
  end
12
12
 
13
- config.app_generators do |g|
14
- g.template_engine :tailwindcss
15
- end
13
+ config.app_generators do |g|
14
+ g.template_engine :tailwindcss
15
+ end
16
16
  end
17
17
  end
@@ -1,7 +1,7 @@
1
1
  module Tailwindcss
2
2
  # constants describing the upstream tailwindcss project
3
3
  module Upstream
4
- VERSION = "v3.0.8"
4
+ VERSION = "v3.0.22"
5
5
 
6
6
  # rubygems platform name => upstream release filename
7
7
  NATIVE_PLATFORMS = {
@@ -1,3 +1,3 @@
1
1
  module Tailwindcss
2
- VERSION = "2.0.3"
2
+ VERSION = "2.0.7"
3
3
  end
data/lib/tasks/build.rake CHANGED
@@ -1,4 +1,4 @@
1
- TAILWIND_COMPILE_COMMAND = "#{Pathname.new(__dir__).to_s}/../../exe/tailwindcss -i #{Rails.root.join("app/assets/stylesheets/application.tailwind.css")} -o #{Rails.root.join("app/assets/builds/tailwind.css")} -c #{Rails.root.join("config/tailwind.config.js")}"
1
+ TAILWIND_COMPILE_COMMAND = "#{Pathname.new(__dir__).to_s}/../../exe/tailwindcss -i #{Rails.root.join("app/assets/stylesheets/application.tailwind.css")} -o #{Rails.root.join("app/assets/builds/tailwind.css")} -c #{Rails.root.join("config/tailwind.config.js")} --minify"
2
2
 
3
3
  namespace :tailwindcss do
4
4
  desc "Build your Tailwind CSS"
@@ -6,6 +6,7 @@ namespace :tailwindcss do
6
6
  system TAILWIND_COMPILE_COMMAND
7
7
  end
8
8
 
9
+ desc "Watch and build your Tailwind CSS on file changes"
9
10
  task :watch do
10
11
  system "#{TAILWIND_COMPILE_COMMAND} -w"
11
12
  end
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.0.3
4
+ version: 2.0.7
5
5
  platform: arm64-darwin
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-03 00:00:00.000000000 Z
11
+ date: 2022-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -52,7 +52,6 @@ files:
52
52
  - app/assets/fonts/Inter-roman.symbols.var.woff2
53
53
  - app/assets/fonts/Inter-roman.vietnamese.var.woff2
54
54
  - app/assets/stylesheets/inter-font.css
55
- - app/assets/stylesheets/tailwind.css
56
55
  - exe/arm64-darwin/tailwindcss
57
56
  - exe/tailwindcss
58
57
  - lib/generators/tailwindcss/controller/controller_generator.rb