Skip to content

Commit c003115

Browse files
tclaude
andcommitted
chore(deps-dev): vite 5 → 8, @vitejs/plugin-react 4 → 6
Supersedes #138 and #139, which are coupled (plugin-react 6 requires vite 7+) and were deferred in June because `vite build` failed with `Rolldown failed to resolve import "openai"` — vite 8 swaps in the rolldown bundler, and the renderer was transitively pulling core/dist/providers/deepseek.js. That blocker is gone: #192 split dependency-free model metadata from the provider implementation specifically so provider/OpenAI SDK code is absent from renderer bundles. The import rolldown could not resolve no longer reaches the renderer graph, so no `build.rolldownOptions.external` migration is needed. Also replaces `__dirname` with `import.meta.dirname` in vite.config.ts. vite 8 warns that `__dirname` is unsupported by `configLoader: 'native'`, which is planned to become the default in a future major. The repo requires Node >=22, so `import.meta.dirname` is available. Verified on top of React 19 (#211), forced rebuild throughout: - tsc -b --force, lint (--max-warnings=0), format:check: clean - 1033 tests across 8 packages: pass - pnpm build + full build:tauri-assets pipeline: pass (app-server.cjs 599,395 bytes — within the 768 KiB #208 budget) - desktop Playwright protocol journey (4 tests): pass Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 66ece52 commit c003115

3 files changed

Lines changed: 469 additions & 374 deletions

File tree

apps/desktop/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@
4040
"@types/node": "^22.10.0",
4141
"@types/react": "^19.2.17",
4242
"@types/react-dom": "^19.2.3",
43-
"@vitejs/plugin-react": "^4.3.0",
43+
"@vitejs/plugin-react": "^6.0.2",
4444
"typescript": "^5.7.0",
45-
"vite": "^5.4.0",
45+
"vite": "^8.0.16",
4646
"vitest": "^2.1.9"
4747
},
4848
"engines": {

apps/desktop/vite.config.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ const host = process.env.TAURI_DEV_HOST;
1313

1414
export default defineConfig({
1515
plugins: [react()],
16-
root: resolve(__dirname, 'src'),
16+
root: resolve(import.meta.dirname, 'src'),
1717
base: './',
18-
publicDir: resolve(__dirname, 'public'),
18+
publicDir: resolve(import.meta.dirname, 'public'),
1919
clearScreen: false,
2020
server: {
2121
port: 5173,
@@ -26,13 +26,13 @@ export default defineConfig({
2626
},
2727
envPrefix: ['VITE_', 'TAURI_'],
2828
build: {
29-
outDir: resolve(__dirname, 'dist'),
29+
outDir: resolve(import.meta.dirname, 'dist'),
3030
emptyOutDir: true,
3131
sourcemap: true,
3232
target: 'es2022',
3333
minify: 'esbuild',
3434
rollupOptions: {
35-
input: resolve(__dirname, 'src', 'index.html'),
35+
input: resolve(import.meta.dirname, 'src', 'index.html'),
3636
},
3737
},
3838
resolve: {
@@ -42,13 +42,21 @@ export default defineConfig({
4242
// cherry-picked from compiled subpaths. The agent runtime is a sidecar.
4343
{
4444
find: /^@deepcode\/core\/dist\/(.+)$/,
45-
replacement: resolve(__dirname, '..', '..', 'packages', 'core', 'dist') + '/$1',
45+
replacement: resolve(import.meta.dirname, '..', '..', 'packages', 'core', 'dist') + '/$1',
4646
},
4747
// Bare import — anything that resolves through the index. We avoid
4848
// doing this in the renderer, but keep the alias so types still resolve.
4949
{
5050
find: '@deepcode/core',
51-
replacement: resolve(__dirname, '..', '..', 'packages', 'core', 'src', 'index.ts'),
51+
replacement: resolve(
52+
import.meta.dirname,
53+
'..',
54+
'..',
55+
'packages',
56+
'core',
57+
'src',
58+
'index.ts',
59+
),
5260
},
5361
],
5462
},

0 commit comments

Comments
 (0)