jsbundling-rails 1.2.0 → 1.2.1
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/lib/jsbundling/version.rb +1 -1
- data/lib/tasks/jsbundling/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: 1bf6310c232f781ceda13fc2e44c0196884afdfe50318f6136a6e95c403f2521
|
4
|
+
data.tar.gz: 296b8a667e1fe8295b7efe1f59185a4ca4a4aa7ccd18697e8e4a1e93c02d2257
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d851108dd46513415cc8645a11992fff06181d94580e9681615d12e0ec8ce1ef7b9ed542c807933c7ad66ac60f710e2037533e003a4d30a65026f4b687e9b8eb
|
7
|
+
data.tar.gz: efbffe3102d9cd3a746d76f55241413c0015d3bd8b7fe6120f6a4ac9b2e64c6d3a563d2a2182e44f33983977a75315c257230bf91a2da040e44482b10926f73d
|
data/lib/jsbundling/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
namespace :javascript do
|
2
2
|
desc "Install JavaScript dependencies"
|
3
3
|
task :install do
|
4
|
-
command = install_command
|
4
|
+
command = Jsbundling::Tasks.install_command
|
5
5
|
unless system(command)
|
6
6
|
raise "jsbundling-rails: Command install failed, ensure #{command.split.first} is installed"
|
7
7
|
end
|
@@ -9,7 +9,7 @@ namespace :javascript do
|
|
9
9
|
|
10
10
|
desc "Build your JavaScript bundle"
|
11
11
|
build_task = task :build do
|
12
|
-
command = build_command
|
12
|
+
command = Jsbundling::Tasks.build_command
|
13
13
|
unless system(command)
|
14
14
|
raise "jsbundling-rails: Command build failed, ensure `#{command}` runs without errors"
|
15
15
|
end
|
@@ -18,20 +18,26 @@ namespace :javascript do
|
|
18
18
|
build_task.prereqs << :install unless ENV["SKIP_YARN_INSTALL"] || ENV["SKIP_BUN_INSTALL"]
|
19
19
|
end
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
raise "jsbundling-rails: No suitable tool found for installing JavaScript dependencies"
|
25
|
-
end
|
21
|
+
module Jsbundling
|
22
|
+
module Tasks
|
23
|
+
extend self
|
26
24
|
|
27
|
-
def
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
end
|
25
|
+
def install_command
|
26
|
+
return "bun install" if File.exist?('bun.lockb') || (tool_exists?('bun') && !File.exist?('yarn.lock'))
|
27
|
+
return "yarn install" if File.exist?('yarn.lock') || tool_exists?('yarn')
|
28
|
+
raise "jsbundling-rails: No suitable tool found for installing JavaScript dependencies"
|
29
|
+
end
|
32
30
|
|
33
|
-
def
|
34
|
-
|
31
|
+
def build_command
|
32
|
+
return "bun run build" if File.exist?('bun.lockb') || (tool_exists?('bun') && !File.exist?('yarn.lock'))
|
33
|
+
return "yarn build" if File.exist?('yarn.lock') || tool_exists?('yarn')
|
34
|
+
raise "jsbundling-rails: No suitable tool found for building JavaScript"
|
35
|
+
end
|
36
|
+
|
37
|
+
def tool_exists?(tool)
|
38
|
+
system "command -v #{tool} > /dev/null"
|
39
|
+
end
|
40
|
+
end
|
35
41
|
end
|
36
42
|
|
37
43
|
unless ENV["SKIP_JS_BUILD"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsbundling-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-09-
|
11
|
+
date: 2023-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|