git clone https://github.com/ethereum-push-notification-service/push-smart-contracts
cd push-smart-contracts
yarn install
Note -
We are using yarn
and strongly advise to use yarn 1.x to avoid any NPM issues.
We have a demoreact
playground to test the individual packages being built out. To run the demoreact
app
- click on the
NX console
extension icon in the VSCode sidebar. - click on the
build
target execute icon underdemoreact
- click on the
serve
target execute icon underdemoreact
- wait for the localhost to be ready in the terminal & then hit
http://localhost:4200/
on your browser to run the app.
- run
yarn nx build demoreact
- run
yarn nx run demoreact:build:production
- All changes should be requested through PRs from a feature/bug branch to
main
branch. - We are using
- conventional-commits: to follow semver for npm package versioning
- commitizen to restrict commits to follow conventional commits
- husky to run pre-commit checks
So, use yarn cz
to commit changes after git add
(recommended) or hand crafted git commit messages to follow conventional commit. Otherwise the CLI will prevent you from committing code.
- Before starting on any dev on the repo,
# pull latest from main
git pull origin main
git fetch --tags
# checkout new branch
git checkout -b <your-branch-name>
When you are ready to commit your changes.
Run
git add -A
then
yarn cz
this will pop up the below CLI
Read through the conventional-commits and semver to get a better understanding for selecting which option.
- for bug fixes use
fix
- for backward compatible new features use
feat
We are using NX and some NX plugins for monorepo management, verison & publish.
The repo comes in with a baked in NX console and some other VSCode extensions to -
- help simplify processes like build, lint, test, run demo apps
- run scripts on affected parts of the codebase
Note - Don't run CI-prefixed targets in the NX console in local, they are only for CI..
The NX monorepo uses project.json
& package.json
to manage the monorepo workspace and also ultimately build out the bundle that will be published to NPM registry.
at root, simply run
yarn add "[email protected]"
And then simply import that dependency in your package. NX while running build
for that package will take care of making it a dependency
in the final bundle.
at root, simply run
yarn add -D "[email protected]"
And then simply import that dependency in your package. NX while running build
for that package will take care of making it a devDependency
in the final bundle.
at root, simply run
yarn add "[email protected]"
And then simply import that dependency in your package. In the package.json
of the package where you want to consume it, simply declare the dependency as peerDependency
NX while running build
for that package will take care of making it a peerDependency
in the final bundle.