├── src ├── views │ └── Home.vue ├── store │ └── store.js ├── main.js ├── plugins │ └── router.js └── App.vue ├── src-tauri ├── build.rs ├── .gitignore ├── icons │ ├── 32x32.png │ ├── icon.icns │ ├── icon.ico │ ├── icon.png │ ├── 128x128.png │ ├── 128x128@2x.png │ ├── StoreLogo.png │ ├── Square30x30Logo.png │ ├── Square44x44Logo.png │ ├── Square71x71Logo.png │ ├── Square89x89Logo.png │ ├── Square107x107Logo.png │ ├── Square142x142Logo.png │ ├── Square150x150Logo.png │ ├── Square284x284Logo.png │ └── Square310x310Logo.png ├── src │ └── main.rs ├── Cargo.toml └── tauri.conf.json ├── .vscode └── extensions.json ├── .gitignore ├── index.html ├── package.json ├── vite.config.js ├── README.md └── .github └── workflows └── tauri-release.yml /src/views/Home.vue: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src-tauri/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | tauri_build::build() 3 | } 4 | -------------------------------------------------------------------------------- /src-tauri/.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | /target/ 4 | 5 | -------------------------------------------------------------------------------- /src-tauri/icons/32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skymen/tauri-vue-template/HEAD/src-tauri/icons/32x32.png -------------------------------------------------------------------------------- /src-tauri/icons/icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skymen/tauri-vue-template/HEAD/src-tauri/icons/icon.icns -------------------------------------------------------------------------------- /src-tauri/icons/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skymen/tauri-vue-template/HEAD/src-tauri/icons/icon.ico -------------------------------------------------------------------------------- /src-tauri/icons/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skymen/tauri-vue-template/HEAD/src-tauri/icons/icon.png -------------------------------------------------------------------------------- /src-tauri/icons/128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skymen/tauri-vue-template/HEAD/src-tauri/icons/128x128.png -------------------------------------------------------------------------------- /src-tauri/icons/128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skymen/tauri-vue-template/HEAD/src-tauri/icons/128x128@2x.png -------------------------------------------------------------------------------- /src-tauri/icons/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skymen/tauri-vue-template/HEAD/src-tauri/icons/StoreLogo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square30x30Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skymen/tauri-vue-template/HEAD/src-tauri/icons/Square30x30Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square44x44Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skymen/tauri-vue-template/HEAD/src-tauri/icons/Square44x44Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square71x71Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skymen/tauri-vue-template/HEAD/src-tauri/icons/Square71x71Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square89x89Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skymen/tauri-vue-template/HEAD/src-tauri/icons/Square89x89Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square107x107Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skymen/tauri-vue-template/HEAD/src-tauri/icons/Square107x107Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square142x142Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skymen/tauri-vue-template/HEAD/src-tauri/icons/Square142x142Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square150x150Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skymen/tauri-vue-template/HEAD/src-tauri/icons/Square150x150Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square284x284Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skymen/tauri-vue-template/HEAD/src-tauri/icons/Square284x284Logo.png -------------------------------------------------------------------------------- /src-tauri/icons/Square310x310Logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/skymen/tauri-vue-template/HEAD/src-tauri/icons/Square310x310Logo.png -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "Vue.volar", 4 | "tauri-apps.tauri-vscode", 5 | "rust-lang.rust-analyzer" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /src/store/store.js: -------------------------------------------------------------------------------- 1 | import { defineStore } from "pinia"; 2 | 3 | export const useStore = defineStore("main", { 4 | state: () => ({}), 5 | getters: {}, 6 | actions: {}, 7 | }); 8 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from "vue"; 2 | import { createPinia } from "pinia"; 3 | import App from "./App.vue"; 4 | import { router } from "./plugins/router.js"; 5 | 6 | const pinia = createPinia(); 7 | const app = createApp(App); 8 | 9 | app.use(pinia); 10 | app.use(router); 11 | 12 | app.mount("#app"); 13 | -------------------------------------------------------------------------------- /src/plugins/router.js: -------------------------------------------------------------------------------- 1 | import { createRouter, createWebHistory } from "vue-router"; 2 | 3 | const routes = [ 4 | { 5 | path: "/", 6 | name: "Home", 7 | component: () => import("../views/Home.vue"), 8 | }, 9 | ]; 10 | 11 | const router = createRouter({ 12 | history: createWebHistory(), 13 | routes, 14 | }); 15 | 16 | export { routes, router }; 17 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Tauri + Vue 3 App 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tauri-template", 3 | "private": true, 4 | "version": "0.0.0", 5 | "type": "module", 6 | "scripts": { 7 | "dev": "vite", 8 | "build": "vite build", 9 | "preview": "vite preview", 10 | "tauri": "tauri" 11 | }, 12 | "dependencies": { 13 | "@tauri-apps/api": "^1.4.0", 14 | "pinia": "^2.1.6", 15 | "vue": "^3.3.4", 16 | "vue-router": "^4.2.4" 17 | }, 18 | "devDependencies": { 19 | "@tauri-apps/cli": "^1.4.0", 20 | "@vitejs/plugin-vue": "^4.2.3", 21 | "vite": "^4.4.4" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src-tauri/src/main.rs: -------------------------------------------------------------------------------- 1 | // Prevents additional console window on Windows in release, DO NOT REMOVE!! 2 | #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] 3 | 4 | // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command 5 | #[tauri::command] 6 | fn greet(name: &str) -> String { 7 | format!("Hello, {}! You've been greeted from Rust!", name) 8 | } 9 | 10 | fn main() { 11 | tauri::Builder::default() 12 | .invoke_handler(tauri::generate_handler![greet]) 13 | .run(tauri::generate_context!()) 14 | .expect("error while running tauri application"); 15 | } 16 | -------------------------------------------------------------------------------- /src-tauri/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tauri-template" 3 | version = "0.0.0" 4 | description = "A Tauri App" 5 | authors = ["you"] 6 | license = "" 7 | repository = "" 8 | edition = "2021" 9 | 10 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 11 | 12 | [build-dependencies] 13 | tauri-build = { version = "1.4", features = [] } 14 | 15 | [dependencies] 16 | tauri = { version = "1.4", features = ["shell-open"] } 17 | serde = { version = "1.0", features = ["derive"] } 18 | serde_json = "1.0" 19 | 20 | [features] 21 | # this feature is used for production builds or when `devPath` points to the filesystem 22 | # DO NOT REMOVE!! 23 | custom-protocol = ["tauri/custom-protocol"] 24 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from "vite"; 2 | import vue from "@vitejs/plugin-vue"; 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig(async () => ({ 6 | plugins: [vue()], 7 | 8 | // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build` 9 | // 10 | // 1. prevent vite from obscuring rust errors 11 | clearScreen: false, 12 | // 2. tauri expects a fixed port, fail if that port is not available 13 | server: { 14 | port: 1420, 15 | strictPort: true, 16 | }, 17 | // 3. to make use of `TAURI_DEBUG` and other env variables 18 | // https://tauri.studio/v1/api/config#buildconfig.beforedevcommand 19 | envPrefix: ["VITE_", "TAURI_"], 20 | })); 21 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 47 | -------------------------------------------------------------------------------- /src-tauri/tauri.conf.json: -------------------------------------------------------------------------------- 1 | { 2 | "build": { 3 | "beforeDevCommand": "npm run dev", 4 | "beforeBuildCommand": "npm run build", 5 | "devPath": "http://localhost:1420", 6 | "distDir": "../dist", 7 | "withGlobalTauri": false 8 | }, 9 | "package": { 10 | "productName": "tauri-template", 11 | "version": "0.0.0" 12 | }, 13 | "tauri": { 14 | "allowlist": { 15 | "all": false, 16 | "shell": { 17 | "all": false, 18 | "open": true 19 | } 20 | }, 21 | "bundle": { 22 | "active": true, 23 | "targets": "all", 24 | "identifier": "com.tauri.dev", 25 | "icon": [ 26 | "icons/32x32.png", 27 | "icons/128x128.png", 28 | "icons/128x128@2x.png", 29 | "icons/icon.icns", 30 | "icons/icon.ico" 31 | ] 32 | }, 33 | "security": { 34 | "csp": null 35 | }, 36 | "windows": [ 37 | { 38 | "fullscreen": false, 39 | "resizable": true, 40 | "center": true, 41 | "title": "tauri-template", 42 | "width": 800, 43 | "height": 600 44 | } 45 | ], 46 | "updater": { 47 | "active": true, 48 | "endpoints": [ 49 | "https://raw.githubusercontent.com///update/latest.json" 50 | ], 51 | "dialog": true, 52 | "pubkey": "generate updater key: https://tauri.app/v1/guides/distribution/updater/", 53 | "windows": { 54 | "installMode": "passive" 55 | } 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | Download the app from the releases page and run it. 4 | 5 | https://github.com/skymen/construct-crawler/releases/latest 6 | 7 | Note that opening a project as a c3p file does not apply the changes to the c3p. 8 | To actually apply the changes, you need to save the project as a project folder before opening it. 9 | 10 | # Development prerequisites 11 | 12 | ## Github Action 13 | 14 | You need to enable the github actions write authorization for the repository. This is needed to publish the releases and to create a branch for the updater. 15 | 16 | ## Updater 17 | 18 | Generate a publication key, add the private key to the repository secrets as `TAURI_PRIVATE_KEY` and add the public key to tauri.config.json as `updater/pubkey`. 19 | Also, change the endpoint to the correct name/repo in tauri.config.json. 20 | 21 | ## App name 22 | 23 | I have no idea how to properly change the name of the app when cloning it from this repo to a new one. Good luck!!! 24 | 25 | # Tech stack 26 | 27 | This template uses the following technologies: 28 | 29 | - [Vue 3](https://v3.vuejs.org/) 30 | - [Vite](https://vitejs.dev/) 31 | - [Tauri](https://tauri.studio/) 32 | - [Pinia](https://pinia.esm.dev/) 33 | - [Vue Router](https://next.router.vuejs.org/) 34 | 35 | It also includes the following features: 36 | 37 | - Auto publish release when committing to the `main` branch 38 | - Automatically support tauri's auto updater by generating and uploading the latest.json file to a separate branch 39 | - Template comes preinstalled and preconfigured with Pinia and Vue Router 40 | 41 | ## Recommended IDE Setup 42 | 43 | - [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) 44 | -------------------------------------------------------------------------------- /.github/workflows/tauri-release.yml: -------------------------------------------------------------------------------- 1 | name: "publish" 2 | on: 3 | push: 4 | branches: 5 | - main 6 | 7 | jobs: 8 | publishtauri: 9 | permissions: 10 | contents: write 11 | strategy: 12 | fail-fast: false 13 | matrix: 14 | platform: [macos-latest, ubuntu-20.04, windows-latest] 15 | 16 | runs-on: ${{ matrix.platform }} 17 | 18 | outputs: 19 | releaseId: ${{ steps.tauri.outputs.releaseHtmlUrl }} 20 | steps: 21 | - uses: actions/checkout@v3 22 | - name: setup node 23 | uses: actions/setup-node@v3 24 | with: 25 | node-version: 16 26 | - name: install Rust stable 27 | uses: dtolnay/rust-toolchain@stable 28 | - name: Export variable (unix) 29 | if: matrix.platform != 'windows-latest' 30 | run: echo "TAURI_PRIVATE_KEY=${{ secrets.TAURI_PRIVATE_KEY }}" >> $GITHUB_ENV 31 | - name: Export variable (windows) 32 | if: matrix.platform == 'windows-latest' 33 | run: echo "TAURI_PRIVATE_KEY=${{ secrets.TAURI_PRIVATE_KEY }}" >> $GITHUB_ENV 34 | shell: bash 35 | - name: install dependencies (ubuntu only) 36 | if: matrix.platform == 'ubuntu-20.04' 37 | run: | 38 | sudo apt-get update 39 | sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf 40 | - name: install frontend dependencies 41 | run: yarn install # change this to npm or pnpm depending on which one you use 42 | - uses: tauri-apps/tauri-action@v0 43 | id: tauri 44 | env: 45 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 46 | with: 47 | tagName: v__VERSION__ # the action automatically replaces __VERSION__ with the app version 48 | releaseName: "v__VERSION__" 49 | releaseBody: "See the assets to download this version and install." 50 | releaseDraft: false 51 | prerelease: false 52 | includeUpdaterJson: true 53 | updaterJsonPreferNsis: true 54 | includeDebug: false 55 | includeRelease: true 56 | 57 | update-json: 58 | runs-on: ubuntu-latest 59 | needs: publishtauri 60 | steps: 61 | - name: Checkout code 62 | uses: actions/checkout@v2 63 | - name: Configure Git 64 | run: | 65 | git config user.name "GitHub Action" 66 | git config user.email "action@github.com" 67 | - name: Create or checkout branch 68 | run: | 69 | git checkout "update" || git checkout --orphan "update" 70 | - name: Remove all files 71 | run: | 72 | git rm -rf . 73 | - name: Fetch JSON file 74 | env: 75 | RELEASE_ID: ${{needs.publishtauri.outputs.releaseId}} 76 | run: | 77 | echo "$RELEASE_ID" 78 | RELEASE_TAG=$(basename $RELEASE_ID) 79 | echo "$RELEASE_TAG" 80 | RELEASE_URL="https://github.com/skymen/construct-crawler/releases/download/$RELEASE_TAG/latest.json" 81 | echo "$RELEASE_URL" 82 | curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3.raw" -o latest.json -L "$RELEASE_URL" 83 | cat latest.json 84 | - name: Commit and push changes 85 | run: | 86 | git add latest.json 87 | git commit -m "Update latest.json" 88 | git push -u origin update --force 89 | --------------------------------------------------------------------------------