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

[feat] tauri add CLI Command #6505

Closed
lorenzolewis opened this issue Mar 20, 2023 · 3 comments
Closed

[feat] tauri add CLI Command #6505

lorenzolewis opened this issue Mar 20, 2023 · 3 comments

Comments

@lorenzolewis
Copy link
Member

lorenzolewis commented Mar 20, 2023

Describe the problem

With doubling-down down on a plugin approach (Issue for context: #6339, RFC coming soon from @lucasfernog) there are going to be more and more packages to deal with in the Tauri ecosystem. A lot (all?) of them will require the user performing the following steps:

  1. Add to Cargo
  2. Add to Node (if using)
  3. Register the plugin in main.rs
  4. Then you can begin using the plugin via imports

This is a lot of steps just to start using something like the upcoming camera plugin and can cause a lot of friction to the DX of Tauri.

Describe the solution you'd like

I'd propose adding a command to the Tauri CLI: tauri add. The inspiration from this is the way Astro handles their integration ecosystem: https://docs.astro.build/en/guides/integrations-guide/#automatic-integration-setup

svelte-add is another example of this: https://github.com/svelte-add/svelte-add

This could allow you to do something like this:

pnpm tauri add camera

That would complete steps 1-3 for your by...

  1. Analysing the project (determine if it's only Rust, if there's a node project, if pnpm, etc.)
  2. Propose the changes visually with diffs in the terminal for the user to make (such as adding the dependencies, updating main.rs, etc.)
  3. Applying those changes on the user's confirmation

Alternatives considered

No response

Additional context

This can become quite tricky when dealing with different package versions across the Tauri ecosystem. We may need to have a conversation around what versions and compatibility between versions looks like. I may put in an RFC after this week's WG call to begin this discussion.

Future considerations

We may want to look at expanding this to handle adding frontend frameworks (Svelte, Vue, etc.) but that is a lot more complicated. I'd take this as a first step and see where we land.

@denjell-crabnebula
Copy link

tauri plugin [add|update|remove] makes more cognitive sense for me.

@github-project-automation github-project-automation bot moved this to 📬Proposal in Roadmap Sep 26, 2023
@vasfvitor
Copy link
Contributor

vasfvitor commented Oct 10, 2023

To add plugins tauri add is already in place (still missing the write to lib.rs automation) so I guess #7696 supersede this issue.

@amrbashir
Copy link
Member

thanks @vasfvitor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📬Proposal
Development

No branches or pull requests

4 participants