From fc1f2e197c078c29371b3ac1c447403b306b69f0 Mon Sep 17 00:00:00 2001 From: Jacob Bolda Date: Thu, 19 Nov 2026 16:28:41 -0600 Subject: [PATCH 1/3] pnpm tasks and dx improvements --- .github/workflows/check.yml | 1 - CONTRIBUTING.md | 26 ++- package.json | 19 +- packages/ui/bench/helpers.ts | 17 +- packages/ui/package.json | 19 +- packages/web-platform-tests/package.json | 2 +- packages/web-platform-tests/src/cli.ts | 6 + pnpm-lock.yaml | 270 ++++++++++++++++++++++- pnpm-workspace.yaml | 10 +- vitest.config.mts | 22 +- 10 files changed, 341 insertions(+), 51 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index a552131..cacedc6 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -41,7 +41,6 @@ jobs: submodules: true - uses: jdx/mise-action@c2a87611a18de5b3828c5652fe268e992400cb5c # v4.3.0 - run: pnpm install --frozen-lockfile - - run: pnpm --filter @bomb.sh/web-platform-tests exec playwright install --with-deps chromium - run: pnpm test dom-wpt: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b3f57c1..9464eef 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,9 +9,10 @@ Fork the repo, then clone your fork: ```sh git clone https://github.com//ui.git cd ui +git submodule update --init packages/web-platform-tests/wpt ``` -You need the exact Node and pnpm versions listed under `devEngines` in the root `package.json`. This part is picky. The wrong Node stops `pnpm install` right away, and pnpm 11 fails on the `node-pty` build. +Use the Node and pnpm versions listed under `devEngines` in the root `package.json`. The build and test scripts rely on pnpm's workspace task runner. Any version manager works. If you use [mise](https://mise.jdx.dev), which is what our lint, format, and test checks use, export `MISE_IDIOMATIC_VERSION_FILE_ENABLE_TOOLS=node,pnpm` and run `mise install` so it reads those versions from `package.json`. @@ -25,15 +26,20 @@ pnpm install Run these from the repo root. You don't need to build before you run the tests. -| Command | What it does | -| ------------------------------------------ | ----------------------------------------- | -| `pnpm test` | Runs every test | -| `pnpm test packages/ui/src/layout.test.ts` | Runs one test file | -| `pnpm lint` | Runs the linter | -| `pnpm format` | Formats the code | -| `pnpm format:check` | Checks the formatting and changes nothing | -| `pnpm build` | Builds the packages | -| `pnpm bench` | Runs the benchmarks | +| Command | What it does | +| ----------------------------------------------- | --------------------------------------------------- | +| `pnpm test` | Runs unit tests once, then builds and runs WPT | +| `pnpm test:unit` | Runs unit tests in watch mode | +| `pnpm test:unit packages/ui/src/layout.test.ts` | Watches one unit test file | +| `pnpm test:unit:run` | Runs unit tests once, without watch mode | +| `pnpm test:wpt` | Builds the WPT runner and runs only WPT | +| `pnpm lint` | Runs the linter | +| `pnpm format` | Formats the code | +| `pnpm format:check` | Checks the formatting and changes nothing | +| `pnpm build` | Builds the packages | +| `pnpm bench` | Runs the benchmarks | + +`pnpm install` installs the Chromium browser used by WPT. The WPT submodule must also be initialized (as above). The WPT command builds its runner automatically; no manual build is needed. The benchmarks take a few minutes, so you only need them for changes that could affect rendering speed. diff --git a/package.json b/package.json index 51ed10b..850b93f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { - "name": "@bomb.sh/ui-workspace", + "name": "root", + "private": "true", "version": "0.0.0", "keywords": [ "bombshell", @@ -27,13 +28,17 @@ "access": "public" }, "scripts": { + "prepare": "pnpm --filter @bomb.sh/web-platform-tests exec playwright install --with-deps chromium", "dev": "bsh dev", - "build": "pnpm --filter @bomb.sh/web-platform-tests build && pnpm --filter \"@clack/*\" run build", - "bench": "vitest bench --reporter=verbose", + "build": "pnpm -r --filter '@clack/*...' run build", + "bench": "vitest bench --project 'bench (bench)' --reporter=verbose", "format": "bsh format", "format:check": "bsh format --check", "lint": "bsh lint .", - "test": "pnpm --filter @bomb.sh/web-platform-tests build && bsh test && pnpm --filter @clack/ui exec wpt" + "test": "pnpm -r --filter root run --workspace-concurrency=1 '/^test:(unit:run|wpt)$/' --run", + "test:unit": "vitest --config vitest.config.mts --project unit", + "test:unit:run": "vitest run --config vitest.config.mts --project unit", + "test:wpt": "pnpm --filter @clack/ui test:wpt" }, "devDependencies": { "@bomb.sh/tools": "^0.8.0", @@ -48,13 +53,13 @@ "devEngines": { "packageManager": { "name": "pnpm", - "version": "10.7.0", + "version": "11.28.13", "onFail": "warn" }, "runtime": { "name": "node", - "version": "22.23.4", - "onFail": "error" + "version": "22.23.5", + "onFail": "warn" } } } diff --git a/packages/ui/bench/helpers.ts b/packages/ui/bench/helpers.ts index 05eca85..b68a65c 100644 --- a/packages/ui/bench/helpers.ts +++ b/packages/ui/bench/helpers.ts @@ -86,6 +86,7 @@ export async function setupUI( shape: (typeof shapes)[number], ): Promise { const input = new PassThrough(); + const controller = new AbortController(); let writes = 0; const output = new Writable({ write(_chunk, _encoding, callback) { @@ -95,10 +96,11 @@ export async function setupUI( }); }, }); - const ui = await createUI({ input, output, width: 80, height: 24 }); + const ui = await createUI({ input, output, width: 80, height: 24, signal: controller.signal }); const { texts } = createTree({ document: ui.document, nodeCount, shape }); const initialWrites = writes; let started = false; + let running: Promise | undefined; return { document: ui.document, root: ui.document.documentElement, @@ -110,13 +112,18 @@ export async function setupUI( async start() { if (started) return; started = true; - void ui.main(); + running = ui.main(); + void running.catch(() => {}); await waitFor(() => writes > initialWrites); }, async close() { - await ui[Symbol.asyncDispose](); - input.destroy(); - output.destroy(); + controller.abort(); + try { + await running; + } finally { + input.destroy(); + output.destroy(); + } }, }; } diff --git a/packages/ui/package.json b/packages/ui/package.json index dc2e2f0..d39f327 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -27,30 +27,21 @@ "publishConfig": { "access": "public" }, + "files": [ + "dist" + ], "scripts": { "dev": "bsh dev", - "bench": "vitest bench --config ../../vitest.config.mts --reporter=verbose", "build": "bsh build --dts", "format": "bsh format", "lint": "bsh lint", - "test": "pnpm --filter @bomb.sh/web-platform-tests build && bsh test && wpt" + "test:wpt": "pnpm -r --filter '{.}...' run .wpt", + ".wpt": "wpt --config ./wpt.config.ts" }, "dependencies": { "@bomb.sh/tty": "catalog:", "css-select": "^7.0.0" }, - "devEngines": { - "packageManager": { - "name": "pnpm", - "version": "^10.7.0", - "onFail": "error" - }, - "runtime": { - "name": "node", - "version": "^22.14.0", - "onFail": "error" - } - }, "devDependencies": { "@bomb.sh/web-platform-tests": "workspace:*" } diff --git a/packages/web-platform-tests/package.json b/packages/web-platform-tests/package.json index add6dc6..ebd0c01 100644 --- a/packages/web-platform-tests/package.json +++ b/packages/web-platform-tests/package.json @@ -26,7 +26,7 @@ }, "scripts": { "build": "bsh build src/index.ts src/config.ts src/cli.ts src/vitest.ts src/vitest/runner.ts src/node/worker.ts --dts", - "test": "bsh test", + "test:unit": "vitest", "typecheck": "tsc -p tsconfig.json", "format": "bsh format", "lint": "bsh lint" diff --git a/packages/web-platform-tests/src/cli.ts b/packages/web-platform-tests/src/cli.ts index 6c2991f..b1922d2 100644 --- a/packages/web-platform-tests/src/cli.ts +++ b/packages/web-platform-tests/src/cli.ts @@ -23,6 +23,12 @@ const app = command( description('WPT configuration path, relative to the current directory.'), schema(z.string().min(1).default('wpt.config.ts')), ), + option( + name('run'), + cli(['--run'], { switch: true }), + description('Accepted for compatibility; WPT always runs in one-shot mode.'), + schema(z.boolean().default(false)), + ), option( name('name'), cli(['--name', '-t']), diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index da2ad7d..43e6cc2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,3 +1,192 @@ +--- +lockfileVersion: '9.0' + +importers: + + .: + configDependencies: {} + packageManagerDependencies: + '@pnpm/exe': + specifier: 11.28.13 + version: 11.28.13 + pnpm: + specifier: 11.28.13 + version: 11.28.13 + +packages: + + '@pnpm/exe@11.28.13': + resolution: {integrity: sha512-KdgdN5e6EGQQ4lRTJpOfdCoP3dKnt5MF4kBWNMOsYrlLlXS2414CyXSCr/Ka6HPmNshNHzLsIQjNO5mED+3Cqw==} + hasBin: true + + '@pnpm/linux-arm64@11.28.13': + resolution: {integrity: sha512-B3m8ZqR7HI8n3gSacE9EV1Wk8UWdpsXJNhL+mBU9fQEvGJwhwDlejSFEi7THafulrw+ujuTGbXEcAJoODfWZIA==} + cpu: [arm64] + os: [linux] + + '@pnpm/linux-x64@11.28.13': + resolution: {integrity: sha512-d9pCOTPyBMY5xphnpXfrxU2tI0ZhYuiVHMVzhST3K/pt5WBbyMvUTsA51s2fE114wbdIhEBOE2+9LNDHnFDqUA==} + cpu: [x64] + os: [linux] + + '@pnpm/linuxstatic-x64@11.28.13': + resolution: {integrity: sha512-dDOc1gd1JkURSSfrjuYodh0cKrLCdbBbcyS0nFwZYWkvl7ya8P2Wx8yY+Q+4qDbdhq+EvKzkmIutn5VPKB9gbg==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@pnpm/macos-arm64@11.28.13': + resolution: {integrity: sha512-6+2F6dcxGxZfrFRNSt5o0JiaeXZxRFveom5sXrYTaGnZNvQE1iNYORoyTvtivb8A3nVYBIGpkBYtqQKNIzKJIg==} + cpu: [arm64] + os: [darwin] + + '@pnpm/win-arm64@11.28.13': + resolution: {integrity: sha512-9X3cYPyIYGAR1dPlTtDbIXN0q069GONfU1GtCYjem2z48tLZb+/Opd6YNsc29IjCMkuc4U3LbInGcE08JEyQaQ==} + cpu: [arm64] + os: [win32] + + '@pnpm/win-x64@11.28.13': + resolution: {integrity: sha512-nXfjsxRQMAP+q+EP7u4yPLcmrlBKtfshJ80b/dCuPcjncRd0wVA1VM23aDoIB1sEMIghJI/V6X+6yxlRa+DEcQ==} + cpu: [x64] + os: [win32] + + '@reflink/reflink-darwin-arm64@0.1.19': + resolution: {integrity: sha512-ruy44Lpepdk1FqDz38vExBY/PVUsjxZA+chd9wozjUH9JjuDT/HEaQYA6wYN9mf041l0yLVar6BCZuWABJvHSA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@reflink/reflink-darwin-x64@0.1.19': + resolution: {integrity: sha512-By85MSWrMZa+c26TcnAy8SDk0sTUkYlNnwknSchkhHpGXOtjNDUOxJE9oByBnGbeuIE1PiQsxDG3Ud+IVV9yuA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@reflink/reflink-linux-arm64-gnu@0.1.19': + resolution: {integrity: sha512-7P+er8+rP9iNeN+bfmccM4hTAaLP6PQJPKWSA4iSk2bNvo6KU6RyPgYeHxXmzNKzPVRcypZQTpFgstHam6maVg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@reflink/reflink-linux-arm64-musl@0.1.19': + resolution: {integrity: sha512-37iO/Dp6m5DDaC2sf3zPtx/hl9FV3Xze4xoYidrxxS9bgP3S8ALroxRK6xBG/1TtfXKTvolvp+IjrUU6ujIGmA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@reflink/reflink-linux-x64-gnu@0.1.19': + resolution: {integrity: sha512-jbI8jvuYCaA3MVUdu8vLoLAFqC+iNMpiSuLbxlAgg7x3K5bsS8nOpTRnkLF7vISJ+rVR8W+7ThXlXlUQ93ulkw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@reflink/reflink-linux-x64-musl@0.1.19': + resolution: {integrity: sha512-e9FBWDe+lv7QKAwtKOt6A2W/fyy/aEEfr0g6j/hWzvQcrzHCsz07BNQYlNOjTfeytrtLU7k449H1PI95jA4OjQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + libc: [musl] + + '@reflink/reflink-win32-arm64-msvc@0.1.19': + resolution: {integrity: sha512-09PxnVIQcd+UOn4WAW73WU6PXL7DwGS6wPlkMhMg2zlHHG65F3vHepOw06HFCq+N42qkaNAc8AKIabWvtk6cIQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + + '@reflink/reflink-win32-x64-msvc@0.1.19': + resolution: {integrity: sha512-E//yT4ni2SyhwP8JRjVGWr3cbnhWDiPLgnQ66qqaanjjnMiu3O/2tjCPQXlcGc/DEYofpDc9fvhv6tALQsMV9w==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + + '@reflink/reflink@0.1.19': + resolution: {integrity: sha512-DmCG8GzysnCZ15bres3N5AHCmwBwYgp0As6xjhQ47rAUTUXxJiK+lLUxaGsX3hd/30qUpVElh05PbGuxRPgJwA==} + engines: {node: '>= 10'} + + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + + pnpm@11.28.13: + resolution: {integrity: sha512-1cqpzc1gZ6wpAvn0TaoAsSiKc7q/Hpj083Wzp1g7GJS01J91J9qPXhUwGYuxDgOtujIaHwFUKdwpRs6KepqMZQ==} + engines: {node: '>=22.13'} + hasBin: true + +snapshots: + + '@pnpm/exe@11.28.13': + dependencies: + '@reflink/reflink': 0.1.19 + detect-libc: 2.1.2 + optionalDependencies: + '@pnpm/linux-arm64': 11.28.13 + '@pnpm/linux-x64': 11.28.13 + '@pnpm/linuxstatic-x64': 11.28.13 + '@pnpm/macos-arm64': 11.28.13 + '@pnpm/win-arm64': 11.28.13 + '@pnpm/win-x64': 11.28.13 + + '@pnpm/linux-arm64@11.28.13': + optional: true + + '@pnpm/linux-x64@11.28.13': + optional: true + + '@pnpm/linuxstatic-x64@11.28.13': + optional: true + + '@pnpm/macos-arm64@11.28.13': + optional: true + + '@pnpm/win-arm64@11.28.13': + optional: true + + '@pnpm/win-x64@11.28.13': + optional: true + + '@reflink/reflink-darwin-arm64@0.1.19': + optional: true + + '@reflink/reflink-darwin-x64@0.1.19': + optional: true + + '@reflink/reflink-linux-arm64-gnu@0.1.19': + optional: true + + '@reflink/reflink-linux-arm64-musl@0.1.19': + optional: true + + '@reflink/reflink-linux-x64-gnu@0.1.19': + optional: true + + '@reflink/reflink-linux-x64-musl@0.1.19': + optional: true + + '@reflink/reflink-win32-arm64-msvc@0.1.19': + optional: true + + '@reflink/reflink-win32-x64-msvc@0.1.19': + optional: true + + '@reflink/reflink@0.1.19': + optionalDependencies: + '@reflink/reflink-darwin-arm64': 0.1.19 + '@reflink/reflink-darwin-x64': 0.1.19 + '@reflink/reflink-linux-arm64-gnu': 0.1.19 + '@reflink/reflink-linux-arm64-musl': 0.1.19 + '@reflink/reflink-linux-x64-gnu': 0.1.19 + '@reflink/reflink-linux-x64-musl': 0.1.19 + '@reflink/reflink-win32-arm64-msvc': 0.1.19 + '@reflink/reflink-win32-x64-msvc': 0.1.19 + + detect-libc@2.1.2: {} + + pnpm@11.28.13: {} + +--- lockfileVersion: '9.0' settings: @@ -22,7 +211,7 @@ importers: version: 3.0.3 '@codspeed/vitest-plugin': specifier: ^6.1.0 - version: 6.1.0(tinybench@6.2.2)(vite@8.3.5(@types/node@22.20.0)(jiti@2.7.0)(yaml@2.9.1))(vitest@5.0.5(@types/node@22.20.0)(vite@8.3.5(@types/node@22.20.0)(jiti@2.7.0)(yaml@2.9.1))) + version: 6.1.0(debug@4.4.3)(tinybench@6.2.2)(vite@8.3.5(@types/node@22.20.0)(jiti@2.7.0)(yaml@2.9.1))(vitest@5.0.5(@types/node@22.20.0)(vite@8.3.5(@types/node@22.20.0)(jiti@2.7.0)(yaml@2.9.1))) '@termless/core': specifier: ^0.10.2 version: 0.10.2(node-pty@1.2.0-beta.15) @@ -249,30 +438,35 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] '@napi-rs/canvas-linux-arm64-musl@1.0.11': resolution: {integrity: sha512-6Jz6jys17yXydO+WdJgu7JhoB4K7/w9sWHByzzTmLjQghUx3TDMWvLv+UcCdnWhg4oprET67EMymnrETdeGNAg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] '@napi-rs/canvas-linux-riscv64-gnu@1.0.11': resolution: {integrity: sha512-lf2XeEebWiUYVOVEjLXxF7dfXrBBSEOBn9AqBh39VYXrPt5cDqI+1t58IFSjn8npqkg5jIOs8TQbjKABbFW1gQ==} engines: {node: '>= 10'} cpu: [riscv64] os: [linux] + libc: [glibc] '@napi-rs/canvas-linux-x64-gnu@1.0.11': resolution: {integrity: sha512-iDapw7nFSE5tsmQxcH2+KotJhyfVPmHd6vUOQN/Em+8WNbkZJwJ/rDowlJMFnMl0SYSDSfgKCNUGi6Sn5++Smg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] '@napi-rs/canvas-linux-x64-musl@1.0.11': resolution: {integrity: sha512-26q26AyITo3CGZX4HWFIMgBMA1lu3YN07gxzBm4tW6Hglq/OVyTP50kDrmWuKybCX6dh3m8Ly+c7YhI+sqCgCQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] '@napi-rs/canvas-win32-arm64-msvc@1.0.11': resolution: {integrity: sha512-cUO96IdsfvIj2S+2PNcDSkTcLhjPj8pIOEWRV1Kj70MOP4wnE9zSk7N4C1EKHlFGRcgdR5AkbnBZj0dfHK9nbQ==} @@ -343,48 +537,56 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [glibc] '@oxc-parser/binding-linux-arm64-musl@0.133.0': resolution: {integrity: sha512-wJQGamIosQBoJHW9+S5XxrtKRo3eyJxsnS1XCPrqN0LHi8uw1pTqqTfn3t/NVuvbBg7Pumn4ez9Eidgcn0xbEg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [musl] '@oxc-parser/binding-linux-ppc64-gnu@0.133.0': resolution: {integrity: sha512-Koaz32/O5+abIfrNGdyndgRvdOZ9jEf5/z3Ep9h3h2QWpdDiUQpVwgH0OcMXCs+l9aXxPLtkupqyVig9W6FDKw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] + libc: [glibc] '@oxc-parser/binding-linux-riscv64-gnu@0.133.0': resolution: {integrity: sha512-R4vOjWzxhnNWHnVLeiB6jNuIifdy9vcMXZGPc7StXcxBovI+U2zg1QhZ9o8OjV80oGivs1lX5NfPLzk4IPqlRA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] + libc: [glibc] '@oxc-parser/binding-linux-riscv64-musl@0.133.0': resolution: {integrity: sha512-iwgBNUTHiMdxARLYuM0SBlnYeb19iw1Ea5M+4ERZupCsBMLArti6FyZ6UfFjJxIiTDr2oW2DGQFxlQVQ/dW9rA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] + libc: [musl] '@oxc-parser/binding-linux-s390x-gnu@0.133.0': resolution: {integrity: sha512-ZwZNo8FZmB/gVfboQl+wXilBigGl+6nQQs+nITOeAP/HcAOjiHl6XZJL9F/KXNEspODQcbjAiyjUbeCJd9a0fA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] + libc: [glibc] '@oxc-parser/binding-linux-x64-gnu@0.133.0': resolution: {integrity: sha512-govCvWx1dBlED3uu4qXctxpRcouu9I8Kn+DBktGCl760JtlGJzc9l/OmPJKlYWSbrRqKkMZehNeZ/4Wfma7uSA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [glibc] '@oxc-parser/binding-linux-x64-musl@0.133.0': resolution: {integrity: sha512-ssTlpXD5Mq9uCssDJPzlRWqBt4Y7Zzd9i+XZhWmK/9Y6KUIuAxVYTYiI8lxcGWi0+3/Cz4A8q9UrD4NK9Y2j7g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [musl] '@oxc-parser/binding-openharmony-arm64@0.133.0': resolution: {integrity: sha512-51aByfXhPtLEdWG4a2Ihdw6cPWV1ei1AarALpFdDP8MLWDLE2NuUMgbo3DERR2Kt8fT/ok1GUvBiLxVGke9uUQ==} @@ -463,41 +665,49 @@ packages: resolution: {integrity: sha512-0bJnmYFp62JdZ4nVMDUZ/C58BCZOCcqgKtnUlp7L9Ojf/czIN+3j72YlLPeWLkzlr6SlYvIQA4SGV/HyO0d+qg==} cpu: [arm64] os: [linux] + libc: [glibc] '@oxc-resolver/binding-linux-arm64-musl@11.20.0': resolution: {integrity: sha512-wKHHzPKZo7Ufhv/Bt6yxT7FOgnIgW4gwXcJUipkShGp68W3wGVqvr1Sr0fY65lN0Oy6y41+g2kIDvkgZaMMUkw==} cpu: [arm64] os: [linux] + libc: [musl] '@oxc-resolver/binding-linux-ppc64-gnu@11.20.0': resolution: {integrity: sha512-RN8goF7Ie0B79L4i4G6OeBocTgSC56vJbQ65VJje+oXnldVpLnOU7j/AQ/dP94TcCS+Yh6WG8u3Qt4ETteXFNQ==} cpu: [ppc64] os: [linux] + libc: [glibc] '@oxc-resolver/binding-linux-riscv64-gnu@11.20.0': resolution: {integrity: sha512-5l1yU6/xQEqLZRzxqmMxJfWPslpwCmBsdDGaBvABPehxquCXDC7dd7oraNdKSJUMDXSM7VvVj8H2D2FTjU7oWw==} cpu: [riscv64] os: [linux] + libc: [glibc] '@oxc-resolver/binding-linux-riscv64-musl@11.20.0': resolution: {integrity: sha512-xHEvkbgz6UC+A3JOyDQy76LkUaxsNSfIr3/GV8slwZsnuooJiIB34gzJfsyvR4JdCYNUUPsRJc/w/oWkODu+hg==} cpu: [riscv64] os: [linux] + libc: [musl] '@oxc-resolver/binding-linux-s390x-gnu@11.20.0': resolution: {integrity: sha512-aWPDUUmSeyHvlW+SoEUd+JIJsQhVhu6a5tBpDRMu058naPAchTgAVGCFy35zjbnFlt0i8hLWziff6HX0D3LU4g==} cpu: [s390x] os: [linux] + libc: [glibc] '@oxc-resolver/binding-linux-x64-gnu@11.20.0': resolution: {integrity: sha512-x2YeSimvhJjKLVD8KSu8f/rqU1potcdEMkApIPJqjZWN7c2Fpt4g2X32WDg1p+XDAmyT7nuQGe0vnhvXeLbH+g==} cpu: [x64] os: [linux] + libc: [glibc] '@oxc-resolver/binding-linux-x64-musl@11.20.0': resolution: {integrity: sha512-kcRLEIxpZefeYfLChjpgFf3ilBzRDZ+yobMrpRsQlSrxuFGtm3U6PMU7AaEpMqo3NfDGVyJJseAjnRLzMFHjwQ==} cpu: [x64] os: [linux] + libc: [musl] '@oxc-resolver/binding-openharmony-arm64@11.20.0': resolution: {integrity: sha512-HHcfnApSZGtKhTiHqe8OZruOZe5XuFQH5/E0Yhj3u8fnFvzkM4/k6WjacUf4SvA0SPEAbfbgYmVPuo0VX/fIBQ==} @@ -566,48 +776,56 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [glibc] '@oxfmt/binding-linux-arm64-musl@0.74.0': resolution: {integrity: sha512-nI5FJwZ4Flo6CBdscpwxymZXxO3m3IErQJX55ZS6h+ObfGXu8FostL85L/RWPFaCLnIVE4/WfLw+2q8XvVEeUA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [musl] '@oxfmt/binding-linux-ppc64-gnu@0.74.0': resolution: {integrity: sha512-BoQYKuqUdsKAFAkK6DLBvkdv4+t0hppSm79sB0wIcE2o/eOwNj+6Z3OlKY4q3Eta/tlssP65FaS9vHn8TeF7vQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] + libc: [glibc] '@oxfmt/binding-linux-riscv64-gnu@0.74.0': resolution: {integrity: sha512-FSroRrM12+jCdSQklF9aOxsKpI6wFs4ZCo/1cSYG80RWZS6z4LV+l9tXRMT8lDGu+yohIZBwi9M76FzGPFDE2A==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] + libc: [glibc] '@oxfmt/binding-linux-riscv64-musl@0.74.0': resolution: {integrity: sha512-0VLQD0dhGBLY9Ik/w+otMvD81D0YXi4VDwql65macV+O9UzmSWmUr6CKf+dMtysDeC0PnG3y6kBkRO08BJx52g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] + libc: [musl] '@oxfmt/binding-linux-s390x-gnu@0.74.0': resolution: {integrity: sha512-6X7BbZNz34+OHM6Oqjf6TRcUyRn6aRcB4VtIDZAF/uQRyeVhg+G2hv6MlMvmnRekVSyTJ/8rG/u8W2dRFW6glg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] + libc: [glibc] '@oxfmt/binding-linux-x64-gnu@0.74.0': resolution: {integrity: sha512-4kYIQK53yJXrxwxSzx8H2bojlf6/KezLGYLRXzV9QCCkoiCsvBTCid9Bg83dUPTLPa3g9K0730f6MKDbck1+OA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [glibc] '@oxfmt/binding-linux-x64-musl@0.74.0': resolution: {integrity: sha512-MfWz4wDREjp/JQDmuxtKieix4FHGa1z5rBvB3betdcPwZvf5fqeQrlCm1mmoyuUVQOh9Pt3M61HwN94kJCxw7Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [musl] '@oxfmt/binding-openharmony-arm64@0.74.0': resolution: {integrity: sha512-6rmAApkq5s1kbDjvNI6Nl5A+JqQkLORb2sR941pf5HWsrd01WGKyagK/B4vX9+kh1FfvRkNgEu59FHvVk4H8cQ==} @@ -680,48 +898,56 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [glibc] '@oxlint/binding-linux-arm64-musl@1.89.0': resolution: {integrity: sha512-vfffe8mQ484AzVadlUOFpgL+JDwhvs9hrzxTgQP1FVfi4ZEUUYeffXlzC9dFV7Dgnu5s/KrNKvfmG6HxBd/ISQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [musl] '@oxlint/binding-linux-ppc64-gnu@1.89.0': resolution: {integrity: sha512-Buonlp4hVS7RGNP5M7bPpGNQrenyzA2C64JcO/oz9C1c6dGOXJ7VEAnaiAMY7voou0JYyCJdvDVlFQc5DZX3DQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] + libc: [glibc] '@oxlint/binding-linux-riscv64-gnu@1.89.0': resolution: {integrity: sha512-1eVwJJrJ3lYIPT+cm7BcBBZZXY6IQZP/oyonaruTor/MrVyWOpvnwt1oD5CLdsHg5aVBIxXodQSvt+1gK6ck5w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] + libc: [glibc] '@oxlint/binding-linux-riscv64-musl@1.89.0': resolution: {integrity: sha512-fRQQsKUGShdEL5Fl9o9uhj3grkZbeXKLv0icQ5tspUCNYSDy8wzzEcP1WC2bKdTQ0rSszbKlO3iiHORxV22DLg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] + libc: [musl] '@oxlint/binding-linux-s390x-gnu@1.89.0': resolution: {integrity: sha512-dEtYjIy6+fHcjKklsmtmMkZRhwHr2UbzjmpvuPtQYSeN9awQ2hx5JLms5Wvri+8P/NZtD8v5hfgHALUql+/Ycg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] + libc: [glibc] '@oxlint/binding-linux-x64-gnu@1.89.0': resolution: {integrity: sha512-hqjwIj5KOYM8Wjef/p7IruNi1iByLhSzbMBk62y22P/E8q7Jj0Pp+DeUTKTRYyZYCDtU1wEGlnWOnttHbyNIww==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [glibc] '@oxlint/binding-linux-x64-musl@1.89.0': resolution: {integrity: sha512-iAQN3e6o9UgUCcdGwqRx/jYcKbG3HK7ur3rH6lTqVcQeNGZ85AeWIg6cgn/edwFQ0ofEZZItMwkzyCVTahnvEA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [musl] '@oxlint/binding-openharmony-arm64@1.89.0': resolution: {integrity: sha512-MNxjEByz3N/7Q4qFQuPWvc14TpN9LoD3pECEDsJTZbP/wyB7U+hduUXEl7QAbbgVezFwsb9sWtNUO6XVBndOhg==} @@ -793,24 +1019,28 @@ packages: engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [glibc] '@resvg/resvg-js-linux-arm64-musl@2.6.2': resolution: {integrity: sha512-3h3dLPWNgSsD4lQBJPb4f+kvdOSJHa5PjTYVsWHxLUzH4IFTJUAnmuWpw4KqyQ3NA5QCyhw4TWgxk3jRkQxEKg==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] + libc: [musl] '@resvg/resvg-js-linux-x64-gnu@2.6.2': resolution: {integrity: sha512-IVUe+ckIerA7xMZ50duAZzwf1U7khQe2E0QpUxu5MBJNao5RqC0zwV/Zm965vw6D3gGFUl7j4m+oJjubBVoftw==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [glibc] '@resvg/resvg-js-linux-x64-musl@2.6.2': resolution: {integrity: sha512-UOf83vqTzoYQO9SZ0fPl2ZIFtNIz/Rr/y+7X8XRX1ZnBYsQ/tTb+cj9TE+KHOdmlTFBxhYzVkP2lRByCzqi4jQ==} engines: {node: '>= 10'} cpu: [x64] os: [linux] + libc: [musl] '@resvg/resvg-js-win32-arm64-msvc@2.6.2': resolution: {integrity: sha512-7C/RSgCa+7vqZ7qAbItfiaAWhyRSoD4l4BQAbVDqRRsRgY+S+hgS3in0Rxr7IorKUpGE69X48q6/nOAuTJQxeQ==} @@ -905,72 +1135,84 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [glibc] '@rolldown/binding-linux-arm64-gnu@1.2.15': resolution: {integrity: sha512-iTBjXx+B5QSvgI89lJfmqh4wTh8NabR1YZIIN3hNx4zSG0EVfVqkOvLulNpG4251pbd6/IAmZ/LefVk1Y4rPhw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [glibc] '@rolldown/binding-linux-arm64-musl@1.0.0-rc.17': resolution: {integrity: sha512-b/CgbwAJpmrRLp02RPfhbudf5tZnN9nsPWK82znefso832etkem8H7FSZwxrOI9djcdTP7U6YfNhbRnh7djErg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [musl] '@rolldown/binding-linux-arm64-musl@1.2.15': resolution: {integrity: sha512-uN26XOnVR7rqQupG3V9oAG2EGGatWjcJHOeDOHUFCh4TBWmP2tHTFoVN13aYbwfm0aHqJAEmcwhAu6sooIjfqQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] + libc: [musl] '@rolldown/binding-linux-ppc64-gnu@1.0.0-rc.17': resolution: {integrity: sha512-4EII1iNGRUN5WwGbF/kOh/EIkoDN9HsupgLQoXfY+D1oyJm7/F4t5PYU5n8SWZgG0FEwakyM8pGgwcBYruGTlA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] + libc: [glibc] '@rolldown/binding-linux-ppc64-gnu@1.2.15': resolution: {integrity: sha512-9nWkcdd+H+XhaA3fQIwpHnKIrfx/PQ6rO0pivr78Og07tXlUlctBBJoEYLPfhTmCR/QxEVdn6uPjHV5SymPhdw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] + libc: [glibc] '@rolldown/binding-linux-s390x-gnu@1.0.0-rc.17': resolution: {integrity: sha512-AH8oq3XqQo4IibpVXvPeLDI5pzkpYn0WiZAfT05kFzoJ6tQNzwRdDYQ45M8I/gslbodRZwW8uxLhbSBbkv96rA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] + libc: [glibc] '@rolldown/binding-linux-s390x-gnu@1.2.15': resolution: {integrity: sha512-Ggh0ciFjLwIusLSLz7LZYEaGdxOAUJXI+Qu5JCbhPJJHEt8vP+IjRATTJheiJsdzzTYgUiHUiw3X1Ea3ZpMBdA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] + libc: [glibc] '@rolldown/binding-linux-x64-gnu@1.0.0-rc.17': resolution: {integrity: sha512-cLnjV3xfo7KslbU41Z7z8BH/E1y5mzUYzAqih1d1MDaIGZRCMqTijqLv76/P7fyHuvUcfGsIpqCdddbxLLK9rA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [glibc] '@rolldown/binding-linux-x64-gnu@1.2.15': resolution: {integrity: sha512-FHg60rS6DBePAYZ9X9F67x+JObFdmgn6tupA1C/a3B+CufFmTD4mX+e8M75tCiAO3foR/6xwVBI0KQiI7sn/rw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [glibc] '@rolldown/binding-linux-x64-musl@1.0.0-rc.17': resolution: {integrity: sha512-0phclDw1spsL7dUB37sIARuis2tAgomCJXAHZlpt8PXZ4Ba0dRP1e+66lsRqrfhISeN9bEGNjQs+T/Fbd7oYGw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [musl] '@rolldown/binding-linux-x64-musl@1.2.15': resolution: {integrity: sha512-/cvV/7v5VGz/moiz0XKRj2dE8DzsKyhIu1KpOvJGPjRywg3yscON889UGvAe8zfiJLHup7VLjBduoGWi3HusWQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] + libc: [musl] '@rolldown/binding-openharmony-arm64@1.0.0-rc.17': resolution: {integrity: sha512-0ag/hEgXOwgw4t8QyQvUCxvEg+V0KBcA6YuOx9g0r02MprutRF5dyljgm3EmR02O292UX7UeS6HzWHAl6KgyhA==} @@ -1221,31 +1463,37 @@ packages: resolution: {integrity: sha512-0OyIH53C0I1CbADHn9FSdCfX5qbpeLwJhmOVhonFJNYheybOnkSJ50qGMfTJIb8y5zrwqvLs7FVBvz6Fk8maZg==} cpu: [arm] os: [linux] + libc: [glibc] '@yuku-core/binding-linux-arm-musl@0.19.0': resolution: {integrity: sha512-z/iPfkCOCSXE34VXNt0uP1ORSW+4mEa9b5CiJcWZeqZH08g49bFU/jRM2T04f+Wpw5mJ6HIzNBiojxeAbrHjeg==} cpu: [arm] os: [linux] + libc: [musl] '@yuku-core/binding-linux-arm64-gnu@0.19.0': resolution: {integrity: sha512-jLNTi+gzaRwBJ+gwhCJ+rDb5dmx/8hEBx93UWd7hjMSqPTL1D1wvVSvXVAldV5kALvju7b0/m51EHEhs4+I1fA==} cpu: [arm64] os: [linux] + libc: [glibc] '@yuku-core/binding-linux-arm64-musl@0.19.0': resolution: {integrity: sha512-YwyPIdW/rN2Fmv0MTFWi47FaB3F9g+2b+sJISyAw83Yd60RWH4T3Nx6XkAHHVN+uKJNBAd6So7/BVihSiFYvuQ==} cpu: [arm64] os: [linux] + libc: [musl] '@yuku-core/binding-linux-x64-gnu@0.19.0': resolution: {integrity: sha512-/vskaAXVX3ESR43FiTdfiYS7z1b9uoQJwVQ/0RgUHgN2sWoAyCZs+aX4CgU7eKGIHTVfp9VFwv+c+2XchYiEtQ==} cpu: [x64] os: [linux] + libc: [glibc] '@yuku-core/binding-linux-x64-musl@0.19.0': resolution: {integrity: sha512-FuXL5igeSKib9Rye02TdH+D6SQezTyGxIATMu1Qsn/QywrzwpGl35OLpS2C1x5vpGLeVE2XgiLd5mVPFHmIglQ==} cpu: [x64] os: [linux] + libc: [musl] '@yuku-core/binding-win32-arm64@0.19.0': resolution: {integrity: sha512-YuJAe7zEKT1Xa7LuHlhGJpPnYQeVtvo0rZvNjJRqkH0hQGOw4C8QeP30Tg5VKGzZfo2x8CjhjEhKt4TmLwfmdg==} @@ -1544,24 +1792,28 @@ packages: engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [glibc] lightningcss-linux-arm64-musl@1.33.0: resolution: {integrity: sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] + libc: [musl] lightningcss-linux-x64-gnu@1.33.0: resolution: {integrity: sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [glibc] lightningcss-linux-x64-musl@1.33.0: resolution: {integrity: sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] + libc: [musl] lightningcss-win32-arm64-msvc@1.33.0: resolution: {integrity: sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==} @@ -2165,9 +2417,9 @@ snapshots: fast-wrap-ansi: 0.2.2 sisteransi: 2.0.0 - '@codspeed/core@6.1.0': + '@codspeed/core@6.1.0(debug@4.4.3)': dependencies: - axios: 1.21.0 + axios: 1.21.0(debug@4.4.3) form-data: 4.0.6 node-gyp-build: 4.8.4 stack-trace: 1.0.0-pre2 @@ -2175,9 +2427,9 @@ snapshots: - debug - supports-color - '@codspeed/vitest-plugin@6.1.0(tinybench@6.2.2)(vite@8.3.5(@types/node@22.20.0)(jiti@2.7.0)(yaml@2.9.1))(vitest@5.0.5(@types/node@22.20.0)(vite@8.3.5(@types/node@22.20.0)(jiti@2.7.0)(yaml@2.9.1)))': + '@codspeed/vitest-plugin@6.1.0(debug@4.4.3)(tinybench@6.2.2)(vite@8.3.5(@types/node@22.20.0)(jiti@2.7.0)(yaml@2.9.1))(vitest@5.0.5(@types/node@22.20.0)(vite@8.3.5(@types/node@22.20.0)(jiti@2.7.0)(yaml@2.9.1)))': dependencies: - '@codspeed/core': 6.1.0 + '@codspeed/core': 6.1.0(debug@4.4.3) tinybench: 6.2.2 vite: 8.3.5(@types/node@22.20.0)(jiti@2.7.0)(yaml@2.9.1) vitest: 5.0.5(@types/node@22.20.0)(vite@8.3.5(@types/node@22.20.0)(jiti@2.7.0)(yaml@2.9.1)) @@ -2861,9 +3113,9 @@ snapshots: asynckit@0.4.0: {} - axios@1.21.0: + axios@1.21.0(debug@4.4.3): dependencies: - follow-redirects: 1.16.2 + follow-redirects: 1.16.2(debug@4.4.3) form-data: 4.0.6 https-proxy-agent: 5.0.1 proxy-from-env: 2.1.0 @@ -2981,7 +3233,9 @@ snapshots: optionalDependencies: picomatch: 4.0.7 - follow-redirects@1.16.2: {} + follow-redirects@1.16.2(debug@4.4.3): + optionalDependencies: + debug: 4.4.3 form-data@4.0.6: dependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index c295565..c5085ed 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -3,9 +3,15 @@ packages: - examples/* catalog: '@bomb.sh/tty': ^0.10.0 -onlyBuiltDependencies: - - node-pty +allowBuilds: + node-pty: true publicHoistPattern: - oxlint - oxfmt - vitest +tasks: + test:unit:run: + dependsOn: [] + wpt: + dependsOn: + - ^build diff --git a/vitest.config.mts b/vitest.config.mts index f1b09f9..4a55733 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -1,13 +1,29 @@ import codspeedPlugin from '@codspeed/vitest-plugin'; -import { defineConfig } from 'vitest/config'; +import { createRequire } from 'node:module'; +import { configDefaults, defineConfig } from 'vitest/config'; + +const toolsRequire = createRequire(import.meta.resolve('@bomb.sh/tools/package.json')); +const ansiSerializer = toolsRequire.resolve('vitest-ansi-serializer'); export default defineConfig({ plugins: [codspeedPlugin()], test: { - benchmark: { include: ['**/*.bench.ts'] }, - experimental: { viteModuleRunner: false }, + exclude: [...configDefaults.exclude, 'dist/**'], + projects: [ + { test: { name: 'unit' } }, + { + test: { + name: 'bench', + benchmark: { enabled: true, include: ['**/*.bench.ts'] }, + experimental: { viteModuleRunner: false }, + }, + }, + ], // ensure we running only one test at a time maxWorkers: 1, isolate: false, + testTimeout: 15_000, + env: { FORCE_COLOR: '1' }, + snapshotSerializers: [ansiSerializer], }, }); From c0fcce86404443b8873936aef5cb7c3afa8a77fb Mon Sep 17 00:00:00 2001 From: Jacob Bolda Date: Thu, 19 Nov 2026 16:54:49 -0600 Subject: [PATCH 2/3] test:wpt is watch by default --- CONTRIBUTING.md | 2 +- packages/web-platform-tests/README.md | 31 +++++++++++++------------- packages/web-platform-tests/src/cli.ts | 8 ++++--- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9464eef..d915f16 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -32,7 +32,7 @@ Run these from the repo root. You don't need to build before you run the tests. | `pnpm test:unit` | Runs unit tests in watch mode | | `pnpm test:unit packages/ui/src/layout.test.ts` | Watches one unit test file | | `pnpm test:unit:run` | Runs unit tests once, without watch mode | -| `pnpm test:wpt` | Builds the WPT runner and runs only WPT | +| `pnpm test:wpt` | Runs WPT watching for changes in interactive terminals | | `pnpm lint` | Runs the linter | | `pnpm format` | Formats the code | | `pnpm format:check` | Checks the formatting and changes nothing | diff --git a/packages/web-platform-tests/README.md b/packages/web-platform-tests/README.md index 89bd92d..da59f51 100644 --- a/packages/web-platform-tests/README.md +++ b/packages/web-platform-tests/README.md @@ -30,14 +30,15 @@ pnpm --filter @clack/ui exec wpt --config wpt.config.ts Document-createElementNS pnpm --filter @clack/ui exec wpt --watch Node-parentNode -t 'Root element' ``` -`--watch` (or `-w`) keeps the CLI running. It reruns the selected upstream files -when `wpt.config.ts` or a local implementation module imported by that config -changes, including transitive imports. Config edits reload source and case -selection. Each rerun starts fresh Vitest and WPT workers, so implementation +In an interactive terminal, the CLI watches by default similar to `vitest`. Using +`--watch` (or `-w`) forces watch mode in a non-interactive terminal. It reruns the +selected upstream files when `wpt.config.ts` or a local implementation module imported +by that config changes, including transitive imports. Config edits reload source and +case selection. Each rerun starts fresh Vitest and WPT workers, so implementation changes take effect and upstream scripts execute again. The watcher ignores the pinned WPT checkout, package helpers, dependencies, and generated output. Press -Ctrl+C to stop. Without `--watch`, the CLI runs once and retains its usual exit -status for CI. +Ctrl+C to stop. In CI or when passing `--run`, it forces a single run and exits +on completion. `pnpm test` and `pnpm --filter @clack/ui test` build the harness, run the local implementation tests, and run the configured WPT cases. @@ -49,20 +50,20 @@ implementation's global bindings, then selects upstream source paths and origina case names. See the [UI configuration](../ui/wpt.config.ts). ```ts -import type { WPTConfig } from '@bomb.sh/web-platform-tests/config'; -import { createHTMLDocument, Node, Document, Element } from './dom.ts'; +import type { WPTConfig } from "@bomb.sh/web-platform-tests/config"; +import { createHTMLDocument, Node, Document, Element } from "./dom.ts"; export default { createDocument: () => createHTMLDocument(), globals: { Node, Document, Element }, include: { - 'dom/nodes/Node-parentNode.html': ['Document', 'Root element'], + "dom/nodes/Node-parentNode.html": ["Document", "Root element"], }, - exclude: { '**': true }, + exclude: { "**": true }, // excluded cases that run for their shared state, but we don't wait for forceTimeout: { // Waits on an iframe load the fixture cannot deliver. - 'dom/nodes/Node-parentNode.html': ['Removed iframe'], + "dom/nodes/Node-parentNode.html": ["Removed iframe"], }, } satisfies WPTConfig; ``` @@ -90,14 +91,14 @@ Solid, or Svelte. Pass them to `include` with `exclude: { '**': true }` to run that profile against the consumer's document factory and globals: ```ts -import { framework, type WPTConfig } from '@bomb.sh/web-platform-tests'; -import { createDocument, globals } from './dom.ts'; +import { framework, type WPTConfig } from "@bomb.sh/web-platform-tests"; +import { createDocument, globals } from "./dom.ts"; export default { createDocument, globals, - include: framework('preact'), - exclude: { '**': true }, + include: framework("preact"), + exclude: { "**": true }, } satisfies WPTConfig; ``` diff --git a/packages/web-platform-tests/src/cli.ts b/packages/web-platform-tests/src/cli.ts index b1922d2..3710bec 100644 --- a/packages/web-platform-tests/src/cli.ts +++ b/packages/web-platform-tests/src/cli.ts @@ -23,10 +23,10 @@ const app = command( description('WPT configuration path, relative to the current directory.'), schema(z.string().min(1).default('wpt.config.ts')), ), - option( + toggle( name('run'), cli(['--run'], { switch: true }), - description('Accepted for compatibility; WPT always runs in one-shot mode.'), + description('Run and exit on completion.'), schema(z.boolean().default(false)), ), option( @@ -41,6 +41,7 @@ const app = command( name('watch'), cli(['--watch', '-w'], { switch: true }), description('Rerun selected WPT cases when the config or its implementation changes.'), + schema(z.boolean().default(process.stdout.isTTY === true)), ), argument( name('files'), @@ -63,7 +64,8 @@ if (!result.ok) { files: [...result.model.files, ...Array.from(result.literals, (literal) => literal.text)], namePattern: result.model.name, }; - if (result.model.watch) { + const watch = !result.model.run && result.model.watch; + if (watch) { await watchWPT(options); } else { const vitest = await runWPT(options); From c867318a31d90e9f31ef5d889689463fee3083dd Mon Sep 17 00:00:00 2001 From: Jacob Bolda Date: Thu, 19 Nov 2026 17:14:44 -0600 Subject: [PATCH 3/3] .wpt as task dep --- pnpm-workspace.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index c5085ed..8e70bd0 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -12,6 +12,6 @@ publicHoistPattern: tasks: test:unit:run: dependsOn: [] - wpt: + .wpt: dependsOn: - ^build