Skip to content

BridgeJS: Add CI job to check BridgeJS generated files are up-to-date #408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@ jobs:
echo "::error::The formatting changed some files. Please run \`./Utilities/format.swift\` and commit the changes."
exit 1
}

check-bridgejs-generated:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/install-swift
with:
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
- run: make bootstrap
- run: ./Utilities/bridge-js-generate.sh
- name: Check if BridgeJS generated files are up-to-date
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
git diff --exit-code || {
echo "::error::BridgeJS generated files are out of date. Please run \`./Utilities/bridge-js-generate.sh\` and commit the changes."
exit 1
}

build-examples:
runs-on: ubuntu-latest
steps:
Expand Down
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,24 @@ To make changes to the runtime, you need to edit the TypeScript files and regene
make regenerate_swiftpm_resources
```

### Working with BridgeJS

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.

To update these pre-generated files, use the utility script:

```bash
./Utilities/bridge-js-generate.sh
```

This script runs the BridgeJS plugin in AoT mode (`swift package bridge-js`) on several SwiftPM packages in this repository.

Run this script when you've made changes to:
- TypeScript definitions
- BridgeJS configuration
- BridgeJS code generator itself

These changes require updating the pre-generated Swift bindings committed to the repository.

## Support
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).