esm-dev / esm.sh

A fast, smart, & global CDN for modern(es2015+) web development.
https://esm.sh
MIT License
3.14k stars 151 forks source link

Packages should import latest semver-compatible version of dependencies #276

Open ysulyma opened 2 years ago

ysulyma commented 2 years ago

I am importing https://esm.sh/liqvid and https://cdn.esm.sh/v68/@liqvid/katex. The first correctly imports the latest version liqvid@2.1.3. However, the second is importing liqvid@2.1.1 as a dependency, which causes code to break since it's accessing the wrong Liqvid context. The @liqvid/katex package declares "liqvid": "^2.1.1" as a dependency; since 2.1.2 matches ^2.1.1 and is newer than 2.1.1, it should be imported.

ije commented 2 years ago

try to add ?deps=liqvid@2.1.3 to change the liqvid version

ysulyma commented 2 years ago

That's what I resorted to, and it worked, but it should happen automatically

matt-way commented 2 years ago

How does esm determine the dependency version? Is this just a bug, where the package.json semver isn't being honoured correctly, or is it something else?