From d50e2e6d70a85fd37c821244731d41e318cdbfc0 Mon Sep 17 00:00:00 2001 From: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> Date: Mon, 1 Jun 2026 14:17:55 +0100 Subject: [PATCH 1/4] =?UTF-8?q?fix(e2e):=20Playwright=20fundamental=20?= =?UTF-8?q?=E2=80=94=20vite=20alias=20+=20ums=20sub-build=20(closes=20idap?= =?UTF-8?q?tik#113)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lands the two-layer fundamental fix described in idaptik#113. With PR #112 having unblocked the outer layers (typo SHA on denoland/setup-deno@v2, missing @playwright/test dep), the dev-server boot inside Playwright's `webServer` then exposed two deeper, pre-existing problems. This PR closes both. ## Layer 1 — vite.config.js `@src/` optimizeDeps.include `optimizeDeps.include` carried two entries with a bare `@src/...` specifier: include: ['@src/app/tea/AffineTEA.js', '@src/app/tea/AffineTEARouter.js'] …but the configured aliases are only `affinescript` and `@tea` — there is no `@src` alias. Vite reported on every dev-server boot: [WebServer] Failed to resolve dependency: @src/app/tea/AffineTEA.js, present in client 'optimizeDeps.include' [WebServer] Failed to resolve dependency: @src/app/tea/AffineTEARouter.js, present in client 'optimizeDeps.include' …and that warning blocked the dev server from settling within Playwright's 60s webServer timeout (the warning isn't fatal but slows the boot enough that Playwright times out). Fix: empty the `include` array. Vite pre-bundles relative-path .js imports automatically as it walks the module graph from the entry HTML; the explicit include was redundant from day one and the wrong specifier shape made it actively harmful. Comment in the config explains the history so future contributors don't re-add a bare-specifier entry. ## Layer 2 — Build idaptik-ums sub-project in CI `idaptik-ums/index.html` imports `src/App.res.mjs` (relative to the HTML) i.e. `idaptik-ums/src/App.res.mjs`. The source file `idaptik-ums/src/App.res` exists but its `.res.mjs` sibling is only created by compiling against `idaptik-ums/rescript.json`, which the existing workflow's `deno task res:build` step never touched (that task compiles the root `rescript.json` only). When the vite dev-server scanned `idaptik-ums/index.html` it reported: [WebServer] src/App.res.mjs (imported by .../idaptik-ums/index.html) [WebServer] Are they installed? Error: Timed out waiting 60000ms from config.webServer. Fix: add a second build step after the root res:build that runs `npx rescript build` inside `idaptik-ums/`. Mirrors the soft-fail pattern of the existing step (`|| echo "ums attempt"`) — the workflow keeps running even if the ums build itself fails, so the existing Playwright-vs-megaport separation is preserved. ## Verification Local: `timeout 15 deno task dev:vite` boots cleanly with the new vite config, no unresolved-dep warnings (PR #112's deno.json @playwright/test import also confirmed downloaded on first run). ## Closes closes hyperpolymath/idaptik#113 Signed-off-by: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> --- .github/workflows/e2e-playwright.yml | 5 ++++- vite.config.js | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e-playwright.yml b/.github/workflows/e2e-playwright.yml index 4977d819..7159876f 100644 --- a/.github/workflows/e2e-playwright.yml +++ b/.github/workflows/e2e-playwright.yml @@ -54,9 +54,12 @@ jobs: - name: Install dependencies run: deno install --node-modules-dir=auto - - name: Build ReScript + - name: Build ReScript (root) run: deno task res:build || echo "ReScript build attempted" + - name: Build ReScript (idaptik-ums sub-project) + run: cd idaptik-ums && npx rescript build || echo "ums ReScript build attempted" + - name: Install Playwright browsers run: npx playwright install --with-deps ${{ matrix.project == 'firefox-1080p' && 'firefox' || matrix.project == 'webkit-1080p' && 'webkit' || 'chromium' }} diff --git a/vite.config.js b/vite.config.js index b7dadd7f..2d5b9612 100644 --- a/vite.config.js +++ b/vite.config.js @@ -89,8 +89,14 @@ export default defineConfig({ }, }, optimizeDeps: { - // Include AffineScript dependencies for proper optimization - include: ['@src/app/tea/AffineTEA.js', '@src/app/tea/AffineTEARouter.js'], + // Allow Vite to discover AffineScript-TEA deps on demand. Listing them + // here with the prior '@src/...' bare-specifier shape failed to resolve + // (no '@src' alias is configured; only 'affinescript' and '@tea' are). + // Vite pre-bundles relative-path .js imports automatically as it walks + // the module graph from the entry HTML, so the explicit include is + // redundant and was the source of the dev-server boot warning that + // tripped the Playwright webServer 60s wait. + include: [], }, define: { APP_VERSION: JSON.stringify(process.env.npm_package_version), From 1428e5cb5cd7dfc6ad5473500c1f79b195b93589 Mon Sep 17 00:00:00 2001 From: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> Date: Mon, 1 Jun 2026 18:33:24 +0100 Subject: [PATCH 2/4] fix(e2e): scope vite optimizeDeps.entries to root index.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Layer 3 of the Playwright fundamental fix. The previous Layer 2 (building idaptik-ums/src/App.res.mjs via a sub-rescript step) ran into a deeper pre-existing bug: idaptik-ums/src/editor/EditorEngine.res contains JS/TS-shaped syntax (typeof checks, ES-style `import * as`) rather than ReScript syntax, so `rescript build` on the sub-project hard-fails at compile. The previous step soft-failed with `|| echo`, which silently swallowed the error and left App.res.mjs unbuilt — which then surfaced as a vite unresolved-import inside Playwright's 60s webServer boot wait. Pivot: idaptik-ums/index.html is a Tauri webview entry, NOT the Playwright SPA entry (Playwright hits '/' which serves the ROOT index.html). Vite's default optimizeDeps scan crawls every .html in the project, which is why it pulled idaptik-ums/index.html in even though the SPA never references it. Scoping `optimizeDeps.entries` to `['index.html']` aligns the scan with the actual SPA boundary. This also drops the broken sub-rescript step (the build wasn't useful for Playwright in the first place — the broken EditorEngine.res bug remains as a separate concern for the idaptik-ums Tauri shell, which should be filed as its own issue). Also adds vite.config.js + idaptik-ums/** to both push and pull_request path filters so the workflow can self-validate when either is modified in a PR. Co-Authored-By: Claude Opus 4.7 (1M context) Signed-off-by: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> --- .github/workflows/e2e-playwright.yml | 10 ++++++---- vite.config.js | 14 +++++++++----- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.github/workflows/e2e-playwright.yml b/.github/workflows/e2e-playwright.yml index 7159876f..7e114f4f 100644 --- a/.github/workflows/e2e-playwright.yml +++ b/.github/workflows/e2e-playwright.yml @@ -13,6 +13,8 @@ on: - 'src/**' - 'shared/**' - 'tools/compat-testing/**' + - 'idaptik-ums/**' + - 'vite.config.js' - '.github/workflows/e2e-playwright.yml' pull_request: branches: [main, master] @@ -20,6 +22,9 @@ on: - 'src/**' - 'shared/**' - 'tools/compat-testing/**' + - 'idaptik-ums/**' + - 'vite.config.js' + - '.github/workflows/e2e-playwright.yml' workflow_dispatch: permissions: read-all @@ -55,10 +60,7 @@ jobs: run: deno install --node-modules-dir=auto - name: Build ReScript (root) - run: deno task res:build || echo "ReScript build attempted" - - - name: Build ReScript (idaptik-ums sub-project) - run: cd idaptik-ums && npx rescript build || echo "ums ReScript build attempted" + run: deno task res:build - name: Install Playwright browsers run: npx playwright install --with-deps ${{ matrix.project == 'firefox-1080p' && 'firefox' || matrix.project == 'webkit-1080p' && 'webkit' || 'chromium' }} diff --git a/vite.config.js b/vite.config.js index 2d5b9612..c4264ab2 100644 --- a/vite.config.js +++ b/vite.config.js @@ -89,14 +89,18 @@ export default defineConfig({ }, }, optimizeDeps: { - // Allow Vite to discover AffineScript-TEA deps on demand. Listing them - // here with the prior '@src/...' bare-specifier shape failed to resolve - // (no '@src' alias is configured; only 'affinescript' and '@tea' are). // Vite pre-bundles relative-path .js imports automatically as it walks // the module graph from the entry HTML, so the explicit include is - // redundant and was the source of the dev-server boot warning that - // tripped the Playwright webServer 60s wait. + // redundant. The prior '@src/...' bare-specifier shape failed to resolve + // (no '@src' alias is configured; only 'affinescript' and '@tea' are). include: [], + // Scope entry discovery to the root index.html only. Vite's default + // crawls every .html in the project, which pulled in idaptik-ums/index.html + // — a separate Tauri webview entry that imports its own (independently + // built) src/App.res.mjs. Playwright tests only exercise the root '/' path, + // so scanning idaptik-ums is wasted work and was previously crashing the + // dev-server boot under the Playwright webServer 60s timeout. + entries: ['index.html'], }, define: { APP_VERSION: JSON.stringify(process.env.npm_package_version), From eab7317e32e4fe7daeb7dc0a2d45212658f125de Mon Sep 17 00:00:00 2001 From: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> Date: Mon, 1 Jun 2026 18:42:46 +0100 Subject: [PATCH 3/4] fix(e2e): align Playwright config port to vite's 1984 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After the optimizeDeps.entries pivot let vite boot cleanly, the 'webServer timed out at 60000ms' kept firing on all three matrices even though no error message appeared. Root cause: vite is configured in vite.config.js with port 1984 + strictPort, but tools/compat-testing/ playwright.config.js polled baseURL http://localhost:8080 / webServer.port 8080. Vite started fine, just on the wrong port — Playwright kept polling 8080 until the deadline. Aligning both Playwright endpoints to 1984. Co-Authored-By: Claude Opus 4.7 (1M context) Signed-off-by: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> --- tools/compat-testing/playwright.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/compat-testing/playwright.config.js b/tools/compat-testing/playwright.config.js index 05ade3f1..0e681531 100644 --- a/tools/compat-testing/playwright.config.js +++ b/tools/compat-testing/playwright.config.js @@ -19,7 +19,7 @@ export default defineConfig({ // Shared settings applied to every project unless overridden. use: { - baseURL: 'http://localhost:8080', + baseURL: 'http://localhost:1984', trace: 'on-first-retry', screenshot: 'only-on-failure', }, @@ -74,7 +74,7 @@ export default defineConfig({ webServer: { command: 'deno task dev:vite', - port: 8080, + port: 1984, reuseExistingServer: true, timeout: 60000, }, From afb906a05ef7c8d782b5faad2aa70f6234311ceb Mon Sep 17 00:00:00 2001 From: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> Date: Mon, 1 Jun 2026 18:45:08 +0100 Subject: [PATCH 4/4] fix(e2e): testDir relative to playwright.config.js, not repo root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The workflow's 'Run Playwright tests' step sets working-directory to tools/compat-testing/, then runs 'npx playwright test'. Playwright loads playwright.config.js from that CWD, then resolves testDir relative to the config file location. testDir was './tools/compat-testing/tests', which resolved to 'tools/compat-testing/tools/compat-testing/tests' — a path that doesn't exist. Result: "Error: No tests found" on every matrix. Fixing to './tests' so Playwright discovers tools/compat-testing/tests/{game-loads,accessibility,performance}.spec.js. Co-Authored-By: Claude Opus 4.7 (1M context) Signed-off-by: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> --- tools/compat-testing/playwright.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/compat-testing/playwright.config.js b/tools/compat-testing/playwright.config.js index 0e681531..a1106472 100644 --- a/tools/compat-testing/playwright.config.js +++ b/tools/compat-testing/playwright.config.js @@ -7,7 +7,7 @@ import { defineConfig, devices } from '@playwright/test'; export default defineConfig({ - testDir: './tools/compat-testing/tests', + testDir: './tests', timeout: 30000, retries: 1, fullyParallel: true,