mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 13:22:07 +00:00
This commit implements the --prefer-offline flag for `bun install` to support offline development workflows by using locally cached package metadata even when it has expired. Changes: - Add --prefer-offline CLI flag parsing in CommandLineArguments.zig - Wire up ctx.debug.offline_mode_setting in PackageManagerOptions.zig - Modify PackageManagerEnqueue.zig to respect prefer-offline for cache expiry - Add logic to prevent network requests for uncached dependencies in offline mode - Update all call sites to handle new function signatures - Add comprehensive test suite with fake registry The implementation follows standard package manager offline behavior: - Uses expired cache when prefer-offline is set - Fails gracefully when no cached data exists - Works with both CLI flag and bunfig.toml configuration - Integrates with existing Bun architecture patterns 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>