-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Hernani Fernandes edited this page May 31, 2021
·
7 revisions
This structure is a suggestion when one needs to manage:
- multiple projects with same ui (admin, site, landpage)
- or one app that can be divided in multiple react apps as an admin (user/dashboard/...) if this app is huge and it doesn't matter the refresh between pages
Inside the root folder run
$ yarn install
- Create the react project (or ts project) and add inside the root package.json the namespace
"workspaces": [
...
"shared/components",
"{NEW_FOLDER_PATH}"
]
- Inside the new folder add inside the specific package eg. NEW_FOLDER_PATH/package.json the project with scope and also the
main
path:
{
"name": "@monorepo/{NEW_PROJECT_NAME}",
"version": "0.1.0",
"main": "./src/index.ts",
...
$ yarn workspace @monorepo/customer start
$ yarn workspace @monorepo/customer cypress open
|
|_ customer -> drag'n drop this folder into IDEA
|_ planner -> or this folder
|_ shared -> or this folder
|_ helper -> or this folder
|_ components -> or this folder