butaneprotocol / translucent-compat

Deprecated in favour of blaze https://github.com/butaneprotocol/blaze-cardano
https://github.com/butaneprotocol/blaze-cardano
Other
15 stars 8 forks source link

added compile step and node module resolution to translucent-blueprint #39

Open Piefayth opened 6 months ago

Piefayth commented 6 months ago

Closes #38

bun run build from the translucent-blueprint folder should produce a valid artifact for any platform that supports the node apis now.

I found one limitation WRT imports described here. Essentially, typescript won't transpile import foo from './foo to import foo from './foo.js no matter what you do. Likewise, the node team specifically refuses to allow ./foo style ESM imports. Luckily, Bun can interpret xxx.js as xxx.ts when handling imports, so the simplest solution here is just to use from xxx.js style imports in translucent-blueprint. It sure looks silly, though.

Also fixed up the test I added to be a lil more Bun-idiomatic, since I had to touch it anyway.