esm.sh icon indicating copy to clipboard operation
esm.sh copied to clipboard

tgz support

Open stainless-em opened this issue 7 months ago • 9 comments

adds support for .tar.gz files from arbitrary urls

stainless-em avatar May 07 '25 16:05 stainless-em

Would be very helpful for supporting Stainless packages in Val Town 👍

stevekrouse avatar May 07 '25 17:05 stevekrouse

specifically preview versions, which we upload as tarballs to our own servers

stainless-em avatar May 07 '25 17:05 stainless-em

I've found that val town doesn't acquire types for any val town sdk's actually via esm.sh but yes for npm, but I'm not sure why. (To be fair our type acquisition is super janky, so it might not be worth designing around too much.)

stevekrouse avatar May 07 '25 17:05 stevekrouse

@stainless-em thanks, this is great! do you think we can remove the package name in the tgz path? like:

- https://esm.sh/tgz/preact@https%3A%2F%2Fregistry.yarnpkg.com%2Fpreact%2F-%2Fpreact-10.26.6.tgz
+ https://esm.sh/tgz/https%3A%2F%2Fregistry.yarnpkg.com%2Fpreact%2F-%2Fpreact-10.26.6.tgz

ije avatar May 08 '25 03:05 ije

I've found that val town doesn't acquire types for any val town sdk's actually via esm.sh but yes for npm, but I'm not sure why. (To be fair our type acquisition is super janky, so it might not be worth designing around too much.)

@stevekrouse i will look into it, can you please provide a code smaple for testing? Thanks🙏

ije avatar May 08 '25 03:05 ije

do you think we can remove the package name in the tgz path?

Possibly, I tried that first actually. But then the PkgName in the EsmPath would need to be empty I think? Because there's no way to know what it is until the tarball is downloaded? idk

stainless-em avatar May 08 '25 14:05 stainless-em

Possibly, I tried that first actually. But then the PkgName in the EsmPath would need to be empty I think? Because there's no way to know what it is until the tarball is downloaded? idk

makes sense, can you please check the CI? i'm love to the merge this after the CI passing. Thanks!

ije avatar May 12 '25 00:05 ije

tbc i think having the pkgname in the url is bad but i'm not familiar enough with how esm.sh is structured to know how to get rid of it 😅

stainless-em avatar May 12 '25 16:05 stainless-em

how is this pr evolving ?

alexandre-hallaine avatar Jun 17 '25 20:06 alexandre-hallaine