Skip to content

Commit

Permalink
fix: don't print info messages about .pnpmfile.cjs
Browse files Browse the repository at this point in the history
close #5027
  • Loading branch information
zkochan committed Jul 13, 2022
1 parent 701f158 commit ec52a76
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
6 changes: 6 additions & 0 deletions .changeset/kind-cups-rescue.md
@@ -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).
7 changes: 0 additions & 7 deletions packages/pnpmfile/src/requireHooks.ts
@@ -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'
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions packages/pnpmfile/src/requirePnpmfile.ts
Expand Up @@ -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".`,
Expand Down

0 comments on commit ec52a76

Please sign in to comment.