Skip to content

Commit 82413b9

Browse files
authored
feat: use tauri-plugin-opener instead of tauri-plugin-shell in templates (#854)
1 parent c9e3cbc commit 82413b9

16 files changed

Lines changed: 22 additions & 15 deletions

File tree

.changes/opener.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"create-tauri-app": "patch"
3+
"create-tauri-app-js": "patch"
4+
---
5+
6+
Use `tauri-plugin-opener` instead of `tauri-plugin-shell` in templates
7+

templates/_base_/src-tauri/Cargo.toml.lte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ tauri-build = { version = "2", features = [] }
2323

2424
[dependencies]
2525
tauri = { version = "2", features = [] }
26-
tauri-plugin-shell = "2"{% endif %}
26+
tauri-plugin-opener = "2"{% endif %}
2727
serde = { version = "1", features = ["derive"] }
2828
serde_json = "1"
2929
{% if v1 %}

templates/_base_/src-tauri/capabilities/%(v2)%default.json.lte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"windows": ["main"],
66
"permissions": [
77
"core:default",
8-
"shell:allow-open"
8+
"opener:default"
99
]
1010
}

templates/_base_/src-tauri/src/%(v2)%lib.rs.lte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fn greet(name: &str) -> String {
77
#[cfg_attr(mobile, tauri::mobile_entry_point)]
88
pub fn run() {
99
tauri::Builder::default()
10-
.plugin(tauri_plugin_shell::init())
10+
.plugin(tauri_plugin_opener::init())
1111
.invoke_handler(tauri::generate_handler![greet])
1212
.run(tauri::generate_context!())
1313
.expect("error while running tauri application");

templates/template-angular/package.json.lte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"tslib": "^2.3.0",
2323
"zone.js": "~0.14.2",
2424
"@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %},
25-
"@tauri-apps/plugin-shell": "^2"{% endif %}
25+
"@tauri-apps/plugin-opener": "^2"{% endif %}
2626
},
2727
"devDependencies": {
2828
"@angular-devkit/build-angular": "^17.0.0",

templates/template-preact-ts/package.json.lte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dependencies": {
1313
"preact": "^10.16.0",
1414
"@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %},
15-
"@tauri-apps/plugin-shell": "^2"{% endif %}
15+
"@tauri-apps/plugin-opener": "^2"{% endif %}
1616
},
1717
"devDependencies": {
1818
"@preact/preset-vite": "^2.5.0",

templates/template-preact/package.json.lte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"dependencies": {
1313
"preact": "^10.16.0",
1414
"@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %},
15-
"@tauri-apps/plugin-shell": "^2"{% endif %}
15+
"@tauri-apps/plugin-opener": "^2"{% endif %}
1616
},
1717
"devDependencies": {
1818
"@preact/preset-vite": "^2.5.0",

templates/template-react-ts/package.json.lte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"react": "^18.2.0",
1414
"react-dom": "^18.2.0",
1515
"@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %},
16-
"@tauri-apps/plugin-shell": "^2"{% endif %}
16+
"@tauri-apps/plugin-opener": "^2"{% endif %}
1717
},
1818
"devDependencies": {
1919
"@types/react": "^18.2.15",

templates/template-react/package.json.lte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"react": "^18.2.0",
1414
"react-dom": "^18.2.0",
1515
"@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %},
16-
"@tauri-apps/plugin-shell": "^2"{% endif %}
16+
"@tauri-apps/plugin-opener": "^2"{% endif %}
1717
},
1818
"devDependencies": {
1919
"@vitejs/plugin-react": "^4.2.1",

templates/template-solid-ts/package.json.lte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dependencies": {
1515
"solid-js": "^1.7.8",
1616
"@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %},
17-
"@tauri-apps/plugin-shell": "^2"{% endif %}
17+
"@tauri-apps/plugin-opener": "^2"{% endif %}
1818
},
1919
"devDependencies": {
2020
"typescript": "^5.2.2",

0 commit comments

Comments
 (0)