Hello @tsnobip,
Step 1
The first step is to build the library and then find a way to avoid relying on rescript for JS bindings. This means rewriting somb bindings by hand or use nullable instead of option as adviced by @fham here.
Step 2
Decide on an API. Somehow the conventions are a little different if the library is used in ReScript, where you can expose methods such as “use” or in TypeScript where you cannot (because it is part of React and the habit is not to use namespaces so much).
This step was a bit confusing and I decided to have some differences (Tilia.use in ReScript vs useTilia in TS).
Step 3
Decide on creating the TypeScript types (and/or bindings to the compiled JS) by hand or with @genType.
I created the types by hand because the API surface is really small and I have an index.js file that does the rewiring to the TiliaCore.mjs files.
Step 4
Bundle. I decided to use esbuild for this and output for both cjs and esm modules.
Step 5
Configure package.json and .npmignore.
I had to use main and module entries to export for cjs and esm (using exports would hide ReScript sources).
My .npmignore keeps dist files and .res and .resi files in src.
For those interested, don’t hesitate to copy some files from the repo. I would be very proud if my little project helps others.
Step 6
Discover crazy bugs from your early adopters and fix them with passion 
PS: I didn’t know with which semver version to use for my alpha publication. If I could go back in time, I would start at “0.1.0”…