Move Jest preprocessor up to workspace root, remove public metro-react-native-babel-transformer dep (#36523)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36523

`jest/private/preprocessor.js` is only used to run tests on the workspace itself, it's not part of our exported Jest preset and is specifically excluded from publication in the `react-native` package.

Now that we have the monorepo setup, this belongs at the workspace root.

 - `metro-react-native-babel-transformer` moved from RN `dependencies` to root `devDependencies` because it's only used by the preprocessor
 - `jest/create-cache-key-function` added to `devDependencies` - it's also used by the `assetTransformer` in the public preset.

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D44197879

fbshipit-source-id: 0bbd9e2f500f53fa4f16562f05374dc601b67df6
This commit is contained in:
Rob Hogan
2023-03-20 05:44:34 -07:00
committed by Facebook GitHub Bot
parent 0c5c07fc9b
commit a0fa3c736e
4 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ module.exports = {
transform: {
'^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$':
'<rootDir>/packages/react-native/jest/assetFileTransformer.js',
'.*': './packages/react-native/jest/private/preprocessor.js',
'.*': './jest/preprocessor.js',
},
setupFiles: ['./packages/react-native/jest/local-setup.js'],
fakeTimers: {
+2
View File
@@ -55,6 +55,7 @@
"@babel/generator": "^7.20.0",
"@babel/plugin-transform-regenerator": "^7.0.0",
"@definitelytyped/dtslint": "^0.0.127",
"@jest/create-cache-key-function": "^29.2.1",
"@reactions/component": "^2.0.2",
"@types/react": "^18.0.18",
"@typescript-eslint/parser": "^5.30.5",
@@ -84,6 +85,7 @@
"jscodeshift": "^0.14.0",
"metro-babel-register": "0.75.1",
"metro-memory-fs": "0.75.1",
"metro-react-native-babel-transformer": "0.75.1",
"mkdirp": "^0.5.1",
"mock-fs": "^5.1.4",
"prettier": "^2.4.1",
-2
View File
@@ -24,7 +24,6 @@
"interface.js",
"jest-preset.js",
"jest",
"!jest/private",
"Libraries",
"LICENSE",
"local-cli",
@@ -96,7 +95,6 @@
"jest-environment-node": "^29.2.1",
"jsc-android": "^250231.0.0",
"memoize-one": "^5.0.0",
"metro-react-native-babel-transformer": "0.75.1",
"metro-runtime": "0.75.1",
"metro-source-map": "0.75.1",
"mkdirp": "^0.5.1",