jekyll-tailwindcss 0.3.1 → 0.4.0
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 +4 -4
- data/README.md +3 -17
- data/lib/jekyll-tailwindcss/version.rb +1 -1
- data/lib/jekyll-tailwindcss.rb +0 -1
- data/lib/tailwindcss/commands.rb +2 -72
- data/lib/tailwindcss/upstream.rb +2 -12
- metadata +22 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a7dff01afc392c63f38fd87d5b9062aa7c9fb0769b54d58c9704f8e2655fb6c0
|
4
|
+
data.tar.gz: be657f430dfa4495de742f294eb6c54a5ef51c64a6b775207e1329a3ee006545
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17d3cd0c41c610731c0423f2e3541a3d42f723b350ba5edab60c7aaaaba454eebadec89ec66991ed73bdc2503415ee87bfd0385183865cec6b2c6e083167fe66
|
7
|
+
data.tar.gz: d6e0a10af255b1a70f029f927f0efc1642f9cce4abfb3f11f7768b52ce42d8c3184262aa370260aeda181c382251a59b8d7a06679a4962adb9da543ebc18d874
|
data/README.md
CHANGED
@@ -4,8 +4,6 @@ Bring the fun of building with TailwindCSS into your Jekyll project (without any
|
|
4
4
|
|
5
5
|
**TL;DR** This gem borrows *heavily* from [tailwindcss-rails](https://github.com/rails/tailwindcss-rails) to provide platform-specific tailwind executables and provide a smooth developer experience in Jekyll projects
|
6
6
|
|
7
|
-
Much like the Rails gem, this gem wraps [the standalone executable version](https://tailwindcss.com/blog/standalone-cli) of the Tailwind CSS v3 framework. It installs these as platform-specific executables, so there are separate underlying gems per platform, but the correct gem will automatically be picked for your platform.
|
8
|
-
|
9
7
|
> “Because building a great jekyll site shouldn’t require a `node_modules` folder
|
10
8
|
|
11
9
|
## Installation
|
@@ -91,26 +89,16 @@ will be converted to
|
|
91
89
|
|
92
90
|
## Development
|
93
91
|
|
94
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests.
|
92
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests.
|
95
93
|
|
96
94
|
To install this gem on your local machine, run `bundle exec rake install`.
|
97
95
|
|
98
|
-
### Updating to the latest upstream tailwindcss version
|
99
|
-
|
100
|
-
Update `lib/tailwindcss/upstream.rb` with the upstream version.
|
101
|
-
|
102
|
-
Run `bundle exec rake clobber` and then `bundle exec rake download` to ensure the tailwindcss binaries can be downloaded and you have the correct versions on the local disk.
|
103
|
-
|
104
|
-
|
105
96
|
## Testing this gem
|
106
97
|
|
107
98
|
### Running the test suite
|
108
99
|
|
109
100
|
The unit tests are run with `bundle exec rspec`
|
110
101
|
|
111
|
-
There is an additional integration test which runs in CI, `spec/integration/user_journey_test.sh` which you may also want to run.
|
112
|
-
|
113
|
-
|
114
102
|
### Testing in a Jekyll project
|
115
103
|
|
116
104
|
If you want to test modifications to this gem, you must run `rake download` once to download the upstream `tailwindcss` executables.
|
@@ -127,11 +115,9 @@ gem "jekyll-tailwindcss", path: "/path/to/jekyll-tailwindcss"
|
|
127
115
|
- [ ] update `lib/jekyll-tailwindcss/version.rb`
|
128
116
|
- [ ] update `CHANGELOG.md`
|
129
117
|
- [ ] commit and create a git tag ( example `git tag -a v0.3.1 -m "Release 0.3.1"` )
|
130
|
-
- build the native gems:
|
131
|
-
- [ ] `bundle exec rake clobber` to clean up possibly old tailwindcss executables
|
132
|
-
- [ ] `bundle exec rake package`
|
133
118
|
- push
|
134
|
-
- [ ] `
|
119
|
+
- [ ] `bundle exec rake build`
|
120
|
+
- [ ] `gem push pkg/*.gem`
|
135
121
|
- [ ] `git push --follow-tags`
|
136
122
|
- announce
|
137
123
|
- [ ] create a release at https://github.com/vormwald/jekyll-tailwindcss/releases
|
data/lib/jekyll-tailwindcss.rb
CHANGED
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 = "jekyll-tailwindcss"
|
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
|
-
jekyll-tailwindcss 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
|
-
TODO 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/vormwald/jekyll-tailwindcss#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
|
"--input", "-",
|
80
10
|
"--config", "./tailwind.config.js"
|
81
11
|
]
|
data/lib/tailwindcss/upstream.rb
CHANGED
@@ -1,17 +1,7 @@
|
|
1
1
|
module Tailwindcss
|
2
2
|
# constants describing the upstream tailwindcss project
|
3
3
|
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
|
-
}
|
4
|
+
VERSION = Tailwindcss::Ruby::Upstream::VERSION
|
5
|
+
deprecate_constant :VERSION
|
16
6
|
end
|
17
7
|
end
|
metadata
CHANGED
@@ -1,16 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-tailwindcss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Vormwald
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
12
|
-
dependencies:
|
13
|
-
|
11
|
+
date: 2024-11-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: tailwindcss-ruby
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description:
|
14
28
|
email:
|
15
29
|
- mvormwald@gmail.com
|
16
30
|
executables:
|
@@ -32,7 +46,7 @@ licenses:
|
|
32
46
|
- MIT
|
33
47
|
metadata:
|
34
48
|
homepage_uri: https://github.com/vormwald/jekyll-tailwindcss
|
35
|
-
post_install_message:
|
49
|
+
post_install_message:
|
36
50
|
rdoc_options: []
|
37
51
|
require_paths:
|
38
52
|
- lib
|
@@ -40,7 +54,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
40
54
|
requirements:
|
41
55
|
- - ">="
|
42
56
|
- !ruby/object:Gem::Version
|
43
|
-
version: 3.
|
57
|
+
version: 3.1.0
|
44
58
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
45
59
|
requirements:
|
46
60
|
- - ">="
|
@@ -48,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
48
62
|
version: '0'
|
49
63
|
requirements: []
|
50
64
|
rubygems_version: 3.5.18
|
51
|
-
signing_key:
|
65
|
+
signing_key:
|
52
66
|
specification_version: 4
|
53
67
|
summary: Integrate Tailwind CSS into your Jekyll site.
|
54
68
|
test_files: []
|