Turbopack: Allow Pages entrypoint template to import user's `.ts` files (#55296)
### What?
This adds an exception for the entrypoint templates directory which will
prevent the restricted resolve options from taking over. So, the
templates entrypoint will be able to import with the user's default
resolve options, which enables a `_app.ts` import.
### Why?
The entrypoint templates need to be able to import the user's code as if
the template were use code itself.
### How?
The [Pages
entrypoint](https://github.com/vercel/next.js/blob/85d30b62db4606bf56a6a9533494c9e14d55e1cc/packages/next/src/build/templates/pages.ts#L9-L10)
template [imports the user's `_app`
file](https://github.com/vercel/next.js/blob/85d30b62db4606bf56a6a9533494c9e14d55e1cc/packages/next-swc/crates/next-core/src/next_pages/page_entry.rs#L83-L84)
via a special `@vercel/turbopack-next/pages/_app` which is [import
mapped](https://github.com/vercel/next.js/blob/85d30b62db4606bf56a6a9533494c9e14d55e1cc/packages/next-swc/crates/next-core/src/next_import_map.rs#L404-L411)
to the user's `/pages/_app` file. If the user is using `/pages/_app.js`
file, everything is OK. But a problem pops up if the user is using a
`.ts` (or similar non-standard extension).
Why? In order to prevent a foobar node modules from importing TS/CSS/etc
files, we apply a restricted set of `ResolveOptions` when the base file
(the file that is doing the import) is inside a `node_modules`
directory. In this case, we stop allowing `.ts`/`.tsx`/`.css` file
extension imports and only allow `.js`/`.json`/`.node` (the standard
node extensions).
Well, the shared entrypoint templates are _technically_ inside the
`node_modules/next/dist/esm/build/templates/` directory, ie they are
node modules. So we applied the restricted resolve options when it was
importing `@vercel/turbopack-next/pages/_app`. Even though we're able to
correctly read the user's `/pages` directory, we ignore a
`/pages/_app.ts` file that would otherwise be found if the user code did
the import.
Depends on https://github.com/vercel/turbo/pull/5938.
Closes WEB-1545