Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Jul 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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