Skip to content

Conversation

snomiao
Copy link
Member

@snomiao snomiao commented Sep 12, 2025

Summary

  • Fixes babel configuration for Playwright tests to handle TypeScript declare fields
  • Adds module resolution for the @ alias
  • Implements Vue/CSS file stubbing to prevent parsing errors during test runs

Changes

  • Added babel.config.json with TypeScript preset configured with allowDeclareFields: true
  • Created custom babel plugin babel-plugin-stub-vue-imports to stub Vue and CSS imports
  • Added browser globals polyfill using happy-dom in scripts/setup-browser-globals.js
  • Updated playwright.i18n.config.ts with babel plugins configuration
  • Installed necessary babel dependencies (@babel/core, @babel/preset-typescript, etc.)

Test plan

  • Run pnpm collect-i18n - babel transformations now work correctly
  • The tests still require a ComfyUI backend to fully pass, but the babel configuration issues are resolved

Related Issues

Fixes issues with pnpm collect-i18n failing due to TypeScript declare fields not being properly transformed by babel.

🤖 Generated with Claude Code

┆Issue is synchronized with this Notion page by Unito

…are fields

- Configure babel plugins for TypeScript with allowDeclareFields option
- Add module resolver for @ alias to src directory
- Create custom babel plugin to stub Vue/CSS imports
- Add browser globals polyfill using happy-dom for Node.js context
- Update playwright.i18n.config.ts with babel configuration

This enables collect-i18n tests to run with proper TypeScript and module transformations.
Copy link

github-actions bot commented Sep 12, 2025

🎭 Playwright Test Results

Tests completed successfully!

⏰ Completed at: 09/12/2025, 08:57:37 AM UTC

📊 Test Reports by Browser


🎉 Click on the links above to view detailed test results for each browser configuration.

Copy link

socket-security bot commented Sep 12, 2025

Copy link

socket-security bot commented Sep 12, 2025

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn Critical
[email protected] has a Critical CVE.

CVE: GHSA-67hx-6x53-jw92 Babel vulnerable to arbitrary code execution when compiling specifically crafted malicious code (CRITICAL)

Affected versions: >= 0

Patched version: No patched versions

From: pnpm-lock.yamlnpm/[email protected]npm/[email protected]

ℹ Read more on: This package | This alert | What is a critical CVE?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Remove or replace dependencies that include known critical CVEs. Consumers can use dependency overrides or npm audit fix --force to remove vulnerable dependencies.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

…lity

- Renamed babel-plugin-stub-vue-imports.js to .cjs extension
- Changed from ES module exports to CommonJS module.exports
- Updated playwright.i18n.config.ts to use correct file path with __dirname
- Added import.meta.url handling for ES module compatibility

This fixes the module resolution errors when running pnpm collect-i18n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant