paulmillr / noble-hashes

Audited & minimal JS implementation of hash functions, MACs and KDFs.
https://paulmillr.com/noble
MIT License
545 stars 46 forks source link

Add source map to build output. #41

Closed MicahZoltu closed 1 year ago

MicahZoltu commented 1 year ago

This change will make it so source maps are shipped along side the JS files and they will contain the TS source content as well. Including these will make it so developers can step into and through the original source code of this library when debugging their problems which can help facilitate users finding bugs in their code, as well as isolating potential bugs in this library.

MicahZoltu commented 1 year ago

Note: Since this project appears to use rollup, you may need to add something to make it so rollup will also rollup the sourcemap file(s). I'm pretty sure it has this ability, and it may do it automatically, but someone more familiar with rollup will need to figure out how to do that. Either way, this is the first step and I think worth doing even if a necessary rollup change isn't completed immediately.

paulmillr commented 1 year ago

Rollup is only used to build a single browser friendly umd file which is discouraged to use.

MicahZoltu commented 1 year ago

In that case I think this PR will work as-is, but someone should definitely verify this by doing a full dry run of an NPM publish and verifying that all of the right files end up in all of the right places.

paulmillr commented 1 year ago

=> 1.2.0; but i've removed inlineSources - duplication seems suboptimal compared to including src directory

MicahZoltu commented 1 year ago

I'm a fan of that solution. Thanks!