denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
96.4k stars 5.33k forks source link

"deno info" should ignore lock file #17169

Open bartlomieju opened 1 year ago

bartlomieju commented 1 year ago

Currently if there's a "deno.json(c)" and "deno.lock" then "deno info" will print out all npm packages that are listed in the lockfile, even if the entry point is not an npm package (nor does it have npm imports). This is unexpected behavior and led to some confusion in https://github.com/denoland/deno/issues/17167#issuecomment-1363397034.

Since deno info doesn't have --lock flag available in this case the lockfile should be ignored.

dsherret commented 1 year ago

I don't think it should ignore the lockfile because the lockfile may contain information such as what version a package requirement should resolve to. It seems like there's two things we should fix here:

  1. deno info should have the lock flags.
  2. Only show npm packages relevant to the files that were analyzed. I'm not sure we should even do that because the other npm packages are loaded with a lockfile and that might be useful information to some people.