Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// we can use concat here because we always only append new packages, which are guaranteed to not be there by definition
ctx.pendingBuilds = ctx.pendingBuilds
.concat(
result.newDepPaths
.filter((depPath) => result.depGraph[depPath].requiresBuild)
.map((depPath) => dp.relative(ctx.registries, result.depGraph[depPath].name, depPath)),
)
}
if (!opts.lockfileOnly) {
// postinstall hooks
if (!opts.ignoreScripts && result.newDepPaths?.length) {
const depPaths = Object.keys(result.depGraph)
const rootNodes = depPaths.filter((depPath) => result.depGraph[depPath].depth === 0)
await buildModules(result.depGraph, rootNodes, {
childConcurrency: opts.childConcurrency,
depsToBuild: new Set(result.newDepPaths),
extraBinPaths: ctx.extraBinPaths,
lockfileDir: ctx.lockfileDir,
optional: opts.include.optionalDependencies,
rawConfig: opts.rawConfig,
rootNodeModulesDir: ctx.virtualStoreDir,
sideEffectsCacheWrite: opts.sideEffectsCacheWrite,
storeController: opts.storeController,
unsafePerm: opts.unsafePerm,
userAgent: opts.userAgent,
})
}
if (result.newDepPaths?.length) {
const newPkgs = R.props(result.newDepPaths, result.depGraph)
depNodes.map((depNode => limitLinking(async () => linkBinsOfDependencies(depNode, depGraph, opts)))),
)