Commit Graph

61 Commits

Author SHA1 Message Date
snomiao
7590b82a52 Revert "fix: Fix i18n collection by handling Vue/CSS imports in Node.js"
This reverts commit 7444c05564.
2025-09-12 04:44:05 +00:00
snomiao
7444c05564 fix: Fix i18n collection by handling Vue/CSS imports in Node.js
The collect-i18n Playwright tests were failing because Babel was trying to
parse Vue and CSS files as JavaScript when importing modules in Node.js.

Changes:
- Add Node.js ES module loader to stub Vue components and CSS imports
- Extend litegraph preprocessing to also handle CSS imports and declare keywords in src/scripts
- Simplify ComfyNodeDefImpl usage in i18n collection to avoid Vue dependency chains
- Add mock dialogService to bypass Vue component imports

The loader intercepts .vue and .css file imports and returns appropriate stubs,
while the preprocessing comments out CSS imports in TypeScript files to prevent
Babel parsing errors.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-12 04:17:09 +00:00
snomiao
be87bd02a1 Merge branch 'main' into sno-fix-playwright-babel - Resolved conflict in knip.config.ts 2025-09-11 06:12:06 +00:00
snomiao
6fbd692370 fix: Split PR deployment workflow for forked vs non-forked repos (#5425)
* [fix] Consolidate Playwright workflow jobs to fix missing deployment links

The issue in PR #5298 was caused by missing deployment-info artifact
creation. The deploy-reports job was deploying to Cloudflare but wasn't
creating the deployment-info-* artifacts that comment-tests-completed
job expected to download.

This change consolidates the deployment and commenting into a single job,
eliminating the artifact dependency and ensuring links are always available.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* refactor: Split PR deployment workflow for forked vs non-forked repos

- Extract deployment logic to reusable script (scripts/cicd/pr-playwright-deploy-and-comment.sh)
- Non-forked PRs: Use direct pull_request event in test-ui.yaml (faster)
- Forked PRs: Use workflow_run in pr-playwright-deploy.yaml (handles permissions)
- Add starting comment for both forked and non-forked PRs
- Make Cloudflare tokens optional for starting status comments

* refactor: Simplify PR deployment workflow and script

- Consolidate workflow into single job with clearer structure
- Reduce script from 200+ to ~140 lines
- Simplify deployment retry logic and comment generation
- Remove redundant checks and unnecessary complexity

* fix: Add debugging and wrangler installation to deployment script

- Add debug output to identify missing reports
- Install wrangler if not available
- Show deployment attempts and failures
- Log available reports before deployment

* chore: Trigger CI to test deployment workflow

* fix: Fix browser artifact name mismatch in deployment script

- Use dot notation (0.5x) for artifact names as Playwright creates them
- Convert to dash notation (0-5x) for Cloudflare project names
- Properly handle browser name display in comments

* refactor: Convert deployment script to POSIX sh for better compatibility

- Replace bash arrays with space-separated strings
- Use while loops instead of bash-specific for syntax
- Remove bash-specific string manipulation features
- Replace local variables (not required in functions)
- Ensure compatibility with standard /bin/sh

* fix: Fix deployment script output to properly capture URLs

- Redirect debug messages to stderr
- Only output URL to stdout for proper capture
- This fixes the missing deployment links in PR comments

* fix: Add input validation to prevent command injection

- Validate PR number is numeric only
- Sanitize branch name at script start
- Validate status parameter values
- Use pre-sanitized branch throughout script
- Addresses high-severity security issue from PR review

* fix: Add null checks and logging to workflow condition

- Add explicit null checks for head_repository and repository
- Add debug logging to help diagnose workflow trigger issues
- Prevents potential failures from undefined repository objects
- Addresses medium-severity issue from PR review

* fix: Pin wrangler to major version 4 with error handling

- Pin wrangler to major version 4 (^4.0.0) for stability
- Add error handling if wrangler installation fails
- Return 'failed' status if installation fails
- Addresses dependency management issue from PR review

* perf: Implement parallel deployments to reduce CI time

- Deploy all browser reports in parallel using background processes
- Use temporary directory to collect deployment results
- Wait for all deployments to complete before generating comment
- Maintains result order for consistent output
- Significantly reduces deployment time from sequential to parallel execution

* fix: Use specific comment ID for updates instead of edit-last

- Use GitHub API to find exact comment ID
- Update specific comment by ID to avoid editing wrong comment
- Prevents race conditions if user posts between finding and editing
- More reliable comment updates

* fix(workflows/test-ui.yaml): change condition to always run deploy job for pull requests to ensure deployment consistency

* fix(workflows/test-ui.yaml): change condition to always run deploy job for pull requests to ensure deployment consistency

* fix(pr-playwright-deploy-and-comment.sh): remove npx prefix from wrangler command for consistency and simplicity

* fix(pr-playwright-deploy-and-comment.sh): remove npx prefix from wrangler command for consistency and simplicity

* Update scripts/cicd/pr-playwright-deploy-and-comment.sh

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix(pr-playwright-deploy-and-comment.sh): improve regex for URL extraction to include valid characters and ensure correct URL format

* chore(pr-playwright-deploy-and-comment.sh): move wrangler installation to the beginning of the script to avoid redundancy and improve efficiency

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-09-08 23:11:26 -07:00
snomiao
ea917ba720 fix: Remove ComfyPageNoUser fixture and revert to standard fixture
The NoUser fixture doesn't work properly in CI. Tests will handle user creation properly with the standard fixture.
2025-09-02 05:03:21 +00:00
snomiao
4c2715e480 refactor: Replace script-based litegraph preprocessing with integrated Playwright setup
- Remove prebuild-litegraph.js and restore-litegraph.js scripts
- Add i18nSetup.ts module for litegraph TypeScript 'declare' keyword preprocessing
- Create ComfyPageNoUser fixture to avoid user creation conflicts in i18n tests
- Update playwright.i18n.config.ts to use integrated setup/teardown
- Simplify collect-i18n command to just run Playwright tests
- Ensure pnpm collect-i18n works correctly

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-02 03:33:16 +00:00
snomiao
5bc50500fd fix: Fix Playwright i18n collection by handling TypeScript declare fields in litegraph
- Add prebuild script that temporarily removes 'declare' keyword from litegraph TypeScript files
- Add restore script to revert files to original state after i18n collection
- Update collect-i18n script to use prebuild/restore workflow
- Add babel dependencies for TypeScript transformation
- Update playwright.i18n.config.ts with global setup/teardown

This fix addresses an issue where Playwright's Babel transformation couldn't handle TypeScript 'declare' fields in litegraph classes, causing the i18n collection to fail.

Fixes the issue where 'pnpm collect-i18n' would fail with:
"TypeScript 'declare' fields must first be transformed by @babel/plugin-transform-typescript"
2025-09-01 23:21:01 +00:00
Benjamin Lu
7f849e9a44 Update remaining @comfyorg/litegraph references 2025-08-04 10:16:24 -04:00
Christian Byrne
eb63b5c536 [feat] Add Traditional Chinese language support (#4410)
Co-authored-by: github-actions <github-actions@github.com>
2025-07-10 01:52:47 -07:00
Christian Byrne
22c70d5d1b [fix] use getter functions for sidebar tab command labels to resolve i18n collection issues (#4370)
Co-authored-by: github-actions <github-actions@github.com>
2025-07-08 23:50:49 -07:00
Christian Byrne
7befec5b17 Add unused i18n keys detection to pre-commit hook (#4328) 2025-07-03 10:53:56 -07:00
filtered
a5729c9e06 Revert "[fix] Automatically fix malformed node def translations" (#4045) 2025-06-02 05:37:30 +10:00
Christian Byrne
ec4ced26e7 [fix] Automatically fix malformed node def translations (#4042) 2025-06-01 06:45:40 -07:00
Christian Byrne
2daa51421c Remove fetch-templates script (#3500) 2025-04-18 20:34:03 -04:00
Chenlei Hu
bde518fa13 [CI] Update i18n-node-defs GH action (#3047) 2025-03-14 12:08:08 -04:00
Chenlei Hu
680268bb29 Generate json schema for node def (#2862) 2025-03-04 17:40:26 -05:00
Chenlei Hu
30c750f787 [i18n] Ignore devtools nodes for i18n (#2835) 2025-03-03 16:57:52 -05:00
Chenlei Hu
b30aac6f98 [CI] Use gh action to update electron types (#2811) 2025-03-02 17:15:16 -05:00
Chenlei Hu
fd4263065b [CI] Use gh action to bump version (#2810) 2025-03-02 17:10:30 -05:00
Chenlei Hu
5b2b3cdacf [CI] Use gh action to update litegraph (#2808) 2025-03-02 16:57:30 -05:00
Chenlei Hu
e6a583e11b [Cleanup] Remove deploy script (#2806) 2025-03-02 15:36:54 -05:00
Chenlei Hu
9431c955a6 [CI] Include workflow templates at build time (#2775) 2025-03-02 15:22:18 -05:00
bymyself
76818b54e6 Fix widget label extraction (#2737) 2025-02-26 13:44:05 -05:00
bymyself
e7420fe2e3 Translate runtime-generated widget labels (#2688) 2025-02-23 10:16:25 -05:00
bymyself
365fd1e047 Fix error translating legacy setting options (#2648) 2025-02-20 10:12:46 -05:00
Chenlei Hu
150b4341b2 Update litegraph 0.8.77 (#2530) 2025-02-12 11:11:05 -05:00
Chenlei Hu
d7a0ee8703 Update litegraph 0.8.76 (#2496)
Co-authored-by: github-actions <github-actions@github.com>
2025-02-10 15:30:46 -05:00
filtered
78f43b1e06 [Desktop] Add electron types update script (#2290) 2025-01-19 14:16:27 -05:00
Chenlei Hu
1d02cd3c47 [Docs] Extract comfy workflow zod schema as json schema (#2206) 2025-01-09 11:30:47 -05:00
Chenlei Hu
549a2fdc92 Remove main_repo_release.py (#2147) 2025-01-06 17:01:41 -05:00
Chenlei Hu
e82d795ff9 Trigger node def locale update manually (#2170) 2025-01-06 10:54:59 -05:00
Chenlei Hu
d8f074fea0 [Lint] Sort imports (#2104) 2024-12-30 17:26:37 -05:00
Chenlei Hu
f1eee96ebc Ignore hidden settings for translation (#2050)
Co-authored-by: github-actions <github-actions@github.com>
2024-12-25 21:26:52 -05:00
Chenlei Hu
569a131624 [i18n] Add gihtub action to translate custom nodes (#1987) 2024-12-18 17:04:35 -08:00
Chenlei Hu
b1d02c6a7b [i18n] Split settings locale to separate json files (#1986)
Co-authored-by: github-actions <github-actions@github.com>
2024-12-18 14:57:05 -08:00
Chenlei Hu
4997d13219 [i18n] Add commands label translation (#1890)
* [i18n] Add commands label translation

* Use translation
2024-12-12 09:28:47 -08:00
Chenlei Hu
c60645d9f4 [i18n] Translate node input label (#1880) 2024-12-11 14:57:49 -08:00
Chenlei Hu
a39c04d56e [i18n] Split nodeDefs translations to a separate json file (#1878)
* [i18n] Split nodeDefs translations to a separate json file

* build locale
2024-12-11 11:51:54 -08:00
Chenlei Hu
0c511d08e6 [i18n] Use folder mode for locale (#1876)
* [i18n] Use folder mode for locale

* try pipe
2024-12-11 11:29:52 -08:00
Chenlei Hu
ac6130a556 [i18n] Translate node input/output label and tooltip (#1860)
* [i18n] Translate node input/output labels

* nit

* Impl actual translation

* Remove outputs where name is the type

* Pick outputs key

* Translate outputs

* Properly persist label

* Translate input tooltips

* Translate single node

* Translate first node

* Translate 10 nodes

* Exclude input name translation

* Update test expectations [skip ci]

* nit

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-12-10 17:08:45 -08:00
Chenlei Hu
86797d2492 [i18n] Collect node data types (#1859)
* [i18n] Collect node data types

* nit

* Update locales [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-12-10 11:29:54 -08:00
Chenlei Hu
112a693f3d [i18n] Translate setting options (#1858)
* Collect options

* Translate setting options

* Update locales [skip ci]

* Normalize key

* Revert change of logic

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-12-10 09:31:13 -08:00
Chenlei Hu
a76159e9a0 [i18n] Translate node categories (#1842)
* [i18n] Translate node categories

* nit

* Update locales [skip ci]

* Fix some translations

* Do translate

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-12-07 21:25:40 -05:00
Chenlei Hu
517ae56763 Translate node title and description (#1822)
* Collect node def i18n

* Add collected en locale

* Sort by node id

* Add translations

* Show translated node def

* Update locales [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-12-06 16:56:54 -05:00
Chenlei Hu
dac2a2ec86 [Electron] Translate server config panel (#1817)
* Update i18 collection to include server config items

* Use translation

* Update locales [skip ci]

* nit

---------

Co-authored-by: github-actions <github-actions@github.com>
2024-12-05 19:56:51 -05:00
Chenlei Hu
5206939c78 Translate setting categories (#1797)
* Add i18n for setting categories

* Update locales

* Translate about

* nit

* nit
2024-12-04 16:32:28 -05:00
Chenlei Hu
d04cc4e272 Translate dynamically added settings (#1794)
* Collect settings i18n at runtime

* Translation

* Remove unused file
2024-12-04 13:51:37 -05:00
Chenlei Hu
7986aebf27 Translate command label on top command dropdown menu (#1792)
* collect i18n with playwright

* Add command label translation

* Normalize i18n object key
2024-12-04 13:19:53 -05:00
Chenlei Hu
1856479de9 Translate topbar command menu (#1784)
* Rename script

* Translate menu labels

* Update translations

* Display translated menu items
2024-12-03 22:51:15 -05:00
Chenlei Hu
d953b8fa46 Merge core settings with existing translations (#1782) 2024-12-03 22:04:19 -05:00