Our publish pipeline called set-version.js, which would change version numbers in package.json files. This invalidated our yarn.lock file. Then, npm publish would calls the lifecycle script pack , which calls prepack, which Meta defined to run packages/react-native/scripts/prepack.js. This will build react-native-codegen if it hasn't been (I guess we want the build output packed) and run yarn install. In CI, yarn install is by default immutable. However, as I pointed out above, our yarn.lock is invalidated, so yarn install --immutable will fail because we need to update the lock file.
So.. let's fix this by building codeine and mutably running yarn install. Also, we don't need to call the publish-npm script anymore methinks. We're doing it in our pipeline separately anyway.
Test Plan:
Did my best to locally reproduce and test.. but testing publish sucks.
Summary:
Our publish pipeline called
set-version.js
, which would change version numbers in package.json files. This invalidated ouryarn.lock
file. Then,npm publish
would calls the lifecycle scriptpack
, which callsprepack
, which Meta defined to runpackages/react-native/scripts/prepack.js
. This will buildreact-native-codegen
if it hasn't been (I guess we want the build output packed) and runyarn install
. In CI,yarn install
is by default immutable. However, as I pointed out above, ouryarn.lock
is invalidated, soyarn install --immutable
will fail because we need to update the lock file.So.. let's fix this by building codeine and mutably running yarn install. Also, we don't need to call the
publish-npm
script anymore methinks. We're doing it in our pipeline separately anyway.Test Plan:
Did my best to locally reproduce and test.. but testing publish sucks.