All you need is yarn 💙
Yarn can be installed with the link above (recommended) or using npm with npm install -g yarn
Lerna can be installed using npm with npm install -g lerna
(might require sudo if you're on macOS).
Posting is actually a monorepo containing several workspaces (/packages
). It utilizes yarn workspaces and lerna(https://lerna.js.org/) to manage dependencies and workspaces and handle cross-dependencies.
Installation from root:
yarn install
installs lerna dependencylerna bootstrap
installs dependencies of all workspacesyarn run dev
starts dev server concurrently
Note: You can run lerna
scripts from anywhere in the monorepo.
Result | Command |
---|---|
Runs tests once for all packages | lerna run test |
Runs the script for all packages that have that script | lerna run <script> |
removes node_modules from all packages | lerna clean |
If you run lerna clean
, you'll need to run lerna bootstrap
to reinstall dependencies
if you wish to see verbose builds and testing, you can cd into a package and run scripts using yarn.
Result | Command |
---|---|
Starts a Dev server | yarn start |
adds or removes 3rd party dependency to workspace | yarn add/remove <3rd party dependency> |
Note: Do not add package dependencies to the monorepo root package.json, add the dependency to the necessary workspace
Please make sure your code doesn't break any linter rules and passes all unit tests before submitting a PR.
-
####Open Terminal.
-
####List the current configured remote repository for your fork.
$ git remote -v
> origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
> origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
-
####Specify a new remote upstream repository that will be synced with the fork.
$ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
-
####Verify the new upstream repository you've specified for your fork.
$ git remote -v
> origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
> origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
> upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch)
> upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push)
-
- #####Create a copy of your branch to cherry pick commits from
git checkout -b <my-branch-name>-2
- #####Checkout develop and reset it to latest upstream (upstream being higi remote)
git checkout master
git fetch upstream
git reset --hard upstream/master
- #####Reset feature branch from develop
git checkout <my-branch-name>
git reset --hard upstream/master
- `git checkput
git reset --hard upstream/master
- #####Create a copy of your branch to cherry pick commits from
-
####Update featured branch from upstream
git checkout master
git reset --hard upstream/master
git push origin master
git checkput <my-branch-name>
git merge master