Skip to content

Commit bb116ae

Browse files
committed
BridgeJS: Check generated TypeScript validity in test suites
1 parent 60b9444 commit bb116ae

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ jobs:
6969
git diff --exit-code Sources/JavaScriptKit/Runtime
7070
- run: swift test --package-path ./Plugins/PackageToJS
7171
- run: swift test --package-path ./Plugins/BridgeJS
72+
- name: Validate BridgeJS TypeScript declarations
73+
run: npm run check:bridgejs-dts
7274

7375
test-bridgejs-against-swift-versions:
7476
name: Test BridgeJS against Swift versions
@@ -90,6 +92,8 @@ jobs:
9092
node-version: '20'
9193
- name: Install TypeScript
9294
run: npm install
95+
- name: Validate BridgeJS TypeScript declarations
96+
run: npm run check:bridgejs-dts
9397
- name: Run BridgeJS tests
9498
# NOTE: Seems like the prebuilt SwiftSyntax binaries are not compatible with
9599
# non-macro dependents, so disable experimental prebuilts for now.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"compilerOptions": {
3+
"strict": true,
4+
"noEmit": true,
5+
"skipLibCheck": false,
6+
"target": "ES2020",
7+
"module": "ES2020",
8+
"moduleResolution": "node",
9+
"lib": ["ES2020", "DOM"]
10+
},
11+
"include": ["*.d.ts"]
12+
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"build:clean": "rm -rf Runtime/lib",
1414
"build:ts": "cd Runtime; rollup -c",
1515
"prepublishOnly": "npm run build",
16-
"format": "prettier --write Runtime/src"
16+
"format": "prettier --write Runtime/src",
17+
"check:bridgejs-dts": "tsc --project Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests/tsconfig.json"
1718
},
1819
"keywords": [
1920
"Swift",

0 commit comments

Comments
 (0)