feat: add search, update, catalog and remove commands#2
Open
dongguacute wants to merge 3 commits intoLittleSound:mainfrom
Open
feat: add search, update, catalog and remove commands#2dongguacute wants to merge 3 commits intoLittleSound:mainfrom
dongguacute wants to merge 3 commits intoLittleSound:mainfrom
Conversation
Added a new command to remove packages from dependencies, including options for catalog cleanup. Updated provider interfaces and implementations for bun, pnpm, and yarn to support the new removal feature. Enhanced type definitions and added tests for the new functionality.
Added new commands to the CLI for searching npm packages and updating dependencies. The `search` command allows users to find packages interactively, while the `update` command checks for outdated packages and facilitates their updates. Updated the README to reflect these new features and provided usage examples.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This PR adds four new commands to enhance the package management experience:
nai search- Search npm registry for packagesnai update- Batch update dependencies to latest versionsnai catalog- Browse and manage catalog versionsnai remove- Remove packages from dependenciesChanges
New Files
src/npm.tsModified Files
src/cli.tssearch,update,catalogcommands with interactive UIREADME.mdFeatures
🔍
nai search(alias:nai s)Search npm registry interactively:
nai search react nai s "ui framework"📦
nai update(alias:nai up)Check and update outdated packages:
🗂️
nai catalogBrowse catalogs and change dependency versions:
🗑️
nai remove(alias:nai rm)Remove packages from dependencies:
--clean-catalogTechnical Details
src/npm.tsNew module providing npm registry interactions:
searchNpm(query, options)- Search npm registrygetPackageVersions(packageName)- Fetch all available versionscheckOutdated(deps, options)- Compare current versions with latestUI/UX
All new commands follow the existing design patterns:
@clack/promptsfor consistent interactive UIansisTest Plan
nai search reactnai updatein a project with outdated depsnai catalogin a monorepo with catalogsnai removeto uninstall packages(以上就是具体描述,让AI总结的,指令我都试了一遍正常的,基本就是完善了一下基础功能,希望能够合并,谢谢)