yarn install
- Since we are using yarn workspaces this command will install the dependencies of the root folder and go into all package’s root folders and execute yarn install. It doesn’t make much sense to invoke lerna bootstrap since it just calls yarn install itself.
yarn build
- Needed for generate the lib folder inside each package as this folder (lib) will be required to use one package in the other packages like:
import { App } from 'package-1'
. Yarn workspaces will symlink each package which means that /node_modules/package-1 will point to the package folder itself and since the main field of the package.json is"main": "lib/index.js",
lib is required as itsindex.js
file will be the entry point of each package.
- Needed for generate the lib folder inside each package as this folder (lib) will be required to use one package in the other packages like:
yarn start
Note that you need environment variables in .env
file in to root of the project
# firebase project config
STORYBOOK_API_KEY=
STORYBOOK_AUTH_DOMAIN=
STORYBOOK_DATABASE_URL=
STORYBOOK_PROJECT_ID=
STORYBOOK_STORAGE_BUCKET=
STORYBOOK_MESSAGING_SENDER_ID=
STORYBOOK_APP_ID=
# maps
STORYBOOK_MAPBOX_ACCESS_TOKEN=map box access token
STORYBOOK_GOOGLE_MAPS_API_KEY=google maps api key
If you want to run command in a specific package:
yarn workspace <package-name> <command>
If you want to add a common dependency to all packages:
yarn add some-package -W