Skip to content

Commit 9aeaca7

Browse files
authored
chore(dpes): update templates for tauri alpha.9 (#424)
* chore(dpes): update templates for tauri alpha.9 * fix vanilla templates * fix npm versions * fix vanilla templates button type
1 parent 88944c8 commit 9aeaca7

54 files changed

Lines changed: 264 additions & 152 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changes/tauri-alpha.09.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"create-tauri-app": "minor"
3+
"create-tauri-app-js": "minor"
4+
---
5+
6+
Update `--alpha` templates for `tauri@2.0.0-alpha.9`
7+

.changes/templates-form.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+
Update `vue`, `vue-ts`, `vanilla`, `vanilla-ts`, `solid`, `solid-ts`, `svelte`, and `svelte-ts` to use `<form>`
7+

.github/workflows/publish-napi.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ jobs:
193193
run: |
194194
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
195195
npm publish
196+
jq '.name = "create-tauri" | .bin = { "create-tauri": .bin["create-tauri-app"] } | del(.scripts.prepublishOnly)' package.json > package.tmp
197+
mv -f package.tmp package.json
198+
npm publish
196199
env:
197200
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
198201
NPM_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}

packages/cli/fragments/_base_/src-tauri/%(alpha)%Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ edition = "2021"
1313
tauri-build = { version = "2.0.0-alpha", features = [] }
1414

1515
[dependencies]
16-
tauri = { version = "2.0.0-alpha", features = ["shell-open"] }
16+
tauri = { version = "2.0.0-alpha", features = [] }
17+
tauri-plugin-window = "2.0.0-alpha"
18+
tauri-plugin-shell = "2.0.0-alpha"
1719
serde = { version = "1.0", features = ["derive"] }
1820
serde_json = "1.0"
1921

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"build": {
3+
"beforeDevCommand": "~fragment_before_dev_command~",
4+
"beforeBuildCommand": "~fragment_before_build_command~",
5+
"devPath": "~fragment_dev_path~",
6+
"distDir": "~fragment_dist_dir~",
7+
"withGlobalTauri": "~fragment_with_global_tauri~"
8+
},
9+
"package": {
10+
"productName": "~package_name~",
11+
"version": "0.0.0"
12+
},
13+
"tauri": {
14+
"bundle": {
15+
"active": true,
16+
"targets": "all",
17+
"identifier": "com.tauri.dev",
18+
"icon": [
19+
"icons/32x32.png",
20+
"icons/128x128.png",
21+
"icons/128x128@2x.png",
22+
"icons/icon.icns",
23+
"icons/icon.ico"
24+
]
25+
},
26+
"security": {
27+
"csp": null
28+
},
29+
"windows": [
30+
{
31+
"fullscreen": false,
32+
"resizable": true,
33+
"title": "~package_name~",
34+
"width": 800,
35+
"height": 600
36+
}
37+
]
38+
},
39+
"plugins": {
40+
"shell": {
41+
"open": true
42+
}
43+
}
44+
}

packages/cli/fragments/_base_/src-tauri/%(mobile)%Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ crate-type = ["staticlib", "cdylib", "rlib"]
1717
tauri-build = { version = "2.0.0-alpha", features = [] }
1818

1919
[dependencies]
20-
tauri = { version = "2.0.0-alpha", features = ["shell-open"] }
20+
tauri = { version = "2.0.0-alpha", features = [] }
21+
tauri-plugin-window = "2.0.0-alpha"
22+
tauri-plugin-shell = "2.0.0-alpha"
2123
serde = { version = "1.0", features = ["derive"] }
2224
serde_json = "1.0"
2325

packages/cli/fragments/_base_/src-tauri/tauri.conf.json renamed to packages/cli/fragments/_base_/src-tauri/%(stable)%tauri.conf.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333
"security": {
3434
"csp": null
3535
},
36-
"updater": {
37-
"active": false
38-
},
3936
"windows": [
4037
{
4138
"fullscreen": false,
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
2+
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
3+
4+
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
5+
#[tauri::command]
6+
fn greet(name: &str) -> String {
7+
format!("Hello, {}! You've been greeted from Rust!", name)
8+
}
9+
10+
fn main() {
11+
tauri::Builder::default()
12+
.plugin(tauri_plugin_window::init())
13+
.plugin(tauri_plugin_shell::init())
14+
.invoke_handler(tauri::generate_handler![greet])
15+
.run(tauri::generate_context!())
16+
.expect("error while running tauri application");
17+
}

packages/cli/fragments/_base_/src-tauri/src/%(mobile)%lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ 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_window::init())
11+
.plugin(tauri_plugin_shell::init())
1012
.invoke_handler(tauri::generate_handler![greet])
1113
.run(tauri::generate_context!())
1214
.expect("error while running tauri application");

packages/cli/fragments/_base_/src-tauri/src/%(stable-alpha)%main.rs renamed to packages/cli/fragments/_base_/src-tauri/src/%(stable)%main.rs

File renamed without changes.

0 commit comments

Comments
 (0)