You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`command not found: yarn`| Run `corepack enable`|
62
+
| Build fails with type errors | Run `yarn build:clean`|
63
+
| Tests fail after setup | Ensure all dependencies installed: `yarn install`|
64
+
| Circular dependency warnings | Run `yarn lint:dependencies:fix`|
65
65
66
66
---
67
67
@@ -81,6 +81,7 @@ yarn build:docs
81
81
```
82
82
83
83
**Build System Notes:**
84
+
84
85
- Uses `ts-bridge` for TypeScript compilation
85
86
- Build outputs go to each package's `dist/` directory
86
87
- Source maps are generated for debugging
@@ -106,6 +107,7 @@ yarn test:clean
106
107
```
107
108
108
109
**Testing Notes:**
110
+
109
111
- Tests must be colocated with source files (e.g., `file.ts` → `file.test.ts`)
110
112
- Uses Jest as test runner
111
113
- Coverage reports in `coverage/` directory of each package
@@ -160,6 +162,7 @@ yarn dedupe
160
162
```
161
163
162
164
**Dependency Notes:**
165
+
163
166
- Use workspace protocol for internal dependencies: `"@metamask/keyring-api": "workspace:^"`
164
167
- Run `yarn lint:dependencies:fix` after adding/updating packages
165
168
- Check `syncpack` for version consistency across packages
@@ -321,54 +324,61 @@ accounts/
321
324
**The dependency relationships between packages are maintained in [README.md](./README.md) with a visual graph. Always run `yarn readme:update` when updating dependencies to keep this graph current.**
- Solution: Replace `any` with proper type (string, number, Json, unknown, etc.)
936
958
937
959
**"Cannot find module '@metamask/...'"**
960
+
938
961
- Solution: Add dependency to package.json and run `yarn install`
939
962
940
963
**"Circular dependency detected"**
964
+
941
965
- Solution: Refactor imports to avoid circular references, use type-only imports if needed
942
966
943
967
**"Test suite failed to run"**
968
+
944
969
- Solution: Check jest.config.js configuration, ensure test file has `.test.ts` extension
945
970
946
971
---
947
972
948
973
## Summary for Quick Reference
949
974
950
975
**Key Commands:**
976
+
951
977
```bash
952
978
yarn install # Install dependencies
953
979
yarn build # Build all packages
@@ -957,6 +983,7 @@ yarn release # Start release process
957
983
```
958
984
959
985
**Key Principles:**
986
+
960
987
1. TypeScript only, no `any` types
961
988
2. Tests colocated with source
962
989
3. High test coverage (>80%)
@@ -965,13 +992,14 @@ yarn release # Start release process
965
992
6. Follow existing patterns in codebase
966
993
967
994
**Before Committing:**
995
+
968
996
-[ ]`yarn lint:fix` passes
969
-
-[ ]`yarn test` passes
997
+
-[ ]`yarn test` passes
970
998
-[ ]`yarn build` succeeds
971
999
-[ ] CHANGELOG.md updated
972
1000
-[ ] Tests added/updated
973
1001
-[ ] Documentation updated
974
1002
975
1003
---
976
1004
977
-
*This document is intended to help AI coding agents understand the codebase structure, patterns, and workflows. For human developers, please also refer to the package-specific README files and MetaMask contributor documentation.*
1005
+
_This document is intended to help AI coding agents understand the codebase structure, patterns, and workflows. For human developers, please also refer to the package-specific README files and MetaMask contributor documentation._
0 commit comments