From 68cf801ad57b015357701748d466980725c4418e Mon Sep 17 00:00:00 2001 From: oboard Date: Fri, 21 Aug 2026 14:21:58 +0800 Subject: [PATCH 1/2] fix: declare js+native supported targets to reject wasm consumers The package still selected mocket.wasm.mbt and serve.mbt for wasm/wasm-gc, so Mocket::listen type-checked for those targets and then trapped at runtime in the panic stubs. Declare supported_targets at the package boundary so wasm/wasm-gc consumers are rejected at build/check time, matching the README. Also declare supported_targets on the cors and static_file sub-packages, which depend on mocket and are likewise js+native only. Co-Authored-By: Claude Fable 5 --- cors/moon.pkg | 2 ++ moon.pkg | 2 ++ static_file/moon.pkg | 2 ++ 3 files changed, 6 insertions(+) diff --git a/cors/moon.pkg b/cors/moon.pkg index 738b150..16167c0 100644 --- a/cors/moon.pkg +++ b/cors/moon.pkg @@ -5,3 +5,5 @@ import { // Suppress warning 20 from MoonBit's generated native test driver. warnings = "-20" + +supported_targets = "+js+native" diff --git a/moon.pkg b/moon.pkg index f910147..aba3d8f 100644 --- a/moon.pkg +++ b/moon.pkg @@ -22,6 +22,8 @@ import { warnings = "-15-29" +supported_targets = "+js+native" + options( expose: [ "__ws_emit_js", diff --git a/static_file/moon.pkg b/static_file/moon.pkg index f763feb..0823313 100644 --- a/static_file/moon.pkg +++ b/static_file/moon.pkg @@ -6,3 +6,5 @@ import { // Suppress warning 20 from MoonBit's generated native test driver. warnings = "-20" + +supported_targets = "+js+native" From 303953b0f75ab96de4e8d5852ff8f45a527adfde Mon Sep 17 00:00:00 2001 From: oboard Date: Fri, 21 Aug 2026 14:24:48 +0800 Subject: [PATCH 2/2] Update check.yaml --- .github/workflows/check.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 41539ba..4bb23fa 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest continue-on-error: false steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: submodules: 'recursive' @@ -50,4 +50,4 @@ jobs: - name: moon test run: | - moon test --target js,native \ No newline at end of file + moon test --target js,native