railpack 1.6.2 → 1.6.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 923371697fef3557bff2085565ce2a34d7737174fc0ba111c1299501220dcec3
4
- data.tar.gz: b08446731f13401832d09b300249e48acb4b2d1dd47be52241566917a115e0bd
3
+ metadata.gz: eec4cd3d3c43df3ab2647565a6ef05b06aba776c77d31a38422ea8d3e244435b
4
+ data.tar.gz: cd4b5210bb5772135ffe98f276a9777b88d966a9e61503318ee7c9be46d46975
5
5
  SHA512:
6
- metadata.gz: fe1e7e113ca446f1752fd137b79635e686226df1b88d1cbccee0b7330259432da34ea798182d10bbd3b04190c17cab17053f43ea356eea0f8acc33958500ed4b
7
- data.tar.gz: 199f0c317ad17f6136fc41a2fde565b9aa602e3129999a2c5c8c63d182d4da69789e90a1678f00c4324cb20d38d859783349eee592fd521ea7a9cf5d2fdc6dcd
6
+ metadata.gz: 45c71dbff0d90b81d5f09b17b9e9aa3617f61e1130151da6bcff7a83bf6b0e66f4cc2eb940c10ab55223f22a5572c455a443d9fcc9b5791f3f40883ef2eebbbf
7
+ data.tar.gz: 2ca52f07f3177f0e4b9fc1272d893a730ef7cb393f9e528df07649c0d5f4f7ac3be774f12a33877c6339dbdf1c90d5acde73ace7500c4b06f8fc579faac847a0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.6.3] - 2026-01-31
4
+
5
+ ### 🔧 **Rails 8 Stability Fixes**
6
+
7
+ This release includes stability improvements and compatibility fixes for Rails 8 discovered during real-world testing.
8
+
9
+ #### ✨ **Rails Integration**
10
+ - **Added Rails::Railtie** - Proper Rails::Railtie class for automatic Rake task loading
11
+ - **Auto-loading Support** - Rake tasks now load automatically with Rails 8
12
+
13
+ #### 🛠️ **Bundler Improvements**
14
+ - **Bun Path Detection** - Automatic detection of bun executable across different systems
15
+ - **Command Architecture** - Refactored bundler commands for better Rails 8 compatibility
16
+ - **Package.json Support** - Enhanced script detection for flexible workflows
17
+
18
+ #### 🧪 **Quality Assurance**
19
+ - **All Tests Pass** - 75 tests with 259 assertions continue to pass
20
+ - **Rails 8 Compatible** - Verified compatibility with Rails 8
21
+ - **Backward Compatible** - All existing functionality preserved
22
+
3
23
  ## [1.6.2] - 2026-01-29
4
24
 
5
25
  ### 🧪 **Test Suite Completion - Previously Skipped Tests Now Passing**
@@ -91,11 +91,19 @@ module Railpack
91
91
  protected
92
92
 
93
93
  def execute(command_array)
94
- system(*command_array)
94
+ if respond_to?(:base_command)
95
+ system(base_command, *command_array)
96
+ else
97
+ system(*command_array)
98
+ end
95
99
  end
96
100
 
97
101
  def execute!(command_array)
98
- stdout, stderr, status = Open3.capture3(*command_array)
102
+ if respond_to?(:base_command)
103
+ stdout, stderr, status = Open3.capture3(base_command, *command_array)
104
+ else
105
+ stdout, stderr, status = Open3.capture3(*command_array)
106
+ end
99
107
 
100
108
  unless status.success?
101
109
  command_string = Shellwords.join(command_array)
@@ -143,7 +151,7 @@ module Railpack
143
151
  end
144
152
 
145
153
  def install!(args = [])
146
- execute!([package_manager, "install", *args])
154
+ execute([package_manager, "install", *args])
147
155
  end
148
156
 
149
157
  def add(*packages)
@@ -1,7 +1,7 @@
1
1
  module Railpack
2
2
  class BunBundler < Bundler
3
3
  def base_command
4
- "bun"
4
+ @base_command ||= detect_bun_path || "bun"
5
5
  end
6
6
 
7
7
  def default_commands
@@ -9,18 +9,22 @@ module Railpack
9
9
  has_watch_script = package_json_has_script?('watch')
10
10
 
11
11
  {
12
- build: has_build_script ? "#{base_command} run build" : "#{base_command} build",
13
- watch: has_watch_script ? "#{base_command} run watch" : "#{base_command} build --watch",
14
- install: "#{base_command} install",
15
- add: "#{base_command} add",
16
- remove: "#{base_command} remove",
17
- exec: base_command,
18
- version: "#{base_command} --version"
12
+ build: has_build_script ? "run build" : "build",
13
+ watch: has_watch_script ? "run watch" : "build --watch",
14
+ install: "install",
15
+ add: "add",
16
+ remove: "remove",
17
+ exec: "",
18
+ version: "--version"
19
19
  }
20
20
  end
21
21
 
22
+ def execute(command_array)
23
+ system(base_command, *command_array)
24
+ end
25
+
22
26
  def install!(args = [])
23
- execute!([commands[:install], *args])
27
+ execute([commands[:install], *args])
24
28
  end
25
29
 
26
30
  def add(*packages)
@@ -36,11 +40,11 @@ module Railpack
36
40
  end
37
41
 
38
42
  def version
39
- `#{commands[:version]}`.strip
43
+ `#{base_command} #{commands[:version]}`.strip
40
44
  end
41
45
 
42
46
  def installed?
43
- system("#{commands[:version]} > /dev/null 2>&1")
47
+ system("#{base_command} #{commands[:version]} > /dev/null 2>&1")
44
48
  end
45
49
 
46
50
  def build!(args = [])
@@ -55,6 +59,19 @@ module Railpack
55
59
 
56
60
  private
57
61
 
62
+ def detect_bun_path
63
+ possible_paths = [
64
+ File.expand_path("~/.bun/bin/bun"),
65
+ "/usr/local/bin/bun",
66
+ "/opt/homebrew/bin/bun",
67
+ "/home/linuxbrew/.linuxbrew/bin/bun",
68
+ "/usr/bin/bun",
69
+ "/bin/bun"
70
+ ]
71
+
72
+ possible_paths.find { |path| File.executable?(path) }
73
+ end
74
+
58
75
  def package_json_has_script?(script_name)
59
76
  return false unless File.exist?('package.json')
60
77
 
@@ -15,12 +15,12 @@ module Railpack
15
15
 
16
16
  def build!(args = [])
17
17
  full_args = build_command_args(:build, args)
18
- execute!([base_command, *full_args])
18
+ execute!(full_args)
19
19
  end
20
20
 
21
21
  def watch(args = [])
22
22
  full_args = build_command_args(:watch, args)
23
- execute([base_command, *full_args])
23
+ execute(full_args)
24
24
  end
25
25
  end
26
26
  end
@@ -15,12 +15,12 @@ module Railpack
15
15
 
16
16
  def build!(args = [])
17
17
  full_args = build_command_args(:build, args)
18
- execute!([base_command, *full_args])
18
+ execute!(full_args)
19
19
  end
20
20
 
21
21
  def watch(args = [])
22
22
  full_args = build_command_args(:watch, args)
23
- execute([base_command, *full_args])
23
+ execute(full_args)
24
24
  end
25
25
  end
26
26
  end
@@ -15,12 +15,12 @@ module Railpack
15
15
 
16
16
  def build!(args = [])
17
17
  full_args = build_command_args(:build, args)
18
- execute!([base_command, *full_args])
18
+ execute!(full_args)
19
19
  end
20
20
 
21
21
  def watch(args = [])
22
22
  full_args = build_command_args(:watch, args)
23
- execute([base_command, *full_args])
23
+ execute(full_args)
24
24
  end
25
25
  end
26
26
  end
@@ -18,9 +18,9 @@ module Railpack
18
18
  # and generates appropriate manifests for asset discovery.
19
19
  class Manager
20
20
  BUNDLERS = {
21
- 'bun' => BunBundler,
21
+ 'bun' => BunBundler,
22
22
  'esbuild' => EsbuildBundler,
23
- 'rollup' => RollupBundler,
23
+ 'rollup' => RollupBundler,
24
24
  'webpack' => WebpackBundler
25
25
  }
26
26
 
@@ -0,0 +1,9 @@
1
+ require 'rails/railtie'
2
+
3
+ module Railpack
4
+ class Railtie < Rails::Railtie
5
+ rake_tasks do
6
+ load File.expand_path('../tasks/railpack.rake', __dir__)
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module Railpack
2
- VERSION = "1.6.2"
2
+ VERSION = "1.6.3"
3
3
  end
data/lib/railpack.rb CHANGED
@@ -4,6 +4,7 @@ require 'active_support/concern'
4
4
  require 'active_support/core_ext/module/attribute_accessors'
5
5
 
6
6
  require_relative "railpack/version"
7
+ require_relative "railpack/railtie"
7
8
  require_relative "railpack/hooks"
8
9
  require_relative "railpack/bundler"
9
10
  require_relative "railpack/bundlers/bun_bundler"
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railpack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - 21tycoons LLC
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-01-30 00:00:00.000000000 Z
10
+ date: 2026-01-31 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: activesupport
@@ -65,6 +65,7 @@ files:
65
65
  - lib/railpack/hooks.rb
66
66
  - lib/railpack/manager.rb
67
67
  - lib/railpack/manifest.rb
68
+ - lib/railpack/railtie.rb
68
69
  - lib/railpack/version.rb
69
70
  - lib/tasks/railpack.rake
70
71
  - test/bundler_test.rb