tailwindcss_merger 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 510d735c124dd43869384ae043cdba070934d95bc1e867adcaa5812dd21bccf4
4
+ data.tar.gz: cd91bd57a754c4c8963cefec427c9bdc1e365b6a246203206604e765a758f02d
5
+ SHA512:
6
+ metadata.gz: 499b95641bacc5051746b233d4d5a54094ceac1dca7ef5f01159269a2a745a16c26ca74ca2476b4a5a21ccec4c1b70301788bc6ced6b4f71dc75c06c200d60c3
7
+ data.tar.gz: b4530a55c79d4e0dee0820eb7145ecbc2afa84d064fde7591d07d030a0d7d4f03855a3d6704b87d987bf41a53a29aa67349e024dbf33d90f54c42cfd553b04fc
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2022 loqimean
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,52 @@
1
+ # TailwindcssMerger
2
+
3
+ This gem gives you a simple way to use many files with components in your project where you are using gem `tailwindcss-rails`.
4
+
5
+ ## Usage
6
+
7
+ Well, just follow this three easy steps:
8
+
9
+ 1. Install gem `bundle add tailwindcss_merger`
10
+ 2. Create folder `app/assets/tailwindcss_stylesheets`
11
+ 3. Add files with your styles into this folder, like this:
12
+
13
+ ```
14
+ .
15
+ ├── app
16
+ │ └── assets
17
+ │ │ └── tailwindcss_stylesheets
18
+ ```
19
+
20
+ ## Installation
21
+
22
+ Add this line to your application's Gemfile:
23
+
24
+ ```ruby
25
+ gem "tailwindcss_merger"
26
+ ```
27
+
28
+ Or just do this:
29
+
30
+ ```
31
+ bundle add tailwindcss_merger
32
+ ```
33
+
34
+ And then execute:
35
+
36
+ ```bash
37
+ bundle
38
+ ```
39
+
40
+ Or install it yourself as:
41
+
42
+ ```bash
43
+ gem install tailwindcss_merger
44
+ ```
45
+
46
+ ## Contributing
47
+
48
+ For your applying your changes just create pull request with assigning to me.
49
+
50
+ ## License
51
+
52
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,3 @@
1
+ require "bundler/setup"
2
+
3
+ require "bundler/gem_tasks"
@@ -0,0 +1,11 @@
1
+ module TailwindcssMerger
2
+ class Railtie < ::Rails::Railtie
3
+ railtie_name :tailwindcss_merger
4
+
5
+ rake_tasks do
6
+ path = File.expand_path(__dir__)
7
+
8
+ Dir.glob("#{path}/../tasks/**/*.rake").each { |f| load f }
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ module TailwindcssMerger
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,6 @@
1
+ require "tailwindcss_merger/version"
2
+ require "tailwindcss_merger/railtie"
3
+ require 'listen'
4
+
5
+ module TailwindcssMerger
6
+ end
@@ -0,0 +1,43 @@
1
+ # Loading tailwindcss-rails tasks
2
+ tailwindcss_rails_path = Pathname.new("#{Gem.find_files('tailwindcss-rails.rb').first}").dirname
3
+ load "#{tailwindcss_rails_path}/tasks/build.rake"
4
+
5
+ namespace :csspacker do
6
+ desc 'Packs all CSS files from app/assets/tailwindcss_stylesheets into app/assets/application.tailwind.css
7
+ then runs the tailwindcss:build'
8
+ task :build do
9
+ files = Dir['./app/assets/tailwindcss_stylesheets/**/*.css']
10
+
11
+ File.open('./app/assets/stylesheets/application.tailwind.css', 'w') do |main_file|
12
+ main_file.write("/* GENERATED FILE! */\n")
13
+ main_file.write("@tailwind base;\n")
14
+ main_file.write("@tailwind components;\n")
15
+ main_file.write("@tailwind utilities;\n")
16
+ main_file.write("\n")
17
+
18
+ files.each do |file_path|
19
+ File.open(file_path, 'r') do |file|
20
+ loop do
21
+ main_file.write(file.readline)
22
+ rescue StandardError
23
+ main_file.write("\n")
24
+ break
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
30
+
31
+ desc 'Runs tailwindcss:build on changes in directory app/assets/tailwindcss_stylesheets'
32
+
33
+ task :watch do
34
+ listen = Listen.to(Rails.root.join('app', 'assets', 'tailwindcss_stylesheets')) do
35
+ Rake::Task['csspacker:build'].execute
36
+ end
37
+
38
+ listen.start
39
+ end
40
+ end
41
+
42
+ Rake::Task['tailwindcss:build'].enhance(['csspacker:build'])
43
+ Rake::Task['tailwindcss:watch'].enhance(['csspacker:watch'])
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tailwindcss_merger
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - loqimean
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-02-19 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 6.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 6.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: listen
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'
41
+ - !ruby/object:Gem::Dependency
42
+ name: tailwindcss-rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rake
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: Simple way for using to many files of styles with tailwindcss-rails gem
70
+ or just tailwind. Make it easy.
71
+ email:
72
+ - vanuha277@gmail.com
73
+ executables: []
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - MIT-LICENSE
78
+ - README.md
79
+ - Rakefile
80
+ - lib/tailwindcss_merger.rb
81
+ - lib/tailwindcss_merger/railtie.rb
82
+ - lib/tailwindcss_merger/version.rb
83
+ - lib/tasks/csspacker.rake
84
+ homepage: https://github.com/loqimean/tailwindcss_merger
85
+ licenses:
86
+ - MIT
87
+ metadata:
88
+ allowed_push_host: https://rubygems.org
89
+ homepage_uri: https://github.com/loqimean/tailwindcss_merger
90
+ source_code_uri: https://github.com/loqimean/tailwindcss_merger
91
+ post_install_message:
92
+ rdoc_options: []
93
+ require_paths:
94
+ - lib
95
+ required_ruby_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ required_rubygems_version: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
105
+ requirements: []
106
+ rubygems_version: 3.2.3
107
+ signing_key:
108
+ specification_version: 4
109
+ summary: Extension to tailwindcss-rails gem for adding possibility of using multiple
110
+ files.
111
+ test_files: []