Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: track circular dependency in the codebase (#29811)
## **Description** This PR introduces circular dependency detection, tracking, and CODEOWNERS. Here are the key changes: 1. Added a new circular dependency detection system: - New script `development/circular-deps.ts` that uses `madge` to detect circular dependencies - New config file `.madgerc` for TypeScript-specific settings - Generated baseline file `development/circular-deps.json` containing current circular dependencies 2. Added new yarn scripts in `package.json`: - `yarn circular-deps:check` - Verifies circular dependencies match baseline - `yarn circular-deps:update` - Updates baseline with current circular dependencies 3. Added CI integration: - Added `.github/workflows/test-circular-deps.yml` to run circular dependency check 4. Assigning appropriate CODEOWNERS to `circular-deps.jsonc` The PR essentially sets up a process to track new circular dependencies while acknowledging existing ones in the codebase. [](https://codespaces.new/MetaMask/metamask-extension/pull/29811?quickstart=1) ## **Related issues** * Fixes: MetaMask/MetaMask-planning#3088 ## **Manual testing steps** 1. Remove (or add) a circular dependency in the code. 2. Run `yarn circular-deps:check` => should report that codebase is out of sync with `circular-deps.jsonc` 3. Run `yarn circular-deps:update` => should update `circular-deps.jsonc` to match the codebase. Inspect the diff. 4. Run `yarn circular-deps:check` => should pass. ## **Screenshots/Recordings** ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: MetaMask Bot <[email protected]> Co-authored-by: Howard Braham <[email protected]>
- Loading branch information