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

CLI: Big CLI cleanup + merge Edge CLI #4407

Merged
merged 21 commits into from
Jan 25, 2024

Conversation

theduke
Copy link
Contributor

@theduke theduke commented Jan 25, 2024

This PR cleans up the CLI and merges in both the wasmer-api (backend API bindings) crate and the the wasmer-edge-cli create (Edge related commands).

The diff is very large, reviewers should look at the individual commits.

There is a lot of cleanup, like re-structuring the modules, removing a bunch of
dead code, normalizing all the use imports to the standard format, ...

My initial intention was to keep them separate, and it would potentially make
sense to factor out all commands that use the Wasmer Backend in the future, but
this was not feasible in this PR without prevent future required cleanups and
normalization, particular regarding the wasmer_registry crate.

NOTE:: This PR makes all the CLI internals private.
This is a breaking change, but the CLI internals are heavily idiomatic and should
not be exposed to external users.
We were already not really paying attention to potential breakage.
Still needs to be discussed if we can actually do this.

Closes #4405

Required followup work:

@theduke theduke requested a review from syrusakbary as a code owner January 25, 2024 00:56
@theduke theduke force-pushed the issue-4405-wasmer-api-and-edge-cli branch 3 times, most recently from 2acd2c8 to 0ff6cc9 Compare January 25, 2024 02:24
Copy link
Member

@syrusakbary syrusakbary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR looks good. I'll approve once we create the two related issues in the Wasmer repo so we don't forget:

  • Unify Backend API crate and registry crate
  • EdgeConfig (ideally it will have full context that combines with the wasmer.toml/config)

Provides bindings to the Wasmer GraphQL api.
Imported from a different repository.

Renamed to "wasmer-backend-cli".

This crate will hold all CLI commands that interact with the Wasmer
backend.
* Use async_trait for AsyncCliCommand
* add `type Output = XX` to allow commands to return an output
* Update all implementations
Wasn't used anywhere, the module wasn't even included in lib.rs
To have the templates in a nested directory.
These have not been needed in years...
The CLI internals are an implementation detail and should not be exposed.

The only remaining public export is a single function that runs the CLI.
They are the most important thing for many viewers
They are commented out because some only work on nightly Rust.

un-comment and run `rustup run nightly cargo fmt` to apply
Rename module + type
Prevents a duplicate dependency on the object crate.

NOTE: does not update to latest, since that would just create another
duplicate dependency chain.
@theduke theduke force-pushed the issue-4405-wasmer-api-and-edge-cli branch from 46e15c3 to 35ed4ea Compare January 25, 2024 13:32
@theduke
Copy link
Contributor Author

theduke commented Jan 25, 2024

@syrusakbary I added two followup issues.

@theduke theduke merged commit 1a49312 into master Jan 25, 2024
52 checks passed
@theduke theduke deleted the issue-4405-wasmer-api-and-edge-cli branch January 25, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move wasmer-api and edge-client-cli to Wasmer Repo
2 participants