bundlebun 0.5.0.1.4.0-aarch64-linux-gnu → 0.5.1.1.4.1-aarch64-linux-gnu

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: dd6e2138a033680c26126fa9ee87a8d46b009619b75e329b8f0a44363e4861db
4
- data.tar.gz: 8bd61f302f3c0176354756f8ea5dd053f84f3dd27fc748dd83684eb3ef8a4ee0
3
+ metadata.gz: 217ea0838abefdf6e5a056228d838ef34c69d85051bab64674e6aef042339fd7
4
+ data.tar.gz: 997e6a6cdd7f21a28467751f2c38c0923e4d06736c0c2e4fdf48460d6897f055
5
5
  SHA512:
6
- metadata.gz: 91535de3c2401607651d4d5eb717739e767eb718ab75834d74433a2b5f9d7626583e044f19576443a3202d4c163e0e0badea3354137323470fe3e01b8ee7da2d
7
- data.tar.gz: b874f0cce7e52a0def96fbe3fd985471a019cbb231c79a835824a33d6b5c2497c5913e559e7f05ecaec2fd6330e4e5a36f46a0cd219e3a8f8be914b26dfb596d
6
+ metadata.gz: 5e45cd29e1974070bf6b33b95e0999d8dd2c6ff23dbf6691f67dc041b7d5667aade048df16e51389621dbc50951028f17621c2d38cf0419d7d9fff761b046be4
7
+ data.tar.gz: 692dec335969a8c6d8cc3f8fad20468a55affb1a323d0edd3430dd74625f79658cbfe710b29d7f487d30620a58a52fdcea3712c98e9a108afb5f155c380945e8
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [0.5.1] - 2026-09-02
2
+
3
+ - bundlebun is now Ractor-ready.
4
+ - Zeitwerk is no longer a dependency.
5
+ - Bun binaries are now verified against the SHA256 checksums Bun publishes in `SHASUMS256.txt` while building the platform gems. A missing or mismatched checksum aborts the build, so a tampered or corrupted binary is never packaged into a released gem.
6
+
1
7
  ## [0.5.0] - 2026-04-30
2
8
 
3
9
  - Now including Bun builds for `linux-musl` Linux variants [#16].
@@ -11,8 +11,8 @@ module Bundlebun
11
11
  def windows?
12
12
  return @windows if defined?(@windows)
13
13
 
14
- @windows = defined?(RbConfig) && defined?(RbConfig::CONFIG) &&
15
- RbConfig::CONFIG['host_os'].match?(/mswin|mingw|cygwin/)
14
+ @windows = (defined?(RbConfig) && defined?(RbConfig::CONFIG) &&
15
+ RbConfig::CONFIG['host_os'].match?(/mswin|mingw|cygwin/)).freeze
16
16
  end
17
17
  end
18
18
  end
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'shellwords'
4
+ require_relative 'platform'
4
5
 
5
6
  module Bundlebun
6
7
  # {Runner} is the class that bundlebun uses to run the bundled Bun executable.
@@ -101,7 +102,7 @@ module Bundlebun
101
102
  def binstub_path
102
103
  return @binstub_path if defined?(@binstub_path)
103
104
 
104
- @binstub_path = Bundlebun::Platform.windows? ? "#{BINSTUB_PATH}.cmd" : BINSTUB_PATH
105
+ @binstub_path = (Bundlebun::Platform.windows? ? "#{BINSTUB_PATH}.cmd" : BINSTUB_PATH).freeze
105
106
  end
106
107
 
107
108
  # A full path to binstub that bundlebun usually generates with installation Rake tasks.
@@ -112,7 +113,7 @@ module Bundlebun
112
113
  def full_binstub_path
113
114
  return @full_binstub_path if defined?(@full_binstub_path)
114
115
 
115
- @full_binstub_path = File.expand_path(binstub_path)
116
+ @full_binstub_path = File.expand_path(binstub_path).freeze
116
117
  end
117
118
 
118
119
  # A relative directory path to the bundled Bun executable from the root of the gem.
@@ -128,7 +129,7 @@ module Bundlebun
128
129
  def full_directory
129
130
  return @full_directory if defined?(@full_directory)
130
131
 
131
- @full_directory = File.expand_path("../../#{relative_directory}", __dir__)
132
+ @full_directory = File.expand_path("../../#{relative_directory}", __dir__).freeze
132
133
  end
133
134
 
134
135
  # A full path to the bundled Bun binary we run
@@ -139,7 +140,7 @@ module Bundlebun
139
140
  return @binary_path if defined?(@binary_path)
140
141
 
141
142
  executable = "bun#{".exe" if Bundlebun::Platform.windows?}"
142
- @binary_path = File.join(full_directory, executable)
143
+ @binary_path = File.join(full_directory, executable).freeze
143
144
  end
144
145
 
145
146
  # Does the bundled Bun binary exist?
@@ -159,6 +160,22 @@ module Bundlebun
159
160
  binstub_exist? ? full_binstub_path : binary_path
160
161
  end
161
162
 
163
+ # Makes the class-level state shareable between Ractors: computes and
164
+ # memoizes every path, and the platform check they depend on, as frozen
165
+ # values on the main Ractor.
166
+ #
167
+ # A non-main Ractor can read a frozen class-level memo, but it can never
168
+ # write one. So all of them have to be warm before any Ractor is spawned.
169
+ # This runs once, when the file is loaded, so you should not need to call it.
170
+ #
171
+ # @return [void]
172
+ def make_shareable
173
+ Bundlebun::Platform.windows?
174
+ binary_path
175
+ full_binstub_path
176
+ nil
177
+ end
178
+
162
179
  # Does the binstub exist?
163
180
  #
164
181
  # @return [Boolean]
@@ -276,3 +293,5 @@ module Bundlebun
276
293
  end
277
294
  end
278
295
  end
296
+
297
+ Bundlebun::Runner.make_shareable
Binary file
@@ -8,5 +8,5 @@ module Bundlebun
8
8
  # a Bun runtime with version `1.1.38`.
9
9
  #
10
10
  # This constant always points to the "own" version of the gem.
11
- VERSION = '0.5.0'
11
+ VERSION = '0.5.1'
12
12
  end
data/lib/bundlebun.rb CHANGED
@@ -1,6 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'zeitwerk'
3
+ require_relative 'bundlebun/version'
4
+ require_relative 'bundlebun/platform'
5
+ require_relative 'bundlebun/env_path'
6
+ require_relative 'bundlebun/runner'
7
+ require_relative 'bundlebun/integrations'
8
+ require_relative 'bundlebun/integrations/cssbundling'
9
+ require_relative 'bundlebun/integrations/execjs'
10
+ require_relative 'bundlebun/integrations/jsbundling'
11
+ require_relative 'bundlebun/integrations/vite_ruby'
4
12
 
5
13
  # bundlebun bundles [Bun](https://bun.sh), a fast JavaScript runtime, package manager
6
14
  # and builder, with your Ruby and Rails applications.
@@ -87,18 +95,6 @@ module Bundlebun
87
95
  Runner.system(...)
88
96
  end
89
97
 
90
- def loader # @private
91
- @loader ||= Zeitwerk::Loader.for_gem.tap do |loader|
92
- loader.ignore("#{__dir__}/tasks")
93
- loader.ignore("#{__dir__}/bundlebun/vendor")
94
- loader.ignore("#{__dir__}/templates")
95
-
96
- loader.inflector.inflect('execjs' => 'ExecJS')
97
-
98
- loader.setup
99
- end
100
- end
101
-
102
98
  # Prepend the path to the bundled Bun executable to `PATH`.
103
99
  #
104
100
  # @see Bundlebun::Runner.full_directory
@@ -108,7 +104,7 @@ module Bundlebun
108
104
 
109
105
  # Load included Rake tasks (like `bun:install`).
110
106
  def load_tasks
111
- Dir[File.expand_path('tasks/*.rake', __dir__)].each { |task| load task }
107
+ Dir[File.expand_path('tasks/*.rake', __dir__)].each { |task| Rake.load_rakefile(task) }
112
108
  end
113
109
 
114
110
  # Detect and load all integrations (monkey-patches).
@@ -124,7 +120,6 @@ module Bundlebun
124
120
  end
125
121
  end
126
122
 
127
- Bundlebun.loader
128
123
  Bundlebun.prepend_to_path
129
124
  Bundlebun.load_tasks if defined?(Rake)
130
125
  Bundlebun.load_integrations
@@ -21,6 +21,9 @@ module Bundlebun
21
21
  def self.binstub_or_binary_path: () -> String
22
22
  def self.binstub_exist?: () -> bool
23
23
 
24
+ # Memoizes every path as frozen values on the main Ractor. Runs when the file is loaded.
25
+ def self.make_shareable: () -> void
26
+
24
27
  def initialize: (String | Array[String] arguments) -> void
25
28
 
26
29
  # Replaces the current Ruby process with Bun. Never returns.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundlebun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0.1.4.0
4
+ version: 0.5.1.1.4.1
5
5
  platform: aarch64-linux-gnu
6
6
  authors:
7
7
  - Yaroslav Markin
@@ -9,20 +9,6 @@ bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
- - !ruby/object:Gem::Dependency
13
- name: zeitwerk
14
- requirement: !ruby/object:Gem::Requirement
15
- requirements:
16
- - - "~>"
17
- - !ruby/object:Gem::Version
18
- version: '2.5'
19
- type: :runtime
20
- prerelease: false
21
- version_requirements: !ruby/object:Gem::Requirement
22
- requirements:
23
- - - "~>"
24
- - !ruby/object:Gem::Version
25
- version: '2.5'
26
12
  - !ruby/object:Gem::Dependency
27
13
  name: json
28
14
  requirement: !ruby/object:Gem::Requirement