bundlebun 0.2.3.1.3.6-x86_64-linux → 0.3.0.1.3.8-x86_64-linux
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/CHANGELOG.md +6 -0
- data/README.md +5 -3
- data/lib/bundlebun/vendor/bun/bun +0 -0
- data/lib/bundlebun/version.rb +1 -1
- data/lib/tasks/install.rake +132 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9ae009c76b7bd168879700c9b45f9038374971485ddcc7dd58ddf7587a70d684
|
|
4
|
+
data.tar.gz: 18c85d6ff1e1b3f6988a7274cf6a966b1237b35e7e3a6ebfcaed0ccc330ced73
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 48b3e9edae824ebda8b6284dd2665fe6d812a72debda08a07b2e0d39d1a49c3a7fd21b895f99efaf28954a3f5eb9a085e632fbb3760f67529eae3c004c9dfa14
|
|
7
|
+
data.tar.gz: 3f6f3424cc65b7a872c7302853a80784b8cc67faab442816a105ab6c38cbd7e72b092b3f8edc228684d935fc987138e764814bb82c527e942779e9a4c9434fb6
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [0.3.0] - 2026-01-29
|
|
2
|
+
|
|
3
|
+
- New `rake bun:install:package` task: automatically migrates `package.json` scripts to use `bin/bun`. Replaces calls to `bun`, `bunx`, `npx`, `npm run`, `yarn run`, `pnpm run`, and `pnpm exec` with their `bin/bun` equivalents. Asks for confirmation.
|
|
4
|
+
- New `rake bun:install:procfile` task: automatically migrates `Procfile` and `Procfile.*` files to use `bin/bun`. Same as above.
|
|
5
|
+
- Both tasks are automatically invoked by `rake bun:install` when the relevant files are detected.
|
|
6
|
+
|
|
1
7
|
## [0.2.3] - 2025-12-17
|
|
2
8
|
|
|
3
9
|
- Update dependencies
|
data/README.md
CHANGED
|
@@ -71,8 +71,8 @@ bundle install
|
|
|
71
71
|
bundle add bundlebun
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
(aarch64-linux, aarch64-linux-gnu <...> )`, [check this article](https://github.com/yaroslav/bundlebun/wiki/Could-not-find-gems-matching-'bundlebun'-valid-for-all-resolution-platforms).
|
|
74
|
+
_If you're seeing a message like `Could not find gems matching 'bundlebun' valid for all resolution platforms
|
|
75
|
+
(aarch64-linux, aarch64-linux-gnu <...> )`, [check this article](https://github.com/yaroslav/bundlebun/wiki/Could-not-find-gems-matching-'bundlebun'-valid-for-all-resolution-platforms)._
|
|
76
76
|
|
|
77
77
|
Next, run:
|
|
78
78
|
|
|
@@ -82,7 +82,9 @@ rake bun:install
|
|
|
82
82
|
|
|
83
83
|
The task will install a binstub (`bin/bun`) that you can use to run Bun commands; try running `bin/bun` or `bin/bun --version`.
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
If `package.json` is present, the installer will offer to migrate your scripts to use `bin/bun` (e.g., `bun` → `bin/bun`, `npx` → `bin/bun x`). You can also run `rake bun:install:package` manually later.
|
|
86
|
+
|
|
87
|
+
Similarly, if `Procfile` or `Procfile.*` files are present, the installer will offer to migrate those as well. Run `rake bun:install:procfile` manually if needed.
|
|
86
88
|
|
|
87
89
|
_Windows tip:_ If you're on Windows, the `bin\bun.cmd` file will be created. If you've joined an existing project where only the Unix-like binstub exists at that location, just run `rake bun:install` again.
|
|
88
90
|
|
|
Binary file
|
data/lib/bundlebun/version.rb
CHANGED
data/lib/tasks/install.rake
CHANGED
|
@@ -26,6 +26,16 @@ namespace :bun do
|
|
|
26
26
|
puts "vite-ruby detected.\n\n"
|
|
27
27
|
Rake::Task['bun:install:vite'].invoke
|
|
28
28
|
end
|
|
29
|
+
|
|
30
|
+
if File.exist?('package.json')
|
|
31
|
+
puts "package.json detected.\n\n"
|
|
32
|
+
Rake::Task['bun:install:package'].invoke
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
if Dir.glob('Procfile*').any?
|
|
36
|
+
puts "Procfile detected.\n\n"
|
|
37
|
+
Rake::Task['bun:install:procfile'].invoke
|
|
38
|
+
end
|
|
29
39
|
end
|
|
30
40
|
|
|
31
41
|
desc 'Install bundlebun: create `bin/bun` binstub'
|
|
@@ -170,4 +180,126 @@ namespace :bun do
|
|
|
170
180
|
|
|
171
181
|
MESSAGE
|
|
172
182
|
end
|
|
183
|
+
|
|
184
|
+
desc 'Migrate package.json scripts to use bin/bun'
|
|
185
|
+
task 'install:package' do
|
|
186
|
+
package_json_path = 'package.json'
|
|
187
|
+
|
|
188
|
+
unless File.exist?(package_json_path)
|
|
189
|
+
puts "No package.json found in the current directory."
|
|
190
|
+
next
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
begin
|
|
194
|
+
package = JSON.parse(File.read(package_json_path))
|
|
195
|
+
rescue JSON::ParserError
|
|
196
|
+
puts "Failed to parse package.json."
|
|
197
|
+
next
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
scripts = package['scripts']
|
|
201
|
+
if scripts.nil? || scripts.empty?
|
|
202
|
+
puts "No scripts found in package.json."
|
|
203
|
+
next
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# Order in alternation matters: more specific patterns first
|
|
207
|
+
pattern = /\b(bunx|npx|pnpm exec|yarn exec|npm run|yarn run|pnpm run|bun)\b/
|
|
208
|
+
binstub = Bundlebun::Runner.binstub_path
|
|
209
|
+
replacements = {
|
|
210
|
+
'bunx' => "#{binstub} x",
|
|
211
|
+
'npx' => "#{binstub} x",
|
|
212
|
+
'pnpm exec' => "#{binstub} x",
|
|
213
|
+
'yarn exec' => "#{binstub} x",
|
|
214
|
+
'npm run' => "#{binstub} run",
|
|
215
|
+
'yarn run' => "#{binstub} run",
|
|
216
|
+
'pnpm run' => "#{binstub} run",
|
|
217
|
+
'bun' => binstub
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
changes = []
|
|
221
|
+
scripts.each do |name, value|
|
|
222
|
+
next unless value.is_a?(String)
|
|
223
|
+
next if value.include?(Bundlebun::Runner::BINSTUB_PATH)
|
|
224
|
+
|
|
225
|
+
new_value = value.gsub(pattern) { |match| replacements[match] }
|
|
226
|
+
changes << {name: name, old: value, new: new_value} if new_value != value
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
if changes.empty?
|
|
230
|
+
puts "All scripts in package.json already use bin/bun. No changes needed."
|
|
231
|
+
next
|
|
232
|
+
end
|
|
233
|
+
|
|
234
|
+
puts "The following changes will be made to package.json scripts:\n\n"
|
|
235
|
+
changes.each do |change|
|
|
236
|
+
puts " #{change[:name]}:"
|
|
237
|
+
puts " - #{change[:old]}"
|
|
238
|
+
puts " + #{change[:new]}"
|
|
239
|
+
puts
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
print "Apply these changes? [Y/n] "
|
|
243
|
+
answer = $stdin.gets&.strip&.downcase
|
|
244
|
+
|
|
245
|
+
if answer.empty? || answer == 'y' || answer == 'yes'
|
|
246
|
+
changes.each do |change|
|
|
247
|
+
package['scripts'][change[:name]] = change[:new]
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
File.write(package_json_path, JSON.pretty_generate(package) + "\n")
|
|
251
|
+
puts "\nUpdated package.json successfully."
|
|
252
|
+
else
|
|
253
|
+
puts "\nNo changes made."
|
|
254
|
+
end
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
desc 'Migrate Procfile commands to use bin/bun'
|
|
258
|
+
task 'install:procfile' do
|
|
259
|
+
procfiles = Dir.glob('Procfile*')
|
|
260
|
+
|
|
261
|
+
if procfiles.empty?
|
|
262
|
+
puts "No Procfile found in the current directory."
|
|
263
|
+
next
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
pattern = /\b(bunx|npx|pnpm exec|yarn exec|npm run|yarn run|pnpm run|bun)\b/
|
|
267
|
+
binstub = Bundlebun::Runner.binstub_path
|
|
268
|
+
replacements = {
|
|
269
|
+
'bunx' => "#{binstub} x",
|
|
270
|
+
'npx' => "#{binstub} x",
|
|
271
|
+
'pnpm exec' => "#{binstub} x",
|
|
272
|
+
'yarn exec' => "#{binstub} x",
|
|
273
|
+
'npm run' => "#{binstub} run",
|
|
274
|
+
'yarn run' => "#{binstub} run",
|
|
275
|
+
'pnpm run' => "#{binstub} run",
|
|
276
|
+
'bun' => binstub
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
procfiles.each do |procfile|
|
|
280
|
+
content = File.read(procfile)
|
|
281
|
+
next if content.include?(Bundlebun::Runner::BINSTUB_PATH)
|
|
282
|
+
|
|
283
|
+
new_content = content.gsub(pattern) { |match| replacements[match] }
|
|
284
|
+
next if new_content == content
|
|
285
|
+
|
|
286
|
+
puts "Changes for #{procfile}:\n\n"
|
|
287
|
+
content.lines.zip(new_content.lines).each do |old_line, new_line|
|
|
288
|
+
if old_line != new_line
|
|
289
|
+
puts " - #{old_line}"
|
|
290
|
+
puts " + #{new_line}"
|
|
291
|
+
end
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
print "Apply these changes? [Y/n] "
|
|
295
|
+
answer = $stdin.gets&.strip&.downcase
|
|
296
|
+
|
|
297
|
+
if answer.empty? || answer == 'y' || answer == 'yes'
|
|
298
|
+
File.write(procfile, new_content)
|
|
299
|
+
puts "Updated #{procfile} successfully.\n\n"
|
|
300
|
+
else
|
|
301
|
+
puts "No changes made to #{procfile}.\n\n"
|
|
302
|
+
end
|
|
303
|
+
end
|
|
304
|
+
end
|
|
173
305
|
end
|