lowlighter / libs

🍱 Collection of carefully crafted TypeScript standalone libraries. Minimal, unbloated, convenient.
https://jsr.io/@libs
MIT License
118 stars 11 forks source link

Error importing dependencies in v3.0.0 #34

Closed oscarotero closed 6 months ago

oscarotero commented 6 months ago

In version 3.0.0, dependencies are declared in the import map, so it doesn't work importing them from deno.land/x.

error: Failed resolving types. Relative import path "@std/io" not prefixed with / or ./ or ../
    at https://deno.land/x/xml@3.0.0/utils/types.ts:1:33
lowlighter commented 6 months ago

This should be fixed with 3.0.2

Basically we have this type Flux = Deno.ReaderSync & Deno.SeekerSync but as they're planning to remove Deno.ReaderSync for Deno 2 (it was moved to std/io/types.ts), I mistakenly introduced a type dependency to get it back

Thing is jsr doesn't support https imports and https import doesn't work with import maps so it was kind of unfortunate 😅

Since this type only contain a single method definition I figured out it'd be simpler to vendor it in back: https://github.com/lowlighter/xml/blob/640e322882f24530e932bdc13db10ceb4a82df69/utils/types.ts#L13-L15

Might need to do it later for Deno.SeekerSync too, but oddly enough it seems the only type that is surviving the purge, it isn't listed in Deno 2 migration guide

But yeah, this lib is now again truly dependencyless, thanks for reporting this issue