Skip to content

Commit c46cabc

Browse files
authored
Merge branch 'v2' into i18n-calling-rust
2 parents fdb7082 + 995c59e commit c46cabc

File tree

31 files changed

+1371
-263
lines changed

31 files changed

+1371
-263
lines changed

astro.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,10 @@ export default defineConfig({
284284
collapsed: true,
285285
autogenerate: { directory: 'plugin' },
286286
},
287+
{
288+
label: 'Contribute',
289+
link: '/contribute/',
290+
},
287291
{
288292
label: 'About',
289293
translations: {

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@
3333
"astro-d2": "^0.6.0",
3434
"astro-feelback": "^0.3.4",
3535
"astrojs-service-worker": "^2.0.0",
36-
"jsdom": "^26.0.0",
36+
"jsdom": "^26.1.0",
3737
"prettier": "^3.2.5",
3838
"prettier-plugin-astro": "^0.14.0",
3939
"rehype-autolink-headings": "^7.1.0",
40-
"sass": "^1.77.2",
41-
"sharp": "^0.33.2",
42-
"shiki": "^1.1.7",
40+
"sass": "^1.89.0",
41+
"sharp": "^0.33.5",
42+
"shiki": "^3.0.0",
4343
"starlight-blog": "^0.15.0",
4444
"starlight-links-validator": "^0.13.0"
4545
},
46-
"packageManager": "pnpm@10.10.0",
46+
"packageManager": "pnpm@10.12.3",
4747
"engines": {
4848
"pnpm": "^10.0.0"
4949
},

packages/awesome-tauri

packages/plugins-workspace

Submodule plugins-workspace updated 149 files

packages/tauri

Submodule tauri updated 336 files

pnpm-lock.yaml

Lines changed: 279 additions & 227 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

renovate.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,12 @@
77
"git-submodules": {
88
"enabled": true,
99
"schedule": ["every weekend"]
10-
}
10+
},
11+
"packageRules": [
12+
{
13+
"matchPackageNames": ["/.*astro.*/i", "/.*starlight.*/i", "/.*typedoc.*/i"],
14+
"groupName": "astro & starlight packages",
15+
"separateMajorMinor": false
16+
}
17+
]
1118
}

src/content/docs/blog/tauri-board-elections-2024.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Tauri Board Elections 2024
33
date: 2024-06-28
44
authors: [jbolda]
5-
excerpt: The Tauri Programme is celebrating it's third anniversary of Tauri becoming a programme within The Commons Conservancy. We are hard at work bringing v2 to a stable release, and now the next round of Tauri Board Director elections is upon us!
5+
excerpt: The Tauri Programme is celebrating its third anniversary of Tauri becoming a programme within The Commons Conservancy. We are hard at work bringing v2 to a stable release, and now the next round of Tauri Board Director elections is upon us!
66
---
77

88
The Tauri Programme is celebrating its third anniversary of Tauri becoming a programme within [The Commons Conservancy](https://commonsconservancy.org/). We are hard at work bringing v2 to a stable release, and now the next round of Tauri Board Director elections is upon us! Want to [get involved in other ways](#interested-in-getting-involved) and help Tauri towards v2? We would love your contributions especially to help evolve the documentation!

src/content/docs/concept/Inter-Process Communication/brownfield.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ legacy systems.
1616
## Configuration
1717

1818
Because the Brownfield pattern is the default pattern, it doesn't require a configuration option to be set. To explicitly set
19-
it, you can use the `tauri > pattern` object in the `tauri.conf.json` configuration file.
19+
it, you can use the `app > security > pattern` object in the `tauri.conf.json` configuration file.
2020

2121
```json
2222
{
23-
"tauri": {
24-
"pattern": {
25-
"use": "brownfield"
23+
"app": {
24+
"security": {
25+
"pattern": {
26+
"use": "brownfield"
27+
}
2628
}
2729
}
2830
}

src/content/docs/concept/size.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ This won't be accounting for dynamically added ACLs at runtime so make sure to c
103103
and let them generate a list of allowed commands from the ACL,
104104
this will then be used by the `generate_handler` macro to remove unused commands based on that
105105

106-
An internal detial is this environment variable is currently `REMOVE_UNUSED_COMMANDS`,
106+
An internal detail is this environment variable is currently `REMOVE_UNUSED_COMMANDS`,
107107
and it's set to project's directory, usually the `src-tauri` directory, this is used for the build scripts to find the capability files,
108108
and although it's not encouraged, you can still set this environment variable yourself if you can't or don't want to use `tauri-cli` to get this to work
109109
(**do note that as this is an implementation detail, we don't guarantee the stability of it**)

src/content/docs/contribute/index.mdx

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: Contribute
3+
description: Guide for Tauri contributors
4+
sidebar:
5+
order: 0
6+
label: Overview
7+
badge:
8+
text: New
9+
variant: tip
10+
---
11+
12+
We, the maintainers, are really excited that you are interested in contributing to Tauri. We welcome contributors of any skill level and are happy to provide guidance on PRs.
13+
In case of any doubts you can reach out to us on [our Discord server](https://discord.gg/SpmNs4S).
14+
15+
### Project repositories
16+
17+
Main Tauri repositories you can contribute to are:
18+
19+
- The [core Tauri](https://github.com/tauri-apps/tauri/) repository containing the Tauri runtime, build tools, macros and utils.
20+
- [Plugins workspace](https://github.com/tauri-apps/plugins-workspace) repository with all the official Tauri plugins
21+
- [Tauri Docs](https://github.com/tauri-apps/tauri-docs) repository containing this website
22+
23+
Each of those Tauri repositories contains a `.github/CONTRIBUTING.md` file. In it you will find instructions on how to set up local development environment and submit a Pull Request.

src/content/docs/develop/Plugins/develop-mobile.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,20 @@ class ExamplePlugin(private val activity: Activity): Plugin(activity) {
216216
}
217217
```
218218

219+
:::note
220+
On Android native commands are scheduled on the main thread. Performing long-running operations will cause the UI to freeze and potentially "Application Not Responding" (ANR) error.
221+
222+
If you need to wait for some blocking IO, you can launch a corouting like that:
223+
224+
```kotlin
225+
CoroutineScope(Dispatchers.IO).launch {
226+
val result = myLongRunningOperation()
227+
invoke.resolve(result)
228+
}
229+
```
230+
231+
:::
232+
219233
</TabItem>
220234
<TabItem label="iOS">
221235

src/content/docs/develop/sidecar.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ The string provided to `Command.sidecar` must match one of the strings defined i
171171

172172
You can pass arguments to Sidecar commands just like you would for running normal [Command][std::process::Command].
173173

174-
Arguments can be either **static** (e.g. `-o` or `serve`) or **dynamic** (e.g. `<file_path>` or `localhost:<PORT>`). You define the arguments in the exact order in which you'd call them. Static arguments are defined as-is, while dynamic arguments can be defined using a regular expression.
174+
Arguments can be either **static** (e.g. `-o` or `serve`) or **dynamic** (e.g. `<file_path>` or `localhost:<PORT>`). A value of `true` will allow any arguments to be passed to the command. `false` will disable all arguments. If neither `true` or `false` is set, you define the arguments in the exact order in which you'd call them. Static arguments are defined as-is, while dynamic arguments can be defined using a regular expression.
175175

176176
First, define the arguments that need to be passed to the sidecar command in `src-tauri/capabilities/default.json`:
177177

src/content/docs/distribute/Sign/macos.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Code signing is required on macOS to allow your application to be listed in the
1010

1111
## Prerequisites
1212

13-
Code signing on macOS requires an [Apple Developer] account which is either paid (99$ per year) or on the free plan. You also need an Apple device where you perform the code signing. This is required by the signing process and due to Apple's Terms and Conditions.
13+
Code signing on macOS requires an [Apple Developer] account which is either paid (99$ per year) or on the free plan (only for testing and development purposes). You also need an Apple device where you perform the code signing. This is required by the signing process and due to Apple's Terms and Conditions.
1414

1515
:::note
1616
Note when using a free Apple Developer account, you will not be able to notarize your application and it will still show up as not verified when opening the app.
@@ -134,6 +134,7 @@ jobs:
134134
security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
135135
security default-keychain -s build.keychain
136136
security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
137+
security set-keychain-settings -t 3600 -u build.keychain
137138
security import certificate.p12 -k build.keychain -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign
138139
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
139140
security find-identity -v -p codesigning build.keychain

src/content/docs/distribute/flatpak.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ finish-args:
7575
- --socket=fallback-x11 # Permission needed to show the window
7676
- --device=dri # OpenGL, not necessary for all projects
7777
- --share=ipc
78+
- --talk-name=org.kde.StatusNotifierWatcher # Optional: needed only if your app uses the tray icon
79+
- --filesystem=xdg-run/tray-icon:create # Optional: needed only if your app uses the tray icon - see an alternative way below
7880

7981
modules:
8082
- name: binary
@@ -99,6 +101,19 @@ modules:
99101
100102
The Gnome 46 runtime includes all dependencies of the standard Tauri app with their correct versions.
101103
104+
:::note[Using tray-icon without changing the Flatpak manifest]
105+
If you prefer not opening access from your app to $XDG_RUNTIME_DIR (where tray-icon is saved on linux), you can change the path tauri saves the tray image:
106+
107+
```rust
108+
TrayIconBuilder::new()
109+
.icon(app.default_window_icon().unwrap().clone())
110+
.temp_dir_path(app.path().app_cache_dir().unwrap()) // will save to the cache folder ($XDG_CACHE_HOME) where the app already has permission
111+
.build()
112+
.unwrap();
113+
```
114+
115+
:::
116+
102117
**5. Install, and Test the app**
103118

104119
```shell

src/content/docs/distribute/snapcraft.mdx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,24 @@ apps:
8484
# - network
8585
# Add whatever plugs you need here, see https://snapcraft.io/docs/snapcraft-interfaces for more info.
8686
# The gnome extension already includes [ desktop, desktop-legacy, gsettings, opengl, wayland, x11, mount-observe, calendar-service ]
87+
# - single-instance-plug # add this if you're using the single-instance plugin
88+
#slots:
89+
# Add the slots you need to expose to other snaps
90+
# - single-instance-plug # add this if you're using the single-instance plugin
91+
92+
# Add these lines only if you're using the single-instance plugin
93+
# Check https://v2.tauri.app/plugin/single-instance/ for details
94+
#slots:
95+
# single-instance:
96+
# interface: dbus
97+
# bus: session
98+
# name: org.net_mydomain_MyApp.SingleInstance # Remember to change net_mydomain_MyApp to your app ID with "_" instead of "." and "-"
99+
#
100+
#plugs:
101+
# single-instance-plug:
102+
# interface: dbus
103+
# bus: session
104+
# name: org.net_mydomain_MyApp.SingleInstance # Remember to change net_mydomain_MyApp to your app ID with "_" instead of "." and "-"
87105

88106
package-repositories:
89107
- type: apt
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
---
2+
title: Inicio automático
3+
description: Inicia automáticamente tu aplicación al arrancar el sistema.
4+
plugin: autostart
5+
i18nReady: true
6+
---
7+
8+
import PluginLinks from '@components/PluginLinks.astro';
9+
import Compatibility from '@components/plugins/Compatibility.astro';
10+
11+
import { Tabs, TabItem, Steps } from '@astrojs/starlight/components';
12+
import CommandTabs from '@components/CommandTabs.astro';
13+
import PluginPermissions from '@components/PluginPermissions.astro';
14+
15+
<PluginLinks plugin={frontmatter.plugin} />
16+
17+
Inicia automáticamente tu aplicación al arrancar el sistema.
18+
19+
## Plataformas compatibles
20+
21+
<Compatibility plugin={frontmatter.plugin} />
22+
23+
## Configuración
24+
25+
Instala el plugin de autostart para comenzar.
26+
27+
<Tabs>
28+
<TabItem label="Automático">
29+
30+
Usa el gestor de paquetes de tu proyecto para añadir la dependencia:
31+
32+
{' '}
33+
34+
<CommandTabs
35+
npm="npm run tauri add autostart"
36+
yarn="yarn run tauri add autostart"
37+
pnpm="pnpm tauri add autostart"
38+
deno="deno task tauri add autostart"
39+
bun="bun tauri add autostart"
40+
cargo="cargo tauri add autostart"
41+
/>
42+
43+
</TabItem>
44+
<TabItem label="Manual">
45+
<Steps>
46+
47+
1. Ejecuta el siguiente comando en la carpeta `src-tauri` para añadir el plugin a las dependencias del proyecto en `Cargo.toml`:
48+
49+
```sh frame=none
50+
cargo add tauri-plugin-autostart --target 'cfg(any(target_os = "macos", windows, target_os = "linux"))'
51+
```
52+
53+
2. Modifica `lib.rs` para inicializar el plugin:
54+
55+
```rust title="src-tauri/src/lib.rs" ins={5-6}
56+
#[cfg_attr(mobile, tauri::mobile_entry_point)]
57+
pub fn run() {
58+
tauri::Builder::default()
59+
.setup(|app| {
60+
#[cfg(desktop)]
61+
app.handle().plugin(tauri_plugin_autostart::init(tauri_plugin_autostart::MacosLauncher::LaunchAgent, Some(vec!["--flag1", "--flag2"]) /* arbitrary number of args to pass to your app */));
62+
Ok(())
63+
})
64+
.run(tauri::generate_context!())
65+
.expect("error al ejecutar la aplicación tauri");
66+
}
67+
```
68+
69+
3. Puedes instalar los enlaces de JavaScript Guest utilizando tu gestor de paquetes de JavaScript preferido:
70+
71+
<CommandTabs
72+
npm="npm install @tauri-apps/plugin-autostart"
73+
yarn="yarn add @tauri-apps/plugin-autostart"
74+
pnpm="pnpm add @tauri-apps/plugin-autostart"
75+
deno="deno add npm:@tauri-apps/plugin-autostart"
76+
bun="bun add @tauri-apps/plugin-autostart"
77+
/>
78+
79+
</Steps>
80+
</TabItem>
81+
82+
</Tabs>
83+
84+
## Uso
85+
86+
El plugin de autostart está disponible tanto en JavaScript como en Rust.
87+
88+
<Tabs syncKey="lang">
89+
<TabItem label="JavaScript">
90+
91+
```javascript
92+
import { enable, isEnabled, disable } from '@tauri-apps/plugin-autostart';
93+
// si utilizas `"withGlobalTauri": true`, deberías usar
94+
// const { enable, isEnabled, disable } = window.__TAURI__.autostart;
95+
96+
// Activar el arranque automático
97+
await enable();
98+
// Comprobar el estado de activación
99+
console.log(`registered for autostart? ${await isEnabled()}`);
100+
// Desactivar el arranque automático
101+
disable();
102+
```
103+
104+
</TabItem>
105+
<TabItem label="Rust">
106+
107+
```rust
108+
#[cfg_attr(mobile, tauri::mobile_entry_point)]
109+
pub fn run() {
110+
tauri::Builder::default()
111+
.setup(|app| {
112+
#[cfg(desktop)]
113+
{
114+
use tauri_plugin_autostart::MacosLauncher;
115+
use tauri_plugin_autostart::ManagerExt;
116+
117+
app.handle().plugin(tauri_plugin_autostart::init(
118+
MacosLauncher::LaunchAgent,
119+
Some(vec!["--flag1", "--flag2"]),
120+
));
121+
122+
// Obtener el gestor de arranque automático
123+
let autostart_manager = app.autolaunch();
124+
// Activar el arranque automático
125+
let _ = autostart_manager.enable();
126+
// Comprobar el estado de activación
127+
println!("registered for autostart? {}", autostart_manager.is_enabled().unwrap());
128+
// Desactivar el arranque automático
129+
let _ = autostart_manager.disable();
130+
}
131+
Ok(())
132+
})
133+
.run(tauri::generate_context!())
134+
.expect("error al ejecutar la aplicación tauri");
135+
}
136+
```
137+
138+
</TabItem>
139+
</Tabs>
140+
141+
## Permisos
142+
143+
Por defecto, todos los comandos y ámbitos de plugin potencialmente peligrosos están bloqueados y no se pueden acceder. Debes modificar los permisos en tu configuración de `capabilities` para habilitar estos.
144+
145+
Consulta la [Descripción general de capacidades](/es/security/capabilities/) para obtener más información y la [guía paso a paso](/es/learn/security/using-plugin-permissions/) para utilizar los permisos de plugin.
146+
147+
```json title="src-tauri/capabilities/default.json"
148+
{
149+
"permissions": [
150+
...,
151+
"autostart:allow-enable",
152+
"autostart:allow-disable",
153+
"autostart:allow-is-enabled"
154+
]
155+
}
156+
```
157+
158+
<PluginPermissions plugin={frontmatter.plugin} />

0 commit comments

Comments
 (0)