-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[docs/feat] npm run tauri add tauri-plugin-custom
for community plugins
#12217
Comments
custom
for community pluginsnpm run tauri add tauri-plugin-custom
for community plugins
well, not really. at least not anymore (for now).
Yep iirc we want |
Thx for the feedback. This helps a lot :) Would it help to add some parameter I wasn't sure if it would be easy to read and modify the tauri code, so I tried and tested it locally first. I guess I would still need to create a feature request first and sign my git commit properly. It would also be fine if I rename this parameter to something else. |
npm run tauri add tauri-plugin-custom
for community pluginsnpm run tauri add tauri-plugin-custom
for community plugins
My first idea would be --community but i really hate naming things x)
looks good on first glance
that would indeed be a requirement for the PR to be merged.
Changed it already :) |
Thx. |
It currently isn't possible to simply add a community plugin the same was as adding official plugins. Trying to perform `npm run tauri add tauri-plugin-python` is trying to install npm package `@tauri-apps/plugin-python`. But the npm scope `@tauri-apps/` is reserved for official tauri plugins. The official documentation recommends to name the npm package `tauri-plugin-{name}-api` and it should be possible to have a parameter that makes it possible to install that package. - closes #12217 This changes the command to check if the plugin is an official tauri plugin or not, using the appropriate npm package name format --------- Co-authored-by: Lucas Nogueira <[email protected]>
Describe the problem
So - I'm not sure if this is a bug, a feature request or something where the documentation could be improved.
I'm trying to write a plugin for tauri and I was trying to add it via
npm run tauri add tauri-plugin-python
I registered the plugin
tauri-plugin-python
in crates.io and the npm package astauri-plugin-python-api
in npmjs.com.But when trying to add it via
npm run tauri add tauri-plugin-python
, it tries to install@tauri-apps/plugin-python
.According to the cli code,
@tauri-apps/plugin-...
just seems to be the only scope for npm packages:https://github.com/tauri-apps/tauri/blob/f86e2387c96b7872a7ca661fd8c22136b2932402/crates/tauri-cli/src/add.rs#L54C7-L54C15
According to the documentation, you should still call the plugin js package
tauri-plugin-...-api
. And it is recommended to use npm-scopes. But it seems that the only supported scope is@tauri-apps
.I guess some good and often used community plugins are manually moved to
@tauri-apps
So the default way is to perform manual steps for community plugins and calling
cargo add ...
andnpm install ...
instead ofnpm run tauri add...
Is this correct (just asking)?
Edit:
Reproduction
Run
npm run tauri add tauri-plugin-python
or another community plugin. It is always trying to use an npm package fro@tauri-apps/...
Therefore, it is required to perform manual steps instead of just performing
tauri add
to add community plugins. This needs to be documented.Expected behavior
Adding additional parameter
--community
so that community plugins can also be added vianpm run tauri add ... --community
which performs the same steps for community plugins as for official ones.The text was updated successfully, but these errors were encountered: