[Electron] Add basic welcome screen (#1491)

* WIP

* Add LogTerminal

* Modify server startup view

* Add installView

* Add basic welcome screen and dev server setup

* nit

* nit

* nit

* nit

* nit
This commit is contained in:
Chenlei Hu
2024-11-10 09:41:32 -05:00
committed by GitHub
parent 31fac3873c
commit d9a34872c3
11 changed files with 216 additions and 15 deletions

33
vite.electron.config.mts Normal file
View File

@@ -0,0 +1,33 @@
import { defineConfig, Plugin } from 'vite'
import { mergeConfig } from 'vite'
import type { UserConfig } from 'vitest/config'
import baseConfig from './vite.config.mts'
import type { ElectronAPI } from '@comfyorg/comfyui-electron-types'
const electronAPIMock: Partial<ElectronAPI> = {
sendReady: () => {},
onShowSelectDirectory: () => {},
onFirstTimeSetupComplete: () => {},
onProgressUpdate: () => {},
onLogMessage: () => {},
isFirstTimeSetup: () => Promise.resolve(true)
}
const mockElectronAPI: Plugin = {
name: 'mock-electron-api',
transformIndexHtml() {
return [
{
tag: 'script',
children: `window.electronAPI = ${JSON.stringify(electronAPIMock)};`
}
]
}
}
export default mergeConfig(
baseConfig as unknown as UserConfig,
defineConfig({
plugins: [mockElectronAPI]
})
)