GeezerVison is showing github.com — Fix missing comma in @_expose attribute for SwiftSyntax602 (#555) · tayloraswift/JavaScriptKit@36d4c73
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/test.yml +27Lines changed: 27 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
67 | 67 | - run: swift test --package-path ./Plugins/PackageToJS |
68 | 68 | - run: swift test --package-path ./Plugins/BridgeJS |
69 | 69 |
|
| 70 | + test-bridgejs-against-swift-versions: |
| 71 | + name: Test BridgeJS against Swift versions |
| 72 | + strategy: |
| 73 | + matrix: |
| 74 | + entry: |
| 75 | + - image: "swift:6.1.2" |
| 76 | + swift-syntax-version: "601.0.0" |
| 77 | + - image: "swift:6.2" |
| 78 | + swift-syntax-version: "602.0.0" |
| 79 | + runs-on: ubuntu-latest |
| 80 | + container: |
| 81 | + image: ${{ matrix.entry.image }} |
| 82 | + steps: |
| 83 | + - uses: actions/checkout@v6 |
| 84 | + - name: Setup Node.js |
| 85 | + uses: actions/setup-node@v4 |
| 86 | + with: |
| 87 | + node-version: '20' |
| 88 | + - name: Install TypeScript |
| 89 | + run: npm install --prefix Plugins/BridgeJS/Sources/TS2Swift/JavaScript |
| 90 | + - name: Run BridgeJS tests |
| 91 | + # NOTE: Seems like the prebuilt SwiftSyntax binaries are not compatible with |
| 92 | + # non-macro dependents, so disable experimental prebuilts for now. |
| 93 | + run: swift test --disable-experimental-prebuilts --package-path ./Plugins/BridgeJS |
| 94 | + env: |
| 95 | + BRIDGEJS_OVERRIDE_SWIFT_SYNTAX_VERSION: ${{ matrix.entry.swift-syntax-version }} |
| 96 | + |
70 | 97 | native-build: |
71 | 98 | # Check native build to make it easy to develop applications by Xcode |
72 | 99 | name: Build for native target |
|
Collapse file
Copy file name to clipboardExpand all lines: Plugins/BridgeJS/Package.swift +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
3 | 3 | import CompilerPluginSupport |
4 | 4 | import PackageDescription |
5 | 5 |
|
| 6 | +let swiftSyntaxVersion = Context.environment["BRIDGEJS_OVERRIDE_SWIFT_SYNTAX_VERSION"] ?? "600.0.1" |
| 7 | + |
6 | 8 | let package = Package( |
7 | 9 | name: "BridgeJS", |
8 | 10 | platforms: [.macOS(.v13)], |
9 | 11 | dependencies: [ |
10 | | - .package(url: "https://github.com/swiftlang/swift-syntax", from: "600.0.1"), |
| 12 | + .package(url: "https://github.com/swiftlang/swift-syntax", from: Version(swiftSyntaxVersion)!), |
11 | 13 | // Development dependencies |
12 | 14 | .package(url: "https://github.com/apple/swift-argument-parser", from: "1.7.0"), |
13 | 15 | ], |
|
Collapse file
Copy file name to clipboardExpand all lines: Plugins/BridgeJS/Sources/BridgeJSCore/ImportTS.swift +5-4Lines changed: 5 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -760,10 +760,11 @@ enum SwiftCodePattern { |
760 | 760 | return AttributeListSyntax { |
761 | 761 | #if canImport(SwiftSyntax602) |
762 | 762 | let exposeAttrArgs = AttributeSyntax.Arguments.argumentList( |
763 | | - [ |
764 | | - LabeledExprSyntax(label: nil, expression: DeclReferenceExprSyntax(baseName: "wasm")), |
765 | | - LabeledExprSyntax(label: nil, expression: StringLiteralExprSyntax(content: abiName)), |
766 | | - ] |
| 763 | + LabeledExprListSyntax { |
| 764 | + LabeledExprSyntax(label: nil, expression: DeclReferenceExprSyntax(baseName: "wasm")) |
| 765 | + .with(\.trailingComma, .commaToken()) |
| 766 | + LabeledExprSyntax(label: nil, expression: StringLiteralExprSyntax(content: abiName)) |
| 767 | + } |
767 | 768 | ) |
768 | 769 | let cdeclAttrArgs = AttributeSyntax.Arguments.argumentList( |
769 | 770 | [ |
|