Skip to content

Fix: Ensure BridgeJS.Macros.swift is processed by SwiftToSkeleton #556

Merged
kateinoigakukun merged 1 commit intomainfrom
fix_bridgegsMacrosProcessing
Feb 3, 2026
Merged

Fix: Ensure BridgeJS.Macros.swift is processed by SwiftToSkeleton #556
kateinoigakukun merged 1 commit intomainfrom
fix_bridgegsMacrosProcessing

Conversation

@fjtrujy
Copy link
Contributor

@fjtrujy fjtrujy commented Feb 2, 2026

Description

When using TypeScript declarations (.d.ts files) with BridgeJS, the generated BridgeJS.Macros.swift file containing @JSFunction, @JSClass, @JSGetter, and @JSSetter declarations was not being processed by SwiftToSkeleton.

This meant that:

  • Imported TypeScript APIs were missing from the BridgeJS.json skeleton
  • No JavaScript glue code was generated for these imports
  • The imports were unusable at runtime

Root Cause

The BridgeJSCommandPlugin filters out files from the Generated/ directory when passing input files to BridgeJSTool:

  target.sourceFiles.filter {
      !$0.url.path.hasPrefix(generatedDirectory.path + "/")
  }

Since BridgeJS.Macros.swift is generated into the Generated/ directory, it was never included in the list of files to process, even though it contains important type information that SwiftToSkeleton needs to build the imported skeleton.

Solution

After generating BridgeJS.Macros.swift from TypeScript definitions, explicitly add it to the inputFiles array before processing with SwiftToSkeleton

@fjtrujy fjtrujy changed the title Fix: Ensure BridgeJS.Macros.swift is processed by SwiftToSkeleton Fix: Ensure BridgeJS.Macros.swift is processed by SwiftToSkeleton Feb 2, 2026
@fjtrujy fjtrujy force-pushed the fix_bridgegsMacrosProcessing branch from ba47474 to e882a22 Compare February 2, 2026 17:52
@fjtrujy fjtrujy force-pushed the fix_bridgegsMacrosProcessing branch from e882a22 to 2b29076 Compare February 2, 2026 18:04
@fjtrujy fjtrujy marked this pull request as ready for review February 2, 2026 18:20
Copy link
Member

@kateinoigakukun kateinoigakukun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kateinoigakukun kateinoigakukun merged commit d4c16e4 into main Feb 3, 2026
9 checks passed
@kateinoigakukun kateinoigakukun deleted the fix_bridgegsMacrosProcessing branch February 3, 2026 00:24
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.

2 participants