mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-11 17:42:43 -04:00
fix(hoist): don't print a warning on skipped optional deps (#3454)
close #2798
This commit is contained in:
5
.changeset/tiny-foxes-roll.md
Normal file
5
.changeset/tiny-foxes-roll.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/hoist": patch
|
||||
---
|
||||
|
||||
Do not print a warning if a skipped optional dependency cannot be hoisted.
|
||||
@@ -6,13 +6,15 @@ import {
|
||||
nameVerFromPkgSnapshot,
|
||||
} from '@pnpm/lockfile-utils'
|
||||
import lockfileWalker, { LockfileWalkerStep } from '@pnpm/lockfile-walker'
|
||||
import logger, { globalWarn } from '@pnpm/logger'
|
||||
import logger from '@pnpm/logger'
|
||||
import matcher from '@pnpm/matcher'
|
||||
import symlinkDependency from '@pnpm/symlink-dependency'
|
||||
import { HoistedDependencies } from '@pnpm/types'
|
||||
import * as dp from 'dependency-path'
|
||||
import * as R from 'ramda'
|
||||
|
||||
const hoistLogger = logger('hoist')
|
||||
|
||||
export default async function hoistByLockfile (
|
||||
opts: {
|
||||
lockfile: Lockfile
|
||||
@@ -194,8 +196,8 @@ async function symlinkHoistedDependencies (
|
||||
.map(async ([depPath, pkgAliases]) => {
|
||||
const pkgSnapshot = opts.lockfile.packages![depPath]
|
||||
if (!pkgSnapshot) {
|
||||
globalWarn(`Failed to find "${depPath}" in lockfile during hoisting. ` +
|
||||
`Next aliases will not be hoisted: ${Object.keys(pkgAliases).join(', ')}`)
|
||||
// This dependency is probably a skipped optional dependency.
|
||||
hoistLogger.debug({ hoistFailedFor: depPath })
|
||||
return
|
||||
}
|
||||
const pkgName = nameVerFromPkgSnapshot(depPath, pkgSnapshot).name
|
||||
|
||||
Reference in New Issue
Block a user