rsnext/packages
Connor Prussin a92c5465ca
Make jest config serializable (#47620)
### 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>
2023-04-17 18:52:52 +00:00
..
create-next-app v13.3.1-canary.10 2023-04-17 17:04:11 +00:00
eslint-config-next v13.3.1-canary.10 2023-04-17 17:04:11 +00:00
eslint-plugin-next v13.3.1-canary.10 2023-04-17 17:04:11 +00:00
font v13.3.1-canary.10 2023-04-17 17:04:11 +00:00
next Make jest config serializable (#47620) 2023-04-17 18:52:52 +00:00
next-bundle-analyzer v13.3.1-canary.10 2023-04-17 17:04:11 +00:00
next-codemod v13.3.1-canary.10 2023-04-17 17:04:11 +00:00
next-env v13.3.1-canary.10 2023-04-17 17:04:11 +00:00
next-mdx v13.3.1-canary.10 2023-04-17 17:04:11 +00:00
next-plugin-storybook v13.3.1-canary.10 2023-04-17 17:04:11 +00:00
next-polyfill-module v13.3.1-canary.10 2023-04-17 17:04:11 +00:00
next-polyfill-nomodule v13.3.1-canary.10 2023-04-17 17:04:11 +00:00
next-swc v13.3.1-canary.10 2023-04-17 17:04:11 +00:00
react-dev-overlay v13.3.1-canary.10 2023-04-17 17:04:11 +00:00
react-refresh-utils v13.3.1-canary.10 2023-04-17 17:04:11 +00:00