pnpm i
or pnpm i --force
- execute to install all dependencies
pnpm add <package_to_add> -F <workspace_name>
pnpm add <package_to_add> -F <workspace_name> --workspace
. root (@ba/monorepo)
├── apps
│ ├── client (@ba/client)
│ ├── mobile (@ba/mobile)
│ └── server (@ba/server)
tree -I node_modules -L 2
.
├── README.md
├── apps
│ ├── client
│ ├── mobile
│ └── server
├── commitlint.config.js
├── package.json
├── packages
├── pnpm-lock.yaml
└── pnpm-workspace.yaml
pnpm clear:all
brew install pnpm
- Installing pnpm to the systemnvm alias default 16.18
- nvm set default node.js version 16.18nvm use
pnpm licenses list
pnpm init
- To generate a top-level package.json
mkdir apps packages
- Create an apps and packages. We will use app centric repositories
touch pnpm-workspace.yaml
pnpm add -D -w @nestjs/cli
- Run this command from the root of the project. I suppose that it will be our root helper. For example: I want to create microservices based on NestJS
npx nest new server
- Create a new NestJS project
pnpm apps:server start:dev
- run the server in the dev mode
pnpm create next-app --typescript
- Run this command from the root of the project.
Visit expo.dev. To create an account.
pnpm add -D -w eas-cli
- Add expo cli
npx create-expo-app mobile
- Init the mobile app. Was executed in an apps directory
eas init --id {{ID}}
- Connect expo to the server (expo.dev)
pnpm apps:mobile start
- run the mobile in the dev mode
pnpm add -D -w @commitlint/{config-conventional,cli}
- Run this command from the root of the project.
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js
- Add config
To lint commits before they are created you can use Husky's commit-msg hook:
pnpm add -D -w husky
- Install Husky v6pnpm husky install
- Activate hookspnpm husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'
pnpm nx <target> <project>
pnpm nx start:dev @ba/server
pnpm nx run-many --target=build --all
pnpm nx run-many --target=build --projects=@ba/server,@ba/client,@ba/theme
pnpm nx affected:<target>
pnpm nx graph