diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2766d6ef..e6da32aa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f71ca83a..f3cdb46c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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).