Merge remote-tracking branch 'origin/feat-tauir-v2' into feat-tauir-v2

This commit is contained in:
lloydzhou 2024-09-25 00:15:46 +08:00
commit a7d8abbc4d
11 changed files with 4825 additions and 4550 deletions

1
.gitignore vendored
View File

@ -46,3 +46,4 @@ dev
*.key.pub
masks.json
package-lock.json

View File

@ -10,7 +10,7 @@ export const getBuildConfig = () => {
const buildMode = process.env.BUILD_MODE ?? "standalone";
const isApp = !!process.env.BUILD_APP;
const version = "v" + tauriConfig.package.version;
const version = "v" + tauriConfig.version;
const commitInfo = (() => {
try {

View File

@ -13,6 +13,9 @@
"export:dev": "concurrently -r \"yarn mask:watch\" \"cross-env BUILD_MODE=export BUILD_APP=1 next dev\"",
"app:dev": "concurrently -r \"yarn mask:watch\" \"yarn tauri dev\"",
"app:build": "yarn mask && yarn tauri build",
"ios:init": "yarn tauri ios init",
"ios:dev": "concurrently -r \"yarn mask:watch\" \"yarn tauri ios dev\"",
"ios:build": "yarn mask && yarn tauri ios build",
"prompts": "node ./scripts/fetch-prompts.mjs",
"prepare": "husky install",
"proxy-dev": "sh ./scripts/init-proxy.sh && proxychains -f ./scripts/proxychains.conf yarn dev"
@ -31,8 +34,8 @@
"html-to-image": "^1.11.11",
"idb-keyval": "^6.2.1",
"lodash-es": "^4.17.21",
"mermaid": "^10.6.1",
"markdown-to-txt": "^2.0.1",
"mermaid": "^10.6.1",
"nanoid": "^5.0.3",
"next": "^14.1.1",
"node-fetch": "^3.3.1",
@ -53,7 +56,7 @@
},
"devDependencies": {
"@tauri-apps/api": "^1.6.0",
"@tauri-apps/cli": "1.5.11",
"@tauri-apps/cli": "^2.0.0-rc.0",
"@types/js-yaml": "4.0.9",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.11.30",

View File

@ -1,3 +1,4 @@
# Generated by Cargo
# will have compiled files and executables
/target/
/gen/

3831
src-tauri/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -2,44 +2,44 @@
name = "nextchat"
version = "0.1.0"
description = "A cross platform app for LLM ChatBot."
authors = ["Yidadaa"]
authors = ["GPTsMotion Tech LLC"]
license = "mit"
repository = ""
default-run = "nextchat"
edition = "2021"
rust-version = "1.60"
rust-version = "1.71"
[lib]
name = "nextchat"
crate-type = ["staticlib", "cdylib", "rlib"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[build-dependencies]
tauri-build = { version = "1.5.1", features = [] }
tauri-build = { version = "2.0.0-rc", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.5.4", features = [ "http-all",
"notification-all",
"fs-all",
"clipboard-all",
"dialog-all",
"shell-open",
"updater",
"window-close",
"window-hide",
"window-maximize",
"window-minimize",
"window-set-icon",
"window-set-ignore-cursor-events",
"window-set-resizable",
"window-show",
"window-start-dragging",
"window-unmaximize",
"window-unminimize",
] }
tauri-plugin-window-state = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
log = "0.4"
tauri = { version = "2.0.0-rc.15", features = [] }
tauri-plugin-log = "2.0.0-rc"
tauri-plugin-http = "2.0.0-rc"
# Optimize for smaller binary size
[profile.release]
panic = "abort" # Strip expensive panic clean-up logic
codegen-units = 1 # Compile crates one after another so the compiler can optimize better
lto = true # Enables link to optimizations
opt-level = "s" # Optimize for binary size
strip = true # Remove debug symbols
[features]
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.
# If you use cargo directly instead of tauri's cli you can use this feature flag to switch between tauri's `dev` and `build` modes.
# DO NOT REMOVE!!
custom-protocol = ["tauri/custom-protocol"]

View File

@ -0,0 +1,27 @@
{
"identifier": "main",
"description": "permissions for desktop app",
"local": true,
"windows": ["main"],
"permissions": [
"core:default",
"core:window:allow-start-dragging",
"core:window:allow-maximize",
"http:default",
"http:allow-fetch",
"http:allow-fetch-cancel",
"http:allow-fetch-read-body",
"http:allow-fetch-send",
{
"identifier": "http:allow-fetch",
"allow": [
{
"url": "https://*"
},
{
"url": "http://*"
}
]
}
]
}

17
src-tauri/src/lib.rs Normal file
View File

@ -0,0 +1,17 @@
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
.plugin(tauri_plugin_http::init())
.setup(|app| {
if cfg!(debug_assertions) {
app.handle().plugin(
tauri_plugin_log::Builder::default()
.level(log::LevelFilter::Info)
.build(),
)?;
}
Ok(())
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}

View File

@ -1,9 +1,4 @@
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
fn main() {
tauri::Builder::default()
.plugin(tauri_plugin_window_state::Builder::default().build())
.run(tauri::generate_context!())
.expect("error while running tauri application");
nextchat::run()
}

View File

@ -1,110 +1,17 @@
{
"$schema": "../node_modules/@tauri-apps/cli/schema.json",
"productName": "NextChat",
"identifier": "com.yida.chatgpt.next.web",
"version": "2.15.4",
"build": {
"beforeBuildCommand": "yarn export",
"beforeDevCommand": "yarn export:dev",
"devPath": "http://localhost:3000",
"distDir": "../out",
"withGlobalTauri": true
"devUrl": "http://localhost:3000",
"frontendDist": "../out"
},
"package": {
"productName": "NextChat",
"version": "2.15.2"
},
"tauri": {
"allowlist": {
"all": false,
"shell": {
"all": false,
"open": true
},
"dialog": {
"all": true,
"ask": true,
"confirm": true,
"message": true,
"open": true,
"save": true
},
"clipboard": {
"all": true,
"writeText": true,
"readText": true
},
"window": {
"all": false,
"close": true,
"hide": true,
"maximize": true,
"minimize": true,
"setIcon": true,
"setIgnoreCursorEvents": true,
"setResizable": true,
"show": true,
"startDragging": true,
"unmaximize": true,
"unminimize": true
},
"fs": {
"all": true
},
"notification": {
"all": true
},
"http": {
"all": true,
"request": true,
"scope": ["https://*", "http://*"]
}
},
"bundle": {
"active": true,
"category": "DeveloperTool",
"copyright": "2023, Zhang Yifei All Rights Reserved.",
"deb": {
"depends": []
},
"externalBin": [],
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
],
"identifier": "com.yida.chatgpt.next.web",
"longDescription": "NextChat is a cross-platform ChatGPT client, including Web/Win/Linux/OSX/PWA.",
"macOS": {
"entitlements": null,
"exceptionDomain": "",
"frameworks": [],
"providerShortName": null,
"signingIdentity": null
},
"resources": [],
"shortDescription": "NextChat App",
"targets": "all",
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": ""
}
},
"security": {
"csp": null,
"dangerousUseHttpScheme": true
},
"updater": {
"active": true,
"endpoints": [
"https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web/releases/latest/download/latest.json"
],
"dialog": false,
"windows": {
"installMode": "passive"
},
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IERFNDE4MENFM0Y1RTZBOTQKUldTVWFsNC96b0JCM3RqM2NmMnlFTmxIaStRaEJrTHNOU2VqRVlIV1hwVURoWUdVdEc1eDcxVEYK"
},
"plugins": {},
"app": {
"withGlobalTauri": true,
"windows": [
{
"fullscreen": false,
@ -115,6 +22,27 @@
"hiddenTitle": true,
"titleBarStyle": "Overlay"
}
],
"security": {
"csp": null
}
},
"bundle": {
"active": true,
"targets": "all",
"category": "Utility",
"copyright": "Copyright © 2024 GPTsMotion Tech LLC All Rights Reserved.",
"shortDescription": "NextChat App",
"longDescription": "Experience NextChat: Local-first, seamless, and designed for the ultimate chat experience",
"macOS": {
"signingIdentity": "-"
},
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
]
}
}

5300
yarn.lock

File diff suppressed because it is too large Load Diff