DioxusLabs / dioxus

Fullstack GUI library for web, desktop, mobile, and more.
https://dioxuslabs.com
Apache License 2.0
18.5k stars 704 forks source link

dx new in existing multicrate workspace #2350

Open alexanderjophus opened 1 week ago

alexanderjophus commented 1 week ago

Feature Request

When creating a new project with dx new, after the directory is created cargo fmt is ran. If this is in a workspace where the user has not pre-added the crate to workspace members list, the user is presented with a cargo fmt error message.

Everything else runs fine, and the command has an exit code of 0, as everything is fine, it just looks worrying.

Implement Suggestion

Not sure how possible it is, currently investigating, but if the user is in a workspace either

alexanderjophus commented 1 week ago

I'm reading cargo-metadata, but nothing is jumping out at me to say "this is a workspace" vs "this is a standalone package.

Maybe checking the length of workspace_members, and if there's only 1 checking if it matches the workspace_root?

I'm thinking of use cases/edge cases though;