Support metadata routes in --debug-build-paths (#95788)
Extracted from https://github.com/vercel/next.js/pull/95468.
@lubieowoce asked me to use `--debug-build-paths` in a test, but it
didn't work for route handlers because this flag was using a homecooked
regex that doesn't match App Router's actual mechanism.
Making it use the actual App Router matching involves moving some
resolution around and threading things through.
This is for a debug-only (test-only?) helper.