Common Tasks
Managing npm dependencies via yarn
Prefer existing dependencies. Add a new npm dependency only when no suitable dependency is already available in the repo.
yarn workspace @trezor/package-name add dependency-name
After adding or updating a dependency, run:
yarn dedupe
yarn requirements:verify
Review all changes made by yarn dedupe before keeping them.
Do not bypass .yarnrc.yml npmMinimalAgeGate.
If a blocked version is required to fix a bug, add a targeted exception to npmPreapprovedPackages.
Keep Nix pins in sync in the same PR:
react-nativeorexpo:.nix/android.nixmust includecompileSdk,buildToolsandndkVersionfromnode_modules/react-native/gradle/libs.versions.toml.electronor.nvmrc:flake.nixandshell.nix.@playwright/test:playwright-web-flakeinflake.nix.
Monorepo Package Management
yarn generate-package # Create new package
yarn update-submodules # Update trezor-common submodule (see git-and-commit-guidelines)
Troubleshooting
# Reset environment if builds fail
rm -rf node_modules .yarn/cache
yarn --mode=skip-build
yarn build:essential
# Clear NX cache
yarn nx reset
# Restart development server
pkill -f "webpack-dev-server"
yarn suite:dev