tauri-docs icon indicating copy to clipboard operation
tauri-docs copied to clipboard

feat: Plugin permissions component

Open vasfvitor opened this issue 1 year ago • 6 comments

This is mostly to improve DX. Right now it just gets the generated md file and outputs it. Pending i18n functionality

Preview: ~~But right now it is like that below, until changes are implemented upstream, or ,alternatively, process the md file in the component. I'm already checking this out.~~

~For now this is pending tauri-plugin-workspace submodule update,~ ~but it's best to wait to update it until/if the generated markdown is changed in Tauri core~ https://github.com/tauri-apps/tauri/pull/9019

Usage:

 <Permissions plugin="authenticator" />

vasfvitor avatar Feb 27 '24 23:02 vasfvitor

Deploy Preview for tauri-v2 ready!

Built without sensitive environment variables

Name Link
Latest commit 064a92226851ed2acdc5dd7357c5603e0e6d8bb6
Latest deploy log https://app.netlify.com/sites/tauri-v2/deploys/66b6a655ce1c5c0009a6f0b4
Deploy Preview https://deploy-preview-1890--tauri-v2.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

Lighthouse
1 paths audited
Performance: 100 (🟢 up 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 92 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Feb 27 '24 23:02 netlify[bot]

Added the plugin identifier to the permission id in https://github.com/tauri-apps/tauri/pull/10113 so you should be able to use this somehow. Also open to improve the generated tables.

tillmann-crabnebula avatar Jun 24 '24 12:06 tillmann-crabnebula

Hey @vasfvitor can you update the tauri and plugin workspace submodule (the plugins default permissions and the upstream PR are merged)? Would like to see it in rendered preview :)

tillmann-crabnebula avatar Jun 26 '24 06:06 tillmann-crabnebula

Also wondering how we want to translate the auto generated content and content based on the plugins permissions. Maybe we use some auto translation for these generated sections?

tillmann-crabnebula avatar Jun 26 '24 06:06 tillmann-crabnebula

can you update the tauri and plugin workspace submodule (the plugins default permissions and the upstream PR are merged)?

@tillmann-crabnebula it looks https://github.com/tauri-apps/plugins-workspace/blob/v2/plugins/autostart/permissions/autogenerated/reference.md broken? I'll update the submodules

Also wondering how we want to translate the auto generated content and content based on the plugins permissions. Maybe we use some auto translation for these generated sections?

this is something I've been wondering since. And somehow having it auto translated would be the best, because the strings are very repetitive and prone to change. And I think it should be translated because it's part of a 'normal' page where eveything else can be translated and not a full auto generated reference page

vasfvitor avatar Jun 26 '24 16:06 vasfvitor

https://deploy-preview-1890--tauri-v2.netlify.app/plugin/global-shortcut/

vasfvitor avatar Jun 26 '24 16:06 vasfvitor

@simonhyll for some reason it's failing on set_statuses, any ideas?

vasfvitor avatar Jul 23 '24 17:07 vasfvitor

I didn't know about this one and opened #2522 just pick the one you prefer and close the other (or we could merge this one and apply my other changes idk)

lucasfernog avatar Aug 09 '24 17:08 lucasfernog

I'm kinda leaning into yours now that I have to write some scope docs.. yours is more flexible :)

lucasfernog avatar Aug 09 '24 23:08 lucasfernog

Something I wish we could have is to keep the headers in the "On this page" section :/ doesn't seem like it's possible since we're inlining HTML instead of markdown

lucasfernog avatar Aug 09 '24 23:08 lucasfernog

fyi alternatively we could import the markdown files directly:

import { Content as PluginPermissions } from '../../../../packages/plugins-workspace/plugins/fs/permissions/autogenerated/reference.md';

but that still doesn't preserve the headers :(

lucasfernog avatar Aug 09 '24 23:08 lucasfernog

I didn't know about this one and opened https://github.com/tauri-apps/tauri-docs/pull/2522 just pick the one you prefer and close the other (or we could merge this one and apply my other changes idk)

np, I just looked at it and was thinking about using yours because you already provided more usage context. Notice that mine changes around 26 files and yours 17, so a few pages was changed without need, or are missing tables (I added to all pages with or without content)

vasfvitor avatar Aug 09 '24 23:08 vasfvitor

and I always enjoy seeing how people solves the same problem that I did in a totally different way

vasfvitor avatar Aug 09 '24 23:08 vasfvitor

i'll go ahead and merge this one, i wanna move a bit faster to write as much content as i can :D

lucasfernog avatar Aug 09 '24 23:08 lucasfernog