Feature: cargo new --workspace
could create a new workspace and embed the new crate under crates/
#13825
Labels
A-workspaces
Area: workspaces
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Command-new
S-needs-design
Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
S-triage
Status: This issue is waiting on initial triage.
Problem
I often want to create new projects as workspaces directly.
Currently this isn't possible: I either have to use a template, copy paste from an existing workspace or do it manually.
Proposed Solution
Have
cargo new my-crate --workspace
create a workspace with the crate being undercrates/my-crate
and the members beingcrates/*
.--workspace
would take an (optional, defaultcrates
) argument to customize the path for the members.It would create empty
[workspace.dependencies]
(and[workspace.lints]
?) table(s) with doc link, as is currently done for crate creation.In the
[dependencies]
section of the created crate, it could show how to use workspace dependencies instead of specifying them separately in all crates.Notes
I feel this would be a nice addition to promote workspace usage and a common format for them. It would also make using them when starting a new project much easier.
I haven't found an issue for this but I may easily have missed it, feel free to close/mark as duplicate if that was already asked for.
There's probably more design work to do too, I'm typing the issue after encountering the issue but I haven't spent a long time looking for issues that would crop up from this.
The text was updated successfully, but these errors were encountered: