-
-
Notifications
You must be signed in to change notification settings - Fork 913
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
Allow to use dioxus-cli
within a cargo workspace
#1547
Labels
Milestone
Comments
ealmloff
added
enhancement
New feature or request
cli
Related to the dioxus-cli program
labels
Oct 16, 2023
This would be a great addition to the CLI! It would be useful for the main Dioxus repo which uses workspace with Dioxus examples within workspace members. |
RGafiyatullin
added a commit
to RGafiyatullin/dioxus
that referenced
this issue
Nov 15, 2023
Although the `dx` CLI allows to specify a package name to chose from workspace members, it does not support workspace members specified as glob-wildcards. Neither it respects the effective package name, specified in the crate's `Cargo.toml`. This PR addresses that issue: - upon `dx build ...`, if the `--bin` CLI-argument is provided, treat the current dir as a workspace; - search through the workspace's `members`: resolve each of them with `glob`; - assume that any workspace member has a `Cargo.toml` in it (cargo does it, so it's okay); - read said manifest, and check the package name in it; - if found — there we have our sought package.
ealmloff
pushed a commit
that referenced
this issue
Nov 15, 2023
…rs, real package names) (#1642) * Related to #1547: use `dioxus-cli` within a workspace Although the `dx` CLI allows to specify a package name to chose from workspace members, it does not support workspace members specified as glob-wildcards. Neither it respects the effective package name, specified in the crate's `Cargo.toml`. This PR addresses that issue: - upon `dx build ...`, if the `--bin` CLI-argument is provided, treat the current dir as a workspace; - search through the workspace's `members`: resolve each of them with `glob`; - assume that any workspace member has a `Cargo.toml` in it (cargo does it, so it's okay); - read said manifest, and check the package name in it; - if found — there we have our sought package. * Use cargo-metadata to find out the workspace structure * glob is unused
Cargo build, serve, bundle, and fmt now all apply based on the package arg. Only |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'd like to work on this on my own if this feature is welcomed.
Specific Demand
I'm using dioxus in a cargo workspace and want to run the
dx
command within the workspace root instead ofcd
to the dioxus project before rundx
. Also, although I did not do it yet, a workspace could include multiple dioxus projects in the monorepo context.Implement Suggestion
Add
-p, --package [<SPEC>] Package with the target to run
option to severaldx
's commands.The text was updated successfully, but these errors were encountered: