Compare commits
104 Commits
drjkl/remo
...
bl-queue
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0c02dfca6 | ||
|
|
e6534f17e6 | ||
|
|
7e3c04399a | ||
|
|
2599136296 | ||
|
|
d7796fcda4 | ||
|
|
4404c0461d | ||
|
|
4cb03cf052 | ||
|
|
eeb0977738 | ||
|
|
9a505100ac | ||
|
|
21873d40d5 | ||
|
|
cbbbadf438 | ||
|
|
d2972220bb | ||
|
|
4e08ed64f0 | ||
|
|
13db1e484b | ||
|
|
8b7bc5eb89 | ||
|
|
fd474fe2aa | ||
|
|
b6b6455189 | ||
|
|
1455845a30 | ||
|
|
6b3a4d214b | ||
|
|
06b0eecfe4 | ||
|
|
b222cae56e | ||
|
|
8188029c6c | ||
|
|
b943c0fa75 | ||
|
|
c9da8b200d | ||
|
|
9f0fa7202d | ||
|
|
eda781ad37 | ||
|
|
ec3a77355f | ||
|
|
c56fff0b8b | ||
|
|
87f5480462 | ||
|
|
ea01723249 | ||
|
|
b2ea7b4a62 | ||
|
|
a234dac038 | ||
|
|
1461e371ad | ||
|
|
874ef3ba0c | ||
|
|
45ebc59033 | ||
|
|
fc1d040e06 | ||
|
|
8fc54646de | ||
|
|
fe0eaaefb3 | ||
|
|
99b3a59679 | ||
|
|
0616c049e4 | ||
|
|
34d5a4523a | ||
|
|
f62175ed0c | ||
|
|
d9157925f5 | ||
|
|
89f4452488 | ||
|
|
247080f0d7 | ||
|
|
61d0a12aae | ||
|
|
6617de771f | ||
|
|
893621265c | ||
|
|
338cbd4eed | ||
|
|
9a452fc31a | ||
|
|
0a73072ff1 | ||
|
|
e7745eb2be | ||
|
|
51f0f111ea | ||
|
|
d69c54820f | ||
|
|
3eedff3876 | ||
|
|
349f351f54 | ||
|
|
72ab84e37b | ||
|
|
022cf6dd8e | ||
|
|
2cb078cd9e | ||
|
|
dc0b729efa | ||
|
|
480f37e2f5 | ||
|
|
1df6187972 | ||
|
|
c636900487 | ||
|
|
f09590f269 | ||
|
|
07a74e3cdc | ||
|
|
ac9ebe1266 | ||
|
|
cd7310cb8c | ||
|
|
4e7e6e2bf3 | ||
|
|
1c6edd146b | ||
|
|
2c555efdfe | ||
|
|
59736c6d1d | ||
|
|
84e6e99f17 | ||
|
|
abf2b3b980 | ||
|
|
661885f5e5 | ||
|
|
5cff131144 | ||
|
|
038ed27107 | ||
|
|
139ae87983 | ||
|
|
b994608506 | ||
|
|
7b1cce1d0e | ||
|
|
39eca0bc0a | ||
|
|
2970692176 | ||
|
|
4b1c165d43 | ||
|
|
720de8cc8a | ||
|
|
48335475dc | ||
|
|
0d3d258995 | ||
|
|
3818ba5d17 | ||
|
|
5090f41028 | ||
|
|
7e4c756258 | ||
|
|
37fab21daf | ||
|
|
706ff953de | ||
|
|
9c97fb359d | ||
|
|
c662c77305 | ||
|
|
d0e81cdd33 | ||
|
|
01b3aeae68 | ||
|
|
20731fe3f0 | ||
|
|
bf9659fb2c | ||
|
|
e9352f613e | ||
|
|
d76b1abc46 | ||
|
|
fd757027a9 | ||
|
|
1efc2233c5 | ||
|
|
557b2fdb0e | ||
|
|
7fd2dc304a | ||
|
|
e8de474d42 | ||
|
|
3f291672d4 |
@@ -294,7 +294,6 @@ echo "Last stable release: $LAST_STABLE"
|
|||||||
1. Run complete test suite:
|
1. Run complete test suite:
|
||||||
```bash
|
```bash
|
||||||
pnpm test:unit
|
pnpm test:unit
|
||||||
pnpm test:component
|
|
||||||
```
|
```
|
||||||
2. Run type checking:
|
2. Run type checking:
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ echo "Available commands:"
|
|||||||
echo " pnpm dev - Start development server"
|
echo " pnpm dev - Start development server"
|
||||||
echo " pnpm build - Build for production"
|
echo " pnpm build - Build for production"
|
||||||
echo " pnpm test:unit - Run unit tests"
|
echo " pnpm test:unit - Run unit tests"
|
||||||
echo " pnpm test:component - Run component tests"
|
|
||||||
echo " pnpm typecheck - Run TypeScript checks"
|
echo " pnpm typecheck - Run TypeScript checks"
|
||||||
echo " pnpm lint - Run ESLint"
|
echo " pnpm lint - Run ESLint"
|
||||||
echo " pnpm format - Format code with Prettier"
|
echo " pnpm format - Format code with Prettier"
|
||||||
|
|||||||
55
.github/actions/setup-comfyui-server/action.yml
vendored
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
name: Setup ComfyUI Server
|
||||||
|
description: 'Setup ComfyUI server for continuous integration (with ComfyUI_devtools node installed)'
|
||||||
|
inputs:
|
||||||
|
extra_server_params:
|
||||||
|
description: 'Additional parameters to pass to ComfyUI server'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
launch_server:
|
||||||
|
description: 'Whether to launch the server after setup'
|
||||||
|
required: false
|
||||||
|
default: 'false'
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
# Note: this workflow assume frontend repo is checked out and is built in ../dist
|
||||||
|
|
||||||
|
# Checkout ComfyUI repo, install the dev_tools node and start server
|
||||||
|
- name: Checkout ComfyUI
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
repository: 'comfyanonymous/ComfyUI'
|
||||||
|
path: 'ComfyUI'
|
||||||
|
|
||||||
|
- name: Install ComfyUI_devtools from frontend repo
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
mkdir -p ComfyUI/custom_nodes/ComfyUI_devtools
|
||||||
|
if ! cp -r ./tools/devtools/* ComfyUI/custom_nodes/ComfyUI_devtools/; then
|
||||||
|
echo "::error::Failed to copy ComfyUI_devtools from ./tools/devtools/"
|
||||||
|
echo "::error::This action assumes the ComfyUI_frontend repository is checked out in the current working directory."
|
||||||
|
echo "::error::Please ensure you have run 'actions/checkout@v5' before calling this action."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.10'
|
||||||
|
|
||||||
|
- name: Install Python requirements
|
||||||
|
shell: bash
|
||||||
|
working-directory: ComfyUI
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
||||||
|
pip install -r requirements.txt
|
||||||
|
pip install wait-for-it
|
||||||
|
|
||||||
|
- name: Start ComfyUI server
|
||||||
|
if: ${{ inputs.launch_server == 'true' }}
|
||||||
|
shell: bash
|
||||||
|
working-directory: ComfyUI
|
||||||
|
run: |
|
||||||
|
python main.py --cpu --multi-user --front-end-root ../dist ${{ inputs.extra_server_params }} &
|
||||||
|
wait-for-it --service 127.0.0.1:8188 -t 600
|
||||||
68
.github/actions/setup-frontend/action.yml
vendored
@@ -1,31 +1,16 @@
|
|||||||
name: Setup Frontend
|
name: Setup ComfyUI Frontend
|
||||||
description: 'Setup ComfyUI frontend development environment'
|
description: 'Install nodejs/pnpm/dependencies and optionally build ComfyUI_frontend'
|
||||||
inputs:
|
inputs:
|
||||||
extra_server_params:
|
include_build_step:
|
||||||
description: 'Additional parameters to pass to ComfyUI server'
|
description: 'Include the build step to build the frontend. Set to true for workflows that need a built frontend'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: 'false'
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout ComfyUI
|
# Note: this workflow assume frontend repo is checked out in the root of the workspace
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
repository: 'comfyanonymous/ComfyUI'
|
|
||||||
path: 'ComfyUI'
|
|
||||||
|
|
||||||
- name: Checkout ComfyUI_frontend
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
repository: 'Comfy-Org/ComfyUI_frontend'
|
|
||||||
path: 'ComfyUI_frontend'
|
|
||||||
|
|
||||||
- name: Copy ComfyUI_devtools from frontend repo
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
mkdir -p ComfyUI/custom_nodes/ComfyUI_devtools
|
|
||||||
cp -r ComfyUI_frontend/tools/devtools/* ComfyUI/custom_nodes/ComfyUI_devtools/
|
|
||||||
|
|
||||||
|
# Install pnpm, Node.js, build frontend
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
with:
|
with:
|
||||||
@@ -36,32 +21,25 @@ runs:
|
|||||||
with:
|
with:
|
||||||
node-version: 'lts/*'
|
node-version: 'lts/*'
|
||||||
cache: 'pnpm'
|
cache: 'pnpm'
|
||||||
cache-dependency-path: 'ComfyUI_frontend/pnpm-lock.yaml'
|
cache-dependency-path: './pnpm-lock.yaml'
|
||||||
|
|
||||||
- name: Setup Python
|
# Restore tool caches before running any build/lint operations
|
||||||
uses: actions/setup-python@v4
|
- name: Restore tool output cache
|
||||||
|
uses: actions/cache/restore@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
path: |
|
||||||
|
./.cache
|
||||||
|
./tsconfig.tsbuildinfo
|
||||||
|
key: tool-cache-${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml') }}-${{ hashFiles('./src/**/*.{ts,vue,js,mts}', './*.config.*') }}
|
||||||
|
restore-keys: |
|
||||||
|
tool-cache-${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml') }}-
|
||||||
|
tool-cache-${{ runner.os }}-
|
||||||
|
|
||||||
- name: Install Python requirements
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ComfyUI
|
run: pnpm install --frozen-lockfile
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
|
||||||
pip install -r requirements.txt
|
|
||||||
pip install wait-for-it
|
|
||||||
|
|
||||||
- name: Build & Install ComfyUI_frontend
|
- name: Build ComfyUI_frontend
|
||||||
|
if: ${{ inputs.include_build_step == 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
working-directory: ComfyUI_frontend
|
run: pnpm build
|
||||||
run: |
|
|
||||||
pnpm install --frozen-lockfile
|
|
||||||
pnpm build
|
|
||||||
|
|
||||||
- name: Start ComfyUI server
|
|
||||||
shell: bash
|
|
||||||
working-directory: ComfyUI
|
|
||||||
run: |
|
|
||||||
python main.py --cpu --multi-user --front-end-root ../ComfyUI_frontend/dist ${{ inputs.extra_server_params }} &
|
|
||||||
wait-for-it --service 127.0.0.1:8188 -t 600
|
|
||||||
|
|||||||
28
.github/actions/setup-playwright/action.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: Setup Playwright
|
||||||
|
description: Cache and install Playwright browsers with dependencies
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Detect Playwright version
|
||||||
|
id: detect-version
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --json | jq --raw-output '.[0].devDependencies["@playwright/test"].version')
|
||||||
|
echo "playwright-version=$PLAYWRIGHT_VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Cache Playwright Browsers
|
||||||
|
uses: actions/cache@v4
|
||||||
|
id: cache-playwright-browsers
|
||||||
|
with:
|
||||||
|
path: '~/.cache/ms-playwright'
|
||||||
|
key: ${{ runner.os }}-playwright-browsers-${{ steps.detect-version.outputs.playwright-version }}
|
||||||
|
|
||||||
|
- name: Install Playwright Browsers
|
||||||
|
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
|
||||||
|
shell: bash
|
||||||
|
run: pnpm exec playwright install chromium --with-deps
|
||||||
|
|
||||||
|
- name: Install Playwright Browsers (operating system dependencies)
|
||||||
|
if: steps.cache-playwright-browsers.outputs.cache-hit == 'true'
|
||||||
|
shell: bash
|
||||||
|
run: pnpm exec playwright install-deps
|
||||||
29
.github/workflows/claude-pr-review.yml
vendored
@@ -11,6 +11,10 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
types: [labeled]
|
types: [labeled]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
wait-for-ci:
|
wait-for-ci:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -29,11 +33,9 @@ jobs:
|
|||||||
- name: Check if we should proceed
|
- name: Check if we should proceed
|
||||||
id: check-status
|
id: check-status
|
||||||
run: |
|
run: |
|
||||||
# Get all check runs for this commit
|
CHECK_RUNS=$(gh api repos/${{ github.repository }}/commits/${{ github.event.pull_request.head.sha }}/check-runs --jq '.check_runs[] | select(.name | test("lint-and-format")) | {name, conclusion}')
|
||||||
CHECK_RUNS=$(gh api repos/${{ github.repository }}/commits/${{ github.event.pull_request.head.sha }}/check-runs --jq '.check_runs[] | select(.name | test("lint-and-format|test|playwright-tests")) | {name, conclusion}')
|
|
||||||
|
if echo "$CHECK_RUNS" | grep -Eq '"conclusion": "(failure|cancelled|timed_out|action_required)"'; then
|
||||||
# Check if any required checks failed
|
|
||||||
if echo "$CHECK_RUNS" | grep -q '"conclusion": "failure"'; then
|
|
||||||
echo "Some CI checks failed - skipping Claude review"
|
echo "Some CI checks failed - skipping Claude review"
|
||||||
echo "proceed=false" >> $GITHUB_OUTPUT
|
echo "proceed=false" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
@@ -53,6 +55,7 @@ jobs:
|
|||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
ref: refs/pull/${{ github.event.pull_request.number }}/head
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
@@ -74,10 +77,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
label_trigger: "claude-review"
|
label_trigger: "claude-review"
|
||||||
prompt: |
|
prompt: |
|
||||||
Read the file .claude/commands/comprehensive-pr-review.md and follow ALL the instructions exactly.
|
Read the file .claude/commands/comprehensive-pr-review.md and follow ALL the instructions exactly.
|
||||||
|
|
||||||
CRITICAL: You must post individual inline comments using the gh api commands shown in the file.
|
CRITICAL: You must post individual inline comments using the gh api commands shown in the file.
|
||||||
DO NOT create a summary comment.
|
DO NOT create a summary comment.
|
||||||
Each issue must be posted as a separate inline comment on the specific line of code.
|
Each issue must be posted as a separate inline comment on the specific line of code.
|
||||||
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||||
claude_args: "--max-turns 256 --allowedTools 'Bash(git:*),Bash(gh api:*),Bash(gh pr:*),Bash(gh repo:*),Bash(jq:*),Bash(echo:*),Read,Write,Edit,Glob,Grep,WebFetch'"
|
claude_args: "--max-turns 256 --allowedTools 'Bash(git:*),Bash(gh api:*),Bash(gh pr:*),Bash(gh repo:*),Bash(jq:*),Bash(echo:*),Read,Write,Edit,Glob,Grep,WebFetch'"
|
||||||
@@ -86,4 +89,10 @@ jobs:
|
|||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
COMMIT_SHA: ${{ github.event.pull_request.head.sha }}
|
||||||
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||||
REPOSITORY: ${{ github.repository }}
|
REPOSITORY: ${{ github.repository }}
|
||||||
|
|
||||||
|
- name: Remove claude-review label
|
||||||
|
if: always()
|
||||||
|
run: gh pr edit ${{ github.event.pull_request.number }} --remove-label "claude-review"
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
12
.github/workflows/lint-and-format.yaml
vendored
@@ -4,6 +4,10 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches-ignore: [wip/*, draft/*, temp/*]
|
branches-ignore: [wip/*, draft/*, temp/*]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
@@ -15,9 +19,7 @@ jobs:
|
|||||||
- name: Checkout PR
|
- name: Checkout PR
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || github.ref }}
|
||||||
ref: ${{ github.event.pull_request.head.ref }}
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Install pnpm
|
- name: Install pnpm
|
||||||
uses: pnpm/action-setup@v4
|
uses: pnpm/action-setup@v4
|
||||||
@@ -69,7 +71,7 @@ jobs:
|
|||||||
git config --local user.email "action@github.com"
|
git config --local user.email "action@github.com"
|
||||||
git config --local user.name "GitHub Action"
|
git config --local user.name "GitHub Action"
|
||||||
git add .
|
git add .
|
||||||
git commit -m "[auto-fix] Apply ESLint and Prettier fixes"
|
git commit -m "[automated] Apply ESLint and Prettier fixes"
|
||||||
git push
|
git push
|
||||||
|
|
||||||
- name: Final validation
|
- name: Final validation
|
||||||
@@ -102,4 +104,4 @@ jobs:
|
|||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
body: '## ⚠️ Linting/Formatting Issues Found\n\nThis PR has linting or formatting issues that need to be fixed.\n\n**Since this PR is from a fork, auto-fix cannot be applied automatically.**\n\n### Option 1: Set up pre-commit hooks (recommended)\nRun this once to automatically format code on every commit:\n```bash\npnpm prepare\n```\n\n### Option 2: Fix manually\nRun these commands and push the changes:\n```bash\npnpm lint:fix\npnpm format\n```\n\nSee [CONTRIBUTING.md](https://github.com/Comfy-Org/ComfyUI_frontend/blob/main/CONTRIBUTING.md#git-pre-commit-hooks) for more details.'
|
body: '## ⚠️ Linting/Formatting Issues Found\n\nThis PR has linting or formatting issues that need to be fixed.\n\n**Since this PR is from a fork, auto-fix cannot be applied automatically.**\n\n### Option 1: Set up pre-commit hooks (recommended)\nRun this once to automatically format code on every commit:\n```bash\npnpm prepare\n```\n\n### Option 2: Fix manually\nRun these commands and push the changes:\n```bash\npnpm lint:fix\npnpm format\n```\n\nSee [CONTRIBUTING.md](https://github.com/Comfy-Org/ComfyUI_frontend/blob/main/CONTRIBUTING.md#git-pre-commit-hooks) for more details.'
|
||||||
})
|
})
|
||||||
|
|||||||
59
.github/workflows/publish-desktop-ui-on-merge.yaml
vendored
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
name: Publish Desktop UI on PR Merge
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [ closed ]
|
||||||
|
branches: [ main, core/* ]
|
||||||
|
paths:
|
||||||
|
- 'apps/desktop-ui/package.json'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
resolve:
|
||||||
|
name: Resolve Version and Dist Tag
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: >
|
||||||
|
github.event.pull_request.merged == true &&
|
||||||
|
contains(github.event.pull_request.labels.*.name, 'Release')
|
||||||
|
outputs:
|
||||||
|
version: ${{ steps.get_version.outputs.version }}
|
||||||
|
dist_tag: ${{ steps.dist.outputs.dist_tag }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.pull_request.merge_commit_sha }}
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v5
|
||||||
|
with:
|
||||||
|
node-version: '24.x'
|
||||||
|
|
||||||
|
- name: Read desktop-ui version
|
||||||
|
id: get_version
|
||||||
|
run: |
|
||||||
|
VERSION=$(node -p "require('./apps/desktop-ui/package.json').version")
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Determine dist-tag
|
||||||
|
id: dist
|
||||||
|
env:
|
||||||
|
VERSION: ${{ steps.get_version.outputs.version }}
|
||||||
|
run: |
|
||||||
|
if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+- ]]; then
|
||||||
|
echo "dist_tag=next" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "dist_tag=latest" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
publish:
|
||||||
|
name: Publish Desktop UI to npm
|
||||||
|
needs: resolve
|
||||||
|
uses: ./.github/workflows/publish-desktop-ui.yaml
|
||||||
|
with:
|
||||||
|
version: ${{ needs.resolve.outputs.version }}
|
||||||
|
dist_tag: ${{ needs.resolve.outputs.dist_tag }}
|
||||||
|
ref: ${{ github.event.pull_request.merge_commit_sha }}
|
||||||
|
secrets:
|
||||||
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
205
.github/workflows/publish-desktop-ui.yaml
vendored
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
name: Publish Desktop UI
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
description: 'Version to publish (e.g., 1.2.3)'
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
dist_tag:
|
||||||
|
description: 'npm dist-tag to use'
|
||||||
|
required: true
|
||||||
|
default: latest
|
||||||
|
type: string
|
||||||
|
ref:
|
||||||
|
description: 'Git ref to checkout (commit SHA, tag, or branch)'
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
version:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
dist_tag:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: latest
|
||||||
|
ref:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
secrets:
|
||||||
|
NPM_TOKEN:
|
||||||
|
required: true
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: publish-desktop-ui-${{ github.workflow }}-${{ inputs.version }}-${{ inputs.dist_tag }}
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish_desktop_ui:
|
||||||
|
name: Publish @comfyorg/desktop-ui
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
env:
|
||||||
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
|
||||||
|
steps:
|
||||||
|
- name: Validate inputs
|
||||||
|
env:
|
||||||
|
VERSION: ${{ inputs.version }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
SEMVER_REGEX='^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*)(\.(0|[1-9][0-9]*|[0-9]*[A-Za-z-][0-9A-Za-z-]*))*))?(\+([0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*))?$'
|
||||||
|
if [[ ! "$VERSION" =~ $SEMVER_REGEX ]]; then
|
||||||
|
echo "::error title=Invalid version::Version '$VERSION' must follow semantic versioning (x.y.z[-suffix][+build])" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Determine ref to checkout
|
||||||
|
id: resolve_ref
|
||||||
|
env:
|
||||||
|
REF: ${{ inputs.ref }}
|
||||||
|
VERSION: ${{ inputs.version }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
if [ -n "$REF" ]; then
|
||||||
|
if ! git check-ref-format --allow-onelevel "$REF"; then
|
||||||
|
echo "::error title=Invalid ref::Ref '$REF' fails git check-ref-format validation." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "ref=$REF" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "ref=refs/tags/v$VERSION" >> "$GITHUB_OUTPUT"
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
ref: ${{ steps.resolve_ref.outputs.ref }}
|
||||||
|
fetch-depth: 1
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 10
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v5
|
||||||
|
with:
|
||||||
|
node-version: '24.x'
|
||||||
|
cache: 'pnpm'
|
||||||
|
registry-url: https://registry.npmjs.org
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile --ignore-scripts
|
||||||
|
|
||||||
|
- name: Build Desktop UI
|
||||||
|
run: pnpm build:desktop
|
||||||
|
|
||||||
|
- name: Prepare npm package
|
||||||
|
id: pkg
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
APP_PKG=apps/desktop-ui/package.json
|
||||||
|
ROOT_PKG=package.json
|
||||||
|
|
||||||
|
NAME=$(jq -r .name "$APP_PKG")
|
||||||
|
APP_VERSION=$(jq -r .version "$APP_PKG")
|
||||||
|
ROOT_LICENSE=$(jq -r .license "$ROOT_PKG")
|
||||||
|
REPO=$(jq -r .repository "$ROOT_PKG")
|
||||||
|
|
||||||
|
if [ -z "$NAME" ] || [ "$NAME" = "null" ]; then
|
||||||
|
echo "::error title=Missing name::apps/desktop-ui/package.json is missing 'name'" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
INPUT_VERSION="${{ inputs.version }}"
|
||||||
|
if [ "$APP_VERSION" != "$INPUT_VERSION" ]; then
|
||||||
|
echo "::error title=Version mismatch::apps/desktop-ui version $APP_VERSION does not match input $INPUT_VERSION" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -d apps/desktop-ui/dist ]; then
|
||||||
|
echo "::error title=Missing build::apps/desktop-ui/dist not found. Did build succeed?" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
PUBLISH_DIR=apps/desktop-ui/.npm-publish
|
||||||
|
rm -rf "$PUBLISH_DIR"
|
||||||
|
mkdir -p "$PUBLISH_DIR"
|
||||||
|
cp -R apps/desktop-ui/dist "$PUBLISH_DIR/dist"
|
||||||
|
|
||||||
|
INPUT_VERSION="${{ inputs.version }}"
|
||||||
|
jq -n \
|
||||||
|
--arg name "$NAME" \
|
||||||
|
--arg version "$INPUT_VERSION" \
|
||||||
|
--arg description "Static assets for the ComfyUI Desktop UI" \
|
||||||
|
--arg license "$ROOT_LICENSE" \
|
||||||
|
--arg repository "$REPO" \
|
||||||
|
'{
|
||||||
|
name: $name,
|
||||||
|
version: $version,
|
||||||
|
description: $description,
|
||||||
|
license: $license,
|
||||||
|
repository: $repository,
|
||||||
|
type: "module",
|
||||||
|
private: false,
|
||||||
|
files: ["dist"],
|
||||||
|
publishConfig: { access: "public" }
|
||||||
|
}' > "$PUBLISH_DIR/package.json"
|
||||||
|
|
||||||
|
if [ -f apps/desktop-ui/README.md ]; then
|
||||||
|
cp apps/desktop-ui/README.md "$PUBLISH_DIR/README.md"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "publish_dir=$PUBLISH_DIR" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "name=$NAME" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Pack (preview only)
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{ steps.pkg.outputs.publish_dir }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
npm pack --json | tee pack-result.json
|
||||||
|
|
||||||
|
- name: Upload package tarball artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: desktop-ui-npm-tarball-${{ inputs.version }}
|
||||||
|
path: ${{ steps.pkg.outputs.publish_dir }}/*.tgz
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- name: Check if version already on npm
|
||||||
|
id: check_npm
|
||||||
|
env:
|
||||||
|
NAME: ${{ steps.pkg.outputs.name }}
|
||||||
|
VER: ${{ inputs.version }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
STATUS=0
|
||||||
|
OUTPUT=$(npm view "${NAME}@${VER}" --json 2>&1) || STATUS=$?
|
||||||
|
if [ "$STATUS" -eq 0 ]; then
|
||||||
|
echo "exists=true" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "::warning title=Already published::${NAME}@${VER} already exists on npm. Skipping publish."
|
||||||
|
else
|
||||||
|
if echo "$OUTPUT" | grep -q "E404"; then
|
||||||
|
echo "exists=false" >> "$GITHUB_OUTPUT"
|
||||||
|
else
|
||||||
|
echo "::error title=Registry lookup failed::$OUTPUT" >&2
|
||||||
|
exit "$STATUS"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Publish package
|
||||||
|
if: steps.check_npm.outputs.exists == 'false'
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
DIST_TAG: ${{ inputs.dist_tag }}
|
||||||
|
run: pnpm publish --access public --tag "$DIST_TAG" --no-git-checks --ignore-scripts
|
||||||
|
working-directory: ${{ steps.pkg.outputs.publish_dir }}
|
||||||
52
.github/workflows/test-browser-exp.yaml
vendored
@@ -1,52 +0,0 @@
|
|||||||
# Setting test expectation screenshots for Playwright
|
|
||||||
name: Update Playwright Expectations
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [ labeled ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event.label.name == 'New Browser Test Expectations'
|
|
||||||
steps:
|
|
||||||
- name: Checkout workflow repo
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
- name: Setup Frontend
|
|
||||||
uses: ./.github/actions/setup-frontend
|
|
||||||
- name: Cache Playwright browsers
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: ~/.cache/ms-playwright
|
|
||||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
playwright-browsers-${{ runner.os }}-
|
|
||||||
- name: Install Playwright Browsers
|
|
||||||
run: pnpm exec playwright install chromium --with-deps
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Run Playwright tests and update snapshots
|
|
||||||
id: playwright-tests
|
|
||||||
run: pnpm exec playwright test --update-snapshots
|
|
||||||
continue-on-error: true
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: playwright-report
|
|
||||||
path: ComfyUI_frontend/playwright-report/
|
|
||||||
retention-days: 30
|
|
||||||
- name: Debugging info
|
|
||||||
run: |
|
|
||||||
echo "Branch: ${{ github.head_ref }}"
|
|
||||||
git status
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Commit updated expectations
|
|
||||||
run: |
|
|
||||||
git config --global user.name 'github-actions'
|
|
||||||
git config --global user.email 'github-actions@github.com'
|
|
||||||
git fetch origin ${{ github.head_ref }}
|
|
||||||
git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
|
|
||||||
git add browser_tests
|
|
||||||
git commit -m "Update test expectations [skip ci]"
|
|
||||||
git push origin HEAD:${{ github.head_ref }}
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
357
.github/workflows/test-ui.yaml
vendored
@@ -1,357 +0,0 @@
|
|||||||
name: Tests CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main, master, core/*, desktop/*]
|
|
||||||
pull_request:
|
|
||||||
branches-ignore:
|
|
||||||
[wip/*, draft/*, temp/*, vue-nodes-migration, sno-playwright-*]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
setup:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
outputs:
|
|
||||||
cache-key: ${{ steps.cache-key.outputs.key }}
|
|
||||||
playwright-version: ${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout ComfyUI
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
repository: 'comfyanonymous/ComfyUI'
|
|
||||||
path: 'ComfyUI'
|
|
||||||
ref: master
|
|
||||||
|
|
||||||
- name: Checkout ComfyUI_frontend
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
repository: 'Comfy-Org/ComfyUI_frontend'
|
|
||||||
path: 'ComfyUI_frontend'
|
|
||||||
|
|
||||||
- name: Copy ComfyUI_devtools from frontend repo
|
|
||||||
run: |
|
|
||||||
mkdir -p ComfyUI/custom_nodes/ComfyUI_devtools
|
|
||||||
cp -r ComfyUI_frontend/tools/devtools/* ComfyUI/custom_nodes/ComfyUI_devtools/
|
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: lts/*
|
|
||||||
cache: 'pnpm'
|
|
||||||
cache-dependency-path: 'ComfyUI_frontend/pnpm-lock.yaml'
|
|
||||||
|
|
||||||
- name: Cache tool outputs
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
ComfyUI_frontend/.cache
|
|
||||||
ComfyUI_frontend/tsconfig.tsbuildinfo
|
|
||||||
key: playwright-setup-cache-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}-${{ hashFiles('ComfyUI_frontend/src/**/*.{ts,vue,js}', 'ComfyUI_frontend/*.config.*') }}
|
|
||||||
restore-keys: |
|
|
||||||
playwright-setup-cache-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}-
|
|
||||||
playwright-setup-cache-${{ runner.os }}-
|
|
||||||
playwright-tools-cache-${{ runner.os }}-
|
|
||||||
|
|
||||||
- name: Build ComfyUI_frontend
|
|
||||||
run: |
|
|
||||||
pnpm install --frozen-lockfile
|
|
||||||
pnpm build
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
|
||||||
- name: Generate cache key
|
|
||||||
id: cache-key
|
|
||||||
run: echo "key=$(date +%s)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Playwright Version
|
|
||||||
id: playwright-version
|
|
||||||
run: |
|
|
||||||
PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --json | jq --raw-output '.[0].devDependencies["@playwright/test"].version')
|
|
||||||
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_OUTPUT
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
|
||||||
- name: Save cache
|
|
||||||
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
ComfyUI
|
|
||||||
ComfyUI_frontend
|
|
||||||
key: comfyui-setup-${{ steps.cache-key.outputs.key }}
|
|
||||||
|
|
||||||
# Sharded chromium tests
|
|
||||||
playwright-tests-chromium-sharded:
|
|
||||||
needs: setup
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8]
|
|
||||||
shardTotal: [8]
|
|
||||||
steps:
|
|
||||||
- name: Wait for cache propagation
|
|
||||||
run: sleep 10
|
|
||||||
|
|
||||||
- name: Restore cached setup
|
|
||||||
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684
|
|
||||||
with:
|
|
||||||
fail-on-cache-miss: true
|
|
||||||
path: |
|
|
||||||
ComfyUI
|
|
||||||
ComfyUI_frontend
|
|
||||||
key: comfyui-setup-${{ needs.setup.outputs.cache-key }}
|
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.10'
|
|
||||||
cache: 'pip'
|
|
||||||
|
|
||||||
- name: Install requirements
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
|
||||||
pip install -r requirements.txt
|
|
||||||
pip install wait-for-it
|
|
||||||
working-directory: ComfyUI
|
|
||||||
|
|
||||||
|
|
||||||
- name: Cache Playwright Browsers
|
|
||||||
uses: actions/cache@v4
|
|
||||||
id: cache-playwright-browsers
|
|
||||||
with:
|
|
||||||
path: '~/.cache/ms-playwright'
|
|
||||||
key: '${{ runner.os }}-playwright-browsers-${{ needs.setup.outputs.playwright-version }}'
|
|
||||||
|
|
||||||
- name: Install Playwright Browsers
|
|
||||||
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
|
|
||||||
run: pnpm exec playwright install chromium --with-deps
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
|
||||||
- name: Install Playwright Browsers (operating system dependencies)
|
|
||||||
if: steps.cache-playwright-browsers.outputs.cache-hit == 'true'
|
|
||||||
run: pnpm exec playwright install-deps
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
|
||||||
- name: Start ComfyUI server
|
|
||||||
run: |
|
|
||||||
python main.py --cpu --multi-user --front-end-root ../ComfyUI_frontend/dist &
|
|
||||||
wait-for-it --service 127.0.0.1:8188 -t 600
|
|
||||||
working-directory: ComfyUI
|
|
||||||
|
|
||||||
- name: Run Playwright tests (Shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
|
|
||||||
id: playwright
|
|
||||||
run: pnpm exec playwright test --project=chromium --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=blob
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
env:
|
|
||||||
PLAYWRIGHT_BLOB_OUTPUT_DIR: ../blob-report
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
if: ${{ !cancelled() }}
|
|
||||||
with:
|
|
||||||
name: blob-report-chromium-${{ matrix.shardIndex }}
|
|
||||||
path: blob-report/
|
|
||||||
retention-days: 1
|
|
||||||
|
|
||||||
playwright-tests:
|
|
||||||
# Ideally, each shard runs test in 6 minutes, but allow up to 15 minutes
|
|
||||||
timeout-minutes: 15
|
|
||||||
needs: setup
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
browser: [chromium-2x, chromium-0.5x, mobile-chrome]
|
|
||||||
steps:
|
|
||||||
- name: Wait for cache propagation
|
|
||||||
run: sleep 10
|
|
||||||
|
|
||||||
- name: Restore cached setup
|
|
||||||
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684
|
|
||||||
with:
|
|
||||||
fail-on-cache-miss: true
|
|
||||||
path: |
|
|
||||||
ComfyUI
|
|
||||||
ComfyUI_frontend
|
|
||||||
key: comfyui-setup-${{ needs.setup.outputs.cache-key }}
|
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.10'
|
|
||||||
cache: 'pip'
|
|
||||||
|
|
||||||
- name: Install requirements
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
|
||||||
pip install -r requirements.txt
|
|
||||||
pip install wait-for-it
|
|
||||||
working-directory: ComfyUI
|
|
||||||
|
|
||||||
- name: Cache Playwright Browsers
|
|
||||||
uses: actions/cache@v4
|
|
||||||
id: cache-playwright-browsers
|
|
||||||
with:
|
|
||||||
path: '~/.cache/ms-playwright'
|
|
||||||
key: '${{ runner.os }}-playwright-browsers-${{ needs.setup.outputs.playwright-version }}'
|
|
||||||
|
|
||||||
- name: Install Playwright Browsers
|
|
||||||
if: steps.cache-playwright-browsers.outputs.cache-hit != 'true'
|
|
||||||
run: pnpm exec playwright install chromium --with-deps
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
|
||||||
- name: Install Playwright Browsers (operating system dependencies)
|
|
||||||
if: steps.cache-playwright-browsers.outputs.cache-hit == 'true'
|
|
||||||
run: pnpm exec playwright install-deps
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
|
||||||
- name: Start ComfyUI server
|
|
||||||
run: |
|
|
||||||
python main.py --cpu --multi-user --front-end-root ../ComfyUI_frontend/dist &
|
|
||||||
wait-for-it --service 127.0.0.1:8188 -t 600
|
|
||||||
working-directory: ComfyUI
|
|
||||||
|
|
||||||
- name: Run Playwright tests (${{ matrix.browser }})
|
|
||||||
id: playwright
|
|
||||||
run: |
|
|
||||||
# Run tests with both HTML and JSON reporters
|
|
||||||
PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/report.json \
|
|
||||||
pnpm exec playwright test --project=${{ matrix.browser }} \
|
|
||||||
--reporter=list \
|
|
||||||
--reporter=html \
|
|
||||||
--reporter=json
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
name: playwright-report-${{ matrix.browser }}
|
|
||||||
path: ComfyUI_frontend/playwright-report/
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
# Merge sharded test reports
|
|
||||||
merge-reports:
|
|
||||||
needs: [playwright-tests-chromium-sharded]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ !cancelled() }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout ComfyUI_frontend
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
with:
|
|
||||||
repository: 'Comfy-Org/ComfyUI_frontend'
|
|
||||||
path: 'ComfyUI_frontend'
|
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: lts/*
|
|
||||||
cache: 'pnpm'
|
|
||||||
cache-dependency-path: 'ComfyUI_frontend/pnpm-lock.yaml'
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
pnpm install --frozen-lockfile
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
|
||||||
- name: Download blob reports
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: ComfyUI_frontend/all-blob-reports
|
|
||||||
pattern: blob-report-chromium-*
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: Merge into HTML Report
|
|
||||||
run: |
|
|
||||||
# Generate HTML report
|
|
||||||
pnpm exec playwright merge-reports --reporter=html ./all-blob-reports
|
|
||||||
# Generate JSON report separately with explicit output path
|
|
||||||
PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/report.json \
|
|
||||||
pnpm exec playwright merge-reports --reporter=json ./all-blob-reports
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
|
||||||
- name: Upload HTML report
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: playwright-report-chromium
|
|
||||||
path: ComfyUI_frontend/playwright-report/
|
|
||||||
retention-days: 30
|
|
||||||
|
|
||||||
#### BEGIN Deployment and commenting (non-forked PRs only)
|
|
||||||
# when using pull_request event, we have permission to comment directly
|
|
||||||
# if its a forked repo, we need to use workflow_run event in a separate workflow (pr-playwright-deploy.yaml)
|
|
||||||
|
|
||||||
# Post starting comment for non-forked PRs
|
|
||||||
comment-on-pr-start:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Get start time
|
|
||||||
id: start-time
|
|
||||||
run: echo "time=$(date -u '+%m/%d/%Y, %I:%M:%S %p')" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Post starting comment
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
run: |
|
|
||||||
chmod +x scripts/cicd/pr-playwright-deploy-and-comment.sh
|
|
||||||
./scripts/cicd/pr-playwright-deploy-and-comment.sh \
|
|
||||||
"${{ github.event.pull_request.number }}" \
|
|
||||||
"${{ github.head_ref }}" \
|
|
||||||
"starting" \
|
|
||||||
"${{ steps.start-time.outputs.time }}"
|
|
||||||
|
|
||||||
# Deploy and comment for non-forked PRs only
|
|
||||||
deploy-and-comment:
|
|
||||||
needs: [playwright-tests, merge-reports]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: always() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
contents: read
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Download all playwright reports
|
|
||||||
uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
pattern: playwright-report-*
|
|
||||||
path: reports
|
|
||||||
|
|
||||||
- name: Make deployment script executable
|
|
||||||
run: chmod +x scripts/cicd/pr-playwright-deploy-and-comment.sh
|
|
||||||
|
|
||||||
- name: Deploy reports and comment on PR
|
|
||||||
env:
|
|
||||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
||||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
run: |
|
|
||||||
./scripts/cicd/pr-playwright-deploy-and-comment.sh \
|
|
||||||
"${{ github.event.pull_request.number }}" \
|
|
||||||
"${{ github.head_ref }}" \
|
|
||||||
"completed"
|
|
||||||
#### END Deployment and commenting (non-forked PRs only)
|
|
||||||
235
.github/workflows/tests-ci.yaml
vendored
Normal file
@@ -0,0 +1,235 @@
|
|||||||
|
name: Tests CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main, master, core/*, desktop/*]
|
||||||
|
pull_request:
|
||||||
|
branches-ignore:
|
||||||
|
[wip/*, draft/*, temp/*, vue-nodes-migration, sno-playwright-*]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
setup:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
cache-key: ${{ steps.cache-key.outputs.key }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
# Setup Test Environment, build frontend but do not start server yet
|
||||||
|
- name: Setup ComfyUI server
|
||||||
|
uses: ./.github/actions/setup-comfyui-server
|
||||||
|
- name: Setup frontend
|
||||||
|
uses: ./.github/actions/setup-frontend
|
||||||
|
with:
|
||||||
|
include_build_step: true
|
||||||
|
- name: Setup Playwright
|
||||||
|
uses: ./.github/actions/setup-playwright # Setup Playwright and cache browsers
|
||||||
|
|
||||||
|
# Save the entire workspace as cache for later test jobs to restore
|
||||||
|
- name: Generate cache key
|
||||||
|
id: cache-key
|
||||||
|
run: echo "key=$(date +%s)" >> $GITHUB_OUTPUT
|
||||||
|
- name: Save cache
|
||||||
|
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684
|
||||||
|
with:
|
||||||
|
path: .
|
||||||
|
key: comfyui-setup-${{ steps.cache-key.outputs.key }}
|
||||||
|
|
||||||
|
# Sharded chromium tests
|
||||||
|
playwright-tests-chromium-sharded:
|
||||||
|
needs: setup
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8]
|
||||||
|
shardTotal: [8]
|
||||||
|
steps:
|
||||||
|
# download built frontend repo from setup job
|
||||||
|
- name: Wait for cache propagation
|
||||||
|
run: sleep 10
|
||||||
|
- name: Restore cached setup
|
||||||
|
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684
|
||||||
|
with:
|
||||||
|
fail-on-cache-miss: true
|
||||||
|
path: .
|
||||||
|
key: comfyui-setup-${{ needs.setup.outputs.cache-key }}
|
||||||
|
|
||||||
|
# Setup Test Environment for this runner, start server, use cached built frontend ./dist from 'setup' job
|
||||||
|
- name: Setup ComfyUI server
|
||||||
|
uses: ./.github/actions/setup-comfyui-server
|
||||||
|
with:
|
||||||
|
launch_server: true
|
||||||
|
- name: Setup nodejs, pnpm, reuse built frontend
|
||||||
|
uses: ./.github/actions/setup-frontend
|
||||||
|
- name: Setup Playwright
|
||||||
|
uses: ./.github/actions/setup-playwright
|
||||||
|
|
||||||
|
# Run sharded tests and upload sharded reports
|
||||||
|
- name: Run Playwright tests (Shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }})
|
||||||
|
id: playwright
|
||||||
|
run: pnpm exec playwright test --project=chromium --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --reporter=blob
|
||||||
|
env:
|
||||||
|
PLAYWRIGHT_BLOB_OUTPUT_DIR: ./blob-report
|
||||||
|
|
||||||
|
- name: Upload blob report
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
if: ${{ !cancelled() }}
|
||||||
|
with:
|
||||||
|
name: blob-report-chromium-${{ matrix.shardIndex }}
|
||||||
|
path: blob-report/
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
playwright-tests:
|
||||||
|
# Ideally, each shard runs test in 6 minutes, but allow up to 15 minutes
|
||||||
|
timeout-minutes: 15
|
||||||
|
needs: setup
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
browser: [chromium-2x, chromium-0.5x, mobile-chrome]
|
||||||
|
steps:
|
||||||
|
# download built frontend repo from setup job
|
||||||
|
- name: Wait for cache propagation
|
||||||
|
run: sleep 10
|
||||||
|
- name: Restore cached setup
|
||||||
|
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684
|
||||||
|
with:
|
||||||
|
fail-on-cache-miss: true
|
||||||
|
path: .
|
||||||
|
key: comfyui-setup-${{ needs.setup.outputs.cache-key }}
|
||||||
|
|
||||||
|
# Setup Test Environment for this runner, start server, use cached built frontend ./dist from 'setup' job
|
||||||
|
- name: Setup ComfyUI server
|
||||||
|
uses: ./.github/actions/setup-comfyui-server
|
||||||
|
with:
|
||||||
|
launch_server: true
|
||||||
|
- name: Setup nodejs, pnpm, reuse built frontend
|
||||||
|
uses: ./.github/actions/setup-frontend
|
||||||
|
- name: Setup Playwright
|
||||||
|
uses: ./.github/actions/setup-playwright
|
||||||
|
|
||||||
|
# Run tests and upload reports
|
||||||
|
- name: Run Playwright tests (${{ matrix.browser }})
|
||||||
|
id: playwright
|
||||||
|
run: |
|
||||||
|
# Run tests with both HTML and JSON reporters
|
||||||
|
PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/report.json \
|
||||||
|
pnpm exec playwright test --project=${{ matrix.browser }} \
|
||||||
|
--reporter=list \
|
||||||
|
--reporter=html \
|
||||||
|
--reporter=json
|
||||||
|
|
||||||
|
- name: Upload Playwright report
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: playwright-report-${{ matrix.browser }}
|
||||||
|
path: ./playwright-report/
|
||||||
|
retention-days: 30
|
||||||
|
|
||||||
|
# Merge sharded test reports
|
||||||
|
merge-reports:
|
||||||
|
needs: [playwright-tests-chromium-sharded]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ !cancelled() }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
# Setup Test Environment, we only need playwright to merge reports
|
||||||
|
- name: Setup frontend
|
||||||
|
uses: ./.github/actions/setup-frontend
|
||||||
|
- name: Setup Playwright
|
||||||
|
uses: ./.github/actions/setup-playwright
|
||||||
|
|
||||||
|
- name: Download blob reports
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
path: ./all-blob-reports
|
||||||
|
pattern: blob-report-chromium-*
|
||||||
|
merge-multiple: true
|
||||||
|
|
||||||
|
- name: Merge into HTML Report
|
||||||
|
run: |
|
||||||
|
# Generate HTML report
|
||||||
|
pnpm exec playwright merge-reports --reporter=html ./all-blob-reports
|
||||||
|
# Generate JSON report separately with explicit output path
|
||||||
|
PLAYWRIGHT_JSON_OUTPUT_NAME=playwright-report/report.json \
|
||||||
|
pnpm exec playwright merge-reports --reporter=json ./all-blob-reports
|
||||||
|
|
||||||
|
- name: Upload HTML report
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: playwright-report-chromium
|
||||||
|
path: ./playwright-report/
|
||||||
|
retention-days: 30
|
||||||
|
|
||||||
|
#### BEGIN Deployment and commenting (non-forked PRs only)
|
||||||
|
# when using pull_request event, we have permission to comment directly
|
||||||
|
# if its a forked repo, we need to use workflow_run event in a separate workflow (pr-playwright-deploy.yaml)
|
||||||
|
|
||||||
|
# Post starting comment for non-forked PRs
|
||||||
|
comment-on-pr-start:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Get start time
|
||||||
|
id: start-time
|
||||||
|
run: echo "time=$(date -u '+%m/%d/%Y, %I:%M:%S %p')" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Post starting comment
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
chmod +x scripts/cicd/pr-playwright-deploy-and-comment.sh
|
||||||
|
./scripts/cicd/pr-playwright-deploy-and-comment.sh \
|
||||||
|
"${{ github.event.pull_request.number }}" \
|
||||||
|
"${{ github.head_ref }}" \
|
||||||
|
"starting" \
|
||||||
|
"${{ steps.start-time.outputs.time }}"
|
||||||
|
|
||||||
|
# Deploy and comment for non-forked PRs only
|
||||||
|
deploy-and-comment:
|
||||||
|
needs: [playwright-tests, merge-reports]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: always() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == false
|
||||||
|
permissions:
|
||||||
|
pull-requests: write
|
||||||
|
contents: read
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Download all playwright reports
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
pattern: playwright-report-*
|
||||||
|
path: reports
|
||||||
|
|
||||||
|
- name: Deploy reports and comment on PR
|
||||||
|
env:
|
||||||
|
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||||
|
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
bash ./scripts/cicd/pr-playwright-deploy-and-comment.sh \
|
||||||
|
"${{ github.event.pull_request.number }}" \
|
||||||
|
"${{ github.head_ref }}" \
|
||||||
|
"completed"
|
||||||
|
#### END Deployment and commenting (non-forked PRs only)
|
||||||
@@ -21,91 +21,64 @@ jobs:
|
|||||||
update-locales:
|
update-locales:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout ComfyUI
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
# Setup playwright environment with custom node repository
|
||||||
|
- name: Setup ComfyUI Server (without launching)
|
||||||
|
uses: ./.github/actions/setup-comfyui-server
|
||||||
|
- name: Setup frontend
|
||||||
|
uses: ./.github/actions/setup-frontend
|
||||||
with:
|
with:
|
||||||
repository: comfyanonymous/ComfyUI
|
include_build_step: 'true'
|
||||||
path: ComfyUI
|
- name: Setup Playwright
|
||||||
ref: master
|
uses: ./.github/actions/setup-playwright
|
||||||
- name: Checkout ComfyUI_frontend
|
|
||||||
uses: actions/checkout@v5
|
# Install the custom node repository
|
||||||
with:
|
|
||||||
repository: Comfy-Org/ComfyUI_frontend
|
|
||||||
path: ComfyUI_frontend
|
|
||||||
- name: Copy ComfyUI_devtools from frontend repo
|
|
||||||
run: |
|
|
||||||
mkdir -p ComfyUI/custom_nodes/ComfyUI_devtools
|
|
||||||
cp -r ComfyUI_frontend/tools/devtools/* ComfyUI/custom_nodes/ComfyUI_devtools/
|
|
||||||
- name: Checkout custom node repository
|
- name: Checkout custom node repository
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
repository: ${{ inputs.owner }}/${{ inputs.repository }}
|
repository: ${{ inputs.owner }}/${{ inputs.repository }}
|
||||||
path: 'ComfyUI/custom_nodes/${{ inputs.repository }}'
|
path: 'ComfyUI/custom_nodes/${{ inputs.repository }}'
|
||||||
- name: Install pnpm
|
- name: Install custom node Python requirements
|
||||||
uses: pnpm/action-setup@v4
|
working-directory: ComfyUI/custom_nodes/${{ inputs.repository }}
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 'lts/*'
|
|
||||||
cache: 'pnpm'
|
|
||||||
- uses: actions/setup-python@v4
|
|
||||||
with:
|
|
||||||
python-version: '3.10'
|
|
||||||
- name: Install ComfyUI requirements
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
|
|
||||||
pip install -r requirements.txt
|
|
||||||
pip install wait-for-it
|
|
||||||
working-directory: ComfyUI
|
|
||||||
- name: Install custom node requirements
|
|
||||||
run: |
|
run: |
|
||||||
if [ -f "requirements.txt" ]; then
|
if [ -f "requirements.txt" ]; then
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
fi
|
fi
|
||||||
working-directory: ComfyUI/custom_nodes/${{ inputs.repository }}
|
|
||||||
- name: Build & Install ComfyUI_frontend
|
# Start ComfyUI Server
|
||||||
run: |
|
- name: Start ComfyUI Server
|
||||||
pnpm install --frozen-lockfile
|
shell: bash
|
||||||
pnpm build
|
|
||||||
rm -rf ../ComfyUI/web/*
|
|
||||||
mv dist/* ../ComfyUI/web/
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Start ComfyUI server
|
|
||||||
run: |
|
|
||||||
python main.py --cpu --multi-user &
|
|
||||||
wait-for-it --service 127.0.0.1:8188 -t 600
|
|
||||||
working-directory: ComfyUI
|
working-directory: ComfyUI
|
||||||
- name: Install Playwright Browsers
|
run: |
|
||||||
run: pnpm exec playwright install chromium --with-deps
|
python main.py --cpu --multi-user --front-end-root ../dist --custom-node-path ../ComfyUI/custom_nodes/${{ inputs.repository }} &
|
||||||
working-directory: ComfyUI_frontend
|
wait-for-it --service
|
||||||
|
|
||||||
- name: Start dev server
|
- name: Start dev server
|
||||||
# Run electron dev server as it is a superset of the web dev server
|
# Run electron dev server as it is a superset of the web dev server
|
||||||
# We do want electron specific UIs to be translated.
|
# We do want electron specific UIs to be translated.
|
||||||
run: pnpm dev:electron &
|
run: pnpm dev:electron &
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Capture base i18n
|
- name: Capture base i18n
|
||||||
run: pnpm exec tsx scripts/diff-i18n capture
|
run: pnpm exec tsx scripts/diff-i18n capture
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Update en.json
|
- name: Update en.json
|
||||||
run: pnpm collect-i18n
|
run: pnpm collect-i18n
|
||||||
env:
|
env:
|
||||||
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Update translations
|
- name: Update translations
|
||||||
run: pnpm locale
|
run: pnpm locale
|
||||||
env:
|
env:
|
||||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Diff base vs updated i18n
|
- name: Diff base vs updated i18n
|
||||||
run: pnpm exec tsx scripts/diff-i18n diff
|
run: pnpm exec tsx scripts/diff-i18n diff
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Update i18n in custom node repository
|
- name: Update i18n in custom node repository
|
||||||
run: |
|
run: |
|
||||||
LOCALE_DIR=ComfyUI/custom_nodes/${{ inputs.repository }}/locales/
|
LOCALE_DIR=ComfyUI/custom_nodes/${{ inputs.repository }}/locales/
|
||||||
install -d "$LOCALE_DIR"
|
install -d "$LOCALE_DIR"
|
||||||
cp -rf ComfyUI_frontend/temp/diff/* "$LOCALE_DIR"
|
cp -rf ComfyUI_frontend/temp/diff/* "$LOCALE_DIR"
|
||||||
|
|
||||||
|
# Git ops for pushing changes and creating PR
|
||||||
- name: Check and create fork of custom node repository
|
- name: Check and create fork of custom node repository
|
||||||
run: |
|
run: |
|
||||||
# Try to fork the repository
|
# Try to fork the repository
|
||||||
@@ -14,43 +14,35 @@ jobs:
|
|||||||
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'version-bump-'))
|
if: github.event_name == 'workflow_dispatch' || (github.event.pull_request.head.repo.full_name == github.repository && startsWith(github.head_ref, 'version-bump-'))
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Frontend
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
|
# Setup playwright environment
|
||||||
|
- name: Setup ComfyUI Server
|
||||||
|
uses: ./.github/actions/setup-comfyui-server
|
||||||
|
with:
|
||||||
|
launch_server: true
|
||||||
|
- name: Setup ComfyUI Frontend
|
||||||
uses: ./.github/actions/setup-frontend
|
uses: ./.github/actions/setup-frontend
|
||||||
|
|
||||||
- name: Cache tool outputs
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
with:
|
||||||
path: |
|
include_build_step: true
|
||||||
ComfyUI_frontend/.cache
|
- name: Setup Playwright
|
||||||
ComfyUI_frontend/.cache
|
uses: ./.github/actions/setup-playwright
|
||||||
key: i18n-tools-cache-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
i18n-tools-cache-${{ runner.os }}-
|
|
||||||
- name: Cache Playwright browsers
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: ~/.cache/ms-playwright
|
|
||||||
key: playwright-browsers-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}
|
|
||||||
restore-keys: |
|
|
||||||
playwright-browsers-${{ runner.os }}-
|
|
||||||
- name: Install Playwright Browsers
|
|
||||||
run: pnpm exec playwright install chromium --with-deps
|
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Start dev server
|
- name: Start dev server
|
||||||
# Run electron dev server as it is a superset of the web dev server
|
# Run electron dev server as it is a superset of the web dev server
|
||||||
# We do want electron specific UIs to be translated.
|
# We do want electron specific UIs to be translated.
|
||||||
run: pnpm dev:electron &
|
run: pnpm dev:electron &
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
|
# Update locales, collect new strings and update translations using OpenAI, then commit changes
|
||||||
- name: Update en.json
|
- name: Update en.json
|
||||||
run: pnpm collect-i18n
|
run: pnpm collect-i18n
|
||||||
env:
|
env:
|
||||||
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Update translations
|
- name: Update translations
|
||||||
run: pnpm locale
|
run: pnpm locale
|
||||||
env:
|
env:
|
||||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Commit updated locales
|
- name: Commit updated locales
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name 'github-actions'
|
git config --global user.name 'github-actions'
|
||||||
@@ -64,4 +56,3 @@ jobs:
|
|||||||
git add src/locales/
|
git add src/locales/
|
||||||
git diff --staged --quiet || git commit -m "Update locales [skip ci]"
|
git diff --staged --quiet || git commit -m "Update locales [skip ci]"
|
||||||
git push origin HEAD:${{ github.head_ref }}
|
git push origin HEAD:${{ github.head_ref }}
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
@@ -13,26 +13,32 @@ jobs:
|
|||||||
update-locales:
|
update-locales:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Frontend
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
# Setup playwright environment
|
||||||
|
- name: Setup ComfyUI Server (and start)
|
||||||
|
uses: ./.github/actions/setup-comfyui-server
|
||||||
|
with:
|
||||||
|
launch_server: true
|
||||||
|
- name: Setup frontend
|
||||||
uses: ./.github/actions/setup-frontend
|
uses: ./.github/actions/setup-frontend
|
||||||
- name: Install Playwright Browsers
|
with:
|
||||||
run: pnpm exec playwright install chromium --with-deps
|
include_build_step: true
|
||||||
working-directory: ComfyUI_frontend
|
- name: Setup Playwright
|
||||||
|
uses: ./.github/actions/setup-playwright
|
||||||
|
|
||||||
- name: Start dev server
|
- name: Start dev server
|
||||||
# Run electron dev server as it is a superset of the web dev server
|
# Run electron dev server as it is a superset of the web dev server
|
||||||
# We do want electron specific UIs to be translated.
|
# We do want electron specific UIs to be translated.
|
||||||
run: pnpm dev:electron &
|
run: pnpm dev:electron &
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Update en.json
|
- name: Update en.json
|
||||||
run: pnpm collect-i18n -- scripts/collect-i18n-node-defs.ts
|
run: pnpm collect-i18n -- scripts/collect-i18n-node-defs.ts
|
||||||
env:
|
env:
|
||||||
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Update translations
|
- name: Update translations
|
||||||
run: pnpm locale
|
run: pnpm locale
|
||||||
env:
|
env:
|
||||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||||
working-directory: ComfyUI_frontend
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
|
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
|
||||||
with:
|
with:
|
||||||
@@ -46,4 +52,3 @@ jobs:
|
|||||||
branch: update-locales-node-defs-${{ github.event.inputs.trigger_type }}-${{ github.run_id }}
|
branch: update-locales-node-defs-${{ github.event.inputs.trigger_type }}-${{ github.run_id }}
|
||||||
base: main
|
base: main
|
||||||
labels: dependencies
|
labels: dependencies
|
||||||
path: ComfyUI_frontend
|
|
||||||
108
.github/workflows/update-playwright-expectations.yaml
vendored
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
# Setting test expectation screenshots for Playwright
|
||||||
|
name: Update Playwright Expectations
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [labeled]
|
||||||
|
issue_comment:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: >
|
||||||
|
( github.event_name == 'pull_request' && github.event.label.name == 'New Browser Test Expectations' ) ||
|
||||||
|
( github.event.issue.pull_request &&
|
||||||
|
github.event_name == 'issue_comment' &&
|
||||||
|
(
|
||||||
|
github.event.comment.author_association == 'OWNER' ||
|
||||||
|
github.event.comment.author_association == 'MEMBER' ||
|
||||||
|
github.event.comment.author_association == 'COLLABORATOR'
|
||||||
|
) &&
|
||||||
|
startsWith(github.event.comment.body, '/update-playwright') )
|
||||||
|
steps:
|
||||||
|
- name: Find Update Comment
|
||||||
|
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad
|
||||||
|
id: "find-update-comment"
|
||||||
|
with:
|
||||||
|
issue-number: ${{ github.event.number || github.event.issue.number }}
|
||||||
|
comment-author: "github-actions[bot]"
|
||||||
|
body-includes: "Updating Playwright Expectations"
|
||||||
|
|
||||||
|
- name: Add Starting Reaction
|
||||||
|
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9
|
||||||
|
with:
|
||||||
|
comment-id: ${{ steps.find-update-comment.outputs.comment-id }}
|
||||||
|
issue-number: ${{ github.event.number || github.event.issue.number }}
|
||||||
|
body: |
|
||||||
|
Updating Playwright Expectations
|
||||||
|
edit-mode: replace
|
||||||
|
reactions: eyes
|
||||||
|
|
||||||
|
- name: Get Branch SHA
|
||||||
|
id: "get-branch"
|
||||||
|
run: echo ::set-output name=branch::$(gh pr view $PR_NO --repo $REPO --json headRefName --jq '.headRefName')
|
||||||
|
env:
|
||||||
|
REPO: ${{ github.repository }}
|
||||||
|
PR_NO: ${{ github.event.number || github.event.issue.number }}
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Initial Checkout
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
ref: ${{ steps.get-branch.outputs.branch }}
|
||||||
|
- name: Setup Frontend
|
||||||
|
uses: ./.github/actions/setup-frontend
|
||||||
|
with:
|
||||||
|
include_build_step: true
|
||||||
|
- name: Setup ComfyUI Server
|
||||||
|
uses: ./.github/actions/setup-comfyui-server
|
||||||
|
with:
|
||||||
|
launch_server: true
|
||||||
|
- name: Setup Playwright
|
||||||
|
uses: ./.github/actions/setup-playwright
|
||||||
|
- name: Run Playwright tests and update snapshots
|
||||||
|
id: playwright-tests
|
||||||
|
run: pnpm exec playwright test --update-snapshots
|
||||||
|
continue-on-error: true
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: playwright-report
|
||||||
|
path: ./playwright-report/
|
||||||
|
retention-days: 30
|
||||||
|
- name: Debugging info
|
||||||
|
run: |
|
||||||
|
echo "PR: ${{ github.event.issue.number }}"
|
||||||
|
echo "Branch: ${{ steps.get-branch.outputs.branch }}"
|
||||||
|
git status
|
||||||
|
- name: Commit updated expectations
|
||||||
|
run: |
|
||||||
|
git config --global user.name 'github-actions'
|
||||||
|
git config --global user.email 'github-actions@github.com'
|
||||||
|
git add browser_tests
|
||||||
|
if git diff --cached --quiet; then
|
||||||
|
echo "No changes to commit"
|
||||||
|
else
|
||||||
|
git commit -m "[automated] Update test expectations"
|
||||||
|
git push origin ${{ steps.get-branch.outputs.branch }}
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Add Done Reaction
|
||||||
|
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9
|
||||||
|
if: github.event_name == 'issue_comment'
|
||||||
|
with:
|
||||||
|
comment-id: ${{ steps.find-update-comment.outputs.comment-id }}
|
||||||
|
issue-number: ${{ github.event.number || github.event.issue.number }}
|
||||||
|
reactions: +1
|
||||||
|
reactions-edit-mode: replace
|
||||||
|
|
||||||
|
- name: Remove New Browser Test Expectations label
|
||||||
|
if: always() && github.event_name == 'pull_request'
|
||||||
|
run: gh pr edit ${{ github.event.pull_request.number }} --remove-label "New Browser Test Expectations"
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
71
.github/workflows/version-bump-desktop-ui.yaml
vendored
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
name: Version Bump Desktop UI
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
version_type:
|
||||||
|
description: 'Version increment type'
|
||||||
|
required: true
|
||||||
|
default: 'patch'
|
||||||
|
type: 'choice'
|
||||||
|
options: [patch, minor, major, prepatch, preminor, premajor, prerelease]
|
||||||
|
pre_release:
|
||||||
|
description: Pre-release ID (suffix)
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
bump-version-desktop-ui:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 10
|
||||||
|
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v5
|
||||||
|
with:
|
||||||
|
node-version: '24.x'
|
||||||
|
cache: 'pnpm'
|
||||||
|
|
||||||
|
- name: Bump desktop-ui version
|
||||||
|
id: bump-version
|
||||||
|
env:
|
||||||
|
VERSION_TYPE: ${{ github.event.inputs.version_type }}
|
||||||
|
PRE_RELEASE: ${{ github.event.inputs.pre_release }}
|
||||||
|
run: |
|
||||||
|
pnpm -C apps/desktop-ui version "$VERSION_TYPE" --preid "$PRE_RELEASE" --no-git-tag-version
|
||||||
|
NEW_VERSION=$(node -p "require('./apps/desktop-ui/package.json').version")
|
||||||
|
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Format PR string
|
||||||
|
id: capitalised
|
||||||
|
env:
|
||||||
|
VERSION_TYPE: ${{ github.event.inputs.version_type }}
|
||||||
|
run: |
|
||||||
|
echo "capitalised=${VERSION_TYPE@u}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Create Pull Request
|
||||||
|
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.PR_GH_TOKEN }}
|
||||||
|
commit-message: '[release] Increment desktop-ui to ${{ steps.bump-version.outputs.NEW_VERSION }}'
|
||||||
|
title: desktop-ui ${{ steps.bump-version.outputs.NEW_VERSION }}
|
||||||
|
body: |
|
||||||
|
${{ steps.capitalised.outputs.capitalised }} version increment for @comfyorg/desktop-ui to ${{ steps.bump-version.outputs.NEW_VERSION }}
|
||||||
|
branch: desktop-ui-version-bump-${{ steps.bump-version.outputs.NEW_VERSION }}
|
||||||
|
base: main
|
||||||
|
labels: |
|
||||||
|
Release
|
||||||
|
|
||||||
48
.github/workflows/vitest-tests.yaml
vendored
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
name: Vitest Tests
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main, master, dev*, core/*, desktop/*]
|
||||||
|
pull_request:
|
||||||
|
branches-ignore: [wip/*, draft/*, temp/*]
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
|
- name: Install pnpm
|
||||||
|
uses: pnpm/action-setup@v4
|
||||||
|
with:
|
||||||
|
version: 10
|
||||||
|
|
||||||
|
- name: Use Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "lts/*"
|
||||||
|
cache: "pnpm"
|
||||||
|
|
||||||
|
- name: Cache tool outputs
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
.cache
|
||||||
|
coverage
|
||||||
|
.vitest-cache
|
||||||
|
key: vitest-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('src/**/*.{ts,vue,js}', 'vitest.config.*', 'tsconfig.json') }}
|
||||||
|
restore-keys: |
|
||||||
|
vitest-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
|
||||||
|
vitest-cache-${{ runner.os }}-
|
||||||
|
test-tools-cache-${{ runner.os }}-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Run Vitest tests
|
||||||
|
run: pnpm test:unit
|
||||||
46
.github/workflows/vitest.yaml
vendored
@@ -1,46 +0,0 @@
|
|||||||
name: Vitest Tests
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ main, master, dev*, core/*, desktop/* ]
|
|
||||||
pull_request:
|
|
||||||
branches-ignore: [ wip/*, draft/*, temp/* ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v5
|
|
||||||
|
|
||||||
- name: Install pnpm
|
|
||||||
uses: pnpm/action-setup@v4
|
|
||||||
with:
|
|
||||||
version: 10
|
|
||||||
|
|
||||||
- name: Use Node.js
|
|
||||||
uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 'lts/*'
|
|
||||||
cache: 'pnpm'
|
|
||||||
|
|
||||||
- name: Cache tool outputs
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
.cache
|
|
||||||
coverage
|
|
||||||
.vitest-cache
|
|
||||||
key: vitest-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('src/**/*.{ts,vue,js}', 'vitest.config.*', 'tsconfig.json') }}
|
|
||||||
restore-keys: |
|
|
||||||
vitest-cache-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}-
|
|
||||||
vitest-cache-${{ runner.os }}-
|
|
||||||
test-tools-cache-${{ runner.os }}-
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
run: pnpm install --frozen-lockfile
|
|
||||||
|
|
||||||
- name: Run Vitest tests
|
|
||||||
run: |
|
|
||||||
pnpm test:component
|
|
||||||
pnpm test:unit
|
|
||||||
2
.gitignore
vendored
@@ -15,6 +15,7 @@ yarn.lock
|
|||||||
# Cache files
|
# Cache files
|
||||||
.eslintcache
|
.eslintcache
|
||||||
.prettiercache
|
.prettiercache
|
||||||
|
.stylelintcache
|
||||||
|
|
||||||
node_modules
|
node_modules
|
||||||
dist
|
dist
|
||||||
@@ -31,6 +32,7 @@ CLAUDE.local.md
|
|||||||
*.code-workspace
|
*.code-workspace
|
||||||
!.vscode/extensions.json
|
!.vscode/extensions.json
|
||||||
!.vscode/tailwind.json
|
!.vscode/tailwind.json
|
||||||
|
!.vscode/custom-css.json
|
||||||
!.vscode/settings.json.default
|
!.vscode/settings.json.default
|
||||||
!.vscode/launch.json.default
|
!.vscode/launch.json.default
|
||||||
.idea
|
.idea
|
||||||
|
|||||||
1
.npmrc
@@ -1 +1,2 @@
|
|||||||
ignore-workspace-root-check=true
|
ignore-workspace-root-check=true
|
||||||
|
catalog-mode=prefer
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
- `pnpm storybook`: Start Storybook development server
|
- `pnpm storybook`: Start Storybook development server
|
||||||
- `pnpm build-storybook`: Build static Storybook
|
- `pnpm build-storybook`: Build static Storybook
|
||||||
- `pnpm test:component`: Run component tests (includes Storybook components)
|
- `pnpm test:unit`: Run unit tests (includes Storybook components)
|
||||||
|
|
||||||
## Development Workflow for Storybook
|
## Development Workflow for Storybook
|
||||||
|
|
||||||
|
|||||||
@@ -211,18 +211,17 @@ This Storybook setup includes:
|
|||||||
|
|
||||||
## Icon Usage in Storybook
|
## Icon Usage in Storybook
|
||||||
|
|
||||||
In this project, the `<i-lucide:... />` syntax from unplugin-icons is not supported in Storybook.
|
In this project, only the `<i class="icon-[lucide--folder]" />` syntax from unplugin-icons is supported in Storybook.
|
||||||
|
|
||||||
**Example:**
|
**Example:**
|
||||||
|
|
||||||
```vue
|
```vue
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Trophy, Settings } from 'lucide-vue-next'
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Trophy :size="16" class="text-neutral" />
|
<i class="icon-[lucide--trophy] text-neutral size-4" />
|
||||||
<Settings :size="16" class="text-neutral" />
|
<i class="icon-[lucide--settings] text-neutral size-4" />
|
||||||
</template>
|
</template>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -76,11 +76,6 @@ const config: StorybookConfig = {
|
|||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
rollupOptions: {
|
rollupOptions: {
|
||||||
external: () => {
|
|
||||||
// Don't externalize any modules in Storybook build
|
|
||||||
// This ensures PrimeVue and other dependencies are bundled
|
|
||||||
return false
|
|
||||||
},
|
|
||||||
onwarn: (warning, warn) => {
|
onwarn: (warning, warn) => {
|
||||||
// Suppress specific warnings
|
// Suppress specific warnings
|
||||||
if (
|
if (
|
||||||
|
|||||||
74
.stylelintrc.json
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
{
|
||||||
|
"extends": [],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": ["*.vue", "**/*.vue"],
|
||||||
|
"customSyntax": "postcss-html"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rules": {
|
||||||
|
"import-notation": "string",
|
||||||
|
"font-family-no-missing-generic-family-keyword": true,
|
||||||
|
"declaration-property-value-no-unknown": [
|
||||||
|
true,
|
||||||
|
{
|
||||||
|
"ignoreProperties": {
|
||||||
|
"speak": ["none"],
|
||||||
|
"app-region": ["drag", "no-drag"],
|
||||||
|
"/^(width|height)$/": ["/^v-bind/"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"color-function-notation": "modern",
|
||||||
|
"shorthand-property-no-redundant-values": true,
|
||||||
|
"selector-pseudo-element-colon-notation": "double",
|
||||||
|
"no-duplicate-selectors": true,
|
||||||
|
"font-weight-notation": "numeric",
|
||||||
|
"length-zero-no-unit": true,
|
||||||
|
"color-no-invalid-hex": true,
|
||||||
|
"number-max-precision": 4,
|
||||||
|
"property-no-vendor-prefix": true,
|
||||||
|
"value-no-vendor-prefix": true,
|
||||||
|
"selector-no-vendor-prefix": true,
|
||||||
|
"media-feature-name-no-vendor-prefix": true,
|
||||||
|
"selector-max-universal": 1,
|
||||||
|
"selector-max-type": 2,
|
||||||
|
"declaration-block-no-duplicate-properties": true,
|
||||||
|
"block-no-empty": true,
|
||||||
|
"no-descending-specificity": null,
|
||||||
|
"no-duplicate-at-import-rules": true,
|
||||||
|
"at-rule-no-unknown": [
|
||||||
|
true,
|
||||||
|
{
|
||||||
|
"ignoreAtRules": [
|
||||||
|
"tailwind",
|
||||||
|
"apply",
|
||||||
|
"layer",
|
||||||
|
"config",
|
||||||
|
"theme",
|
||||||
|
"reference",
|
||||||
|
"plugin",
|
||||||
|
"custom-variant",
|
||||||
|
"utility"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"function-no-unknown": [
|
||||||
|
true,
|
||||||
|
{
|
||||||
|
"ignoreFunctions": [
|
||||||
|
"theme",
|
||||||
|
"v-bind"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ignoreFiles": [
|
||||||
|
"node_modules/**",
|
||||||
|
"dist/**",
|
||||||
|
"playwright-report/**",
|
||||||
|
"public/**",
|
||||||
|
"src/lib/litegraph/**"
|
||||||
|
],
|
||||||
|
"files": ["**/*.css", "**/*.vue"]
|
||||||
|
}
|
||||||
50
.vscode/custom-css.json
vendored
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
{
|
||||||
|
"version": 1.1,
|
||||||
|
"properties": [
|
||||||
|
{
|
||||||
|
"name": "app-region",
|
||||||
|
"description": "Electron-specific CSS property that defines draggable regions in custom title bar windows. Setting 'drag' marks a rectangular area as draggable for moving the window; 'no-drag' excludes areas from the draggable region.",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "drag",
|
||||||
|
"description": "Marks the element as draggable for moving the Electron window"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "no-drag",
|
||||||
|
"description": "Excludes the element from being used to drag the Electron window"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"name": "Electron Window Customization",
|
||||||
|
"url": "https://www.electronjs.org/docs/latest/tutorial/window-customization"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "speak",
|
||||||
|
"description": "Deprecated CSS2 aural stylesheet property for controlling screen reader speech. Use ARIA attributes instead.",
|
||||||
|
"values": [
|
||||||
|
{
|
||||||
|
"name": "auto",
|
||||||
|
"description": "Content is read aurally if element is not a block and is visible"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "never",
|
||||||
|
"description": "Content will not be read aurally"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "always",
|
||||||
|
"description": "Content will be read aurally regardless of display settings"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"name": "CSS-Tricks Reference",
|
||||||
|
"url": "https://css-tricks.com/almanac/properties/s/speak/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"status": "obsolete"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
3
.vscode/settings.json.default
vendored
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"css.customData": [
|
"css.customData": [
|
||||||
".vscode/tailwind.json"
|
".vscode/tailwind.json",
|
||||||
|
".vscode/custom-css.json"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
36
.vscode/tailwind.json
vendored
@@ -7,7 +7,7 @@
|
|||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"name": "Tailwind Documentation",
|
"name": "Tailwind Documentation",
|
||||||
"url": "https://tailwindcss.com/docs/functions-and-directives#import"
|
"url": "https://tailwindcss.com/docs/functions-and-directives#import-directive"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"name": "Tailwind Documentation",
|
"name": "Tailwind Documentation",
|
||||||
"url": "https://tailwindcss.com/docs/functions-and-directives#theme"
|
"url": "https://tailwindcss.com/docs/functions-and-directives#theme-directive"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -27,17 +27,17 @@
|
|||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"name": "Tailwind Documentation",
|
"name": "Tailwind Documentation",
|
||||||
"url": "https://tailwindcss.com/docs/functions-and-directives#layer"
|
"url": "https://tailwindcss.com/docs/theme#layers"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "@apply",
|
"name": "@apply",
|
||||||
"description": "Use the `@apply` directive to inline any existing utility classes into your own custom CSS. This is useful when you find a common utility pattern in your HTML that you’d like to extract to a new component.",
|
"description": "DO NOT USE. IF YOU ARE CAUGHT USING @apply YOU WILL FACE SEVERE CONSEQUENCES.",
|
||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"name": "Tailwind Documentation",
|
"name": "Tailwind Documentation",
|
||||||
"url": "https://tailwindcss.com/docs/functions-and-directives#apply"
|
"url": "https://tailwindcss.com/docs/functions-and-directives#apply-directive"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"name": "Tailwind Documentation",
|
"name": "Tailwind Documentation",
|
||||||
"url": "https://tailwindcss.com/docs/functions-and-directives#config"
|
"url": "https://tailwindcss.com/docs/functions-and-directives#config-directive"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"name": "Tailwind Documentation",
|
"name": "Tailwind Documentation",
|
||||||
"url": "https://tailwindcss.com/docs/functions-and-directives#reference"
|
"url": "https://tailwindcss.com/docs/functions-and-directives#reference-directive"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -67,7 +67,27 @@
|
|||||||
"references": [
|
"references": [
|
||||||
{
|
{
|
||||||
"name": "Tailwind Documentation",
|
"name": "Tailwind Documentation",
|
||||||
"url": "https://tailwindcss.com/docs/functions-and-directives#plugin"
|
"url": "https://tailwindcss.com/docs/functions-and-directives#plugin-directive"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "@custom-variant",
|
||||||
|
"description": "Use the `@custom-variant` directive to add a custom variant to your project. Custom variants can be used with utilities like `hover`, `focus`, and responsive breakpoints. Use `@slot` inside the variant to indicate where the utility's styles should be inserted.",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"name": "Tailwind Documentation",
|
||||||
|
"url": "https://tailwindcss.com/docs/adding-custom-styles#adding-custom-variants"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "@utility",
|
||||||
|
"description": "Use the `@utility` directive to add custom utilities to your project. Custom utilities work with all variants like `hover`, `focus`, and responsive variants. Use `--value()` to create functional utilities that accept arguments.",
|
||||||
|
"references": [
|
||||||
|
{
|
||||||
|
"name": "Tailwind Documentation",
|
||||||
|
"url": "https://tailwindcss.com/docs/adding-custom-styles#adding-custom-utilities"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,15 +5,14 @@
|
|||||||
- Routing/i18n/entry: `src/router.ts`, `src/i18n.ts`, `src/main.ts`.
|
- Routing/i18n/entry: `src/router.ts`, `src/i18n.ts`, `src/main.ts`.
|
||||||
- Tests: unit/component in `tests-ui/` and `src/components/**/*.{test,spec}.ts`; E2E in `browser_tests/`.
|
- Tests: unit/component in `tests-ui/` and `src/components/**/*.{test,spec}.ts`; E2E in `browser_tests/`.
|
||||||
- Public assets: `public/`. Build output: `dist/`.
|
- Public assets: `public/`. Build output: `dist/`.
|
||||||
- Config: `vite.config.mts`, `vitest.config.ts`, `playwright.config.ts`, `eslint.config.js`, `.prettierrc`.
|
- Config: `vite.config.mts`, `vitest.config.ts`, `playwright.config.ts`, `eslint.config.ts`, `.prettierrc`.
|
||||||
|
|
||||||
## Build, Test, and Development Commands
|
## Build, Test, and Development Commands
|
||||||
- `pnpm dev`: Start Vite dev server.
|
- `pnpm dev`: Start Vite dev server.
|
||||||
- `pnpm dev:electron`: Dev server with Electron API mocks.
|
- `pnpm dev:electron`: Dev server with Electron API mocks.
|
||||||
- `pnpm build`: Type-check then production build to `dist/`.
|
- `pnpm build`: Type-check then production build to `dist/`.
|
||||||
- `pnpm preview`: Preview the production build locally.
|
- `pnpm preview`: Preview the production build locally.
|
||||||
- `pnpm test:unit`: Run Vitest unit tests (`tests-ui/`).
|
- `pnpm test:unit`: Run Vitest unit tests.
|
||||||
- `pnpm test:component`: Run component tests (`src/components/`).
|
|
||||||
- `pnpm test:browser`: Run Playwright E2E tests (`browser_tests/`).
|
- `pnpm test:browser`: Run Playwright E2E tests (`browser_tests/`).
|
||||||
- `pnpm lint` / `pnpm lint:fix`: Lint (ESLint). `pnpm format` / `format:check`: Prettier.
|
- `pnpm lint` / `pnpm lint:fix`: Lint (ESLint). `pnpm format` / `format:check`: Prettier.
|
||||||
- `pnpm typecheck`: Vue TSC type checking.
|
- `pnpm typecheck`: Vue TSC type checking.
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ This bootstraps the monorepo with dependencies, builds, tests, and dev server ve
|
|||||||
- `pnpm build`: Build for production (via nx)
|
- `pnpm build`: Build for production (via nx)
|
||||||
- `pnpm lint`: Linting (via nx)
|
- `pnpm lint`: Linting (via nx)
|
||||||
- `pnpm format`: Prettier formatting
|
- `pnpm format`: Prettier formatting
|
||||||
- `pnpm test:component`: Run component tests with browser environment
|
|
||||||
- `pnpm test:unit`: Run all unit tests
|
- `pnpm test:unit`: Run all unit tests
|
||||||
- `pnpm test:browser`: Run E2E tests via Playwright
|
- `pnpm test:browser`: Run E2E tests via Playwright
|
||||||
- `pnpm test:unit -- tests-ui/tests/example.test.ts`: Run single test file
|
- `pnpm test:unit -- tests-ui/tests/example.test.ts`: Run single test file
|
||||||
@@ -127,6 +126,5 @@ const value = api.getServerFeature('config_name', defaultValue) // Get config
|
|||||||
- NEVER use `--no-verify` flag when committing
|
- NEVER use `--no-verify` flag when committing
|
||||||
- NEVER delete or disable tests to make them pass
|
- NEVER delete or disable tests to make them pass
|
||||||
- NEVER circumvent quality checks
|
- NEVER circumvent quality checks
|
||||||
- NEVER use `dark:` prefix - always use `dark-theme:` for dark mode styles, for example: `dark-theme:text-white dark-theme:bg-black`
|
- NEVER use `dark:` or `dark-theme:` tailwind variants. Instead use a semantic value from the `style.css` theme, e.g. `bg-node-component-surface`
|
||||||
- NEVER use `:class="[]"` to merge class names - always use `import { cn } from '@/utils/tailwindUtil'`, for example: `<div :class="cn('bg-red-500', { 'bg-blue-500': condition })" />`
|
- NEVER use `:class="[]"` to merge class names - always use `import { cn } from '@/utils/tailwindUtil'`, for example: `<div :class="cn('text-node-component-header-icon', hasError && 'text-danger')" />`
|
||||||
|
|
||||||
|
|||||||
14
CODEOWNERS
@@ -1,12 +1,7 @@
|
|||||||
# Desktop/Electron
|
# Desktop/Electron
|
||||||
/src/types/desktop/ @webfiltered
|
/apps/desktop-ui/ @webfiltered
|
||||||
/src/constants/desktopDialogs.ts @webfiltered
|
|
||||||
/src/constants/desktopMaintenanceTasks.ts @webfiltered
|
|
||||||
/src/stores/electronDownloadStore.ts @webfiltered
|
/src/stores/electronDownloadStore.ts @webfiltered
|
||||||
/src/extensions/core/electronAdapter.ts @webfiltered
|
/src/extensions/core/electronAdapter.ts @webfiltered
|
||||||
/src/views/DesktopDialogView.vue @webfiltered
|
|
||||||
/src/components/install/ @webfiltered
|
|
||||||
/src/components/maintenance/ @webfiltered
|
|
||||||
/vite.electron.config.mts @webfiltered
|
/vite.electron.config.mts @webfiltered
|
||||||
|
|
||||||
# Common UI Components
|
# Common UI Components
|
||||||
@@ -59,3 +54,10 @@
|
|||||||
|
|
||||||
# Translations
|
# Translations
|
||||||
/src/locales/ @Yorha4D @KarryCharon @shinshin86 @Comfy-Org/comfy_maintainer
|
/src/locales/ @Yorha4D @KarryCharon @shinshin86 @Comfy-Org/comfy_maintainer
|
||||||
|
|
||||||
|
# LLM Instructions (blank on purpose)
|
||||||
|
.claude/
|
||||||
|
.cursor/
|
||||||
|
.cursorrules
|
||||||
|
**/AGENTS.md
|
||||||
|
**/CLAUDE.md
|
||||||
@@ -213,12 +213,6 @@ Here's how Claude Code can use the Playwright MCP server to inspect the interfac
|
|||||||
- `pnpm i` to install all dependencies
|
- `pnpm i` to install all dependencies
|
||||||
- `pnpm test:unit` to execute all unit tests
|
- `pnpm test:unit` to execute all unit tests
|
||||||
|
|
||||||
### Component Tests
|
|
||||||
|
|
||||||
Component tests verify Vue components in `src/components/`.
|
|
||||||
|
|
||||||
- `pnpm test:component` to execute all component tests
|
|
||||||
|
|
||||||
### Playwright Tests
|
### Playwright Tests
|
||||||
|
|
||||||
Playwright tests verify the whole app. See [browser_tests/README.md](browser_tests/README.md) for details.
|
Playwright tests verify the whole app. See [browser_tests/README.md](browser_tests/README.md) for details.
|
||||||
@@ -229,7 +223,6 @@ Before submitting a PR, ensure all tests pass:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
pnpm test:unit
|
pnpm test:unit
|
||||||
pnpm test:component
|
|
||||||
pnpm test:browser
|
pnpm test:browser
|
||||||
pnpm typecheck
|
pnpm typecheck
|
||||||
pnpm lint
|
pnpm lint
|
||||||
@@ -262,7 +255,7 @@ pnpm format
|
|||||||
The project supports three types of icons, all with automatic imports (no manual imports needed):
|
The project supports three types of icons, all with automatic imports (no manual imports needed):
|
||||||
|
|
||||||
1. **PrimeIcons** - Built-in PrimeVue icons using CSS classes: `<i class="pi pi-plus" />`
|
1. **PrimeIcons** - Built-in PrimeVue icons using CSS classes: `<i class="pi pi-plus" />`
|
||||||
2. **Iconify Icons** - 200,000+ icons from various libraries: `<i-lucide:settings />`, `<i-mdi:folder />`
|
2. **Iconify Icons** - 200,000+ icons from various libraries: `<i class="icon-[lucide--settings]" />`, `<i class="icon-[mdi--folder]" />`
|
||||||
3. **Custom Icons** - Your own SVG icons: `<i-comfy:workflow />`
|
3. **Custom Icons** - Your own SVG icons: `<i-comfy:workflow />`
|
||||||
|
|
||||||
Icons are powered by the unplugin-icons system, which automatically discovers and imports icons as Vue components. Custom icons are stored in `packages/design-system/src/icons/` and processed by `packages/design-system/src/iconCollection.ts` with automatic validation.
|
Icons are powered by the unplugin-icons system, which automatically discovers and imports icons as Vue components. Custom icons are stored in `packages/design-system/src/icons/` and processed by `packages/design-system/src/iconCollection.ts` with automatic validation.
|
||||||
|
|||||||
103
apps/desktop-ui/.storybook/main.ts
Normal file
@@ -0,0 +1,103 @@
|
|||||||
|
import type { StorybookConfig } from '@storybook/vue3-vite'
|
||||||
|
import { FileSystemIconLoader } from 'unplugin-icons/loaders'
|
||||||
|
import IconsResolver from 'unplugin-icons/resolver'
|
||||||
|
import Icons from 'unplugin-icons/vite'
|
||||||
|
import Components from 'unplugin-vue-components/vite'
|
||||||
|
import type { InlineConfig } from 'vite'
|
||||||
|
|
||||||
|
const config: StorybookConfig = {
|
||||||
|
stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
|
||||||
|
addons: ['@storybook/addon-docs'],
|
||||||
|
framework: {
|
||||||
|
name: '@storybook/vue3-vite',
|
||||||
|
options: {}
|
||||||
|
},
|
||||||
|
staticDirs: [{ from: '../public', to: '/' }],
|
||||||
|
async viteFinal(config) {
|
||||||
|
// Use dynamic import to avoid CJS deprecation warning
|
||||||
|
const { mergeConfig } = await import('vite')
|
||||||
|
const { default: tailwindcss } = await import('@tailwindcss/vite')
|
||||||
|
|
||||||
|
// Filter out any plugins that might generate import maps
|
||||||
|
if (config.plugins) {
|
||||||
|
config.plugins = config.plugins
|
||||||
|
// Type guard: ensure we have valid plugin objects with names
|
||||||
|
.filter(
|
||||||
|
(plugin): plugin is NonNullable<typeof plugin> & { name: string } => {
|
||||||
|
return (
|
||||||
|
plugin !== null &&
|
||||||
|
plugin !== undefined &&
|
||||||
|
typeof plugin === 'object' &&
|
||||||
|
'name' in plugin &&
|
||||||
|
typeof plugin.name === 'string'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
// Business logic: filter out import-map plugins
|
||||||
|
.filter((plugin) => !plugin.name.includes('import-map'))
|
||||||
|
}
|
||||||
|
|
||||||
|
return mergeConfig(config, {
|
||||||
|
// Replace plugins entirely to avoid inheritance issues
|
||||||
|
plugins: [
|
||||||
|
// Only include plugins we explicitly need for Storybook
|
||||||
|
tailwindcss(),
|
||||||
|
Icons({
|
||||||
|
compiler: 'vue3',
|
||||||
|
customCollections: {
|
||||||
|
comfy: FileSystemIconLoader(
|
||||||
|
process.cwd() + '/../../packages/design-system/src/icons'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
Components({
|
||||||
|
dts: false, // Disable dts generation in Storybook
|
||||||
|
resolvers: [
|
||||||
|
IconsResolver({
|
||||||
|
customCollections: ['comfy']
|
||||||
|
})
|
||||||
|
],
|
||||||
|
dirs: [
|
||||||
|
process.cwd() + '/src/components',
|
||||||
|
process.cwd() + '/src/views'
|
||||||
|
],
|
||||||
|
deep: true,
|
||||||
|
extensions: ['vue'],
|
||||||
|
directoryAsNamespace: true
|
||||||
|
})
|
||||||
|
],
|
||||||
|
server: {
|
||||||
|
allowedHosts: true
|
||||||
|
},
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
'@': process.cwd() + '/src',
|
||||||
|
'@frontend-locales': process.cwd() + '/../../src/locales'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
rollupOptions: {
|
||||||
|
onwarn: (warning, warn) => {
|
||||||
|
// Suppress specific warnings
|
||||||
|
if (
|
||||||
|
warning.code === 'UNUSED_EXTERNAL_IMPORT' &&
|
||||||
|
warning.message?.includes('resolveComponent')
|
||||||
|
) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// Suppress Storybook font asset warnings
|
||||||
|
if (
|
||||||
|
warning.code === 'UNRESOLVED_IMPORT' &&
|
||||||
|
warning.message?.includes('nunito-sans')
|
||||||
|
) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
warn(warning)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
chunkSizeWarningLimit: 1000
|
||||||
|
}
|
||||||
|
} satisfies InlineConfig)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export default config
|
||||||
88
apps/desktop-ui/.storybook/preview.ts
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
import { definePreset } from '@primevue/themes'
|
||||||
|
import Aura from '@primevue/themes/aura'
|
||||||
|
import { setup } from '@storybook/vue3'
|
||||||
|
import type { Preview, StoryContext, StoryFn } from '@storybook/vue3-vite'
|
||||||
|
import { createPinia } from 'pinia'
|
||||||
|
import 'primeicons/primeicons.css'
|
||||||
|
import PrimeVue from 'primevue/config'
|
||||||
|
import ConfirmationService from 'primevue/confirmationservice'
|
||||||
|
import ToastService from 'primevue/toastservice'
|
||||||
|
import Tooltip from 'primevue/tooltip'
|
||||||
|
|
||||||
|
import '@/assets/css/style.css'
|
||||||
|
import { i18n } from '@/i18n'
|
||||||
|
|
||||||
|
const ComfyUIPreset = definePreset(Aura, {
|
||||||
|
semantic: {
|
||||||
|
// @ts-expect-error prime type quirk
|
||||||
|
primary: Aura['primitive'].blue
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
setup((app) => {
|
||||||
|
app.directive('tooltip', Tooltip)
|
||||||
|
|
||||||
|
const pinia = createPinia()
|
||||||
|
|
||||||
|
app.use(pinia)
|
||||||
|
app.use(i18n)
|
||||||
|
app.use(PrimeVue, {
|
||||||
|
theme: {
|
||||||
|
preset: ComfyUIPreset,
|
||||||
|
options: {
|
||||||
|
prefix: 'p',
|
||||||
|
cssLayer: { name: 'primevue', order: 'primevue, tailwind-utilities' },
|
||||||
|
darkModeSelector: '.dark-theme, :root:has(.dark-theme)'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
app.use(ConfirmationService)
|
||||||
|
app.use(ToastService)
|
||||||
|
})
|
||||||
|
|
||||||
|
export const withTheme = (Story: StoryFn, context: StoryContext) => {
|
||||||
|
const theme = context.globals.theme || 'light'
|
||||||
|
if (theme === 'dark') {
|
||||||
|
document.documentElement.classList.add('dark-theme')
|
||||||
|
document.body.classList.add('dark-theme')
|
||||||
|
} else {
|
||||||
|
document.documentElement.classList.remove('dark-theme')
|
||||||
|
document.body.classList.remove('dark-theme')
|
||||||
|
}
|
||||||
|
|
||||||
|
return Story(context.args, context)
|
||||||
|
}
|
||||||
|
|
||||||
|
const preview: Preview = {
|
||||||
|
parameters: {
|
||||||
|
controls: {
|
||||||
|
matchers: { color: /(background|color)$/i, date: /Date$/i }
|
||||||
|
},
|
||||||
|
backgrounds: {
|
||||||
|
default: 'light',
|
||||||
|
values: [
|
||||||
|
{ name: 'light', value: '#ffffff' },
|
||||||
|
{ name: 'dark', value: '#0a0a0a' }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
globalTypes: {
|
||||||
|
theme: {
|
||||||
|
name: 'Theme',
|
||||||
|
description: 'Global theme for components',
|
||||||
|
defaultValue: 'light',
|
||||||
|
toolbar: {
|
||||||
|
icon: 'circlehollow',
|
||||||
|
items: [
|
||||||
|
{ value: 'light', icon: 'sun', title: 'Light' },
|
||||||
|
{ value: 'dark', icon: 'moon', title: 'Dark' }
|
||||||
|
],
|
||||||
|
showName: true,
|
||||||
|
dynamicTitle: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
decorators: [withTheme]
|
||||||
|
}
|
||||||
|
|
||||||
|
export default preview
|
||||||
12
apps/desktop-ui/index.html
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<title>ComfyUI Desktop</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="desktop-app"></div>
|
||||||
|
<script type="module" src="src/main.ts"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
117
apps/desktop-ui/package.json
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
{
|
||||||
|
"name": "@comfyorg/desktop-ui",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"type": "module",
|
||||||
|
"nx": {
|
||||||
|
"tags": [
|
||||||
|
"scope:desktop",
|
||||||
|
"type:app"
|
||||||
|
],
|
||||||
|
"targets": {
|
||||||
|
"dev": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"continuous": true,
|
||||||
|
"options": {
|
||||||
|
"cwd": "apps/desktop-ui",
|
||||||
|
"command": "vite --config vite.config.mts"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"serve": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"continuous": true,
|
||||||
|
"options": {
|
||||||
|
"cwd": "apps/desktop-ui",
|
||||||
|
"command": "vite --config vite.config.mts"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"build": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"cache": true,
|
||||||
|
"dependsOn": [
|
||||||
|
"^build"
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"cwd": "apps/desktop-ui",
|
||||||
|
"command": "vite build --config vite.config.mts"
|
||||||
|
},
|
||||||
|
"outputs": [
|
||||||
|
"{projectRoot}/dist"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"preview": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"continuous": true,
|
||||||
|
"dependsOn": [
|
||||||
|
"build"
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"cwd": "apps/desktop-ui",
|
||||||
|
"command": "vite preview --config vite.config.mts"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"storybook": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"continuous": true,
|
||||||
|
"options": {
|
||||||
|
"cwd": "apps/desktop-ui",
|
||||||
|
"command": "storybook dev -p 6007"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"build-storybook": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"cache": true,
|
||||||
|
"options": {
|
||||||
|
"cwd": "apps/desktop-ui",
|
||||||
|
"command": "storybook build -o dist/storybook"
|
||||||
|
},
|
||||||
|
"outputs": [
|
||||||
|
"{projectRoot}/dist/storybook"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"cache": true,
|
||||||
|
"options": {
|
||||||
|
"cwd": "apps/desktop-ui",
|
||||||
|
"command": "eslint src --cache"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"typecheck": {
|
||||||
|
"executor": "nx:run-commands",
|
||||||
|
"cache": true,
|
||||||
|
"options": {
|
||||||
|
"cwd": "apps/desktop-ui",
|
||||||
|
"command": "vue-tsc --noEmit -p tsconfig.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"storybook": "storybook dev -p 6007",
|
||||||
|
"build-storybook": "storybook build -o dist/storybook"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@comfyorg/comfyui-electron-types": "0.4.73-0",
|
||||||
|
"@comfyorg/shared-frontend-utils": "workspace:*",
|
||||||
|
"@primevue/core": "catalog:",
|
||||||
|
"@primevue/themes": "catalog:",
|
||||||
|
"@vueuse/core": "catalog:",
|
||||||
|
"pinia": "catalog:",
|
||||||
|
"primeicons": "catalog:",
|
||||||
|
"primevue": "catalog:",
|
||||||
|
"vue": "catalog:",
|
||||||
|
"vue-i18n": "catalog:",
|
||||||
|
"vue-router": "catalog:"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@tailwindcss/vite": "catalog:",
|
||||||
|
"@vitejs/plugin-vue": "catalog:",
|
||||||
|
"dotenv": "catalog:",
|
||||||
|
"unplugin-icons": "catalog:",
|
||||||
|
"unplugin-vue-components": "catalog:",
|
||||||
|
"vite": "catalog:",
|
||||||
|
"vite-plugin-html": "catalog:",
|
||||||
|
"vite-plugin-vue-devtools": "catalog:",
|
||||||
|
"vue-tsc": "catalog:"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 174 KiB |
7
apps/desktop-ui/src/App.vue
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<template>
|
||||||
|
<RouterView />
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { RouterView } from 'vue-router'
|
||||||
|
</script>
|
||||||
6
apps/desktop-ui/src/assets/css/style.css
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
@import '@comfyorg/design-system/css/style.css';
|
||||||
|
|
||||||
|
#desktop-app {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
<template>
|
||||||
|
<div
|
||||||
|
ref="rootEl"
|
||||||
|
class="relative overflow-hidden h-full w-full bg-neutral-900"
|
||||||
|
>
|
||||||
|
<div class="p-terminal rounded-none h-full w-full p-2">
|
||||||
|
<div ref="terminalEl" class="h-full terminal-host" />
|
||||||
|
</div>
|
||||||
|
<Button
|
||||||
|
v-tooltip.left="{
|
||||||
|
value: tooltipText,
|
||||||
|
showDelay: 300
|
||||||
|
}"
|
||||||
|
icon="pi pi-copy"
|
||||||
|
severity="secondary"
|
||||||
|
size="small"
|
||||||
|
:class="
|
||||||
|
cn('absolute top-2 right-8 transition-opacity', {
|
||||||
|
'opacity-0 pointer-events-none select-none': !isHovered
|
||||||
|
})
|
||||||
|
"
|
||||||
|
:aria-label="tooltipText"
|
||||||
|
@click="handleCopy"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { useElementHover, useEventListener } from '@vueuse/core'
|
||||||
|
import type { IDisposable } from '@xterm/xterm'
|
||||||
|
import Button from 'primevue/button'
|
||||||
|
import type { Ref } from 'vue'
|
||||||
|
import { computed, onMounted, onUnmounted, ref } from 'vue'
|
||||||
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
|
import { useTerminal } from '@/composables/bottomPanelTabs/useTerminal'
|
||||||
|
import { electronAPI, isElectron } from '@/utils/envUtil'
|
||||||
|
import { cn } from '@/utils/tailwindUtil'
|
||||||
|
|
||||||
|
const { t } = useI18n()
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
created: [ReturnType<typeof useTerminal>, Ref<HTMLElement | undefined>]
|
||||||
|
unmounted: []
|
||||||
|
}>()
|
||||||
|
const terminalEl = ref<HTMLElement | undefined>()
|
||||||
|
const rootEl = ref<HTMLElement | undefined>()
|
||||||
|
const hasSelection = ref(false)
|
||||||
|
|
||||||
|
const isHovered = useElementHover(rootEl)
|
||||||
|
|
||||||
|
const terminalData = useTerminal(terminalEl)
|
||||||
|
emit('created', terminalData, ref(rootEl))
|
||||||
|
|
||||||
|
const { terminal } = terminalData
|
||||||
|
let selectionDisposable: IDisposable | undefined
|
||||||
|
|
||||||
|
const tooltipText = computed(() => {
|
||||||
|
return hasSelection.value
|
||||||
|
? t('serverStart.copySelectionTooltip')
|
||||||
|
: t('serverStart.copyAllTooltip')
|
||||||
|
})
|
||||||
|
|
||||||
|
const handleCopy = async () => {
|
||||||
|
const existingSelection = terminal.getSelection()
|
||||||
|
const shouldSelectAll = !existingSelection
|
||||||
|
if (shouldSelectAll) terminal.selectAll()
|
||||||
|
|
||||||
|
const selectedText = shouldSelectAll
|
||||||
|
? terminal.getSelection()
|
||||||
|
: existingSelection
|
||||||
|
|
||||||
|
if (selectedText) {
|
||||||
|
await navigator.clipboard.writeText(selectedText)
|
||||||
|
|
||||||
|
if (shouldSelectAll) {
|
||||||
|
terminal.clearSelection()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const showContextMenu = (event: MouseEvent) => {
|
||||||
|
event.preventDefault()
|
||||||
|
electronAPI()?.showContextMenu({ type: 'text' })
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isElectron()) {
|
||||||
|
useEventListener(terminalEl, 'contextmenu', showContextMenu)
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
selectionDisposable = terminal.onSelectionChange(() => {
|
||||||
|
hasSelection.value = terminal.hasSelection()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
selectionDisposable?.dispose()
|
||||||
|
emit('unmounted')
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
@reference '../../../../assets/css/style.css';
|
||||||
|
|
||||||
|
:deep(.p-terminal) .xterm {
|
||||||
|
@apply overflow-hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.p-terminal) .xterm-screen {
|
||||||
|
@apply bg-neutral-900 overflow-hidden;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
129
apps/desktop-ui/src/components/common/UrlInput.vue
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
<template>
|
||||||
|
<IconField class="w-full">
|
||||||
|
<InputText
|
||||||
|
v-bind="$attrs"
|
||||||
|
:model-value="internalValue"
|
||||||
|
class="w-full"
|
||||||
|
:invalid="validationState === ValidationState.INVALID"
|
||||||
|
@update:model-value="handleInput"
|
||||||
|
@blur="handleBlur"
|
||||||
|
/>
|
||||||
|
<InputIcon
|
||||||
|
:class="{
|
||||||
|
'pi pi-spin pi-spinner text-neutral-400':
|
||||||
|
validationState === ValidationState.LOADING,
|
||||||
|
'pi pi-check text-green-500 cursor-pointer':
|
||||||
|
validationState === ValidationState.VALID,
|
||||||
|
'pi pi-times text-red-500 cursor-pointer':
|
||||||
|
validationState === ValidationState.INVALID
|
||||||
|
}"
|
||||||
|
@click="validateUrl(props.modelValue)"
|
||||||
|
/>
|
||||||
|
</IconField>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { isValidUrl } from '@comfyorg/shared-frontend-utils/formatUtil'
|
||||||
|
import { checkUrlReachable } from '@comfyorg/shared-frontend-utils/networkUtil'
|
||||||
|
import IconField from 'primevue/iconfield'
|
||||||
|
import InputIcon from 'primevue/inputicon'
|
||||||
|
import InputText from 'primevue/inputtext'
|
||||||
|
import { onMounted, ref, watch } from 'vue'
|
||||||
|
|
||||||
|
import { ValidationState } from '@/utils/validationUtil'
|
||||||
|
|
||||||
|
const props = defineProps<{
|
||||||
|
modelValue: string
|
||||||
|
validateUrlFn?: (url: string) => Promise<boolean>
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const emit = defineEmits<{
|
||||||
|
'update:modelValue': [value: string]
|
||||||
|
'state-change': [state: ValidationState]
|
||||||
|
}>()
|
||||||
|
|
||||||
|
const validationState = ref<ValidationState>(ValidationState.IDLE)
|
||||||
|
|
||||||
|
const cleanInput = (value: string): string =>
|
||||||
|
value ? value.replace(/\s+/g, '') : ''
|
||||||
|
|
||||||
|
// Add internal value state
|
||||||
|
const internalValue = ref(cleanInput(props.modelValue))
|
||||||
|
|
||||||
|
// Watch for external modelValue changes
|
||||||
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
async (newValue: string) => {
|
||||||
|
internalValue.value = cleanInput(newValue)
|
||||||
|
await validateUrl(newValue)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
watch(validationState, (newState) => {
|
||||||
|
emit('state-change', newState)
|
||||||
|
})
|
||||||
|
|
||||||
|
// Validate on mount
|
||||||
|
onMounted(async () => {
|
||||||
|
await validateUrl(props.modelValue)
|
||||||
|
})
|
||||||
|
|
||||||
|
const handleInput = (value: string | undefined) => {
|
||||||
|
// Update internal value without emitting
|
||||||
|
internalValue.value = cleanInput(value ?? '')
|
||||||
|
// Reset validation state when user types
|
||||||
|
validationState.value = ValidationState.IDLE
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleBlur = async () => {
|
||||||
|
const input = cleanInput(internalValue.value)
|
||||||
|
|
||||||
|
let normalizedUrl = input
|
||||||
|
try {
|
||||||
|
const url = new URL(input)
|
||||||
|
normalizedUrl = url.toString()
|
||||||
|
} catch {
|
||||||
|
// If URL parsing fails, just use the cleaned input
|
||||||
|
}
|
||||||
|
|
||||||
|
// Emit the update only on blur
|
||||||
|
emit('update:modelValue', normalizedUrl)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default validation implementation
|
||||||
|
const defaultValidateUrl = async (url: string): Promise<boolean> => {
|
||||||
|
if (!isValidUrl(url)) return false
|
||||||
|
try {
|
||||||
|
return await checkUrlReachable(url)
|
||||||
|
} catch {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const validateUrl = async (value: string) => {
|
||||||
|
if (validationState.value === ValidationState.LOADING) return
|
||||||
|
|
||||||
|
const url = cleanInput(value)
|
||||||
|
|
||||||
|
// Reset state
|
||||||
|
validationState.value = ValidationState.IDLE
|
||||||
|
|
||||||
|
// Skip validation if empty
|
||||||
|
if (!url) return
|
||||||
|
|
||||||
|
validationState.value = ValidationState.LOADING
|
||||||
|
try {
|
||||||
|
const isValid = await (props.validateUrlFn ?? defaultValidateUrl)(url)
|
||||||
|
validationState.value = isValid
|
||||||
|
? ValidationState.VALID
|
||||||
|
: ValidationState.INVALID
|
||||||
|
} catch {
|
||||||
|
validationState.value = ValidationState.INVALID
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add inheritAttrs option to prevent attrs from being applied to root element
|
||||||
|
defineOptions({
|
||||||
|
inheritAttrs: false
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
:value="$t('install.gpuPicker.recommended')"
|
:value="$t('install.gpuPicker.recommended')"
|
||||||
class="bg-neutral-300 text-neutral-900 rounded-full text-sm font-bold px-2 py-[1px]"
|
class="bg-neutral-300 text-neutral-900 rounded-full text-sm font-bold px-2 py-[1px]"
|
||||||
/>
|
/>
|
||||||
<i-lucide:badge-check class="text-neutral-300 text-lg" />
|
<i class="icon-[lucide--badge-check] text-neutral-300 text-lg" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -106,6 +106,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { TorchDeviceType } from '@comfyorg/comfyui-electron-types'
|
import type { TorchDeviceType } from '@comfyorg/comfyui-electron-types'
|
||||||
import { TorchMirrorUrl } from '@comfyorg/comfyui-electron-types'
|
import { TorchMirrorUrl } from '@comfyorg/comfyui-electron-types'
|
||||||
|
import { isInChina } from '@comfyorg/shared-frontend-utils/networkUtil'
|
||||||
import Accordion from 'primevue/accordion'
|
import Accordion from 'primevue/accordion'
|
||||||
import AccordionContent from 'primevue/accordioncontent'
|
import AccordionContent from 'primevue/accordioncontent'
|
||||||
import AccordionHeader from 'primevue/accordionheader'
|
import AccordionHeader from 'primevue/accordionheader'
|
||||||
@@ -125,7 +126,6 @@ import {
|
|||||||
type UVMirror
|
type UVMirror
|
||||||
} from '@/constants/uvMirrors'
|
} from '@/constants/uvMirrors'
|
||||||
import { electronAPI } from '@/utils/envUtil'
|
import { electronAPI } from '@/utils/envUtil'
|
||||||
import { isInChina } from '@/utils/networkUtil'
|
|
||||||
import { ValidationState } from '@/utils/validationUtil'
|
import { ValidationState } from '@/utils/validationUtil'
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
@@ -286,6 +286,12 @@ const onFocus = async () => {
|
|||||||
.p-accordionheader {
|
.p-accordionheader {
|
||||||
@apply rounded-t-xl rounded-b-none;
|
@apply rounded-t-xl rounded-b-none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.p-accordionheader-toggle-icon {
|
||||||
|
&::before {
|
||||||
|
content: '\e902';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-accordioncontent {
|
.p-accordioncontent {
|
||||||
@@ -302,13 +308,5 @@ const onFocus = async () => {
|
|||||||
content: '\e933';
|
content: '\e933';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.p-accordionpanel-active {
|
|
||||||
.p-accordionheader-toggle-icon {
|
|
||||||
&::before {
|
|
||||||
content: '\e902';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -53,6 +53,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { normalizeI18nKey } from '@comfyorg/shared-frontend-utils/formatUtil'
|
||||||
import Dialog from 'primevue/dialog'
|
import Dialog from 'primevue/dialog'
|
||||||
import Divider from 'primevue/divider'
|
import Divider from 'primevue/divider'
|
||||||
import { computed, onMounted, ref, watch } from 'vue'
|
import { computed, onMounted, ref, watch } from 'vue'
|
||||||
@@ -61,7 +62,6 @@ import UrlInput from '@/components/common/UrlInput.vue'
|
|||||||
import type { UVMirror } from '@/constants/uvMirrors'
|
import type { UVMirror } from '@/constants/uvMirrors'
|
||||||
import { st } from '@/i18n'
|
import { st } from '@/i18n'
|
||||||
import { checkMirrorReachable } from '@/utils/electronMirrorCheck'
|
import { checkMirrorReachable } from '@/utils/electronMirrorCheck'
|
||||||
import { normalizeI18nKey } from '@/utils/formatUtil'
|
|
||||||
import { ValidationState } from '@/utils/validationUtil'
|
import { ValidationState } from '@/utils/validationUtil'
|
||||||
|
|
||||||
const FILE_URL_SCHEME = 'file://'
|
const FILE_URL_SCHEME = 'file://'
|
||||||
105
apps/desktop-ui/src/composables/bottomPanelTabs/useTerminal.ts
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
import { FitAddon } from '@xterm/addon-fit'
|
||||||
|
import { Terminal } from '@xterm/xterm'
|
||||||
|
import '@xterm/xterm/css/xterm.css'
|
||||||
|
import { debounce } from 'es-toolkit/compat'
|
||||||
|
import type { Ref } from 'vue'
|
||||||
|
import { markRaw, onMounted, onUnmounted } from 'vue'
|
||||||
|
|
||||||
|
export function useTerminal(element: Ref<HTMLElement | undefined>) {
|
||||||
|
const fitAddon = new FitAddon()
|
||||||
|
const terminal = markRaw(
|
||||||
|
new Terminal({
|
||||||
|
convertEol: true,
|
||||||
|
theme: { background: '#171717' }
|
||||||
|
})
|
||||||
|
)
|
||||||
|
terminal.loadAddon(fitAddon)
|
||||||
|
|
||||||
|
terminal.attachCustomKeyEventHandler((event) => {
|
||||||
|
// Allow default browser copy/paste handling
|
||||||
|
if (
|
||||||
|
event.type === 'keydown' &&
|
||||||
|
(event.ctrlKey || event.metaKey) &&
|
||||||
|
((event.key === 'c' && terminal.hasSelection()) || event.key === 'v')
|
||||||
|
) {
|
||||||
|
// TODO: Deselect text after copy/paste; use IPC.
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
})
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
if (element.value) {
|
||||||
|
terminal.open(element.value)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
terminal.dispose()
|
||||||
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
terminal,
|
||||||
|
useAutoSize({
|
||||||
|
root,
|
||||||
|
autoRows = true,
|
||||||
|
autoCols = true,
|
||||||
|
minCols = Number.NEGATIVE_INFINITY,
|
||||||
|
minRows = Number.NEGATIVE_INFINITY,
|
||||||
|
onResize
|
||||||
|
}: {
|
||||||
|
root: Ref<HTMLElement | undefined>
|
||||||
|
autoRows?: boolean
|
||||||
|
autoCols?: boolean
|
||||||
|
minCols?: number
|
||||||
|
minRows?: number
|
||||||
|
onResize?: () => void
|
||||||
|
}) {
|
||||||
|
const ensureValidRows = (rows: number | undefined): number => {
|
||||||
|
if (rows == null || isNaN(rows)) {
|
||||||
|
return (root.value?.clientHeight ?? 80) / 20
|
||||||
|
}
|
||||||
|
return rows
|
||||||
|
}
|
||||||
|
|
||||||
|
const ensureValidCols = (cols: number | undefined): number => {
|
||||||
|
if (cols == null || isNaN(cols)) {
|
||||||
|
// Sometimes this is NaN if so, estimate.
|
||||||
|
return (root.value?.clientWidth ?? 80) / 8
|
||||||
|
}
|
||||||
|
return cols
|
||||||
|
}
|
||||||
|
|
||||||
|
const resize = () => {
|
||||||
|
const dims = fitAddon.proposeDimensions()
|
||||||
|
// Sometimes propose returns NaN, so we may need to estimate.
|
||||||
|
terminal.resize(
|
||||||
|
Math.max(
|
||||||
|
autoCols ? ensureValidCols(dims?.cols) : terminal.cols,
|
||||||
|
minCols
|
||||||
|
),
|
||||||
|
Math.max(
|
||||||
|
autoRows ? ensureValidRows(dims?.rows) : terminal.rows,
|
||||||
|
minRows
|
||||||
|
)
|
||||||
|
)
|
||||||
|
onResize?.()
|
||||||
|
}
|
||||||
|
|
||||||
|
const resizeObserver = new ResizeObserver(debounce(resize, 25))
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
if (root.value) {
|
||||||
|
resizeObserver.observe(root.value)
|
||||||
|
resize()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
resizeObserver.disconnect()
|
||||||
|
})
|
||||||
|
|
||||||
|
return { resize }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
34
apps/desktop-ui/src/constants/uvMirrors.ts
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
export interface UVMirror {
|
||||||
|
/**
|
||||||
|
* The setting id defined for the mirror.
|
||||||
|
*/
|
||||||
|
settingId: string
|
||||||
|
/**
|
||||||
|
* The default mirror to use.
|
||||||
|
*/
|
||||||
|
mirror: string
|
||||||
|
/**
|
||||||
|
* The fallback mirror to use.
|
||||||
|
*/
|
||||||
|
fallbackMirror: string
|
||||||
|
/**
|
||||||
|
* The path suffix to validate the mirror is reachable.
|
||||||
|
*/
|
||||||
|
validationPathSuffix?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export const PYTHON_MIRROR: UVMirror = {
|
||||||
|
settingId: 'Comfy-Desktop.UV.PythonInstallMirror',
|
||||||
|
mirror:
|
||||||
|
'https://github.com/astral-sh/python-build-standalone/releases/download',
|
||||||
|
fallbackMirror:
|
||||||
|
'https://python-standalone.org/mirror/astral-sh/python-build-standalone',
|
||||||
|
validationPathSuffix:
|
||||||
|
'/20250115/cpython-3.10.16+20250115-aarch64-apple-darwin-debug-full.tar.zst.sha256'
|
||||||
|
}
|
||||||
|
|
||||||
|
export const PYPI_MIRROR: UVMirror = {
|
||||||
|
settingId: 'Comfy-Desktop.UV.PypiInstallMirror',
|
||||||
|
mirror: 'https://pypi.org/simple/',
|
||||||
|
fallbackMirror: 'https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple'
|
||||||
|
}
|
||||||
88
apps/desktop-ui/src/i18n.ts
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
import arCommands from '@frontend-locales/ar/commands.json' with { type: 'json' }
|
||||||
|
import ar from '@frontend-locales/ar/main.json' with { type: 'json' }
|
||||||
|
import arNodes from '@frontend-locales/ar/nodeDefs.json' with { type: 'json' }
|
||||||
|
import arSettings from '@frontend-locales/ar/settings.json' with { type: 'json' }
|
||||||
|
import enCommands from '@frontend-locales/en/commands.json' with { type: 'json' }
|
||||||
|
import en from '@frontend-locales/en/main.json' with { type: 'json' }
|
||||||
|
import enNodes from '@frontend-locales/en/nodeDefs.json' with { type: 'json' }
|
||||||
|
import enSettings from '@frontend-locales/en/settings.json' with { type: 'json' }
|
||||||
|
import esCommands from '@frontend-locales/es/commands.json' with { type: 'json' }
|
||||||
|
import es from '@frontend-locales/es/main.json' with { type: 'json' }
|
||||||
|
import esNodes from '@frontend-locales/es/nodeDefs.json' with { type: 'json' }
|
||||||
|
import esSettings from '@frontend-locales/es/settings.json' with { type: 'json' }
|
||||||
|
import frCommands from '@frontend-locales/fr/commands.json' with { type: 'json' }
|
||||||
|
import fr from '@frontend-locales/fr/main.json' with { type: 'json' }
|
||||||
|
import frNodes from '@frontend-locales/fr/nodeDefs.json' with { type: 'json' }
|
||||||
|
import frSettings from '@frontend-locales/fr/settings.json' with { type: 'json' }
|
||||||
|
import jaCommands from '@frontend-locales/ja/commands.json' with { type: 'json' }
|
||||||
|
import ja from '@frontend-locales/ja/main.json' with { type: 'json' }
|
||||||
|
import jaNodes from '@frontend-locales/ja/nodeDefs.json' with { type: 'json' }
|
||||||
|
import jaSettings from '@frontend-locales/ja/settings.json' with { type: 'json' }
|
||||||
|
import koCommands from '@frontend-locales/ko/commands.json' with { type: 'json' }
|
||||||
|
import ko from '@frontend-locales/ko/main.json' with { type: 'json' }
|
||||||
|
import koNodes from '@frontend-locales/ko/nodeDefs.json' with { type: 'json' }
|
||||||
|
import koSettings from '@frontend-locales/ko/settings.json' with { type: 'json' }
|
||||||
|
import ruCommands from '@frontend-locales/ru/commands.json' with { type: 'json' }
|
||||||
|
import ru from '@frontend-locales/ru/main.json' with { type: 'json' }
|
||||||
|
import ruNodes from '@frontend-locales/ru/nodeDefs.json' with { type: 'json' }
|
||||||
|
import ruSettings from '@frontend-locales/ru/settings.json' with { type: 'json' }
|
||||||
|
import trCommands from '@frontend-locales/tr/commands.json' with { type: 'json' }
|
||||||
|
import tr from '@frontend-locales/tr/main.json' with { type: 'json' }
|
||||||
|
import trNodes from '@frontend-locales/tr/nodeDefs.json' with { type: 'json' }
|
||||||
|
import trSettings from '@frontend-locales/tr/settings.json' with { type: 'json' }
|
||||||
|
import zhTWCommands from '@frontend-locales/zh-TW/commands.json' with { type: 'json' }
|
||||||
|
import zhTW from '@frontend-locales/zh-TW/main.json' with { type: 'json' }
|
||||||
|
import zhTWNodes from '@frontend-locales/zh-TW/nodeDefs.json' with { type: 'json' }
|
||||||
|
import zhTWSettings from '@frontend-locales/zh-TW/settings.json' with { type: 'json' }
|
||||||
|
import zhCommands from '@frontend-locales/zh/commands.json' with { type: 'json' }
|
||||||
|
import zh from '@frontend-locales/zh/main.json' with { type: 'json' }
|
||||||
|
import zhNodes from '@frontend-locales/zh/nodeDefs.json' with { type: 'json' }
|
||||||
|
import zhSettings from '@frontend-locales/zh/settings.json' with { type: 'json' }
|
||||||
|
import { createI18n } from 'vue-i18n'
|
||||||
|
|
||||||
|
function buildLocale<M, N, C, S>(main: M, nodes: N, commands: C, settings: S) {
|
||||||
|
return {
|
||||||
|
...main,
|
||||||
|
nodeDefs: nodes,
|
||||||
|
commands: commands,
|
||||||
|
settings: settings
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const messages = {
|
||||||
|
en: buildLocale(en, enNodes, enCommands, enSettings),
|
||||||
|
zh: buildLocale(zh, zhNodes, zhCommands, zhSettings),
|
||||||
|
'zh-TW': buildLocale(zhTW, zhTWNodes, zhTWCommands, zhTWSettings),
|
||||||
|
ru: buildLocale(ru, ruNodes, ruCommands, ruSettings),
|
||||||
|
ja: buildLocale(ja, jaNodes, jaCommands, jaSettings),
|
||||||
|
ko: buildLocale(ko, koNodes, koCommands, koSettings),
|
||||||
|
fr: buildLocale(fr, frNodes, frCommands, frSettings),
|
||||||
|
es: buildLocale(es, esNodes, esCommands, esSettings),
|
||||||
|
ar: buildLocale(ar, arNodes, arCommands, arSettings),
|
||||||
|
tr: buildLocale(tr, trNodes, trCommands, trSettings)
|
||||||
|
}
|
||||||
|
|
||||||
|
export const i18n = createI18n({
|
||||||
|
// Must set `false`, as Vue I18n Legacy API is for Vue 2
|
||||||
|
legacy: false,
|
||||||
|
locale: navigator.language.split('-')[0] || 'en',
|
||||||
|
fallbackLocale: 'en',
|
||||||
|
messages,
|
||||||
|
// Ignore warnings for locale options as each option is in its own language.
|
||||||
|
// e.g. "English", "中文", "Русский", "日本語", "한국어", "Français", "Español"
|
||||||
|
missingWarn: /^(?!settings\.Comfy_Locale\.options\.).+/,
|
||||||
|
fallbackWarn: /^(?!settings\.Comfy_Locale\.options\.).+/
|
||||||
|
})
|
||||||
|
|
||||||
|
/** Convenience shorthand: i18n.global */
|
||||||
|
export const { t, te } = i18n.global
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Safe translation function that returns the fallback message if the key is not found.
|
||||||
|
*
|
||||||
|
* @param key - The key to translate.
|
||||||
|
* @param fallbackMessage - The fallback message to use if the key is not found.
|
||||||
|
*/
|
||||||
|
export function st(key: string, fallbackMessage: string) {
|
||||||
|
return te(key) ? t(key) : fallbackMessage
|
||||||
|
}
|
||||||
46
apps/desktop-ui/src/main.ts
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import { definePreset } from '@primevue/themes'
|
||||||
|
import Aura from '@primevue/themes/aura'
|
||||||
|
import { createPinia } from 'pinia'
|
||||||
|
import 'primeicons/primeicons.css'
|
||||||
|
import PrimeVue from 'primevue/config'
|
||||||
|
import ConfirmationService from 'primevue/confirmationservice'
|
||||||
|
import ToastService from 'primevue/toastservice'
|
||||||
|
import Tooltip from 'primevue/tooltip'
|
||||||
|
import { createApp } from 'vue'
|
||||||
|
|
||||||
|
import App from './App.vue'
|
||||||
|
import './assets/css/style.css'
|
||||||
|
import { i18n } from './i18n'
|
||||||
|
import router from './router'
|
||||||
|
|
||||||
|
const ComfyUIPreset = definePreset(Aura, {
|
||||||
|
semantic: {
|
||||||
|
// @ts-expect-error fixme ts strict error
|
||||||
|
primary: Aura['primitive'].blue
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const app = createApp(App)
|
||||||
|
const pinia = createPinia()
|
||||||
|
|
||||||
|
app.directive('tooltip', Tooltip)
|
||||||
|
app
|
||||||
|
.use(router)
|
||||||
|
.use(PrimeVue, {
|
||||||
|
theme: {
|
||||||
|
preset: ComfyUIPreset,
|
||||||
|
options: {
|
||||||
|
prefix: 'p',
|
||||||
|
cssLayer: {
|
||||||
|
name: 'primevue',
|
||||||
|
order: 'theme, base, primevue'
|
||||||
|
},
|
||||||
|
darkModeSelector: '.dark-theme, :root:has(.dark-theme)'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.use(ConfirmationService)
|
||||||
|
.use(ToastService)
|
||||||
|
.use(pinia)
|
||||||
|
.use(i18n)
|
||||||
|
.mount('#desktop-app')
|
||||||
92
apps/desktop-ui/src/router.ts
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
import {
|
||||||
|
createRouter,
|
||||||
|
createWebHashHistory,
|
||||||
|
createWebHistory
|
||||||
|
} from 'vue-router'
|
||||||
|
|
||||||
|
import { isElectron } from '@/utils/envUtil'
|
||||||
|
import LayoutDefault from '@/views/layouts/LayoutDefault.vue'
|
||||||
|
|
||||||
|
const isFileProtocol = window.location.protocol === 'file:'
|
||||||
|
const basePath = isElectron() ? '/' : window.location.pathname
|
||||||
|
|
||||||
|
const router = createRouter({
|
||||||
|
history: isFileProtocol ? createWebHashHistory() : createWebHistory(basePath),
|
||||||
|
routes: [
|
||||||
|
{
|
||||||
|
path: '/',
|
||||||
|
component: LayoutDefault,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
name: 'WelcomeView',
|
||||||
|
component: () => import('@/views/WelcomeView.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'welcome',
|
||||||
|
name: 'WelcomeViewAlias',
|
||||||
|
component: () => import('@/views/WelcomeView.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'install',
|
||||||
|
name: 'InstallView',
|
||||||
|
component: () => import('@/views/InstallView.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'download-git',
|
||||||
|
name: 'DownloadGitView',
|
||||||
|
component: () => import('@/views/DownloadGitView.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'desktop-start',
|
||||||
|
name: 'DesktopStartView',
|
||||||
|
component: () => import('@/views/DesktopStartView.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'desktop-update',
|
||||||
|
name: 'DesktopUpdateView',
|
||||||
|
component: () => import('@/views/DesktopUpdateView.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'server-start',
|
||||||
|
name: 'ServerStartView',
|
||||||
|
component: () => import('@/views/ServerStartView.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'manual-configuration',
|
||||||
|
name: 'ManualConfigurationView',
|
||||||
|
component: () => import('@/views/ManualConfigurationView.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'metrics-consent',
|
||||||
|
name: 'MetricsConsentView',
|
||||||
|
component: () => import('@/views/MetricsConsentView.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'maintenance',
|
||||||
|
name: 'MaintenanceView',
|
||||||
|
component: () => import('@/views/MaintenanceView.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'not-supported',
|
||||||
|
name: 'NotSupportedView',
|
||||||
|
component: () => import('@/views/NotSupportedView.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'desktop-dialog/:dialogId',
|
||||||
|
name: 'DesktopDialogView',
|
||||||
|
component: () => import('@/views/DesktopDialogView.vue')
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
scrollBehavior(_to, _from, savedPosition) {
|
||||||
|
if (savedPosition) {
|
||||||
|
return savedPosition
|
||||||
|
}
|
||||||
|
|
||||||
|
return { top: 0 }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
export default router
|
||||||
@@ -151,7 +151,6 @@ export const useMaintenanceTaskStore = defineStore('maintenanceTask', () => {
|
|||||||
/** @todo Refreshes Electron tasks only. */
|
/** @todo Refreshes Electron tasks only. */
|
||||||
const refreshDesktopTasks = async () => {
|
const refreshDesktopTasks = async () => {
|
||||||
isRefreshing.value = true
|
isRefreshing.value = true
|
||||||
console.log('Refreshing desktop tasks')
|
|
||||||
await electron.Validation.validateInstallation(processUpdate)
|
await electron.Validation.validateInstallation(processUpdate)
|
||||||
}
|
}
|
||||||
|
|
||||||
12
apps/desktop-ui/src/types/global.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
declare global {
|
||||||
|
interface Navigator {
|
||||||
|
/**
|
||||||
|
* Desktop app uses windowControlsOverlay to decide if it is in a custom window.
|
||||||
|
*/
|
||||||
|
windowControlsOverlay?: {
|
||||||
|
visible: boolean
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export {}
|
||||||
14
apps/desktop-ui/src/utils/electronMirrorCheck.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { isValidUrl } from '@comfyorg/shared-frontend-utils/formatUtil'
|
||||||
|
|
||||||
|
import { electronAPI } from './envUtil'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a mirror is reachable from the electron App.
|
||||||
|
* @param mirror - The mirror to check.
|
||||||
|
* @returns True if the mirror is reachable, false otherwise.
|
||||||
|
*/
|
||||||
|
export const checkMirrorReachable = async (mirror: string) => {
|
||||||
|
return (
|
||||||
|
isValidUrl(mirror) && (await electronAPI().NetWork.canAccessUrl(mirror))
|
||||||
|
)
|
||||||
|
}
|
||||||
13
apps/desktop-ui/src/utils/envUtil.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import type { ElectronAPI } from '@comfyorg/comfyui-electron-types'
|
||||||
|
|
||||||
|
export function isElectron() {
|
||||||
|
return 'electronAPI' in window && window.electronAPI !== undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
export function electronAPI() {
|
||||||
|
return (window as any).electronAPI as ElectronAPI
|
||||||
|
}
|
||||||
|
|
||||||
|
export function isNativeWindow() {
|
||||||
|
return isElectron() && !!window.navigator.windowControlsOverlay?.visible
|
||||||
|
}
|
||||||
1
apps/desktop-ui/src/utils/tailwindUtil.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export { cn } from '@comfyorg/tailwind-utils'
|
||||||
6
apps/desktop-ui/src/utils/validationUtil.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
export enum ValidationState {
|
||||||
|
IDLE = 'IDLE',
|
||||||
|
LOADING = 'LOADING',
|
||||||
|
VALID = 'VALID',
|
||||||
|
INVALID = 'INVALID'
|
||||||
|
}
|
||||||
@@ -25,13 +25,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { normalizeI18nKey } from '@comfyorg/shared-frontend-utils/formatUtil'
|
||||||
import Button from 'primevue/button'
|
import Button from 'primevue/button'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
|
|
||||||
import { type DialogAction, getDialog } from '@/constants/desktopDialogs'
|
import { type DialogAction, getDialog } from '@/constants/desktopDialogs'
|
||||||
import { t } from '@/i18n'
|
import { t } from '@/i18n'
|
||||||
import { electronAPI } from '@/utils/envUtil'
|
import { electronAPI } from '@/utils/envUtil'
|
||||||
import { normalizeI18nKey } from '@/utils/formatUtil'
|
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const { id, title, message, buttons } = getDialog(route.params.dialogId)
|
const { id, title, message, buttons } = getDialog(route.params.dialogId)
|
||||||
@@ -65,12 +65,12 @@ onUnmounted(() => electron.Validation.dispose())
|
|||||||
|
|
||||||
.download-bg::before {
|
.download-bg::before {
|
||||||
@apply m-0 absolute text-muted;
|
@apply m-0 absolute text-muted;
|
||||||
font-family: 'primeicons';
|
font-family: 'primeicons', sans-serif;
|
||||||
top: -2rem;
|
top: -2rem;
|
||||||
right: 2rem;
|
right: 2rem;
|
||||||
speak: none;
|
speak: none;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: normal;
|
font-weight: 400;
|
||||||
font-variant: normal;
|
font-variant: normal;
|
||||||
text-transform: none;
|
text-transform: none;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
@@ -48,16 +48,10 @@ const meta: Meta<typeof InstallView> = {
|
|||||||
getDetectedGpu: () => Promise.resolve('mps')
|
getDetectedGpu: () => Promise.resolve('mps')
|
||||||
},
|
},
|
||||||
Events: {
|
Events: {
|
||||||
trackEvent: (eventName: string, data?: any) => {
|
trackEvent: (_eventName: string, _data?: any) => {}
|
||||||
console.log('Track event:', eventName, data)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
installComfyUI: (options: any) => {
|
|
||||||
console.log('Install ComfyUI with options:', options)
|
|
||||||
},
|
|
||||||
changeTheme: (theme: any) => {
|
|
||||||
console.log('Change theme:', theme)
|
|
||||||
},
|
},
|
||||||
|
installComfyUI: (_options: any) => {},
|
||||||
|
changeTheme: (_theme: any) => {},
|
||||||
getSystemPaths: () =>
|
getSystemPaths: () =>
|
||||||
Promise.resolve({
|
Promise.resolve({
|
||||||
defaultInstallPath: '/Users/username/ComfyUI'
|
defaultInstallPath: '/Users/username/ComfyUI'
|
||||||
@@ -186,12 +186,12 @@ onUnmounted(() => electron.Validation.dispose())
|
|||||||
|
|
||||||
.backspan::before {
|
.backspan::before {
|
||||||
@apply m-0 absolute text-muted;
|
@apply m-0 absolute text-muted;
|
||||||
font-family: 'primeicons';
|
font-family: 'primeicons', sans-serif;
|
||||||
top: -2rem;
|
top: -2rem;
|
||||||
right: -2rem;
|
right: -2rem;
|
||||||
speak: none;
|
speak: none;
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
font-weight: normal;
|
font-weight: 400;
|
||||||
font-variant: normal;
|
font-variant: normal;
|
||||||
text-transform: none;
|
text-transform: none;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||