From c58e19e89aadcc01c2ac8ead876831ed8a2f6c5d Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Thu, 9 Nov 2023 15:07:52 -0800 Subject: [PATCH] Correctly declare runtime dependencies (#41398) Summary: In pnpm setups, codegen will fail during build because it cannot find its dependencies. Some of the dependencies it relies on at runtime are currently declared under `devDependencies`. This change moves them to `dependencies`. ## Changelog: [GENERAL] [FIXED] - Fix `react-native/codegen` not being able to resolve dependencies in pnpm setups Pull Request resolved: https://github.com/facebook/react-native/pull/41398 Test Plan: We are currently trying to [enable pnpm mode](https://github.com/microsoft/rnx-kit/pull/2811) in rnx-kit and hit this issue. We've patched this package locally and it works. Reviewed By: christophpurrer Differential Revision: D51169116 Pulled By: NickGerleman fbshipit-source-id: 28906a0de412c660d2fc42f62deaf77240d27a58 --- packages/react-native-codegen/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native-codegen/package.json b/packages/react-native-codegen/package.json index 193583d5dbef77..19e6afe09e9886 100644 --- a/packages/react-native-codegen/package.json +++ b/packages/react-native-codegen/package.json @@ -30,8 +30,11 @@ ], "dependencies": { "@babel/parser": "^7.20.0", + "glob": "^7.1.1", "hermes-parser": "0.17.1", + "invariant": "^2.2.4", "jscodeshift": "^0.14.0", + "mkdirp": "^0.5.1", "nullthrows": "^1.1.1" }, "devDependencies": { @@ -46,11 +49,8 @@ "@babel/plugin-transform-flow-strip-types": "^7.20.0", "@babel/preset-env": "^7.20.0", "chalk": "^4.0.0", - "glob": "^7.1.1", "hermes-estree": "0.17.1", - "invariant": "^2.2.4", "micromatch": "^4.0.4", - "mkdirp": "^0.5.1", "prettier": "2.8.8", "rimraf": "^3.0.2" },