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

feature(cli): dioxus-cli as lib #3362

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

notdanilo
Copy link

Problem

While it is possible to wrap dx using std::process::Command, a more flexible and programmable approach would be to reuse dioxus-cli as a library. Publishing dioxus-cli as a library would greatly enhance its usability.

Solution

This PR exposes dioxus-cli as a library, making it possible to reuse dx instead of redirecting cli commands to it.

A good example is how bolt-cli uses anchor-cli as a library.
https://github.com/magicblock-labs/bolt/blob/main/crates/bolt-cli/src/lib.rs

@notdanilo
Copy link
Author

Thanks for running the checks. I will fix them asap.

@jkelleyrtp
Copy link
Member

Thanks! Also - do you mind adding a no_exhaustive on any structs in the public API of the cli?

I'm okay with opening up the CLI as a library but that means the CLI needs to follow semver. We should try to keep our public API minimal in that case. This means marking things as no_exhaustive where possible and not making too many things public.

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.

2 participants