Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove depcheck #820

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

chore: remove depcheck #820

wants to merge 2 commits into from

Conversation

boneskull
Copy link
Contributor

@boneskull boneskull commented Dec 21, 2023

This adds dependency-cruiser to replace depcheck, which does a very thorough check of all referenced packages throughout the codebase.

After configuration, I went through and fixed the problems it highlighted (of which there were many).

Closes #793


Reviewers

You'll want to look at everything here, as there were numerous problems. Hopefully I split it up in a way that makes sense.

@boneskull boneskull requested review from legobeat and a team as code owners December 21, 2023 21:35
@boneskull
Copy link
Contributor Author

boneskull commented Dec 21, 2023

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @boneskull and the rest of your teammates on Graphite Graphite

@boneskull boneskull added the chore overhead, tests, dev env, etc. label Dec 21, 2023
@boneskull boneskull self-assigned this Dec 21, 2023
@boneskull boneskull requested a review from leotm December 21, 2023 21:36
@boneskull
Copy link
Contributor Author

An "orphan" is a file that isn't referenced by any other file. I think we can create exceptions for many of these esp in core

@boneskull
Copy link
Contributor Author

also I neglected to run any tests so I'm not surprised I broke it

@boneskull
Copy link
Contributor Author

OK, I've got it down to a single warning.

❯ npm run lint:deps

> lavamoat-monorepo@0.0.0 lint:deps
> depcruise -c ./.config/dependency-cruiser.js packages scripts


  info optional-deps-used: packages/node/test/prepare.js → node_modules/corepack/package.json
  warn no-orphans: packages/tofu/src/referenceTracker.js

✘ 2 dependency violations (0 errors, 1 warnings). 339 modules, 574 dependencies cruised.

This orphan file (tofu/src/referenceTracker.js) appears to not be used at all, so I'm hoping someone can justify its existence. @kumavis maybe?

@boneskull
Copy link
Contributor Author

"2 dependency violations" is rather misleading, since the first one is not a violation at all.

@boneskull boneskull force-pushed the boneskull/depcruise branch 4 times, most recently from 7ade82f to f7e9092 Compare March 20, 2024 00:42
Base automatically changed from boneskull/zap-aa-macos-perf-test to main March 20, 2024 10:51
Copy link

socket-security bot commented Mar 20, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/dependency-cruiser@16.0.0 Transitive: environment, eval, filesystem, shell, unsafe +48 7.08 MB sverweij

🚮 Removed packages: npm/depcheck@1.4.7

View full report↗︎

@boneskull
Copy link
Contributor Author

boneskull commented Mar 21, 2024

I've removed all of the changes that aren't just removing depcheck and configuring dependency-cruiser from this PR.

The lint check should fail.

Ref: #1123 #1124 #1125 #1126 #1127

Base automatically changed from boneskull/issue1103 to main March 26, 2024 22:10
@boneskull boneskull force-pushed the boneskull/depcruise branch 2 times, most recently from d76bb3c to bed4301 Compare March 27, 2024 19:50
This adds [dependency-cruiser](https://npm.im/dependency-cruiser) to replace [depcheck](https://npm.im/depcheck), which does a _very_ thorough check of all referenced packages throughout the codebase.

To support this, I needed to create quite a few exceptions, as we often reference non-existent packages in our tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore overhead, tests, dev env, etc. dependencies Pull requests that update a dependency file pkg:@lavamoat/aa Changes in package @lavamoat/aa pkg:@lavamoat/allow-scripts Changes in package @lavamoat/allow-scripts pkg:@lavamoat/lavapack Changes in package @lavamoat/lavapack pkg:@lavamoat/laverna pkg:@lavamoat/webpack Changes in package @lavamoat/webpack pkg:lavamoat-browserify Changes in package lavamoat-browserify pkg:lavamoat-core Changes in package lavamoat-core pkg:lavamoat-perf Changes in package lavamoat-perf pkg:lavamoat-tofu Changes in package lavamoat-tofu
Projects
None yet
Development

Successfully merging this pull request may close these issues.

replace depcheck
3 participants