hunk.code_window:     .map(shortId => shortIdToFullId(shortId, shrinkwrap.registry))
     const newPkgs = R.props<DependencyTreeNode>(newPkgResolvedIds, pkgsToLink)
     await linkAllPkgs(newPkgs, opts)
     if (!opts.force) {
       // add subdependencies that have been updated
       // TODO: no need to relink everything. Can be relinked only what was changed
       for (const shortId of nextPkgResolvedIds) {
  
hunk.labels: keep keep keep keep replace keep keep keep keep keep
hunk.after_edit:   try {
       await linkAllPkgs(linkPkg, newPkgs, opts)
     } catch (err) {
       if (!err.message.startsWith('EXDEV: cross-device link not permitted')) throw err
       logger.warn(err.message)
       logger.info('Falling back to copying packages from store')
       await linkAllPkgs(copyPkg, newPkgs, opts)
     }
  
hunk.file_path: src/link/index.ts
hunk.type: replace
file: import path = require('path')
  import loadJsonFile = require('load-json-file')
  import symlinkDir from 'symlink-dir'
  import logger from 'pnpm-logger'
  import {install} from './install'
  import expandTilde from '../fs/expandTilde'
  import {linkPkgBins} from '../link/linkBins'
  import {PnpmOptions} from '../types'
  import extendOptions from './extendOptions'
  
  const linkLogger = logger('link')
  
  export default async function link (
    linkFrom: string,
    linkTo: string,
    maybeOpts?: PnpmOptions
  ) {
    const opts = extendOptions(maybeOpts)
  
    await install(Object.assign({}, opts, { prefix: linkFrom, global: false }))
  
    const destModules = path.join(linkTo, 'node_modules')
    await linkToModules(linkFrom, destModules)
  
    const bin = path.join(destModules, '.bin')
    await linkPkgBins(linkFrom, bin)
  }
  
  async function linkToModules (linkFrom: string, modules: string) {
    const pkg = await loadJsonFile(path.join(linkFrom, 'package.json'))
    const dest = path.join(modules, pkg.name)
    linkLogger.info(`${dest} -> ${linkFrom}`)
    await symlinkDir(linkFrom, dest)
  }
  
  export async function linkFromGlobal (
    pkgName: string,
    linkTo: string,
    maybeOpts: PnpmOptions & {globalPrefix: string}
  ) {
    const opts = extendOptions(maybeOpts)
    const globalPkgPath = expandTilde(maybeOpts.globalPrefix)
    const linkedPkgPath = path.join(globalPkgPath, 'node_modules', pkgName)
    await link(linkedPkgPath, linkTo, opts)
  }
  
  export async function linkToGlobal (
    linkFrom: string,
    maybeOpts: PnpmOptions & {globalPrefix: string}
  ) {
    const opts = extendOptions(maybeOpts)
    opts.global = true // bins will be linked to the global bin path
    const globalPkgPath = expandTilde(maybeOpts.globalPrefix)
    await link(linkFrom, globalPkgPath, opts)
  }
  