Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add frontend of model community #1

Merged
merged 42 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
4f16965
init dev
doombeaker Nov 25, 2024
851c66b
[fix]filter bugs
Of-qinhai Nov 26, 2024
24e6f90
refine
linjm8780860 Nov 26, 2024
ae7c273
[fix]remove unused alter
Of-qinhai Nov 28, 2024
58f88ab
[fix] resolve shortcut key conflicts for md edit
Of-qinhai Dec 3, 2024
dca65f5
fix
linjm8780860 Dec 3, 2024
45c589b
fix
linjm8780860 Dec 3, 2024
ac833a9
Remove unused bun.lockb file and refactor btnModel component for impr…
Of-qinhai Dec 3, 2024
43baa89
Refactor API key handling: Rename set_api_key to setApiKey for consis…
Of-qinhai Dec 3, 2024
a261083
[feat]remove unused test code
Of-qinhai Dec 4, 2024
7004ffb
[feat]fix model select z-index
Of-qinhai Dec 4, 2024
177352b
[feat]optimize z-index
Of-qinhai Dec 4, 2024
5a05d07
fix
linjm8780860 Dec 5, 2024
65353bd
fix
linjm8780860 Dec 5, 2024
91cc9f6
[feat]fix can't remove model bug
Of-qinhai Dec 5, 2024
5dac6c6
[feat]fix bug
Of-qinhai Dec 5, 2024
32d5d48
fix
linjm8780860 Dec 5, 2024
7093a02
Merge branch 'dev_bbs' of https://github.com/siliconflow/bizyair_fron…
linjm8780860 Dec 5, 2024
e93e66e
fix
linjm8780860 Dec 5, 2024
4e76b65
fix
linjm8780860 Dec 5, 2024
d815c3c
fix editor shortcut
Of-qinhai Dec 5, 2024
a876a04
fix
linjm8780860 Dec 5, 2024
1dc4f03
fix
linjm8780860 Dec 5, 2024
8345960
fix
linjm8780860 Dec 5, 2024
d1d677d
[feat]fix bugs
Of-qinhai Dec 6, 2024
9ad5e3c
[feat]add eslint
Of-qinhai Dec 6, 2024
0811162
[feat]off eslint warn
Of-qinhai Dec 6, 2024
81190b1
[feat]add prettier format
Of-qinhai Dec 6, 2024
3e5879d
[feat]add markdown
Of-qinhai Dec 6, 2024
ff374d4
Add lint.yaml (#5)
wjymtg Dec 9, 2024
e9bb63a
fix
linjm8780860 Dec 10, 2024
7e3490d
merge
linjm8780860 Dec 10, 2024
c486d13
fix
linjm8780860 Dec 10, 2024
3e71de9
auto prettier format code
linjm8780860 Dec 10, 2024
9d2adcf
fix
linjm8780860 Dec 10, 2024
5c5cff9
Merge branch 'dev_bbs' of https://github.com/siliconflow/bizyair_fron…
linjm8780860 Dec 10, 2024
bd35371
fix
linjm8780860 Dec 10, 2024
c8daf03
auto prettier format code
linjm8780860 Dec 10, 2024
703e296
fix
linjm8780860 Dec 10, 2024
af04ad6
fix ws (#7)
wjymtg Dec 11, 2024
f20ef1c
Initial Playwright browser test (#8)
wjymtg Dec 12, 2024
9f7e004
Playwright test snapshots (#9)
wjymtg Dec 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
node_modules
*.d.ts
28 changes: 28 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module.exports = {
root: true,
env: {
node: true,
browser: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
'prettier'
],
parser: 'vue-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2021,
sourceType: 'module'
},
plugins: ['vue', '@typescript-eslint'],
rules: {
'vue/multi-word-component-names': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'no-console': 'off',
'no-debugger': 'off'
}
}
108 changes: 108 additions & 0 deletions .github/workflows/browser_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Inspired by: https://github.com/Comfy-Org/ComfyUI_frontend/blob/57701f6145f622bf17237410c165966fb4aecc75/.github/workflows/test-ui.yaml
name: Browser Tests

on:
workflow_dispatch:
push:
branches:
- dev_bbs
# TODO: add master when it's ready
pull_request:
types: [opened, synchronize, reopened]

env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

jobs:
browser_tests:
runs-on: ubuntu-latest
steps:
# Ref: https://github.com/orgs/community/discussions/25199#discussioncomment-3246802
- name: Get latest ComfyUI release with tag
id: latestrelease
run: |
echo "comfy_latest_release=$(curl -s https://api.github.com/repos/comfyanonymous/ComfyUI/releases/latest | jq '.tag_name' | sed 's/\"//g')" >> $GITHUB_OUTPUT

- name: Checkout ComfyUI
uses: actions/checkout@v4
with:
repository: comfyanonymous/ComfyUI
ref: ${{ steps.latestrelease.outputs.comfy_latest_release }}
path: ComfyUI

- name: Checkout BizyAir
uses: actions/checkout@v4
with:
repository: siliconflow/BizyAir
ref: master
path: ComfyUI/custom_nodes/BizyAir

- name: Checkout bizyair_frontend
uses: actions/checkout@v4
with:
repository: siliconflow/bizyair_frontend
ref: ${{ env.BRANCH_NAME }}
path: ComfyUI/custom_nodes/BizyAir/bizyair_frontend

- uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: |
ComfyUI/requirements.txt
ComfyUI/custom_nodes/BizyAir/requirements.txt

- uses: actions/setup-node@v4
with:
node-version: '20.9.0'
cache: 'npm'
cache-dependency-path: |
ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests/package-lock.json
ComfyUI/custom_nodes/BizyAir/bizyair_frontend/package-lock.json

- name: Install dependencies
run: |
pip install -r ComfyUI/requirements.txt
pip install -r ComfyUI/custom_nodes/BizyAir/requirements.txt
pip install wait-for-it

- name: Install playwright
run: |
npm install
npx playwright install chromium --with-deps
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests

- name: Install bizyair_frontend dependencies
run: |
npm install
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend

- name: Copy over test workflows
run: |
mkdir -p ComfyUI/user/default
cp -r ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests/workflows ComfyUI/user/default

- name: Update bizyair_frontend.js
run: |
npx vue-tsc -b
npx vite build
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend

- name: Start ComfyUI server
run: |
python main.py --cpu &
wait-for-it --service 127.0.0.1:8188 -t 600
working-directory: ComfyUI

- name: Run Tests
continue-on-error: true
run: |
npx playwright test --project chromium chromium-2x
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests

- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests/playwright-report/
retention-days: 30
60 changes: 60 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: TypeScript, Vue.js, and CSS Formatting And Linting

on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- "**.css"
- "**.ts"
- "**.vue"

permissions:
contents: write
pull-requests: write

jobs:
format_and_lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.9.0'

- name: Install dependencies
run: npm install

- name: Run Prettier
run: npm run format

- name: Run ESLint
continue-on-error: true
id: lint
run: npx eslint src

- name: Auto commit Prettier formatted files
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "auto prettier format code"
file_pattern: "*.css *.ts *.vue" # Don't update package-lock.json and package.json

- name: Add PR review comment if eslint fails
if: ${{ steps.lint.outcome == 'failure' }}
uses: actions/github-script@v4
with:
script: |
const { pull_request } = context.payload;
const comment = "Your code does not meet our eslint standards.\nPlease run `npm install eslint @eslint/js typescript-eslint eslint-plugin-vue globals && npx eslint src` to lint your code.";
await github.issues.createComment({
issue_number: pull_request.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
core.setFailed("eslint failed")
119 changes: 119 additions & 0 deletions .github/workflows/update_browser_exp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# Inspired by: https://github.com/Comfy-Org/ComfyUI_frontend/blob/57701f6145f622bf17237410c165966fb4aecc75/.github/workflows/test-browser-exp.yaml
name: Update Browser Tests Expectations

on:
workflow_dispatch:
# TODO: more proper trigger

jobs:
update_browser_expectations:
runs-on: ubuntu-latest
steps:
# Ref: https://github.com/orgs/community/discussions/25199#discussioncomment-3246802
- name: Get latest ComfyUI release with tag
id: latestrelease
run: |
echo "comfy_latest_release=$(curl -s https://api.github.com/repos/comfyanonymous/ComfyUI/releases/latest | jq '.tag_name' | sed 's/\"//g')" >> $GITHUB_OUTPUT

- name: Checkout ComfyUI
uses: actions/checkout@v4
with:
repository: comfyanonymous/ComfyUI
ref: ${{ steps.latestrelease.outputs.comfy_latest_release }}
path: ComfyUI

- name: Checkout BizyAir
uses: actions/checkout@v4
with:
repository: siliconflow/BizyAir
ref: master
path: ComfyUI/custom_nodes/BizyAir

- name: Checkout bizyair_frontend
uses: actions/checkout@v4
with:
repository: siliconflow/bizyair_frontend
# TODO: update after PR is merged
# TODO2: use master when it's ready
ref: dev_bbs_ci
path: ComfyUI/custom_nodes/BizyAir/bizyair_frontend

- uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: |
ComfyUI/requirements.txt
ComfyUI/custom_nodes/BizyAir/requirements.txt

- uses: actions/setup-node@v4
with:
node-version: '20.9.0'
cache: 'npm'
cache-dependency-path: |
ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests/package-lock.json
ComfyUI/custom_nodes/BizyAir/bizyair_frontend/package-lock.json

- name: Install dependencies
run: |
pip install -r ComfyUI/requirements.txt
pip install -r ComfyUI/custom_nodes/BizyAir/requirements.txt
pip install wait-for-it

- name: Install playwright
run: |
npm install
npx playwright install chromium --with-deps
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests

- name: Install bizyair_frontend dependencies
run: |
npm install
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend

- name: Copy over test workflows
run: |
mkdir -p ComfyUI/user/default
cp -r ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests/workflows ComfyUI/user/default

- name: Update bizyair_frontend.js
run: |
npx vue-tsc -b
npx vite build
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend

- name: Start ComfyUI server
run: |
python main.py --cpu &
wait-for-it --service 127.0.0.1:8188 -t 600
working-directory: ComfyUI

- name: Run Playwright tests and update snapshots
run: |
npx playwright test --update-snapshots --project chromium chromium-2x
continue-on-error: true
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests

- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests/playwright-report/
retention-days: 30

- name: Debugging info
run: |
git status
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests

# TODO: if need to support PR, refer to https://github.com/Comfy-Org/ComfyUI_frontend/blob/57701f6145f622bf17237410c165966fb4aecc75/.github/workflows/test-browser-exp.yaml
- name: Commit updated expectations
continue-on-error: true
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git fetch
git add .
git commit -m "Update test expectations [skip ci]"
git push
working-directory: ComfyUI/custom_nodes/BizyAir/bizyair_frontend/browser_tests
Loading
Loading