mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-28 20:11:48 -04:00
feat: print more info on different stages of installation
This commit is contained in:
@@ -8,6 +8,7 @@ import {read as readStore, save as saveStore} from '../fs/storeController'
|
||||
import R = require('ramda')
|
||||
import {PackageSpec} from '../resolve'
|
||||
import removeTopDependency from '../removeTopDependency'
|
||||
import logger from 'pnpm-logger'
|
||||
|
||||
export default async function removeOrphanPkgs (
|
||||
oldShr: Shrinkwrap,
|
||||
@@ -29,16 +30,20 @@ export default async function removeOrphanPkgs (
|
||||
const store = await readStore(storePath) || {}
|
||||
const notDependents = R.difference(oldPkgIds, newPkgIds)
|
||||
|
||||
await Promise.all(Array.from(notDependents).map(async notDependent => {
|
||||
if (store[notDependent]) {
|
||||
store[notDependent].splice(store[notDependent].indexOf(root), 1)
|
||||
if (!store[notDependent].length) {
|
||||
delete store[notDependent]
|
||||
await rimraf(path.join(storePath, notDependent))
|
||||
if (notDependents.length) {
|
||||
logger.info(`Removing ${notDependents.length} orphan packages from node_modules`);
|
||||
|
||||
await Promise.all(notDependents.map(async notDependent => {
|
||||
if (store[notDependent]) {
|
||||
store[notDependent].splice(store[notDependent].indexOf(root), 1)
|
||||
if (!store[notDependent].length) {
|
||||
delete store[notDependent]
|
||||
await rimraf(path.join(storePath, notDependent))
|
||||
}
|
||||
}
|
||||
}
|
||||
await rimraf(path.join(rootModules, `.${notDependent}`))
|
||||
}))
|
||||
await rimraf(path.join(rootModules, `.${notDependent}`))
|
||||
}))
|
||||
}
|
||||
|
||||
const newDependents = R.difference(newPkgIds, oldPkgIds)
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ export default async function (
|
||||
newPkgResolvedIds: string[],
|
||||
}> {
|
||||
const topPkgIds = topPkgs.map(pkg => pkg.id)
|
||||
logger.info(`Creating dependency tree`)
|
||||
const pkgsToLink = await resolvePeers(tree, rootNodeIds, topPkgIds, opts.topParents, opts.independentLeaves)
|
||||
const newShr = updateShrinkwrap(pkgsToLink, opts.shrinkwrap, opts.pkg)
|
||||
|
||||
@@ -152,6 +153,10 @@ async function linkNewPackages (
|
||||
}
|
||||
}
|
||||
|
||||
if (!newPkgs.length) return []
|
||||
|
||||
logger.info(`Adding ${newPkgs.length} packages to node_modules`)
|
||||
|
||||
await Promise.all([
|
||||
linkAllModules(newPkgs, pkgsToLink, {optional: opts.optional}),
|
||||
(async () => {
|
||||
|
||||
Reference in New Issue
Block a user