bin/importmap outdated fails when using nested package path (e.g. photoswipe/lightbox)
Steps to reproduce:
- Pin a nested ESM path from a package:
bin/importmap pin photoswipe/lightbox
This produces:
Pinning “photoswipe/lightbox” to vendor/javascript/photoswipe/lightbox.js via download from https://ga.jspm.io/npm:photoswipe@5.4.4/dist/photoswipe-lightbox.esm.js
- Run:
Actual result:
/Users/xeross/.gem/ruby/3.4.7/gems/importmap-rails-2.2.2/lib/importmap/npm.rb:95:in 'Importmap::Npm#get_json': Unexpected error response 404: "version not found: lightbox" (Importmap::Npm::HTTPError)
Importmap attempts to look up “lightbox” as an NPM package, instead of resolving it as a subpath of “photoswipe”. Pin handles this correctly, but outdated breaks because it splits the name incorrectly and treats the subpath as a separate package.