aspnet / LibraryManager

MIT License
457 stars 83 forks source link

@latest tag needs to handle fluctuating version #748

Closed jimmylewis closed 6 months ago

jimmylewis commented 6 months ago

Describe the bug

When using a static version, libman can cache the files locally with a reasonable assumption that they won't change (once published, a package is immutable). However, when using the @latest version in providers that support it (unpkg, jsdelivr), the contents of that "version" do change over time.

Libman needs a way to either convert @latest to a concrete version (i.e. use the same cache folder as the current latest, so that when a new version comes out it uses a different version), or to invalidate the cached files for @latest to avoid reusing outdated assets (this would require some way to know when to invalidate the files and redownload).

To Reproduce

Steps to reproduce the behavior (hypothetical steps):

  1. libman install --provider unpkg jquery@latest
  2. Wait until a new version of jquery ships
  3. libman clean
  4. libman restore

Expected behavior

The new latest version of the library should be installed

Actual behavior

The older version of the library is in the cache, so it gets installed instead.  

Additional context

Issue forked from discussion https://github.com/aspnet/LibraryManager/issues/640#issuecomment-2088113617