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

SignalDefault URL
Vite (vite.config.*)http://localhost:5173
Next.jshttp://localhost:3000
Angular / Nxhttp://localhost:4200
Unknown projecthttp://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-cloudBot commented Jun 9, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 601a373

CommandStatusDurationResult
nx run-many -t unit-test,int-test✅ Succeeded<1sView ↗
nx run ci:code-pushup -- merge-diffs --files=/h...✅ Succeeded5sView ↗
nx run-many --targets=code-pushup --parallel=fa...✅ Succeeded1m 19sView ↗
nx run-many --targets=code-pushup --parallel=fa...✅ Succeeded1m 20sView ↗

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

@github-actions

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

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
LighthousePerformance🔴 40🔴 33↓ −6.5

33 other groups are unchanged.

🛡️ Audits

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

660 other audits are unchanged.

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

Labels

🧩 axe-plugin🧩 create-cli🧩 lighthouse-plugin📖 Project documentationimprovements or additions to the project documentation🔬 testingwriting tests🧩 utils

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

@kacperpaczos