Skip to content

Commit cc50be3

Browse files
Merge pull request #408 from swiftwasm/yt/bridge-js-aot-gen-check-ci
2 parents 42ddc65 + 223673e commit cc50be3

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,24 @@ jobs:
8888
echo "::error::The formatting changed some files. Please run \`./Utilities/format.swift\` and commit the changes."
8989
exit 1
9090
}
91+
92+
check-bridgejs-generated:
93+
runs-on: ubuntu-22.04
94+
steps:
95+
- uses: actions/checkout@v5
96+
- uses: ./.github/actions/install-swift
97+
with:
98+
download-url: https://download.swift.org/development/ubuntu2204/swift-DEVELOPMENT-SNAPSHOT-2025-06-12-a/swift-DEVELOPMENT-SNAPSHOT-2025-06-12-a-ubuntu22.04.tar.gz
99+
- run: make bootstrap
100+
- run: ./Utilities/bridge-js-generate.sh
101+
- name: Check if BridgeJS generated files are up-to-date
102+
run: |
103+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
104+
git diff --exit-code || {
105+
echo "::error::BridgeJS generated files are out of date. Please run \`./Utilities/bridge-js-generate.sh\` and commit the changes."
106+
exit 1
107+
}
108+
91109
build-examples:
92110
runs-on: ubuntu-latest
93111
steps:

CONTRIBUTING.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,24 @@ To make changes to the runtime, you need to edit the TypeScript files and regene
8181
make regenerate_swiftpm_resources
8282
```
8383

84+
### Working with BridgeJS
85+
86+
BridgeJS is a Swift Package Manager plugin that automatically generates Swift bindings from TypeScript definitions. This repository contains pre-generated files created by BridgeJS in AoT (Ahead of Time) mode that are checked into version control.
87+
88+
To update these pre-generated files, use the utility script:
89+
90+
```bash
91+
./Utilities/bridge-js-generate.sh
92+
```
93+
94+
This script runs the BridgeJS plugin in AoT mode (`swift package bridge-js`) on several SwiftPM packages in this repository.
95+
96+
Run this script when you've made changes to:
97+
- TypeScript definitions
98+
- BridgeJS configuration
99+
- BridgeJS code generator itself
100+
101+
These changes require updating the pre-generated Swift bindings committed to the repository.
102+
84103
## Support
85104
If you have any questions or need assistance, feel free to reach out via [GitHub Issues](https://github.com/swiftwasm/JavaScriptKit/issues) or [Discord](https://discord.gg/ashJW8T8yp).

0 commit comments

Comments
 (0)