rvagg / cborg

fast CBOR with a focus on strictness
Other
47 stars 13 forks source link

Fix import errors while using TypeScript+ESM #86

Closed alula closed 1 year ago

alula commented 1 year ago

Should close #77

rvagg commented 1 year ago

@alula can you run npm run build and confirm that the package.json in build/ contains these? cborg is still using https://github.com/mikeal/ipjs to cross-compile esm and cjs but it does its own funky things with package.json, and I suspect it's going to be stripping out these fields. We could either fix it in ipjs, or just ditch ipjs entirely and go esm-only, which is a TODO I have here anyway.

rvagg commented 1 year ago

ah, it even fails in CI: https://github.com/rvagg/cborg/actions/runs/5675282092/job/15666542079?pr=86 sad

rvagg commented 1 year ago

I'm going to pull the trigger on https://github.com/rvagg/cborg/pull/91 soon and cut a 3.0.0 that drops CJS, and in the meantime skip a compile step completely and ship the types as they are. You could help by installing cborg@3.0.0-alpha.1 and seeing if that (a) works and (b) solves your problems.

rvagg commented 1 year ago

should be fixed by 3.0.0

alula commented 1 year ago

Sorry for late response, 3.0.0 works fine for me!