Script parser doesn't account for optional "run" when running scripts
It seems like the script parser doesn't detect scripts when omitting the run keyword for package managers like pnpm and yarn.
In the following Github Action example, the start:server script is reported as an unlisted binary:
- name: Run dev API in the background background
run: |
pnpm -F @snaplet/seed start:server &
npx --yes wait-on -d 5000 -i 2000 -t 20000 http://localhost:3000 --log --verbose
This is fixable by explicitly using run like this: pnpm -F @snaplet/seed run start:server &.
But it would be cool if the script parser works without it. 😄
This issue is specific to monorepos. Knip should not match start:server in the current workspace, but in -F this one. Unfortunately this isn't trivial given how Knip currently handles this.
In general Knip should handle either pnpm start:server or pnpm run start:server fine, but does not work as expected when using the -F argument.
Closing this as "wontfix".