nbd-wtf / nostr-tools

Tools for developing Nostr clients.
The Unlicense
706 stars 197 forks source link

NIP-06 removed from exports? #351

Closed josefelbez closed 9 months ago

josefelbez commented 9 months ago

Hey, after updating from 1.17 to 2.1.3 I realized that there is no exports for the nip06 anymore, is there a workaround?

image

It is still listed as within the lib but inaccessible, at least not typed

image

fiatjaf commented 9 months ago

Yes, you can do import * as nip06 from 'nostr-tools/nip06.ts' or something like that.

josefelbez commented 9 months ago

Yes, you can do import * as nip06 from 'nostr-tools/nip06.ts' or something like that.

Unfortunatelly there is no nostr-tools/nip06.ts, only way is to import from folder cjs or esm but this way we lose types, perhaps is there a better way to keep using the typed one?

fiatjaf commented 9 months ago

Sorry, it's nostr-tools/nip06.

josefelbez commented 9 months ago

Sorry, it's nostr-tools/nip06.

image image

fiatjaf commented 9 months ago

2024-01-18-084243_677x232_scrot

josefelbez commented 9 months ago

image

It does not make sense, can you confirm that you are using the same version as me? 2.1.3

image

josefelbez commented 9 months ago

@fiatjaf please can u reopen the issue?

fiatjaf commented 9 months ago

Yes, I am using 2.1.3.

Can you try running it on Node, Deno or Bun?

josefelbez commented 9 months ago

Yes, I am using 2.1.3.

Can you try running it on Node, Deno or Bun?

Hi, tried with yarn, npm, deno and bun, only bun seems to work properly with types.

With yarn: image image

With npm: image image

with bun: image image

With deno seems to work but no types: image image

I used save exact to garantuee they were at the same version

fiatjaf commented 9 months ago

Then it must be because you're using an old version of TypeScript? I'm guessing, I don't understand this mess.

josefelbez commented 9 months ago

image

Weirdly i'm using ts 5.2.2, but ok. I'll just do a workaround and remove the nip06 from my stuff.

Thanks for the help

fiatjaf commented 9 months ago

I am sorry, but I really don't understand the JS ecosystem. I can barely make it work on my machine.

fiatjaf commented 9 months ago

This is the solution: https://stackoverflow.com/a/70020984