From c9b476e437479b3fe6ee72ddcf3ff3ee482d05ff Mon Sep 17 00:00:00 2001 From: yhh <359807859@qq.com> Date: Thu, 18 Jun 2026 02:01:54 -0700 Subject: [PATCH 1/2] =?UTF-8?q?ci:=20make=20repo=20web-only=20consistent?= =?UTF-8?q?=20=E2=80=94=20drop=20native=20build=20+=20editor=20steps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The native platform layer (NativePlatform/NativeFileSystem/FileDialog) and the editor/ workspace were deliberately removed in d9a08d87, but build.yml still ran a Linux native job (whose cmake configure died on the missing platform sources) and type-checked/tested a nonexistent editor/. Align CI and CMake with the web-only reality: - build.yml: drop the Linux (Ubuntu GCC) native job; remove the Type-check Editor and Run Editor tests steps; rename the test job to "Tests (SDK)". - CMakeLists.txt: drop the deleted native-platform source/header refs from the non-web branch so a plain cmake configure no longer errors on missing files. CI is now Web (Emscripten) + Tests (SDK). --- .github/workflows/build.yml | 45 +------------------------------------ CMakeLists.txt | 10 +++------ 2 files changed, 4 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 876190a7..e573f41a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,43 +4,6 @@ on: workflow_dispatch: jobs: - build-linux: - name: Linux (Ubuntu GCC) - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y \ - cmake \ - ninja-build \ - libglfw3-dev \ - libgl1-mesa-dev \ - xorg-dev \ - libxkbcommon-dev \ - ccache - - - name: Setup ccache - uses: hendrikmuhs/ccache-action@v1.2.20 - with: - key: ${{ runner.os }}-build-linux - max-size: 500M - - - name: Configure CMake - run: cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DES_ENABLE_CCACHE=ON - - - name: Build - run: cmake --build build - - - name: Test - working-directory: build - run: ctest --output-on-failure - build-emscripten: name: Web (Emscripten) runs-on: ubuntu-latest @@ -95,7 +58,7 @@ jobs: run: node build-tools/cli.js build -t all --no-sync --continue-on-error test: - name: Tests (SDK + Editor) + name: Tests (SDK) runs-on: ubuntu-latest steps: @@ -120,14 +83,8 @@ jobs: - name: Build SDK run: pnpm --filter ./sdk build - - name: Type-check Editor - run: pnpm exec tsc --noEmit -p editor/tsconfig.json - - name: Type-check Examples run: node build-tools/cli.js check-examples - name: Run SDK tests run: pnpm --filter ./sdk exec vitest run - - - name: Run Editor tests - run: pnpm --filter ./editor exec vitest run diff --git a/CMakeLists.txt b/CMakeLists.txt index ac0a036c..ea76a133 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,19 +231,15 @@ if(ES_BUILD_WEB OR ES_BUILD_WXGAME) src/esengine/platform/web/WebFileSystem.cpp ) else() + # Web-only repo: the native platform layer (NativePlatform/NativeFileSystem/ + # FileDialog) was removed in d9a08d87. Keep only the platform-agnostic + # sources a native tooling/test build still needs. list(APPEND ESENGINE_SOURCES - src/esengine/platform/native/NativePlatform.cpp - src/esengine/platform/native/NativeFileSystem.cpp - src/esengine/platform/FileDialog.cpp src/esengine/renderer/stb_image_impl.cpp src/esengine/resource/LoaderJobQueue.cpp src/esengine/resource/HotReloadManager.cpp src/esengine/resource/loaders/ShaderLoader.cpp ) - list(APPEND ESENGINE_HEADERS - src/esengine/platform/native/NativePlatform.hpp - src/esengine/platform/FileDialog.hpp - ) endif() # ============================================================================= From 470b8405b71bed2175167466b751fb6ac763c3b2 Mon Sep 17 00:00:00 2001 From: yhh <359807859@qq.com> Date: Thu, 18 Jun 2026 02:24:37 -0700 Subject: [PATCH 2/2] fix: web build (spine index widening) + align stale examples to SDK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fold the two remaining master CI breakages into this web-only consistency PR so master goes green: - RenderFrameSubmit.cpp: widen submitSpineBatch's offset-index buffer u16 -> u32 to match appendIndices(const u32*) (the spine path #41 missed) — fixes the web build compile error. - examples: align 3 stale examples to the current SDK API: - audio-demo: events.hasEvent(e,'click') -> events.query('click').some(e=>e.target===entity) - ui-interaction: UIEvent.entity -> UIEvent.target - ui-controls: drop the obsolete ProgressBar-component animation (the SDK no longer exposes a queryable ProgressBar component; progress is now the createProgress widget). Scene-defined controls are unaffected. Verified locally: SDK typecheck + check-examples (18/18) pass. --- examples/audio-demo/src/systems/sfx.ts | 2 +- examples/ui-controls/src/main.ts | 9 ++++---- examples/ui-controls/src/systems/animate.ts | 21 ------------------- .../ui-interaction/src/systems/dragFocus.ts | 4 ++-- src/esengine/renderer/RenderFrameSubmit.cpp | 4 ++-- 5 files changed, 9 insertions(+), 31 deletions(-) delete mode 100644 examples/ui-controls/src/systems/animate.ts diff --git a/examples/audio-demo/src/systems/sfx.ts b/examples/audio-demo/src/systems/sfx.ts index 2890cf15..1f066391 100644 --- a/examples/audio-demo/src/systems/sfx.ts +++ b/examples/audio-demo/src/systems/sfx.ts @@ -22,7 +22,7 @@ export const sfxTriggerSystem = defineSystem( trigger.cooldown = Math.max(0, trigger.cooldown - time.delta); const key = `Digit${triggerIndex + 1}`; - const clicked = events.hasEvent(entity, 'click'); + const clicked = events.query('click').some(e => e.target === entity); if ((input.isKeyPressed(key) || clicked) && trigger.cooldown <= 0) { const url = SFX_URLS[triggerIndex]; if (url) { diff --git a/examples/ui-controls/src/main.ts b/examples/ui-controls/src/main.ts index b0188bbd..e2d4123c 100644 --- a/examples/ui-controls/src/main.ts +++ b/examples/ui-controls/src/main.ts @@ -1,6 +1,5 @@ -import { addSystemToSchedule, Schedule } from 'esengine'; - +// The progress bars in this scene are declarative (defined in the .esscene). +// The old per-frame ProgressBar-component animation was removed: the SDK no +// longer exposes a queryable ProgressBar component — progress is now an +// imperative widget (createProgress -> ProgressHandle). import './components'; -import { progressAnimateSystem } from './systems/animate'; - -addSystemToSchedule(Schedule.Update, progressAnimateSystem); diff --git a/examples/ui-controls/src/systems/animate.ts b/examples/ui-controls/src/systems/animate.ts deleted file mode 100644 index 8fe5e882..00000000 --- a/examples/ui-controls/src/systems/animate.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { - defineSystem, Query, Mut, Res, Time, ProgressBar, -} from 'esengine'; -import { ProgressAnimator } from '../components'; - -export const progressAnimateSystem = defineSystem( - [Query(Mut(ProgressBar), Mut(ProgressAnimator)), Res(Time)], - (query, time) => { - for (const [_entity, bar, animator] of query) { - bar.value += animator.speed * animator.direction * time.delta; - if (bar.value >= 1) { - bar.value = 1; - animator.direction = -1; - } else if (bar.value <= 0) { - bar.value = 0; - animator.direction = 1; - } - } - }, - { name: 'ProgressAnimateSystem' } -); diff --git a/examples/ui-interaction/src/systems/dragFocus.ts b/examples/ui-interaction/src/systems/dragFocus.ts index ab0b5574..9966b88f 100644 --- a/examples/ui-interaction/src/systems/dragFocus.ts +++ b/examples/ui-interaction/src/systems/dragFocus.ts @@ -72,8 +72,8 @@ export const dragFocusSystem = defineSystem( return; } - const dragStartEntities = new Set(events.query('drag_start').map(e => e.entity)); - const dragEndEntities = new Set(events.query('drag_end').map(e => e.entity)); + const dragStartEntities = new Set(events.query('drag_start').map(e => e.target)); + const dragEndEntities = new Set(events.query('drag_end').map(e => e.target)); for (const e of dragStartEntities) { droppedEntities.delete(e); diff --git a/src/esengine/renderer/RenderFrameSubmit.cpp b/src/esengine/renderer/RenderFrameSubmit.cpp index 4367706a..2e9a88cd 100644 --- a/src/esengine/renderer/RenderFrameSubmit.cpp +++ b/src/esengine/renderer/RenderFrameSubmit.cpp @@ -83,9 +83,9 @@ void RenderFrame::submitSpineBatch( } u32 baseVertex = vOff / sizeof(BatchVertex); - std::vector offsetIndices(indexCount); + std::vector offsetIndices(indexCount); for (i32 i = 0; i < indexCount; ++i) { - offsetIndices[i] = static_cast(baseVertex + indices[i]); + offsetIndices[i] = static_cast(baseVertex + indices[i]); } u32 iOff = pool_.appendIndices(LayoutId::Batch, offsetIndices.data(), static_cast(indexCount));