cssbundling-rails 1.3.0 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cssbundling/version.rb +1 -1
- data/lib/install/install.rb +1 -1
- data/lib/tasks/cssbundling/build.rake +20 -14
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 643412ab70b4a60ccf019381db175e18fb2e779c34439cf89c19d0caa3a8dfd5
|
4
|
+
data.tar.gz: 80888732e4252b4e59ef90843010ef5dd6cf3e395c72ea8d2539c27557752dec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a14d2636c1b596f6cd4106c9214b1963f1f5e65329b3beaa27557de5dbfa6e57dcb9c688130e11ce75fc68a823fad74fddc3e3a14557e1fa6d3e663dc22a05a1
|
7
|
+
data.tar.gz: 687cd595a551a1feef7279fe59ff8a6a4c623e00c35b33aeb4a3dc13259f89f548e8a6ece4d1c7d727cedb71dd3feb88f4a8577278eba825f1074d6606286185
|
data/lib/cssbundling/version.rb
CHANGED
data/lib/install/install.rb
CHANGED
@@ -47,7 +47,7 @@ if Rails.root.join("Procfile.dev").exist?
|
|
47
47
|
append_to_file "Procfile.dev", "css: #{bundler_run_cmd} build:css --watch\n"
|
48
48
|
else
|
49
49
|
say "Add default Procfile.dev"
|
50
|
-
copy_file "#{__dir__}/#{using_bun? ? "Procfile_for_bun" : "Procfile_for_node"}", "Procfile.dev"
|
50
|
+
copy_file "#{__dir__}/#{using_bun? ? "Procfile_for_bun.dev" : "Procfile_for_node.dev"}", "Procfile.dev"
|
51
51
|
|
52
52
|
say "Ensure foreman is installed"
|
53
53
|
run "gem install foreman"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
namespace :css do
|
2
2
|
desc "Install JavaScript dependencies"
|
3
3
|
task :install do
|
4
|
-
command = install_command
|
4
|
+
command = Cssbundling::Tasks.install_command
|
5
5
|
unless system(command)
|
6
6
|
raise "cssbundling-rails: Command install failed, ensure #{command.split.first} is installed"
|
7
7
|
end
|
@@ -9,7 +9,7 @@ namespace :css do
|
|
9
9
|
|
10
10
|
desc "Build your CSS bundle"
|
11
11
|
build_task = task :build do
|
12
|
-
command = build_command
|
12
|
+
command = Cssbundling::Tasks.build_command
|
13
13
|
unless system(command)
|
14
14
|
raise "cssbundling-rails: Command build failed, ensure `#{command}` runs without errors"
|
15
15
|
end
|
@@ -17,20 +17,26 @@ namespace :css do
|
|
17
17
|
build_task.prereqs << :install unless ENV["SKIP_YARN_INSTALL"] || ENV["SKIP_BUN_INSTALL"]
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
raise "cssbundling-rails: No suitable tool found for installing JavaScript dependencies"
|
24
|
-
end
|
20
|
+
module Cssbundling
|
21
|
+
module Tasks
|
22
|
+
extend self
|
25
23
|
|
26
|
-
def
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end
|
24
|
+
def install_command
|
25
|
+
return "bun install" if File.exist?('bun.lockb') || (tool_exists?('bun') && !File.exist?('yarn.lock'))
|
26
|
+
return "yarn install" if File.exist?('yarn.lock') || tool_exists?('yarn')
|
27
|
+
raise "cssbundling-rails: No suitable tool found for installing JavaScript dependencies"
|
28
|
+
end
|
31
29
|
|
32
|
-
def
|
33
|
-
|
30
|
+
def build_command
|
31
|
+
return "bun run build:css" if File.exist?('bun.lockb') || (tool_exists?('bun') && !File.exist?('yarn.lock'))
|
32
|
+
return "yarn build:css" if File.exist?('yarn.lock') || tool_exists?('yarn')
|
33
|
+
raise "cssbundling-rails: No suitable tool found for building CSS"
|
34
|
+
end
|
35
|
+
|
36
|
+
def tool_exists?(tool)
|
37
|
+
system "command -v #{tool} > /dev/null"
|
38
|
+
end
|
39
|
+
end
|
34
40
|
end
|
35
41
|
|
36
42
|
unless ENV["SKIP_CSS_BUILD"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cssbundling-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-09-
|
12
|
+
date: 2023-09-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: railties
|