sway
sway copied to clipboard
Split client interaction commands into a `forc-client` plugin
The aim here is the separation of two major kinds of functionality currently provided by forc:
- Managing Sway code projects / hosting plugins (
init,clean,check,build,update,plugins). This is the role of the standaloneforcbinary. - Interacting with a Fuel node as a client (
deploy,run). This would be the role of aforc-clientplugin.
One of our primary upcoming priorities is integrating wallet support into the deployment process. Before we add this integration to deploy and run and further bloat the standalone forc tool, it makes sense to separate this client functionality into a dedicated crate.
By keeping the client interaction logic in a dedicated crate, we'll likely also greatly improve the build times and binary size of the standalone forc tool.
To-do
- [ ] Create a
forc-clientplugin crate under the sway repo'sforc-pluginsdirectory. - [ ] Move the
forc deployandforc runcommands to theforc-clientcrate.- Note: this will be the first forc plugin that provides more than one new forc command. To achieve providing multiple commands under a single crate, the best approach might be to declare multiple
[[bin]]targets under theforc-clientmanifest with a separatemainfor each command. Before diving into this, we should consider checking how thecargo-editcrate (which provides thecargo add,cargo rmandcargo upgradecommands via the installation of a singlecargo-editcrate) achieves this.
- Note: this will be the first forc plugin that provides more than one new forc command. To achieve providing multiple commands under a single crate, the best approach might be to declare multiple
- [ ] Update E2E tests that use the deploy, run commands.
- [ ] Update Sway documentation.
- The forc chapter documentation should for the most part be an automatic update, but we may need to add a file stem for the new plugin. We should also review the rest of the Sway docs.
- [ ] Ensure
forc-clientis published and shipped withfuelup- This will include:
- Ensuring the new plugin is published under the release assets along with forc and the rest of the plugins and
- Ensuring
fuelupis aware of the plugin and distributes it in each of the toolchains. I believe this should be automated for the most part, but it may be the case that we need to update a list of plugin names or similar somewhere infuelupto make it aware.
- This will include:
cc @adlerjohn I know we briefly discussed splitting out forc deploy into a forc-deploy plugin in our roadmap chat, but it occurred to me that it might be useful to treat this as a general forc-client plugin that acts as the home of any commands that interact with a fuel node generally, I.e. any command that initalises a fuel client with FuelClient::new(node_url). Does this sound OK?