mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 02:32:18 +00:00
Compare commits
43 Commits
manual-i18
...
sno-fix-pl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1650b8ba56 | ||
|
|
e1105ee22e | ||
|
|
0afbf94eb7 | ||
|
|
f7889b514e | ||
|
|
a704d6e56f | ||
|
|
9a7d8cdca5 | ||
|
|
35f5773deb | ||
|
|
65b6b27831 | ||
|
|
66a76c0ee0 | ||
|
|
9f208b876c | ||
|
|
7862ae4b65 | ||
|
|
8f7ee4e9a3 | ||
|
|
b091f3aa08 | ||
|
|
f215872e2e | ||
|
|
481e3b593a | ||
|
|
b592c9015e | ||
|
|
f0afc261a4 | ||
|
|
1e6ba5c689 | ||
|
|
ddd7b4866f | ||
|
|
e731f3b833 | ||
|
|
b99e451f91 | ||
|
|
f8b8b1c6ed | ||
|
|
2358a97fe9 | ||
|
|
571043fa58 | ||
|
|
186b1888a3 | ||
|
|
68c41839ec | ||
|
|
2e72988ef8 | ||
|
|
176ff73788 | ||
|
|
843ea39954 | ||
|
|
c3c2681819 | ||
|
|
b515ef0a5b | ||
|
|
8eef1b727e | ||
|
|
23d0362267 | ||
|
|
2bf92a0e57 | ||
|
|
b5d3cfdd9a | ||
|
|
18d724c08d | ||
|
|
d0eee738b7 | ||
|
|
f3d9f4cffb | ||
|
|
d766cd6fe5 | ||
|
|
b9f232ebc6 | ||
|
|
6b1584ebce | ||
|
|
20181195e1 | ||
|
|
1bdc190154 |
@@ -128,7 +128,25 @@ echo "Last stable release: $LAST_STABLE"
|
||||
|
||||
### Step 4: Analyze Dependency Updates
|
||||
|
||||
1. **Check significant dependency updates:**
|
||||
1. **Use pnpm's built-in dependency analysis:**
|
||||
```bash
|
||||
# Get outdated dependencies with pnpm
|
||||
pnpm outdated --format table > outdated-deps-${NEW_VERSION}.txt
|
||||
|
||||
# Check for license compliance
|
||||
pnpm licenses ls --json > licenses-${NEW_VERSION}.json
|
||||
|
||||
# Analyze why specific dependencies exist
|
||||
echo "Dependency analysis:" > dep-analysis-${NEW_VERSION}.md
|
||||
MAJOR_DEPS=("vue" "vite" "@vitejs/plugin-vue" "typescript" "pinia")
|
||||
for dep in "${MAJOR_DEPS[@]}"; do
|
||||
echo -e "\n## $dep\n\`\`\`" >> dep-analysis-${NEW_VERSION}.md
|
||||
pnpm why "$dep" >> dep-analysis-${NEW_VERSION}.md || echo "Not found" >> dep-analysis-${NEW_VERSION}.md
|
||||
echo "\`\`\`" >> dep-analysis-${NEW_VERSION}.md
|
||||
done
|
||||
```
|
||||
|
||||
2. **Check for significant dependency updates:**
|
||||
```bash
|
||||
# Extract all dependency changes for major version bumps
|
||||
OTHER_DEP_CHANGES=""
|
||||
@@ -200,22 +218,48 @@ echo "Last stable release: $LAST_STABLE"
|
||||
PR data: [contents of prs-${NEW_VERSION}.json]
|
||||
```
|
||||
|
||||
3. **Generate GTM notification:**
|
||||
3. **Generate GTM notification using this EXACT Slack-compatible format:**
|
||||
```bash
|
||||
# Save to gtm-summary-${NEW_VERSION}.md based on analysis
|
||||
# If GTM-worthy features exist, include them with testing instructions
|
||||
# If not, note that this is a maintenance/bug fix release
|
||||
|
||||
# Check if notification is needed
|
||||
if grep -q "No marketing-worthy features" gtm-summary-${NEW_VERSION}.md; then
|
||||
echo "✅ No GTM notification needed for this release"
|
||||
echo "📄 Summary saved to: gtm-summary-${NEW_VERSION}.md"
|
||||
else
|
||||
# Only create file if GTM-worthy features exist:
|
||||
if [ "$GTM_FEATURES_FOUND" = "true" ]; then
|
||||
cat > gtm-summary-${NEW_VERSION}.md << 'EOF'
|
||||
*GTM Summary: ComfyUI Frontend v${NEW_VERSION}*
|
||||
|
||||
_Disclaimer: the below is AI-generated_
|
||||
|
||||
1. *[Feature Title]* (#[PR_NUMBER])
|
||||
* *Author:* @[username]
|
||||
* *Demo:* [Media Link or "No demo available"]
|
||||
* *Why users should care:* [One compelling sentence]
|
||||
* *Key Features:*
|
||||
* [Feature detail 1]
|
||||
* [Feature detail 2]
|
||||
|
||||
2. *[Feature Title]* (#[PR_NUMBER])
|
||||
* *Author:* @[username]
|
||||
* *Demo:* [Media Link]
|
||||
* *Why users should care:* [One compelling sentence]
|
||||
* *Key Features:*
|
||||
* [Feature detail 1]
|
||||
* [Feature detail 2]
|
||||
EOF
|
||||
echo "📋 GTM summary saved to: gtm-summary-${NEW_VERSION}.md"
|
||||
echo "📤 Share this file in #gtm channel to notify the team"
|
||||
else
|
||||
echo "✅ No GTM notification needed for this release"
|
||||
echo "📄 No gtm-summary file created - no marketing-worthy features"
|
||||
fi
|
||||
```
|
||||
|
||||
**CRITICAL Formatting Requirements:**
|
||||
- Use single asterisk (*) for emphasis, NOT double (**)
|
||||
- Use underscore (_) for italics
|
||||
- Use 4 spaces for indentation (not tabs)
|
||||
- Convert author names to @username format (e.g., "John Smith" → "@john")
|
||||
- No section headers (#), no code language specifications
|
||||
- Always include "Disclaimer: the below is AI-generated"
|
||||
- Keep content minimal - no testing instructions, additional sections, etc.
|
||||
|
||||
### Step 6: Version Preview
|
||||
|
||||
**Version Preview:**
|
||||
@@ -228,17 +272,22 @@ echo "Last stable release: $LAST_STABLE"
|
||||
|
||||
### Step 7: Security and Dependency Audit
|
||||
|
||||
1. Run security audit:
|
||||
1. Run pnpm security audit:
|
||||
```bash
|
||||
npm audit --audit-level moderate
|
||||
pnpm audit --audit-level moderate
|
||||
pnpm licenses ls --summary
|
||||
```
|
||||
2. Check for known vulnerabilities in dependencies
|
||||
3. Scan for hardcoded secrets or credentials:
|
||||
3. Run comprehensive dependency health check:
|
||||
```bash
|
||||
pnpm doctor
|
||||
```
|
||||
4. Scan for hardcoded secrets or credentials:
|
||||
```bash
|
||||
git log -p ${BASE_TAG}..HEAD | grep -iE "(password|key|secret|token)" || echo "No sensitive data found"
|
||||
```
|
||||
4. Verify no sensitive data in recent commits
|
||||
5. **SECURITY REVIEW**: Address any critical findings before proceeding?
|
||||
5. Verify no sensitive data in recent commits
|
||||
6. **SECURITY REVIEW**: Address any critical findings before proceeding?
|
||||
|
||||
### Step 8: Pre-Release Testing
|
||||
|
||||
|
||||
158
.claude/commands/setup_repo.md
Normal file
158
.claude/commands/setup_repo.md
Normal file
@@ -0,0 +1,158 @@
|
||||
# Setup Repository
|
||||
|
||||
Bootstrap the ComfyUI Frontend monorepo with all necessary dependencies and verification checks.
|
||||
|
||||
## Overview
|
||||
|
||||
This command will:
|
||||
1. Install pnpm package manager (if not present)
|
||||
2. Install all project dependencies
|
||||
3. Verify the project builds successfully
|
||||
4. Run unit tests to ensure functionality
|
||||
5. Start development server to verify frontend boots correctly
|
||||
|
||||
## Prerequisites Check
|
||||
|
||||
First, let's verify the environment:
|
||||
|
||||
```bash
|
||||
# Check Node.js version (should be >= 24)
|
||||
node --version
|
||||
|
||||
# Check if we're in a git repository
|
||||
git status
|
||||
```
|
||||
|
||||
## Step 1: Install pnpm
|
||||
|
||||
```bash
|
||||
# Check if pnpm is already installed
|
||||
pnpm --version 2>/dev/null || {
|
||||
echo "Installing pnpm..."
|
||||
npm install -g pnpm
|
||||
}
|
||||
|
||||
# Verify pnpm installation
|
||||
pnpm --version
|
||||
```
|
||||
|
||||
## Step 2: Install Dependencies
|
||||
|
||||
```bash
|
||||
# Install all dependencies using pnpm
|
||||
echo "Installing project dependencies..."
|
||||
pnpm install
|
||||
|
||||
# Verify node_modules exists and has packages
|
||||
ls -la node_modules | head -5
|
||||
```
|
||||
|
||||
## Step 3: Verify Build
|
||||
|
||||
```bash
|
||||
# Run TypeScript type checking
|
||||
echo "Running TypeScript checks..."
|
||||
pnpm typecheck
|
||||
|
||||
# Build the project
|
||||
echo "Building project..."
|
||||
pnpm build
|
||||
|
||||
# Verify dist folder was created
|
||||
ls -la dist/
|
||||
```
|
||||
|
||||
## Step 4: Run Unit Tests
|
||||
|
||||
```bash
|
||||
# Run unit tests
|
||||
echo "Running unit tests..."
|
||||
pnpm test:unit
|
||||
|
||||
# If tests fail, show the output and stop
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "❌ Unit tests failed. Please fix failing tests before continuing."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ Unit tests passed successfully"
|
||||
```
|
||||
|
||||
## Step 5: Verify Development Server
|
||||
|
||||
```bash
|
||||
# Start development server in background
|
||||
echo "Starting development server..."
|
||||
pnpm dev &
|
||||
SERVER_PID=$!
|
||||
|
||||
# Wait for server to start (check for port 5173 or similar)
|
||||
echo "Waiting for server to start..."
|
||||
sleep 10
|
||||
|
||||
# Check if server is running
|
||||
if curl -s http://localhost:5173 > /dev/null 2>&1; then
|
||||
echo "✅ Development server started successfully at http://localhost:5173"
|
||||
|
||||
# Kill the background server
|
||||
kill $SERVER_PID
|
||||
wait $SERVER_PID 2>/dev/null
|
||||
else
|
||||
echo "❌ Development server failed to start or is not accessible"
|
||||
kill $SERVER_PID 2>/dev/null
|
||||
wait $SERVER_PID 2>/dev/null
|
||||
exit 1
|
||||
fi
|
||||
```
|
||||
|
||||
## Step 6: Final Verification
|
||||
|
||||
```bash
|
||||
# Run linting to ensure code quality
|
||||
echo "Running linter..."
|
||||
pnpm lint
|
||||
|
||||
# Show project status
|
||||
echo ""
|
||||
echo "🎉 Repository setup complete!"
|
||||
echo ""
|
||||
echo "Available commands:"
|
||||
echo " pnpm dev - Start development server"
|
||||
echo " pnpm build - Build for production"
|
||||
echo " pnpm test:unit - Run unit tests"
|
||||
echo " pnpm test:component - Run component tests"
|
||||
echo " pnpm typecheck - Run TypeScript checks"
|
||||
echo " pnpm lint - Run ESLint"
|
||||
echo " pnpm format - Format code with Prettier"
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo "1. Run 'pnpm dev' to start developing"
|
||||
echo "2. Open http://localhost:5173 in your browser"
|
||||
echo "3. Check README.md for additional setup instructions"
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If any step fails:
|
||||
|
||||
1. **pnpm installation fails**: Try using `curl -fsSL https://get.pnpm.io/install.sh | sh -`
|
||||
2. **Dependencies fail to install**: Try clearing cache with `pnpm store prune` and retry
|
||||
3. **Build fails**: Check for TypeScript errors and fix them first
|
||||
4. **Tests fail**: Review test output and fix failing tests
|
||||
5. **Dev server fails**: Check if port 5173 is already in use
|
||||
|
||||
## Manual Verification Steps
|
||||
|
||||
After running the setup, manually verify:
|
||||
|
||||
1. **Dependencies installed**: `ls node_modules | wc -l` should show many packages
|
||||
2. **Build artifacts**: `ls dist/` should show built files
|
||||
3. **Server accessible**: Open http://localhost:5173 in browser
|
||||
4. **Hot reload works**: Edit a file and see changes reflect
|
||||
|
||||
## Environment Requirements
|
||||
|
||||
- Node.js >= 24
|
||||
- Git repository
|
||||
- Internet connection for package downloads
|
||||
- Available ports (typically 5173 for dev server)
|
||||
60
.github/workflows/chromatic.yaml
vendored
60
.github/workflows/chromatic.yaml
vendored
@@ -12,9 +12,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
# Only run for PRs from version-bump-* branches or manual triggers
|
||||
if: github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'version-bump-')
|
||||
permissions:
|
||||
pull-requests: write
|
||||
issues: write
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
@@ -32,29 +29,6 @@ jobs:
|
||||
node-version: '20'
|
||||
cache: 'pnpm'
|
||||
|
||||
- name: Get current time
|
||||
id: current-time
|
||||
run: echo "time=$(date -u '+%m/%d/%Y, %I:%M:%S %p')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Comment PR - Build Started
|
||||
if: github.event_name == 'pull_request'
|
||||
continue-on-error: true
|
||||
uses: edumserrano/find-create-or-update-comment@v3
|
||||
with:
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body-includes: '<!-- STORYBOOK_BUILD_STATUS -->'
|
||||
comment-author: 'github-actions[bot]'
|
||||
edit-mode: append
|
||||
body: |
|
||||
<!-- STORYBOOK_BUILD_STATUS -->
|
||||
## 🎨 Storybook Build Status
|
||||
|
||||
🔄 **Building Storybook and running visual tests...**
|
||||
|
||||
⏳ Build started at: ${{ steps.current-time.outputs.time }} UTC
|
||||
|
||||
---
|
||||
*This comment will be updated when the build completes*
|
||||
|
||||
- name: Cache tool outputs
|
||||
uses: actions/cache@v4
|
||||
@@ -81,37 +55,3 @@ jobs:
|
||||
autoAcceptChanges: 'main' # Auto-accept changes on main branch
|
||||
exitOnceUploaded: true # Don't wait for UI tests to complete
|
||||
|
||||
- name: Get completion time
|
||||
id: completion-time
|
||||
if: always()
|
||||
run: echo "time=$(date -u '+%m/%d/%Y, %I:%M:%S %p')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Comment PR - Build Complete
|
||||
if: github.event_name == 'pull_request' && always()
|
||||
continue-on-error: true
|
||||
uses: edumserrano/find-create-or-update-comment@v3
|
||||
with:
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body-includes: '<!-- STORYBOOK_BUILD_STATUS -->'
|
||||
comment-author: 'github-actions[bot]'
|
||||
edit-mode: replace
|
||||
body: |
|
||||
<!-- STORYBOOK_BUILD_STATUS -->
|
||||
## 🎨 Storybook Build Status
|
||||
|
||||
${{ steps.chromatic.outcome == 'success' && '✅' || '❌' }} **${{ steps.chromatic.outcome == 'success' && 'Build completed successfully!' || 'Build failed!' }}**
|
||||
|
||||
⏰ Completed at: ${{ steps.completion-time.outputs.time }} UTC
|
||||
|
||||
### 📊 Build Summary
|
||||
- **Components**: ${{ steps.chromatic.outputs.componentCount || '0' }}
|
||||
- **Stories**: ${{ steps.chromatic.outputs.testCount || '0' }}
|
||||
- **Visual changes**: ${{ steps.chromatic.outputs.changeCount || '0' }}
|
||||
- **Errors**: ${{ steps.chromatic.outputs.errorCount || '0' }}
|
||||
|
||||
### 🔗 Links
|
||||
${{ steps.chromatic.outputs.buildUrl && format('- [📸 View Chromatic Build]({0})', steps.chromatic.outputs.buildUrl) || '' }}
|
||||
${{ steps.chromatic.outputs.storybookUrl && format('- [📖 Preview Storybook]({0})', steps.chromatic.outputs.storybookUrl) || '' }}
|
||||
|
||||
---
|
||||
${{ steps.chromatic.outcome == 'success' && '🎉 Your Storybook is ready for review!' || '⚠️ Please check the workflow logs for error details.' }}
|
||||
|
||||
92
.github/workflows/i18n.yaml
vendored
92
.github/workflows/i18n.yaml
vendored
@@ -1,59 +1,59 @@
|
||||
name: Update Locales
|
||||
|
||||
on:
|
||||
# Manual dispatch for urgent translation updates
|
||||
# Manual dispatch for urgent translation updates
|
||||
workflow_dispatch:
|
||||
# Only trigger on PRs to main/master - additional branch filtering in job condition
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
branches: [main]
|
||||
types: [opened, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
update-locales:
|
||||
# Branch detection: Only run for manual dispatch or version-bump-* branches from main repo
|
||||
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-')) || startsWith(github.head_ref, 'sno-fix-playwright')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: Comfy-Org/ComfyUI_frontend_setup_action@v3
|
||||
|
||||
- name: Cache tool outputs
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
ComfyUI_frontend/.cache
|
||||
ComfyUI_frontend/.cache
|
||||
key: i18n-tools-cache-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
i18n-tools-cache-${{ runner.os }}-
|
||||
- name: Install Playwright Browsers
|
||||
run: npx playwright install chromium --with-deps
|
||||
working-directory: ComfyUI_frontend
|
||||
- name: Start 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.
|
||||
run: pnpm dev:electron &
|
||||
working-directory: ComfyUI_frontend
|
||||
- name: Update en.json
|
||||
run: pnpm collect-i18n -- scripts/collect-i18n-general.ts
|
||||
env:
|
||||
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
||||
working-directory: ComfyUI_frontend
|
||||
- name: Update translations
|
||||
run: pnpm locale
|
||||
env:
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
working-directory: ComfyUI_frontend
|
||||
- name: Commit updated locales
|
||||
run: |
|
||||
git config --global user.name 'github-actions'
|
||||
git config --global user.email 'github-actions@github.com'
|
||||
git fetch origin ${{ github.head_ref }}
|
||||
# Stash any local changes before checkout
|
||||
git stash -u
|
||||
git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
|
||||
# Apply the stashed changes if any
|
||||
git stash pop || true
|
||||
git add src/locales/
|
||||
git diff --staged --quiet || git commit -m "Update locales [skip ci]"
|
||||
git push origin HEAD:${{ github.head_ref }}
|
||||
working-directory: ComfyUI_frontend
|
||||
- uses: Comfy-Org/ComfyUI_frontend_setup_action@v3
|
||||
|
||||
- name: Cache tool outputs
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
ComfyUI_frontend/.cache
|
||||
ComfyUI_frontend/.cache
|
||||
key: i18n-tools-cache-${{ runner.os }}-${{ hashFiles('ComfyUI_frontend/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
i18n-tools-cache-${{ runner.os }}-
|
||||
- name: Install Playwright Browsers
|
||||
run: npx playwright install chromium --with-deps
|
||||
working-directory: ComfyUI_frontend
|
||||
- name: Start 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.
|
||||
run: pnpm dev:electron &
|
||||
working-directory: ComfyUI_frontend
|
||||
- name: Update en.json
|
||||
run: pnpm collect-i18n
|
||||
env:
|
||||
PLAYWRIGHT_TEST_URL: http://localhost:5173
|
||||
working-directory: ComfyUI_frontend
|
||||
- name: Update translations
|
||||
run: pnpm locale
|
||||
env:
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
working-directory: ComfyUI_frontend
|
||||
- name: Commit updated locales
|
||||
run: |
|
||||
git config --global user.name 'github-actions'
|
||||
git config --global user.email 'github-actions@github.com'
|
||||
git fetch origin ${{ github.head_ref }}
|
||||
# Stash any local changes before checkout
|
||||
git stash -u
|
||||
git checkout -B ${{ github.head_ref }} origin/${{ github.head_ref }}
|
||||
# Apply the stashed changes if any
|
||||
git stash pop || true
|
||||
git add src/locales/
|
||||
git diff --staged --quiet || git commit -m "Update locales [skip ci]"
|
||||
git push origin HEAD:${{ github.head_ref }}
|
||||
working-directory: ComfyUI_frontend
|
||||
|
||||
163
.github/workflows/pr-playwright-comment.yaml
vendored
Normal file
163
.github/workflows/pr-playwright-comment.yaml
vendored
Normal file
@@ -0,0 +1,163 @@
|
||||
name: PR Playwright Comment
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ['Tests CI']
|
||||
types: [requested, completed]
|
||||
|
||||
env:
|
||||
DATE_FORMAT: '+%m/%d/%Y, %I:%M:%S %p'
|
||||
|
||||
jobs:
|
||||
comment-summary:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'Comfy-Org/ComfyUI_frontend' && github.event.workflow_run.event == 'pull_request'
|
||||
permissions:
|
||||
pull-requests: write
|
||||
actions: read
|
||||
steps:
|
||||
- name: Get PR number
|
||||
id: pr
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const { data: pullRequests } = await github.rest.pulls.list({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'open',
|
||||
head: `${context.repo.owner}:${context.payload.workflow_run.head_branch}`,
|
||||
});
|
||||
|
||||
if (pullRequests.length === 0) {
|
||||
console.log('No open PR found for this branch');
|
||||
return null;
|
||||
}
|
||||
|
||||
return pullRequests[0].number;
|
||||
|
||||
- name: Log when no PR found
|
||||
if: steps.pr.outputs.result == 'null'
|
||||
run: |
|
||||
echo "⚠️ No open PR found for branch: ${{ github.event.workflow_run.head_branch }}"
|
||||
echo "Workflow run ID: ${{ github.event.workflow_run.id }}"
|
||||
echo "Repository: ${{ github.event.workflow_run.repository.full_name }}"
|
||||
echo "Event: ${{ github.event.workflow_run.event }}"
|
||||
|
||||
- name: Generate comment body for start
|
||||
if: steps.pr.outputs.result != 'null' && github.event.action == 'requested'
|
||||
id: comment-body-start
|
||||
run: |
|
||||
echo "<!-- PLAYWRIGHT_TEST_STATUS -->" > comment.md
|
||||
echo "## 🎭 Playwright Test Results" >> comment.md
|
||||
echo "" >> comment.md
|
||||
echo "<img alt='comfy-loading-gif' src='https://github.com/user-attachments/assets/755c86ee-e445-4ea8-bc2c-cca85df48686' width='14px' height='14px' style='vertical-align: middle; margin-right: 4px;' /> **Tests are starting...** " >> comment.md
|
||||
echo "" >> comment.md
|
||||
echo "⏰ Started at: ${{ steps.completion-time.outputs.time }} UTC" >> comment.md
|
||||
echo "" >> comment.md
|
||||
echo "### 🚀 Running Tests" >> comment.md
|
||||
echo "- 🧪 **chromium**: Running tests..." >> comment.md
|
||||
echo "- 🧪 **chromium-0.5x**: Running tests..." >> comment.md
|
||||
echo "- 🧪 **chromium-2x**: Running tests..." >> comment.md
|
||||
echo "- 🧪 **mobile-chrome**: Running tests..." >> comment.md
|
||||
echo "" >> comment.md
|
||||
echo "---" >> comment.md
|
||||
echo "⏱️ Please wait while tests are running across all browsers..." >> comment.md
|
||||
|
||||
- name: Download all deployment info
|
||||
if: steps.pr.outputs.result != 'null' && github.event.action == 'completed'
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
run-id: ${{ github.event.workflow_run.id }}
|
||||
pattern: deployment-info-*
|
||||
merge-multiple: true
|
||||
path: deployment-info
|
||||
|
||||
- name: Get completion time
|
||||
id: completion-time
|
||||
run: echo "time=$(date -u '${{ env.DATE_FORMAT }}')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Generate comment body for completion
|
||||
if: steps.pr.outputs.result != 'null' && github.event.action == 'completed'
|
||||
id: comment-body-completed
|
||||
run: |
|
||||
echo "<!-- PLAYWRIGHT_TEST_STATUS -->" > comment.md
|
||||
echo "## 🎭 Playwright Test Results" >> comment.md
|
||||
echo "" >> comment.md
|
||||
|
||||
# Check if all tests passed
|
||||
ALL_PASSED=true
|
||||
for file in deployment-info/*.txt; do
|
||||
if [ -f "$file" ]; then
|
||||
browser=$(basename "$file" .txt)
|
||||
info=$(cat "$file")
|
||||
exit_code=$(echo "$info" | cut -d'|' -f2)
|
||||
if [ "$exit_code" != "0" ]; then
|
||||
ALL_PASSED=false
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$ALL_PASSED" = "true" ]; then
|
||||
echo "✅ **All tests passed across all browsers!**" >> comment.md
|
||||
else
|
||||
echo "❌ **Some tests failed!**" >> comment.md
|
||||
fi
|
||||
|
||||
echo "" >> comment.md
|
||||
echo "⏰ Completed at: ${{ steps.completion-time.outputs.time }} UTC" >> comment.md
|
||||
echo "" >> comment.md
|
||||
echo "### 📊 Test Reports by Browser" >> comment.md
|
||||
|
||||
for file in deployment-info/*.txt; do
|
||||
if [ -f "$file" ]; then
|
||||
browser=$(basename "$file" .txt)
|
||||
info=$(cat "$file")
|
||||
exit_code=$(echo "$info" | cut -d'|' -f2)
|
||||
url=$(echo "$info" | cut -d'|' -f3)
|
||||
|
||||
# Validate URLs before using them in comments
|
||||
sanitized_url=$(echo "$url" | grep -E '^https://[a-z0-9.-]+\.pages\.dev(/.*)?$' || echo "INVALID_URL")
|
||||
if [ "$sanitized_url" = "INVALID_URL" ]; then
|
||||
echo "Invalid deployment URL detected: $url"
|
||||
url="#" # Use safe fallback
|
||||
fi
|
||||
|
||||
if [ "$exit_code" = "0" ]; then
|
||||
status="✅"
|
||||
else
|
||||
status="❌"
|
||||
fi
|
||||
|
||||
echo "- $status **$browser**: [View Report]($url)" >> comment.md
|
||||
fi
|
||||
done
|
||||
|
||||
echo "" >> comment.md
|
||||
echo "---" >> comment.md
|
||||
if [ "$ALL_PASSED" = "true" ]; then
|
||||
echo "🎉 Your tests are passing across all browsers!" >> comment.md
|
||||
else
|
||||
echo "⚠️ Please check the test reports for details on failures." >> comment.md
|
||||
fi
|
||||
|
||||
- name: Comment PR - Tests Started
|
||||
if: steps.pr.outputs.result != 'null' && github.event.action == 'requested'
|
||||
uses: edumserrano/find-create-or-update-comment@82880b65c8a3a6e4c70aa05a204995b6c9696f53 # v3.0.0
|
||||
with:
|
||||
issue-number: ${{ steps.pr.outputs.result }}
|
||||
body-includes: '<!-- PLAYWRIGHT_TEST_STATUS -->'
|
||||
comment-author: 'github-actions[bot]'
|
||||
edit-mode: replace
|
||||
body-path: comment.md
|
||||
|
||||
- name: Comment PR - Tests Complete
|
||||
if: steps.pr.outputs.result != 'null' && github.event.action == 'completed'
|
||||
uses: edumserrano/find-create-or-update-comment@82880b65c8a3a6e4c70aa05a204995b6c9696f53 # v3.0.0
|
||||
with:
|
||||
issue-number: ${{ steps.pr.outputs.result }}
|
||||
body-includes: '<!-- PLAYWRIGHT_TEST_STATUS -->'
|
||||
comment-author: 'github-actions[bot]'
|
||||
edit-mode: replace
|
||||
body-path: comment.md
|
||||
101
.github/workflows/pr-playwright-deploy.yaml
vendored
Normal file
101
.github/workflows/pr-playwright-deploy.yaml
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
name: PR Playwright Deploy
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Tests CI"]
|
||||
types: [completed]
|
||||
|
||||
jobs:
|
||||
deploy-reports:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'Comfy-Org/ComfyUI_frontend' && github.event.workflow_run.event == 'pull_request'
|
||||
permissions:
|
||||
actions: read
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
browser: [chromium, chromium-2x, chromium-0.5x, mobile-chrome]
|
||||
steps:
|
||||
- name: Get PR info
|
||||
id: pr-info
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const { data: pullRequests } = await github.rest.pulls.list({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'open',
|
||||
head: `${context.repo.owner}:${context.payload.workflow_run.head_branch}`,
|
||||
});
|
||||
|
||||
if (pullRequests.length === 0) {
|
||||
console.log('No open PR found for this branch');
|
||||
return { number: null, sanitized_branch: null };
|
||||
}
|
||||
|
||||
const pr = pullRequests[0];
|
||||
const branchName = context.payload.workflow_run.head_branch;
|
||||
const sanitizedBranch = branchName.toLowerCase().replace(/[^a-z0-9-]/g, '-').replace(/--+/g, '-').replace(/^-|-$/g, '');
|
||||
|
||||
return {
|
||||
number: pr.number,
|
||||
sanitized_branch: sanitizedBranch
|
||||
};
|
||||
|
||||
- name: Set project name
|
||||
if: fromJSON(steps.pr-info.outputs.result).number != null
|
||||
id: project-name
|
||||
run: |
|
||||
if [ "${{ matrix.browser }}" = "chromium-0.5x" ]; then
|
||||
echo "name=comfyui-playwright-chromium-0-5x" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "name=comfyui-playwright-${{ matrix.browser }}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
echo "branch=${{ fromJSON(steps.pr-info.outputs.result).sanitized_branch }}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Download playwright report
|
||||
if: fromJSON(steps.pr-info.outputs.result).number != null
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
run-id: ${{ github.event.workflow_run.id }}
|
||||
name: playwright-report-${{ matrix.browser }}
|
||||
path: playwright-report
|
||||
|
||||
- name: Install Wrangler
|
||||
if: fromJSON(steps.pr-info.outputs.result).number != null
|
||||
run: npm install -g wrangler
|
||||
|
||||
- name: Deploy to Cloudflare Pages (${{ matrix.browser }})
|
||||
if: fromJSON(steps.pr-info.outputs.result).number != null
|
||||
id: cloudflare-deploy
|
||||
continue-on-error: true
|
||||
run: |
|
||||
# Retry logic for wrangler deploy (3 attempts)
|
||||
RETRY_COUNT=0
|
||||
MAX_RETRIES=3
|
||||
SUCCESS=false
|
||||
|
||||
while [ $RETRY_COUNT -lt $MAX_RETRIES ] && [ $SUCCESS = false ]; do
|
||||
RETRY_COUNT=$((RETRY_COUNT + 1))
|
||||
echo "Deployment attempt $RETRY_COUNT of $MAX_RETRIES..."
|
||||
|
||||
if npx wrangler pages deploy playwright-report --project-name=${{ steps.project-name.outputs.name }} --branch=${{ steps.project-name.outputs.branch }}; then
|
||||
SUCCESS=true
|
||||
echo "Deployment successful on attempt $RETRY_COUNT"
|
||||
else
|
||||
echo "Deployment failed on attempt $RETRY_COUNT"
|
||||
if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
|
||||
echo "Retrying in 10 seconds..."
|
||||
sleep 10
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $SUCCESS = false ]; then
|
||||
echo "All deployment attempts failed"
|
||||
exit 1
|
||||
fi
|
||||
env:
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
108
.github/workflows/pr-storybook-comment.yaml
vendored
Normal file
108
.github/workflows/pr-storybook-comment.yaml
vendored
Normal file
@@ -0,0 +1,108 @@
|
||||
name: PR Storybook Comment
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ['Chromatic']
|
||||
types: [requested, completed]
|
||||
|
||||
jobs:
|
||||
comment-storybook:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'Comfy-Org/ComfyUI_frontend' && github.event.workflow_run.event == 'pull_request'
|
||||
permissions:
|
||||
pull-requests: write
|
||||
actions: read
|
||||
steps:
|
||||
- name: Get PR number
|
||||
id: pr
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const { data: pullRequests } = await github.rest.pulls.list({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'open',
|
||||
head: `${context.repo.owner}:${context.payload.workflow_run.head_branch}`,
|
||||
});
|
||||
|
||||
if (pullRequests.length === 0) {
|
||||
console.log('No open PR found for this branch');
|
||||
return null;
|
||||
}
|
||||
|
||||
return pullRequests[0].number;
|
||||
|
||||
- name: Log when no PR found
|
||||
if: steps.pr.outputs.result == 'null'
|
||||
run: |
|
||||
echo "⚠️ No open PR found for branch: ${{ github.event.workflow_run.head_branch }}"
|
||||
echo "Workflow run ID: ${{ github.event.workflow_run.id }}"
|
||||
echo "Repository: ${{ github.event.workflow_run.repository.full_name }}"
|
||||
echo "Event: ${{ github.event.workflow_run.event }}"
|
||||
|
||||
- name: Get workflow run details
|
||||
if: steps.pr.outputs.result != 'null' && github.event.action == 'completed'
|
||||
id: workflow-run
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const run = await github.rest.actions.getWorkflowRun({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
run_id: context.payload.workflow_run.id,
|
||||
});
|
||||
|
||||
return {
|
||||
conclusion: run.data.conclusion,
|
||||
html_url: run.data.html_url
|
||||
};
|
||||
|
||||
- name: Get completion time
|
||||
id: completion-time
|
||||
run: echo "time=$(date -u '+%m/%d/%Y, %I:%M:%S %p')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Comment PR - Storybook Started
|
||||
if: steps.pr.outputs.result != 'null' && github.event.action == 'requested'
|
||||
uses: edumserrano/find-create-or-update-comment@82880b65c8a3a6e4c70aa05a204995b6c9696f53 # v3.0.0
|
||||
with:
|
||||
issue-number: ${{ steps.pr.outputs.result }}
|
||||
body-includes: '<!-- STORYBOOK_BUILD_STATUS -->'
|
||||
comment-author: 'github-actions[bot]'
|
||||
edit-mode: replace
|
||||
body: |
|
||||
<!-- STORYBOOK_BUILD_STATUS -->
|
||||
## 🎨 Storybook Build Status
|
||||
|
||||
<img alt='comfy-loading-gif' src='https://github.com/user-attachments/assets/755c86ee-e445-4ea8-bc2c-cca85df48686' width='14px' height='14px' style='vertical-align: middle; margin-right: 4px;' /> **Build is starting...**
|
||||
|
||||
⏰ Started at: ${{ steps.completion-time.outputs.time }} UTC
|
||||
|
||||
### 🚀 Building Storybook
|
||||
- 📦 Installing dependencies...
|
||||
- 🔧 Building Storybook components...
|
||||
- 🎨 Running Chromatic visual tests...
|
||||
|
||||
---
|
||||
⏱️ Please wait while the Storybook build is in progress...
|
||||
|
||||
- name: Comment PR - Storybook Complete
|
||||
if: steps.pr.outputs.result != 'null' && github.event.action == 'completed'
|
||||
uses: edumserrano/find-create-or-update-comment@82880b65c8a3a6e4c70aa05a204995b6c9696f53 # v3.0.0
|
||||
with:
|
||||
issue-number: ${{ steps.pr.outputs.result }}
|
||||
body-includes: '<!-- STORYBOOK_BUILD_STATUS -->'
|
||||
comment-author: 'github-actions[bot]'
|
||||
edit-mode: replace
|
||||
body: |
|
||||
<!-- STORYBOOK_BUILD_STATUS -->
|
||||
## 🎨 Storybook Build Status
|
||||
|
||||
${{ fromJSON(steps.workflow-run.outputs.result).conclusion == 'success' && '✅' || '❌' }} **${{ fromJSON(steps.workflow-run.outputs.result).conclusion == 'success' && 'Build completed successfully!' || 'Build failed!' }}**
|
||||
|
||||
⏰ Completed at: ${{ steps.completion-time.outputs.time }} UTC
|
||||
|
||||
### 🔗 Links
|
||||
- [📊 View Workflow Run](${{ fromJSON(steps.workflow-run.outputs.result).html_url }})
|
||||
|
||||
---
|
||||
${{ fromJSON(steps.workflow-run.outputs.result).conclusion == 'success' && '🎉 Your Storybook is ready for review!' || '⚠️ Please check the workflow logs for error details.' }}
|
||||
246
.github/workflows/test-ui.yaml
vendored
246
.github/workflows/test-ui.yaml
vendored
@@ -2,20 +2,16 @@ name: Tests CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main, master, core/*, desktop/*]
|
||||
branches: [main, master, core/*, desktop/*, sno-fix-playwright-nx]
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
[wip/*, draft/*, temp/*, vue-nodes-migration, sno-playwright-*]
|
||||
|
||||
env:
|
||||
DATE_FORMAT: '+%m/%d/%Y, %I:%M:%S %p'
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
cache-key: ${{ steps.cache-key.outputs.key }}
|
||||
sanitized-branch: ${{ steps.branch-info.outputs.sanitized }}
|
||||
steps:
|
||||
- name: Checkout ComfyUI
|
||||
uses: actions/checkout@v4
|
||||
@@ -48,29 +44,6 @@ jobs:
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: 'ComfyUI_frontend/pnpm-lock.yaml'
|
||||
|
||||
- name: Get current time
|
||||
id: current-time
|
||||
run: echo "time=$(date -u '${{ env.DATE_FORMAT }}')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Comment PR - Tests Started
|
||||
if: github.event_name == 'pull_request'
|
||||
continue-on-error: true
|
||||
uses: edumserrano/find-create-or-update-comment@v3
|
||||
with:
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body-includes: '<!-- PLAYWRIGHT_TEST_STATUS -->'
|
||||
comment-author: 'github-actions[bot]'
|
||||
edit-mode: append
|
||||
body: |
|
||||
<!-- PLAYWRIGHT_TEST_STATUS -->
|
||||
|
||||
---
|
||||
|
||||
<img alt='claude-loading-gif' src="https://github.com/user-attachments/assets/5ac382c7-e004-429b-8e35-7feb3e8f9c6f" width="14px" height="14px" style="vertical-align: middle; margin-left: 4px;" />
|
||||
<bold>[${{ steps.current-time.outputs.time }} UTC] Preparing browser tests across multiple browsers...</bold>
|
||||
|
||||
---
|
||||
*This comment will be updated when tests complete*
|
||||
|
||||
- name: Cache tool outputs
|
||||
uses: actions/cache@v4
|
||||
@@ -94,14 +67,6 @@ jobs:
|
||||
id: cache-key
|
||||
run: echo "key=$(date +%s)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Generate sanitized branch name
|
||||
id: branch-info
|
||||
run: |
|
||||
# Get branch name and sanitize it for Cloudflare branch names
|
||||
BRANCH_NAME="${{ github.head_ref || github.ref_name }}"
|
||||
SANITIZED_BRANCH=$(echo "$BRANCH_NAME" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9-]/-/g' | sed 's/--*/-/g' | sed 's/^-\|-$//g')
|
||||
echo "sanitized=${SANITIZED_BRANCH}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Save cache
|
||||
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684
|
||||
with:
|
||||
@@ -114,8 +79,6 @@ jobs:
|
||||
needs: setup
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
issues: write
|
||||
contents: read
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@@ -144,32 +107,6 @@ jobs:
|
||||
python-version: '3.10'
|
||||
cache: 'pip'
|
||||
|
||||
- name: Get current time
|
||||
id: current-time
|
||||
run: echo "time=$(date -u '${{ env.DATE_FORMAT }}')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Set project name
|
||||
id: project-name
|
||||
run: |
|
||||
if [ "${{ matrix.browser }}" = "chromium-0.5x" ]; then
|
||||
echo "name=comfyui-playwright-chromium-0-5x" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "name=comfyui-playwright-${{ matrix.browser }}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
echo "branch=${{ needs.setup.outputs.sanitized-branch }}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Comment PR - Browser Test Started
|
||||
if: github.event_name == 'pull_request'
|
||||
continue-on-error: true
|
||||
uses: edumserrano/find-create-or-update-comment@v3
|
||||
with:
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body-includes: '<!-- PLAYWRIGHT_TEST_STATUS -->'
|
||||
comment-author: 'github-actions[bot]'
|
||||
edit-mode: append
|
||||
body: |
|
||||
<img alt='claude-loading-gif' src="https://github.com/user-attachments/assets/5ac382c7-e004-429b-8e35-7feb3e8f9c6f" width="14px" height="14px" style="vertical-align: middle; margin-left: 4px;" />
|
||||
<bold>${{ matrix.browser }}</bold>: Running tests...
|
||||
|
||||
- name: Install requirements
|
||||
run: |
|
||||
@@ -198,9 +135,6 @@ jobs:
|
||||
run: npx playwright install chromium --with-deps
|
||||
working-directory: ComfyUI_frontend
|
||||
|
||||
- name: Install Wrangler
|
||||
run: pnpm install -g wrangler
|
||||
|
||||
- name: Run Playwright tests (${{ matrix.browser }})
|
||||
id: playwright
|
||||
run: npx playwright test --project=${{ matrix.browser }} --reporter=html
|
||||
@@ -213,181 +147,3 @@ jobs:
|
||||
path: ComfyUI_frontend/playwright-report/
|
||||
retention-days: 30
|
||||
|
||||
- name: Deploy to Cloudflare Pages (${{ matrix.browser }})
|
||||
id: cloudflare-deploy
|
||||
if: always()
|
||||
continue-on-error: true
|
||||
run: |
|
||||
# Retry logic for wrangler deploy (3 attempts)
|
||||
RETRY_COUNT=0
|
||||
MAX_RETRIES=3
|
||||
SUCCESS=false
|
||||
|
||||
while [ $RETRY_COUNT -lt $MAX_RETRIES ] && [ $SUCCESS = false ]; do
|
||||
RETRY_COUNT=$((RETRY_COUNT + 1))
|
||||
echo "Deployment attempt $RETRY_COUNT of $MAX_RETRIES..."
|
||||
|
||||
if npx wrangler pages deploy ComfyUI_frontend/playwright-report --project-name=${{ steps.project-name.outputs.name }} --branch=${{ steps.project-name.outputs.branch }}; then
|
||||
SUCCESS=true
|
||||
echo "Deployment successful on attempt $RETRY_COUNT"
|
||||
else
|
||||
echo "Deployment failed on attempt $RETRY_COUNT"
|
||||
if [ $RETRY_COUNT -lt $MAX_RETRIES ]; then
|
||||
echo "Retrying in 10 seconds..."
|
||||
sleep 10
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $SUCCESS = false ]; then
|
||||
echo "All deployment attempts failed"
|
||||
exit 1
|
||||
fi
|
||||
env:
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
|
||||
- name: Save deployment info for summary
|
||||
if: always()
|
||||
run: |
|
||||
mkdir -p deployment-info
|
||||
# Use step conclusion to determine test result
|
||||
if [ "${{ steps.playwright.conclusion }}" = "success" ]; then
|
||||
EXIT_CODE="0"
|
||||
else
|
||||
EXIT_CODE="1"
|
||||
fi
|
||||
DEPLOYMENT_URL="${{ steps.cloudflare-deploy.outputs.deployment-url || steps.cloudflare-deploy.outputs.url || format('https://{0}.{1}.pages.dev', steps.project-name.outputs.branch, steps.project-name.outputs.name) }}"
|
||||
echo "${{ matrix.browser }}|${EXIT_CODE}|${DEPLOYMENT_URL}" > deployment-info/${{ matrix.browser }}.txt
|
||||
|
||||
- name: Upload deployment info
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: deployment-info-${{ matrix.browser }}
|
||||
path: deployment-info/
|
||||
retention-days: 1
|
||||
|
||||
- name: Get completion time
|
||||
id: completion-time
|
||||
if: always()
|
||||
run: echo "time=$(date -u '${{ env.DATE_FORMAT }}')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Comment PR - Browser Test Complete
|
||||
if: always() && github.event_name == 'pull_request'
|
||||
continue-on-error: true
|
||||
uses: edumserrano/find-create-or-update-comment@v3
|
||||
with:
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body-includes: '<!-- PLAYWRIGHT_TEST_STATUS -->'
|
||||
comment-author: 'github-actions[bot]'
|
||||
edit-mode: append
|
||||
body: |
|
||||
${{ steps.playwright.conclusion == 'success' && '✅' || '❌' }} **${{ matrix.browser }}**: ${{ steps.playwright.conclusion == 'success' && 'Tests passed!' || 'Tests failed!' }} [View Report](${{ steps.cloudflare-deploy.outputs.deployment-url || format('https://{0}.{1}.pages.dev', steps.project-name.outputs.branch, steps.project-name.outputs.name) }})
|
||||
|
||||
comment-summary:
|
||||
needs: playwright-tests
|
||||
runs-on: ubuntu-latest
|
||||
if: always() && github.event_name == 'pull_request'
|
||||
permissions:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Download all deployment info
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: deployment-info-*
|
||||
merge-multiple: true
|
||||
path: deployment-info
|
||||
|
||||
- name: Get completion time
|
||||
id: completion-time
|
||||
run: echo "time=$(date -u '${{ env.DATE_FORMAT }}')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Generate comment body
|
||||
id: comment-body
|
||||
run: |
|
||||
echo "<!-- PLAYWRIGHT_TEST_STATUS -->" > comment.md
|
||||
echo "## 🎭 Playwright Test Results" >> comment.md
|
||||
echo "" >> comment.md
|
||||
|
||||
# Check if all tests passed
|
||||
ALL_PASSED=true
|
||||
for file in deployment-info/*.txt; do
|
||||
if [ -f "$file" ]; then
|
||||
browser=$(basename "$file" .txt)
|
||||
info=$(cat "$file")
|
||||
exit_code=$(echo "$info" | cut -d'|' -f2)
|
||||
if [ "$exit_code" != "0" ]; then
|
||||
ALL_PASSED=false
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$ALL_PASSED" = "true" ]; then
|
||||
echo "✅ **All tests passed across all browsers!**" >> comment.md
|
||||
else
|
||||
echo "❌ **Some tests failed!**" >> comment.md
|
||||
fi
|
||||
|
||||
echo "" >> comment.md
|
||||
echo "⏰ Completed at: ${{ steps.completion-time.outputs.time }} UTC" >> comment.md
|
||||
echo "" >> comment.md
|
||||
echo "### 📊 Test Reports by Browser" >> comment.md
|
||||
|
||||
for file in deployment-info/*.txt; do
|
||||
if [ -f "$file" ]; then
|
||||
browser=$(basename "$file" .txt)
|
||||
info=$(cat "$file")
|
||||
exit_code=$(echo "$info" | cut -d'|' -f2)
|
||||
url=$(echo "$info" | cut -d'|' -f3)
|
||||
|
||||
if [ "$exit_code" = "0" ]; then
|
||||
status="✅"
|
||||
else
|
||||
status="❌"
|
||||
fi
|
||||
|
||||
echo "- $status **$browser**: [View Report]($url)" >> comment.md
|
||||
fi
|
||||
done
|
||||
|
||||
echo "" >> comment.md
|
||||
echo "---" >> comment.md
|
||||
if [ "$ALL_PASSED" = "true" ]; then
|
||||
echo "🎉 Your tests are passing across all browsers!" >> comment.md
|
||||
else
|
||||
echo "⚠️ Please check the test reports for details on failures." >> comment.md
|
||||
fi
|
||||
|
||||
- name: Comment PR - Tests Complete
|
||||
continue-on-error: true
|
||||
uses: edumserrano/find-create-or-update-comment@v3
|
||||
with:
|
||||
issue-number: ${{ github.event.pull_request.number }}
|
||||
body-includes: '<!-- PLAYWRIGHT_TEST_STATUS -->'
|
||||
comment-author: 'github-actions[bot]'
|
||||
edit-mode: replace
|
||||
body-path: comment.md
|
||||
|
||||
- name: Check test results and fail if needed
|
||||
run: |
|
||||
# Check if all tests passed and fail the job if not
|
||||
ALL_PASSED=true
|
||||
for file in deployment-info/*.txt; do
|
||||
if [ -f "$file" ]; then
|
||||
info=$(cat "$file")
|
||||
exit_code=$(echo "$info" | cut -d'|' -f2)
|
||||
if [ "$exit_code" != "0" ]; then
|
||||
ALL_PASSED=false
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$ALL_PASSED" = "false" ]; then
|
||||
echo "❌ Tests failed in one or more browsers. Failing the CI job."
|
||||
exit 1
|
||||
else
|
||||
echo "✅ All tests passed across all browsers!"
|
||||
fi
|
||||
|
||||
10
.gitignore
vendored
10
.gitignore
vendored
@@ -22,6 +22,7 @@ dist-ssr
|
||||
*.local
|
||||
# Claude configuration
|
||||
.claude/*.local.json
|
||||
CLAUDE.local.md
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
@@ -76,3 +77,12 @@ vite.config.mts.timestamp-*.mjs
|
||||
*storybook.log
|
||||
storybook-static
|
||||
|
||||
|
||||
|
||||
|
||||
.nx/cache
|
||||
.nx/workspace-data
|
||||
.cursor/rules/nx-rules.mdc
|
||||
.github/instructions/nx.instructions.md
|
||||
vite.config.*.timestamp*
|
||||
vitest.config.*.timestamp*
|
||||
|
||||
42
CLAUDE.md
42
CLAUDE.md
@@ -1,22 +1,52 @@
|
||||
# ComfyUI Frontend Project Guidelines
|
||||
|
||||
## Repository Setup
|
||||
|
||||
For first-time setup, use the Claude command:
|
||||
```
|
||||
/setup_repo
|
||||
```
|
||||
This bootstraps the monorepo with dependencies, builds, tests, and dev server verification.
|
||||
|
||||
**Prerequisites:** Node.js >= 24, Git repository, available ports (5173, 6006)
|
||||
|
||||
## Quick Commands
|
||||
|
||||
- `pnpm`: See all available commands
|
||||
- `pnpm dev`: Start development server (port 5173, via nx)
|
||||
- `pnpm typecheck`: Type checking
|
||||
- `pnpm lint`: Linting
|
||||
- `pnpm build`: Build for production (via nx)
|
||||
- `pnpm lint`: Linting (via nx)
|
||||
- `pnpm format`: Prettier formatting
|
||||
- `pnpm test:component`: Run component tests with browser environment
|
||||
- `pnpm test:unit`: Run all unit tests
|
||||
- `pnpm test:browser`: Run E2E tests via Playwright
|
||||
- `pnpm test:unit -- tests-ui/tests/example.test.ts`: Run single test file
|
||||
- `pnpm storybook`: Start Storybook development server (port 6006)
|
||||
- `pnpm knip`: Detect unused code and dependencies
|
||||
|
||||
## Monorepo Architecture
|
||||
|
||||
The project now uses **Nx** for build orchestration and task management:
|
||||
|
||||
- **Task Orchestration**: Commands like `dev`, `build`, `lint`, and `test:browser` run via Nx
|
||||
- **Caching**: Nx provides intelligent caching for faster rebuilds
|
||||
- **Configuration**: Managed through `nx.json` with plugins for ESLint, Storybook, Vite, and Playwright
|
||||
- **Dependencies**: Nx handles dependency graph analysis and parallel execution
|
||||
|
||||
Key Nx features:
|
||||
- Build target caching and incremental builds
|
||||
- Parallel task execution across the monorepo
|
||||
- Plugin-based architecture for different tools
|
||||
|
||||
## Development Workflow
|
||||
|
||||
1. Make code changes
|
||||
2. Run tests (see subdirectory CLAUDE.md files)
|
||||
3. Run typecheck, lint, format
|
||||
4. Check README updates
|
||||
5. Consider docs.comfy.org updates
|
||||
1. **First-time setup**: Run `/setup_repo` Claude command
|
||||
2. Make code changes
|
||||
3. Run tests (see subdirectory CLAUDE.md files)
|
||||
4. Run typecheck, lint, format
|
||||
5. Check README updates
|
||||
6. Consider docs.comfy.org updates
|
||||
|
||||
## Git Conventions
|
||||
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
/src/extensions/core/load3d.ts @jtydhr88 @Comfy-Org/comfy_frontend_devs
|
||||
|
||||
# Mask Editor extension
|
||||
/src/extensions/core/maskeditor.ts @trsommer @Comfy-Org/comfy_frontend_devs
|
||||
/src/extensions/core/maskeditor.ts @brucew4yn3rp @trsommer @Comfy-Org/comfy_frontend_devs
|
||||
|
||||
75
I18N_FIX_DOCUMENTATION.md
Normal file
75
I18N_FIX_DOCUMENTATION.md
Normal file
@@ -0,0 +1,75 @@
|
||||
# i18n Collection Fix Documentation
|
||||
|
||||
## Problem Statement
|
||||
The `pnpm collect-i18n` command was failing in CI/CD with TypeScript compilation errors related to `declare` field syntax in Playwright's Babel transpiler.
|
||||
|
||||
## Root Cause
|
||||
Playwright's Babel transpiler couldn't properly handle TypeScript's `declare` field syntax in several subgraph-related classes, resulting in the error:
|
||||
```
|
||||
TypeScript 'declare' fields must first be transformed by @babel/plugin-transform-typescript
|
||||
```
|
||||
|
||||
## Files Modified
|
||||
|
||||
### 1. TypeScript Files (Fixed `declare` syntax issues)
|
||||
- `src/lib/litegraph/src/subgraph/SubgraphNode.ts`
|
||||
- Changed: `declare inputs:` → `override inputs: ... = []`
|
||||
|
||||
- `src/lib/litegraph/src/subgraph/SubgraphInput.ts`
|
||||
- `src/lib/litegraph/src/subgraph/SubgraphOutput.ts`
|
||||
- `src/lib/litegraph/src/subgraph/EmptySubgraphInput.ts`
|
||||
- `src/lib/litegraph/src/subgraph/EmptySubgraphOutput.ts`
|
||||
- Kept: `declare parent:` (works with standard TypeScript compilation)
|
||||
|
||||
### 2. Package Dependencies
|
||||
- `package.json`: Updated `@playwright/test` from `^1.52.0` to `^1.55.0`
|
||||
- Resolved version conflict with `@executeautomation/playwright-mcp-server`
|
||||
|
||||
### 3. Configuration Files
|
||||
- `playwright.i18n.config.ts`: Updated to use correct test directory and dynamic baseURL
|
||||
|
||||
## Verification
|
||||
Run the verification script to ensure the setup is correct:
|
||||
```bash
|
||||
node scripts/verify-i18n-setup.cjs
|
||||
```
|
||||
|
||||
## How to Run i18n Collection
|
||||
|
||||
### In Development:
|
||||
```bash
|
||||
# 1. Start the electron dev server
|
||||
pnpm dev:electron
|
||||
|
||||
# 2. In another terminal, run the collection
|
||||
pnpm collect-i18n
|
||||
```
|
||||
|
||||
### In CI/CD:
|
||||
The GitHub workflow (`.github/workflows/i18n.yaml`) automatically:
|
||||
1. Starts the electron dev server
|
||||
2. Runs `pnpm collect-i18n`
|
||||
3. Updates locale files
|
||||
4. Commits changes
|
||||
|
||||
## Key Insights
|
||||
|
||||
1. **TypeScript vs Babel Compilation**: Playwright uses Babel for transpilation which has different requirements than standard TypeScript compilation.
|
||||
|
||||
2. **Version Consistency**: Multiple Playwright versions in dependencies can cause test runner conflicts.
|
||||
|
||||
3. **Server Requirements**: The i18n collection requires the electron dev server (not the regular dev server) to properly load the application context.
|
||||
|
||||
## Files Created During Debugging
|
||||
- `scripts/verify-i18n-setup.cjs` - Verification script to check setup
|
||||
- `scripts/collect-i18n-simple.cjs` - Alternative standalone collection script (backup)
|
||||
- `scripts/collect-i18n-standalone.js` - Initial attempt at standalone collection
|
||||
- `browser_tests/collect-i18n-*.ts` - Copies of original scripts in browser_tests directory
|
||||
|
||||
## Testing Status
|
||||
✅ TypeScript compilation passes (`pnpm typecheck`)
|
||||
✅ All locale files present and valid
|
||||
✅ Playwright configuration updated
|
||||
✅ Version conflicts resolved
|
||||
|
||||
The i18n collection system is now ready for use in CI/CD pipelines.
|
||||
@@ -43,7 +43,7 @@ test.describe('Selection Toolbox', () => {
|
||||
const boundingBox = await toolboxContainer.boundingBox()
|
||||
expect(boundingBox).not.toBeNull()
|
||||
// Canvas-based positioning can vary, just verify toolbox appears in reasonable bounds
|
||||
expect(boundingBox!.x).toBeGreaterThan(-100) // Not too far off-screen left
|
||||
expect(boundingBox!.x).toBeGreaterThan(-200) // Not too far off-screen left
|
||||
expect(boundingBox!.x).toBeLessThan(1000) // Not too far off-screen right
|
||||
expect(boundingBox!.y).toBeGreaterThan(-100) // Not too far off-screen top
|
||||
})
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 103 KiB After Width: | Height: | Size: 103 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 104 KiB After Width: | Height: | Size: 103 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 99 KiB |
@@ -17,9 +17,10 @@ export default [
|
||||
'src/scripts/*',
|
||||
'src/extensions/core/*',
|
||||
'src/types/vue-shim.d.ts',
|
||||
// Generated files that don't need linting
|
||||
'src/types/comfyRegistryTypes.ts',
|
||||
'src/types/generatedManagerTypes.ts'
|
||||
'src/types/generatedManagerTypes.ts',
|
||||
'**/vite.config.*.timestamp*',
|
||||
'**/vitest.config.*.timestamp*'
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ const config: KnipConfig = {
|
||||
// Workspace configuration for monorepo-like structure
|
||||
workspaces: {
|
||||
'.': {
|
||||
entry: ['src/main.ts']
|
||||
entry: ['src/main.ts', 'playwright.i18n.config.ts']
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
23
package.json
23
package.json
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@comfyorg/comfyui-frontend",
|
||||
"private": true,
|
||||
"version": "1.26.7",
|
||||
"version": "1.26.9",
|
||||
"type": "module",
|
||||
"repository": "https://github.com/Comfy-Org/ComfyUI_frontend",
|
||||
"homepage": "https://comfy.org",
|
||||
@@ -18,7 +18,7 @@
|
||||
"format:check": "prettier --check './**/*.{js,ts,tsx,vue,mts}' --cache",
|
||||
"format:no-cache": "prettier --write './**/*.{js,ts,tsx,vue,mts}'",
|
||||
"format:check:no-cache": "prettier --check './**/*.{js,ts,tsx,vue,mts}'",
|
||||
"test:browser": "npx playwright test",
|
||||
"test:browser": "playwright test",
|
||||
"test:unit": "vitest run tests-ui/tests",
|
||||
"test:component": "vitest run src/components/",
|
||||
"preinstall": "npx only-allow pnpm",
|
||||
@@ -31,20 +31,20 @@
|
||||
"knip": "knip --cache",
|
||||
"knip:no-cache": "knip",
|
||||
"locale": "lobe-i18n locale",
|
||||
"collect-i18n": "playwright test --config=playwright.i18n.config.ts",
|
||||
"collect-i18n": "npx playwright test --config=playwright.i18n.config.ts",
|
||||
"json-schema": "tsx scripts/generate-json-schema.ts",
|
||||
"storybook": "storybook dev -p 6006",
|
||||
"build-storybook": "storybook build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.8.0",
|
||||
"@executeautomation/playwright-mcp-server": "^1.0.5",
|
||||
"@executeautomation/playwright-mcp-server": "^1.0.6",
|
||||
"@iconify/json": "^2.2.245",
|
||||
"@iconify/tailwind": "^1.2.0",
|
||||
"@intlify/eslint-plugin-vue-i18n": "^3.2.0",
|
||||
"@lobehub/i18n-cli": "^1.20.0",
|
||||
"@lobehub/i18n-cli": "^1.25.1",
|
||||
"@pinia/testing": "^0.1.5",
|
||||
"@playwright/test": "^1.52.0",
|
||||
"@playwright/test": "1.55.0",
|
||||
"@storybook/addon-docs": "^9.1.1",
|
||||
"@storybook/vue3": "^9.1.1",
|
||||
"@storybook/vue3-vite": "^9.1.1",
|
||||
@@ -55,6 +55,7 @@
|
||||
"@types/semver": "^7.7.0",
|
||||
"@types/three": "^0.169.0",
|
||||
"@vitejs/plugin-vue": "^5.1.4",
|
||||
"@vitest/ui": "^3.0.0",
|
||||
"@vue/test-utils": "^2.4.6",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"chalk": "^5.3.0",
|
||||
@@ -70,14 +71,16 @@
|
||||
"happy-dom": "^15.11.0",
|
||||
"husky": "^9.0.11",
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
"ink": "^4.2.0",
|
||||
"ink": "^6.2.2",
|
||||
"jiti": "2.4.2",
|
||||
"knip": "^5.62.0",
|
||||
"lint-staged": "^15.2.7",
|
||||
"lucide-vue-next": "^0.540.0",
|
||||
"playwright": "^1.55.0",
|
||||
"postcss": "^8.4.39",
|
||||
"prettier": "^3.3.2",
|
||||
"react": "^18.3.1",
|
||||
"react-reconciler": "^0.29.2",
|
||||
"react": "^19.1.1",
|
||||
"react-reconciler": "^0.32.0",
|
||||
"storybook": "^9.1.1",
|
||||
"tailwindcss": "^3.4.4",
|
||||
"tsx": "^4.15.6",
|
||||
@@ -90,7 +93,7 @@
|
||||
"vite-plugin-dts": "^4.3.0",
|
||||
"vite-plugin-html": "^3.2.2",
|
||||
"vite-plugin-vue-devtools": "^7.7.6",
|
||||
"vitest": "^2.0.0",
|
||||
"vitest": "^3.2.4",
|
||||
"vue-tsc": "^2.1.10",
|
||||
"zip-dir": "^2.0.0",
|
||||
"zod-to-json-schema": "^3.24.1"
|
||||
|
||||
@@ -1,39 +1,31 @@
|
||||
import { defineConfig, devices } from '@playwright/test'
|
||||
|
||||
/**
|
||||
* Read environment variables from file.
|
||||
* https://github.com/motdotla/dotenv
|
||||
*/
|
||||
// import dotenv from 'dotenv';
|
||||
// dotenv.config({ path: path.resolve(__dirname, '.env') });
|
||||
|
||||
/**
|
||||
* See https://playwright.dev/docs/test-configuration.
|
||||
*/
|
||||
export default defineConfig({
|
||||
testDir: './browser_tests',
|
||||
/* Run tests in files in parallel */
|
||||
fullyParallel: true,
|
||||
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
||||
forbidOnly: !!process.env.CI,
|
||||
/* Retry on CI only - increased for better flaky test handling */
|
||||
retries: process.env.CI ? 3 : 0,
|
||||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
||||
reporter: 'html',
|
||||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
||||
// /* // Toggle for [LOCAL] testing.
|
||||
retries: process.env.CI ? 3 : 0,
|
||||
use: {
|
||||
/* Base URL to use in actions like `await page.goto('/')`. */
|
||||
// baseURL: 'http://127.0.0.1:3000',
|
||||
|
||||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
||||
trace: 'on-first-retry'
|
||||
},
|
||||
/* Path to global setup file. Exported function runs once before all the tests */
|
||||
/*/ // [LOCAL]
|
||||
// VERY HELPFUL: Skip screenshot tests locally
|
||||
// grep: process.env.CI ? undefined : /^(?!.*screenshot).*$/,
|
||||
timeout: 30_000, // Longer timeout for breakpoints
|
||||
retries: 0, // No retries while debugging. Increase if writing new tests. that may be flaky.
|
||||
workers: 4, // Single worker for easier debugging. Increase to match CPU cores if you want to run a lot of tests in parallel.
|
||||
|
||||
use: {
|
||||
trace: 'on', // Always capture traces (CI uses 'on-first-retry')
|
||||
video: 'on' // Always record video (CI uses 'retain-on-failure')
|
||||
},
|
||||
//*/
|
||||
|
||||
globalSetup: './browser_tests/globalSetup.ts',
|
||||
/* Path to global teardown file. Exported function runs once after all the tests */
|
||||
globalTeardown: './browser_tests/globalTeardown.ts',
|
||||
|
||||
/* Configure projects for major browsers */
|
||||
projects: [
|
||||
{
|
||||
name: 'chromium',
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import { PlaywrightTestConfig } from '@playwright/test'
|
||||
import { defineConfig } from '@playwright/test'
|
||||
|
||||
const config: PlaywrightTestConfig = {
|
||||
export default defineConfig({
|
||||
testDir: './scripts',
|
||||
use: {
|
||||
baseURL: 'http://localhost:5173',
|
||||
baseURL: process.env.PLAYWRIGHT_TEST_URL || 'http://localhost:5173',
|
||||
headless: true
|
||||
},
|
||||
reporter: 'list',
|
||||
timeout: 60000,
|
||||
testMatch: /collect-i18n-.*\.ts/
|
||||
}
|
||||
|
||||
export default config
|
||||
})
|
||||
|
||||
2645
pnpm-lock.yaml
generated
2645
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -12,4 +12,5 @@ onlyBuiltDependencies:
|
||||
- '@playwright/browser-firefox'
|
||||
- '@playwright/browser-webkit'
|
||||
- esbuild
|
||||
- nx
|
||||
- oxc-resolver
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as fs from 'fs'
|
||||
|
||||
import { comfyPageFixture as test } from '../browser_tests/fixtures/ComfyPage'
|
||||
import { test } from '@playwright/test'
|
||||
import { CORE_MENU_COMMANDS } from '../src/constants/coreMenuCommands'
|
||||
import { SERVER_CONFIG_ITEMS } from '../src/constants/serverConfig'
|
||||
import type { ComfyCommandImpl } from '../src/stores/commandStore'
|
||||
@@ -19,9 +19,26 @@ const extractMenuCommandLocaleStrings = (): Set<string> => {
|
||||
return labels
|
||||
}
|
||||
|
||||
test('collect-i18n-general', async ({ comfyPage }) => {
|
||||
test('collect-i18n-general', async ({ page }) => {
|
||||
// Navigate to the page and wait for app to be available
|
||||
console.log('Navigating to page...')
|
||||
await page.goto('/')
|
||||
console.log('Waiting for app to be available...')
|
||||
|
||||
// Check if we're on electron page
|
||||
const title = await page.title()
|
||||
console.log('Page title:', title)
|
||||
|
||||
// Debug: Check what's available on window
|
||||
const windowKeys = await page.evaluate(() => {
|
||||
return Object.keys(window).filter(key => !key.startsWith('__')).slice(0, 20)
|
||||
})
|
||||
console.log('Window keys:', windowKeys)
|
||||
|
||||
await page.waitForFunction(() => window['app'] != null, { timeout: 30000 })
|
||||
|
||||
const commands = (
|
||||
await comfyPage.page.evaluate(() => {
|
||||
await page.evaluate(() => {
|
||||
const workspace = window['app'].extensionManager
|
||||
const commands = workspace.command.commands as ComfyCommandImpl[]
|
||||
return commands.map((command) => ({
|
||||
@@ -58,7 +75,7 @@ test('collect-i18n-general', async ({ comfyPage }) => {
|
||||
)
|
||||
|
||||
// Settings
|
||||
const settings = await comfyPage.page.evaluate(() => {
|
||||
const settings = await page.evaluate(() => {
|
||||
const workspace = window['app'].extensionManager
|
||||
const settings = workspace.setting.settings as Record<string, SettingParams>
|
||||
return Object.values(settings)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as fs from 'fs'
|
||||
|
||||
import { comfyPageFixture as test } from '../browser_tests/fixtures/ComfyPage'
|
||||
import { test } from '@playwright/test'
|
||||
import type { ComfyNodeDef } from '../src/schemas/nodeDefSchema'
|
||||
import type { ComfyApi } from '../src/scripts/api'
|
||||
import { ComfyNodeDefImpl } from '../src/stores/nodeDefStore'
|
||||
@@ -9,17 +9,23 @@ import { normalizeI18nKey } from '../src/utils/formatUtil'
|
||||
const localePath = './src/locales/en/main.json'
|
||||
const nodeDefsPath = './src/locales/en/nodeDefs.json'
|
||||
|
||||
test('collect-i18n-node-defs', async ({ comfyPage }) => {
|
||||
test('collect-i18n-node-defs', async ({ page }) => {
|
||||
// Navigate to the page
|
||||
await page.goto('/')
|
||||
|
||||
// Mock view route
|
||||
comfyPage.page.route('**/view**', async (route) => {
|
||||
await page.route('**/view**', async (route) => {
|
||||
await route.fulfill({
|
||||
body: JSON.stringify({})
|
||||
})
|
||||
})
|
||||
|
||||
// Wait for app to be available
|
||||
await page.waitForFunction(() => window['app'] != null, { timeout: 30000 })
|
||||
|
||||
const nodeDefs: ComfyNodeDefImpl[] = (
|
||||
Object.values(
|
||||
await comfyPage.page.evaluate(async () => {
|
||||
await page.evaluate(async () => {
|
||||
const api = window['app'].api as ComfyApi
|
||||
return await api.getNodeDefs()
|
||||
})
|
||||
@@ -62,7 +68,7 @@ test('collect-i18n-node-defs', async ({ comfyPage }) => {
|
||||
if (!inputNames.length) continue
|
||||
|
||||
try {
|
||||
const widgetsMappings = await comfyPage.page.evaluate(
|
||||
const widgetsMappings = await page.evaluate(
|
||||
(args) => {
|
||||
const [nodeName, displayName, inputNames] = args
|
||||
const node = window['LiteGraph'].createNode(nodeName, displayName)
|
||||
@@ -91,7 +97,7 @@ test('collect-i18n-node-defs', async ({ comfyPage }) => {
|
||||
`Failed to extract widgets from ${nodeDef.name}: ${error}`
|
||||
)
|
||||
} finally {
|
||||
await comfyPage.nextFrame()
|
||||
await page.waitForTimeout(10)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
50
scripts/debug-i18n.cjs
Normal file
50
scripts/debug-i18n.cjs
Normal file
@@ -0,0 +1,50 @@
|
||||
const { chromium } = require('playwright');
|
||||
|
||||
(async () => {
|
||||
const browser = await chromium.launch({ headless: true });
|
||||
const page = await browser.newPage();
|
||||
|
||||
// Check console messages
|
||||
page.on('console', msg => {
|
||||
console.log(`[${msg.type()}]`, msg.text());
|
||||
});
|
||||
|
||||
page.on('pageerror', error => {
|
||||
console.log('Page error:', error.message);
|
||||
});
|
||||
|
||||
console.log('Navigating to http://localhost:5173...');
|
||||
await page.goto('http://localhost:5173');
|
||||
|
||||
const title = await page.title();
|
||||
console.log('Page title:', title);
|
||||
|
||||
// Wait for page to load
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
// Check console errors
|
||||
page.on('console', msg => {
|
||||
if (msg.type() === 'error') {
|
||||
console.log('Console error:', msg.text());
|
||||
}
|
||||
});
|
||||
|
||||
// Wait a bit more and check again
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
// Check what's on window
|
||||
const windowInfo = await page.evaluate(() => {
|
||||
const keys = Object.keys(window).filter(key => !key.startsWith('__'));
|
||||
return {
|
||||
hasApp: 'app' in window,
|
||||
hasLiteGraph: 'LiteGraph' in window,
|
||||
hasComfyApp: 'ComfyApp' in window,
|
||||
topKeys: keys.slice(0, 30),
|
||||
appType: typeof window['app']
|
||||
};
|
||||
});
|
||||
|
||||
console.log('Window info:', JSON.stringify(windowInfo, null, 2));
|
||||
|
||||
await browser.close();
|
||||
})();
|
||||
116
scripts/verify-i18n-setup.cjs
Normal file
116
scripts/verify-i18n-setup.cjs
Normal file
@@ -0,0 +1,116 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Verification script to check if i18n collection setup is working properly
|
||||
* This script performs basic checks to ensure the environment is ready for i18n collection
|
||||
*/
|
||||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
console.log('🔍 Verifying i18n collection setup...\n');
|
||||
|
||||
let hasErrors = false;
|
||||
|
||||
// Check 1: Verify locale directories exist
|
||||
console.log('1. Checking locale directories...');
|
||||
const localeDir = path.join(__dirname, '../src/locales/en');
|
||||
if (fs.existsSync(localeDir)) {
|
||||
console.log(' ✅ Locale directory exists');
|
||||
} else {
|
||||
console.log(' ❌ Locale directory missing:', localeDir);
|
||||
hasErrors = true;
|
||||
}
|
||||
|
||||
// Check 2: Verify required locale files
|
||||
console.log('\n2. Checking locale files...');
|
||||
const requiredFiles = ['main.json', 'commands.json', 'settings.json', 'nodeDefs.json'];
|
||||
requiredFiles.forEach(file => {
|
||||
const filePath = path.join(localeDir, file);
|
||||
if (fs.existsSync(filePath)) {
|
||||
const stats = fs.statSync(filePath);
|
||||
console.log(` ✅ ${file} exists (${stats.size} bytes)`);
|
||||
} else {
|
||||
console.log(` ❌ ${file} missing`);
|
||||
hasErrors = true;
|
||||
}
|
||||
});
|
||||
|
||||
// Check 3: Verify TypeScript compilation works
|
||||
console.log('\n3. Checking TypeScript compilation...');
|
||||
const problematicFiles = [
|
||||
'src/lib/litegraph/src/subgraph/SubgraphNode.ts',
|
||||
'src/lib/litegraph/src/subgraph/SubgraphInput.ts',
|
||||
'src/lib/litegraph/src/subgraph/SubgraphOutput.ts',
|
||||
'src/lib/litegraph/src/subgraph/EmptySubgraphInput.ts',
|
||||
'src/lib/litegraph/src/subgraph/EmptySubgraphOutput.ts'
|
||||
];
|
||||
|
||||
problematicFiles.forEach(file => {
|
||||
const filePath = path.join(__dirname, '..', file);
|
||||
if (fs.existsSync(filePath)) {
|
||||
const content = fs.readFileSync(filePath, 'utf-8');
|
||||
// Check for problematic patterns that caused issues
|
||||
if (content.includes('declare inputs:') && !content.includes('override inputs:')) {
|
||||
console.log(` ⚠️ ${file} may have unfixed declare syntax`);
|
||||
} else {
|
||||
console.log(` ✅ ${file} syntax looks correct`);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Check 4: Verify Playwright configuration
|
||||
console.log('\n4. Checking Playwright configuration...');
|
||||
const playwrightConfig = path.join(__dirname, '../playwright.i18n.config.ts');
|
||||
if (fs.existsSync(playwrightConfig)) {
|
||||
const content = fs.readFileSync(playwrightConfig, 'utf-8');
|
||||
if (content.includes('testDir: \'./browser_tests\'')) {
|
||||
console.log(' ✅ Playwright config points to correct test directory');
|
||||
} else {
|
||||
console.log(' ⚠️ Playwright config may need adjustment');
|
||||
}
|
||||
} else {
|
||||
console.log(' ❌ Playwright i18n config missing');
|
||||
hasErrors = true;
|
||||
}
|
||||
|
||||
// Check 5: Verify package.json scripts
|
||||
console.log('\n5. Checking package.json scripts...');
|
||||
const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, '../package.json'), 'utf-8'));
|
||||
if (packageJson.scripts['collect-i18n']) {
|
||||
console.log(` ✅ collect-i18n script exists: "${packageJson.scripts['collect-i18n']}"`);
|
||||
} else {
|
||||
console.log(' ❌ collect-i18n script missing from package.json');
|
||||
hasErrors = true;
|
||||
}
|
||||
|
||||
// Check 6: Verify Playwright version consistency
|
||||
console.log('\n6. Checking Playwright versions...');
|
||||
const devDeps = packageJson.devDependencies || {};
|
||||
const playwrightVersion = devDeps['@playwright/test'];
|
||||
if (playwrightVersion) {
|
||||
console.log(` ✅ @playwright/test version: ${playwrightVersion}`);
|
||||
|
||||
// Check for potential conflicts
|
||||
const mcpServer = devDeps['@executeautomation/playwright-mcp-server'];
|
||||
if (mcpServer) {
|
||||
console.log(` ⚠️ MCP server present - may have version conflicts`);
|
||||
console.log(` Ensure both use compatible Playwright versions`);
|
||||
}
|
||||
} else {
|
||||
console.log(' ❌ @playwright/test not found in devDependencies');
|
||||
hasErrors = true;
|
||||
}
|
||||
|
||||
// Final summary
|
||||
console.log('\n' + '='.repeat(50));
|
||||
if (hasErrors) {
|
||||
console.log('❌ Verification failed - some issues need to be fixed');
|
||||
process.exit(1);
|
||||
} else {
|
||||
console.log('✅ All checks passed - i18n collection should work!');
|
||||
console.log('\nTo run i18n collection:');
|
||||
console.log(' 1. Start dev server: pnpm dev:electron');
|
||||
console.log(' 2. Run collection: pnpm collect-i18n');
|
||||
process.exit(0);
|
||||
}
|
||||
@@ -57,14 +57,23 @@
|
||||
class="w-8 h-8 mt-4"
|
||||
style="--pc-spinner-color: #000"
|
||||
/>
|
||||
<Button
|
||||
v-else
|
||||
class="mt-4 w-32"
|
||||
severity="secondary"
|
||||
:label="$t('auth.signOut.signOut')"
|
||||
icon="pi pi-sign-out"
|
||||
@click="handleSignOut"
|
||||
/>
|
||||
<div v-else class="mt-4 flex flex-col gap-2">
|
||||
<Button
|
||||
class="w-32"
|
||||
severity="secondary"
|
||||
:label="$t('auth.signOut.signOut')"
|
||||
icon="pi pi-sign-out"
|
||||
@click="handleSignOut"
|
||||
/>
|
||||
<Button
|
||||
v-if="!isApiKeyLogin"
|
||||
class="w-32"
|
||||
severity="danger"
|
||||
:label="$t('auth.deleteAccount.deleteAccount')"
|
||||
icon="pi pi-trash"
|
||||
@click="handleDeleteAccount"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Login Section -->
|
||||
@@ -100,6 +109,7 @@ const dialogService = useDialogService()
|
||||
const {
|
||||
loading,
|
||||
isLoggedIn,
|
||||
isApiKeyLogin,
|
||||
isEmailProvider,
|
||||
userDisplayName,
|
||||
userEmail,
|
||||
@@ -107,6 +117,7 @@ const {
|
||||
providerName,
|
||||
providerIcon,
|
||||
handleSignOut,
|
||||
handleSignIn
|
||||
handleSignIn,
|
||||
handleDeleteAccount
|
||||
} = useCurrentUser()
|
||||
</script>
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
<template>
|
||||
<Transition name="slide-up">
|
||||
<!-- Wrapping panel in div to get correct ref because panel ref is not of raw dom el -->
|
||||
<div
|
||||
v-show="visible"
|
||||
ref="toolboxRef"
|
||||
style="
|
||||
transform: translate(calc(var(--tb-x) - 50%), calc(var(--tb-y) - 120%));
|
||||
"
|
||||
class="selection-toolbox fixed left-0 top-0 z-40"
|
||||
>
|
||||
<div
|
||||
ref="toolboxRef"
|
||||
style="transform: translate(var(--tb-x), var(--tb-y))"
|
||||
class="fixed left-0 top-0 z-40"
|
||||
>
|
||||
<Transition name="slide-up">
|
||||
<Panel
|
||||
class="rounded-lg"
|
||||
v-if="visible"
|
||||
class="rounded-lg selection-toolbox"
|
||||
:pt="{
|
||||
header: 'hidden',
|
||||
content: 'p-0 flex flex-row'
|
||||
@@ -33,8 +30,8 @@
|
||||
/>
|
||||
<HelpButton />
|
||||
</Panel>
|
||||
</div>
|
||||
</Transition>
|
||||
</Transition>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -84,22 +81,31 @@ const extensionToolboxCommands = computed<ComfyCommandImpl[]>(() => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.selection-toolbox {
|
||||
transform: translateX(-50%) translateY(-120%);
|
||||
will-change: transform, opacity;
|
||||
}
|
||||
|
||||
@keyframes slideUp {
|
||||
0% {
|
||||
transform: translateX(-50%) translateY(-100%);
|
||||
opacity: 0;
|
||||
}
|
||||
50% {
|
||||
transform: translateX(-50%) translateY(-125%);
|
||||
opacity: 0.5;
|
||||
}
|
||||
100% {
|
||||
transform: translateX(-50%) translateY(-120%);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.slide-up-enter-active {
|
||||
opacity: 1;
|
||||
transition: all 0.3s ease-out;
|
||||
animation: slideUp 125ms ease-out;
|
||||
}
|
||||
|
||||
.slide-up-leave-active {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.slide-up-enter-from {
|
||||
transform: translateY(-100%);
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.slide-up-leave-to {
|
||||
transform: translateY(0);
|
||||
opacity: 0;
|
||||
animation: slideUp 25ms ease-out reverse;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -41,11 +41,13 @@ afterAll(() => {
|
||||
})
|
||||
|
||||
// Mock the useCurrentUser composable
|
||||
const mockHandleSignOut = vi.fn()
|
||||
vi.mock('@/composables/auth/useCurrentUser', () => ({
|
||||
useCurrentUser: vi.fn(() => ({
|
||||
userPhotoUrl: 'https://example.com/avatar.jpg',
|
||||
userDisplayName: 'Test User',
|
||||
userEmail: 'test@example.com'
|
||||
userEmail: 'test@example.com',
|
||||
handleSignOut: mockHandleSignOut
|
||||
}))
|
||||
}))
|
||||
|
||||
@@ -155,8 +157,8 @@ describe('CurrentUserPopover', () => {
|
||||
// Click the logout button
|
||||
await logoutButton.trigger('click')
|
||||
|
||||
// Verify logout was called
|
||||
expect(mockLogout).toHaveBeenCalled()
|
||||
// Verify handleSignOut was called
|
||||
expect(mockHandleSignOut).toHaveBeenCalled()
|
||||
|
||||
// Verify close event was emitted
|
||||
expect(wrapper.emitted('close')).toBeTruthy()
|
||||
|
||||
@@ -88,7 +88,8 @@ const emit = defineEmits<{
|
||||
close: []
|
||||
}>()
|
||||
|
||||
const { userDisplayName, userEmail, userPhotoUrl } = useCurrentUser()
|
||||
const { userDisplayName, userEmail, userPhotoUrl, handleSignOut } =
|
||||
useCurrentUser()
|
||||
const authActions = useFirebaseAuthActions()
|
||||
const dialogService = useDialogService()
|
||||
|
||||
@@ -103,7 +104,7 @@ const handleTopUp = () => {
|
||||
}
|
||||
|
||||
const handleLogout = async () => {
|
||||
await authActions.logout()
|
||||
await handleSignOut()
|
||||
emit('close')
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { computed } from 'vue'
|
||||
|
||||
import { useFirebaseAuthActions } from '@/composables/auth/useFirebaseAuthActions'
|
||||
import { t } from '@/i18n'
|
||||
import { useDialogService } from '@/services/dialogService'
|
||||
import { useApiKeyAuthStore } from '@/stores/apiKeyAuthStore'
|
||||
import { useCommandStore } from '@/stores/commandStore'
|
||||
import { useFirebaseAuthStore } from '@/stores/firebaseAuthStore'
|
||||
@@ -8,6 +11,8 @@ export const useCurrentUser = () => {
|
||||
const authStore = useFirebaseAuthStore()
|
||||
const commandStore = useCommandStore()
|
||||
const apiKeyStore = useApiKeyAuthStore()
|
||||
const dialogService = useDialogService()
|
||||
const { deleteAccount } = useFirebaseAuthActions()
|
||||
|
||||
const firebaseUser = computed(() => authStore.currentUser)
|
||||
const isApiKeyLogin = computed(() => apiKeyStore.isAuthenticated)
|
||||
@@ -85,6 +90,18 @@ export const useCurrentUser = () => {
|
||||
await commandStore.execute('Comfy.User.OpenSignInDialog')
|
||||
}
|
||||
|
||||
const handleDeleteAccount = async () => {
|
||||
const confirmed = await dialogService.confirm({
|
||||
title: t('auth.deleteAccount.confirmTitle'),
|
||||
message: t('auth.deleteAccount.confirmMessage'),
|
||||
type: 'delete'
|
||||
})
|
||||
|
||||
if (confirmed) {
|
||||
await deleteAccount()
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
loading: authStore.loading,
|
||||
isLoggedIn,
|
||||
@@ -96,6 +113,7 @@ export const useCurrentUser = () => {
|
||||
providerName,
|
||||
providerIcon,
|
||||
handleSignOut,
|
||||
handleSignIn
|
||||
handleSignIn,
|
||||
handleDeleteAccount
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,6 +135,16 @@ export const useFirebaseAuthActions = () => {
|
||||
reportError
|
||||
)
|
||||
|
||||
const deleteAccount = wrapWithErrorHandlingAsync(async () => {
|
||||
await authStore.deleteAccount()
|
||||
toastStore.add({
|
||||
severity: 'success',
|
||||
summary: t('auth.deleteAccount.success'),
|
||||
detail: t('auth.deleteAccount.successDetail'),
|
||||
life: 5000
|
||||
})
|
||||
}, reportError)
|
||||
|
||||
return {
|
||||
logout,
|
||||
sendPasswordReset,
|
||||
@@ -146,6 +156,7 @@ export const useFirebaseAuthActions = () => {
|
||||
signInWithEmail,
|
||||
signUpWithEmail,
|
||||
updatePassword,
|
||||
deleteAccount,
|
||||
accessError
|
||||
}
|
||||
}
|
||||
|
||||
@@ -446,6 +446,9 @@ export function useCoreCommands(): ComfyCommand[] {
|
||||
)
|
||||
group.resizeTo(canvas.selectedItems, padding)
|
||||
canvas.graph?.add(group)
|
||||
|
||||
group.recomputeInsideNodes()
|
||||
|
||||
useTitleEditorStore().titleEditorTarget = group
|
||||
}
|
||||
},
|
||||
|
||||
@@ -13,6 +13,7 @@ export const CORE_MENU_COMMANDS = [
|
||||
],
|
||||
[['Edit'], ['Comfy.Undo', 'Comfy.Redo']],
|
||||
[['Edit'], ['Comfy.OpenClipspace']],
|
||||
[['Edit'], ['Comfy.RefreshNodeDefinitions']],
|
||||
[
|
||||
['Help'],
|
||||
[
|
||||
|
||||
@@ -42,6 +42,8 @@ app.registerExtension({
|
||||
this.graph.add(group)
|
||||
// @ts-expect-error fixme ts strict error
|
||||
this.graph.change()
|
||||
|
||||
group.recomputeInsideNodes()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -390,8 +390,8 @@ export class LGraphNode
|
||||
selected?: boolean
|
||||
showAdvanced?: boolean
|
||||
|
||||
declare comfyClass?: string
|
||||
declare isVirtualNode?: boolean
|
||||
comfyClass?: string
|
||||
isVirtualNode?: boolean
|
||||
applyToGraph?(extraLinks?: LLink[]): void
|
||||
|
||||
isSubgraphNode(): this is SubgraphNode {
|
||||
|
||||
@@ -12,8 +12,8 @@ import type { SubgraphInputNode } from './SubgraphInputNode'
|
||||
* A virtual slot that simply creates a new input slot when connected to.
|
||||
*/
|
||||
export class EmptySubgraphInput extends SubgraphInput {
|
||||
declare parent: SubgraphInputNode
|
||||
|
||||
// Parent type is narrowed to SubgraphInputNode
|
||||
|
||||
constructor(parent: SubgraphInputNode) {
|
||||
super(
|
||||
{
|
||||
|
||||
@@ -12,8 +12,8 @@ import type { SubgraphOutputNode } from './SubgraphOutputNode'
|
||||
* A virtual slot that simply creates a new output slot when connected to.
|
||||
*/
|
||||
export class EmptySubgraphOutput extends SubgraphOutput {
|
||||
declare parent: SubgraphOutputNode
|
||||
|
||||
// Parent type is narrowed to SubgraphOutputNode
|
||||
|
||||
constructor(parent: SubgraphOutputNode) {
|
||||
super(
|
||||
{
|
||||
|
||||
@@ -141,7 +141,8 @@ export class ExecutableNodeDTO implements ExecutableLGraphNode {
|
||||
*/
|
||||
resolveInput(
|
||||
slot: number,
|
||||
visited = new Set<string>()
|
||||
visited = new Set<string>(),
|
||||
type?: ISlotType
|
||||
): ResolvedInput | undefined {
|
||||
const uniqueId = `${this.subgraphNode?.subgraph.id}:${this.node.id}[I]${slot}`
|
||||
if (visited.has(uniqueId)) {
|
||||
@@ -232,7 +233,11 @@ export class ExecutableNodeDTO implements ExecutableLGraphNode {
|
||||
`No output node DTO found for id [${outputNodeExecutionId}]`
|
||||
)
|
||||
|
||||
return outputNodeDto.resolveOutput(link.origin_slot, input.type, visited)
|
||||
return outputNodeDto.resolveOutput(
|
||||
link.origin_slot,
|
||||
type ?? input.type,
|
||||
visited
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -284,7 +289,7 @@ export class ExecutableNodeDTO implements ExecutableLGraphNode {
|
||||
|
||||
// Upstreamed: Other virtual nodes are bypassed using the same input/output index (slots must match)
|
||||
if (node.isVirtualNode) {
|
||||
if (this.inputs.at(slot)) return this.resolveInput(slot, visited)
|
||||
if (this.inputs.at(slot)) return this.resolveInput(slot, visited, type)
|
||||
|
||||
// Fallback check for nodes performing link redirection
|
||||
const virtualLink = this.node.getInputLink(slot)
|
||||
|
||||
@@ -30,7 +30,10 @@ import { isNodeSlot, isSubgraphOutput } from './subgraphUtils'
|
||||
* Functionally, however, when editing a subgraph, that "subgraph input" is the "origin" or "output side" of a link.
|
||||
*/
|
||||
export class SubgraphInput extends SubgraphSlot {
|
||||
declare parent: SubgraphInputNode
|
||||
// Parent type is narrowed to SubgraphInputNode
|
||||
get parent(): SubgraphInputNode {
|
||||
return super.parent as SubgraphInputNode
|
||||
}
|
||||
|
||||
events = new CustomEventTarget<SubgraphInputEventMap>()
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ import type { SubgraphInput } from './SubgraphInput'
|
||||
* An instance of a {@link Subgraph}, displayed as a node on the containing (parent) graph.
|
||||
*/
|
||||
export class SubgraphNode extends LGraphNode implements BaseLGraph {
|
||||
declare inputs: (INodeInputSlot & Partial<ISubgraphInput>)[]
|
||||
override inputs: (INodeInputSlot & Partial<ISubgraphInput>)[] = []
|
||||
|
||||
override readonly type: UUID
|
||||
override readonly isVirtualNode = true as const
|
||||
|
||||
@@ -29,7 +29,10 @@ import { isNodeSlot, isSubgraphInput } from './subgraphUtils'
|
||||
* Functionally, however, when editing a subgraph, that "subgraph output" is the "target" or "input side" of a link.
|
||||
*/
|
||||
export class SubgraphOutput extends SubgraphSlot {
|
||||
declare parent: SubgraphOutputNode
|
||||
// Parent type is narrowed to SubgraphOutputNode
|
||||
get parent(): SubgraphOutputNode {
|
||||
return super.parent as SubgraphOutputNode
|
||||
}
|
||||
|
||||
override connect(
|
||||
slot: INodeOutputSlot,
|
||||
|
||||
@@ -47,8 +47,8 @@ export abstract class BaseWidget<TWidget extends IBaseWidget = IBaseWidget>
|
||||
/** Minimum gap between label and value */
|
||||
static labelValueGap = 5
|
||||
|
||||
declare computedHeight?: number
|
||||
declare serialize?: boolean
|
||||
computedHeight?: number
|
||||
serialize?: boolean
|
||||
computeLayoutSize?(node: LGraphNode): {
|
||||
minHeight: number
|
||||
maxHeight?: number
|
||||
|
||||
@@ -334,12 +334,9 @@ describe('LinkConnector Integration', () => {
|
||||
} = graph.getNodeById(nodeId)!
|
||||
|
||||
expect(input.link).toBeNull()
|
||||
// @ts-expect-error toBeOneOf not in type definitions
|
||||
expect(output.links?.length).toBeOneOf([0, undefined])
|
||||
|
||||
// @ts-expect-error toBeOneOf not in type definitions
|
||||
expect(input._floatingLinks?.size).toBeOneOf([0, undefined])
|
||||
// @ts-expect-error toBeOneOf not in type definitions
|
||||
expect(output._floatingLinks?.size).toBeOneOf([0, undefined])
|
||||
}
|
||||
})
|
||||
@@ -537,12 +534,9 @@ describe('LinkConnector Integration', () => {
|
||||
} = graph.getNodeById(nodeId)!
|
||||
|
||||
expect(input.link).toBeNull()
|
||||
// @ts-expect-error toBeOneOf not in type definitions
|
||||
expect(output.links?.length).toBeOneOf([0, undefined])
|
||||
|
||||
// @ts-expect-error toBeOneOf not in type definitions
|
||||
expect(input._floatingLinks?.size).toBeOneOf([0, undefined])
|
||||
// @ts-expect-error toBeOneOf not in type definitions
|
||||
expect(output._floatingLinks?.size).toBeOneOf([0, undefined])
|
||||
}
|
||||
})
|
||||
@@ -856,12 +850,9 @@ describe('LinkConnector Integration', () => {
|
||||
} = graph.getNodeById(nodeId)!
|
||||
|
||||
expect(input.link).toBeNull()
|
||||
// @ts-expect-error toBeOneOf not in type definitions
|
||||
expect(output.links?.length).toBeOneOf([0, undefined])
|
||||
|
||||
// @ts-expect-error toBeOneOf not in type definitions
|
||||
expect(input._floatingLinks?.size).toBeOneOf([0, undefined])
|
||||
// @ts-expect-error toBeOneOf not in type definitions
|
||||
expect(output._floatingLinks?.size).toBeOneOf([0, undefined])
|
||||
}
|
||||
})
|
||||
|
||||
@@ -27,6 +27,15 @@
|
||||
"title": "مفتاح API",
|
||||
"whitelistInfo": "حول المواقع غير المدرجة في القائمة البيضاء"
|
||||
},
|
||||
"deleteAccount": {
|
||||
"cancel": "إلغاء",
|
||||
"confirm": "حذف الحساب",
|
||||
"confirmMessage": "هل أنت متأكد أنك تريد حذف حسابك؟ لا يمكن التراجع عن هذا الإجراء وسيتم حذف جميع بياناتك نهائيًا.",
|
||||
"confirmTitle": "حذف الحساب",
|
||||
"deleteAccount": "حذف الحساب",
|
||||
"success": "تم حذف الحساب",
|
||||
"successDetail": "تم حذف حسابك بنجاح."
|
||||
},
|
||||
"login": {
|
||||
"andText": "و",
|
||||
"confirmPasswordLabel": "تأكيد كلمة المرور",
|
||||
|
||||
@@ -1601,6 +1601,15 @@
|
||||
"passwordUpdate": {
|
||||
"success": "Password Updated",
|
||||
"successDetail": "Your password has been updated successfully"
|
||||
},
|
||||
"deleteAccount": {
|
||||
"deleteAccount": "Delete Account",
|
||||
"confirmTitle": "Delete Account",
|
||||
"confirmMessage": "Are you sure you want to delete your account? This action cannot be undone and will permanently remove all your data.",
|
||||
"confirm": "Delete Account",
|
||||
"cancel": "Cancel",
|
||||
"success": "Account Deleted",
|
||||
"successDetail": "Your account has been successfully deleted."
|
||||
}
|
||||
},
|
||||
"validation": {
|
||||
|
||||
@@ -27,6 +27,15 @@
|
||||
"title": "Clave API",
|
||||
"whitelistInfo": "Acerca de los sitios no incluidos en la lista blanca"
|
||||
},
|
||||
"deleteAccount": {
|
||||
"cancel": "Cancelar",
|
||||
"confirm": "Eliminar cuenta",
|
||||
"confirmMessage": "¿Estás seguro de que deseas eliminar tu cuenta? Esta acción no se puede deshacer y eliminará permanentemente todos tus datos.",
|
||||
"confirmTitle": "Eliminar cuenta",
|
||||
"deleteAccount": "Eliminar cuenta",
|
||||
"success": "Cuenta eliminada",
|
||||
"successDetail": "Tu cuenta ha sido eliminada exitosamente."
|
||||
},
|
||||
"login": {
|
||||
"andText": "y",
|
||||
"confirmPasswordLabel": "Confirmar contraseña",
|
||||
|
||||
@@ -27,6 +27,15 @@
|
||||
"title": "Clé API",
|
||||
"whitelistInfo": "À propos des sites non autorisés"
|
||||
},
|
||||
"deleteAccount": {
|
||||
"cancel": "Annuler",
|
||||
"confirm": "Supprimer le compte",
|
||||
"confirmMessage": "Êtes-vous sûr de vouloir supprimer votre compte ? Cette action est irréversible et supprimera définitivement toutes vos données.",
|
||||
"confirmTitle": "Supprimer le compte",
|
||||
"deleteAccount": "Supprimer le compte",
|
||||
"success": "Compte supprimé",
|
||||
"successDetail": "Votre compte a été supprimé avec succès."
|
||||
},
|
||||
"login": {
|
||||
"andText": "et",
|
||||
"confirmPasswordLabel": "Confirmer le mot de passe",
|
||||
|
||||
@@ -27,6 +27,15 @@
|
||||
"title": "APIキー",
|
||||
"whitelistInfo": "ホワイトリストに登録されていないサイトについて"
|
||||
},
|
||||
"deleteAccount": {
|
||||
"cancel": "キャンセル",
|
||||
"confirm": "アカウントを削除",
|
||||
"confirmMessage": "本当にアカウントを削除しますか?この操作は元に戻せず、すべてのデータが完全に削除されます。",
|
||||
"confirmTitle": "アカウントを削除",
|
||||
"deleteAccount": "アカウントを削除",
|
||||
"success": "アカウントが削除されました",
|
||||
"successDetail": "アカウントは正常に削除されました。"
|
||||
},
|
||||
"login": {
|
||||
"andText": "および",
|
||||
"confirmPasswordLabel": "パスワードの確認",
|
||||
|
||||
@@ -27,6 +27,15 @@
|
||||
"title": "API 키",
|
||||
"whitelistInfo": "비허용 사이트에 대하여"
|
||||
},
|
||||
"deleteAccount": {
|
||||
"cancel": "취소",
|
||||
"confirm": "계정 삭제",
|
||||
"confirmMessage": "정말로 계정을 삭제하시겠습니까? 이 작업은 되돌릴 수 없으며 모든 데이터가 영구적으로 삭제됩니다.",
|
||||
"confirmTitle": "계정 삭제",
|
||||
"deleteAccount": "계정 삭제",
|
||||
"success": "계정이 삭제되었습니다",
|
||||
"successDetail": "계정이 성공적으로 삭제되었습니다."
|
||||
},
|
||||
"login": {
|
||||
"andText": "및",
|
||||
"confirmPasswordLabel": "비밀번호 확인",
|
||||
|
||||
@@ -27,6 +27,15 @@
|
||||
"title": "API-ключ",
|
||||
"whitelistInfo": "О не включённых в белый список сайтах"
|
||||
},
|
||||
"deleteAccount": {
|
||||
"cancel": "Отмена",
|
||||
"confirm": "Удалить аккаунт",
|
||||
"confirmMessage": "Вы уверены, что хотите удалить свой аккаунт? Это действие необратимо и приведёт к безвозвратному удалению всех ваших данных.",
|
||||
"confirmTitle": "Удалить аккаунт",
|
||||
"deleteAccount": "Удалить аккаунт",
|
||||
"success": "Аккаунт удалён",
|
||||
"successDetail": "Ваш аккаунт был успешно удалён."
|
||||
},
|
||||
"login": {
|
||||
"andText": "и",
|
||||
"confirmPasswordLabel": "Подтвердите пароль",
|
||||
|
||||
@@ -27,6 +27,15 @@
|
||||
"title": "API 金鑰",
|
||||
"whitelistInfo": "關於未列入白名單的網站"
|
||||
},
|
||||
"deleteAccount": {
|
||||
"cancel": "取消",
|
||||
"confirm": "刪除帳號",
|
||||
"confirmMessage": "您確定要刪除您的帳號嗎?此操作無法復原,且將永久移除您所有的資料。",
|
||||
"confirmTitle": "刪除帳號",
|
||||
"deleteAccount": "刪除帳號",
|
||||
"success": "帳號已刪除",
|
||||
"successDetail": "您的帳號已成功刪除。"
|
||||
},
|
||||
"login": {
|
||||
"andText": "以及",
|
||||
"confirmPasswordLabel": "確認密碼",
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
"label": "适应视图到选中节点"
|
||||
},
|
||||
"Comfy_Canvas_Lock": {
|
||||
"label": "鎖定畫布"
|
||||
"label": "锁定画布"
|
||||
},
|
||||
"Comfy_Canvas_MoveSelectedNodes_Down": {
|
||||
"label": "下移选中的节点"
|
||||
@@ -93,7 +93,7 @@
|
||||
"label": "固定/取消固定选中项"
|
||||
},
|
||||
"Comfy_Canvas_Unlock": {
|
||||
"label": "解鎖畫布"
|
||||
"label": "解锁画布"
|
||||
},
|
||||
"Comfy_Canvas_ZoomIn": {
|
||||
"label": "放大"
|
||||
@@ -111,7 +111,7 @@
|
||||
"label": "联系支持"
|
||||
},
|
||||
"Comfy_Dev_ShowModelSelector": {
|
||||
"label": "顯示模型選擇器(開發)"
|
||||
"label": "显示模型选择器(开发)"
|
||||
},
|
||||
"Comfy_DuplicateWorkflow": {
|
||||
"label": "复制当前工作流"
|
||||
|
||||
@@ -27,6 +27,15 @@
|
||||
"title": "API 密钥",
|
||||
"whitelistInfo": "关于非白名单网站"
|
||||
},
|
||||
"deleteAccount": {
|
||||
"cancel": "取消",
|
||||
"confirm": "删除账户",
|
||||
"confirmMessage": "您确定要删除您的账户吗?此操作无法撤销,并且会永久删除您的所有数据。",
|
||||
"confirmTitle": "删除账户",
|
||||
"deleteAccount": "删除账户",
|
||||
"success": "账户已删除",
|
||||
"successDetail": "您的账户已成功删除。"
|
||||
},
|
||||
"login": {
|
||||
"andText": "和",
|
||||
"confirmPasswordLabel": "确认密码",
|
||||
@@ -313,7 +322,7 @@
|
||||
"feedback": "反馈",
|
||||
"filter": "过滤",
|
||||
"findIssues": "查找问题",
|
||||
"frontendNewer": "前端版本 {frontendVersion} 可能與後端版本 {backendVersion} 不相容。",
|
||||
"frontendNewer": "前端版本 {frontendVersion} 可能与后端版本 {backendVersion} 不相容。",
|
||||
"frontendOutdated": "前端版本 {frontendVersion} 已过时。后端需要 {requiredVersion} 或更高版本。",
|
||||
"goToNode": "转到节点",
|
||||
"help": "帮助",
|
||||
@@ -410,17 +419,17 @@
|
||||
},
|
||||
"graphCanvasMenu": {
|
||||
"fitView": "适应视图",
|
||||
"focusMode": "專注模式",
|
||||
"hand": "拖曳",
|
||||
"hideLinks": "隱藏連結",
|
||||
"focusMode": "专注模式",
|
||||
"hand": "拖拽",
|
||||
"hideLinks": "隐藏链接",
|
||||
"panMode": "平移模式",
|
||||
"resetView": "重置视图",
|
||||
"select": "選取",
|
||||
"select": "选择",
|
||||
"selectMode": "选择模式",
|
||||
"showLinks": "顯示連結",
|
||||
"showLinks": "显示链接",
|
||||
"toggleMinimap": "切换小地图",
|
||||
"zoomIn": "放大",
|
||||
"zoomOptions": "縮放選項",
|
||||
"zoomOptions": "缩放选项",
|
||||
"zoomOut": "缩小"
|
||||
},
|
||||
"groupNode": {
|
||||
@@ -806,7 +815,7 @@
|
||||
"Increase Brush Size in MaskEditor": "在 MaskEditor 中增大笔刷大小",
|
||||
"Interrupt": "中断",
|
||||
"Load Default Workflow": "加载默认工作流",
|
||||
"Lock Canvas": "鎖定畫布",
|
||||
"Lock Canvas": "锁定画布",
|
||||
"Manage group nodes": "管理组节点",
|
||||
"Manager": "管理器",
|
||||
"Minimap": "小地图",
|
||||
@@ -847,8 +856,8 @@
|
||||
"Restart": "重启",
|
||||
"Save": "保存",
|
||||
"Save As": "另存为",
|
||||
"Show Keybindings Dialog": "顯示快捷鍵對話框",
|
||||
"Show Model Selector (Dev)": "顯示模型選擇器(開發用)",
|
||||
"Show Keybindings Dialog": "显示快捷键对话框",
|
||||
"Show Model Selector (Dev)": "显示模型选择器(开发用)",
|
||||
"Show Settings Dialog": "显示设置对话框",
|
||||
"Sign Out": "退出登录",
|
||||
"Toggle Essential Bottom Panel": "切换基础底部面板",
|
||||
@@ -861,7 +870,7 @@
|
||||
"Toggle the Custom Nodes Manager Progress Bar": "切换自定义节点管理器进度条",
|
||||
"Undo": "撤销",
|
||||
"Ungroup selected group nodes": "解散选中组节点",
|
||||
"Unlock Canvas": "解除鎖定畫布",
|
||||
"Unlock Canvas": "解除锁定画布",
|
||||
"Unpack the selected Subgraph": "解包选中子图",
|
||||
"Workflows": "工作流",
|
||||
"Zoom In": "放大画面",
|
||||
@@ -1684,8 +1693,8 @@
|
||||
},
|
||||
"versionMismatchWarning": {
|
||||
"dismiss": "关闭",
|
||||
"frontendNewer": "前端版本 {frontendVersion} 可能與後端版本 {backendVersion} 不相容。",
|
||||
"frontendOutdated": "前端版本 {frontendVersion} 已过时。後端需要 {requiredVersion} 版或更高版本。",
|
||||
"frontendNewer": "前端版本 {frontendVersion} 可能与后端版本 {backendVersion} 不相容。",
|
||||
"frontendOutdated": "前端版本 {frontendVersion} 已过时。后端需要 {requiredVersion} 版或更高版本。",
|
||||
"title": "版本相容性警告",
|
||||
"updateFrontend": "更新前端"
|
||||
},
|
||||
@@ -1703,9 +1712,9 @@
|
||||
"saveWorkflow": "保存工作流"
|
||||
},
|
||||
"zoomControls": {
|
||||
"hideMinimap": "隱藏小地圖",
|
||||
"label": "縮放控制",
|
||||
"showMinimap": "顯示小地圖",
|
||||
"zoomToFit": "適合畫面"
|
||||
"hideMinimap": "隐藏小地图",
|
||||
"label": "缩放控制",
|
||||
"showMinimap": "显示小地图",
|
||||
"zoomToFit": "适合画面"
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
type UserCredential,
|
||||
browserLocalPersistence,
|
||||
createUserWithEmailAndPassword,
|
||||
deleteUser,
|
||||
onAuthStateChanged,
|
||||
sendPasswordResetEmail,
|
||||
setPersistence,
|
||||
@@ -287,6 +288,14 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => {
|
||||
await updatePassword(currentUser.value, newPassword)
|
||||
}
|
||||
|
||||
/** Delete the current user account */
|
||||
const _deleteAccount = async (): Promise<void> => {
|
||||
if (!currentUser.value) {
|
||||
throw new FirebaseAuthStoreError(t('toastMessages.userNotAuthenticated'))
|
||||
}
|
||||
await deleteUser(currentUser.value)
|
||||
}
|
||||
|
||||
const addCredits = async (
|
||||
requestBodyContent: CreditPurchasePayload
|
||||
): Promise<CreditPurchaseResponse> => {
|
||||
@@ -385,6 +394,7 @@ export const useFirebaseAuthStore = defineStore('firebaseAuth', () => {
|
||||
accessBillingPortal,
|
||||
sendPasswordReset,
|
||||
updatePassword: _updatePassword,
|
||||
deleteAccount: _deleteAccount,
|
||||
getAuthHeader
|
||||
}
|
||||
})
|
||||
|
||||
@@ -12,16 +12,12 @@
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"resolveJsonModule": true,
|
||||
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"downlevelIteration": true,
|
||||
"noImplicitOverride": true,
|
||||
|
||||
/* AllowJs during migration phase */
|
||||
"allowJs": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
@@ -29,7 +25,7 @@
|
||||
},
|
||||
"typeRoots": ["src/types", "node_modules/@types"],
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./",
|
||||
"rootDir": "./"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*",
|
||||
|
||||
@@ -26,6 +26,9 @@ export default defineConfig({
|
||||
base: '',
|
||||
server: {
|
||||
host: VITE_REMOTE_DEV ? '0.0.0.0' : undefined,
|
||||
watch: {
|
||||
ignored: ['**/coverage/**', '**/playwright-report/**']
|
||||
},
|
||||
proxy: {
|
||||
'/internal': {
|
||||
target: DEV_SERVER_COMFYUI_URL
|
||||
|
||||
Reference in New Issue
Block a user