Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 12 additions & 2 deletions apps/desktop/electron.vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The externalizeDepsPlugin is correctly imported from 'electron-vite' which is the correct import path for version 5.0.0. The configuration looks compatible with electron-vite 5.x.

import { resolve } from 'path'
import tailwindcss from '@tailwindcss/vite'
import tsconfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
main: {
Expand All @@ -23,13 +25,21 @@ export default defineConfig({
}
},
renderer: {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The root change from ../web/dist to ../web is correct for development mode, but ensure production builds still work correctly since dist is the output directory.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Security Issue: The desktop renderer is sharing the same index.html from the web app. This means the desktop app will load the web app's HTML which includes the same CSP policy. However, the desktop app needs to load the actual desktop renderer entry point (/src/main.tsx), not the web app's entry. This configuration could cause the desktop app to fail to load properly or bypass security policies intended for the web app.

root: resolve(__dirname, '../web/dist'),
root: resolve(__dirname, '../web'),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is a positive change - pointing to the source directory instead of dist allows the desktop app to use the web app's Vite dev server with HMR.

plugins: [
tailwindcss(),
tsconfigPaths({ projects: ['./tsconfig.json'] })
],
build: {
rollupOptions: {
input: {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Issue: The desktop renderer configuration uses the web app's root and index.html, but the desktop renderer should have its own entry point. Currently, both web and desktop will share the same renderer, which may not be the intended behavior for a desktop application.

Recommendation: Consider creating a separate renderer entry point for the desktop app (e.g., apps/desktop/src/renderer/) or ensure this is intentional for your architecture.

index: resolve(__dirname, '../web/dist/index.html')
index: resolve(__dirname, '../web/index.html')
}
}
},
server: {
host: '127.0.0.1',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Both apps are configured to use port 3000. When running dev:all, both the web app and desktop renderer will try to bind to the same port, causing a conflict. Consider assigning different ports (e.g., web on 3000, desktop renderer on 3001) or using the web app's server for the desktop renderer.

port: 3000
}
}
})
7 changes: 5 additions & 2 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@
"@electron-toolkit/eslint-config": "^1.0.2",
"@electron-toolkit/eslint-config-ts": "^2.0.0",
"@electron-toolkit/tsconfig": "^1.0.1",
"@tailwindcss/vite": "^4.1.18",
"@types/node": "^22.10.2",
"electron": "^33.3.1",
"electron-builder": "^25.1.8",
"electron-vite": "^2.3.0",
"electron-vite": "^5.0.0",
"tailwindcss": "^4.1.18",
"typescript": "^5.7.2",
"vite": "^7.1.7"
"vite": "^7.1.7",
"vite-tsconfig-paths": "^5.1.4"
}
}
4 changes: 4 additions & 0 deletions apps/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const config = defineConfig({
tanstackRouter({ target: 'react', autoCodeSplitting: true }),
viteReact(),
],
server: {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Port Configuration: Both web and desktop apps are configured to use port 3000. When running dev:all, there's no conflict handling. The desktop app renderer is configured to load from the web app's dev server at port 3000, but this requires the web app to start first.

Recommendation: Consider using different ports or adding a startup delay/await mechanism in the dev:all script to ensure the web app starts before the desktop app tries to connect.

host: '127.0.0.1',
port: 3000,
},
})

export default config
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
"type": "module",
"scripts": {
"dev": "turbo dev",
"dev:web": "turbo dev --filter=web",
"dev:desktop": "turbo dev --filter=desktop",
"dev:all": "turbo run dev --filter=web --filter=desktop",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Security Concern: The dev:all script uses turbo run dev but this will run both apps in parallel without waiting for dependencies to be ready. Also, there's no explicit port conflict handling if both apps try to use the same port.

The desktop app renderer is configured to point to the web app (root: resolve(__dirname, '../web')), but the web app runs on port 3000. This could cause issues during parallel development.

"build": "turbo build",
"lint": "turbo lint",
"typecheck": "turbo typecheck",
Expand Down