diff --git a/apps/desktop/.gitignore b/apps/desktop/.gitignore
index 4108b33e..4cec9104 100644
--- a/apps/desktop/.gitignore
+++ b/apps/desktop/.gitignore
@@ -9,7 +9,9 @@ lerna-debug.log*
node_modules
dist
+dist-electron
dist-ssr
+release
*.local
# Editor directories and files
diff --git a/apps/desktop/README.md b/apps/desktop/README.md
index f02aedf8..d5bcf73d 100644
--- a/apps/desktop/README.md
+++ b/apps/desktop/README.md
@@ -1,30 +1,22 @@
-# React + TypeScript + Vite
+# @multica/desktop
-This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
+Electron desktop app. Vite + React + `createHashRouter`.
-Currently, two official plugins are available:
+## Development
-- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
-- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
-
-## Expanding the ESLint configuration
-
-If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
-
-- Configure the top-level `parserOptions` property like this:
-
-```js
-export default {
- // other rules...
- parserOptions: {
- ecmaVersion: 'latest',
- sourceType: 'module',
- project: ['./tsconfig.json', './tsconfig.node.json'],
- tsconfigRootDir: __dirname,
- },
-}
+```bash
+multica dev desktop
```
-- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
-- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
-- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
+## Build
+
+```bash
+pnpm --filter @multica/desktop build
+```
+
+## Conventions
+
+- **Routing**: `react-router-dom` v7 with `createHashRouter` (Electron loads via `file://`, BrowserRouter won't work). Pages go in `src/pages/`.
+- **UI**: All components from `@multica/ui`. No local UI components.
+- **State**: Store hooks from `@multica/store`.
+- **Styles**: Tailwind CSS v4 via `@multica/ui/globals.css`, imported in `src/main.tsx`.
diff --git a/apps/desktop/electron/main.ts b/apps/desktop/electron/main.ts
index 302852f4..94948866 100644
--- a/apps/desktop/electron/main.ts
+++ b/apps/desktop/electron/main.ts
@@ -4,18 +4,8 @@ import path from 'node:path'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
-// The built directory structure
-//
-// ├─┬─┬ dist
-// │ │ └── index.html
-// │ │
-// │ ├─┬ dist-electron
-// │ │ ├── main.js
-// │ │ └── preload.mjs
-// │
process.env.APP_ROOT = path.join(__dirname, '..')
-// 🚧 Use ['ENV_NAME'] avoid vite:define plugin - Vite@2.x
export const VITE_DEV_SERVER_URL = process.env['VITE_DEV_SERVER_URL']
export const MAIN_DIST = path.join(process.env.APP_ROOT, 'dist-electron')
export const RENDERER_DIST = path.join(process.env.APP_ROOT, 'dist')
@@ -26,17 +16,11 @@ let win: BrowserWindow | null
function createWindow() {
win = new BrowserWindow({
- icon: path.join(process.env.VITE_PUBLIC, 'electron-vite.svg'),
webPreferences: {
preload: path.join(__dirname, 'preload.mjs'),
},
})
- // Test active push message to Renderer-process.
- win.webContents.on('did-finish-load', () => {
- win?.webContents.send('main-process-message', (new Date).toLocaleString())
- })
-
if (VITE_DEV_SERVER_URL) {
win.loadURL(VITE_DEV_SERVER_URL)
} else {
@@ -45,9 +29,6 @@ function createWindow() {
}
}
-// Quit when all windows are closed, except on macOS. There, it's common
-// for applications and their menu bar to stay active until the user quits
-// explicitly with Cmd + Q.
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
@@ -56,8 +37,6 @@ app.on('window-all-closed', () => {
})
app.on('activate', () => {
- // On OS X it's common to re-create a window in the app when the
- // dock icon is clicked and there are no other windows open.
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
diff --git a/apps/desktop/index.html b/apps/desktop/index.html
index 1136ddeb..d17771da 100644
--- a/apps/desktop/index.html
+++ b/apps/desktop/index.html
@@ -2,9 +2,8 @@