a92c5465ca
### What? This PR ensures the jest configuration is json-serializable. It also adds a bunch of typescript types. ### Why? Jest requires that the configuration be json-serializable. See #47407 for details on the issues caused when it isn't. However, prior to this commit, we were passing the entire next config as a property in the swc jest transformer options. The next config includes some fields that are not serializable, such as some functions. ### How? In this PR we instead pluck the fields out of the next config that we actually need and pass only those into the swc transformer. This PR also adds a bunch of more precise typescript types where we were previously just using `any`. This helps confirm that the configs are being threaded through correctly. I think this type safety is enough to confirm this commit and adding tests would just be redundant. Closes NEXT-901 Fixes #47407 fix NEXT-901 ([link](https://linear.app/vercel/issue/NEXT-901)) --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> Co-authored-by: Jiachi Liu <inbox@huozhi.im> |
||
---|---|---|
.. | ||
create-next-app | ||
eslint-config-next | ||
eslint-plugin-next | ||
font | ||
next | ||
next-bundle-analyzer | ||
next-codemod | ||
next-env | ||
next-mdx | ||
next-plugin-storybook | ||
next-polyfill-module | ||
next-polyfill-nomodule | ||
next-swc | ||
react-dev-overlay | ||
react-refresh-utils |