fix: don't print info messages about .pnpmfile.cjs (#5032)

close #5027
This commit is contained in:
Zoltan Kochan
2022-07-14 02:22:08 +03:00
committed by GitHub
parent c71215041d
commit 744d47d90e
3 changed files with 6 additions and 11 deletions

View File

@@ -0,0 +1,6 @@
---
"pnpm": patch
"@pnpm/pnpmfile": patch
---
Don't print any info messages about .pnpmfile.cjs [#5027](https://github.com/pnpm/pnpm/issues/5027).

View File

@@ -1,6 +1,5 @@
import path from 'path'
import { hookLogger } from '@pnpm/core-loggers'
import logger from '@pnpm/logger'
import pathAbsolute from 'path-absolute'
import type { Lockfile } from '@pnpm/lockfile-types'
import type { Log } from '@pnpm/core-loggers'
@@ -48,12 +47,6 @@ export default function requireHooks (
globalHooks = globalHooks || {}
hooks = hooks || {}
const cookedHooks: CookedHooks = {}
if ((globalHooks.readPackage != null) || (hooks.readPackage != null)) {
logger.info({
message: 'readPackage hook is declared. Manifests of dependencies might get overridden',
prefix,
})
}
for (const hookName of ['readPackage', 'afterAllResolved']) {
if (globalHooks[hookName] && hooks[hookName]) {
const globalHookContext = createReadPackageHookContext(globalPnpmfile.filename, prefix, hookName)

View File

@@ -27,10 +27,6 @@ class PnpmFileFailError extends PnpmError {
export default (pnpmFilePath: string, prefix: string) => {
try {
const pnpmfile = require(pnpmFilePath) // eslint-disable-line
logger.info({
message: `Using hooks from: ${pnpmFilePath}`,
prefix,
})
if (typeof pnpmfile === 'undefined') {
logger.warn({
message: `Ignoring the pnpmfile at "${pnpmFilePath}". It exports "undefined".`,