tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
83.81k stars 2.52k forks source link

[feat] tauri subcommand `add-plugin` #11417

Closed Goodjooy closed 1 day ago

Goodjooy commented 1 day ago

Describe the problem

When I migrated from V1 to V2, I had to add a lot of plugins to package.json and Cargo.toml, which was a bit tedious.

Describe the solution you'd like

Is it possible to have an additional command that adds relevant dependencies to both package.json and src-tauri/Cargo.toml.

Example

For example, if you have the command cargo tauri add to add a plugin, and now I want to add the plugin cli, the command would be :

cargo tauri add cli@2

Then the command will perform the following actions:

Alternatives considered

No response

Additional context

No response

FabianLars commented 1 day ago

cargo tauri add cli@2 - well, you should have tried running that one 😅 What you're asking for is implemented in the v2 cli and you even got the syntax right-ish (maybe omit the @2 if npm complains).