Skip to content
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

Add dx create options to skip user interaction #1871

Closed
Andrew15-5 opened this issue Jan 27, 2024 · 5 comments · Fixed by #1872
Closed

Add dx create options to skip user interaction #1871

Andrew15-5 opened this issue Jan 27, 2024 · 5 comments · Fixed by #1872
Labels
cli Related to the dioxus-cli program enhancement New feature or request

Comments

@Andrew15-5
Copy link
Contributor

Specific Demand

Right now, when creating a Dioxus project with dx create you can only specify the template that will be used or use the default one if the option is omitted. For more convenience and easier reproduction examples, a way to skip the user interaction would be great (using echo | dx create doesn't work, and it's more of a hack). So something like --yes to "answer yes" for all questions when creating a cargo project (to use the default values for all questions/variables).

Implement Suggestion

The specifics of the implementation are discussed here: https://discord.com/channels/899851952891002890/1200469217884000288.

@ealmloff ealmloff added enhancement New feature or request cli Related to the dioxus-cli program labels Jan 28, 2024
@mrxiaozhuox
Copy link
Member

mrxiaozhuox commented Jan 28, 2024

Make a new option that can create template without cargo-generator ?

  • Some of template want adapt is difficult, and you don't need input any option from cargo-generator.

@Andrew15-5
Copy link
Contributor Author

This isn't planned in the linked PR. It also would probably be much harder to do it manually, though it will reduce total number of dependencies a little bit.

@Andrew15-5
Copy link
Contributor Author

Some of template want adapt is difficult

I don't understand this part at all. Maybe you can rephrase that? Or say what you want to do.

and you don't need input any option from cargo-generator.

With that PR you only will have to provide:

  • --name and --yes to create the project using the default template (with default values)
  • --name, --yes, --template for other templates

You can also then provide --option to override the default values in the cargo-generate.toml (in the selected template).

@Andrew15-5
Copy link
Contributor Author

Right now cargo-generate can't get the default values: cargo-generate/cargo-generate#1114. So I will implement the "get default values" only for the default template as a temporary fix.

@Andrew15-5
Copy link
Contributor Author

I will copy it here, just in case: #1872 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the dioxus-cli program enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants