mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-10-19 00:13:41 +08:00
feat(tauri): Migrate from Tauri v1 to v2
# Summary This commit completes the migration from Tauri v1 to v2, resolves configuration issues, upgrades Next.js, and adds test coverage for critical components to ensure stability during the transition. # Details ## Tauri v2 Migration - Updated Tauri dependencies to v2.3.0 series in package.json - Restructured build configuration in `/app/config/build.ts` to align with Tauri v2 requirements - Fixed imports and API usage patterns across the codebase - Added compatibility layer for window.__TAURI__ references to maintain backward compatibility ## Next.js Issues - Upgraded Next.js from 14.1.1 to 14.2.24 - Resolved caching problems with Server Actions - Updated eslint-config-next to match the new version - Cleared Next.js cache and temporary files to address build issues ## Testing & Stability - Added comprehensive tests for `stream.ts` to verify streaming functionality - Created mocks for Tauri API to support test environment - Verified that critical functionality continues to work correctly - Translated all comments to English for consistency ## Infrastructure - Fixed peer dependency warnings during installation - Ensured proper integration with Tauri v2 plugins (clipboard-manager, dialog, fs, http, notification, shell, updater, window-state) # Approach Prioritized stability by: 1. Making minimal necessary changes to configuration files 2. Preserving most `window.__TAURI__` calls as they still function in v2 3. Planning gradual migration to new APIs with test coverage for critical components 4. Documenting areas that will require future attention # Testing - Created unit tests for critical streaming functionality - Performed manual testing of key application features - Verified successful build and launch with Tauri v2 # Future Work - Future PRs will gradually replace deprecated Tauri v1 API calls with v2 equivalents - Additional test coverage will be added for other critical components
This commit is contained in:
16
package.json
16
package.json
@@ -26,6 +26,14 @@
|
||||
"@modelcontextprotocol/sdk": "^1.0.4",
|
||||
"@next/third-parties": "^14.1.0",
|
||||
"@svgr/webpack": "^6.5.1",
|
||||
"@tauri-apps/plugin-clipboard-manager": "~2",
|
||||
"@tauri-apps/plugin-dialog": "~2",
|
||||
"@tauri-apps/plugin-fs": "~2",
|
||||
"@tauri-apps/plugin-http": "~2",
|
||||
"@tauri-apps/plugin-notification": "~2",
|
||||
"@tauri-apps/plugin-shell": "~2",
|
||||
"@tauri-apps/plugin-updater": "~2",
|
||||
"@tauri-apps/plugin-window-state": "^2.2.1",
|
||||
"@vercel/analytics": "^0.1.11",
|
||||
"@vercel/speed-insights": "^1.0.2",
|
||||
"axios": "^1.7.5",
|
||||
@@ -39,7 +47,7 @@
|
||||
"markdown-to-txt": "^2.0.1",
|
||||
"mermaid": "^10.6.1",
|
||||
"nanoid": "^5.0.3",
|
||||
"next": "^14.1.1",
|
||||
"next": "14.2.24",
|
||||
"node-fetch": "^3.3.1",
|
||||
"openapi-client-axios": "^7.5.5",
|
||||
"react": "^18.2.0",
|
||||
@@ -59,8 +67,8 @@
|
||||
"zustand": "^4.3.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tauri-apps/api": "^2.1.1",
|
||||
"@tauri-apps/cli": "1.5.11",
|
||||
"@tauri-apps/api": "^2.3.0",
|
||||
"@tauri-apps/cli": "^2.3.1",
|
||||
"@testing-library/dom": "^10.4.0",
|
||||
"@testing-library/jest-dom": "^6.6.3",
|
||||
"@testing-library/react": "^16.1.0",
|
||||
@@ -75,7 +83,7 @@
|
||||
"concurrently": "^8.2.2",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^8.49.0",
|
||||
"eslint-config-next": "13.4.19",
|
||||
"eslint-config-next": "14.2.24",
|
||||
"eslint-config-prettier": "^8.8.0",
|
||||
"eslint-plugin-prettier": "^5.1.3",
|
||||
"eslint-plugin-unused-imports": "^3.2.0",
|
||||
|
Reference in New Issue
Block a user