chore(tooling): make circular dependency check deterministic - #641
Open
Harry19081 wants to merge 1 commit into
Open
chore(tooling): make circular dependency check deterministic#641Harry19081 wants to merge 1 commit into
Harry19081 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
pnpm check:circularinvoked an unpinnednpx madge, so the analyzer version could change between runs or require a network download. Madge also traversed imported stylesheets and misread SCSS keyframes and Tailwind directives as dependencies, producing 37 false skipped-file warnings. Three valid package-export imports added more skipped warnings even though Node resolves them successfully.Solution
madgeat 8.0.0 in development dependencies and the pnpm lockfile.scripts/quality/check-circular-dependencies.mjs.--jsonoutput for detached commit-stat collection and update that collector to use the pinned checker.The checker now has deterministic dependencies, prints no false warnings on the current graph, and fails for either a real TypeScript cycle or an unresolved source import.
Potential risks
The lockfile adds Madge and its development-only transitive dependency graph. It does not change production dependencies or application bundles, and
pnpm install --frozen-lockfile --ignore-scriptspassed. Stylesheet subtrees are intentionally excluded, so this command does not detect CSS or SCSS import cycles; its declared scope remains TypeScript and TSX. The script usesimport.meta.resolve, which requires the Node 20 runtime already configured in CI and release workflows.The detached commit-stat collector still receives the same JSON array shape. Rollback is a direct revert of this commit; there are no runtime configuration, persistence, or public API changes.
Verification
pnpm install --frozen-lockfile --ignore-scriptspnpm check:circular— no cycles or skipped-import warnings across 6,092 modulesnode scripts/quality/check-circular-dependencies.mjs --json— emitted[]./missingimport; probe files were removed afterwardpnpm typecheckpnpm lintpackage.jsonand both changed tooling scriptsgit diff --checkand added-line scan for secrets, personal paths, and debug statements