tshet-uinh-js icon indicating copy to clipboard operation
tshet-uinh-js copied to clipboard

[WIP]

Open graphemecluster opened this issue 1 year ago • 5 comments
trafficstars

Bundle type declaration to avoid exposing internal types and enforce encapsulation

TODOs

  • Convert Unicode escapes in outputted index.d.ts into actual code points Alternatively, use rollup-plugin-dts

graphemecluster avatar Oct 07 '24 12:10 graphemecluster

  • Alternatively, use rollup-plugin-dts

We've used rollup-plugin-dts before, but it ~~didn't build the correct module structure~~ (edit: I've tried again. It does now, but it doesn't preserve the docs for any exported name, only showing wierd aliases), and it's not in active development for some time.

syimyuzya avatar Feb 04 '25 15:02 syimyuzya

Nonetheless, I like the idea that we build multiple target formats. (btw do we really need the CJS target? I understand that the UMD one is for single-file distribution, and the ESM one for pakage managers. CJS just seems redundant 🤔

syimyuzya avatar Feb 04 '25 15:02 syimyuzya

CJS just seems redundant 🤔

Actually I once thought so too (but nevertheless merged that PR. I forgot the reason why). Let’s remove it

graphemecluster avatar Feb 06 '25 00:02 graphemecluster

I would like to try @microsoft/api-extractor, but I don’t think I’ll have the time to dig into it anytime soon. Help me take a look into it if you’ve got the time (unless you don’t think doubling the file size (before gzip) is a problem) 😄

graphemecluster avatar Feb 06 '25 00:02 graphemecluster

@syimyuzya I don’t think the entire type definition is currently in a usable state: https://arethetypeswrong.github.io/?p=tshet-uinh%400.15.1 So it seems crucial to give it a fix soon.

P.S. Be careful not to make the same mistake I made with the library mentioned above, which is a problem Masquerading as ESM/CJS: https://arethetypeswrong.github.io/?p=to-jyutping%403.1.1

graphemecluster avatar Feb 06 '25 00:02 graphemecluster

I just found that the ESM build in this configuration is also bundled into a single file 🤔

~~Is this really desired, as the UMD build already serves this purpose~~? edit: I got it. That's also for browser usage but with ESM.

syimyuzya avatar Mar 15 '25 06:03 syimyuzya