JamieMason / JamieMason/syncpack
feat: add "install" command
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 72
- PR merge metrics
- No merged PRs in 30d
Description
### Description
What's your workflow when adding a dependency to a package?
If it's a new one, I just run `npm install foo -w libs/my-package`
If any of the other packages already use "foo", I have to hunt down the dependency and copy-paste the version into `libs/my-package/package.json`. Only then run `npm install`
This is tedious and error prone.
### Suggested Solution
Add `syncpack install foo -w libs/package`
This can automatically follow its rules for version matching, update the relevant package.json, and then call `npm install` to actually install the dependency.
### Optional comments
I cannot rely on syncpack to fix the issue after the first "latest version" install because npm often fails to properly update the lockfile.
### Code of Conduct
- [x] I agree to follow the [Code of Conduct](https://github.com/JamieMason/syncpack/blob/main/CODE_OF_CONDUCT.md)
Contributor guide
Research direction
Start by locating the CLI command entry point and the code that applies dependency version-matching rules. Inspect the relevant package.json files, including libs/my-package/package.json, and the existing npm workflow. Done means syncpack install foo -w libs/package updates the target manifest according to the rules and then runs npm install with a correct lockfile.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, rust
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100