From f818c123679cfa8a4c884e526fe866cc2a9c8bd9 Mon Sep 17 00:00:00 2001 From: Johnero542 Date: Sat, 29 Aug 2026 19:05:48 +0100 Subject: [PATCH] Re-baseline bundlewatch budgets, add MPL-2.0 to the license allowlist, fix dead config in the e2e runner (#1309, #1310, #1311, #1312) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #1310: bundlewatch.config.json's paths (.next/static/chunks/vendor.js, main*.js, pages/_app*.js) were Pages Router / classic-webpack chunk naming conventions — this app is App Router (src/app/), built with Next.js 16's default Turbopack, so none of those paths ever match any real build output; the budget check was silently a no-op. Re-baselined to App Router chunk conventions (framework-*.js, main-app-*.js, app/page-*.js) plus explicit budgets for the markets and admin route bundles named in the issue's background. #1311: current frontend dependencies don't yet include a wallet SDK/ charting/i18n library (those are hand-rolled: useWalletAddress.ts, useI18n.ts, etc.), so that specific background concern doesn't apply yet. But axe-core — already a devDependency — is licensed MPL-2.0, which wasn't in the onlyAllow list at all (only Apache-2.0/Apache* was present, not MPL). Added MPL-2.0. #1312: package.json's generate-client script + build prerequisite (`build: npm run generate-client && next build`), services/api/ openapi.yaml, and src/lib/api/schema.d.ts all already exist and are already wired together exactly as described, with dedicated contract tests (client-schema-type-contract.test.ts, client-schema-path-contract.test.ts) guarding against drift. Diffed every path in openapi.yaml against schema.d.ts directly — they match exactly. No gap found; nothing changed here. #1309: playwright.config.ts already configures chromium/firefox/webkit/ mobile-chrome/mobile-safari/tablet plus integration and staging projects — already well beyond what the issue asks for. The real, still-live gap was in scripts/run-e2e-tests.js (also named in the issue): it built a `config` object (workers/retries/reporter) and printed it as "Configuration", but the actual invoked command hardcoded `--reporter=github,html,json,junit` in CI and computed nothing else — `config` had zero effect on what actually ran. Rebuilt the command from `config` so the printed configuration is the real one. Closes #1309 Closes #1310 Closes #1311 Closes #1312 Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_014jDDop7frnew1xcCJDSKEw --- frontend/.license-checker.json | 3 ++- frontend/bundlewatch.config.json | 18 +++++++++++++----- frontend/scripts/run-e2e-tests.js | 14 +++++++++++--- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/frontend/.license-checker.json b/frontend/.license-checker.json index dfaaf39..225ce7e 100644 --- a/frontend/.license-checker.json +++ b/frontend/.license-checker.json @@ -13,6 +13,7 @@ "Unlicense", "0BSD", "Python-2.0", - "BlueOak-1.0.0" + "BlueOak-1.0.0", + "MPL-2.0" ] } diff --git a/frontend/bundlewatch.config.json b/frontend/bundlewatch.config.json index e12c5f7..a3f14f5 100644 --- a/frontend/bundlewatch.config.json +++ b/frontend/bundlewatch.config.json @@ -1,16 +1,24 @@ { "files": [ { - "path": ".next/static/chunks/vendor.js", - "maxSize": "250 kB" + "path": ".next/static/chunks/framework-*.js", + "maxSize": "50 kB" }, { - "path": ".next/static/chunks/main*.js", + "path": ".next/static/chunks/main-app-*.js", + "maxSize": "100 kB" + }, + { + "path": ".next/static/chunks/app/page-*.js", "maxSize": "150 kB" }, { - "path": ".next/static/chunks/pages/_app*.js", - "maxSize": "100 kB" + "path": ".next/static/chunks/app/markets/**/*.js", + "maxSize": "200 kB" + }, + { + "path": ".next/static/chunks/app/admin/**/*.js", + "maxSize": "200 kB" } ], "ci": { diff --git a/frontend/scripts/run-e2e-tests.js b/frontend/scripts/run-e2e-tests.js index 1931f88..6731476 100755 --- a/frontend/scripts/run-e2e-tests.js +++ b/frontend/scripts/run-e2e-tests.js @@ -31,9 +31,17 @@ console.log('CI Mode:', CI ? 'Yes' : 'No'); console.log(''); try { - // Run Playwright tests - const command = `npx playwright test ${CI ? '--reporter=github,html,json,junit' : ''}`; - + // Run Playwright tests. Built from `config` above so the printed + // "Configuration" actually reflects what gets invoked — it previously + // hardcoded `--reporter=github,html,json,junit` in CI and computed the + // rest for display only, with no effect on the command. + const flags = [ + `--reporter=${CI ? 'github,html,json,junit' : config.reporter}`, + `--retries=${config.retries}`, + config.workers ? `--workers=${config.workers}` : '', + ].filter(Boolean); + const command = `npx playwright test ${flags.join(' ')}`; + console.log(`Running: ${command}\n`); execSync(command, {