Skip to content

Commit ac39227

Browse files
Add SwiftToSkeleton unified Swift-to-skeleton API
Now ExportSwift/ImportTS are not responsible for collecting macro-annotated decls and produce skeletons.
1 parent 040054f commit ac39227

File tree

10 files changed

+2418
-2494
lines changed

10 files changed

+2418
-2494
lines changed

Plugins/BridgeJS/Sources/BridgeJSCore/ExportSwift.swift

Lines changed: 20 additions & 1662 deletions
Large diffs are not rendered by default.

Plugins/BridgeJS/Sources/BridgeJSCore/ImportSwiftMacros.swift

Lines changed: 0 additions & 710 deletions
This file was deleted.

Plugins/BridgeJS/Sources/BridgeJSCore/ImportTS.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,10 @@ public struct ImportTS {
2121
public private(set) var skeleton: ImportedModuleSkeleton
2222
private let moduleName: String
2323

24-
public init(progress: ProgressReporting, moduleName: String) {
24+
public init(progress: ProgressReporting, moduleName: String, skeleton: ImportedModuleSkeleton) {
2525
self.progress = progress
2626
self.moduleName = moduleName
27-
self.skeleton = ImportedModuleSkeleton(children: [])
28-
}
29-
30-
/// Adds a skeleton to the importer's state
31-
public mutating func addSkeleton(_ skeleton: ImportedFileSkeleton) {
32-
self.skeleton.children.append(skeleton)
27+
self.skeleton = skeleton
3328
}
3429

3530
/// Finalizes the import process and generates Swift code

0 commit comments

Comments
 (0)