deno icon indicating copy to clipboard operation
deno copied to clipboard

fix(install): cache all exports of JSR packages listed in `deno.json`

Open nathanwhit opened this issue 1 year ago • 2 comments

Fixes #26498.

This was a sort of intentional decision originally, as I wanted to avoid caching extra files that may not be needed. It seems like that behavior is unintuitive, so I propose we cache all of the exports of listed jsr packages when you run a bare deno install.

nathanwhit avatar Oct 24 '24 00:10 nathanwhit

LGTM, but I wonder if there's a way someone could express in their deno.json to only cache certain exports or for package authors to say "don't cache this export by default, require an explicit opt-in"

Wouldn't the user only be caching the dependencies actually used in the code of an imported library and not everything in their deno.json or jsr.json?

If somebody forked a lib and wanted to only cache the dependencies used in the code, they could do deno install --entrypoint <mod.ts>. But it makes sense that doing deno install caches literally every dependency listed in the import map.

BlackAsLight avatar Oct 24 '24 01:10 BlackAsLight

Good point! I forgot about that.

dsherret avatar Oct 24 '24 01:10 dsherret