You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This doc is a brief introduction on modifying and maintaining this gem.
4
+
5
+
## Updating to the latest upstream tailwindcss version
6
+
7
+
Update `lib/tailwindcss/ruby/upstream.rb` with the upstream version.
8
+
9
+
Run `bundle exec rake clobber` then `bundle exec rake download` to ensure the tailwindcss binaries can be downloaded, and that you have the correct versions on local disk.
10
+
11
+
## Cutting a release of tailwindcss-ruby
12
+
13
+
- bump the version
14
+
-[ ] update `lib/tailwindcss/ruby/version.rb`
15
+
-[ ] update `CHANGELOG.md`
16
+
-[ ] commit and create a git tag
17
+
- build the native gems:
18
+
-[ ]`bundle exec rake clobber` if needed to clean up possibly-old tailwindcss executables
19
+
-[ ]`bundle exec rake package`
20
+
- push
21
+
-[ ]`for g in pkg/*.gem ; do gem push $g ; done`
22
+
-[ ]`git push && git push --tags`
23
+
- announce
24
+
-[ ] create a release at https://github.com/flavorjones/tailwindcss-ruby/releases
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:
TODO: Delete this and the text below, and describe your gem
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.
4
6
5
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/tailwindcss/ruby`. To experiment with that code, run `bin/console` for an interactive prompt.
6
7
7
8
## Installation
8
9
9
-
TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_IMMEDIATELY_AFTER_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
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)
10
21
11
22
Install the gem and add to the application's Gemfile by executing:
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
21
48
```
22
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
+
23
58
## Usage
24
59
25
-
TODO: Write usage instructions here
60
+
### Ruby
61
+
62
+
The gem makes available `Tailwindcss::Ruby.executable` which is the path to the vendored standalone executable.
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
-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.
30
145
31
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
146
33
147
## Contributing
34
148
@@ -38,6 +152,8 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/flavor
38
152
39
153
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
154
155
+
Tailwind CSS is [released under the MIT License](https://github.com/tailwindlabs/tailwindcss/blob/next/LICENSE).
156
+
41
157
## Code of Conduct
42
158
43
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).
0 commit comments