Skip to content

Commit 5b17335

Browse files
authored
Merge pull request #21 from Kosinkadink/vue-rework
Vue 3 + TypeScript rewrite
2 parents 7c77553 + 77698bc commit 5b17335

129 files changed

Lines changed: 19607 additions & 12781 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ jobs:
4848
- name: Install dependencies
4949
run: npm ci
5050

51-
- name: Build
51+
- name: Lint
52+
run: npm run lint
53+
54+
- name: Compile
55+
run: npm run build
56+
57+
- name: Package
5258
run: npx electron-builder ${{ matrix.args }} --publish never
5359

5460
- name: Upload artifacts

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
node_modules/
22
dist/
3+
out/
34
*.log
5+
*.tsbuildinfo
46
result

.prettierrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"singleQuote": true,
3+
"tabWidth": 2,
4+
"semi": false,
5+
"trailingComma": "none",
6+
"printWidth": 100
7+
}

README.md

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ chmod +x ComfyUI-Launcher-*.AppImage
2626
./ComfyUI-Launcher-*.AppImage --no-sandbox
2727
```
2828

29-
**Nix (flake):**
30-
31-
> ⚠️ The Nix flake (`flake.nix`) is not working currently.
32-
33-
34-
3529
## Development
3630

3731
### Prerequisites
@@ -49,6 +43,35 @@ nvm use 22
4943
node --version # should print v22.x.x
5044
```
5145

46+
### Stack
47+
48+
- **Build tool:** [electron-vite](https://electron-vite.org/)
49+
- **Renderer:** [Vue 3](https://vuejs.org/) (Composition API) + [TypeScript](https://www.typescriptlang.org/)
50+
- **State:** [Pinia](https://pinia.vuejs.org/)
51+
- **i18n:** [vue-i18n](https://vue-i18n.intlify.dev/) (locale files in `locales/`)
52+
- **Styling:** [Tailwind CSS v4](https://tailwindcss.com/)
53+
- **Icons:** [Lucide](https://lucide.dev/)
54+
- **Main process:** TypeScript (`src/main/`)
55+
- **Linting:** [ESLint](https://eslint.org/) (flat config) + [Prettier](https://prettier.io/)
56+
- **Testing:** [Vitest](https://vitest.dev/) + [Vue Test Utils](https://test-utils.vuejs.org/)
57+
58+
### Project structure
59+
60+
```
61+
src/
62+
main/ # Electron main process (TypeScript)
63+
preload/ # Preload scripts (context bridge)
64+
renderer/src/ # Vue 3 renderer
65+
components/ # Reusable UI components
66+
composables/ # Vue composables (useModal, useTheme, …)
67+
stores/ # Pinia stores (session, installation)
68+
views/ # Top-level views and modal views
69+
types/ # Renderer-side type re-exports
70+
types/ # Shared IPC types (single source of truth)
71+
locales/ # i18n translation files
72+
sources/ # Installation source plugins
73+
```
74+
5275
### Setup
5376

5477
```bash
@@ -61,24 +84,45 @@ npm install
6184

6285
**Windows / macOS:**
6386
```bash
64-
npm start
87+
npm run dev
6588
```
6689

6790
**Linux:**
6891
```bash
6992
./linux-dev.sh
7093
```
7194

72-
### Build for distribution
95+
### Type checking
7396

7497
```bash
75-
# Current platform
76-
npm run dist
98+
npm run typecheck # both main + renderer
99+
npm run typecheck:node # main process only
100+
npm run typecheck:web # renderer only
101+
```
77102

103+
### Linting
104+
105+
```bash
106+
npm run lint # check for lint errors
107+
npm run lint:fix # auto-fix lint errors
108+
npm run format # format with Prettier
109+
npm run format:check # check formatting without writing
110+
```
111+
112+
### Testing
113+
114+
```bash
115+
npm test # run all unit tests
116+
npm run test:watch # run in watch mode
117+
```
118+
119+
### Build for distribution
120+
121+
```bash
78122
# Platform-specific
79-
npm run dist:win # Windows (NSIS installer)
80-
npm run dist:mac # macOS (DMG)
81-
npm run dist:linux # Linux (AppImage, .deb)
123+
npm run build:win # Windows (NSIS installer)
124+
npm run build:mac # macOS (DMG)
125+
npm run build:linux # Linux (AppImage, .deb)
82126
```
83127

84128
Build output is written to the `dist/` directory.

electron-builder.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
appId: com.kosinkadink.comfyui-launcher
2+
productName: ComfyUI Launcher
3+
directories:
4+
buildResources: resources
5+
files:
6+
- '!**/.vscode/*'
7+
- '!src/*'
8+
- '!electron.vite.config.{js,ts,mjs,cjs}'
9+
- '!eslint.config.ts'
10+
- '!{.eslintcache,.prettierrc.json,README.md,DESIGN_PROCESS.md,MANAGER_RESTART.md,REFERENCE_COMFY_DESKTOP.md}'
11+
- '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}'
12+
- '!{.env,.env.*,.npmrc}'
13+
- '!docs/*'
14+
- '!reference/*'
15+
asarUnpack:
16+
- node_modules/7zip-bin/**/*
17+
publish:
18+
provider: github
19+
owner: Kosinkadink
20+
repo: ComfyUI-Launcher
21+
artifactName: ComfyUI-Launcher-${version}-${os}-${arch}.${ext}
22+
win:
23+
target: nsis
24+
icon: assets/Comfy_Logo_x256.png
25+
nsis:
26+
oneClick: false
27+
perMachine: false
28+
allowToChangeInstallationDirectory: true
29+
mac:
30+
target:
31+
- dmg
32+
- zip
33+
icon: assets/Comfy_Logo_x512.png
34+
category: public.app-category.developer-tools
35+
linux:
36+
target:
37+
- AppImage
38+
- deb
39+
icon: assets/Comfy_Logo_x256.png
40+
category: Development

electron.vite.config.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { resolve } from 'path'
2+
import { defineConfig } from 'electron-vite'
3+
import vue from '@vitejs/plugin-vue'
4+
import tailwindcss from '@tailwindcss/vite'
5+
6+
export default defineConfig({
7+
main: {},
8+
preload: {},
9+
renderer: {
10+
resolve: {
11+
alias: {
12+
'@renderer': resolve('src/renderer/src')
13+
}
14+
},
15+
plugins: [vue(), tailwindcss()]
16+
}
17+
})

eslint.config.ts

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import pluginJs from '@eslint/js'
2+
import eslintConfigPrettier from 'eslint-config-prettier'
3+
import unusedImports from 'eslint-plugin-unused-imports'
4+
import pluginVue from 'eslint-plugin-vue'
5+
import { defineConfig } from 'eslint/config'
6+
import globals from 'globals'
7+
import {
8+
configs as tseslintConfigs,
9+
parser as tseslintParser
10+
} from 'typescript-eslint'
11+
import vueParser from 'vue-eslint-parser'
12+
13+
const extraFileExtensions = ['.vue']
14+
15+
const commonParserOptions = {
16+
parser: tseslintParser,
17+
projectService: true,
18+
tsConfigRootDir: import.meta.dirname,
19+
ecmaVersion: 2020,
20+
sourceType: 'module',
21+
extraFileExtensions
22+
} as const
23+
24+
export default defineConfig([
25+
{
26+
ignores: ['out/*', 'dist/*', 'node_modules/*']
27+
},
28+
{
29+
files: ['./**/*.{ts,mts}'],
30+
languageOptions: {
31+
globals: { ...globals.node },
32+
parserOptions: {
33+
...commonParserOptions,
34+
projectService: {
35+
allowDefaultProject: ['electron.vite.config.ts', 'eslint.config.ts']
36+
}
37+
}
38+
}
39+
},
40+
{
41+
files: ['./**/*.vue'],
42+
languageOptions: {
43+
globals: { ...globals.browser },
44+
parser: vueParser,
45+
parserOptions: commonParserOptions
46+
}
47+
},
48+
pluginJs.configs.recommended,
49+
tseslintConfigs.recommended,
50+
pluginVue.configs['flat/recommended'],
51+
eslintConfigPrettier,
52+
{
53+
plugins: {
54+
'unused-imports': unusedImports
55+
},
56+
rules: {
57+
'no-empty': ['error', { allowEmptyCatch: true }],
58+
'@typescript-eslint/no-explicit-any': 'off',
59+
'@typescript-eslint/no-unused-vars': 'off',
60+
'@typescript-eslint/consistent-type-imports': 'error',
61+
'@typescript-eslint/no-import-type-side-effects': 'error',
62+
'@typescript-eslint/no-empty-object-type': [
63+
'error',
64+
{ allowInterfaces: 'always' }
65+
],
66+
'unused-imports/no-unused-imports': 'error',
67+
'vue/no-v-html': 'off',
68+
'vue/multi-word-component-names': 'off',
69+
'vue/match-component-import-name': 'error',
70+
'vue/no-unused-properties': 'error',
71+
'vue/no-unused-refs': 'error',
72+
'vue/no-useless-mustaches': 'error',
73+
'vue/no-useless-v-bind': 'error',
74+
'vue/no-unused-emit-declarations': 'error',
75+
'vue/no-use-v-else-with-v-for': 'error',
76+
'vue/one-component-per-file': 'error'
77+
}
78+
}
79+
])

flake.nix

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)