mirror of
https://github.com/oven-sh/bun
synced 2026-02-16 13:51:47 +00:00
This change makes lockfiles more portable across different registries and proxy configurations by storing tarball URLs as relative paths when they start with the package's registry URL. When writing the lockfile: - If a tarball URL starts with the package's registry URL (from scopeForPackageName), strip that prefix - Store only the relative path (e.g., "/lodash/-/lodash-4.17.21.tgz") When reading the lockfile: - If a URL doesn't start with http:// or https://, treat it as relative - Prepend the package's registry URL to reconstruct the full URL This allows users with custom registries or proxies to share lockfiles more easily without URL mismatches. Manual testing shows: - Default registry packages now have relative URLs (e.g., "/is-number/-/is-number-7.0.0.tgz") - Packages resolved from different registries keep full URLs - Reinstalling from lockfiles works correctly with --frozen-lockfile 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>