Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement options affecting resolved value in lock files. #4264

Closed
wants to merge 3 commits into from

Commits on Apr 4, 2022

  1. feat: omit resolved from registry dependencies

    Implement `$disable-write-resolves` described in npm/rfcs#486.  I named
    the option `omitLockfileRegistryResolved` but that can be changed later.
    
    Put simply, this option causes npm to create lock files without a
    `resolved` key for registry dependencies forcing npm to use the current
    configured registry and resolve package tarball urls on install. This
    fixes install errors when users change registries and the recorded
    resolved url is incorrect.
    
    This option causes slower installs because npm must fetch each packages
    manifest to find the tarball url, but it's the most comprehensive
    solution to this problem. Options like recording always the default
    registry, or recording a special 'current registry' sigil will break if
    registries host tarballs at different paths. For example
    `${REGISTRY}/npm/-/npm-8.3.0.tgz` only works if all registries host
    tarballs at `npm/-/npm-8.3.0.tgz`.
    Caleb ツ Everett committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    7aaa344 View commit details
    Browse the repository at this point in the history
  2. feat: add record default registry option

    Create shrinkwrap files with resolved urls modified to replace the
    configured registry with the default registry,
    https://registry.npmjs.org.
    
    The default registry is a magic value meaning the current registry, so
    recording resolved with the default registry allows users to switch to a
    different registry without removing their lockfile. The path portion of
    the acutal resolved url is preserved so this trick only works when the
    different registries host tarballs at the same relative paths. It's
    faster than the omitLockfileRegistryResolved option because npm doesn't
    need to fetch each pacument to resolve the tarball url.
    Caleb ツ Everett committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    db5ca7b View commit details
    Browse the repository at this point in the history
  3. feat: add lockfile resolved options

    Caleb ツ Everett committed Apr 4, 2022
    Configuration menu
    Copy the full SHA
    99de719 View commit details
    Browse the repository at this point in the history