Uses npm workspaces to reference modules.
https://docs.npmjs.com/cli/v7/using-npm/workspaces
Uses tsConfig paths to alias the parent directory.
https://www.typescriptlang.org/tsconfig#paths
- As a build step, need to run
npm installinsideapps-shared/andnext/ - React native web rewrites aliases for babel config depending on env
- May need to transpile the sibling directory using next-plugin-transpile-modules plugin if we use npm link [1] [2]
Most likely the simplest option is to just have one node_modules in the root directory which list all deps.
Each subfolder can have it's npm commands e.g. npm run dev.