Skip to content

Commit

Permalink
Cleanup optimize command
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton committed Oct 15, 2024
1 parent c2ced1a commit 73d13e0
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/commands/optimize.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// import chalk from 'chalk'
// import chalkTable from 'chalk-table'
import meow from 'meow'
import { getManifestData } from '@socketsecurity/registry'

//import ora from 'ora'
import { printFlagList } from '../utils/formatting'
import { writeFileUtf8 } from '../utils/fs'
import { indentedStringify, isParsableJSON } from '../utils/json'
Expand Down Expand Up @@ -299,16 +296,16 @@ export const optimize: CliSubcommand = {
cwd: process.cwd(),
onUnknown: (pkgManager: string | undefined) => {
console.log(
`Unknown package manager${pkgManager ? ` ${pkgManager}` : ''}: Defaulting to npm`
`⚠️ Unknown package manager${pkgManager ? ` ${pkgManager}` : ''}: Defaulting to npm`
)
}
})
if (!supported) {
console.log('The engines.node range is not supported.')
console.log('The engines.node range is not supported.')
return
}
if (pkgJson === undefined) {
console.log('No package.json found.')
console.log('No package.json found.')
return
}
const aoState: AddOverridesState = {
Expand Down Expand Up @@ -357,9 +354,9 @@ export const optimize: CliSubcommand = {
}
const { size: count } = aoState.packageNames
if (count) {
console.log(`Added ${count} overrides!`)
console.log(`Added ${count} Socket.dev optimized overrides 🚀`)
} else {
console.log('Congratulations! No override optimizations needed 🚀')
console.log('Congratulations! Already Socket.dev optimized 🎉')
}
}
}
Expand Down

0 comments on commit 73d13e0

Please sign in to comment.