From cea17ec62f980f4bd2c49c89701212a05ecaeaa5 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Tue, 17 Dec 2024 16:21:21 +0800 Subject: [PATCH] :fire: Simplify config parameters --- package.json | 6 +-- src-tauri/Cargo.lock | 83 +++++++++++++++++++++++++++++++ src-tauri/Cargo.toml | 3 ++ src-tauri/tauri.conf.json | 14 ++---- src-tauri/tauri.linux.conf.json | 8 +-- src-tauri/tauri.macos.conf.json | 14 +----- src-tauri/tauri.windows.conf.json | 7 --- 7 files changed, 95 insertions(+), 40 deletions(-) diff --git a/package.json b/package.json index 719902b..ee6fa5e 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "dependencies": { "@tauri-apps/api": "^1.6.0", "@tauri-apps/cli": "^2.1.0", - "axios": "^1.7.8", + "axios": "^1.7.9", "chalk": "^5.3.0", "commander": "^11.1.0", "file-type": "^18.7.0", @@ -71,7 +71,7 @@ "@rollup/plugin-terser": "^0.4.4", "@types/fs-extra": "^11.0.4", "@types/is-url": "^1.2.32", - "@types/node": "^20.17.9", + "@types/node": "^20.17.10", "@types/page-icon": "^0.3.6", "@types/prompts": "^2.4.9", "@types/psl": "^1.1.3", @@ -80,7 +80,7 @@ "@types/update-notifier": "^6.0.8", "app-root-path": "^3.1.0", "cross-env": "^7.0.3", - "rollup": "^4.28.0", + "rollup": "^4.28.1", "rollup-plugin-typescript2": "^0.36.0", "tslib": "^2.8.1", "typescript": "^5.7.2" diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 279ec63..0ec129b 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -124,6 +124,12 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "binfarce" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18464ccbb85e5dede30d70cc7676dc9950a0fb7dbf595a43d765be9123c616a2" + [[package]] name = "bitflags" version = "1.3.2" @@ -251,6 +257,22 @@ dependencies = [ "serde", ] +[[package]] +name = "cargo-bloat" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e2c483ab55e38021c2c701061e078cc6c28d563932cbdf6bc4efaa28ab117e" +dependencies = [ + "binfarce", + "json", + "memmap2", + "multimap", + "pdb", + "pico-args", + "regex", + "term_size", +] + [[package]] name = "cargo-platform" version = "0.1.9" @@ -775,6 +797,12 @@ dependencies = [ "typeid", ] +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + [[package]] name = "fdeflate" version = "0.3.6" @@ -1723,6 +1751,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "json" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" + [[package]] name = "json-patch" version = "3.0.1" @@ -1894,6 +1928,15 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memmap2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.9.1" @@ -1950,6 +1993,12 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + [[package]] name = "ndk" version = "0.9.0" @@ -2301,6 +2350,7 @@ dependencies = [ name = "pake" version = "3.0.0" dependencies = [ + "cargo-bloat", "serde", "serde_json", "tauri", @@ -2367,6 +2417,17 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" +[[package]] +name = "pdb" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82040a392923abe6279c00ab4aff62d5250d1c8555dc780e4b02783a7aa74863" +dependencies = [ + "fallible-iterator", + "scroll", + "uuid", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -2507,6 +2568,12 @@ dependencies = [ "siphasher", ] +[[package]] +name = "pico-args" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" + [[package]] name = "pin-project-lite" version = "0.2.15" @@ -3029,6 +3096,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "scroll" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" + [[package]] name = "selectors" version = "0.22.0" @@ -3865,6 +3938,16 @@ dependencies = [ "utf-8", ] +[[package]] +name = "term_size" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "thin-slice" version = "0.1.1" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 42d1d26..d2fa2c8 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -29,6 +29,9 @@ tauri-plugin-global-shortcut = { version = "2.2.0" } tauri-plugin-shell = "2.2.0" tokio = { version = "1", features = ["full"] } +[dev-dependencies] +cargo-bloat = "0.12.1" + [features] # this feature is used for development builds from development cli cli-build = [] diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 33a5e4d..5697bcf 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,22 +1,16 @@ { "productName": "WeRead", "identifier": "com.pake.weread", - "version": "2.0.0", - "plugins": {}, + "version": "1.0.0", "app": { - "security": { - "csp": null - }, + "withGlobalTauri": true, "trayIcon": { "iconPath": "png/weread_512.png", "iconAsTemplate": false, "id": "pake-tray" - }, - "withGlobalTauri": true + } }, "build": { - "beforeBuildCommand": "", - "frontendDist": "../dist", - "beforeDevCommand": "" + "frontendDist": "../dist" } } diff --git a/src-tauri/tauri.linux.conf.json b/src-tauri/tauri.linux.conf.json index 3962998..11a0fd3 100644 --- a/src-tauri/tauri.linux.conf.json +++ b/src-tauri/tauri.linux.conf.json @@ -1,20 +1,14 @@ { - "productName": "weread", + "productName": "we-read", "bundle": { "icon": ["png/weread_512.png"], "active": true, - "category": "DeveloperTool", - "copyright": "", "linux": { "deb": { "depends": ["curl", "wget"], "files": { "/usr/share/applications/com-pake-weread.desktop": "assets/com-pake-weread.desktop" } } }, - "externalBin": [], - "longDescription": "", - "resources": [], - "shortDescription": "", "targets": ["deb", "appimage"] } } diff --git a/src-tauri/tauri.macos.conf.json b/src-tauri/tauri.macos.conf.json index 97a3cff..b5a372a 100644 --- a/src-tauri/tauri.macos.conf.json +++ b/src-tauri/tauri.macos.conf.json @@ -2,19 +2,7 @@ "bundle": { "icon": ["icons/weread.icns"], "active": true, - "category": "DeveloperTool", - "copyright": "", - "externalBin": [], - "longDescription": "", - "macOS": { - "entitlements": null, - "exceptionDomain": null, - "frameworks": [], - "providerShortName": null, - "signingIdentity": null - }, - "resources": [], - "shortDescription": "", + "macOS": {}, "targets": ["dmg"] } } diff --git a/src-tauri/tauri.windows.conf.json b/src-tauri/tauri.windows.conf.json index 65ed816..3e45bd6 100644 --- a/src-tauri/tauri.windows.conf.json +++ b/src-tauri/tauri.windows.conf.json @@ -2,17 +2,10 @@ "bundle": { "icon": ["png/weread_256.ico", "png/weread_32.ico"], "active": true, - "category": "DeveloperTool", - "copyright": "", - "externalBin": [], - "longDescription": "", "resources": ["png/weread_32.ico"], - "shortDescription": "", "targets": ["msi"], "windows": { - "certificateThumbprint": null, "digestAlgorithm": "sha256", - "timestampUrl": "", "wix": { "language": ["en-US"], "template": "assets/main.wxs"