drand / tlock-js

Timelock Encryption made practical. A Typescript library for encrypting for the future.
Other
105 stars 8 forks source link

removed module.js from package.json #38

Closed CluEleSsUK closed 1 year ago

CluEleSsUK commented 1 year ago

imported Buffer everywhere so browsers don't need a polyfill

wighawag commented 1 year ago

How do you package your lib

I tried

npm run compile

but it build all in the dist folder and the package.json do not refer to it. I could change it but want to test the real build so I can link to it in my app to test

CluEleSsUK commented 1 year ago

The packaging is a little magical: https://github.com/drand/tlock-js/blob/0638fc39a0b8ad73990cdd430f9661b7ee6768ef/.github/workflows/build.yml#L27

We do it via a github action that moves some stuff around. Previously we used parcel which was a bit of a pain mapping dist folder to be packaged and such. I'd love to move to esbuild and just build a single js file, but unfort that'd be a breaking change for anyone using imports such as "tlock-js/age"

edit: this is also why the references to .js files in the package.json look wrong

wighawag commented 1 year ago

Thanks, I ll try that

Been playing with typescript/js for a while but still not sure best way to organize build pipeline but for now I am quite happy with tsup (which use esbuild behind the scene) and it supports multiple entries/output, so maybe it can work for you

wighawag commented 1 year ago

Any update on this ? I am now integrating tlock-js in a production build and would like to use the latest tlock-js but still need to patch it.

CluEleSsUK commented 1 year ago

sorry, @AnomalRoil is out until tomorrow - he should be around to approve and merge then!