Only NX works fine with Expo
I chose tooling for a monorepo - custom components appear that I would like to release separately from the main application, and a web version will appear someday.
There are currently several options for organizing a monorepo - native functionality of bundlers (NPM/Yarn/PNPM Workspaces), NX and the hyped Turborepo.
My standard choice is NX. I love NX.
But then I decided to see what Turborepo offers. Turbo uses popular templates like t3-stack, in fact, all the templates I found used Turbo - I think it should probably work well.
And it works. Until you make your own dev build using prebuild. It works great with Expo Go, but as soon as you make a prebuild, everything falls apart. And without a prebuild, you basically can’t make normal apps.
In my case, the build does not build, because when building in Turbo, an old version of Kotlin appears from somewhere. There are also other jokes - like in Turbo you need to directly specify in the config which env variables need to be passed to the build (for example, ANDROID_HOME) - why, I still do not understand - but this is not a bug of course, rather a skill issue on my part, they decided to do it this way, and it is written in the doc. It’s just strange.
In NX, in the case of Expo, the Expo CLI terminal does not work - shortcuts a, r, shift+m, etc. do not work. But if you run it directly, not through the NX CLI, everything works fine.
And here is the main charm of NX. In essence, to put it simply, NX is now a utility that distributes your projects into folders and correctly configures paths in tsconfig. That’s it, after that you can use your projects as usual. And only if required, you can add caching, a common linter config, dependencies between tasks, etc. on top. NX has a bunch of add-ons, both from the NX team itself and from the community, which allow you to expand the functionality.
In my case, the project also runs on Bun, with Biome as a linter, and takes the component from the library, which will be published in a separate pipeline to NPM. It’s just a little easier to manage now.