Files
pnpm/src/api/verify.ts
zkochan d3b0bb0c75 feat: use a shrinkwrap file instead of graph.yaml
Ref #658

BREAKING CHANGE: no `node_modules/.graph.yaml` used anymore
2017-03-13 21:23:41 +02:00

18 lines
604 B
TypeScript

import path = require('path')
import pFilter = require('p-filter')
import {PnpmOptions} from '../types'
import extendOptions from './extendOptions'
import getContext from './getContext'
import untouched from '../pkgIsUntouched'
export default async function (maybeOpts: PnpmOptions) {
const opts = extendOptions(maybeOpts)
const ctx = await getContext(opts)
if (!ctx.shrinkwrap) return []
const pkgPaths = Object.keys(ctx.shrinkwrap.packages || {})
.map(pkgPath => path.join(ctx.storePath, pkgPath))
return await pFilter(pkgPaths, async (pkgPath: string) => !await untouched(pkgPath))
}