Skip to content

Commit 30bb713

Browse files
committed
Use more console.error and console.warn
1 parent 6bfe05f commit 30bb713

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/commands/optimize.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ async function addOverrides(
591591
!state.warnedPnpmWorkspaceRequiresNpm
592592
) {
593593
state.warnedPnpmWorkspaceRequiresNpm = true
594-
console.log(
594+
console.warn(
595595
`⚠️ ${COMMAND_TITLE}: pnpm workspace support requires \`npm ls\`, falling back to \`pnpm list\``
596596
)
597597
}
@@ -768,44 +768,44 @@ export const optimize: CliSubcommand = {
768768
} = await detect({
769769
cwd,
770770
onUnknown(pkgManager: string | undefined) {
771-
console.log(
771+
console.warn(
772772
`⚠️ ${COMMAND_TITLE}: Unknown package manager${pkgManager ? ` ${pkgManager}` : ''}, defaulting to npm`
773773
)
774774
}
775775
})
776776
if (!supported) {
777-
console.log(
777+
console.error(
778778
`✖️ ${COMMAND_TITLE}: No supported Node or browser range detected`
779779
)
780780
return
781781
}
782782
if (agent === 'vlt') {
783-
console.log(
783+
console.error(
784784
`✖️ ${COMMAND_TITLE}: ${agent} does not support overrides. Soon, though ⚡`
785785
)
786786
return
787787
}
788788
const lockName = lockPath ? path.basename(lockPath) : 'lock file'
789789
if (lockSrc === undefined) {
790-
console.log(`✖️ ${COMMAND_TITLE}: No ${lockName} found`)
790+
console.error(`✖️ ${COMMAND_TITLE}: No ${lockName} found`)
791791
return
792792
}
793793
if (lockSrc.trim() === '') {
794-
console.log(`✖️ ${COMMAND_TITLE}: ${lockName} is empty`)
794+
console.error(`✖️ ${COMMAND_TITLE}: ${lockName} is empty`)
795795
return
796796
}
797797
if (pkgPath === undefined) {
798-
console.log(`✖️ ${COMMAND_TITLE}: No package.json found`)
798+
console.error(`✖️ ${COMMAND_TITLE}: No package.json found`)
799799
return
800800
}
801801
if (prod && (agent === 'bun' || agent === 'yarn/berry')) {
802-
console.log(
802+
console.error(
803803
`✖️ ${COMMAND_TITLE}: --prod not supported for ${agent}${agentVersion ? `@${agentVersion.toString()}` : ''}`
804804
)
805805
return
806806
}
807807
if (lockPath && path.relative(cwd, lockPath).startsWith('.')) {
808-
console.log(
808+
console.warn(
809809
`⚠️ ${COMMAND_TITLE}: Package ${lockName} found at ${lockPath}`
810810
)
811811
}

0 commit comments

Comments
 (0)