entropyxyz / sdk

Official JavaScript SDK for Entropy blockchain.
GNU Affero General Public License v3.0
7 stars 0 forks source link

simplify exports #379

Closed mixmix closed 2 weeks ago

mixmix commented 3 weeks ago

This PR:

mixmix commented 3 weeks ago

@frankiebee here's the minimal start to our TS work

mixmix commented 3 weeks ago

I tried testing the export by linking with CLI but I'm not confident yarn is linking ... EOD :skull:

mixmix commented 3 weeks ago

Ok tests passing, but here's the thing we need to watch: I only defined exports for import and require I did not define a default - this is needed for when import nor require is used / it's an environment where those don't make sense? I removed that cos it was breaking require/import tests. I think this is fine... I guess we'll see later?

mixmix commented 3 weeks ago

type: module just signals what module system this packages is running (ESM/ CJS), I don't think it's about "is this an application" etc. I'm in favour of leaning towards type: module as our default because ESM will slowly win, and it's better for bundling etc (tree shaking easier with esm?)