When an edge function has no response during `vc dev`, we were seeing an unhelpful error message:
> The event listener did not respond.
Now, we'll see a much more specific error message:
> Unhandled rejection: Edge Function "api/edge-no-response.ts" did not return a response.
> Error! Failed to complete request to /api/edge-no-response: Error: socket hang up
Adds initial support for a root-level `middleware.js` / `middleware.ts` file in the `vercel dev` CLI command. This leverages the existing Edge Function invoking logic in `@vercel/node`'s `startDevServer()` function and applies the necessary response / rewrites / mutations to the HTTP request based on the result of the middleware invocation.
In a previous PR, the entrypoint path extension was stripped in `vc dev` to match the behavior of production deployments (`/api/user.js` => `/api/user`). However, it was supposed to map back to the original file extension before invoking the matching builder. This PR fixes the mapping for dynamic paths with ESM, such as `/api/[id].mjs` => `/api/[id]`.
* Migrate ava cli dev tests to jest
* remove outdated test
* update tests
* Update utils
* update stdio to fix stalling
* test stdio tests
* add debug logs
* more logs
* use strip ansi
* update
* add exit flag and fix next dev test
* update timeout for mac ci
* update cancel
* update cancel tests.yml -> test.yml
* update other ids -> names
* remove outdated test
* de-dupe scripts
* remove redwood dev test due to size