Alternative to `cargo new` templates: examples as build-target templates
bushRAT:
I mean, is it any different to tests, benchmarks, or examples as-is?
docs.rswill include snippets of code from examples in documentation, but examples aren't themselves published to crates.io, so there is definitely precedent here.
I'm looking at it from the users perspective. They put Cargo,tomls down that are "part of their package" but cargo check --workspace doesn't build them?
bushRAT:
Sorry I think I worded that badly, what I meant was for an MVP on templates we don't need to consider the additive functionality yet, that can be added after there's a mechanism for templates. Whereas, I don't think you can make
cargo newadditive without templates (aside from just creating empty files I guess?)
I think there is a major gap between our thought processes and/or understandings on this.
In my mind, there are distinct needs between project, package, and API templates and if we want a single solution to cover their needs then we would need to do a serious analysis of all of them to make sure we don't back ourselves into a corner. My suspicion is that there are major divergences in needs. Part of the intent of this proposal is to remove a lot of the complexity that comes with handling project and package templates by focusing in on API templates which have a much smaller feature set and intersections with existing dynamic behavior in cargo new that we would likely want to keep. This feels like it fits well within cargo news existing behavior and will compose with project or package templates just as well as the existing cargo new behavior.
The whole proposal is about having additive templates in cargo new that aren't empty files. To say you we can't do it requires some clearly articulated reasoning to back such a statement.
Discussion in the ATmosphere