-
-
Notifications
You must be signed in to change notification settings - Fork 832
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
Related to #1547: use dioxus-cli
within a workspace (wildcard-members, real package names)
#1642
Conversation
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.
dioxus-cli
within a workspacedioxus-cli
within a workspace (wildcard-members, real package names)
It seems like this handles workspace names much better! I'm curious what your use case is for glob patterns for the bin field? I realize this PR doesn't introduce this error, but as a note, we don't actually need to assume that the current directory is the root of the package. We can use |
@ealmloff , I agree: invoking cargo-metadata should simplify the things.
I do not use wildcards for the bin field, I use them to specify member-crates of a workspace.
|
Interesting, I didn't know that the workspace field had glob support! |
I had a look at how the rest of the CLI works: a lot of it could use moving to cargo-metadata... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks much better, thank you!
(Related to #1547)
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'sCargo.toml
.This PR addresses that issue:
dx build ...
, if the--bin
CLI-argument is provided, treat the current dir as a workspace;members
: resolve each of them withglob
;Cargo.toml
in it (cargo does it, so it's okay);