From b336baae0a8de1d4807a4b39d9541f07f6ec6ce0 Mon Sep 17 00:00:00 2001 From: Aryan Jain Date: Wed, 5 Mar 2025 17:05:43 +0530 Subject: [PATCH 1/4] ci: tauri-relese --- .github/workflows/tauri-release.yml | 61 +++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/tauri-release.yml diff --git a/.github/workflows/tauri-release.yml b/.github/workflows/tauri-release.yml new file mode 100644 index 00000000..e4ff3258 --- /dev/null +++ b/.github/workflows/tauri-release.yml @@ -0,0 +1,61 @@ +name: Vue Simulator Desktop Release + +on: + push: + branches: [ "main" ] + release: + types: [created] + +jobs: + build-tauri: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + + steps: + - name: Checkout repository + uses: actions/checkout@v3 +# node 22 is been used in circuitverse primary code base. + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Install Dependencies (Vue + Tauri CLI) + run: | + npm install + npm install -g @tauri-apps/cli + working-directory: ./src + + - name: Build Frontend (Vue) + run: | + npm run build + working-directory: ./src + + - name: Setup Rust + if: matrix.os != 'windows-latest' + run: | + rustup update stable + rustup default stable + + - name: Cache Rust Dependencies + uses: Swatinem/rust-cache@v2 + + - name: Build Tauri App + uses: tauri-apps/tauri-action@v0 + with: + projectPath: ./src-tauri + tagName: ${{ github.ref_name }} + releaseName: "Tauri Desktop Release ${{ github.ref_name }}" + releaseBody: "See the assets below to download this release." + releaseDraft: false + prerelease: false + + - name: Upload Tauri Build Artifacts + uses: actions/upload-artifact@v4 + with: + name: Tauri Build Artifacts (${{ matrix.os }}) + path: | + src-tauri/target/release/bundle From 89d0dc18e75f5f4b412e77eecd2e61c732b219b9 Mon Sep 17 00:00:00 2001 From: Aryan Jain Date: Mon, 10 Mar 2025 23:03:56 +0530 Subject: [PATCH 2/4] refactor: navbar toggle on mobile by updating Hamburger component and navbar structure --- v0/src/components/Navbar/Navbar.vue | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/v0/src/components/Navbar/Navbar.vue b/v0/src/components/Navbar/Navbar.vue index caeec961..e18f2bd8 100644 --- a/v0/src/components/Navbar/Navbar.vue +++ b/v0/src/components/Navbar/Navbar.vue @@ -1,14 +1,27 @@ + ', + }, + }, + }), + ], + resolve: { + alias: { + '#': fileURLToPath(new URL(`./v0/src`, import.meta.url)), + '@': fileURLToPath(new URL(`./v0/src/components`, import.meta.url)), + }, + }, + base: process.env.DESKTOP_MODE ? '/' : '/simulatorvue/v0/', + build: { + outDir: './dist', + assetsDir: 'assets', + chunkSizeWarningLimit: 1600, + rollupOptions: { + input: { + main: fileURLToPath(new URL('index-cv.html', import.meta.url)) + } + } + + }, + server: { + port: 4000, + proxy: { + // ...(process.env.NODE_ENV === 'development' && { + '^/(?!(simulatorvue)).*': { + target: proxyUrl, + changeOrigin: true, + headers: { + origin: proxyUrl, + }, + }, + // }), + }, + }, +}) \ No newline at end of file diff --git a/package.json b/package.json index 94916953..c234738f 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "build": "bash build.sh", "dev": "vite", "tauri": "tauri", + "desktop": "bash build-desktop.sh", "preview": "vite preview", "lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src", "format": "prettier . --write", diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 76a1b5ba..ceef23e1 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ "frontendDist": "../dist", "devUrl": "http://localhost:4000/simulatorvue/", "beforeDevCommand": "npm run dev", - "beforeBuildCommand": "DESKTOP_MODE=true npm run build && cp ./dist/index-cv.html ./dist/index.html" + "beforeBuildCommand": "npm run desktop && cp ./dist/index-cv.html ./dist/index.html" }, "app": { "windows": [ From 2f0978293917c0a8883fe5878a66df8e670339b1 Mon Sep 17 00:00:00 2001 From: Aryan Jain Date: Tue, 11 Mar 2025 22:49:06 +0530 Subject: [PATCH 4/4] Revert "build: desktop application" This reverts commit ed73fb86dc80be46905c0cb1c5a049b4e0864615. --- .github/workflows/tauri-release.yml | 2 +- build-desktop.sh | 2 - desktop.config.ts | 68 ----------------------------- package.json | 1 - src-tauri/tauri.conf.json | 2 +- 5 files changed, 2 insertions(+), 73 deletions(-) delete mode 100644 build-desktop.sh delete mode 100644 desktop.config.ts diff --git a/.github/workflows/tauri-release.yml b/.github/workflows/tauri-release.yml index 60c1c519..e4ff3258 100644 --- a/.github/workflows/tauri-release.yml +++ b/.github/workflows/tauri-release.yml @@ -31,7 +31,7 @@ jobs: - name: Build Frontend (Vue) run: | - npm run desktop + npm run build working-directory: ./src - name: Setup Rust diff --git a/build-desktop.sh b/build-desktop.sh deleted file mode 100644 index aaf968c1..00000000 --- a/build-desktop.sh +++ /dev/null @@ -1,2 +0,0 @@ -npx vite build --config desktop.config.ts -echo "All builds completed successfully" diff --git a/desktop.config.ts b/desktop.config.ts deleted file mode 100644 index fc7e675c..00000000 --- a/desktop.config.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { defineConfig } from 'vite' -import vue from '@vitejs/plugin-vue' -import { fileURLToPath, URL } from 'url' -import vueI18n from '@intlify/vite-plugin-vue-i18n' - -// https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin -import vuetify from 'vite-plugin-vuetify' -import { createHtmlPlugin } from 'vite-plugin-html' - -const proxyUrl: string = 'http://localhost:3000' - - -// https://vitejs.dev/config/ -export default defineConfig({ - plugins: [ - vue(), - vuetify({ autoImport: true }), - vueI18n({ - // if you want to use Vue I18n Legacy API, you need to set `compositionOnly: false` - // compositionOnly: false, - - // you need to set i18n resource including paths ! - include: fileURLToPath( - new URL(`./v0/src/locales/**`, import.meta.url) - ), - }), - createHtmlPlugin({ - minify: true, - inject: { - data: { - injectScript: '', - }, - }, - }), - ], - resolve: { - alias: { - '#': fileURLToPath(new URL(`./v0/src`, import.meta.url)), - '@': fileURLToPath(new URL(`./v0/src/components`, import.meta.url)), - }, - }, - base: process.env.DESKTOP_MODE ? '/' : '/simulatorvue/v0/', - build: { - outDir: './dist', - assetsDir: 'assets', - chunkSizeWarningLimit: 1600, - rollupOptions: { - input: { - main: fileURLToPath(new URL('index-cv.html', import.meta.url)) - } - } - - }, - server: { - port: 4000, - proxy: { - // ...(process.env.NODE_ENV === 'development' && { - '^/(?!(simulatorvue)).*': { - target: proxyUrl, - changeOrigin: true, - headers: { - origin: proxyUrl, - }, - }, - // }), - }, - }, -}) \ No newline at end of file diff --git a/package.json b/package.json index c234738f..94916953 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "build": "bash build.sh", "dev": "vite", "tauri": "tauri", - "desktop": "bash build-desktop.sh", "preview": "vite preview", "lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src", "format": "prettier . --write", diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index ceef23e1..76a1b5ba 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -7,7 +7,7 @@ "frontendDist": "../dist", "devUrl": "http://localhost:4000/simulatorvue/", "beforeDevCommand": "npm run dev", - "beforeBuildCommand": "npm run desktop && cp ./dist/index-cv.html ./dist/index.html" + "beforeBuildCommand": "DESKTOP_MODE=true npm run build && cp ./dist/index-cv.html ./dist/index.html" }, "app": { "windows": [