You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,12 +60,24 @@ Tests for `BridgeJS` plugin:
60
60
swift test --package-path ./Plugins/BridgeJS
61
61
```
62
62
63
+
This runs both the TS2Swift Vitest suite (TypeScript `.d.ts` -> Swift macro output) and the Swift codegen/link tests. For fast iteration on the ts2swift tool only, run Vitest directly:
64
+
65
+
```bash
66
+
cd Plugins/BridgeJS/Sources/TS2Swift/JavaScript && npm test
67
+
```
68
+
63
69
To update snapshot test files when expected output changes:
64
70
65
71
```bash
66
72
UPDATE_SNAPSHOTS=1 swift test --package-path ./Plugins/BridgeJS
67
73
```
68
74
75
+
When you change ts2swift behavior, update Vitest snapshots (e.g. `npx vitest run --update`in`Sources/TS2Swift/JavaScript`) and regenerate the macro Swift fixtures used by Swift tests (writes `Tests/BridgeJSToolTests/Inputs/MacroSwift/` from `Inputs/TypeScript/*.d.ts`):
76
+
77
+
```bash
78
+
cd Plugins/BridgeJS/Sources/TS2Swift/JavaScript && npm run generate-macro-fixtures
79
+
```
80
+
69
81
### Editing `./Runtime` directory
70
82
71
83
The `./Runtime` directory contains the JavaScript runtime that interacts with the JavaScript environment and Swift code.
@@ -163,6 +163,12 @@ Return values use direct Wasm returns for primitives, and imported intrinsic fun
163
163
164
164
For detailed semantics, see the [How It Works sections](https://swiftpackageindex.com/swiftwasm/JavaScriptKit/documentation/javascriptkit/exporting-swift-class#How-It-Works) in the user documentation.
0 commit comments