I have settled a monorepo with Lerna and Yarn Workspaces with this structure:
project| - packages | - ReactNativeApp | - NextJsApp | - FirebaseCloudFunctions | - Common | - src > source TypeScript | - lib > compiled TypeScript > published to npm for reuse by cloud functions in Firebase | - AppsCommon | - src > source TypeScript | - lib > compiled TypeScript
I have several issues. One being React Native not resolving symlinks, the other being errors messages from Firebase altered when transmited fom React Native Firebase to AppsCommon to ReactNativeApp, while it does not happen if I copy AppsCommon source TypeScript in ReactNativeApp.
I think I need to get ride of Yarn Workspaces because symlinks are not managed well by React Native, making it extremly complicated to manage. As far as I understand it can be achieved by this?
// replaceimport { function } from '@project/appsCommon'// by:import { function } from '../../appsCommons'
I also tried to replace lib by src in the package.json and tsconfig.json, in order to make it an uncompiled TypeScript package, but it did not resolve.
Then, with Lerna, I tried to import directly the src folder of the other packages. What could go wrong ?
import { function } from '../../../common/src'
Maybe in React Native something like:
FAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':app:mergeDexDebug'.> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade> java.nio.file.NoSuchFileException: C:\code\Experimental\monorepo\packages\mobile\android\common\build\intermediates\external_file_lib_dex_archives\debug\out
Yeah... There is no android files in Common, this is normal because they are in ReactNativeApp... Why are you searching it here React Native ???
Is there a method to create uncompiled TypeScript packages? Or a simple method to handle this use case?