Commit 88a8654
feat: add comprehensive Bun package manager support (#257)
* feat: add comprehensive Bun package manager support
This commit introduces full Bun package manager integration to the CircleCI Node orb,
adding Bun as a first-class supported package manager alongside npm, yarn, yarn-berry, and pnpm.
## Core Installation Infrastructure
- Add install-bun command with version management and retry logic
- Add Bun installation script with automatic version detection
- Integrate bun-version parameter into main install command
- Support for both specific versions and latest stable releases
## Package Management Integration
- Add 'bun' to pkg-manager enum across all commands and jobs
- Implement bun-install.sh with frozen lockfile default for reproducible builds
- Add support for both bun.lock (text) and bun.lockb (binary) lockfiles
- Configure cache support via BUN_INSTALL_CACHE_DIR environment variable
- Default cache path: ~/.bun/install/cache with override capability
## Job Execution Support
- Add bun-run parameter to run job for script execution
- Integrate Bun command execution in run-commands-with.sh
- Add Bun test runner support with native JUnit XML output
- Support Jest and Mocha test frameworks via Bun's built-in test runner
## Testing & CI Integration
- Add comprehensive integration tests for all Bun functionality:
- Installation (specific versions and latest)
- Package installation with caching
- Test execution (Jest/Mocha compatibility)
- Script execution via bun run
- Cross-platform support (Linux, macOS, machine)
- Multi-architecture support (ARM64, x86_64)
## Documentation & Examples
- Create three example configurations:
- bun_install.yml: Basic Bun installation and package management
- node_bun_run.yml: Script execution with Bun
- run_tests_with_bun.yml: Test runner integration
- Update orb description to include Bun in supported package managers
## Key Features & Benefits
- Frozen lockfile by default (--frozen-lockfile) ensures reproducible builds
- Network retry logic (--retry 5) for robust CI installations
- Native test runner with built-in JUnit XML output (no additional dependencies)
- Automatic lockfile detection for both text (.lock) and binary (.lockb) formats
- Seamless integration with existing orb caching mechanisms
- Full compatibility with CircleCI's artifact and test result collection
This enhancement maintains backward compatibility while extending the orb's
package manager support to include Bun's fast JavaScript runtime and toolkit.
The implementation follows existing patterns for consistency and includes
comprehensive test coverage across all supported platforms and architectures.
* fix: replace GitHub API call with redirect method for Bun version detection
Replace api.github.com usage with github.com redirect approach to avoid
rate limiting issues. This follows the same pattern used for other tools
in the orb (e.g., Dockerize).
Changed from parsing JSON API response to extracting version from the
redirect URL of the releases/latest endpoint.
* Add new line at the end
* fix: address typo in path segment that blocked bun installation
* Add new line at the end
* fix: remove integration-test-install-bun-latest job from workflow
The job definition was deleted but references to it remained in the workflow,
causing CI failures. This removes the job from both the workflow jobs list
and the orb publish requirements.
* chore: update Bun version from 1.2.21 to 1.2.22
Updates all references to Bun version 1.2.21 to use version 1.2.22 across:
- CI test configurations in .circleci/test-deploy.yml
- Documentation examples in src/examples/
* fix: correct Bun test runner integration
- Fix Bun+Jest to run Jest via 'bun run' instead of native 'bun test'
- Fix Bun+Mocha to check dependencies properly
- Add 'bun' as test-results-for option for native Bun test runner
- Add examples showing both native and Jest/Mocha usage
* fix: add automatic test result collection for native Bun tests
* improve: simplify Bun cache configuration and add lockfile warnings
- Remove explicit cache-path from examples (orb defaults work correctly)
- Add warning when both bun.lock and bun.lockb are present
- Set explicit BUN_INSTALL_CACHE_DIR default for consistency
- Clarify in examples that cache path is automatically configured
* fix: use npm global install for Bun to ensure PATH availability
Switch from Bun's official installer to npm global install method,
following the same pattern as pnpm. This ensures Bun is properly
available in PATH for subsequent CircleCI steps without requiring
manual PATH manipulation or BASH_ENV exports.
* test: add Bun native test runner coverage and lockfile consistency
Completes the Bun integration by adding test coverage for Bun's native
test runner and ensuring lockfile handling consistency across all package
managers.
Changes:
- Add node-bun-native-test-job to test Bun's built-in test runner with
JUnit output verification
- Create minimal test file at sample/bun-tests/simple.test.js for native
test runner validation
- Generate and commit bun.lock file to match the pattern of having all
package manager lockfiles in the repository
- Update non-Bun package manager tests to remove bun.lock, ensuring
clean test isolation
* Fix linter
* fix: patch sec vulnerability
* fix: resolve Bun test runner issues in CircleCI orb
- Fix Jest/Bun haste map collisions by adding modulePathIgnorePatterns to exclude Bun cache
- Fix Bun native test runner by specifying bun-tests directory for test discovery
These changes address pipeline failures in the node-bun-jest-test-job and
node-bun-native-test-job by preventing Jest from scanning Bun's package
cache and ensuring the native runner finds test files correctly.
* update lock files
* fix: resolve Bun test runner issues in CircleCI orb
- Fix Bun native test runner to output JUnit results to junit.xml
- Fix Bun + Jest mode to look for results at junit.xml instead of test-results
- Add test case for Bun native runner with custom test-results-path
- Remove incorrect post_install_steps verification from Bun native test job
* fix: linter errors, rm trailing spaces
---------
Co-authored-by: Mateo Arboleda <[email protected]>1 parent 49e8134 commit 88a8654
File tree
23 files changed
+1662
-58
lines changed- .circleci
- sample
- bun-tests
- src
- commands
- examples
- jobs
- scripts
- packages
23 files changed
+1662
-58
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
67 | 84 | | |
68 | 85 | | |
69 | 86 | | |
| |||
95 | 112 | | |
96 | 113 | | |
97 | 114 | | |
98 | | - | |
| 115 | + | |
99 | 116 | | |
100 | 117 | | |
101 | 118 | | |
| |||
192 | 209 | | |
193 | 210 | | |
194 | 211 | | |
| 212 | + | |
195 | 213 | | |
196 | 214 | | |
197 | 215 | | |
198 | 216 | | |
199 | 217 | | |
200 | 218 | | |
201 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
202 | 249 | | |
203 | 250 | | |
204 | 251 | | |
| |||
274 | 321 | | |
275 | 322 | | |
276 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
277 | 329 | | |
278 | 330 | | |
279 | 331 | | |
| |||
297 | 349 | | |
298 | 350 | | |
299 | 351 | | |
| 352 | + | |
300 | 353 | | |
301 | 354 | | |
302 | 355 | | |
| |||
311 | 364 | | |
312 | 365 | | |
313 | 366 | | |
| 367 | + | |
314 | 368 | | |
315 | 369 | | |
316 | 370 | | |
| |||
325 | 379 | | |
326 | 380 | | |
327 | 381 | | |
| 382 | + | |
328 | 383 | | |
329 | 384 | | |
330 | 385 | | |
| |||
339 | 394 | | |
340 | 395 | | |
341 | 396 | | |
| 397 | + | |
342 | 398 | | |
343 | 399 | | |
344 | 400 | | |
| |||
354 | 410 | | |
355 | 411 | | |
356 | 412 | | |
| 413 | + | |
357 | 414 | | |
358 | 415 | | |
359 | 416 | | |
| |||
369 | 426 | | |
370 | 427 | | |
371 | 428 | | |
| 429 | + | |
372 | 430 | | |
373 | 431 | | |
374 | 432 | | |
| |||
387 | 445 | | |
388 | 446 | | |
389 | 447 | | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
390 | 523 | | |
391 | 524 | | |
392 | 525 | | |
| |||
403 | 536 | | |
404 | 537 | | |
405 | 538 | | |
| 539 | + | |
406 | 540 | | |
407 | 541 | | |
408 | 542 | | |
| |||
416 | 550 | | |
417 | 551 | | |
418 | 552 | | |
| 553 | + | |
419 | 554 | | |
420 | 555 | | |
421 | 556 | | |
| |||
428 | 563 | | |
429 | 564 | | |
430 | 565 | | |
| 566 | + | |
431 | 567 | | |
432 | 568 | | |
433 | 569 | | |
| |||
445 | 581 | | |
446 | 582 | | |
447 | 583 | | |
| 584 | + | |
448 | 585 | | |
449 | 586 | | |
450 | 587 | | |
| |||
465 | 602 | | |
466 | 603 | | |
467 | 604 | | |
| 605 | + | |
468 | 606 | | |
469 | 607 | | |
470 | 608 | | |
| |||
479 | 617 | | |
480 | 618 | | |
481 | 619 | | |
| 620 | + | |
482 | 621 | | |
483 | 622 | | |
484 | 623 | | |
| |||
500 | 639 | | |
501 | 640 | | |
502 | 641 | | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
503 | 661 | | |
504 | 662 | | |
505 | 663 | | |
| |||
512 | 670 | | |
513 | 671 | | |
514 | 672 | | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
515 | 679 | | |
516 | 680 | | |
517 | 681 | | |
| |||
545 | 709 | | |
546 | 710 | | |
547 | 711 | | |
| 712 | + | |
548 | 713 | | |
| 714 | + | |
549 | 715 | | |
550 | 716 | | |
| 717 | + | |
551 | 718 | | |
552 | 719 | | |
553 | 720 | | |
| |||
556 | 723 | | |
557 | 724 | | |
558 | 725 | | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
559 | 729 | | |
560 | 730 | | |
561 | 731 | | |
562 | 732 | | |
| 733 | + | |
563 | 734 | | |
564 | 735 | | |
565 | 736 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments