├── .cargo └── config.toml ├── .changes ├── config.json └── readme.md ├── .github ├── PULL_REQUEST_TEMPLATE.md ├── splash.png └── workflows │ ├── audit.yml │ ├── cli-test.yml │ ├── clippy.yml │ ├── covector-status.yml │ ├── covector-version-or-publish.yml │ ├── deploy-scripts-worker.yml │ ├── fmt.yml │ ├── publish-binaries.yml │ ├── publish-napi.yml │ └── templates-test.yml ├── .gitignore ├── .prettierignore ├── .prettierrc ├── .scripts ├── generate-templates-matrix.js └── sync-scripts-tagname.js ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Cargo.lock ├── Cargo.toml ├── LICENSE.spdx ├── LICENSE_APACHE-2.0 ├── LICENSE_MIT ├── README.md ├── create-tauri-app.ps1 ├── create-tauri-app.sh ├── node ├── .gitignore ├── .npmignore ├── CHANGELOG.md ├── Cargo.toml ├── LICENSE_APACHE-2.0 ├── LICENSE_MIT ├── README.md ├── build.rs ├── create-tauri-app.js ├── index.d.ts ├── index.js ├── npm │ ├── darwin-arm64 │ │ ├── README.md │ │ └── package.json │ ├── darwin-universal │ │ ├── README.md │ │ └── package.json │ ├── darwin-x64 │ │ ├── README.md │ │ └── package.json │ ├── linux-arm-gnueabihf │ │ ├── README.md │ │ └── package.json │ ├── linux-arm64-gnu │ │ ├── README.md │ │ └── package.json │ ├── linux-arm64-musl │ │ ├── README.md │ │ └── package.json │ ├── linux-x64-gnu │ │ ├── README.md │ │ └── package.json │ ├── linux-x64-musl │ │ ├── README.md │ │ └── package.json │ ├── win32-arm64-msvc │ │ ├── README.md │ │ └── package.json │ ├── win32-ia32-msvc │ │ ├── README.md │ │ └── package.json │ └── win32-x64-msvc │ │ ├── README.md │ │ └── package.json ├── package.json └── src │ └── lib.rs ├── package.json ├── pnpm-lock.yaml ├── pnpm-workspace.yaml ├── renovate.json ├── src ├── args.rs ├── category.rs ├── deps.rs ├── lib.rs ├── main.rs ├── manifest.rs ├── package_manager.rs ├── template.rs └── utils │ ├── colors.rs │ ├── dialoguer_theme.rs │ ├── lte.rs │ └── mod.rs ├── templates ├── _assets_ │ ├── preact.svg │ ├── react.svg │ ├── solid.svg │ ├── styles.css │ ├── svelte.png │ ├── svelte.svg │ ├── tauri.svg │ ├── vite.svg │ └── vue.svg ├── _base_ │ └── src-tauri │ │ ├── %(v1)%tauri.conf.json.lte │ │ ├── %(v2)%tauri.conf.json.lte │ │ ├── Cargo.toml.lte │ │ ├── _gitignore │ │ ├── build.rs │ │ ├── capabilities │ │ └── %(v2)%default.json.lte │ │ ├── icons │ │ ├── 128x128.png │ │ ├── 128x128@2x.png │ │ ├── 32x32.png │ │ ├── Square107x107Logo.png │ │ ├── Square142x142Logo.png │ │ ├── Square150x150Logo.png │ │ ├── Square284x284Logo.png │ │ ├── Square30x30Logo.png │ │ ├── Square310x310Logo.png │ │ ├── Square44x44Logo.png │ │ ├── Square71x71Logo.png │ │ ├── Square89x89Logo.png │ │ ├── StoreLogo.png │ │ ├── icon.icns │ │ ├── icon.ico │ │ └── icon.png │ │ └── src │ │ ├── %(v2)%lib.rs.lte │ │ └── main.rs.lte ├── template-angular │ ├── .manifest │ ├── .vscode │ │ └── extensions.json │ ├── README.md │ ├── _gitignore │ ├── angular.json.lte │ ├── package.json.lte │ ├── src │ │ ├── app │ │ │ ├── app.component.css │ │ │ ├── app.component.html │ │ │ ├── app.component.ts.lte │ │ │ ├── app.config.ts │ │ │ └── app.routes.ts │ │ ├── assets │ │ │ └── angular.svg │ │ ├── index.html │ │ └── main.ts │ ├── tsconfig.app.json │ └── tsconfig.json ├── template-blazor │ ├── .manifest │ ├── _gitignore │ └── src │ │ ├── App.razor │ │ ├── Pages │ │ └── Home.razor.lte │ │ ├── Program.cs.lte │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── _Imports.razor.lte │ │ ├── wwwroot │ │ ├── css │ │ │ └── app.css │ │ ├── img │ │ │ └── blazor.png │ │ └── index.html │ │ └── {% project_name_pascal_case %}.csproj ├── template-dioxus │ ├── .manifest │ ├── .taurignore │ ├── .vscode │ │ └── extensions.json │ ├── Cargo.toml.lte │ ├── Dioxus.toml.lte │ ├── README.md │ ├── _gitignore │ ├── assets │ │ ├── dioxus.png │ │ └── styles.css │ └── src │ │ ├── app.rs.lte │ │ └── main.rs ├── template-leptos │ ├── .manifest │ ├── .taurignore │ ├── .vscode │ │ ├── extensions.json │ │ └── settings.json │ ├── Cargo.toml.lte │ ├── README.md │ ├── Trunk.toml.lte │ ├── _gitignore │ ├── index.html │ ├── public │ │ └── leptos.svg │ ├── src │ │ ├── app.rs.lte │ │ └── main.rs │ └── styles.css ├── template-preact-ts │ ├── .manifest │ ├── .vscode │ │ └── extensions.json │ ├── README.md │ ├── _gitignore │ ├── index.html │ ├── package.json.lte │ ├── src │ │ ├── App.css │ │ ├── App.tsx.lte │ │ ├── main.tsx │ │ └── vite-env.d.ts │ ├── tsconfig.json │ ├── tsconfig.node.json │ └── vite.config.ts.lte ├── template-preact │ ├── .manifest │ ├── .vscode │ │ └── extensions.json │ ├── README.md │ ├── _gitignore │ ├── index.html │ ├── package.json.lte │ ├── src │ │ ├── App.css │ │ ├── App.jsx.lte │ │ └── main.jsx │ └── vite.config.js.lte ├── template-react-ts │ ├── .manifest │ ├── .vscode │ │ └── extensions.json │ ├── README.md │ ├── _gitignore │ ├── index.html │ ├── package.json.lte │ ├── src │ │ ├── App.css │ │ ├── App.tsx.lte │ │ ├── main.tsx │ │ └── vite-env.d.ts │ ├── tsconfig.json │ ├── tsconfig.node.json │ └── vite.config.ts.lte ├── template-react │ ├── .manifest │ ├── .vscode │ │ └── extensions.json │ ├── README.md │ ├── _gitignore │ ├── index.html │ ├── package.json.lte │ ├── src │ │ ├── App.css │ │ ├── App.jsx.lte │ │ └── main.jsx │ └── vite.config.js.lte ├── template-solid-ts │ ├── .manifest │ ├── .vscode │ │ └── extensions.json │ ├── README.md │ ├── _gitignore │ ├── index.html │ ├── package.json.lte │ ├── src │ │ ├── App.css │ │ ├── App.tsx.lte │ │ ├── index.tsx │ │ └── vite-env.d.ts │ ├── tsconfig.json │ ├── tsconfig.node.json │ └── vite.config.ts.lte ├── template-solid │ ├── .manifest │ ├── README.md │ ├── _gitignore │ ├── index.html │ ├── package.json.lte │ ├── src │ │ ├── App.css │ │ ├── App.jsx.lte │ │ └── index.jsx │ └── vite.config.js.lte ├── template-svelte-ts │ ├── .manifest │ ├── .vscode │ │ ├── extensions.json │ │ └── settings.json │ ├── README.md │ ├── _gitignore │ ├── package.json.lte │ ├── src │ │ ├── app.html │ │ └── routes │ │ │ ├── +layout.ts │ │ │ └── +page.svelte.lte │ ├── svelte.config.js │ ├── tsconfig.json │ └── vite.config.js.lte ├── template-svelte │ ├── .manifest │ ├── .vscode │ │ ├── extensions.json │ │ └── settings.json │ ├── README.md │ ├── _gitignore │ ├── jsconfig.json │ ├── package.json.lte │ ├── src │ │ ├── app.html │ │ └── routes │ │ │ ├── +layout.js │ │ │ └── +page.svelte.lte │ ├── svelte.config.js │ └── vite.config.js.lte ├── template-sycamore │ ├── .manifest │ ├── .taurignore │ ├── .vscode │ │ └── extensions.json │ ├── Cargo.toml.lte │ ├── README.md │ ├── Trunk.toml.lte │ ├── _gitignore │ ├── index.html │ ├── public │ │ └── sycamore.svg │ ├── src │ │ ├── app.rs.lte │ │ └── main.rs │ └── styles.css ├── template-vanilla-ts │ ├── .manifest │ ├── .vscode │ │ └── extensions.json │ ├── README.md │ ├── _gitignore │ ├── index.html │ ├── package.json.lte │ ├── src │ │ ├── assets │ │ │ └── typescript.svg │ │ ├── main.ts.lte │ │ └── styles.css │ ├── tsconfig.json │ └── vite.config.ts.lte ├── template-vanilla │ ├── %(pnpm-yarn-npm-deno-bun)%package.json.lte │ ├── .manifest │ ├── .vscode │ │ └── extensions.json │ ├── README.md │ ├── _gitignore │ └── src │ │ ├── assets │ │ └── javascript.svg │ │ ├── index.html │ │ ├── main.js.lte │ │ └── styles.css ├── template-vue-ts │ ├── .manifest │ ├── .vscode │ │ └── extensions.json │ ├── README.md │ ├── _gitignore │ ├── index.html │ ├── package.json.lte │ ├── src │ │ ├── App.vue.lte │ │ ├── main.ts │ │ └── vite-env.d.ts │ ├── tsconfig.json │ ├── tsconfig.node.json │ └── vite.config.ts.lte ├── template-vue │ ├── .manifest │ ├── .vscode │ │ └── extensions.json │ ├── README.md │ ├── _gitignore │ ├── index.html │ ├── package.json.lte │ ├── src │ │ ├── App.vue.lte │ │ └── main.js │ └── vite.config.js.lte └── template-yew │ ├── .manifest │ ├── .taurignore │ ├── .vscode │ ├── extensions.json │ └── settings.json │ ├── Cargo.toml.lte │ ├── README.md │ ├── Trunk.toml.lte │ ├── _gitignore │ ├── index.html │ ├── public │ └── yew.png │ ├── src │ ├── app.rs.lte │ └── main.rs │ └── styles.css └── worker ├── .gitignore ├── README.md ├── index.html ├── index.js ├── package.json ├── scripts ├── READEME.md ├── create-tauri-app.ps1 └── create-tauri-app.sh └── wrangler.toml /.cargo/config.toml: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | # SPDX-License-Identifier: Apache-2.0 3 | # SPDX-License-Identifier: MIT 4 | 5 | [target.aarch64-unknown-linux-gnu] 6 | linker = "aarch64-linux-gnu-gcc" 7 | [target.aarch64-unknown-linux-musl] 8 | linker = "aarch64-linux-musl-gcc" 9 | rustflags = ["-C", "target-feature=-crt-static"] 10 | [target.armv7-unknown-linux-gnueabihf] 11 | linker = "arm-linux-gnueabihf-gcc" 12 | [target.x86_64-pc-windows-msvc] 13 | rustflags = ["-C", "target-feature=+crt-static"] 14 | [target.i686-pc-windows-msvc] 15 | rustflags = ["-C", "target-feature=+crt-static"] 16 | [target.aarch64-pc-windows-msvc] 17 | rustflags = ["-C", "target-feature=+crt-static"] 18 | -------------------------------------------------------------------------------- /.changes/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "gitSiteUrl": "https://www.github.com/tauri-apps/create-tauri-app/", 3 | "timeout": 3600000, 4 | "pkgManagers": { 5 | "javascript": { 6 | "version": true, 7 | "getPublishedVersion": "npm view ${ pkgFile.pkg.name } version" 8 | }, 9 | "rust": { 10 | "version": true, 11 | "getPublishedVersion": "cargo search ${ pkg.pkg } --limit 1 | sed -nE 's/^[^\"]*\"//; s/\".*//1p' -", 12 | "publish": [ 13 | { 14 | "command": "cargo package --no-verify", 15 | "dryRunCommand": true 16 | }, 17 | { 18 | "command": "echo '
\n

Cargo Publish

\n\n```'", 19 | "dryRunCommand": true, 20 | "pipe": true 21 | }, 22 | { 23 | "command": "cargo publish", 24 | "dryRunCommand": "cargo publish --dry-run", 25 | "pipe": true 26 | }, 27 | { 28 | "command": "echo '```\n\n
\n'", 29 | "dryRunCommand": true, 30 | "pipe": true 31 | } 32 | ], 33 | "postpublish": [ 34 | "git tag ${ pkg.pkg }-v${ pkgFile.versionMajor } -f", 35 | "git tag ${ pkg.pkg }-v${ pkgFile.versionMajor }.${ pkgFile.versionMinor } -f", 36 | "git push --tags -f" 37 | ] 38 | } 39 | }, 40 | "packages": { 41 | "create-tauri-app": { 42 | "path": ".", 43 | "manager": "rust", 44 | "postversion": [ 45 | "cargo check", 46 | "node .scripts/sync-scripts-tagname.js ${ release.type }", 47 | "cp create-tauri-app.ps1 worker/scripts", 48 | "cp create-tauri-app.sh worker/scripts" 49 | ], 50 | "assets": [ 51 | { 52 | "path": "${ pkg.path }/target/package/create-tauri-app-${ pkgFile.version }.crate", 53 | "name": "${ pkg.pkg }-${ pkgFile.version }.crate" 54 | } 55 | ] 56 | }, 57 | "create-tauri-app-js": { 58 | "path": "./node", 59 | "manager": "javascript", 60 | "dependencies": ["create-tauri-app"], 61 | "prepublish": [], 62 | "publish": [], 63 | "postpublish": [] 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /.changes/readme.md: -------------------------------------------------------------------------------- 1 | # Changes 2 | 3 | ##### via https://github.com/jbolda/covector 4 | 5 | As you create PRs and make changes that require a version bump, please add a new markdown file in this folder. You do not note the version _number_, but rather the type of bump that you expect: major, minor, or patch. The filename is not important, as long as it is a `.md`, but we recommend it represents the overall change for our sanity. 6 | 7 | When you select the version bump required, you do _not_ need to consider dependencies. Only note the package with the actual change, and any packages that depend on that package will be bumped automatically in the process. 8 | 9 | Use the following format: 10 | 11 | ```md 12 | --- 13 | "create-tauri-app": patch 14 | --- 15 | 16 | Change summary goes here 17 | ``` 18 | 19 | Summaries do not have a specific character limit, but are text only. These summaries are used within the (future implementation of) changelogs. They will give context to the change and also point back to the original PR if more details and context are needed. 20 | 21 | Changes will be designated as a `major`, `minor` or `patch` as further described in [semver](https://semver.org/). 22 | 23 | Given a version number MAJOR.MINOR.PATCH, increment the: 24 | 25 | - MAJOR version when you make incompatible API changes, 26 | - MINOR version when you add functionality in a backwards compatible manner, and 27 | - PATCH version when you make backwards compatible bug fixes. 28 | 29 | Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format, but will be discussed prior to usage (as extra steps will be necessary in consideration of merging and publishing). 30 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 22 | -------------------------------------------------------------------------------- /.github/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/.github/splash.png -------------------------------------------------------------------------------- /.github/workflows/audit.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | # SPDX-License-Identifier: Apache-2.0 3 | # SPDX-License-Identifier: MIT 4 | 5 | name: audit 6 | 7 | on: 8 | workflow_dispatch: 9 | schedule: 10 | - cron: '0 0 * * *' 11 | push: 12 | branches: 13 | - dev 14 | paths: 15 | - '**/Cargo.lock' 16 | - '**/Cargo.toml' 17 | - '**/package.json' 18 | - '**/pnpm-lock.yaml' 19 | pull_request: 20 | paths: 21 | - '**/Cargo.lock' 22 | - '**/Cargo.toml' 23 | - '**/package.json' 24 | - '**/pnpm-lock.yaml' 25 | 26 | concurrency: 27 | group: ${{ github.workflow }}-${{ github.ref }} 28 | cancel-in-progress: true 29 | 30 | 31 | jobs: 32 | audit-rust: 33 | runs-on: ubuntu-latest 34 | steps: 35 | - uses: actions/checkout@v4 36 | - uses: rustsec/audit-check@v2.0.0 37 | with: 38 | token: ${{ secrets.GITHUB_TOKEN }} 39 | 40 | audit-js: 41 | runs-on: ubuntu-latest 42 | steps: 43 | - uses: actions/checkout@v3 44 | - run: | 45 | npm i -g --force corepack 46 | corepack enable 47 | - name: Setup node 48 | uses: actions/setup-node@v4 49 | with: 50 | node-version: 20 51 | check-latest: true 52 | cache: 'pnpm' 53 | cache-dependency-path: '**/pnpm-lock.yaml' 54 | - run: pnpm install 55 | - run: pnpm audit 56 | -------------------------------------------------------------------------------- /.github/workflows/cli-test.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | # SPDX-License-Identifier: Apache-2.0 3 | # SPDX-License-Identifier: MIT 4 | 5 | name: test create-tauri-app 6 | 7 | on: 8 | push: 9 | branches: 10 | - dev 11 | paths: 12 | - '.github/workflows/cli-test.yml' 13 | - 'src/**' 14 | - 'Cargo.lock' 15 | - 'Cargo.toml' 16 | pull_request: 17 | paths: 18 | - '.github/workflows/cli-test.yml' 19 | - 'src/**' 20 | - 'Cargo.lock' 21 | - 'Cargo.toml' 22 | 23 | env: 24 | RUST_BACKTRACE: 1 25 | 26 | concurrency: 27 | group: ${{ github.workflow }}-${{ github.ref }} 28 | cancel-in-progress: true 29 | 30 | jobs: 31 | test: 32 | runs-on: ubuntu-latest 33 | strategy: 34 | matrix: 35 | toolchain: [1.71, stable] 36 | 37 | steps: 38 | - uses: actions/checkout@v3 39 | - uses: dtolnay/rust-toolchain@master 40 | with: 41 | toolchain: ${{ matrix.toolchain }} 42 | - run: cargo test -------------------------------------------------------------------------------- /.github/workflows/clippy.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | # SPDX-License-Identifier: Apache-2.0 3 | # SPDX-License-Identifier: MIT 4 | 5 | name: clippy 6 | 7 | on: 8 | push: 9 | branches: 10 | - dev 11 | paths: 12 | - '.github/workflows/clippy.yml' 13 | - 'src/**' 14 | - 'Cargo.lock' 15 | - 'Cargo.toml' 16 | pull_request: 17 | paths: 18 | - .github/workflows/clippy.yml 19 | - src/** 20 | - Cargo.lock 21 | - Cargo.toml 22 | 23 | concurrency: 24 | group: ${{ github.workflow }}-${{ github.ref }} 25 | cancel-in-progress: true 26 | 27 | jobs: 28 | clippy: 29 | runs-on: ubuntu-latest 30 | steps: 31 | - uses: actions/checkout@v3 32 | - uses: dtolnay/rust-toolchain@stable 33 | with: 34 | components: clippy 35 | 36 | - run: cargo clippy --all-targets --all-features -- -D warnings -------------------------------------------------------------------------------- /.github/workflows/covector-status.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | # SPDX-License-Identifier: Apache-2.0 3 | # SPDX-License-Identifier: MIT 4 | 5 | name: covector status 6 | on: [pull_request] 7 | 8 | jobs: 9 | covector: 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - uses: actions/checkout@v3 14 | with: 15 | fetch-depth: 0 16 | - name: covector status 17 | uses: jbolda/covector/packages/action@covector-v0 18 | id: covector 19 | with: 20 | command: "status" 21 | token: ${{ secrets.GITHUB_TOKEN }} 22 | comment: true 23 | -------------------------------------------------------------------------------- /.github/workflows/deploy-scripts-worker.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | # SPDX-License-Identifier: Apache-2.0 3 | # SPDX-License-Identifier: MIT 4 | 5 | name: deploy .{sh,ps1} scripts worker 6 | 7 | on: 8 | push: 9 | branches: 10 | - dev 11 | paths: 12 | - '.github/workflows/deploy-scripts.yml' 13 | - 'worker/**' 14 | 15 | jobs: 16 | deploy: 17 | # prevents this action from running on forks 18 | if: github.repository_owner == 'tauri-apps' 19 | runs-on: ubuntu-latest 20 | steps: 21 | - uses: actions/checkout@v3 22 | - uses: cloudflare/wrangler-action@2.0.0 23 | with: 24 | command: publish 25 | workingDirectory: 'worker' 26 | apiToken: ${{ secrets.CF_API_TOKEN }} 27 | accountId: ${{ secrets.CF_ACCOUNT_ID }} 28 | -------------------------------------------------------------------------------- /.github/workflows/fmt.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | # SPDX-License-Identifier: Apache-2.0 3 | # SPDX-License-Identifier: MIT 4 | 5 | name: fmt check 6 | 7 | on: 8 | push: 9 | branches: 10 | - dev 11 | pull_request: 12 | 13 | concurrency: 14 | group: ${{ github.workflow }}-${{ github.ref }} 15 | cancel-in-progress: true 16 | 17 | jobs: 18 | cargo-fmt-check: 19 | runs-on: ubuntu-latest 20 | steps: 21 | - uses: actions/checkout@v3 22 | - uses: dtolnay/rust-toolchain@stable 23 | with: 24 | components: rustfmt 25 | 26 | - run: cargo fmt --all -- --check 27 | 28 | prettier-fmt-check: 29 | runs-on: ubuntu-latest 30 | 31 | steps: 32 | - uses: actions/checkout@v3 33 | - run: | 34 | npm i -g --force corepack 35 | corepack enable 36 | - name: Setup node 37 | uses: actions/setup-node@v4 38 | with: 39 | node-version: 20 40 | check-latest: true 41 | 42 | - run: pnpm install 43 | - run: pnpm format:check -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | # SPDX-License-Identifier: Apache-2.0 3 | # SPDX-License-Identifier: MIT 4 | 5 | /node_modules 6 | /target 7 | /package-json.lock 8 | /yarn.lock -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | # SPDX-License-Identifier: Apache-2.0 3 | # SPDX-License-Identifier: MIT 4 | 5 | /.changes 6 | /.github 7 | node_modules 8 | node/index.js 9 | node/index.d.ts 10 | CHANGELOG.md 11 | pnpm-lock.yaml -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": false, 3 | "semi": true 4 | } 5 | -------------------------------------------------------------------------------- /.scripts/generate-templates-matrix.js: -------------------------------------------------------------------------------- 1 | const trigger = process.argv[2]; 2 | const isCron = trigger === "schedule" || trigger === "workflow_dispatch"; 3 | 4 | const changedFilesStr = process.argv[3]; 5 | const changedFiles = changedFilesStr.split(","); 6 | 7 | const nodeJsTemplates = [ 8 | "svelte", 9 | "svelte-ts", 10 | "vue", 11 | "vue-ts", 12 | "solid", 13 | "solid-ts", 14 | "react", 15 | "react-ts", 16 | "vanilla", 17 | "vanilla-ts", 18 | "preact", 19 | "preact-ts", 20 | "angular", 21 | ]; 22 | 23 | const matrixConfig = [ 24 | { 25 | manager: "cargo", 26 | install_cmd: "", 27 | run_cmd: "cargo", 28 | templates: ["vanilla", "yew", "sycamore", "leptos", "dioxus"], 29 | }, 30 | { 31 | manager: "pnpm", 32 | install_cmd: "pnpm install", 33 | run_cmd: "pnpm", 34 | templates: nodeJsTemplates, 35 | }, 36 | { 37 | manager: "yarn", 38 | install_cmd: "yarn", 39 | run_cmd: "yarn", 40 | templates: nodeJsTemplates, 41 | }, 42 | { 43 | manager: "npm", 44 | install_cmd: "npm install", 45 | run_cmd: "npm run", 46 | templates: nodeJsTemplates, 47 | }, 48 | { 49 | manager: "bun", 50 | install_cmd: "bun install", 51 | run_cmd: "bun run", 52 | templates: nodeJsTemplates, 53 | }, 54 | { 55 | manager: "deno", 56 | install_cmd: "deno install", 57 | run_cmd: "deno task", 58 | templates: nodeJsTemplates, 59 | }, 60 | { 61 | manager: "dotnet", 62 | install_cmd: "", 63 | run_cmd: "cargo", 64 | templates: ["blazor"], 65 | }, 66 | ]; 67 | 68 | const outMatrix = []; 69 | matrixConfig 70 | .map((e) => e.templates) 71 | .forEach((ts, i) => { 72 | let { templates, ...managerInfo } = matrixConfig[i]; 73 | for (const t of ts) { 74 | if ( 75 | isCron || 76 | changedFiles.some( 77 | (e) => 78 | e.startsWith(`templates/base`) || 79 | e.startsWith(`templates/template-${t}`) || 80 | e.startsWith("src") || 81 | e.startsWith("Cargo.toml") || 82 | e.startsWith(".github/workflows/templates-test.yml"), 83 | ) 84 | ) { 85 | const jobInfo = { 86 | template: t, 87 | node: ["pnpm", "yarn", "npm"].includes(managerInfo.manager), 88 | install_trunk: ["yew", "sycamore", "leptos"].includes(t), 89 | install_dioxus_cli: t === "dioxus", 90 | tauriVersion: "latest", 91 | no_bundle_flag: "--no-bundle", 92 | ...managerInfo, 93 | }; 94 | outMatrix.push(jobInfo); 95 | outMatrix.push({ 96 | ...jobInfo, 97 | tauriVersion: 1, 98 | no_bundle_flag: "-b none", 99 | flags: "--tauri-version 1", 100 | }); 101 | } 102 | } 103 | }); 104 | 105 | console.log(JSON.stringify(outMatrix)); 106 | -------------------------------------------------------------------------------- /.scripts/sync-scripts-tagname.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | // Copyright 2019-2022 Tauri Programme within The Commons Conservancy 4 | // SPDX-License-Identifier: Apache-2.0 5 | // SPDX-License-Identifier: MIT 6 | 7 | /* 8 | This script is solely intended to be run as part of the `covector version` step to 9 | keep the tagName in `create-tauri-app.{ps1,sh}` up to date with other version bumps. 10 | */ 11 | 12 | const { readFileSync, writeFileSync } = require("fs"); 13 | const { join } = require("path"); 14 | 15 | const bump = process.argv[2]; 16 | 17 | const inc = (content) => { 18 | const re = new RegExp( 19 | /(.*__TAG_NAME__\s*=\s*("|')create-tauri-app-v)([0-9]+)\.([0-9]+)\.([0-9]+)(-([a-zA-z]+\.([0-9]+)))?(("|').*)/, 20 | "s", 21 | ); 22 | const [, before, , major, minor, patch, preStr, , pre, after] = 23 | re.exec(content); 24 | 25 | let ret; 26 | switch (bump) { 27 | case "major": 28 | ret = `${before}${Number(major) + 1}.0.0${after}`; 29 | break; 30 | case "minor": 31 | ret = `${before}${major}.${Number(minor) + 1}.0${after}`; 32 | break; 33 | case "patch": 34 | ret = `${before}${major}.${minor}.${Number(patch) + 1}${after}`; 35 | break; 36 | default: 37 | throw new Error("unexpected bump " + bump); 38 | } 39 | return ret; 40 | }; 41 | 42 | for (let file of [ 43 | join(__dirname, "../create-tauri-app.ps1"), 44 | join(__dirname, "../create-tauri-app.sh"), 45 | ]) { 46 | const content = readFileSync(file, "utf-8"); 47 | const updatedContent = inc(content); 48 | writeFileSync(file, updatedContent); 49 | console.log(`updated __TAG_NAME__ version in "${file}"`); 50 | } 51 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Tauri Contributing Guide 2 | 3 | Please checkout [Tauri contributing guide](https://github.com/tauri-apps/tauri/blob/dev/.github/CONTRIBUTING.md). 4 | 5 | ## Development Guide 6 | 7 | You need to have [Rust](https://www.rust-lang.org) and [Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html) installed. 8 | 9 | ### Testing your changes 10 | 11 | ```bash 12 | cargo run 13 | ``` 14 | 15 | or 16 | 17 | ```bash 18 | cargo run -- 19 | ``` 20 | 21 | #### Adding a new template 22 | 23 | > [!IMPORTANT] 24 | > You should open a new issue first to discuss the addition of a certain template. 25 | 26 | - Add a directory in `templates` and name it `template-` where `` is the name of the template and add all the files you need there. 27 | - A template also must have a `.manifest` file which contains info about the template: 28 | 29 | ```ini 30 | beforeDevCommand = {% pkg_manager_run_command %} dev 31 | beforeBuildCommand = {% pkg_manager_run_command %} build 32 | devUrl = http://localhost:1420 33 | frontendDist = ../dist 34 | 35 | # the next sction is used to determine what files to copy from `templates/_assets_` 36 | # if you introduce a new file like an icon that is shared between multiple templates, 37 | # it should be added to `templates/_assets_` and add entry for it here 38 | # for example: `tauri.svg` is shared between all templates so it lives in `templates/_assets_` 39 | # and is always added to the next section 40 | [files] 41 | # the first part is the path of the file under `templates/_assets_` 42 | # the second part is the path that the file will be copied to under the final template directory 43 | tauri.svg = public/tauri.svg 44 | ``` 45 | 46 | - In `src/template.rs`, add an entry in the `Template` enum, and modify its methods if needed. 47 | - In `src/package_manager.rs` add your new template to the appropriate package manager in the `templates` method. 48 | - Modify `.scripts/generate-templates-matrix.js` and append the template name inside the template list for the appropriate package manager so the CI would run tests for it. 49 | - Before making a commit, make sure to run `cargo fmt --all` and `pnpm format` in the repo root. 50 | 51 | ## Financial Contribution 52 | 53 | Tauri is an MIT-licensed open source project. Its ongoing development can be supported via [Github Sponsors](https://github.com/sponsors/nothingismagick) or [Open Collective](https://opencollective.com/tauri). We prefer Github Sponsors as donations made are doubled through the matching fund program. 54 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "create-tauri-app" 3 | description = "Rapidly scaffold out a new tauri app project." 4 | authors = ["Tauri Programme within The Commons Conservancy"] 5 | version = "4.5.10" 6 | edition = "2021" 7 | license = "Apache-2.0 OR MIT" 8 | readme = "README.md" 9 | repository = "https://github.com/tauri-apps/create-tauri-app" 10 | keywords = ["tauri"] 11 | categories = ["gui"] 12 | exclude = ["node", "worker", ".github", ".changes", ".scripts"] 13 | rust-version = "1.71" 14 | 15 | [[bin]] 16 | name = "cargo-create-tauri-app" 17 | path = "src/main.rs" 18 | 19 | [workspace] 20 | resolver = "2" 21 | members = ["node"] 22 | 23 | [profile.release] 24 | panic = "abort" 25 | codegen-units = 1 26 | lto = true 27 | opt-level = "s" 28 | strip = true 29 | 30 | [dependencies] 31 | anyhow = "1" 32 | dialoguer = "0.11" 33 | pico-args = "0.5" 34 | ctrlc = "3.3" 35 | rust-embed = { version = "8.3", features = [ 36 | "compression", 37 | "interpolate-folder-path", 38 | ] } 39 | -------------------------------------------------------------------------------- /LICENSE.spdx: -------------------------------------------------------------------------------- 1 | SPDXVersion: SPDX-2.1 2 | DataLicense: CC0-1.0 3 | PackageName: create-tauri-app 4 | DataFormat: SPDXRef-1 5 | PackageSupplier: Organization: The Tauri Programme in the Commons Conservancy 6 | PackageHomePage: https://tauri.app 7 | PackageLicenseDeclared: Apache-2.0 8 | PackageLicenseDeclared: MIT 9 | PackageCopyrightText: 2019-2022, The Tauri Programme in the Commons Conservancy 10 | PackageSummary: Rapidly scaffold out a new tauri app project. 11 | PackageComment: The package includes the following libraries; see 12 | Relationship information. 13 | 14 | Created: 2019-05-20T09:00:00Z 15 | PackageDownloadLocation: git://github.com/tauri-apps/create-tauri-app 16 | PackageDownloadLocation: git+https://github.com/tauri-apps/create-tauri-app.git 17 | PackageDownloadLocation: git+ssh://github.com/tauri-apps/create-tauri-app.git 18 | Creator: Person: Daniel Thompson-Yvetot -------------------------------------------------------------------------------- /LICENSE_MIT: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 - 2022 Tauri Programme within The Commons Conservancy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /create-tauri-app.ps1: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | # SPDX-License-Identifier: Apache-2.0 3 | # SPDX-License-Identifier: MIT 4 | 5 | $bitness = if ([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture -eq "X64") { 6 | "x86_64" 7 | } elseif ([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture -eq "Arm64") { 8 | "aarch64" 9 | } else { 10 | "i686" 11 | } 12 | $__TAG_NAME__ = "create-tauri-app-v4.5.10" 13 | # $url="https://github.com/tauri-apps/create-tauri-app/releases/download/$__TAG_NAME__/create-tauri-app-$bitness-pc-windows-msvc.exe" 14 | $url="https://create.tauri.app/download/bin?tag=$__TAG_NAME__&arch=$bitness-pc-windows-msvc&ext=.exe" 15 | $outFile = "$Env:TEMP\create-tauri-app.exe" 16 | 17 | Write-Output "$($PSStyle.Bold)$($PSStyle.Foreground.Green)info:$($PSStyle.Reset) downloading create-tauri-app" 18 | 19 | $oldProgressPreference = $ProgressPreference 20 | $ProgressPreference = 'SilentlyContinue' 21 | Invoke-WebRequest -Uri $url -OutFile $outFile 22 | $ProgressPreference = $oldProgressPreference 23 | 24 | if ($Env:CTA_ARGS) { 25 | Start-Process -FilePath $outFile -Wait -NoNewWindow -ArgumentList "$Env:CTA_ARGS" 26 | } else { 27 | Start-Process -FilePath $outFile -Wait -NoNewWindow 28 | } 29 | -------------------------------------------------------------------------------- /node/.npmignore: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | # SPDX-License-Identifier: Apache-2.0 3 | # SPDX-License-Identifier: MIT 4 | 5 | target 6 | Cargo.lock 7 | .cargo 8 | .github 9 | npm 10 | .eslintrc 11 | .prettierignore 12 | rustfmt.toml 13 | yarn.lock 14 | *.node 15 | -------------------------------------------------------------------------------- /node/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | edition = "2021" 3 | name = "create-tauri-app-node" 4 | version = "0.0.0" 5 | license = "Apache-2.0 OR MIT" 6 | 7 | [lib] 8 | crate-type = ["cdylib"] 9 | 10 | [dependencies] 11 | # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix 12 | napi = { version = "2.16", default-features = false, features = ["napi4"] } 13 | napi-derive = "2.16" 14 | create-tauri-app = { path = ".." } 15 | 16 | [build-dependencies] 17 | napi-build = "2.1" 18 | -------------------------------------------------------------------------------- /node/LICENSE_MIT: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 - 2020 Tauri Programme within The Commons Conservancy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /node/README.md: -------------------------------------------------------------------------------- 1 | Rapidly scaffold out a new Tauri app project. 2 | 3 | [![](https://img.shields.io/crates/v/create-tauri-app)](https://crates.io/crates/create-tauri-app) 4 | [![](https://img.shields.io/npm/v/create-tauri-app.svg)](https://www.npmjs.com/package/create-tauri-app) 5 | [![status](https://img.shields.io/badge/status-stable-blue.svg)](https://github.com/tauri-apps/tauri) 6 | [![Chat Server](https://img.shields.io/badge/chat-discord-7289da.svg)](https://discord.gg/SpmNs4S) 7 | [![website](https://img.shields.io/badge/website-tauri.app-purple.svg)](https://tauri.app) 8 | [![https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg](https://good-labs.github.io/greater-good-affirmation/assets/images/badge.svg)](https://good-labs.github.io/greater-good-affirmation) 9 | [![support](https://img.shields.io/badge/sponsor-Open%20Collective-blue.svg)](https://opencollective.com/tauri) 10 | [![changelog](https://img.shields.io/badge/CHANGELOG-yellowgreen)](./CHANGELOG.md) 11 | 12 | # Usage 13 | 14 | ## NPM: 15 | 16 | ```bash 17 | npm create tauri-app@latest 18 | ``` 19 | 20 | ## Yarn: 21 | 22 | ```bash 23 | yarn create tauri-app 24 | ``` 25 | 26 | ## PNPM: 27 | 28 | ```bash 29 | pnpm create tauri-app 30 | ``` 31 | 32 | ### Deno 33 | 34 | ```bash 35 | deno run -A npm:create-tauri-app 36 | ``` 37 | 38 | ## Bun: 39 | 40 | ```bash 41 | bunx create-tauri-app 42 | ``` 43 | 44 |
45 | 46 | You can also directly specify the project name, package manager and the template you want to use via additional command line options. For example, to scaffold a Svelte project in a `my-tauri-app` directory, run: 47 | 48 | ```bash 49 | # npm 6.x 50 | npm create tauri-app@latest my-tauri-app --template svelte 51 | # npm 7+, extra double-dash is needed: 52 | npm create tauri-app@latest my-tauri-app -- --template svelte 53 | # yarn 54 | yarn create tauri-app my-tauri-app --template svelte 55 | # pnpm 56 | pnpm create tauri-app my-tauri-app --template svelte 57 | # Bun 58 | bunx create-tauri-app my-tauri-app --template svelte 59 | ``` 60 | 61 | Currently supported template presets include: 62 | 63 | - `vanilla` 64 | - `vanilla-ts` 65 | - `vue` 66 | - `vue-ts` 67 | - `svelte` 68 | - `svelte-ts` 69 | - `react` 70 | - `react-ts` 71 | - `preact` 72 | - `preact-ts` 73 | - `solid` 74 | - `solid-ts` 75 | - `angular` 76 | - `yew` 77 | - `leptos` 78 | - `sycamore` 79 | - `blazor` 80 | 81 | You can use `.` for the project name to scaffold in the current directory. 82 | 83 | ## Semver 84 | 85 | **create-tauri-app** is following [Semantic Versioning 2.0](https://semver.org/). 86 | 87 | ## Licenses 88 | 89 | Code: (c) 2022 - The Tauri Programme within The Commons Conservancy. 90 | 91 | MIT or MIT/Apache 2.0 where applicable. 92 | 93 | Logo: CC-BY-NC-ND 94 | 95 | - Original Tauri Logo Designs by [Daniel Thompson-Yvetot](https://github.com/nothingismagick) and [Guillaume Chau](https://github.com/akryum) 96 | -------------------------------------------------------------------------------- /node/build.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | // SPDX-License-Identifier: Apache-2.0 3 | // SPDX-License-Identifier: MIT 4 | 5 | extern crate napi_build; 6 | 7 | fn main() { 8 | napi_build::setup(); 9 | } 10 | -------------------------------------------------------------------------------- /node/create-tauri-app.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | // Copyright 2019-2022 Tauri Programme within The Commons Conservancy 4 | // SPDX-License-Identifier: Apache-2.0 5 | // SPDX-License-Identifier: MIT 6 | 7 | const cli = require("./index"); 8 | const path = require("path"); 9 | 10 | const [bin, script, ...args] = process.argv; 11 | const binStem = path.parse(bin).name.toLowerCase(); 12 | 13 | // We want to make a helpful binary name for the underlying CLI helper, if we 14 | // can successfully detect what command likely started the execution. 15 | let binName; 16 | 17 | // deno run -A npm:@tauri-apps/cli or deno task tauri 18 | if (globalThis.navigator?.userAgent?.includes("Deno")) { 19 | binName = bin; 20 | } 21 | // Even if started by a package manager, the binary will be NodeJS or Bun. 22 | // Some distribution still use "nodejs" as the binary name. 23 | else if (binStem.match(/(nodejs|node|bun)-*([0-9]*)*$/g)) { 24 | const managerStem = process.env.npm_execpath 25 | ? path.parse(process.env.npm_execpath).name.toLowerCase() 26 | : null; 27 | if (managerStem) { 28 | let manager; 29 | switch (managerStem) { 30 | // Only supported package manager that has a different filename is npm. 31 | case "npm-cli": 32 | manager = "npm"; 33 | break; 34 | 35 | // Yarn, pnpm, and Bun have the same stem name as their bin. 36 | // We assume all unknown package managers do as well. 37 | default: 38 | manager = managerStem; 39 | break; 40 | } 41 | 42 | binName = `${manager} run ${process.env.npm_lifecycle_event}`; 43 | } else { 44 | // Assume running NodeJS if we didn't detect a manager from the env. 45 | // We normalize the path to prevent the script's absolute path being used. 46 | const scriptNormal = path.normalize(path.relative(process.cwd(), script)); 47 | binName = `${binStem} ${scriptNormal}`; 48 | } 49 | } else { 50 | // We don't know what started it, assume it's already stripped. 51 | args.unshift(bin); 52 | } 53 | 54 | // adapted from https://github.com/vitejs/vite/blob/34826aae015ed16dc9b9096c0f778154ca6981a6/packages/create-vite/src/index.ts#L513 55 | const userAgent = 56 | process.env.npm_config_user_agent ?? globalThis.navigator?.userAgent; 57 | const pkgManager = userAgent?.split(" ")[0]?.split("/")[0].toLocaleLowerCase(); 58 | 59 | cli.run(args, binName, pkgManager); 60 | -------------------------------------------------------------------------------- /node/index.d.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | // SPDX-License-Identifier: Apache-2.0 3 | // SPDX-License-Identifier: MIT 4 | 5 | /* tslint:disable */ 6 | /* eslint-disable */ 7 | 8 | /* auto-generated by NAPI-RS */ 9 | 10 | export function run( 11 | args: Array, 12 | binName?: string | undefined | null, 13 | pkgManager?: string | undefined | null, 14 | ): void; 15 | -------------------------------------------------------------------------------- /node/npm/darwin-arm64/README.md: -------------------------------------------------------------------------------- 1 | # `create-tauri-app-darwin-arm64` 2 | 3 | This is the **aarch64-apple-darwin** binary for `create-tauri-app` 4 | 5 | ## Licenses 6 | 7 | Code: (c) 2022 - The Tauri Programme within The Commons Conservancy. 8 | 9 | MIT or MIT/Apache 2.0 where applicable. 10 | -------------------------------------------------------------------------------- /node/npm/darwin-arm64/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-tauri-app-darwin-arm64", 3 | "version": "0.0.0", 4 | "os": [ 5 | "darwin" 6 | ], 7 | "cpu": [ 8 | "arm64" 9 | ], 10 | "main": "create-tauri-app.darwin-arm64.node", 11 | "files": [ 12 | "create-tauri-app.darwin-arm64.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /node/npm/darwin-universal/README.md: -------------------------------------------------------------------------------- 1 | # `create-tauri-app-darwin-universal` 2 | 3 | This is the **universal-apple-darwin** binary for `create-tauri-app` 4 | 5 | ## Licenses 6 | 7 | Code: (c) 2022 - The Tauri Programme within The Commons Conservancy. 8 | 9 | MIT or MIT/Apache 2.0 where applicable. 10 | -------------------------------------------------------------------------------- /node/npm/darwin-universal/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-tauri-app-darwin-universal", 3 | "version": "0.0.0", 4 | "os": [ 5 | "darwin" 6 | ], 7 | "main": "create-tauri-app.darwin-universal.node", 8 | "files": [ 9 | "create-tauri-app.darwin-universal.node" 10 | ], 11 | "license": "MIT", 12 | "engines": { 13 | "node": ">= 10" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /node/npm/darwin-x64/README.md: -------------------------------------------------------------------------------- 1 | # `create-tauri-app-darwin-x64` 2 | 3 | This is the **x86_64-apple-darwin** binary for `create-tauri-app` 4 | 5 | ## Licenses 6 | 7 | Code: (c) 2022 - The Tauri Programme within The Commons Conservancy. 8 | 9 | MIT or MIT/Apache 2.0 where applicable. 10 | -------------------------------------------------------------------------------- /node/npm/darwin-x64/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-tauri-app-darwin-x64", 3 | "version": "0.0.0", 4 | "os": [ 5 | "darwin" 6 | ], 7 | "cpu": [ 8 | "x64" 9 | ], 10 | "main": "create-tauri-app.darwin-x64.node", 11 | "files": [ 12 | "create-tauri-app.darwin-x64.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /node/npm/linux-arm-gnueabihf/README.md: -------------------------------------------------------------------------------- 1 | # `create-tauri-app-linux-arm-gnueabihf` 2 | 3 | This is the **armv7-unknown-linux-gnueabihf** binary for `create-tauri-app` 4 | 5 | ## Licenses 6 | 7 | Code: (c) 2022 - The Tauri Programme within The Commons Conservancy. 8 | 9 | MIT or MIT/Apache 2.0 where applicable. 10 | -------------------------------------------------------------------------------- /node/npm/linux-arm-gnueabihf/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-tauri-app-linux-arm-gnueabihf", 3 | "version": "0.0.0", 4 | "os": [ 5 | "linux" 6 | ], 7 | "cpu": [ 8 | "arm" 9 | ], 10 | "main": "create-tauri-app.linux-arm-gnueabihf.node", 11 | "files": [ 12 | "create-tauri-app.linux-arm-gnueabihf.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /node/npm/linux-arm64-gnu/README.md: -------------------------------------------------------------------------------- 1 | # `create-tauri-app-linux-arm64-gnu` 2 | 3 | This is the **aarch64-unknown-linux-gnu** binary for `create-tauri-app` 4 | 5 | ## Licenses 6 | 7 | Code: (c) 2022 - The Tauri Programme within The Commons Conservancy. 8 | 9 | MIT or MIT/Apache 2.0 where applicable. 10 | -------------------------------------------------------------------------------- /node/npm/linux-arm64-gnu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-tauri-app-linux-arm64-gnu", 3 | "version": "0.0.0", 4 | "os": [ 5 | "linux" 6 | ], 7 | "cpu": [ 8 | "arm64" 9 | ], 10 | "main": "create-tauri-app.linux-arm64-gnu.node", 11 | "files": [ 12 | "create-tauri-app.linux-arm64-gnu.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | }, 18 | "libc": [ 19 | "glibc" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /node/npm/linux-arm64-musl/README.md: -------------------------------------------------------------------------------- 1 | # `create-tauri-app-linux-arm64-musl` 2 | 3 | This is the **aarch64-unknown-linux-musl** binary for `create-tauri-app` 4 | 5 | ## Licenses 6 | 7 | Code: (c) 2022 - The Tauri Programme within The Commons Conservancy. 8 | 9 | MIT or MIT/Apache 2.0 where applicable. 10 | -------------------------------------------------------------------------------- /node/npm/linux-arm64-musl/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-tauri-app-linux-arm64-musl", 3 | "version": "0.0.0", 4 | "os": [ 5 | "linux" 6 | ], 7 | "cpu": [ 8 | "arm64" 9 | ], 10 | "main": "create-tauri-app.linux-arm64-musl.node", 11 | "files": [ 12 | "create-tauri-app.linux-arm64-musl.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | }, 18 | "libc": [ 19 | "musl" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /node/npm/linux-x64-gnu/README.md: -------------------------------------------------------------------------------- 1 | # `create-tauri-app-linux-x64-gnu` 2 | 3 | This is the **x86_64-unknown-linux-gnu** binary for `create-tauri-app` 4 | 5 | ## Licenses 6 | 7 | Code: (c) 2022 - The Tauri Programme within The Commons Conservancy. 8 | 9 | MIT or MIT/Apache 2.0 where applicable. 10 | -------------------------------------------------------------------------------- /node/npm/linux-x64-gnu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-tauri-app-linux-x64-gnu", 3 | "version": "0.0.0", 4 | "os": [ 5 | "linux" 6 | ], 7 | "cpu": [ 8 | "x64" 9 | ], 10 | "main": "create-tauri-app.linux-x64-gnu.node", 11 | "files": [ 12 | "create-tauri-app.linux-x64-gnu.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | }, 18 | "libc": [ 19 | "glibc" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /node/npm/linux-x64-musl/README.md: -------------------------------------------------------------------------------- 1 | # `create-tauri-app-linux-x64-musl` 2 | 3 | This is the **x86_64-unknown-linux-musl** binary for `create-tauri-app` 4 | 5 | ## Licenses 6 | 7 | Code: (c) 2022 - The Tauri Programme within The Commons Conservancy. 8 | 9 | MIT or MIT/Apache 2.0 where applicable. 10 | -------------------------------------------------------------------------------- /node/npm/linux-x64-musl/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-tauri-app-linux-x64-musl", 3 | "version": "0.0.0", 4 | "os": [ 5 | "linux" 6 | ], 7 | "cpu": [ 8 | "x64" 9 | ], 10 | "main": "create-tauri-app.linux-x64-musl.node", 11 | "files": [ 12 | "create-tauri-app.linux-x64-musl.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | }, 18 | "libc": [ 19 | "musl" 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /node/npm/win32-arm64-msvc/README.md: -------------------------------------------------------------------------------- 1 | # `create-tauri-app-win32-arm64-msvc` 2 | 3 | This is the **aarch64-pc-windows-msvc** binary for `create-tauri-app` 4 | 5 | ## Licenses 6 | 7 | Code: (c) 2022 - The Tauri Programme within The Commons Conservancy. 8 | 9 | MIT or MIT/Apache 2.0 where applicable. 10 | -------------------------------------------------------------------------------- /node/npm/win32-arm64-msvc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-tauri-app-win32-arm64-msvc", 3 | "version": "0.0.0", 4 | "os": [ 5 | "win32" 6 | ], 7 | "cpu": [ 8 | "arm64" 9 | ], 10 | "main": "create-tauri-app.win32-arm64-msvc.node", 11 | "files": [ 12 | "create-tauri-app.win32-arm64-msvc.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /node/npm/win32-ia32-msvc/README.md: -------------------------------------------------------------------------------- 1 | # `create-tauri-app-win32-ia32-msvc` 2 | 3 | This is the **i686-pc-windows-msvc** binary for `create-tauri-app` 4 | 5 | ## Licenses 6 | 7 | Code: (c) 2022 - The Tauri Programme within The Commons Conservancy. 8 | 9 | MIT or MIT/Apache 2.0 where applicable. 10 | -------------------------------------------------------------------------------- /node/npm/win32-ia32-msvc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-tauri-app-win32-ia32-msvc", 3 | "version": "0.0.0", 4 | "os": [ 5 | "win32" 6 | ], 7 | "cpu": [ 8 | "ia32" 9 | ], 10 | "main": "create-tauri-app.win32-ia32-msvc.node", 11 | "files": [ 12 | "create-tauri-app.win32-ia32-msvc.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /node/npm/win32-x64-msvc/README.md: -------------------------------------------------------------------------------- 1 | # `create-tauri-app-win32-x64-msvc` 2 | 3 | This is the **x86_64-pc-windows-msvc** binary for `create-tauri-app` 4 | 5 | ## Licenses 6 | 7 | Code: (c) 2022 - The Tauri Programme within The Commons Conservancy. 8 | 9 | MIT or MIT/Apache 2.0 where applicable. 10 | -------------------------------------------------------------------------------- /node/npm/win32-x64-msvc/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-tauri-app-win32-x64-msvc", 3 | "version": "0.0.0", 4 | "os": [ 5 | "win32" 6 | ], 7 | "cpu": [ 8 | "x64" 9 | ], 10 | "main": "create-tauri-app.win32-x64-msvc.node", 11 | "files": [ 12 | "create-tauri-app.win32-x64-msvc.node" 13 | ], 14 | "license": "MIT", 15 | "engines": { 16 | "node": ">= 10" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-tauri-app", 3 | "version": "4.5.10", 4 | "description": "Rapidly scaffold out a new tauri app project.", 5 | "funding": { 6 | "type": "opencollective", 7 | "url": "https://opencollective.com/tauri" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/tauri-apps/create-tauri-app.git" 12 | }, 13 | "contributors": [ 14 | "Tauri Team (https://tauri.app)" 15 | ], 16 | "bugs": { 17 | "url": "https://github.com/tauri-apps/create-tauri-app/issues" 18 | }, 19 | "homepage": "https://github.com/tauri-apps/create-tauri-app#readme", 20 | "publishConfig": { 21 | "access": "public" 22 | }, 23 | "main": "index.js", 24 | "types": "index.d.ts", 25 | "napi": { 26 | "name": "create-tauri-app", 27 | "triples": { 28 | "additional": [ 29 | "universal-apple-darwin", 30 | "aarch64-apple-darwin", 31 | "aarch64-unknown-linux-gnu", 32 | "aarch64-unknown-linux-musl", 33 | "armv7-unknown-linux-gnueabihf", 34 | "x86_64-unknown-linux-musl", 35 | "i686-pc-windows-msvc", 36 | "aarch64-pc-windows-msvc" 37 | ] 38 | } 39 | }, 40 | "license": "Apache-2.0 OR MIT", 41 | "devDependencies": { 42 | "@napi-rs/cli": "2.18.4" 43 | }, 44 | "engines": { 45 | "node": ">= 10" 46 | }, 47 | "bin": { 48 | "create-tauri-app": "create-tauri-app.js" 49 | }, 50 | "scripts": { 51 | "create-tauri-app": "node ./create-tauri-app.js", 52 | "artifacts": "napi artifacts", 53 | "build": "napi build --platform --release", 54 | "build:debug": "napi build --platform", 55 | "prepublishOnly": "napi prepublish -t npm --gh-release-id $RELEASE_ID", 56 | "universal": "napi universal", 57 | "version": "napi version" 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /node/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | // SPDX-License-Identifier: Apache-2.0 3 | // SPDX-License-Identifier: MIT 4 | 5 | #[allow(unused)] 6 | #[napi_derive::napi] 7 | fn run(args: Vec, bin_name: Option, pkg_manager: Option) { 8 | create_tauri_app::run(args, bin_name, pkg_manager); 9 | } 10 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "format": "prettier --write .", 4 | "format:check": "prettier --check ." 5 | }, 6 | "devDependencies": { 7 | "prettier": "3.4.2" 8 | }, 9 | "packageManager": "pnpm@9.15.0", 10 | "pnpm": { 11 | "overrides": { 12 | "undici@>=4.5.0 <5.28.5": ">=5.28.5", 13 | "esbuild@<=0.24.2": ">=0.25.0" 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - "worker" 3 | - "node" 4 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["config:base", ":disableDependencyDashboard"], 4 | "packageRules": [ 5 | { 6 | "groupName": "templates dependencies", 7 | "matchFileNames": [ 8 | "templates/**/*package.json", 9 | "templates/**/*Cargo.toml" 10 | ], 11 | "schedule": ["after 3am on Wednesday"] 12 | }, 13 | { 14 | "groupName": "napi-rs dependencies", 15 | "matchPackagePrefixes": ["napi"] 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/category.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Display; 2 | 3 | use crate::package_manager::PackageManager; 4 | 5 | #[derive(Debug, Clone, Copy, PartialEq, Eq)] 6 | #[non_exhaustive] 7 | #[derive(Default)] 8 | pub enum Category { 9 | Rust, 10 | #[default] 11 | JsTs, 12 | Dotnet, 13 | } 14 | 15 | impl<'a> Category { 16 | pub const ALL: &'a [Self] = &[Category::JsTs, Category::Rust, Category::Dotnet]; 17 | 18 | pub const fn package_managers(&self) -> &[PackageManager] { 19 | match self { 20 | Category::Rust => &[PackageManager::Cargo], 21 | Category::JsTs => &[ 22 | PackageManager::Pnpm, 23 | PackageManager::Yarn, 24 | PackageManager::Npm, 25 | PackageManager::Deno, 26 | PackageManager::Bun, 27 | ], 28 | Category::Dotnet => &[PackageManager::Dotnet], 29 | } 30 | } 31 | } 32 | 33 | impl Display for Category { 34 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 35 | let managers = self 36 | .package_managers() 37 | .to_vec() 38 | .iter() 39 | .map(|p| p.to_string()) 40 | .collect::>() 41 | .join(", "); 42 | match self { 43 | Category::Rust => write!(f, "Rust - ({managers})"), 44 | Category::JsTs => write!(f, "TypeScript / JavaScript - ({managers})"), 45 | Category::Dotnet => write!(f, ".NET - ({managers})"), 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | // SPDX-License-Identifier: Apache-2.0 3 | // SPDX-License-Identifier: MIT 4 | 5 | use std::{env::args_os, ffi::OsStr, path::Path}; 6 | 7 | fn main() { 8 | let mut args = args_os().peekable(); 9 | let mut is_cargo = false; 10 | let bin_name = match args 11 | .next() 12 | .as_deref() 13 | .map(Path::new) 14 | .and_then(Path::file_stem) 15 | .and_then(OsStr::to_str) 16 | { 17 | Some("cargo-create-tauri-app") => { 18 | is_cargo = true; 19 | if args.peek().and_then(|s| s.to_str()) == Some("create-tauri-app") { 20 | // remove the extra cargo subcommand 21 | args.next(); 22 | Some("cargo create-tauri-app".into()) 23 | } else { 24 | Some("cargo-create-tauri-app".into()) 25 | } 26 | } 27 | Some(stem) => Some(stem.to_string()), 28 | None => None, 29 | }; 30 | 31 | create_tauri_app::run( 32 | args, 33 | bin_name, 34 | if is_cargo { Some("cargo".into()) } else { None }, 35 | ); 36 | } 37 | -------------------------------------------------------------------------------- /src/utils/colors.rs: -------------------------------------------------------------------------------- 1 | // Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | // SPDX-License-Identifier: Apache-2.0 3 | // SPDX-License-Identifier: MIT 4 | 5 | #![allow(unused)] 6 | 7 | pub const BLACK: &str = "\x1b[30m"; 8 | pub const RED: &str = "\x1b[31m"; 9 | pub const GREEN: &str = "\x1b[32m"; 10 | pub const YELLOW: &str = "\x1b[33m"; 11 | pub const BLUE: &str = "\x1b[34m"; 12 | pub const WHITE: &str = "\x1b[37m"; 13 | pub const RESET: &str = "\x1b[0m"; 14 | pub const BOLD: &str = "\x1b[1m"; 15 | pub const ITALIC: &str = "\x1b[3m"; 16 | pub const DIM: &str = "\x1b[2m"; 17 | pub const DIMRESET: &str = "\x1b[22m"; 18 | 19 | #[inline] 20 | pub fn remove_colors(s: &str) -> String { 21 | s.replace(BLACK, "") 22 | .replace(RED, "") 23 | .replace(GREEN, "") 24 | .replace(YELLOW, "") 25 | .replace(BLUE, "") 26 | .replace(WHITE, "") 27 | .replace(RESET, "") 28 | .replace(BOLD, "") 29 | .replace(ITALIC, "") 30 | .replace(DIM, "") 31 | .replace(DIMRESET, "") 32 | } 33 | -------------------------------------------------------------------------------- /templates/_assets_/preact.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /templates/_assets_/solid.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/_assets_/styles.css: -------------------------------------------------------------------------------- 1 | :root { 2 | font-family: Inter, Avenir, Helvetica, Arial, sans-serif; 3 | font-size: 16px; 4 | line-height: 24px; 5 | font-weight: 400; 6 | 7 | color: #0f0f0f; 8 | background-color: #f6f6f6; 9 | 10 | font-synthesis: none; 11 | text-rendering: optimizeLegibility; 12 | -webkit-font-smoothing: antialiased; 13 | -moz-osx-font-smoothing: grayscale; 14 | -webkit-text-size-adjust: 100%; 15 | } 16 | 17 | .container { 18 | margin: 0; 19 | padding-top: 10vh; 20 | display: flex; 21 | flex-direction: column; 22 | justify-content: center; 23 | text-align: center; 24 | } 25 | 26 | .logo { 27 | height: 6em; 28 | padding: 1.5em; 29 | will-change: filter; 30 | transition: 0.75s; 31 | } 32 | 33 | .logo.tauri:hover { 34 | filter: drop-shadow(0 0 2em #24c8db); 35 | } 36 | 37 | .row { 38 | display: flex; 39 | justify-content: center; 40 | } 41 | 42 | a { 43 | font-weight: 500; 44 | color: #646cff; 45 | text-decoration: inherit; 46 | } 47 | 48 | a:hover { 49 | color: #535bf2; 50 | } 51 | 52 | h1 { 53 | text-align: center; 54 | } 55 | 56 | input, 57 | button { 58 | border-radius: 8px; 59 | border: 1px solid transparent; 60 | padding: 0.6em 1.2em; 61 | font-size: 1em; 62 | font-weight: 500; 63 | font-family: inherit; 64 | color: #0f0f0f; 65 | background-color: #ffffff; 66 | transition: border-color 0.25s; 67 | box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2); 68 | } 69 | 70 | button { 71 | cursor: pointer; 72 | } 73 | 74 | button:hover { 75 | border-color: #396cd8; 76 | } 77 | button:active { 78 | border-color: #396cd8; 79 | background-color: #e8e8e8; 80 | } 81 | 82 | input, 83 | button { 84 | outline: none; 85 | } 86 | 87 | #greet-input { 88 | margin-right: 5px; 89 | } 90 | 91 | @media (prefers-color-scheme: dark) { 92 | :root { 93 | color: #f6f6f6; 94 | background-color: #2f2f2f; 95 | } 96 | 97 | a:hover { 98 | color: #24c8db; 99 | } 100 | 101 | input, 102 | button { 103 | color: #ffffff; 104 | background-color: #0f0f0f98; 105 | } 106 | button:active { 107 | background-color: #0f0f0f69; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /templates/_assets_/svelte.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/_assets_/svelte.png -------------------------------------------------------------------------------- /templates/_assets_/svelte.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/_assets_/tauri.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /templates/_assets_/vite.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/_assets_/vue.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /templates/_base_/src-tauri/%(v1)%tauri.conf.json.lte: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.tauri.app/config/1", 3 | "build": { 4 | {% if before_dev_command %}"beforeDevCommand": "{% before_dev_command %}", 5 | {% endif %}{% if before_build_command %}"beforeBuildCommand": "{% before_build_command %}", 6 | {% endif %}{% if dev_url %}"devPath": "{% dev_url %}", 7 | {% endif %}"distDir": "{% frontend_dist %}"{% if with_global_tauri %}, 8 | "withGlobalTauri": true{% endif %} 9 | }, 10 | "package": { 11 | "productName": "{% package_name %}", 12 | "version": "0.1.0" 13 | }, 14 | "tauri": { 15 | "allowlist": { 16 | "all": false, 17 | "shell": { 18 | "all": false, 19 | "open": true 20 | } 21 | }, 22 | "windows": [ 23 | { 24 | "title": "{% package_name %}", 25 | "width": 800, 26 | "height": 600 27 | } 28 | ], 29 | "security": { 30 | "csp": null 31 | }, 32 | "bundle": { 33 | "active": true, 34 | "targets": "all", 35 | "identifier": "{% identifier %}", 36 | "icon": [ 37 | "icons/32x32.png", 38 | "icons/128x128.png", 39 | "icons/128x128@2x.png", 40 | "icons/icon.icns", 41 | "icons/icon.ico" 42 | ] 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /templates/_base_/src-tauri/%(v2)%tauri.conf.json.lte: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.tauri.app/config/2", 3 | "productName": "{% package_name %}", 4 | "version": "0.1.0", 5 | "identifier": "{% identifier %}", 6 | "build": { 7 | {% if before_dev_command %}"beforeDevCommand": "{% before_dev_command %}", 8 | {% endif %}{% if dev_url %}"devUrl": "{% dev_url %}", 9 | {% endif %}{% if before_build_command %}"beforeBuildCommand": "{% before_build_command %}", 10 | {% endif %}"frontendDist": "{% frontend_dist %}" 11 | }, 12 | "app": { 13 | {% if with_global_tauri %}"withGlobalTauri": true, 14 | {% endif %}"windows": [ 15 | { 16 | "title": "{% package_name %}", 17 | "width": 800, 18 | "height": 600 19 | } 20 | ], 21 | "security": { 22 | "csp": null 23 | } 24 | }, 25 | "bundle": { 26 | "active": true, 27 | "targets": "all", 28 | "icon": [ 29 | "icons/32x32.png", 30 | "icons/128x128.png", 31 | "icons/128x128@2x.png", 32 | "icons/icon.icns", 33 | "icons/icon.ico" 34 | ] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /templates/_base_/src-tauri/Cargo.toml.lte: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "{% package_name %}" 3 | version = "0.1.0" 4 | description = "A Tauri App" 5 | authors = ["you"] 6 | edition = "2021" 7 | 8 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 | 10 | {% if v2 %}[lib] 11 | # The `_lib` suffix may seem redundant but it is necessary 12 | # to make the lib name unique and wouldn't conflict with the bin name. 13 | # This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519 14 | name = "{% lib_name %}" 15 | crate-type = ["staticlib", "cdylib", "rlib"] 16 | 17 | {% endif %}{% if v1 %}[build-dependencies] 18 | tauri-build = { version = "1", features = [] } 19 | 20 | [dependencies] 21 | tauri = { version = "1", features = ["shell-open"] }{% else %}[build-dependencies] 22 | tauri-build = { version = "2", features = [] } 23 | 24 | [dependencies] 25 | tauri = { version = "2", features = [] } 26 | tauri-plugin-opener = "2"{% endif %} 27 | serde = { version = "1", features = ["derive"] } 28 | serde_json = "1" 29 | {% if v1 %} 30 | [features] 31 | # This feature is used for production builds or when a dev server is not specified, DO NOT REMOVE!! 32 | custom-protocol = ["tauri/custom-protocol"]{% endif %} 33 | -------------------------------------------------------------------------------- /templates/_base_/src-tauri/_gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | /target/ 4 | 5 | # Generated by Tauri 6 | # will have schema files for capabilities auto-completion 7 | /gen/schemas 8 | -------------------------------------------------------------------------------- /templates/_base_/src-tauri/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | tauri_build::build() 3 | } 4 | -------------------------------------------------------------------------------- /templates/_base_/src-tauri/capabilities/%(v2)%default.json.lte: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "../gen/schemas/desktop-schema.json", 3 | "identifier": "default", 4 | "description": "Capability for the main window", 5 | "windows": ["main"], 6 | "permissions": [ 7 | "core:default", 8 | "opener:default" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /templates/_base_/src-tauri/icons/128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/_base_/src-tauri/icons/128x128.png -------------------------------------------------------------------------------- /templates/_base_/src-tauri/icons/128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/_base_/src-tauri/icons/128x128@2x.png -------------------------------------------------------------------------------- /templates/_base_/src-tauri/icons/32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/_base_/src-tauri/icons/32x32.png -------------------------------------------------------------------------------- /templates/_base_/src-tauri/icons/Square107x107Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/_base_/src-tauri/icons/Square107x107Logo.png -------------------------------------------------------------------------------- /templates/_base_/src-tauri/icons/Square142x142Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/_base_/src-tauri/icons/Square142x142Logo.png -------------------------------------------------------------------------------- /templates/_base_/src-tauri/icons/Square150x150Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/_base_/src-tauri/icons/Square150x150Logo.png -------------------------------------------------------------------------------- /templates/_base_/src-tauri/icons/Square284x284Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/_base_/src-tauri/icons/Square284x284Logo.png -------------------------------------------------------------------------------- /templates/_base_/src-tauri/icons/Square30x30Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/_base_/src-tauri/icons/Square30x30Logo.png -------------------------------------------------------------------------------- /templates/_base_/src-tauri/icons/Square310x310Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/_base_/src-tauri/icons/Square310x310Logo.png -------------------------------------------------------------------------------- /templates/_base_/src-tauri/icons/Square44x44Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/_base_/src-tauri/icons/Square44x44Logo.png -------------------------------------------------------------------------------- /templates/_base_/src-tauri/icons/Square71x71Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/_base_/src-tauri/icons/Square71x71Logo.png -------------------------------------------------------------------------------- /templates/_base_/src-tauri/icons/Square89x89Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/_base_/src-tauri/icons/Square89x89Logo.png -------------------------------------------------------------------------------- /templates/_base_/src-tauri/icons/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/_base_/src-tauri/icons/StoreLogo.png -------------------------------------------------------------------------------- /templates/_base_/src-tauri/icons/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/_base_/src-tauri/icons/icon.icns -------------------------------------------------------------------------------- /templates/_base_/src-tauri/icons/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/_base_/src-tauri/icons/icon.ico -------------------------------------------------------------------------------- /templates/_base_/src-tauri/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/_base_/src-tauri/icons/icon.png -------------------------------------------------------------------------------- /templates/_base_/src-tauri/src/%(v2)%lib.rs.lte: -------------------------------------------------------------------------------- 1 | // Learn more about Tauri commands at https://tauri.app/develop/calling-rust/ 2 | #[tauri::command] 3 | fn greet(name: &str) -> String { 4 | format!("Hello, {}! You've been greeted from Rust!", name) 5 | } 6 | 7 | #[cfg_attr(mobile, tauri::mobile_entry_point)] 8 | pub fn run() { 9 | tauri::Builder::default() 10 | .plugin(tauri_plugin_opener::init()) 11 | .invoke_handler(tauri::generate_handler![greet]) 12 | .run(tauri::generate_context!()) 13 | .expect("error while running tauri application"); 14 | } 15 | -------------------------------------------------------------------------------- /templates/_base_/src-tauri/src/main.rs.lte: -------------------------------------------------------------------------------- 1 | // Prevents additional console window on Windows in release, DO NOT REMOVE!! 2 | #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] 3 | 4 | {% if v2 %}fn main() { 5 | {% lib_name %}::run() 6 | }{% else %}// Learn more about Tauri commands at https://v1.tauri.app/v1/guides/features/command 7 | #[tauri::command] 8 | fn greet(name: &str) -> String { 9 | format!("Hello, {}! You've been greeted from Rust!", name) 10 | } 11 | 12 | fn main() { 13 | tauri::Builder::default() 14 | .invoke_handler(tauri::generate_handler![greet]) 15 | .run(tauri::generate_context!()) 16 | .expect("error while running tauri application"); 17 | }{% endif %} 18 | -------------------------------------------------------------------------------- /templates/template-angular/.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 %} start 6 | beforeBuildCommand = {% pkg_manager_run_command %} build 7 | devUrl = http://localhost:1420 8 | frontendDist = ../dist/{% package_name %}/browser 9 | 10 | [files] 11 | tauri.svg = src/assets/tauri.svg 12 | styles.css = src/app/app.component.css 13 | -------------------------------------------------------------------------------- /templates/template-angular/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "tauri-apps.tauri-vscode", 4 | "rust-lang.rust-analyzer", 5 | "angular.ng-template" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /templates/template-angular/README.md: -------------------------------------------------------------------------------- 1 | # Tauri + Angular 2 | 3 | This template should help get you started developing with Tauri and Angular. 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) + [Angular Language Service](https://marketplace.visualstudio.com/items?itemName=Angular.ng-template). 8 | -------------------------------------------------------------------------------- /templates/template-angular/_gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /templates/template-angular/angular.json.lte: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json", 3 | "version": 1, 4 | "newProjectRoot": "projects", 5 | "cli": { 6 | "analytics": false 7 | }, 8 | "projects": { 9 | "{% package_name %}": { 10 | "projectType": "application", 11 | "root": "", 12 | "sourceRoot": "src", 13 | "prefix": "app", 14 | "architect": { 15 | "build": { 16 | "builder": "@angular-devkit/build-angular:application", 17 | "options": { 18 | "outputPath": "dist/{% package_name %}", 19 | "index": "src/index.html", 20 | "browser": "src/main.ts", 21 | "polyfills": ["zone.js"], 22 | "tsConfig": "tsconfig.app.json", 23 | "assets": ["src/assets"] 24 | }, 25 | "configurations": { 26 | "production": { 27 | "budgets": [ 28 | { 29 | "type": "initial", 30 | "maximumWarning": "500kb", 31 | "maximumError": "1mb" 32 | }, 33 | { 34 | "type": "anyComponentStyle", 35 | "maximumWarning": "2kb", 36 | "maximumError": "4kb" 37 | } 38 | ], 39 | "outputHashing": "all" 40 | }, 41 | "development": { 42 | "optimization": false, 43 | "extractLicenses": false, 44 | "sourceMap": true 45 | } 46 | }, 47 | "defaultConfiguration": "production" 48 | }, 49 | "serve": { 50 | "builder": "@angular-devkit/build-angular:dev-server", 51 | "options": { 52 | "port": 1420 53 | }, 54 | "configurations": { 55 | "production": { 56 | "buildTarget": "{% package_name %}:build:production" 57 | }, 58 | "development": { 59 | "buildTarget": "{% package_name %}:build:development" 60 | } 61 | }, 62 | "defaultConfiguration": "development" 63 | } 64 | } 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /templates/template-angular/package.json.lte: -------------------------------------------------------------------------------- 1 | { 2 | "name": "{% package_name %}", 3 | "version": "0.1.0", 4 | "scripts": { 5 | "ng": "ng", 6 | "start": "ng serve", 7 | "build": "ng build", 8 | "watch": "ng build --watch --configuration development", 9 | "tauri": "tauri" 10 | }, 11 | "private": true, 12 | "dependencies": { 13 | "@angular/animations": "^17.0.0", 14 | "@angular/common": "^17.0.0", 15 | "@angular/compiler": "^17.0.0", 16 | "@angular/core": "^17.0.0", 17 | "@angular/forms": "^17.0.0", 18 | "@angular/platform-browser": "^17.0.0", 19 | "@angular/platform-browser-dynamic": "^17.0.0", 20 | "@angular/router": "^17.0.0", 21 | "rxjs": "~7.8.0", 22 | "tslib": "^2.3.0", 23 | "zone.js": "~0.14.2", 24 | "@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %}, 25 | "@tauri-apps/plugin-opener": "^2"{% endif %} 26 | }, 27 | "devDependencies": { 28 | "@angular-devkit/build-angular": "^17.0.0", 29 | "@angular/cli": "^17.0.0", 30 | "@angular/compiler-cli": "^17.0.0", 31 | "@types/jasmine": "~5.1.0", 32 | "jasmine-core": "~5.1.0", 33 | "karma": "~6.4.0", 34 | "karma-chrome-launcher": "~3.2.0", 35 | "karma-coverage": "~2.2.0", 36 | "karma-jasmine": "~5.1.0", 37 | "karma-jasmine-html-reporter": "~2.1.0", 38 | "typescript": "~5.4.0", 39 | "@tauri-apps/cli": "{% if v2 %}^2{% else %}^1{% endif %}" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /templates/template-angular/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | .logo.angular:hover { 2 | filter: drop-shadow(0 0 2em #e32727); 3 | } 4 | -------------------------------------------------------------------------------- /templates/template-angular/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 |

Welcome to Tauri + Angular!

3 | 4 | 12 |

Click on the logos to learn more about the frameworks

13 | 14 |
15 | 16 | 17 |
18 |

{{ greetingMessage }}

19 |
20 | -------------------------------------------------------------------------------- /templates/template-angular/src/app/app.component.ts.lte: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { RouterOutlet } from '@angular/router'; 4 | import { invoke } from "@tauri-apps/api/{% if v2 %}core{% else %}tauri{% endif %}"; 5 | 6 | @Component({ 7 | selector: 'app-root', 8 | standalone: true, 9 | imports: [CommonModule, RouterOutlet], 10 | templateUrl: './app.component.html', 11 | styleUrl: './app.component.css' 12 | }) 13 | export class AppComponent { 14 | greetingMessage = ""; 15 | 16 | greet(event: SubmitEvent, name: string): void { 17 | event.preventDefault(); 18 | 19 | // Learn more about Tauri commands at {% if v2 %}https://tauri.app/develop/calling-rust/{% else %}https://v1.tauri.app/v1/guides/features/command{% endif %} 20 | invoke("greet", { name }).then((text) => { 21 | this.greetingMessage = text; 22 | }); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /templates/template-angular/src/app/app.config.ts: -------------------------------------------------------------------------------- 1 | import { ApplicationConfig } from "@angular/core"; 2 | import { provideRouter } from "@angular/router"; 3 | 4 | import { routes } from "./app.routes"; 5 | 6 | export const appConfig: ApplicationConfig = { 7 | providers: [provideRouter(routes)], 8 | }; 9 | -------------------------------------------------------------------------------- /templates/template-angular/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import { Routes } from "@angular/router"; 2 | 3 | export const routes: Routes = []; 4 | -------------------------------------------------------------------------------- /templates/template-angular/src/assets/angular.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 10 | 11 | 12 | 13 | 15 | 16 | -------------------------------------------------------------------------------- /templates/template-angular/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Tauri + Angular 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /templates/template-angular/src/main.ts: -------------------------------------------------------------------------------- 1 | import { bootstrapApplication } from "@angular/platform-browser"; 2 | import { appConfig } from "./app/app.config"; 3 | import { AppComponent } from "./app/app.component"; 4 | 5 | bootstrapApplication(AppComponent, appConfig).catch((err) => 6 | console.error(err), 7 | ); 8 | -------------------------------------------------------------------------------- /templates/template-angular/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": ["src/main.ts"], 9 | "include": ["src/**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /templates/template-angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "outDir": "./dist/out-tsc", 6 | "forceConsistentCasingInFileNames": true, 7 | "strict": true, 8 | "noImplicitOverride": true, 9 | "noPropertyAccessFromIndexSignature": true, 10 | "noImplicitReturns": true, 11 | "noFallthroughCasesInSwitch": true, 12 | "skipLibCheck": true, 13 | "esModuleInterop": true, 14 | "sourceMap": true, 15 | "declaration": false, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "bundler", 18 | "importHelpers": true, 19 | "target": "ES2022", 20 | "module": "ES2022", 21 | "useDefineForClassFields": false, 22 | "lib": ["ES2022", "dom"] 23 | }, 24 | "angularCompilerOptions": { 25 | "enableI18nLegacyMessageIdFormat": false, 26 | "strictInjectionParameters": true, 27 | "strictInputAccessModifiers": true, 28 | "strictTemplates": true 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /templates/template-blazor/.manifest: -------------------------------------------------------------------------------- 1 | beforeDevCommand = dotnet watch run --project src/{% project_name_pascal_case %}.csproj 2 | beforeBuildCommand = dotnet publish -c release src/{% project_name_pascal_case %}.csproj -o dist 3 | devUrl = http://localhost:1420 4 | frontendDist = ../dist/wwwroot 5 | withGlobalTauri = true 6 | 7 | [files] 8 | styles.css = src/wwwroot/css/app.css 9 | tauri.svg = src/wwwroot/img/tauri.svg -------------------------------------------------------------------------------- /templates/template-blazor/src/App.razor: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | Not found 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 | -------------------------------------------------------------------------------- /templates/template-blazor/src/Pages/Home.razor.lte: -------------------------------------------------------------------------------- 1 | @page "/" 2 | @inject IJSRuntime JsRuntime 3 | 4 |
5 |

Welcome to Tauri + Blazor

6 | 7 | 15 |

Click on the Tauri and Blazor logos to learn more.

16 | 17 |
18 | 19 | 20 |
21 |

@GreetMsg

22 |
23 | 24 | @code 25 | { 26 | private string? GreetInput { get; set; } 27 | 28 | private string? GreetMsg { get; set; } 29 | 30 | private async Task GreetAsync() 31 | { 32 | GreetMsg = await JsRuntime.InvokeAsync("__TAURI__.{% if v2 %}core{% else %}tauri{% endif %}.invoke", "greet", new { name = GreetInput }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /templates/template-blazor/src/Program.cs.lte: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components.Web; 2 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 3 | using {% project_name_pascal_case %}; 4 | 5 | var builder = WebAssemblyHostBuilder.CreateDefault(args); 6 | builder.RootComponents.Add("#app"); 7 | builder.RootComponents.Add("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 |
57 | 62 | 63 |
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 |
{ 35 | e.preventDefault(); 36 | greet(); 37 | }} 38 | > 39 | setName(e.currentTarget.value)} 42 | placeholder="Enter a name..." 43 | /> 44 | 45 |
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 |
{ 35 | e.preventDefault(); 36 | greet(); 37 | }} 38 | > 39 | setName(e.currentTarget.value)} 42 | placeholder="Enter a name..." 43 | /> 44 | 45 |
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 |
{ 35 | e.preventDefault(); 36 | greet(); 37 | }} 38 | > 39 | setName(e.currentTarget.value)} 42 | placeholder="Enter a name..." 43 | /> 44 | 45 |
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 |
{ 35 | e.preventDefault(); 36 | greet(); 37 | }} 38 | > 39 | setName(e.currentTarget.value)} 42 | placeholder="Enter a name..." 43 | /> 44 | 45 |
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 | 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 |
{ 35 | e.preventDefault(); 36 | greet(); 37 | }} 38 | > 39 | setName(e.currentTarget.value)} 42 | placeholder="Enter a name..." 43 | /> 44 | 45 |
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 | 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 |
{ 35 | e.preventDefault(); 36 | greet(); 37 | }} 38 | > 39 | setName(e.currentTarget.value)} 42 | placeholder="Enter a name..." 43 | /> 44 | 45 |
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 |
31 | 32 | 33 |
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 |
31 | 32 | 33 |
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 |
37 | 38 | 39 |
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 |
33 | 34 | 35 |
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 | 14 | 15 | -------------------------------------------------------------------------------- /templates/template-vue-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": "vue-tsc --noEmit && vite build", 9 | "preview": "vite preview", 10 | "tauri": "tauri" 11 | }, 12 | "dependencies": { 13 | "vue": "^3.5.13", 14 | "@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %}, 15 | "@tauri-apps/plugin-opener": "^2"{% endif %} 16 | }, 17 | "devDependencies": { 18 | "@vitejs/plugin-vue": "^5.2.1", 19 | "typescript": "~5.6.2", 20 | "vite": "^6.0.3", 21 | "vue-tsc": "^2.1.10", 22 | "@tauri-apps/cli": "{% if v2 %}^2{% else %}^1{% endif %}" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /templates/template-vue-ts/src/App.vue.lte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 38 | 39 | 49 | -------------------------------------------------------------------------------- /templates/template-vue-ts/src/main.ts: -------------------------------------------------------------------------------- 1 | import { createApp } from "vue"; 2 | import App from "./App.vue"; 3 | 4 | createApp(App).mount("#app"); 5 | -------------------------------------------------------------------------------- /templates/template-vue-ts/src/vite-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | declare module "*.vue" { 4 | import type { DefineComponent } from "vue"; 5 | const component: DefineComponent<{}, {}, any>; 6 | export default component; 7 | } 8 | -------------------------------------------------------------------------------- /templates/template-vue-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 | 17 | /* Linting */ 18 | "strict": true, 19 | "noUnusedLocals": true, 20 | "noUnusedParameters": true, 21 | "noFallthroughCasesInSwitch": true 22 | }, 23 | "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], 24 | "references": [{ "path": "./tsconfig.node.json" }] 25 | } 26 | -------------------------------------------------------------------------------- /templates/template-vue-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-vue-ts/vite.config.ts.lte: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "vite"; 2 | import vue from "@vitejs/plugin-vue";{% 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: [vue()], 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-vue/.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/.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/README.md: -------------------------------------------------------------------------------- 1 | # Tauri + Vue 3 2 | 3 | This template should help get you started developing with Tauri + Vue 3 in Vite. The template uses Vue 3 ` 13 | 14 | 15 | -------------------------------------------------------------------------------- /templates/template-vue/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 | "vue": "^3.5.13", 14 | "@tauri-apps/api": "{% if v2 %}^2{% else %}^1{% endif %}"{% if v2 %}, 15 | "@tauri-apps/plugin-opener": "^2"{% endif %} 16 | }, 17 | "devDependencies": { 18 | "@vitejs/plugin-vue": "^5.2.1", 19 | "vite": "^6.0.3", 20 | "@tauri-apps/cli": "{% if v2 %}^2{% else %}^1{% endif %}" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /templates/template-vue/src/App.vue.lte: -------------------------------------------------------------------------------- 1 | 13 | 14 | 38 | 39 | 49 | 52 | -------------------------------------------------------------------------------- /templates/template-vue/src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from "vue"; 2 | import App from "./App.vue"; 3 | 4 | createApp(App).mount("#app"); 5 | -------------------------------------------------------------------------------- /templates/template-vue/vite.config.js.lte: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "vite"; 2 | import vue from "@vitejs/plugin-vue";{% 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: [vue()], 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-yew/.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-yew/.taurignore: -------------------------------------------------------------------------------- 1 | /src 2 | /public 3 | /Cargo.toml -------------------------------------------------------------------------------- /templates/template-yew/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"] 3 | } 4 | -------------------------------------------------------------------------------- /templates/template-yew/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "emmet.includeLanguages": { 3 | "rust": "html" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /templates/template-yew/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 | yew = { version = "0.21", features = ["csr"] } 9 | wasm-bindgen = "0.2" 10 | wasm-bindgen-futures = "0.4" 11 | web-sys = "0.3" 12 | js-sys = "0.3" 13 | serde = { version = "1", features = ["derive"] } 14 | serde-wasm-bindgen = "0.6" 15 | console_error_panic_hook = "0.1.7" 16 | 17 | [workspace] 18 | members = ["src-tauri"] 19 | -------------------------------------------------------------------------------- /templates/template-yew/README.md: -------------------------------------------------------------------------------- 1 | # Tauri + Yew 2 | 3 | This template should help get you started developing with Tauri and Yew. 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-yew/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-yew/_gitignore: -------------------------------------------------------------------------------- 1 | /dist/ 2 | /target/ 3 | /Cargo.lock 4 | -------------------------------------------------------------------------------- /templates/template-yew/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Tauri + Yew App 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /templates/template-yew/public/yew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tauri-apps/create-tauri-app/db3ccf47a0a812f36d896881e68a5e43b0a5e79d/templates/template-yew/public/yew.png -------------------------------------------------------------------------------- /templates/template-yew/src/app.rs.lte: -------------------------------------------------------------------------------- 1 | use serde::{Deserialize, Serialize}; 2 | use wasm_bindgen::prelude::*; 3 | use wasm_bindgen_futures::spawn_local; 4 | use yew::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 | #[function_component(App)] 18 | pub fn app() -> Html { 19 | let greet_input_ref = use_node_ref(); 20 | 21 | let name = use_state(|| String::new()); 22 | 23 | let greet_msg = use_state(|| String::new()); 24 | { 25 | let greet_msg = greet_msg.clone(); 26 | let name = name.clone(); 27 | let name2 = name.clone(); 28 | use_effect_with( 29 | name2, 30 | move |_| { 31 | spawn_local(async move { 32 | if name.is_empty() { 33 | return; 34 | } 35 | 36 | let args = serde_wasm_bindgen::to_value(&GreetArgs { name: &*name }).unwrap(); 37 | // Learn more about Tauri commands at {% if v2 %}https://tauri.app/develop/calling-rust/{% else %}https://v1.tauri.app/v1/guides/features/command{% endif %} 38 | let new_msg = invoke("greet", args).await.as_string().unwrap(); 39 | greet_msg.set(new_msg); 40 | }); 41 | 42 | || {} 43 | }, 44 | ); 45 | } 46 | 47 | let greet = { 48 | let name = name.clone(); 49 | let greet_input_ref = greet_input_ref.clone(); 50 | Callback::from(move |e: SubmitEvent| { 51 | e.prevent_default(); 52 | name.set( 53 | greet_input_ref 54 | .cast::() 55 | .unwrap() 56 | .value(), 57 | ); 58 | }) 59 | }; 60 | 61 | html! { 62 |
63 |

{"Welcome to Tauri + Yew"}

64 | 65 | 73 |

{"Click on the Tauri and Yew logos to learn more."}

74 | 75 |
76 | 77 | 78 |
79 |

{ &*greet_msg }

80 |
81 | } 82 | } 83 | -------------------------------------------------------------------------------- /templates/template-yew/src/main.rs: -------------------------------------------------------------------------------- 1 | mod app; 2 | 3 | use app::App; 4 | 5 | fn main() { 6 | console_error_panic_hook::set_once(); 7 | yew::Renderer::::new().render(); 8 | } 9 | -------------------------------------------------------------------------------- /templates/template-yew/styles.css: -------------------------------------------------------------------------------- 1 | .logo.yew:hover { 2 | filter: drop-shadow(0 0 2em #20a88a); 3 | } 4 | -------------------------------------------------------------------------------- /worker/.gitignore: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | # SPDX-License-Identifier: Apache-2.0 3 | # SPDX-License-Identifier: MIT 4 | 5 | /node_modules -------------------------------------------------------------------------------- /worker/README.md: -------------------------------------------------------------------------------- 1 | # create.tauri.app worker 2 | 3 | Source code for `https://create.tauri.app` cloudflare worker. 4 | -------------------------------------------------------------------------------- /worker/index.html: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | create-tauri-app 12 | 13 | 14 | 15 |

Index of create-tauri-app scripts

16 |
17 |
18 | create-tauri-app.sh
19 | create-tauri-app.ps1
20 |     
21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /worker/index.js: -------------------------------------------------------------------------------- 1 | // Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | // SPDX-License-Identifier: Apache-2.0 3 | // SPDX-License-Identifier: MIT 4 | 5 | import sh from "./scripts/create-tauri-app.sh"; 6 | import ps from "./scripts/create-tauri-app.ps1"; 7 | import index from "./index.html"; 8 | 9 | export default { 10 | async fetch(request) { 11 | const { pathname, searchParams } = new URL(request.url); 12 | 13 | if (pathname.startsWith("/sh")) { 14 | return new Response(sh, { 15 | headers: { "Content-Type": "text/plain" }, 16 | }); 17 | } 18 | 19 | if (pathname.startsWith("/ps")) { 20 | return new Response(ps, { 21 | headers: { "Content-Type": "text/plain" }, 22 | }); 23 | } 24 | 25 | if (pathname.startsWith("/v")) { 26 | const [, version, script] = /^\/v\/(.+?)\/(sh|ps)/g.exec(pathname); 27 | const ext = script === "ps" ? "ps1" : "sh"; 28 | 29 | const res = await fetch( 30 | `https://github.com/tauri-apps/create-tauri-app/releases/download/create-tauri-app-v${version}/create-tauri-app.${ext}`, 31 | ); 32 | 33 | return new Response(await res.text(), { 34 | headers: { "Content-Type": "text/plain" }, 35 | }); 36 | } 37 | 38 | if (pathname.startsWith("/download/bin")) { 39 | const tag = searchParams.get("tag"); 40 | const arch = searchParams.get("arch"); 41 | const ext = searchParams.get("ext"); 42 | 43 | const res = await fetch( 44 | `https://github.com/tauri-apps/create-tauri-app/releases/download/${tag}/create-tauri-app-${arch}${ext}`, 45 | ); 46 | 47 | return new Response(await res.arrayBuffer(), { 48 | headers: { 49 | "Content-Type": "application/octet-stream", 50 | "Content-disposition": `attachment; filename=create-taui-app${searchParams.get( 51 | "ext", 52 | )}`, 53 | }, 54 | }); 55 | } 56 | 57 | return new Response(index, { 58 | headers: { "Content-Type": "text/html" }, 59 | }); 60 | }, 61 | }; 62 | -------------------------------------------------------------------------------- /worker/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "create-tauri-app-worker", 3 | "version": "0.0.0", 4 | "license": "Apache-2.0 OR MIT", 5 | "devDependencies": { 6 | "wrangler": "^3.74" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /worker/scripts/READEME.md: -------------------------------------------------------------------------------- 1 | DON NOT MODIFY THESE SCRIPTS DIRECTLY. 2 | 3 | These scripts are updated automatically when a new version is released. 4 | The scripts are copied over from the repo root to this location, see `covector` [config](../../../.changes/config.json). 5 | -------------------------------------------------------------------------------- /worker/scripts/create-tauri-app.ps1: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | # SPDX-License-Identifier: Apache-2.0 3 | # SPDX-License-Identifier: MIT 4 | 5 | $bitness = if ([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture -eq "X64") { 6 | "x86_64" 7 | } elseif ([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture -eq "Arm64") { 8 | "aarch64" 9 | } else { 10 | "i686" 11 | } 12 | $__TAG_NAME__ = "create-tauri-app-v4.5.10" 13 | # $url="https://github.com/tauri-apps/create-tauri-app/releases/download/$__TAG_NAME__/create-tauri-app-$bitness-pc-windows-msvc.exe" 14 | $url="https://create.tauri.app/download/bin?tag=$__TAG_NAME__&arch=$bitness-pc-windows-msvc&ext=.exe" 15 | $outFile = "$Env:TEMP\create-tauri-app.exe" 16 | 17 | Write-Output "$($PSStyle.Bold)$($PSStyle.Foreground.Green)info:$($PSStyle.Reset) downloading create-tauri-app" 18 | 19 | $oldProgressPreference = $ProgressPreference 20 | $ProgressPreference = 'SilentlyContinue' 21 | Invoke-WebRequest -Uri $url -OutFile $outFile 22 | $ProgressPreference = $oldProgressPreference 23 | 24 | if ($Env:CTA_ARGS) { 25 | Start-Process -FilePath $outFile -Wait -NoNewWindow -ArgumentList "$Env:CTA_ARGS" 26 | } else { 27 | Start-Process -FilePath $outFile -Wait -NoNewWindow 28 | } 29 | -------------------------------------------------------------------------------- /worker/wrangler.toml: -------------------------------------------------------------------------------- 1 | # Copyright 2019-2022 Tauri Programme within The Commons Conservancy 2 | # SPDX-License-Identifier: Apache-2.0 3 | # SPDX-License-Identifier: MIT 4 | 5 | name = "create-tauri-app" 6 | main = "index.js" 7 | compatibility_date = "2022-08-04" 8 | 9 | [[rules]] 10 | type = "Text" 11 | globs = ["**/*.sh", "**/*.ps1", "index.html"] 12 | fallthrough = true 13 | --------------------------------------------------------------------------------