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
I've made sure the reproduction is publicly accessible
Description of the issue
When running knip for a single workspace, it's supposed to analyze both ancestors and dependents of the workspace. However it seems to currently only handle ancestors properly.
To reproduce:
open the default monorepo reproduction StackBlitz (or here)
run yarn knip -W packages/client --debug > debug.txt
search for "Included workspaces" in debug.txt
I would expect to find:
@knip/templates-monorepo (the ancestor) ✅
@monorepo/client (the actual package) ✅
@monorepo/shared (the dependent) ❌
But the last one is missing.
As a result, analyzing a single package is broken as it reports false negatives used in dependents.
I'm not completely sure, but I think the bug comes form this line as:
wsPackages contains the package paths
but name contains the package name
So this is always evaluates to false
The text was updated successfully, but these errors were encountered:
Thanks for the report, Tim! Turns out that line you point out was returning itself 😱 No idea how this could creep in there, but I've added some coverage so this shouldn't happen again.
Prerequisites
Reproduction url
https://stackblitz.com/edit/github-qsxgp9wd?file=debug.txt
Reproduction access
Description of the issue
When running
knip
for a single workspace, it's supposed to analyze both ancestors and dependents of the workspace. However it seems to currently only handle ancestors properly.To reproduce:
yarn knip -W packages/client --debug > debug.txt
debug.txt
I would expect to find:
@knip/templates-monorepo
(the ancestor) ✅@monorepo/client
(the actual package) ✅@monorepo/shared
(the dependent) ❌But the last one is missing.
As a result, analyzing a single package is broken as it reports false negatives used in dependents.
I'm not completely sure, but I think the bug comes form this line as:
wsPackages
contains the package pathsname
contains the package nameSo this is always evaluates to
false
The text was updated successfully, but these errors were encountered: