Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.jp.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ deepchatへの貢献をご検討いただきありがとうございます!貢
- [Vue](https://vuejs.org/)
- [Electron](https://www.electronjs.org/)
- [Electron-Vite](https://electron-vite.org/)
- [Rolldown-Vite](https://github.com/vitejs/rolldown-vite)
- [oxlint](https://github.com/oxc-project/oxc)

## 📃 ライセンス
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ This project is built with the help of these awesome libraries:
- [Vue](https://vuejs.org/)
- [Electron](https://www.electronjs.org/)
- [Electron-Vite](https://electron-vite.org/)
- [Rolldown-Vite](https://github.com/vitejs/rolldown-vite)
- [oxlint](https://github.com/oxc-project/oxc)

## 📃 License
Expand Down
1 change: 0 additions & 1 deletion README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,6 @@ DeepChat是一个活跃的开源社区项目,我们欢迎各种形式的贡献
- [Vue](https://vuejs.org/)
- [Electron](https://www.electronjs.org/)
- [Electron-Vite](https://electron-vite.org/)
- [Rolldown-Vite](https://github.com/vitejs/rolldown-vite)
- [oxlint](https://github.com/oxc-project/oxc)

## 📃 许可证
Expand Down
2 changes: 1 addition & 1 deletion electron.vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default defineConfig({
},
build: {
rollupOptions: {
external: ['sharp'],
external: ['sharp','@duckdb/node-api'],
output: {
inlineDynamicImports: true,
manualChunks: undefined, // Disable automatic chunk splitting
Expand Down
45 changes: 21 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
"build:linux:x64": "pnpm run build && electron-builder --linux --x64",
"build:linux:arm64": "pnpm run build && electron-builder --linux --arm64",
"afterSign": "scripts/notarize.js",
"installRuntime": "npx -y tiny-runtime-injector --type uv --dir ./runtime/uv && npx -y tiny-runtime-injector --type bun --dir ./runtime/bun",
"installRuntime:win:x64": "npx -y tiny-runtime-injector --type uv --dir ./runtime/uv -a x64 -p win32 && npx -y tiny-runtime-injector --type node --dir ./runtime/node -a x64 -p win32",
"installRuntime:win:arm64": "npx -y tiny-runtime-injector --type uv --dir ./runtime/uv -a arm64 -p win32 && npx -y tiny-runtime-injector --type node --dir ./runtime/node -a arm64 -p win32",
"installRuntime:mac:arm64": "npx -y tiny-runtime-injector --type uv --dir ./runtime/uv -a arm64 -p darwin && npx -y tiny-runtime-injector --type bun --dir ./runtime/bun -a arm64 -p darwin",
"installRuntime:mac:x64": "npx -y tiny-runtime-injector --type uv --dir ./runtime/uv -a x64 -p darwin && npx -y tiny-runtime-injector --type bun --dir ./runtime/bun -a x64 -p darwin",
"installRuntime:linux:x64": "npx -y tiny-runtime-injector --type uv --dir ./runtime/uv -a x64 -p linux && npx -y tiny-runtime-injector --type bun --dir ./runtime/bun -a x64 -p linux",
"installRuntime:linux:arm64": "npx -y tiny-runtime-injector --type uv --dir ./runtime/uv -a arm64 -p linux && npx -y tiny-runtime-injector --type bun --dir ./runtime/bun -a arm64 -p linux",
"installRuntime": "npx -y tiny-runtime-injector --type uv --dir ./runtime/uv --runtime-version 0.8.8 && npx -y tiny-runtime-injector --type bun --dir ./runtime/bun --runtime-version v1.2.20",
"installRuntime:win:x64": "npx -y tiny-runtime-injector --type uv --dir ./runtime/uv --runtime-version 0.8.8 -a x64 -p win32 && npx -y tiny-runtime-injector --type node --dir ./runtime/node -a x64 -p win32",
"installRuntime:win:arm64": "npx -y tiny-runtime-injector --type uv --dir ./runtime/uv --runtime-version 0.8.8 -a arm64 -p win32 && npx -y tiny-runtime-injector --type node --dir ./runtime/node -a arm64 -p win32",
"installRuntime:mac:arm64": "npx -y tiny-runtime-injector --type uv --dir ./runtime/uv --runtime-version 0.8.8 -a arm64 -p darwin && npx -y tiny-runtime-injector --type bun --runtime-version v1.2.20 --dir ./runtime/bun -a arm64 -p darwin",
"installRuntime:mac:x64": "npx -y tiny-runtime-injector --type uv --dir ./runtime/uv --runtime-version 0.8.8 -a x64 -p darwin && npx -y tiny-runtime-injector --type bun --runtime-version v1.2.20 --dir ./runtime/bun -a x64 -p darwin",
"installRuntime:linux:x64": "npx -y tiny-runtime-injector --type uv --dir ./runtime/uv --runtime-version 0.8.8 -a x64 -p linux && npx -y tiny-runtime-injector --type bun --runtime-version v1.2.20 --dir ./runtime/bun -a x64 -p linux",
"installRuntime:linux:arm64": "npx -y tiny-runtime-injector --type uv --dir ./runtime/uv --runtime-version 0.8.8 -a arm64 -p linux && npx -y tiny-runtime-injector --type bun --runtime-version v1.2.20 --dir ./runtime/bun -a arm64 -p linux",
Comment on lines +45 to +51
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Runtime pinning: consider pinning Node on Windows and confirm bun omission

  • Windows scripts inject Node without a --runtime-version. For reproducibility, consider pinning this as well (ideally matching the Node version embedded in your Electron target).
  • Windows variants skip bun while macOS/Linux install bun. If intentional, document the rationale; otherwise consider symmetry.

🏁 Script executed:

#!/bin/bash
# 1) Confirm if any code uses ./runtime/node or bun on Windows-only paths.
rg -n --no-heading -A1 -B1 'runtime/(node|bun)'

# 2) Derive Electron's Node version used at runtime (from package.json) to guide pinning.
rg -n '"electron"\\s*:\\s*".*"' -A0 -B3

# 3) Check tiny-runtime-injector usage docs in repo for Node pinning convention (if any).
rg -n 'tiny-runtime-injector' -A2 -B2

Length of output: 5791


Pin Node on Windows and clarify Bun omission

  • In package.json scripts installRuntime:win:x64 and installRuntime:win:arm64, the Node injector calls lack --runtime-version. For reproducible builds, add --runtime-version <node-version> (e.g. matching your Electron–embedded Node).
  • The Windows install scripts omit Bun while macOS/Linux include it. If Bun isn’t supported on Win32, add a comment explaining the omission; otherwise mirror the Bun injection flags for symmetry.

"installRuntime:duckdb:vss": "node scripts/installVss.js",
"i18n": "i18n-check -s zh-CN -f i18next --locales src/renderer/src/i18n",
"i18n:en": "i18n-check -s en-US -f i18next --locales src/renderer/src/i18n",
Expand All @@ -61,9 +61,9 @@
"@e2b/code-interpreter": "^1.5.1",
"@electron-toolkit/preload": "^3.0.1",
"@electron-toolkit/utils": "^4.0.0",
"@google/genai": "^1.5.1",
"@google/genai": "^1.13.0",
"@jxa/run": "^1.4.0",
"@modelcontextprotocol/sdk": "^1.13.1",
"@modelcontextprotocol/sdk": "^1.17.2",
"axios": "^1.7.9",
"better-sqlite3-multiple-ciphers": "11.10.0",
"cheerio": "^1.0.0",
Expand All @@ -78,12 +78,12 @@
"file-type": "^20.5.0",
"glob": "^11.0.3",
"https-proxy-agent": "^7.0.6",
"jsonrepair": "^3.12.0",
"jsonrepair": "^3.13.0",
"mammoth": "^1.9.0",
"mime-types": "^2.1.35",
"nanoid": "^5.1.5",
"ollama": "^0.5.16",
"openai": "^5.3.0",
"openai": "^5.12.2",
"pdf-parse-new": "^1.3.9",
"run-applescript": "^7.0.0",
"sharp": "^0.33.5",
Expand Down Expand Up @@ -121,18 +121,18 @@
"@types/node": "^22.14.1",
"@types/xlsx": "^0.0.35",
"@vitejs/plugin-vue": "^6.0.1",
"@vitest/ui": "^3.2.3",
"@vitest/ui": "^3.2.4",
"@vue/test-utils": "^2.4.6",
"@vueuse/core": "^12.7.0",
"autoprefixer": "^10.4.20",
"autoprefixer": "^10.4.21",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"dompurify": "^3.2.4",
"electron": "^35.5.1",
"dompurify": "^3.2.6",
"electron": "^36.7.4",
"electron-builder": "26.0.12",
"electron-vite": "^4.0.0",
"jsdom": "^26.1.0",
"lint-staged": "^16.1.2",
"lint-staged": "^16.1.5",
"lucide-vue-next": "^0.511.0",
"mermaid": "^11.6.0",
"minimatch": "^10.0.1",
Expand All @@ -148,21 +148,21 @@
"tailwindcss-animate": "^1.0.7",
"tippy.js": "^6.3.7",
"typescript": "^5.8.3",
"vite": "npm:rolldown-vite@7.0.12",
"vite": "7.1.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Vite 7.1.1: confirm compatibility with electron-vite and plugins

You bumped to Vite 7.1.1. electron-vite (^4) and @vitejs/plugin-vue (^6) should be compatible, but please validate dev/build flows.

  • Local verification steps:

    • pnpm install
    • pnpm dev (hot reload, HMR)
    • pnpm build (ensure no plugin errors)
  • Optional web check:


🌐 Web query:

Does electron-vite v4 support Vite 7? Are there known compatibility caveats?

💡 Result:

Short answer: No — there’s no public electron-vite “v4” release that advertises Vite 7 support, and the current electron-vite line (3.x / the docs) targets Vite 5. There are open requests for Vite 6+ support, so you should expect incompatibilities if you try to jump to Vite 7 today. (npmjs.com, electron-vite.org, github.com)

Details & practical caveats

  • State of releases

    • Vite 7 was released on June 24, 2025. (vite.dev)
    • electron-vite’s published package and docs currently target Vite 5 (the electron-vite package on npm is in the 3.x series as of the latest metadata). There is no official electron-vite v4 release that advertises Vite 7 compatibility. (npmjs.com, electron-vite.org)
  • Known compatibility / migration issues you will hit

    • Peer-dependency conflicts: older electron-vite releases declare peer constraints for older Vite majors (historically ^4/^5), so installing Vite 6/7 can produce npm/yarn resolution errors unless the package’s peerDeps are updated or you force/override resolution. (There are open issues requesting Vite 6 support.) (github.com)
    • ESM / CJS changes: electron-vite moved toward ESM (and Vite’s Node API has been migrating to ESM-only in recent majors). That means config files, package.json "type", output formats, and how main/preload bundles are produced may require changes (rename config to .mjs or add "type":"module", adjust build.lib.formats, etc.). Expect to change your Electron entry/main packaging if you upgrade Vite without an electron-vite release that explicitly supports the Vite major. (electron-vite.org, github.com)
    • Electron preload / nodeIntegration limits: electron-vite already documents caveats around preload sandboxing and not supporting nodeIntegration for renderer (because Vite HMR expects ESM). Upgrading the Vite major can change plugin behavior (resolve/prebundle, externalization, rollup options) that affects how native modules, node: imports, and electron imports are treated. Test carefully. (electron-vite.org)
  • Practical recommendations

    • If you need stability: pin Vite to the highest supported minor for your electron-vite release (e.g., Vite 5.x for electron-vite 3.x) until an official electron-vite release (or plugin update) explicitly states Vite 7 support. (npmjs.com, electron-vite.org)
    • If you want to experiment: try a small blank project, upgrade Vite and run the dev/build flows to surface peer-dep and runtime errors early. Be prepared to adjust config to ESM, change build.lib formats (CJS vs ESM), and update any plugins that have their own Vite peer deps.
    • Watch the electron-vite / vite-plugin-electron repos (changelog/ISSUES) for an announced compatibility release — those are the authoritative signals that a new Vite major is supported. (github.com)

If you want, I can:

  • check the electron-vite GitHub/NPM right now for any newly-published v4 tag or a release note that explicitly adds Vite 7 support, or
  • run through a short upgrade checklist for a sample project (what to change in package.json, electron.vite.config, build.lib.formats, and what tests to run). Which would you prefer?

Citations:


Stop Vite 7 upgrade until electron-vite adds official support

electron-vite’s current stable line (3.x) targets Vite 5 and does not support Vite 7. Bumping to "vite": "7.1.1" will lead to peer-dependency resolution errors and require breaking ESM/CJS config changes in your Electron build.

Action required:

  • Revert or pin Vite to the highest 5.x minor (e.g. "vite": "5.10.x") until an electron-vite release declares Vite 7 compatibility.
  • Watch the electron-vite (and vite-plugin-electron) repos for a “v4” release or changelog entry explicitly adding Vite 7 support.
  • Once an official compatibility release is available, you can:
    • Upgrade Vite and resolve any peerDeps.
    • Rename config files (.mjs / "type":"module"), adjust build.lib.formats, and validate dev/build flows (HMR, ESM preload, plugin behavior).

References:

  • electron-vite on npm: targets Vite 5 (no v4 yet)¹
  • Open issue requesting Vite 6+ support³
  • Vite 7 announced June 2025⁴
🤖 Prompt for AI Agents
In package.json around line 151, Vite was bumped to "7.1.1" but electron-vite
(stable 3.x) targets Vite 5 and does not support Vite 7; revert or pin the vite
dependency to the latest 5.x series (for example "vite": "5.10.x") to avoid
peer-dependency and ESM/CJS breakage, update package.json accordingly and run
install to verify no peer conflicts, add a short comment or task in the repo to
watch electron-vite and vite-plugin-electron for an official v4/Vite‑7
compatibility release and only upgrade to Vite 7 after that release while
following the upgrade checklist (resolve peerDeps, convert configs to ESM if
needed, adjust build.lib.formats and validate HMR/preload behavior).

"vite-plugin-monaco-editor-esm": "^2.0.2",
"vite-plugin-vue-devtools": "^8.0.0",
"vite-svg-loader": "^5.1.0",
"vitest": "^3.2.3",
"vue": "^3.5.14",
"vue-i18n": "^11.1.3",
"vue-renderer-markdown": "^0.0.34",
"vitest": "^3.2.4",
"vue": "^3.5.18",
"vue-i18n": "^11.1.11",
"vue-router": "4",
"vue-tsc": "^2.2.10",
"vue-use-monaco": "^0.0.6",
"vue-virtual-scroller": "^2.0.0-beta.8",
"vuedraggable": "^4.1.0",
"yaml": "^2.8.0",
"zod-to-json-schema": "^3.24.5"
"zod-to-json-schema": "^3.24.6"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged && pnpm typecheck",
Expand All @@ -177,9 +177,6 @@
]
},
"pnpm": {
"overrides": {
"vite": "npm:rolldown-vite@7.0.12"
},
"onlyBuiltDependencies": [
"@tailwindcss/oxide",
"electron",
Expand Down