Skip to content

feat(create-cli): detect dev server URL for Axe and Lighthouse targets#1287

Open
kacperpaczos wants to merge 6 commits into
code-pushup:mainfrom
kacperpaczos:feat/create-cli-detect-dev-server-url
Open

feat(create-cli): detect dev server URL for Axe and Lighthouse targets#1287
kacperpaczos wants to merge 6 commits into
code-pushup:mainfrom
kacperpaczos:feat/create-cli-detect-dev-server-url

Conversation

@kacperpaczos

Copy link
Copy Markdown

Fixes #1286

Summary

  • Add dev server URL detection in @code-pushup/utils (detector registry, config/script parsers, cache)
  • Pre-fill Axe and Lighthouse setup wizard prompts with detected URL and source label (e.g. vite.config.js)
  • Reset detection cache at the start of each wizard run
  • Document supported stacks and fallback behavior in create-cli README

Behavior

Signal Default URL
Vite (vite.config.*) http://localhost:5173
Next.js http://localhost:3000
Angular / Nx http://localhost:4200
Unknown project http://localhost:4200 (fallback)

Detection is heuristic (regex over config files; configs are not executed).

Test plan

  • nx run utils:unit-test --testPathPattern=dev-server
  • nx run plugin-axe:unit-test --testPathPattern=binding
  • nx run plugin-lighthouse:unit-test --testPathPattern=binding
  • nx run create-cli:unit-test
  • nx run create-cli:int-test (Vite project → 5173 in generated config)
  • Manual: local create-cli on Vite+React app → prompt shows detected from vite.config.js, default 5173

Commits

  1. feat(utils): add dev server URL detection for setup wizards
  2. feat(plugin-axe): pre-fill target URL from dev server detection
  3. feat(plugin-lighthouse): pre-fill target URL from dev server detection
  4. feat(create-cli): reset dev server cache and document URL auto-detection
  5. refactor(utils): extract formatUrls helper for setup wizard codegen
  6. refactor(utils): simplify config port parsing in dev server detection

Made with Cursor

kacper-paczos added 6 commits June 9, 2026 22:32
Introduce detector registry, config/script parsers, and cached
detectDevServerUrlWithSource() with source metadata for prompt UX.
Supports Vite, Next, Angular, Nx project.json, npm scripts, and deps.
Share URL formatting between Axe and Lighthouse setup bindings.
Let parsePortFromConfigFile return null when no port is found and apply
framework default ports in the detector layer instead.
@nx-cloud

nx-cloud Bot commented Jun 9, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 601a373

Command Status Duration Result
nx run-many -t unit-test,int-test ✅ Succeeded <1s View ↗
nx run ci:code-pushup -- merge-diffs --files=/h... ✅ Succeeded 5s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 1m 19s View ↗
nx run-many --targets=code-pushup --parallel=fa... ✅ Succeeded 1m 20s View ↗

☁️ Nx Cloud last updated this comment at 2026-06-09 21:32:23 UTC

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Code PushUp

😐 Code PushUp report is unchanged – compared current commit ba41f92 with previous commit ba41f92.


All of 14 projects are unchanged.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Code PushUp

😟 Code PushUp report has regressed – compared current commit ba41f92 with previous commit ba41f92.

🏷️ Categories

🏷️ Category ⭐ Previous score ⭐ Current score 🔄 Score change
Performance 🔴 40 🔴 33 ↓ −6.5
Bug prevention 🟡 75 🟡 75
Code style 🟢 100 🟢 100
Code coverage 🟢 92 🟢 92
Security 🔴 0 🔴 0
Updates 🟡 72 🟡 72
Type Safety 🟡 67 🟡 67
Miscellaneous 🟡 67 🟡 67
Documentation 🟡 51 🟡 51
Accessibility 🟢 92 🟢 92
Best Practices 🟢 100 🟢 100
SEO 🟢 92 🟢 92
Axe Accessibility 🟡 88 🟡 88
👎 1 group regressed, 👎 6 audits regressed, 12 audits changed without impacting score

🗃️ Groups

🔌 Plugin 🗃️ Group ⭐ Previous score ⭐ Current score 🔄 Score change
Lighthouse Performance 🔴 40 🔴 33 ↓ −6.5

33 other groups are unchanged.

🛡️ Audits

🔌 Plugin 🛡️ Audit 📏 Previous value 📏 Current value 🔄 Value change
Lighthouse Initial server response time was short 🟩 Root document took 560 ms 🟥 Root document took 640 ms ↑ +13.9 %
Lighthouse Total Blocking Time 🟥 1,270 ms 🟥 4,270 ms ↑ +236.7 %
Lighthouse Speed Index 🟥 6.0 s 🟥 6.7 s ↑ +11 %
Lighthouse Max Potential First Input Delay 🟥 550 ms 🟥 1,040 ms ↑ +88.2 %
Lighthouse First Contentful Paint 🟥 3.2 s 🟥 3.2 s ↑ +2.8 %
Lighthouse Time to Interactive 🟥 15.2 s 🟥 16.1 s ↑ +5.9 %
Lighthouse Avoids enormous network payloads 🟩 Total size was 2,548 KiB 🟩 Total size was 2,564 KiB ↑ +0.7 %
Lighthouse Minimizes main-thread work 🟥 7.5 s 🟥 15.1 s ↑ +101.2 %
Lighthouse JavaScript execution time 🟥 2.6 s 🟥 6.2 s ↑ +143.5 %
Lighthouse Metrics 🟩 100% 🟩 100% ↑ +5.9 %
Lighthouse Largest Contentful Paint 🟥 14.6 s 🟥 13.8 s ↓ −5.3 %
Lighthouse Remove duplicate modules in JavaScript bundles 🟥 Potential savings of 100 KiB 🟥 Potential savings of 100 KiB ↓ −40 %
Lighthouse Uses efficient cache policy on static assets 🟨 31 resources found 🟨 31 resources found ↑ +0.1 %
Lighthouse Server Backend Latencies 🟩 1,020 ms 🟩 1,070 ms ↑ +4.3 %
Lighthouse Avoids an excessive DOM size 🟥 2,340 elements 🟥 2,339 elements ↓ −0.1 %
Axe Inline text spacing must be adjustable with custom stylesheets 🟩 54 elements 🟩 53 elements ↓ −1.9 %
Lighthouse Cumulative Layout Shift 🟩 0 🟩 0 ↓ −100 %
Lighthouse Network Round Trip Times 🟩 20 ms 🟩 20 ms ↑ +0.1 %

660 other audits are unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create-cli defaults Axe/Lighthouse to localhost:4200 instead of detecting the app dev server port

1 participant