sway
sway copied to clipboard
Add a subcommand to forc to `edit` third party dependencies similar to Cargo
Summary
Cargo allows you to add, remove and upgrade dependencies.
It would be nice, and has been requested externally, that a similar command is added to forc.
Moreover, it would be nice to allow the user to search available dependencies which can then be selected and automatically added to the manifest file so that the user does not have to manipulate the dependencies themselves.
Originally these subcommands were introduced to cargo via an external plugin called cargo-edit - perhaps we can take the same approach.
That said, it looks like add has since been added to cargo itself. I'm open to having these added as native commands as they shouldn't require adding any extra dependencies to forc. It should be fairly trivial to add these with toml_edit which we already use.
Checking out this issue, will update with a PR when ready. If someone gets to it before me, no sweat.
Quick heads-up to the future possible implementor, if we follow the external plugin path, you can look at https://github.com/FuelLabs/sway/pull/2440 for a possible skeleton implementation as it also introduces 2 commands as an external plugin. It is essentially the way cargo-edit does this stuff.