sway icon indicating copy to clipboard operation
sway copied to clipboard

Add a subcommand to forc to `edit` third party dependencies similar to Cargo

Open Braqzen opened this issue 3 years ago • 3 comments

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.

Braqzen avatar Jul 23 '22 11:07 Braqzen

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.

mitchmindtree avatar Jul 25 '22 05:07 mitchmindtree

Checking out this issue, will update with a PR when ready. If someone gets to it before me, no sweat.

gr00vytvniks avatar Jul 25 '22 16:07 gr00vytvniks

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.

kayagokalp avatar Aug 06 '22 14:08 kayagokalp