Prerequsites

Set up yarn monorepo root

Let’s start with creating the project monorepo. I am going to use github and yarn. Starting from now I will be using this repo for the project: android-ios-web-monorepo-react-native.

Create the project root folder and switch to it

$ mkdir android-ios-web-monorepo-react-native
$ cd android-ios-web-monorepo-react-native

The next command will create a package.json file. Answering to prompts choose all the default values, except for private, which we should have set to true. Because yarn workspaces are not meant to be published by design.

$ yarn init

After we finished our package.json will look like this*

{
  "name": "android-ios-web-monorepo-react-native",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "private": true
}

Project code on github.

That was a good start!



(*) If you initialized git in a new project folder, then you may discover more properties in package.json (ex: author or repository). I excluded them on purpose to keep the sample lean.