Skip to content

Add support for cargo-generate on "cargo-gen" branch#227

Draft
c-git wants to merge 19 commits intoemilk:mainfrom
c-git:create-cargo-generate-template
Draft

Add support for cargo-generate on "cargo-gen" branch#227
c-git wants to merge 19 commits intoemilk:mainfrom
c-git:create-cargo-generate-template

Conversation

@c-git
Copy link
Copy Markdown
Contributor

@c-git c-git commented Apr 21, 2026

This is an implementation of idea number 2 from #169

Currently still in progress Pending answering the open questions now.

Open question:

  • We need to decide what is the preferred way to set authors in the Cargo.toml. There are three options that I have found of so far.
    1. Use the built in value from cargo-generate (easiest, doesn't prompt the user just sets it based on code from cargo) (Currently using this approach)
    2. Ask the user for the value providing a default of the value we use so they'll have an idea what format to enter it in.
    3. Ask it in two parts like we currently do in the script (Matches current but do users want to set this again? Would they care?)
  • Do we need to put more effort into default values than just showing what we currently have them set to in the template? (It might be possible to do via Rhai in the hooks but I've decided to leave this alone for now unless someone thinks it's worth the effort. Not worth it to me)
  • Should we update the instructions in the readme to update the broader set of fields that we update via cargo-generate?

TODO

  • Write rust single file script to put in placeholders
  • Add placeholder in config with default values of our current values
  • Create CI job to prepare the repo and push it to another branch
  • Update readme to explain how to use cargo-generate
    • How to install cargo-generate
    • The command to use to run cargo generate
    • How to setup the command as a favourite to make it shorter to type
  • Add a CI job on that other branch to test if the expansion works Abandoned because CI doesn't seem to trigger when expected and this isn't very important.
  • Remove test line from CI - create-cargo-generate-template # For testing

@c-git c-git force-pushed the create-cargo-generate-template branch from ca0a429 to 649d7f1 Compare April 21, 2026 03:03
@c-git
Copy link
Copy Markdown
Contributor Author

c-git commented Apr 21, 2026

Basically ready for review but need to discuss/decide on the open questions. Not sure if I should mark it as ready to review still.

Corrected grammar and formatting in README.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant