hunk.code_window:   '@types/camelcase': ^4.1.0
     '@types/node': ^9.4.6 || 10
     '@types/tape': ^4.2.32
     '@types/which': ^1.3.1
     '@zkochan/npm-conf': ^1.0.0
     camelcase: ^5.0.0
     mos: ^2.0.0-alpha.3
     mos-plugin-readme: ^1.0.4
     package-preview: ^1.0.1
  
hunk.labels: keep keep keep keep replace keep keep keep keep
hunk.after_edit:   '@zkochan/npm-conf': ^1.1.0
  
hunk.file_path: packages/config/shrinkwrap.yaml
hunk.type: replace
file: import logger from '@pnpm/logger'
  import {PackageManifest} from '@pnpm/types'
  import {skippedOptionalDependencyLogger} from '@pnpm/utils'
  import installChecks = require('pnpm-install-checks')
  import R = require('ramda')
  import {PkgByPkgId} from '../api/install'
  import {
    installCheckLogger,
  } from '../loggers'
  import {splitNodeId} from '../nodeIdUtils'
  
  export default async function getIsInstallable (
    pkgId: string,
    pkg: PackageManifest,
    options: {
      engineStrict: boolean,
      pkgByPkgId: PkgByPkgId,
      nodeId: string,
      nodeVersion: string,
      optional: boolean,
      pnpmVersion: string,
    },
  ): Promise<boolean> {
    const warn = await installChecks.checkPlatform({
        _id: pkgId,
        cpu: pkg.cpu,
        os: pkg.os,
      }) ||
      await installChecks.checkEngine({
        _id: pkgId,
        engines: pkg.engines,
      }, {
        nodeVersion: options.nodeVersion,
        pnpmVersion: options.pnpmVersion,
      })
  
    if (!warn) return true
  
    installCheckLogger.warn(warn)
  
    if (options.optional) {
      skippedOptionalDependencyLogger.debug({
        details: warn.toString(),
        package: {
          id: pkgId,
          name: pkg.name,
          version: pkg.version,
        },
        parents: nodeIdToParents(options.nodeId, options.pkgByPkgId),
        reason: warn.code === 'ENOTSUP' ? 'unsupported_engine' : 'unsupported_platform',
      })
  
      return false
    }
  
    if (options.engineStrict) throw warn
  
    return true
  }
  
  export function nodeIdToParents (
    nodeId: string,
    pkgByPkgId: PkgByPkgId,
  ) {
    const pkgIds = splitNodeId(nodeId).slice(2, -2)
    return pkgIds
      .map((pkgId) => {
        const pkg = pkgByPkgId[pkgId]
        return {
          id: pkg.id,
          name: pkg.name,
          version: pkg.version,
        }
      })
  }
  