chore: remove unused CLI utility functions and improve version handling #464
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Removes unused utility functions from both CLI packages (
pgpm/cliandpackages/cli) that were defined but never called anywhere in the codebase.Removed from
pgpm/cli/src/utils/argv.ts:ValidatedArgvinterfacevalidateCommonArgs(),validateFlagDependencies(),logEffectiveArgs(),constructTarget()functionsLoggerimport (no longer needed)Removed from both
display.tsfiles:displayVersion()anddisplayUsage()functionsfindAndRequirePackageJson,yanse)The actively-used exports (
extractFirst,usageText) are preserved.Updates since last revision
Refactored version handling in both CLI entry points (
pgpm/cli/src/index.tsandpackages/cli/src/index.ts) to usefindAndRequirePackageJsoninstead of manualreadFileSync+JSON.parse. This provides more robust package.json resolution and aligns with how version is handled elsewhere in the codebase (e.g., incommands.ts).Review & Testing Checklist for Human
displayVersion,displayUsage,validateCommonArgs,ValidatedArgv, etc.) - these were part of the public API viaexport * from './utils'pgpm --versionandcnc --versionto confirm they output the correct versionpgpm --helpandcnc --helpto confirm CLI still works correctlyRecommended test plan:
Notes
These functions appear to be AI-generated code that was never integrated into the actual CLI flow. The user specifically requested cleanup of "AI slop" that hadn't been cleaned up.
Link to Devin run: https://app.devin.ai/sessions/8d1619b099e34c379f020eb65afd5828
Requested by: Dan Lynch (@pyramation)