tailwindcss-ruby 0.1.0-x86_64-darwin
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE-DEPENDENCIES +26 -0
- data/README.md +159 -0
- data/Rakefile +10 -0
- data/exe/tailwindcss +19 -0
- data/exe/x86_64-darwin/tailwindcss +0 -0
- data/lib/tailwindcss/ruby/upstream.rb +18 -0
- data/lib/tailwindcss/ruby/version.rb +7 -0
- data/lib/tailwindcss/ruby.rb +80 -0
- metadata +58 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1b57110d57366abe0173c7b123bbd52e1d68d422fcc4b4672951d83c600b6149
|
4
|
+
data.tar.gz: 0534f6350adb72280474606cf68bdc747ac4c0a936aeccdf6cd5b98cb2f7d07d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: eae87fbcd1c6b0a9b68cfb2a27d8ce2da262ae3e173b146cd9e064353a645ed2a6f2d33fce0e086f5139288862be9398d2725d9f2b3dbec10c5222d522e5b5f3
|
7
|
+
data.tar.gz: 32ee25a5878b53cd956c878f731936d90ea924618202e0b5ce80a192d748755f90e1b73eb637cdff13c5243669fcc772ff43576f0ebd69a5e706d721a8bec9d2
|
@@ -0,0 +1,26 @@
|
|
1
|
+
tailwindcss-rails may redistribute executables from the https://github.com/tailwindlabs/tailwindcss project
|
2
|
+
|
3
|
+
The license for that software can be found at https://github.com/tailwindlabs/tailwindcss/blob/master/LICENSE which is reproduced here for your convenience:
|
4
|
+
|
5
|
+
MIT License
|
6
|
+
|
7
|
+
Copyright (c) Adam Wathan <adam.wathan@gmail.com>
|
8
|
+
Copyright (c) Jonathan Reinink <jonathan@reinink.ca>
|
9
|
+
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
12
|
+
in the Software without restriction, including without limitation the rights
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
15
|
+
furnished to do so, subject to the following conditions:
|
16
|
+
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
18
|
+
copies or substantial portions of the Software.
|
19
|
+
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
26
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,159 @@
|
|
1
|
+
# Tailwindcss::Ruby
|
2
|
+
|
3
|
+
A self-contained `tailwindcss` executable, wrapped up in a ruby gem. That's it. Nothing else.
|
4
|
+
|
5
|
+
If you're looking to leverage tailwindcss in your Rails project, please see https://github.com/rails/tailwindcss-rails for integration that is supported by the Rails team.
|
6
|
+
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
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.
|
11
|
+
|
12
|
+
Supported platforms are:
|
13
|
+
|
14
|
+
- arm64-darwin (macos-arm64)
|
15
|
+
- x64-mingw32 (windows-x64)
|
16
|
+
- x64-mingw-ucr (windows-x64)
|
17
|
+
- x86_64-darwin (macos-x64)
|
18
|
+
- x86_64-linux (linux-x64)
|
19
|
+
- aarch64-linux (linux-arm64)
|
20
|
+
- arm-linux (linux-armv7)
|
21
|
+
|
22
|
+
Install the gem and add to the application's Gemfile by executing:
|
23
|
+
|
24
|
+
```bash
|
25
|
+
bundle add tailwindcss-ruby
|
26
|
+
```
|
27
|
+
|
28
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
29
|
+
|
30
|
+
```bash
|
31
|
+
gem install tailwindcss-ruby
|
32
|
+
```
|
33
|
+
|
34
|
+
### Using a local installation of `tailwindcss`
|
35
|
+
|
36
|
+
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.
|
37
|
+
|
38
|
+
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:
|
39
|
+
|
40
|
+
``` sh
|
41
|
+
TAILWINDCSS_INSTALL_DIR=/path/to/node_modules/bin
|
42
|
+
```
|
43
|
+
|
44
|
+
or, for relative paths like `./node_modules/.bin/tailwindcss`:
|
45
|
+
|
46
|
+
``` sh
|
47
|
+
TAILWINDCSS_INSTALL_DIR=node_modules/.bin
|
48
|
+
```
|
49
|
+
|
50
|
+
|
51
|
+
## Versioning
|
52
|
+
|
53
|
+
This gem will always have the same version number as the underlying TailwindCSS release. For example, the gem with version v3.4.13 will package upstream TailwindCSS v3.4.13.
|
54
|
+
|
55
|
+
If there ever needs to be multiple releases for the same version of TailwindCSS, the version will contain an additional digit. For example, if we re-released TailwindCSS v3.4.13, it might be shipped in gem version v3.4.13.1 or v3.4.13.2.
|
56
|
+
|
57
|
+
|
58
|
+
## Usage
|
59
|
+
|
60
|
+
### Ruby
|
61
|
+
|
62
|
+
The gem makes available `Tailwindcss::Ruby.executable` which is the path to the vendored standalone executable.
|
63
|
+
|
64
|
+
``` ruby
|
65
|
+
require "tailwindcss/ruby"
|
66
|
+
Tailwindcss::Ruby.executable
|
67
|
+
# => "/path/to/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/tailwindcss-ruby-0.1.0-x86_64-linux/exe/x86_64-linux/tailwindcss"
|
68
|
+
```
|
69
|
+
|
70
|
+
|
71
|
+
### Command line
|
72
|
+
|
73
|
+
This gem provides an executable `tailwindcss` shim that will run the vendored standalone executable.
|
74
|
+
|
75
|
+
``` bash
|
76
|
+
# where is the shim?
|
77
|
+
$ bundle exec which tailwindcss
|
78
|
+
/path/to/installs/ruby/3.3/bin/tailwindcss
|
79
|
+
|
80
|
+
# run the actual executable through the shim
|
81
|
+
$ bundle exec tailwindcss --help
|
82
|
+
["/path/to/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/tailwindcss-rails-2.6.0-x86_64-linux/exe/x86_64-linux/tailwindcss", "--help"]
|
83
|
+
|
84
|
+
tailwindcss v3.4.3
|
85
|
+
|
86
|
+
Usage:
|
87
|
+
tailwindcss [--input input.css] [--output output.css] [--watch] [options...]
|
88
|
+
tailwindcss init [--full] [--postcss] [options...]
|
89
|
+
|
90
|
+
Commands:
|
91
|
+
init [options]
|
92
|
+
|
93
|
+
Options:
|
94
|
+
-i, --input Input file
|
95
|
+
-o, --output Output file
|
96
|
+
-w, --watch Watch for changes and rebuild as needed
|
97
|
+
-p, --poll Use polling instead of filesystem events when watching
|
98
|
+
--content Content paths to use for removing unused classes
|
99
|
+
--postcss Load custom PostCSS configuration
|
100
|
+
-m, --minify Minify the output
|
101
|
+
-c, --config Path to a custom config file
|
102
|
+
--no-autoprefixer Disable autoprefixer
|
103
|
+
-h, --help Display usage information
|
104
|
+
```
|
105
|
+
|
106
|
+
|
107
|
+
## Troubleshooting
|
108
|
+
|
109
|
+
### `ERROR: Cannot find the tailwindcss executable` for supported platform
|
110
|
+
|
111
|
+
Some users are reporting this error even when running on one of the supported native platforms:
|
112
|
+
|
113
|
+
- arm64-darwin
|
114
|
+
- x64-mingw32
|
115
|
+
- x64-mingw-ucrt
|
116
|
+
- x86_64-darwin
|
117
|
+
- x86_64-linux
|
118
|
+
- aarch64-linux
|
119
|
+
|
120
|
+
#### Check Bundler PLATFORMS
|
121
|
+
|
122
|
+
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:
|
123
|
+
|
124
|
+
``` sh
|
125
|
+
bundle lock --add-platform <platform-name>
|
126
|
+
```
|
127
|
+
|
128
|
+
and re-bundle.
|
129
|
+
|
130
|
+
|
131
|
+
#### Check BUNDLE_FORCE_RUBY_PLATFORM
|
132
|
+
|
133
|
+
Another common cause of this is that bundler is configured to always use the "ruby" platform via the
|
134
|
+
`BUNDLE_FORCE_RUBY_PLATFORM` config parameter being set to `true`. Please remove this configuration:
|
135
|
+
|
136
|
+
``` sh
|
137
|
+
bundle config unset force_ruby_platform
|
138
|
+
# or
|
139
|
+
bundle config set --local force_ruby_platform false
|
140
|
+
```
|
141
|
+
|
142
|
+
and re-bundle.
|
143
|
+
|
144
|
+
See https://bundler.io/man/bundle-config.1.html for more information.
|
145
|
+
|
146
|
+
|
147
|
+
## Contributing
|
148
|
+
|
149
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/flavorjones/tailwindcss-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/flavorjones/tailwindcss-ruby/blob/main/CODE_OF_CONDUCT.md).
|
150
|
+
|
151
|
+
## License
|
152
|
+
|
153
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
154
|
+
|
155
|
+
Tailwind CSS is [released under the MIT License](https://github.com/tailwindlabs/tailwindcss/blob/next/LICENSE).
|
156
|
+
|
157
|
+
## Code of Conduct
|
158
|
+
|
159
|
+
Everyone interacting in the Tailwindcss::Ruby project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/flavorjones/tailwindcss-ruby/blob/main/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/exe/tailwindcss
ADDED
@@ -0,0 +1,19 @@
|
|
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::Ruby.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::Ruby::UnsupportedPlatformException, Tailwindcss::Ruby::ExecutableNotFoundException => e
|
17
|
+
STDERR.puts("ERROR: " + e.message)
|
18
|
+
exit 1
|
19
|
+
end
|
Binary file
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Tailwindcss
|
2
|
+
module Ruby
|
3
|
+
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
|
+
}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "ruby/version"
|
4
|
+
require_relative "ruby/upstream"
|
5
|
+
|
6
|
+
module Tailwindcss
|
7
|
+
module Ruby
|
8
|
+
DEFAULT_DIR = File.expand_path(File.join(__dir__, "..", "..", "exe"))
|
9
|
+
GEM_NAME = "tailwindcss-rails"
|
10
|
+
|
11
|
+
# raised when the host platform is not supported by upstream tailwindcss's binary releases
|
12
|
+
class UnsupportedPlatformException < StandardError
|
13
|
+
end
|
14
|
+
|
15
|
+
# raised when the tailwindcss executable could not be found where we expected it to be
|
16
|
+
class ExecutableNotFoundException < StandardError
|
17
|
+
end
|
18
|
+
|
19
|
+
# raised when TAILWINDCSS_INSTALL_DIR does not exist
|
20
|
+
class DirectoryNotFoundException < StandardError
|
21
|
+
end
|
22
|
+
|
23
|
+
class << self
|
24
|
+
def platform
|
25
|
+
[:cpu, :os].map { |m| Gem::Platform.local.send(m) }.join("-")
|
26
|
+
end
|
27
|
+
|
28
|
+
def executable(exe_path: DEFAULT_DIR)
|
29
|
+
tailwindcss_install_dir = ENV["TAILWINDCSS_INSTALL_DIR"]
|
30
|
+
if tailwindcss_install_dir
|
31
|
+
if File.directory?(tailwindcss_install_dir)
|
32
|
+
warn "NOTE: using TAILWINDCSS_INSTALL_DIR to find tailwindcss executable: #{tailwindcss_install_dir}"
|
33
|
+
exe_path = tailwindcss_install_dir
|
34
|
+
exe_file = File.expand_path(File.join(tailwindcss_install_dir, "tailwindcss"))
|
35
|
+
else
|
36
|
+
raise DirectoryNotFoundException, <<~MESSAGE
|
37
|
+
TAILWINDCSS_INSTALL_DIR is set to #{tailwindcss_install_dir}, but that directory does not exist.
|
38
|
+
MESSAGE
|
39
|
+
end
|
40
|
+
else
|
41
|
+
if Tailwindcss::Ruby::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match_gem?(Gem::Platform.new(p), GEM_NAME) }
|
42
|
+
raise UnsupportedPlatformException, <<~MESSAGE
|
43
|
+
tailwindcss-rails does not support the #{platform} platform
|
44
|
+
Please install tailwindcss following instructions at https://tailwindcss.com/docs/installation
|
45
|
+
MESSAGE
|
46
|
+
end
|
47
|
+
|
48
|
+
exe_file = Dir.glob(File.expand_path(File.join(exe_path, "*", "tailwindcss"))).find do |f|
|
49
|
+
Gem::Platform.match_gem?(Gem::Platform.new(File.basename(File.dirname(f))), GEM_NAME)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
if exe_file.nil? || !File.exist?(exe_file)
|
54
|
+
raise ExecutableNotFoundException, <<~MESSAGE
|
55
|
+
Cannot find the tailwindcss executable for #{platform} in #{exe_path}
|
56
|
+
|
57
|
+
If you're using bundler, please make sure you're on the latest bundler version:
|
58
|
+
|
59
|
+
gem install bundler
|
60
|
+
bundle update --bundler
|
61
|
+
|
62
|
+
Then make sure your lock file includes this platform by running:
|
63
|
+
|
64
|
+
bundle lock --add-platform #{platform}
|
65
|
+
bundle install
|
66
|
+
|
67
|
+
See `bundle lock --help` output for details.
|
68
|
+
|
69
|
+
If you're still seeing this message after taking those steps, try running
|
70
|
+
`bundle config` and ensure `force_ruby_platform` isn't set to `true`. See
|
71
|
+
https://github.com/rails/tailwindcss-rails#check-bundle_force_ruby_platform
|
72
|
+
for more details.
|
73
|
+
MESSAGE
|
74
|
+
end
|
75
|
+
|
76
|
+
exe_file
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
metadata
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: tailwindcss-ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: x86_64-darwin
|
6
|
+
authors:
|
7
|
+
- Mike Dalessio
|
8
|
+
- David Heinemeier Hansson
|
9
|
+
autorequire:
|
10
|
+
bindir: exe
|
11
|
+
cert_chain: []
|
12
|
+
date: 2024-09-25 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: A self-contained `tailwindcss` executable, wrapped up in a ruby gem.
|
15
|
+
That's it. Nothing else.
|
16
|
+
email:
|
17
|
+
- mike.dalessio@gmail.com
|
18
|
+
- david@loudthinking.com
|
19
|
+
executables:
|
20
|
+
- tailwindcss
|
21
|
+
extensions: []
|
22
|
+
extra_rdoc_files: []
|
23
|
+
files:
|
24
|
+
- LICENSE-DEPENDENCIES
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- exe/tailwindcss
|
28
|
+
- exe/x86_64-darwin/tailwindcss
|
29
|
+
- lib/tailwindcss/ruby.rb
|
30
|
+
- lib/tailwindcss/ruby/upstream.rb
|
31
|
+
- lib/tailwindcss/ruby/version.rb
|
32
|
+
homepage: https://github.com/flavorjones/tailwindcss-ruby
|
33
|
+
licenses:
|
34
|
+
- MIT
|
35
|
+
metadata:
|
36
|
+
source_code_uri: https://github.com/flavorjones/tailwindcss-ruby
|
37
|
+
changelog_uri: https://github.com/flavorjones/tailwindcss-ruby/blob/main/CHANGELOG.md
|
38
|
+
rubygems_mfa_required: 'true'
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options: []
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 3.0.0
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
requirements: []
|
54
|
+
rubygems_version: 3.5.16
|
55
|
+
signing_key:
|
56
|
+
specification_version: 4
|
57
|
+
summary: A self-contained `tailwindcss` executable.
|
58
|
+
test_files: []
|