Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate off IO from nargo command logic #884

Closed
TomAFrench opened this issue Feb 21, 2023 · 0 comments · Fixed by #896
Closed

Separate off IO from nargo command logic #884

TomAFrench opened this issue Feb 21, 2023 · 0 comments · Fixed by #896
Labels
enhancement New feature or request

Comments

@TomAFrench
Copy link
Member

Problem

Currently we've got IO logic spread across the entire cli directory - some in a X_cmd.rs file to be used locally, some in mod.rs to be used in several files.

This causes a large amount of noise which makes it harder to find the actual business logic.

Solution

We can create single module which holds all of the IO logic which the files defining each command can just import as needed.

auth
├─ mod.rs
├─ commands
│  ├─ check_cmd.rs
│  ├─ compile_cmd.rs 
│  ├─ etc.
├─ fs
│  ├─ keys.rs
│  ├─ inputs.rs
│  ├─ etc.

The major benefit I see for this is that it makes reworking how we perform IO (necessary for the new build artifact format) easier due to the increased encapsulation.

Other benefits include:

  • simplifying the CLI files.
  • making it easier to define a specific error type for IO issues.

Alternatives considered

We can maintain the IO alongside the CLI logic.

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant