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

Don't look for dependents of packages with deleted files if those packages were not fully deleted #930

Merged
merged 2 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cold-kiwis-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@definitelytyped/definitions-parser": patch
---

Don't look for dependents of packages with deleted files if those packages were not fully deleted
5 changes: 5 additions & 0 deletions packages/definitions-parser/src/get-affected-packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export async function getAffectedPackages(
// For packages that have been deleted, they won't appear in the graph anymore; look for packages
// that still depend on the package (but via npm) and manually add them.
for (const d of git.deletions) {
if (await allPackages.tryGetTypingsData(d)) {
// The package wasn't actually deleted.
continue;
}

for (const dep of await allPackages.allTypings()) {
for (const [name, version] of dep.allPackageJsonDependencies()) {
if (
Expand Down
Loading