("head::after");
8 |
9 | builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) });
10 |
11 | await builder.Build().RunAsync();
12 |
--------------------------------------------------------------------------------
/templates/template-blazor/src/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://json.schemastore.org/launchsettings.json",
3 | "profiles": {
4 | "http": {
5 | "commandName": "Project",
6 | "dotnetRunMessages": true,
7 | "launchBrowser": false,
8 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
9 | "applicationUrl": "http://localhost:1420",
10 | "environmentVariables": {
11 | "ASPNETCORE_ENVIRONMENT": "Development"
12 | }
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/templates/template-blazor/src/_Imports.razor.lte:
--------------------------------------------------------------------------------
1 | @using System.Net.Http
2 | @using System.Net.Http.Json
3 | @using Microsoft.AspNetCore.Components.Forms
4 | @using Microsoft.AspNetCore.Components.Routing
5 | @using Microsoft.AspNetCore.Components.Web
6 | @using Microsoft.AspNetCore.Components.Web.Virtualization
7 | @using Microsoft.AspNetCore.Components.WebAssembly.Http
8 | @using Microsoft.JSInterop
9 | @using {% project_name_pascal_case %}
10 |
--------------------------------------------------------------------------------
/templates/template-blazor/src/wwwroot/css/app.css:
--------------------------------------------------------------------------------
1 | .logo.blazor:hover {
2 | filter: drop-shadow(0 0 2em #5c2d91);
3 | }
4 |
--------------------------------------------------------------------------------
/templates/template-blazor/src/wwwroot/img/blazor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/template-blazor/src/wwwroot/img/blazor.png
--------------------------------------------------------------------------------
/templates/template-blazor/src/wwwroot/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Tauri + Blazor
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/templates/template-blazor/src/{% project_name_pascal_case %}.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | enable
6 | enable
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/templates/template-dioxus/.manifest:
--------------------------------------------------------------------------------
1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy
2 | # SPDX-License-Identifier: Apache-2.0
3 | # SPDX-License-Identifier: MIT
4 |
5 | beforeDevCommand = dx serve --port 1420
6 | beforeBuildCommand = dx bundle --release
7 | devUrl = http://localhost:1420
8 | frontendDist = ../dist/public
9 | withGlobalTauri = true
10 |
11 | [files]
12 | tauri.svg = assets/tauri.svg
13 | styles.css = assets/styles.css
14 |
--------------------------------------------------------------------------------
/templates/template-dioxus/.taurignore:
--------------------------------------------------------------------------------
1 | /src
2 | /assets
3 | /Cargo.toml
--------------------------------------------------------------------------------
/templates/template-dioxus/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "tauri-apps.tauri-vscode",
4 | "rust-lang.rust-analyzer",
5 | "DioxusLabs.dioxus"
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/templates/template-dioxus/Cargo.toml.lte:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "{% package_name %}-ui"
3 | version = "0.1.0"
4 | edition = "2021"
5 |
6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7 | [dependencies]
8 | dioxus = { version = "0.6", features = ["web"] }
9 | dioxus-logger = "0.6"
10 | wasm-bindgen = "0.2"
11 | wasm-bindgen-futures = "0.4"
12 | web-sys = "0.3"
13 | js-sys = "0.3"
14 | serde = { version = "1", features = ["derive"] }
15 | serde-wasm-bindgen = "0.6"
16 |
17 | [workspace]
18 | members = ["src-tauri"]
19 |
--------------------------------------------------------------------------------
/templates/template-dioxus/Dioxus.toml.lte:
--------------------------------------------------------------------------------
1 | [application]
2 | name = "{% package_name %}-ui"
3 | default_platform = "web"
4 | out_dir = "dist"
5 | asset_dir = "assets"
6 |
7 | [web.app]
8 | title = "Tauri + Dioxus App"
9 |
10 | [web.watcher]
11 | reload_html = true
12 | watch_path = ["src", "assets"]
--------------------------------------------------------------------------------
/templates/template-dioxus/README.md:
--------------------------------------------------------------------------------
1 | # Tauri + Dioxus
2 |
3 | This template should help get you started developing with Tauri and Dioxus.
4 |
5 | ## Recommended IDE Setup
6 |
7 | [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) + [Dioxus](https://marketplace.visualstudio.com/items?itemName=DioxusLabs.dioxus).
8 |
--------------------------------------------------------------------------------
/templates/template-dioxus/_gitignore:
--------------------------------------------------------------------------------
1 | /dist/
2 | /target/
3 | /Cargo.lock
4 |
--------------------------------------------------------------------------------
/templates/template-dioxus/assets/dioxus.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/template-dioxus/assets/dioxus.png
--------------------------------------------------------------------------------
/templates/template-dioxus/assets/styles.css:
--------------------------------------------------------------------------------
1 | .logo.dioxus:hover {
2 | filter: drop-shadow(0 0 2em #2076a8);
3 | }
4 |
--------------------------------------------------------------------------------
/templates/template-dioxus/src/app.rs.lte:
--------------------------------------------------------------------------------
1 | #![allow(non_snake_case)]
2 |
3 | use dioxus::prelude::*;
4 | use serde::{Deserialize, Serialize};
5 | use wasm_bindgen::prelude::*;
6 |
7 | #[wasm_bindgen]
8 | extern "C" {
9 | #[wasm_bindgen(js_namespace = ["window", "__TAURI__", "{% if v2 %}core{% else %}tauri{% endif %}"])]
10 | async fn invoke(cmd: &str, args: JsValue) -> JsValue;
11 | }
12 |
13 | #[derive(Serialize, Deserialize)]
14 | struct GreetArgs<'a> {
15 | name: &'a str,
16 | }
17 |
18 | pub fn App() -> Element {
19 | let mut name = use_signal(|| String::new());
20 | let mut greet_msg = use_signal(|| String::new());
21 |
22 | let greet = move |_: FormEvent| async move {
23 | if name.read().is_empty() {
24 | return;
25 | }
26 |
27 | let name = name.read();
28 | let args = serde_wasm_bindgen::to_value(&GreetArgs { name: &*name }).unwrap();
29 | // Learn more about Tauri commands at {% if v2 %}https://tauri.app/develop/calling-rust/{% else %}https://v1.tauri.app/v1/guides/features/command{% endif %}
30 | let new_msg = invoke("greet", args).await.as_string().unwrap();
31 | greet_msg.set(new_msg);
32 | };
33 |
34 | rsx! {
35 | link { rel: "stylesheet", href: "styles.css" }
36 | main {
37 | class: "container",
38 | h1 { "Welcome to Tauri + Dioxus" }
39 |
40 | div {
41 | class: "row",
42 | a {
43 | href: "https://tauri.app",
44 | target: "_blank",
45 | img {
46 | src: "/tauri.svg",
47 | class: "logo tauri",
48 | alt: "Tauri logo"
49 | }
50 | }
51 | a {
52 | href: "https://dioxuslabs.com/",
53 | target: "_blank",
54 | img {
55 | src: "/dioxus.png",
56 | class: "logo dioxus",
57 | alt: "Dioxus logo"
58 | }
59 | }
60 | }
61 | p { "Click on the Tauri and Dioxus logos to learn more." }
62 |
63 | form {
64 | class: "row",
65 | onsubmit: greet,
66 | input {
67 | id: "greet-input",
68 | placeholder: "Enter a name...",
69 | value: "{name}",
70 | oninput: move |event| name.set(event.value())
71 | }
72 | button { r#type: "submit", "Greet" }
73 | }
74 | p { "{greet_msg}" }
75 | }
76 | }
77 | }
--------------------------------------------------------------------------------
/templates/template-dioxus/src/main.rs:
--------------------------------------------------------------------------------
1 | mod app;
2 |
3 | use app::App;
4 | use dioxus::prelude::*;
5 | use dioxus_logger::tracing::Level;
6 |
7 | fn main() {
8 | dioxus_logger::init(Level::INFO).expect("failed to init logger");
9 | launch(App);
10 | }
11 |
--------------------------------------------------------------------------------
/templates/template-leptos/.manifest:
--------------------------------------------------------------------------------
1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy
2 | # SPDX-License-Identifier: Apache-2.0
3 | # SPDX-License-Identifier: MIT
4 |
5 | beforeDevCommand = trunk serve
6 | beforeBuildCommand = trunk build
7 | devUrl = http://localhost:1420
8 | frontendDist = ../dist
9 | withGlobalTauri = true
10 |
11 | [files]
12 | tauri.svg = public/tauri.svg
13 | styles.css = styles.css
14 |
--------------------------------------------------------------------------------
/templates/template-leptos/.taurignore:
--------------------------------------------------------------------------------
1 | /src
2 | /public
3 | /Cargo.toml
--------------------------------------------------------------------------------
/templates/template-leptos/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
3 | }
4 |
--------------------------------------------------------------------------------
/templates/template-leptos/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "emmet.includeLanguages": {
3 | "rust": "html"
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/templates/template-leptos/Cargo.toml.lte:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "{% package_name %}-ui"
3 | version = "0.1.0"
4 | edition = "2021"
5 |
6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7 | [dependencies]
8 | leptos = { version = "0.7", features = ["csr"] }
9 | wasm-bindgen = "0.2"
10 | wasm-bindgen-futures = "0.4"
11 | js-sys = "0.3"
12 | serde = { version = "1", features = ["derive"] }
13 | serde-wasm-bindgen = "0.6"
14 | console_error_panic_hook = "0.1.7"
15 |
16 | [workspace]
17 | members = ["src-tauri"]
18 |
--------------------------------------------------------------------------------
/templates/template-leptos/README.md:
--------------------------------------------------------------------------------
1 | # Tauri + Leptos
2 |
3 | This template should help get you started developing with Tauri and Leptos.
4 |
5 | ## Recommended IDE Setup
6 |
7 | [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer).
8 |
--------------------------------------------------------------------------------
/templates/template-leptos/Trunk.toml.lte:
--------------------------------------------------------------------------------
1 | [build]
2 | target = "./index.html"
3 |
4 | [watch]
5 | ignore = ["./src-tauri"]
6 |
7 | [serve]
8 | port = 1420
9 | open = false
10 |
--------------------------------------------------------------------------------
/templates/template-leptos/_gitignore:
--------------------------------------------------------------------------------
1 | /dist/
2 | /target/
3 | /Cargo.lock
4 |
--------------------------------------------------------------------------------
/templates/template-leptos/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Tauri + Leptos App
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/templates/template-leptos/src/app.rs.lte:
--------------------------------------------------------------------------------
1 | use leptos::task::spawn_local;
2 | use leptos::{ev::SubmitEvent, prelude::*};
3 | use serde::{Deserialize, Serialize};
4 | use wasm_bindgen::prelude::*;
5 |
6 | #[wasm_bindgen]
7 | extern "C" {
8 | #[wasm_bindgen(js_namespace = ["window", "__TAURI__", "{% if v2 %}core{% else %}tauri{% endif %}"])]
9 | async fn invoke(cmd: &str, args: JsValue) -> JsValue;
10 | }
11 |
12 | #[derive(Serialize, Deserialize)]
13 | struct GreetArgs<'a> {
14 | name: &'a str,
15 | }
16 |
17 | #[component]
18 | pub fn App() -> impl IntoView {
19 | let (name, set_name) = signal(String::new());
20 | let (greet_msg, set_greet_msg) = signal(String::new());
21 |
22 | let update_name = move |ev| {
23 | let v = event_target_value(&ev);
24 | set_name.set(v);
25 | };
26 |
27 | let greet = move |ev: SubmitEvent| {
28 | ev.prevent_default();
29 | spawn_local(async move {
30 | let name = name.get_untracked();
31 | if name.is_empty() {
32 | return;
33 | }
34 |
35 | let args = serde_wasm_bindgen::to_value(&GreetArgs { name: &name }).unwrap();
36 | // Learn more about Tauri commands at {% if v2 %}https://tauri.app/develop/calling-rust/{% else %}https://v1.tauri.app/v1/guides/features/command{% endif %}
37 | let new_msg = invoke("greet", args).await.as_string().unwrap();
38 | set_greet_msg.set(new_msg);
39 | });
40 | };
41 |
42 | view! {
43 |
44 | "Welcome to Tauri + Leptos"
45 |
46 |
54 | "Click on the Tauri and Leptos logos to learn more."
55 |
56 |
64 | { move || greet_msg.get() }
65 |
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/templates/template-leptos/src/main.rs:
--------------------------------------------------------------------------------
1 | mod app;
2 |
3 | use app::*;
4 | use leptos::prelude::*;
5 |
6 | fn main() {
7 | console_error_panic_hook::set_once();
8 | mount_to_body(|| {
9 | view! {
10 |
11 | }
12 | })
13 | }
14 |
--------------------------------------------------------------------------------
/templates/template-leptos/styles.css:
--------------------------------------------------------------------------------
1 | .logo.leptos:hover {
2 | filter: drop-shadow(0 0 2em #a82e20);
3 | }
4 |
--------------------------------------------------------------------------------
/templates/template-preact-ts/.manifest:
--------------------------------------------------------------------------------
1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy
2 | # SPDX-License-Identifier: Apache-2.0
3 | # SPDX-License-Identifier: MIT
4 |
5 | beforeDevCommand = {% pkg_manager_run_command %} dev
6 | beforeBuildCommand = {% pkg_manager_run_command %} build
7 | devUrl = http://localhost:1420
8 | frontendDist = ../dist
9 |
10 | [files]
11 | preact.svg = src/assets/preact.svg
12 | vite.svg = public/vite.svg
13 | tauri.svg = public/tauri.svg
14 | styles.css = src/App.css
15 |
--------------------------------------------------------------------------------
/templates/template-preact-ts/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
3 | }
4 |
--------------------------------------------------------------------------------
/templates/template-preact-ts/README.md:
--------------------------------------------------------------------------------
1 | # Tauri + Preact + Typescript
2 |
3 | This template should help get you started developing with Tauri, Preact and Typescript in Vite.
4 |
5 | ## Recommended IDE Setup
6 |
7 | - [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
8 |
--------------------------------------------------------------------------------
/templates/template-preact-ts/_gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/templates/template-preact-ts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Tauri + Preact + Typescript
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/templates/template-preact-ts/package.json.lte:
--------------------------------------------------------------------------------
1 | {
2 | "name": "{% package_name %}",
3 | "private": true,
4 | "version": "0.1.0",
5 | "type": "module",
6 | "scripts": {
7 | "dev": "vite",
8 | "build": "tsc && vite build",
9 | "preview": "vite preview",
10 | "tauri": "tauri"
11 | },
12 | "dependencies": {
13 | "preact": "^10.25.1",
14 | "@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %},
15 | "@tauri-apps/plugin-opener": "^2"{% endif %}
16 | },
17 | "devDependencies": {
18 | "@preact/preset-vite": "^2.9.3",
19 | "typescript": "~5.6.2",
20 | "vite": "^6.0.3",
21 | "@tauri-apps/cli": "{% if v2 %}^2{% else %}^1{% endif %}"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/templates/template-preact-ts/src/App.css:
--------------------------------------------------------------------------------
1 | .logo.vite:hover {
2 | filter: drop-shadow(0 0 2em #747bff);
3 | }
4 |
5 | .logo.preact:hover {
6 | filter: drop-shadow(0 0 2em #673ab8);
7 | }
8 |
--------------------------------------------------------------------------------
/templates/template-preact-ts/src/App.tsx.lte:
--------------------------------------------------------------------------------
1 | import { useState } from "preact/hooks";
2 | import preactLogo from "./assets/preact.svg";
3 | import { invoke } from "@tauri-apps/api/{% if v2 %}core{% else %}tauri{% endif %}";
4 | import "./App.css";
5 |
6 | function App() {
7 | const [greetMsg, setGreetMsg] = useState("");
8 | const [name, setName] = useState("");
9 |
10 | async function greet() {
11 | // Learn more about Tauri commands at {% if v2 %}https://tauri.app/develop/calling-rust/{% else %}https://v1.tauri.app/v1/guides/features/command{% endif %}
12 | setGreetMsg(await invoke("greet", { name }));
13 | }
14 |
15 | return (
16 |
17 | Welcome to Tauri + Preact
18 |
19 |
30 | Click on the Tauri, Vite, and Preact logos to learn more.
31 |
32 |
46 | {greetMsg}
47 |
48 | );
49 | }
50 |
51 | export default App;
52 |
--------------------------------------------------------------------------------
/templates/template-preact-ts/src/main.tsx:
--------------------------------------------------------------------------------
1 | import { render } from "preact";
2 | import App from "./App";
3 |
4 | render( , document.getElementById("root")!);
5 |
--------------------------------------------------------------------------------
/templates/template-preact-ts/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/templates/template-preact-ts/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "useDefineForClassFields": true,
5 | "module": "ESNext",
6 | "lib": ["ES2020", "DOM", "DOM.Iterable"],
7 | "skipLibCheck": true,
8 |
9 | /* Bundler mode */
10 | "moduleResolution": "bundler",
11 | "allowImportingTsExtensions": true,
12 | "resolveJsonModule": true,
13 | "isolatedModules": true,
14 | "noEmit": true,
15 | "jsx": "react-jsx",
16 | "jsxImportSource": "preact",
17 |
18 | /* Linting */
19 | "strict": true,
20 | "noUnusedLocals": true,
21 | "noUnusedParameters": true,
22 | "noFallthroughCasesInSwitch": true
23 | },
24 | "include": ["src"],
25 | "references": [{ "path": "./tsconfig.node.json" }]
26 | }
27 |
--------------------------------------------------------------------------------
/templates/template-preact-ts/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "composite": true,
4 | "skipLibCheck": true,
5 | "module": "ESNext",
6 | "moduleResolution": "bundler",
7 | "allowSyntheticDefaultImports": true
8 | },
9 | "include": ["vite.config.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/templates/template-preact-ts/vite.config.ts.lte:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "vite";
2 | import preact from "@preact/preset-vite";{% if v2 %}
3 |
4 | // @ts-expect-error process is a nodejs global
5 | const host = process.env.TAURI_DEV_HOST;{% endif %}
6 |
7 | // https://vite.dev/config/
8 | export default defineConfig(async () => ({
9 | plugins: [preact()],
10 |
11 | // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
12 | //
13 | // 1. prevent Vite from obscuring rust errors
14 | clearScreen: false,
15 | // 2. tauri expects a fixed port, fail if that port is not available
16 | server: {
17 | port: 1420,
18 | strictPort: true,{% if v2 %}
19 | host: host || false,
20 | hmr: host
21 | ? {
22 | protocol: "ws",
23 | host,
24 | port: 1421,
25 | }
26 | : undefined,{% endif %}
27 | watch: {
28 | // 3. tell Vite to ignore watching `src-tauri`
29 | ignored: ["**/src-tauri/**"],
30 | },
31 | },
32 | }));
33 |
--------------------------------------------------------------------------------
/templates/template-preact/.manifest:
--------------------------------------------------------------------------------
1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy
2 | # SPDX-License-Identifier: Apache-2.0
3 | # SPDX-License-Identifier: MIT
4 |
5 | beforeDevCommand = {% pkg_manager_run_command %} dev
6 | beforeBuildCommand = {% pkg_manager_run_command %} build
7 | devUrl = http://localhost:1420
8 | frontendDist = ../dist
9 |
10 | [files]
11 | preact.svg = src/assets/preact.svg
12 | vite.svg = public/vite.svg
13 | tauri.svg = public/tauri.svg
14 | styles.css = src/App.css
15 |
--------------------------------------------------------------------------------
/templates/template-preact/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
3 | }
4 |
--------------------------------------------------------------------------------
/templates/template-preact/README.md:
--------------------------------------------------------------------------------
1 | # Tauri + Preact
2 |
3 | This template should help get you started developing with Tauri and Preact in Vite.
4 |
5 | ## Recommended IDE Setup
6 |
7 | - [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
8 |
--------------------------------------------------------------------------------
/templates/template-preact/_gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/templates/template-preact/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Tauri + Preact
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/templates/template-preact/package.json.lte:
--------------------------------------------------------------------------------
1 | {
2 | "name": "{% package_name %}",
3 | "private": true,
4 | "version": "0.1.0",
5 | "type": "module",
6 | "scripts": {
7 | "dev": "vite",
8 | "build": "vite build",
9 | "preview": "vite preview",
10 | "tauri": "tauri"
11 | },
12 | "dependencies": {
13 | "preact": "^10.25.1",
14 | "@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %},
15 | "@tauri-apps/plugin-opener": "^2"{% endif %}
16 | },
17 | "devDependencies": {
18 | "@preact/preset-vite": "^2.9.3",
19 | "vite": "^6.0.3",
20 | "@tauri-apps/cli": "{% if v2 %}^2{% else %}^1{% endif %}"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/templates/template-preact/src/App.css:
--------------------------------------------------------------------------------
1 | .logo.vite:hover {
2 | filter: drop-shadow(0 0 2em #747bff);
3 | }
4 |
5 | .logo.preact:hover {
6 | filter: drop-shadow(0 0 2em #673ab8);
7 | }
8 |
--------------------------------------------------------------------------------
/templates/template-preact/src/App.jsx.lte:
--------------------------------------------------------------------------------
1 | import { useState } from "preact/hooks";
2 | import preactLogo from "./assets/preact.svg";
3 | import { invoke } from "@tauri-apps/api/{% if v2 %}core{% else %}tauri{% endif %}";
4 | import "./App.css";
5 |
6 | function App() {
7 | const [greetMsg, setGreetMsg] = useState("");
8 | const [name, setName] = useState("");
9 |
10 | async function greet() {
11 | // Learn more about Tauri commands at {% if v2 %}https://tauri.app/develop/calling-rust/{% else %}https://v1.tauri.app/v1/guides/features/command{% endif %}
12 | setGreetMsg(await invoke("greet", { name }));
13 | }
14 |
15 | return (
16 |
17 | Welcome to Tauri + Preact
18 |
19 |
30 | Click on the Tauri, Vite, and Preact logos to learn more.
31 |
32 |
46 | {greetMsg}
47 |
48 | );
49 | }
50 |
51 | export default App;
52 |
--------------------------------------------------------------------------------
/templates/template-preact/src/main.jsx:
--------------------------------------------------------------------------------
1 | import { render } from "preact";
2 | import App from "./App";
3 |
4 | render( , document.getElementById("root"));
5 |
--------------------------------------------------------------------------------
/templates/template-preact/vite.config.js.lte:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "vite";
2 | import preact from "@preact/preset-vite";{% if v2 %}
3 |
4 | const host = process.env.TAURI_DEV_HOST;{% endif %}
5 |
6 | // https://vite.dev/config/
7 | export default defineConfig(async () => ({
8 | plugins: [preact()],
9 |
10 | // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
11 | //
12 | // 1. prevent Vite from obscuring rust errors
13 | clearScreen: false,
14 | // 2. tauri expects a fixed port, fail if that port is not available
15 | server: {
16 | port: 1420,
17 | strictPort: true,{% if v2 %}
18 | host: host || false,
19 | hmr: host
20 | ? {
21 | protocol: "ws",
22 | host,
23 | port: 1421,
24 | }
25 | : undefined,{% endif %}
26 | watch: {
27 | // 3. tell Vite to ignore watching `src-tauri`
28 | ignored: ["**/src-tauri/**"],
29 | },
30 | },
31 | }));
32 |
--------------------------------------------------------------------------------
/templates/template-react-ts/.manifest:
--------------------------------------------------------------------------------
1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy
2 | # SPDX-License-Identifier: Apache-2.0
3 | # SPDX-License-Identifier: MIT
4 |
5 | beforeDevCommand = {% pkg_manager_run_command %} dev
6 | beforeBuildCommand = {% pkg_manager_run_command %} build
7 | devUrl = http://localhost:1420
8 | frontendDist = ../dist
9 |
10 | [files]
11 | react.svg = src/assets/react.svg
12 | vite.svg = public/vite.svg
13 | tauri.svg = public/tauri.svg
14 | styles.css = src/App.css
15 |
--------------------------------------------------------------------------------
/templates/template-react-ts/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
3 | }
4 |
--------------------------------------------------------------------------------
/templates/template-react-ts/README.md:
--------------------------------------------------------------------------------
1 | # Tauri + React + Typescript
2 |
3 | This template should help get you started developing with Tauri, React and Typescript in Vite.
4 |
5 | ## Recommended IDE Setup
6 |
7 | - [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
8 |
--------------------------------------------------------------------------------
/templates/template-react-ts/_gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/templates/template-react-ts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Tauri + React + Typescript
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/templates/template-react-ts/package.json.lte:
--------------------------------------------------------------------------------
1 | {
2 | "name": "{% package_name %}",
3 | "private": true,
4 | "version": "0.1.0",
5 | "type": "module",
6 | "scripts": {
7 | "dev": "vite",
8 | "build": "tsc && vite build",
9 | "preview": "vite preview",
10 | "tauri": "tauri"
11 | },
12 | "dependencies": {
13 | "react": "^18.3.1",
14 | "react-dom": "^18.3.1",
15 | "@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %},
16 | "@tauri-apps/plugin-opener": "^2"{% endif %}
17 | },
18 | "devDependencies": {
19 | "@types/react": "^18.3.1",
20 | "@types/react-dom": "^18.3.1",
21 | "@vitejs/plugin-react": "^4.3.4",
22 | "typescript": "~5.6.2",
23 | "vite": "^6.0.3",
24 | "@tauri-apps/cli": "{% if v2 %}^2{% else %}^1{% endif %}"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/templates/template-react-ts/src/App.css:
--------------------------------------------------------------------------------
1 | .logo.vite:hover {
2 | filter: drop-shadow(0 0 2em #747bff);
3 | }
4 |
5 | .logo.react:hover {
6 | filter: drop-shadow(0 0 2em #61dafb);
7 | }
8 |
--------------------------------------------------------------------------------
/templates/template-react-ts/src/App.tsx.lte:
--------------------------------------------------------------------------------
1 | import { useState } from "react";
2 | import reactLogo from "./assets/react.svg";
3 | import { invoke } from "@tauri-apps/api/{% if v2 %}core{% else %}tauri{% endif %}";
4 | import "./App.css";
5 |
6 | function App() {
7 | const [greetMsg, setGreetMsg] = useState("");
8 | const [name, setName] = useState("");
9 |
10 | async function greet() {
11 | // Learn more about Tauri commands at {% if v2 %}https://tauri.app/develop/calling-rust/{% else %}https://v1.tauri.app/v1/guides/features/command{% endif %}
12 | setGreetMsg(await invoke("greet", { name }));
13 | }
14 |
15 | return (
16 |
17 | Welcome to Tauri + React
18 |
19 |
30 | Click on the Tauri, Vite, and React logos to learn more.
31 |
32 |
46 | {greetMsg}
47 |
48 | );
49 | }
50 |
51 | export default App;
52 |
--------------------------------------------------------------------------------
/templates/template-react-ts/src/main.tsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | import App from "./App";
4 |
5 | ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render(
6 |
7 |
8 | ,
9 | );
10 |
--------------------------------------------------------------------------------
/templates/template-react-ts/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/templates/template-react-ts/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "useDefineForClassFields": true,
5 | "lib": ["ES2020", "DOM", "DOM.Iterable"],
6 | "module": "ESNext",
7 | "skipLibCheck": true,
8 |
9 | /* Bundler mode */
10 | "moduleResolution": "bundler",
11 | "allowImportingTsExtensions": true,
12 | "resolveJsonModule": true,
13 | "isolatedModules": true,
14 | "noEmit": true,
15 | "jsx": "react-jsx",
16 |
17 | /* Linting */
18 | "strict": true,
19 | "noUnusedLocals": true,
20 | "noUnusedParameters": true,
21 | "noFallthroughCasesInSwitch": true
22 | },
23 | "include": ["src"],
24 | "references": [{ "path": "./tsconfig.node.json" }]
25 | }
26 |
--------------------------------------------------------------------------------
/templates/template-react-ts/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "composite": true,
4 | "skipLibCheck": true,
5 | "module": "ESNext",
6 | "moduleResolution": "bundler",
7 | "allowSyntheticDefaultImports": true
8 | },
9 | "include": ["vite.config.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/templates/template-react-ts/vite.config.ts.lte:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "vite";
2 | import react from "@vitejs/plugin-react";{% if v2 %}
3 |
4 | // @ts-expect-error process is a nodejs global
5 | const host = process.env.TAURI_DEV_HOST;{% endif %}
6 |
7 | // https://vite.dev/config/
8 | export default defineConfig(async () => ({
9 | plugins: [react()],
10 |
11 | // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
12 | //
13 | // 1. prevent Vite from obscuring rust errors
14 | clearScreen: false,
15 | // 2. tauri expects a fixed port, fail if that port is not available
16 | server: {
17 | port: 1420,
18 | strictPort: true,{% if v2 %}
19 | host: host || false,
20 | hmr: host
21 | ? {
22 | protocol: "ws",
23 | host,
24 | port: 1421,
25 | }
26 | : undefined,{% endif %}
27 | watch: {
28 | // 3. tell Vite to ignore watching `src-tauri`
29 | ignored: ["**/src-tauri/**"],
30 | },
31 | },
32 | }));
33 |
--------------------------------------------------------------------------------
/templates/template-react/.manifest:
--------------------------------------------------------------------------------
1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy
2 | # SPDX-License-Identifier: Apache-2.0
3 | # SPDX-License-Identifier: MIT
4 |
5 | beforeDevCommand = {% pkg_manager_run_command %} dev
6 | beforeBuildCommand = {% pkg_manager_run_command %} build
7 | devUrl = http://localhost:1420
8 | frontendDist = ../dist
9 |
10 | [files]
11 | react.svg = src/assets/react.svg
12 | vite.svg = public/vite.svg
13 | tauri.svg = public/tauri.svg
14 | styles.css = src/App.css
15 |
--------------------------------------------------------------------------------
/templates/template-react/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
3 | }
4 |
--------------------------------------------------------------------------------
/templates/template-react/README.md:
--------------------------------------------------------------------------------
1 | # Tauri + React
2 |
3 | This template should help get you started developing with Tauri and React in Vite.
4 |
5 | ## Recommended IDE Setup
6 |
7 | - [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
8 |
--------------------------------------------------------------------------------
/templates/template-react/_gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/templates/template-react/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Tauri + React
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/templates/template-react/package.json.lte:
--------------------------------------------------------------------------------
1 | {
2 | "name": "{% package_name %}",
3 | "private": true,
4 | "version": "0.1.0",
5 | "type": "module",
6 | "scripts": {
7 | "dev": "vite",
8 | "build": "vite build",
9 | "preview": "vite preview",
10 | "tauri": "tauri"
11 | },
12 | "dependencies": {
13 | "react": "^18.3.1",
14 | "react-dom": "^18.3.1",
15 | "@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %},
16 | "@tauri-apps/plugin-opener": "^2"{% endif %}
17 | },
18 | "devDependencies": {
19 | "@vitejs/plugin-react": "^4.3.4",
20 | "vite": "^6.0.3",
21 | "@tauri-apps/cli": "{% if v2 %}^2{% else %}^1{% endif %}"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/templates/template-react/src/App.css:
--------------------------------------------------------------------------------
1 | .logo.vite:hover {
2 | filter: drop-shadow(0 0 2em #747bff);
3 | }
4 |
5 | .logo.react:hover {
6 | filter: drop-shadow(0 0 2em #61dafb);
7 | }
8 |
--------------------------------------------------------------------------------
/templates/template-react/src/App.jsx.lte:
--------------------------------------------------------------------------------
1 | import { useState } from "react";
2 | import reactLogo from "./assets/react.svg";
3 | import { invoke } from "@tauri-apps/api/{% if v2 %}core{% else %}tauri{% endif %}";
4 | import "./App.css";
5 |
6 | function App() {
7 | const [greetMsg, setGreetMsg] = useState("");
8 | const [name, setName] = useState("");
9 |
10 | async function greet() {
11 | // Learn more about Tauri commands at {% if v2 %}https://tauri.app/develop/calling-rust/{% else %}https://v1.tauri.app/v1/guides/features/command{% endif %}
12 | setGreetMsg(await invoke("greet", { name }));
13 | }
14 |
15 | return (
16 |
17 | Welcome to Tauri + React
18 |
19 |
30 | Click on the Tauri, Vite, and React logos to learn more.
31 |
32 |
46 | {greetMsg}
47 |
48 | );
49 | }
50 |
51 | export default App;
52 |
--------------------------------------------------------------------------------
/templates/template-react/src/main.jsx:
--------------------------------------------------------------------------------
1 | import React from "react";
2 | import ReactDOM from "react-dom/client";
3 | import App from "./App";
4 |
5 | ReactDOM.createRoot(document.getElementById("root")).render(
6 |
7 |
8 | ,
9 | );
10 |
--------------------------------------------------------------------------------
/templates/template-react/vite.config.js.lte:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "vite";
2 | import react from "@vitejs/plugin-react";{% if v2 %}
3 |
4 | const host = process.env.TAURI_DEV_HOST;{% endif %}
5 |
6 | // https://vite.dev/config/
7 | export default defineConfig(async () => ({
8 | plugins: [react()],
9 |
10 | // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
11 | //
12 | // 1. prevent Vite from obscuring rust errors
13 | clearScreen: false,
14 | // 2. tauri expects a fixed port, fail if that port is not available
15 | server: {
16 | port: 1420,
17 | strictPort: true,{% if v2 %}
18 | host: host || false,
19 | hmr: host
20 | ? {
21 | protocol: "ws",
22 | host,
23 | port: 1421,
24 | }
25 | : undefined,{% endif %}
26 | watch: {
27 | // 3. tell Vite to ignore watching `src-tauri`
28 | ignored: ["**/src-tauri/**"],
29 | },
30 | },
31 | }));
32 |
--------------------------------------------------------------------------------
/templates/template-solid-ts/.manifest:
--------------------------------------------------------------------------------
1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy
2 | # SPDX-License-Identifier: Apache-2.0
3 | # SPDX-License-Identifier: MIT
4 |
5 | beforeDevCommand = {% pkg_manager_run_command %} dev
6 | beforeBuildCommand = {% pkg_manager_run_command %} build
7 | devUrl = http://localhost:1420
8 | frontendDist = ../dist
9 |
10 | [files]
11 | vite.svg = public/vite.svg
12 | tauri.svg = public/tauri.svg
13 | solid.svg = src/assets/logo.svg
14 | styles.css = src/App.css
15 |
--------------------------------------------------------------------------------
/templates/template-solid-ts/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
3 | }
4 |
--------------------------------------------------------------------------------
/templates/template-solid-ts/README.md:
--------------------------------------------------------------------------------
1 | # Tauri + Solid + Typescript
2 |
3 | This template should help get you started developing with Tauri, Solid and Typescript in Vite.
4 |
5 | ## Recommended IDE Setup
6 |
7 | - [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
8 |
--------------------------------------------------------------------------------
/templates/template-solid-ts/_gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist
--------------------------------------------------------------------------------
/templates/template-solid-ts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Tauri + Solid + Typescript App
9 |
10 |
11 |
12 | You need to enable JavaScript to run this app.
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/templates/template-solid-ts/package.json.lte:
--------------------------------------------------------------------------------
1 | {
2 | "name": "{% package_name %}",
3 | "version": "0.1.0",
4 | "description": "",
5 | "type": "module",
6 | "scripts": {
7 | "start": "vite",
8 | "dev": "vite",
9 | "build": "vite build",
10 | "serve": "vite preview",
11 | "tauri": "tauri"
12 | },
13 | "license": "MIT",
14 | "dependencies": {
15 | "solid-js": "^1.9.3",
16 | "@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %},
17 | "@tauri-apps/plugin-opener": "^2"{% endif %}
18 | },
19 | "devDependencies": {
20 | "typescript": "~5.6.2",
21 | "vite": "^6.0.3",
22 | "vite-plugin-solid": "^2.11.0",
23 | "@tauri-apps/cli": "{% if v2 %}^2{% else %}^1{% endif %}"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/templates/template-solid-ts/src/App.css:
--------------------------------------------------------------------------------
1 | .logo.vite:hover {
2 | filter: drop-shadow(0 0 2em #747bff);
3 | }
4 |
5 | .logo.solid:hover {
6 | filter: drop-shadow(0 0 2em #2f5d90);
7 | }
8 |
--------------------------------------------------------------------------------
/templates/template-solid-ts/src/App.tsx.lte:
--------------------------------------------------------------------------------
1 | import { createSignal } from "solid-js";
2 | import logo from "./assets/logo.svg";
3 | import { invoke } from "@tauri-apps/api/{% if v2 %}core{% else %}tauri{% endif %}";
4 | import "./App.css";
5 |
6 | function App() {
7 | const [greetMsg, setGreetMsg] = createSignal("");
8 | const [name, setName] = createSignal("");
9 |
10 | async function greet() {
11 | // Learn more about Tauri commands at {% if v2 %}https://tauri.app/develop/calling-rust/{% else %}https://v1.tauri.app/v1/guides/features/command{% endif %}
12 | setGreetMsg(await invoke("greet", { name: name() }));
13 | }
14 |
15 | return (
16 |
17 | Welcome to Tauri + Solid
18 |
19 |
30 | Click on the Tauri, Vite, and Solid logos to learn more.
31 |
32 |
46 | {greetMsg()}
47 |
48 | );
49 | }
50 |
51 | export default App;
52 |
--------------------------------------------------------------------------------
/templates/template-solid-ts/src/index.tsx:
--------------------------------------------------------------------------------
1 | /* @refresh reload */
2 | import { render } from "solid-js/web";
3 | import App from "./App";
4 |
5 | render(() => , document.getElementById("root") as HTMLElement);
6 |
--------------------------------------------------------------------------------
/templates/template-solid-ts/src/vite-env.d.ts:
--------------------------------------------------------------------------------
1 | ///
2 |
--------------------------------------------------------------------------------
/templates/template-solid-ts/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "useDefineForClassFields": true,
5 | "module": "ESNext",
6 | "lib": ["ES2020", "DOM", "DOM.Iterable"],
7 | "skipLibCheck": true,
8 |
9 | /* Bundler mode */
10 | "moduleResolution": "bundler",
11 | "allowImportingTsExtensions": true,
12 | "resolveJsonModule": true,
13 | "isolatedModules": true,
14 | "noEmit": true,
15 | "jsx": "preserve",
16 | "jsxImportSource": "solid-js",
17 |
18 | /* Linting */
19 | "strict": true,
20 | "noUnusedLocals": true,
21 | "noUnusedParameters": true,
22 | "noFallthroughCasesInSwitch": true
23 | },
24 | "include": ["src"],
25 | "references": [{ "path": "./tsconfig.node.json" }]
26 | }
27 |
--------------------------------------------------------------------------------
/templates/template-solid-ts/tsconfig.node.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "composite": true,
4 | "skipLibCheck": true,
5 | "module": "ESNext",
6 | "moduleResolution": "bundler",
7 | "allowSyntheticDefaultImports": true
8 | },
9 | "include": ["vite.config.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/templates/template-solid-ts/vite.config.ts.lte:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "vite";
2 | import solid from "vite-plugin-solid";{% if v2 %}
3 |
4 | // @ts-expect-error process is a nodejs global
5 | const host = process.env.TAURI_DEV_HOST;{% endif %}
6 |
7 | // https://vite.dev/config/
8 | export default defineConfig(async () => ({
9 | plugins: [solid()],
10 |
11 | // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
12 | //
13 | // 1. prevent Vite from obscuring rust errors
14 | clearScreen: false,
15 | // 2. tauri expects a fixed port, fail if that port is not available
16 | server: {
17 | port: 1420,
18 | strictPort: true,{% if v2 %}
19 | host: host || false,
20 | hmr: host
21 | ? {
22 | protocol: "ws",
23 | host,
24 | port: 1421,
25 | }
26 | : undefined,{% endif %}
27 | watch: {
28 | // 3. tell Vite to ignore watching `src-tauri`
29 | ignored: ["**/src-tauri/**"],
30 | },
31 | },
32 | }));
33 |
--------------------------------------------------------------------------------
/templates/template-solid/.manifest:
--------------------------------------------------------------------------------
1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy
2 | # SPDX-License-Identifier: Apache-2.0
3 | # SPDX-License-Identifier: MIT
4 |
5 | beforeDevCommand = {% pkg_manager_run_command %} dev
6 | beforeBuildCommand = {% pkg_manager_run_command %} build
7 | devUrl = http://localhost:1420
8 | frontendDist = ../dist
9 |
10 | [files]
11 | vite.svg = public/vite.svg
12 | tauri.svg = public/tauri.svg
13 | solid.svg = src/assets/logo.svg
14 | styles.css = src/App.css
15 |
--------------------------------------------------------------------------------
/templates/template-solid/README.md:
--------------------------------------------------------------------------------
1 | # Tauri + Solid
2 |
3 | This template should help get you started developing with Tauri and Solid in Vite.
4 |
5 | ## Recommended IDE Setup
6 |
7 | - [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
8 |
--------------------------------------------------------------------------------
/templates/template-solid/_gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | dist
--------------------------------------------------------------------------------
/templates/template-solid/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Tauri + Solid App
9 |
10 |
11 |
12 | You need to enable JavaScript to run this app.
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/templates/template-solid/package.json.lte:
--------------------------------------------------------------------------------
1 | {
2 | "name": "{% package_name %}",
3 | "version": "0.1.0",
4 | "description": "",
5 | "type": "module",
6 | "scripts": {
7 | "start": "vite",
8 | "dev": "vite",
9 | "build": "vite build",
10 | "serve": "vite preview",
11 | "tauri": "tauri"
12 | },
13 | "license": "MIT",
14 | "dependencies": {
15 | "solid-js": "^1.9.3",
16 | "@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %},
17 | "@tauri-apps/plugin-opener": "^2"{% endif %}
18 | },
19 | "devDependencies": {
20 | "vite": "^6.0.3",
21 | "vite-plugin-solid": "^2.11.0",
22 | "@tauri-apps/cli": "{% if v2 %}^2{% else %}^1{% endif %}"
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/templates/template-solid/src/App.css:
--------------------------------------------------------------------------------
1 | .logo.vite:hover {
2 | filter: drop-shadow(0 0 2em #747bff);
3 | }
4 |
5 | .logo.solid:hover {
6 | filter: drop-shadow(0 0 2em #2f5d90);
7 | }
8 |
--------------------------------------------------------------------------------
/templates/template-solid/src/App.jsx.lte:
--------------------------------------------------------------------------------
1 | import { createSignal } from "solid-js";
2 | import logo from "./assets/logo.svg";
3 | import { invoke } from "@tauri-apps/api/{% if v2 %}core{% else %}tauri{% endif %}";
4 | import "./App.css";
5 |
6 | function App() {
7 | const [greetMsg, setGreetMsg] = createSignal("");
8 | const [name, setName] = createSignal("");
9 |
10 | async function greet() {
11 | // Learn more about Tauri commands at {% if v2 %}https://tauri.app/develop/calling-rust/{% else %}https://v1.tauri.app/v1/guides/features/command{% endif %}
12 | setGreetMsg(await invoke("greet", { name: name() }));
13 | }
14 |
15 | return (
16 |
17 | Welcome to Tauri + Solid
18 |
19 |
30 | Click on the Tauri, Vite, and Solid logos to learn more.
31 |
32 |
46 | {greetMsg()}
47 |
48 | );
49 | }
50 |
51 | export default App;
52 |
--------------------------------------------------------------------------------
/templates/template-solid/src/index.jsx:
--------------------------------------------------------------------------------
1 | /* @refresh reload */
2 | import { render } from "solid-js/web";
3 | import App from "./App";
4 |
5 | render(() => , document.getElementById("root"));
6 |
--------------------------------------------------------------------------------
/templates/template-solid/vite.config.js.lte:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "vite";
2 | import solid from "vite-plugin-solid";{% if v2 %}
3 |
4 | const host = process.env.TAURI_DEV_HOST;{% endif %}
5 |
6 | // https://vite.dev/config/
7 | export default defineConfig(async () => ({
8 | plugins: [solid()],
9 |
10 | // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
11 | //
12 | // 1. prevent Vite from obscuring rust errors
13 | clearScreen: false,
14 | // 2. tauri expects a fixed port, fail if that port is not available
15 | server: {
16 | port: 1420,
17 | strictPort: true,{% if v2 %}
18 | host: host || false,
19 | hmr: host
20 | ? {
21 | protocol: "ws",
22 | host,
23 | port: 1421,
24 | }
25 | : undefined,{% endif %}
26 | watch: {
27 | // 3. tell Vite to ignore watching `src-tauri`
28 | ignored: ["**/src-tauri/**"],
29 | },
30 | },
31 | }));
32 |
--------------------------------------------------------------------------------
/templates/template-svelte-ts/.manifest:
--------------------------------------------------------------------------------
1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy
2 | # SPDX-License-Identifier: Apache-2.0
3 | # SPDX-License-Identifier: MIT
4 |
5 | beforeDevCommand = {% pkg_manager_run_command %} dev
6 | beforeBuildCommand = {% pkg_manager_run_command %} build
7 | devUrl = http://localhost:1420
8 | frontendDist = ../build
9 |
10 | [files]
11 | vite.svg = static/vite.svg
12 | tauri.svg = static/tauri.svg
13 | svelte.png = static/favicon.png
14 | svelte.svg = static/svelte.svg
15 |
--------------------------------------------------------------------------------
/templates/template-svelte-ts/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "svelte.svelte-vscode",
4 | "tauri-apps.tauri-vscode",
5 | "rust-lang.rust-analyzer"
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/templates/template-svelte-ts/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "svelte.enable-ts-plugin": true
3 | }
4 |
--------------------------------------------------------------------------------
/templates/template-svelte-ts/README.md:
--------------------------------------------------------------------------------
1 | # Tauri + SvelteKit + TypeScript
2 |
3 | This template should help get you started developing with Tauri, SvelteKit and TypeScript in Vite.
4 |
5 | ## Recommended IDE Setup
6 |
7 | [VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer).
8 |
--------------------------------------------------------------------------------
/templates/template-svelte-ts/_gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /build
4 | /.svelte-kit
5 | /package
6 | .env
7 | .env.*
8 | !.env.example
9 | vite.config.js.timestamp-*
10 | vite.config.ts.timestamp-*
11 |
--------------------------------------------------------------------------------
/templates/template-svelte-ts/package.json.lte:
--------------------------------------------------------------------------------
1 | {
2 | "name": "{% package_name %}",
3 | "version": "0.1.0",
4 | "description": "",
5 | "type": "module",
6 | "scripts": {
7 | "dev": "vite dev",
8 | "build": "vite build",
9 | "preview": "vite preview",
10 | "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
11 | "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
12 | "tauri": "tauri"
13 | },
14 | "license": "MIT",
15 | "dependencies": {
16 | "@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %},
17 | "@tauri-apps/plugin-opener": "^2"{% endif %}
18 | },
19 | "devDependencies": {
20 | "@sveltejs/adapter-static": "^3.0.6",
21 | "@sveltejs/kit": "^2.9.0",
22 | "@sveltejs/vite-plugin-svelte": "^5.0.0",
23 | "svelte": "^5.0.0",
24 | "svelte-check": "^4.0.0",
25 | "typescript": "~5.6.2",
26 | "vite": "^6.0.3",
27 | "@tauri-apps/cli": "{% if v2 %}^2{% else %}^1{% endif %}"
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/templates/template-svelte-ts/src/app.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Tauri + SvelteKit + Typescript App
8 | %sveltekit.head%
9 |
10 |
11 | %sveltekit.body%
12 |
13 |
14 |
--------------------------------------------------------------------------------
/templates/template-svelte-ts/src/routes/+layout.ts:
--------------------------------------------------------------------------------
1 | // Tauri doesn't have a Node.js server to do proper SSR
2 | // so we use adapter-static with a fallback to index.html to put the site in SPA mode
3 | // See: https://svelte.dev/docs/kit/single-page-apps
4 | // See: https://v2.tauri.app/start/frontend/sveltekit/ for more info
5 | export const ssr = false;
6 |
--------------------------------------------------------------------------------
/templates/template-svelte-ts/src/routes/+page.svelte.lte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 | Welcome to Tauri + Svelte
16 |
17 |
28 | Click on the Tauri, Vite, and SvelteKit logos to learn more.
29 |
30 |
34 | {greetMsg}
35 |
36 |
37 |
48 |
--------------------------------------------------------------------------------
/templates/template-svelte-ts/svelte.config.js:
--------------------------------------------------------------------------------
1 | // Tauri doesn't have a Node.js server to do proper SSR
2 | // so we use adapter-static with a fallback to index.html to put the site in SPA mode
3 | // See: https://svelte.dev/docs/kit/single-page-apps
4 | // See: https://v2.tauri.app/start/frontend/sveltekit/ for more info
5 | import adapter from "@sveltejs/adapter-static";
6 | import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
7 |
8 | /** @type {import('@sveltejs/kit').Config} */
9 | const config = {
10 | preprocess: vitePreprocess(),
11 | kit: {
12 | adapter: adapter({
13 | fallback: "index.html",
14 | }),
15 | },
16 | };
17 |
18 | export default config;
19 |
--------------------------------------------------------------------------------
/templates/template-svelte-ts/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./.svelte-kit/tsconfig.json",
3 | "compilerOptions": {
4 | "allowJs": true,
5 | "checkJs": true,
6 | "esModuleInterop": true,
7 | "forceConsistentCasingInFileNames": true,
8 | "resolveJsonModule": true,
9 | "skipLibCheck": true,
10 | "sourceMap": true,
11 | "strict": true,
12 | "moduleResolution": "bundler"
13 | }
14 | // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
15 | // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
16 | //
17 | // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
18 | // from the referenced tsconfig.json - TypeScript does not merge them in
19 | }
20 |
--------------------------------------------------------------------------------
/templates/template-svelte-ts/vite.config.js.lte:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "vite";
2 | import { sveltekit } from "@sveltejs/kit/vite";{% if v2 %}
3 |
4 | // @ts-expect-error process is a nodejs global
5 | const host = process.env.TAURI_DEV_HOST;{% endif %}
6 |
7 | // https://vite.dev/config/
8 | export default defineConfig(async () => ({
9 | plugins: [sveltekit()],
10 |
11 | // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
12 | //
13 | // 1. prevent Vite from obscuring rust errors
14 | clearScreen: false,
15 | // 2. tauri expects a fixed port, fail if that port is not available
16 | server: {
17 | port: 1420,
18 | strictPort: true,{% if v2 %}
19 | host: host || false,
20 | hmr: host
21 | ? {
22 | protocol: "ws",
23 | host,
24 | port: 1421,
25 | }
26 | : undefined,{% endif %}
27 | watch: {
28 | // 3. tell Vite to ignore watching `src-tauri`
29 | ignored: ["**/src-tauri/**"],
30 | },
31 | },
32 | }));
33 |
--------------------------------------------------------------------------------
/templates/template-svelte/.manifest:
--------------------------------------------------------------------------------
1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy
2 | # SPDX-License-Identifier: Apache-2.0
3 | # SPDX-License-Identifier: MIT
4 |
5 | beforeDevCommand = {% pkg_manager_run_command %} dev
6 | beforeBuildCommand = {% pkg_manager_run_command %} build
7 | devUrl = http://localhost:1420
8 | frontendDist = ../build
9 |
10 | [files]
11 | vite.svg = static/vite.svg
12 | tauri.svg = static/tauri.svg
13 | svelte.png = static/favicon.png
14 | svelte.svg = static/svelte.svg
15 |
--------------------------------------------------------------------------------
/templates/template-svelte/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "svelte.svelte-vscode",
4 | "tauri-apps.tauri-vscode",
5 | "rust-lang.rust-analyzer"
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/templates/template-svelte/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "svelte.enable-ts-plugin": true
3 | }
4 |
--------------------------------------------------------------------------------
/templates/template-svelte/README.md:
--------------------------------------------------------------------------------
1 | # Tauri + SvelteKit
2 |
3 | This template should help get you started developing with Tauri and SvelteKit in Vite.
4 |
5 | ## Recommended IDE Setup
6 |
7 | [VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer).
8 |
--------------------------------------------------------------------------------
/templates/template-svelte/_gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | node_modules
3 | /build
4 | /.svelte-kit
5 | /package
6 | .env
7 | .env.*
8 | !.env.example
9 | vite.config.js.timestamp-*
10 | vite.config.ts.timestamp-*
11 |
--------------------------------------------------------------------------------
/templates/template-svelte/jsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./.svelte-kit/tsconfig.json",
3 | "compilerOptions": {
4 | "allowJs": true,
5 | "checkJs": true,
6 | "esModuleInterop": true,
7 | "forceConsistentCasingInFileNames": true,
8 | "resolveJsonModule": true,
9 | "skipLibCheck": true,
10 | "sourceMap": true,
11 | "strict": true,
12 | "moduleResolution": "bundler"
13 | }
14 | // Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
15 | // except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
16 | //
17 | // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
18 | // from the referenced tsconfig.json - TypeScript does not merge them in
19 | }
20 |
--------------------------------------------------------------------------------
/templates/template-svelte/package.json.lte:
--------------------------------------------------------------------------------
1 | {
2 | "name": "{% package_name %}",
3 | "version": "0.1.0",
4 | "description": "",
5 | "type": "module",
6 | "scripts": {
7 | "dev": "vite dev",
8 | "build": "vite build",
9 | "preview": "vite preview",
10 | "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
11 | "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
12 | "tauri": "tauri"
13 | },
14 | "license": "MIT",
15 | "dependencies": {
16 | "@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %},
17 | "@tauri-apps/plugin-opener": "^2"{% endif %}
18 | },
19 | "devDependencies": {
20 | "@sveltejs/adapter-static": "^3.0.6",
21 | "@sveltejs/kit": "^2.9.0",
22 | "@sveltejs/vite-plugin-svelte": "^5.0.0",
23 | "svelte": "^5.0.0",
24 | "svelte-check": "^4.0.0",
25 | "typescript": "~5.6.2",
26 | "vite": "^6.0.3",
27 | "@tauri-apps/cli": "{% if v2 %}^2{% else %}^1{% endif %}"
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/templates/template-svelte/src/app.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Tauri + SvelteKit App
8 | %sveltekit.head%
9 |
10 |
11 | %sveltekit.body%
12 |
13 |
14 |
--------------------------------------------------------------------------------
/templates/template-svelte/src/routes/+layout.js:
--------------------------------------------------------------------------------
1 | // Tauri doesn't have a Node.js server to do proper SSR
2 | // so we use adapter-static with a fallback to index.html to put the site in SPA mode
3 | // See: https://svelte.dev/docs/kit/single-page-apps
4 | // See: https://v2.tauri.app/start/frontend/sveltekit/ for more info
5 | export const ssr = false;
6 |
--------------------------------------------------------------------------------
/templates/template-svelte/src/routes/+page.svelte.lte:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 | Welcome to Tauri + Svelte
16 |
17 |
28 | Click on the Tauri, Vite, and SvelteKit logos to learn more.
29 |
30 |
34 | {greetMsg}
35 |
36 |
37 |
48 |
--------------------------------------------------------------------------------
/templates/template-svelte/svelte.config.js:
--------------------------------------------------------------------------------
1 | // Tauri doesn't have a Node.js server to do proper SSR
2 | // so we use adapter-static with a fallback to index.html to put the site in SPA mode
3 | // See: https://svelte.dev/docs/kit/single-page-apps
4 | // See: https://v2.tauri.app/start/frontend/sveltekit/ for more info
5 | import adapter from "@sveltejs/adapter-static";
6 |
7 | /** @type {import('@sveltejs/kit').Config} */
8 | const config = {
9 | kit: {
10 | adapter: adapter({
11 | fallback: "index.html",
12 | }),
13 | },
14 | };
15 |
16 | export default config;
17 |
--------------------------------------------------------------------------------
/templates/template-svelte/vite.config.js.lte:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "vite";
2 | import { sveltekit } from "@sveltejs/kit/vite";{% if v2 %}
3 |
4 | // @ts-expect-error process is a nodejs global
5 | const host = process.env.TAURI_DEV_HOST;{% endif %}
6 |
7 | // https://vite.dev/config/
8 | export default defineConfig(async () => ({
9 | plugins: [sveltekit()],
10 |
11 | // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
12 | //
13 | // 1. prevent Vite from obscuring rust errors
14 | clearScreen: false,
15 | // 2. tauri expects a fixed port, fail if that port is not available
16 | server: {
17 | port: 1420,
18 | strictPort: true,{% if v2 %}
19 | host: host || false,
20 | hmr: host
21 | ? {
22 | protocol: "ws",
23 | host,
24 | port: 1421,
25 | }
26 | : undefined,{% endif %}
27 | watch: {
28 | // 3. tell Vite to ignore watching `src-tauri`
29 | ignored: ["**/src-tauri/**"],
30 | },
31 | },
32 | }));
33 |
--------------------------------------------------------------------------------
/templates/template-sycamore/.manifest:
--------------------------------------------------------------------------------
1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy
2 | # SPDX-License-Identifier: Apache-2.0
3 | # SPDX-License-Identifier: MIT
4 |
5 | beforeDevCommand = trunk serve
6 | beforeBuildCommand = trunk build --release
7 | devUrl = http://localhost:1420
8 | frontendDist = ../dist
9 | withGlobalTauri = true
10 |
11 | [files]
12 | tauri.svg = public/tauri.svg
13 | styles.css = styles.css
14 |
--------------------------------------------------------------------------------
/templates/template-sycamore/.taurignore:
--------------------------------------------------------------------------------
1 | /src
2 | /public
3 | /Cargo.toml
--------------------------------------------------------------------------------
/templates/template-sycamore/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
3 | }
4 |
--------------------------------------------------------------------------------
/templates/template-sycamore/Cargo.toml.lte:
--------------------------------------------------------------------------------
1 | [package]
2 | name = "{% package_name %}-ui"
3 | version = "0.1.0"
4 | edition = "2021"
5 |
6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7 | [dependencies]
8 | sycamore = { version = "0.9", features = ["suspense"] }
9 | wasm-bindgen = "0.2"
10 | wasm-bindgen-futures = "0.4"
11 | serde-wasm-bindgen = "0.6"
12 | serde = { version = "1", features = ["derive"] }
13 | console_error_panic_hook = "0.1.7"
14 |
15 | [workspace]
16 | members = ["src-tauri"]
17 |
--------------------------------------------------------------------------------
/templates/template-sycamore/README.md:
--------------------------------------------------------------------------------
1 | # Tauri + Sycamore
2 |
3 | This template should help get you started developing with Tauri and Sycamore.
4 |
5 | ## Recommended IDE Setup
6 |
7 | [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer).
8 |
--------------------------------------------------------------------------------
/templates/template-sycamore/Trunk.toml.lte:
--------------------------------------------------------------------------------
1 | [build]
2 | target = "./index.html"
3 |
4 | [watch]
5 | ignore = ["./src-tauri"]
6 |
7 | [serve]
8 | port = 1420
9 | open = false
10 |
--------------------------------------------------------------------------------
/templates/template-sycamore/_gitignore:
--------------------------------------------------------------------------------
1 | /dist/
2 | /target/
3 | /Cargo.lock
4 |
--------------------------------------------------------------------------------
/templates/template-sycamore/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Tauri + Sycamore App
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/templates/template-sycamore/public/sycamore.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/templates/template-sycamore/src/app.rs.lte:
--------------------------------------------------------------------------------
1 | use serde::{Deserialize, Serialize};
2 | use sycamore::futures::spawn_local_scoped;
3 | use sycamore::prelude::*;
4 | use sycamore::web::events::SubmitEvent;
5 | use wasm_bindgen::prelude::*;
6 |
7 | #[wasm_bindgen]
8 | extern "C" {
9 | #[wasm_bindgen(js_namespace = ["window", "__TAURI__", "{% if v2 %}core{% else %}tauri{% endif %}"])]
10 | async fn invoke(cmd: &str, args: JsValue) -> JsValue;
11 | }
12 |
13 | #[derive(Serialize, Deserialize)]
14 | struct GreetArgs<'a> {
15 | name: &'a str,
16 | }
17 |
18 | #[component]
19 | pub fn App() -> View {
20 | let name = create_signal(String::new());
21 | let greet_msg = create_signal(String::new());
22 |
23 | let greet = move |e: SubmitEvent| {
24 | e.prevent_default();
25 | spawn_local_scoped(async move {
26 | // Learn more about Tauri commands at {% if v2 %}https://tauri.app/develop/calling-rust/{% else %}https://v1.tauri.app/v1/guides/features/command{% endif %}
27 | let args = serde_wasm_bindgen::to_value(&GreetArgs {
28 | name: &name.get_clone()
29 | })
30 | .unwrap();
31 | let new_msg = invoke("greet", args).await;
32 | greet_msg.set(new_msg.as_string().unwrap());
33 | })
34 | };
35 |
36 | view! {
37 | main(class="container") {
38 | h1 {
39 | "Welcome to Tauri + Sycamore"
40 | }
41 |
42 | div(class="row") {
43 | a(href="https://tauri.app", target="_blank") {
44 | img(src="public/tauri.svg", class="logo tauri", alt="Tauri logo")
45 | }
46 | a(href="https://sycamore.dev", target="_blank") {
47 | img(src="public/sycamore.svg", class="logo sycamore", alt="Sycamore logo")
48 | }
49 | }
50 | p {
51 | "Click on the Tauri and Sycamore logos to learn more."
52 | }
53 |
54 | form(class="row", on:submit=greet) {
55 | input(id="greet-input", bind:value=name, placeholder="Enter a name...")
56 | button(r#type="submit") {
57 | "Greet"
58 | }
59 | }
60 | p {
61 | (greet_msg)
62 | }
63 | }
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/templates/template-sycamore/src/main.rs:
--------------------------------------------------------------------------------
1 | mod app;
2 |
3 | use app::App;
4 |
5 | fn main() {
6 | console_error_panic_hook::set_once();
7 | sycamore::render(App);
8 | }
--------------------------------------------------------------------------------
/templates/template-sycamore/styles.css:
--------------------------------------------------------------------------------
1 | .logo.sycamore:hover {
2 | filter: drop-shadow(0 0 2em #f8b94c);
3 | }
4 |
--------------------------------------------------------------------------------
/templates/template-vanilla-ts/.manifest:
--------------------------------------------------------------------------------
1 | beforeDevCommand = {% pkg_manager_run_command %} dev
2 | beforeBuildCommand = {% pkg_manager_run_command %} build
3 | devUrl = http://localhost:1420
4 | frontendDist = ../dist
5 | withGlobalTauri = true
6 |
7 | [files]
8 | tauri.svg = src/assets/tauri.svg
9 | vite.svg = src/assets/vite.svg
10 | styles.css = src/styles.css
11 |
--------------------------------------------------------------------------------
/templates/template-vanilla-ts/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
3 | }
4 |
--------------------------------------------------------------------------------
/templates/template-vanilla-ts/README.md:
--------------------------------------------------------------------------------
1 | # Tauri + Vanilla TS
2 |
3 | This template should help get you started developing with Tauri in vanilla HTML, CSS and Typescript.
4 |
5 | ## Recommended IDE Setup
6 |
7 | - [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
8 |
--------------------------------------------------------------------------------
/templates/template-vanilla-ts/_gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/templates/template-vanilla-ts/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Tauri App
8 |
9 |
10 |
11 |
12 |
13 | Welcome to Tauri
14 |
15 |
34 | Click on the Tauri logo to learn more about the framework
35 |
36 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/templates/template-vanilla-ts/package.json.lte:
--------------------------------------------------------------------------------
1 | {
2 | "name": "{% package_name %}",
3 | "private": true,
4 | "version": "0.1.0",
5 | "type": "module",
6 | "scripts": {
7 | "dev": "vite",
8 | "build": "tsc && vite build",
9 | "preview": "vite preview",
10 | "tauri": "tauri"
11 | },
12 | "dependencies": {
13 | "@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %},
14 | "@tauri-apps/plugin-opener": "^2"{% endif %}
15 | },
16 | "devDependencies": {
17 | "@tauri-apps/cli": "{% if v2 %}^2{% else %}^1{% endif %}",
18 | "vite": "^6.0.3",
19 | "typescript": "~5.6.2"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/templates/template-vanilla-ts/src/assets/typescript.svg:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
8 |
10 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/templates/template-vanilla-ts/src/main.ts.lte:
--------------------------------------------------------------------------------
1 | import { invoke } from "@tauri-apps/api/{% if v2 %}core{% else %}tauri{% endif %}";
2 |
3 | let greetInputEl: HTMLInputElement | null;
4 | let greetMsgEl: HTMLElement | null;
5 |
6 | async function greet() {
7 | if (greetMsgEl && greetInputEl) {
8 | // Learn more about Tauri commands at {% if v2 %}https://tauri.app/develop/calling-rust/{% else %}https://v1.tauri.app/v1/guides/features/command{% endif %}
9 | greetMsgEl.textContent = await invoke("greet", {
10 | name: greetInputEl.value,
11 | });
12 | }
13 | }
14 |
15 | window.addEventListener("DOMContentLoaded", () => {
16 | greetInputEl = document.querySelector("#greet-input");
17 | greetMsgEl = document.querySelector("#greet-msg");
18 | document.querySelector("#greet-form")?.addEventListener("submit", (e) => {
19 | e.preventDefault();
20 | greet();
21 | });
22 | });
23 |
--------------------------------------------------------------------------------
/templates/template-vanilla-ts/src/styles.css:
--------------------------------------------------------------------------------
1 | .logo.vite:hover {
2 | filter: drop-shadow(0 0 2em #747bff);
3 | }
4 |
5 | .logo.typescript:hover {
6 | filter: drop-shadow(0 0 2em #2d79c7);
7 | }
8 |
--------------------------------------------------------------------------------
/templates/template-vanilla-ts/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "ES2020",
4 | "useDefineForClassFields": true,
5 | "module": "ESNext",
6 | "lib": ["ES2020", "DOM", "DOM.Iterable"],
7 | "skipLibCheck": true,
8 |
9 | /* Bundler mode */
10 | "moduleResolution": "bundler",
11 | "allowImportingTsExtensions": true,
12 | "resolveJsonModule": true,
13 | "isolatedModules": true,
14 | "noEmit": true,
15 |
16 | /* Linting */
17 | "strict": true,
18 | "noUnusedLocals": true,
19 | "noUnusedParameters": true,
20 | "noFallthroughCasesInSwitch": true
21 | },
22 | "include": ["src"]
23 | }
24 |
--------------------------------------------------------------------------------
/templates/template-vanilla-ts/vite.config.ts.lte:
--------------------------------------------------------------------------------
1 | import { defineConfig } from "vite";{% if v2 %}
2 |
3 | // @ts-expect-error process is a nodejs global
4 | const host = process.env.TAURI_DEV_HOST;{% endif %}
5 |
6 | // https://vite.dev/config/
7 | export default defineConfig(async () => ({
8 |
9 | // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build`
10 | //
11 | // 1. prevent Vite from obscuring rust errors
12 | clearScreen: false,
13 | // 2. tauri expects a fixed port, fail if that port is not available
14 | server: {
15 | port: 1420,
16 | strictPort: true,{% if v2 %}
17 | host: host || false,
18 | hmr: host
19 | ? {
20 | protocol: "ws",
21 | host,
22 | port: 1421,
23 | }
24 | : undefined,{% endif %}
25 | watch: {
26 | // 3. tell Vite to ignore watching `src-tauri`
27 | ignored: ["**/src-tauri/**"],
28 | },
29 | },
30 | }));
31 |
--------------------------------------------------------------------------------
/templates/template-vanilla/%(pnpm-yarn-npm-deno-bun)%package.json.lte:
--------------------------------------------------------------------------------
1 | {
2 | "name": "{% package_name %}",
3 | "private": true,
4 | "version": "0.1.0",
5 | "type": "module",
6 | "scripts": {
7 | "tauri": "tauri"
8 | },
9 | "devDependencies": {
10 | "@tauri-apps/cli": "{% if v2 %}^2{% else %}^1{% endif %}"
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/templates/template-vanilla/.manifest:
--------------------------------------------------------------------------------
1 | devUrl = {% if v1 %}../src{% endif %}
2 | frontendDist = ../src
3 | withGlobalTauri = true
4 |
5 | [files]
6 | tauri.svg = src/assets/tauri.svg
7 | styles.css = src/styles.css
8 |
--------------------------------------------------------------------------------
/templates/template-vanilla/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"]
3 | }
4 |
--------------------------------------------------------------------------------
/templates/template-vanilla/README.md:
--------------------------------------------------------------------------------
1 | # Tauri + Vanilla
2 |
3 | This template should help get you started developing with Tauri in vanilla HTML, CSS and Javascript.
4 |
5 | ## Recommended IDE Setup
6 |
7 | - [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer)
8 |
--------------------------------------------------------------------------------
/templates/template-vanilla/_gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 | npm-debug.log*
5 | yarn-debug.log*
6 | yarn-error.log*
7 | pnpm-debug.log*
8 | lerna-debug.log*
9 |
10 | node_modules
11 | dist
12 | dist-ssr
13 | *.local
14 |
15 | # Editor directories and files
16 | .vscode/*
17 | !.vscode/extensions.json
18 | .idea
19 | .DS_Store
20 | *.suo
21 | *.ntvs*
22 | *.njsproj
23 | *.sln
24 | *.sw?
25 |
--------------------------------------------------------------------------------
/templates/template-vanilla/src/assets/javascript.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/templates/template-vanilla/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | Tauri App
8 |
9 |
10 |
11 |
12 |
13 | Welcome to Tauri
14 |
15 |
30 | Click on the Tauri logo to learn more about the framework
31 |
32 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/templates/template-vanilla/src/main.js.lte:
--------------------------------------------------------------------------------
1 | const { invoke } = window.__TAURI__.{% if v2 %}core{% else %}tauri{% endif %};
2 |
3 | let greetInputEl;
4 | let greetMsgEl;
5 |
6 | async function greet() {
7 | // Learn more about Tauri commands at {% if v2 %}https://tauri.app/develop/calling-rust/{% else %}https://v1.tauri.app/v1/guides/features/command{% endif %}
8 | greetMsgEl.textContent = await invoke("greet", { name: greetInputEl.value });
9 | }
10 |
11 | window.addEventListener("DOMContentLoaded", () => {
12 | greetInputEl = document.querySelector("#greet-input");
13 | greetMsgEl = document.querySelector("#greet-msg");
14 | document.querySelector("#greet-form").addEventListener("submit", (e) => {
15 | e.preventDefault();
16 | greet();
17 | });
18 | });
19 |
--------------------------------------------------------------------------------
/templates/template-vanilla/src/styles.css:
--------------------------------------------------------------------------------
1 | .logo.vanilla:hover {
2 | filter: drop-shadow(0 0 2em #ffe21c);
3 | }
4 |
--------------------------------------------------------------------------------
/templates/template-vue-ts/.manifest:
--------------------------------------------------------------------------------
1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy
2 | # SPDX-License-Identifier: Apache-2.0
3 | # SPDX-License-Identifier: MIT
4 |
5 | beforeDevCommand = {% pkg_manager_run_command %} dev
6 | beforeBuildCommand = {% pkg_manager_run_command %} build
7 | devUrl = http://localhost:1420
8 | frontendDist = ../dist
9 |
10 | [files]
11 | vite.svg = public/vite.svg
12 | tauri.svg = public/tauri.svg
13 | vue.svg = src/assets/vue.svg
14 |
--------------------------------------------------------------------------------
/templates/template-vue-ts/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "Vue.volar",
4 | "tauri-apps.tauri-vscode",
5 | "rust-lang.rust-analyzer"
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/templates/template-vue-ts/README.md:
--------------------------------------------------------------------------------
1 | # Tauri + Vue + TypeScript
2 |
3 | This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `
13 |