From a73b2bd5fc7b50b15314eb604d89d5c83232ad97 Mon Sep 17 00:00:00 2001 From: Piyush Udhao Date: Thu, 19 Sep 2024 12:48:06 +0530 Subject: [PATCH] updated configs, updated SemVer to 0.0.1, removed redundant comments from main.rs --- .github/workflows/test_build_on_push_pr.yml | 7 +---- package.json | 2 +- src-tauri/Cargo.lock | 3 +- src-tauri/Cargo.toml | 3 +- src-tauri/src/main.rs | 7 +---- src-tauri/tauri.conf.json | 4 +-- vite.config.js | 33 +++++++++++++++------ 7 files changed, 31 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test_build_on_push_pr.yml b/.github/workflows/test_build_on_push_pr.yml index 48accb3..3922f14 100644 --- a/.github/workflows/test_build_on_push_pr.yml +++ b/.github/workflows/test_build_on_push_pr.yml @@ -2,11 +2,6 @@ name: "test-build-on-push-and-pr" on: push: - branches-ignore: - - 'main' - pull_request: - branches-ignore: - - 'main' branches: - '**' # This makes the workflow run on pushes to any branch. @@ -57,4 +52,4 @@ jobs: - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - args: ${{ matrix.args }} + args: ${{ matrix.args }} \ No newline at end of file diff --git a/package.json b/package.json index 8e605d1..7f0eceb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "habtrack", "private": true, - "version": "0.0.0", + "version": "0.0.1", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 2db81c4..4e4ed9c 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1195,11 +1195,10 @@ dependencies = [ [[package]] name = "habtrack" -version = "0.0.0" +version = "0.0.1" dependencies = [ "chrono", "headless_chrome", - "lazy_static", "libsqlite3-sys", "rusqlite", "serde", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 195684f..28d52cc 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "habtrack" -version = "0.0.0" +version = "0.0.1" description = "A Tauri App" authors = ["you"] edition = "2021" @@ -15,7 +15,6 @@ tauri = { version = "1", features = ["shell-open", "dialog"] } serde = { version = "1", features = ["derive"] } serde_json = "1" rusqlite = "0.31.0" -lazy_static = "1.4.0" chrono = { version = "0.4.38", features = ["serde"] } headless_chrome = "1.0.10" diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 6af8b66..5609bde 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -4,14 +4,9 @@ // Learn more about Tauri commands at https://tauri.app/v1/guides/features/command use std::sync::{Arc, Mutex}; - -use habtrack::{db::init, db::todos, window, export}; use tauri::Manager; -// Start work on database. -// TODO: Once done, merge with main, and pull changes into FEATURE-add-delete-task. - - +use habtrack::{db::init, db::todos, export, window}; fn main() { tauri::Builder::default() diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index df43c22..ff2ea8c 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -6,8 +6,8 @@ "distDir": "../dist" }, "package": { - "productName": "habtrack", - "version": "0.0.0" + "productName": "HabTrack", + "version": "0.0.1" }, "tauri": { "allowlist": { diff --git a/vite.config.js b/vite.config.js index 96b00a3..d598e5a 100644 --- a/vite.config.js +++ b/vite.config.js @@ -5,15 +5,7 @@ import { resolve } from "path"; // https://vitejs.dev/config/ export default defineConfig(async () => ({ plugins: [react()], - - build: { - rollupOptions: { - input: { - main: resolve(__dirname, "index.html"), - tomorrow: resolve(__dirname, "src/views/TasksView/Tomorrow/index.html"), - }, - }, - }, + base: "./", // Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build` // @@ -28,4 +20,27 @@ export default defineConfig(async () => ({ ignored: ["**/src-tauri/**"], }, }, + envPrefix: [ + "VITE_", + "TAURI_PLATFORM", + "TAURI_ARCH", + "TAURI_FAMILY", + "TAURI_PLATFORM_VERSION", + "TAURI_PLATFORM_TYPE", + "TAURI_DEBUG", + ], + build: { + rollupOptions: { + input: { + main: resolve(__dirname, "index.html"), + tomorrow: resolve(__dirname, "src/views/TasksView/Tomorrow/index.html"), + }, + }, + // Tauri uses Chromium on Windows and WebKit on macOS and Linux + target: process.env.TAURI_PLATFORM == "windows" ? "chrome105" : "safari13", + // don't minify for debug builds + minify: !process.env.TAURI_DEBUG ? "esbuild" : false, + // produce sourcemaps for debug builds + sourcemap: !!process.env.TAURI_DEBUG, + }, }));