mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-30 04:52:04 -04:00
fix: report an info log instead of a warning on binary conflicts
Yarn and npm are not printing any info in such cases, when several dependencies try to create the same binary. It is better if pnpm will print an info message, not a warning. close #2823 PR #2843
This commit is contained in:
8
.changeset/neat-planets-return.md
Normal file
8
.changeset/neat-planets-return.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
"@pnpm/headless": patch
|
||||
"@pnpm/hoist": patch
|
||||
"@pnpm/plugin-commands-rebuild": patch
|
||||
"supi": patch
|
||||
---
|
||||
|
||||
Report an info log instead of a warning when some binaries cannot be linked.
|
||||
@@ -234,7 +234,7 @@ export default async (opts: HeadlessOptions) => {
|
||||
})
|
||||
|
||||
function warn (message: string) {
|
||||
logger.warn({
|
||||
logger.info({
|
||||
message,
|
||||
prefix: lockfileDir,
|
||||
})
|
||||
@@ -369,7 +369,7 @@ function linkBinsOfImporter (
|
||||
rootDir: string
|
||||
}
|
||||
) {
|
||||
const warn = (message: string) => logger.warn({ message, prefix: rootDir })
|
||||
const warn = (message: string) => logger.info({ message, prefix: rootDir })
|
||||
return linkBins(modulesDir, binsDir, {
|
||||
allowExoticManifests: true,
|
||||
warn,
|
||||
|
||||
@@ -89,7 +89,7 @@ async function linkAllBins (modulesDir: string) {
|
||||
const bin = path.join(modulesDir, '.bin')
|
||||
const warn: WarnFunction = (message, code) => {
|
||||
if (code === 'BINARIES_CONFLICT') return
|
||||
logger.warn({ message, prefix: path.join(modulesDir, '../..') })
|
||||
logger.info({ message, prefix: path.join(modulesDir, '../..') })
|
||||
}
|
||||
try {
|
||||
await linkBins(modulesDir, bin, { allowExoticManifests: true, warn })
|
||||
|
||||
@@ -259,7 +259,7 @@ async function _rebuild (
|
||||
groups: [nodesToBuildAndTransitiveArray],
|
||||
})
|
||||
const chunks = graphSequencerResult.chunks as string[][]
|
||||
const warn = (message: string) => logger.warn({ message, prefix: opts.dir })
|
||||
const warn = (message: string) => logger.info({ message, prefix: opts.dir })
|
||||
const groups = chunks.map((chunk) => chunk.filter((depPath) => ctx.pkgsToRebuild.has(depPath)).map((depPath) =>
|
||||
async () => {
|
||||
const pkgSnapshot = pkgSnapshots[depPath]
|
||||
|
||||
@@ -840,7 +840,7 @@ function prefIsLocalTarball (pref: string) {
|
||||
const limitLinking = pLimit(16)
|
||||
|
||||
function linkBinsOfImporter ({ modulesDir, binsDir, rootDir }: ImporterToResolve) {
|
||||
const warn = (message: string) => logger.warn({ message, prefix: rootDir })
|
||||
const warn = (message: string) => logger.info({ message, prefix: rootDir })
|
||||
return linkBins(modulesDir, binsDir, { allowExoticManifests: true, warn })
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ export default async function link (
|
||||
|
||||
const linkToBin = maybeOpts?.linkToBin ?? path.join(destModules, '.bin')
|
||||
await linkBinsOfPackages(linkedPkgs.map((p) => ({ manifest: p.manifest, location: p.path })), linkToBin, {
|
||||
warn: (message: string) => logger.warn({ message, prefix: opts.dir }),
|
||||
warn: (message: string) => logger.info({ message, prefix: opts.dir }),
|
||||
})
|
||||
|
||||
let newPkg!: ProjectManifest
|
||||
|
||||
Reference in New Issue
Block a user