maninak / ts-xor

Compose object types containing mutually exclusive keys, using this generic Typescript utility type.
https://app.radicle.at/nodes/seed.radicle.at/rad:z3nP4yT1PE3m1PxLEzr173sZtJVnT
MIT License
106 stars 5 forks source link

Wrong built files mapping when using lastest ECMAScript Modules config in tsconfig.json #23

Closed hoangngocthanh closed 1 year ago

hoangngocthanh commented 1 year ago

Due to https://www.typescriptlang.org/docs/handbook/esm-node.html, it required a full import with file extension when using latest ECMAScript Modules config in tsconfig.json, so it cause a bug that can not expose the XOR declaration. How to reproduce: Set: compilerOptions.moduleResolution: "NodeNext" in tsconfig.json

image

maninak commented 1 year ago

Interesting. Thank you for reporting this!

A quick audit with publint shows no errors and one suggestion:

image

I wonder if addressing that will fix it or if there's more to it. I definitely want to look more into this.

maninak commented 1 year ago

@hoangngocthanh could you please append the full contents of your tsconfig.json file in your original message?

maninak commented 1 year ago

Should be fixed with v1.1.1. @hoangngocthanh please let me know how that works for you.

Also, any feedback about the new release's compatibility with existing repos importing ts-xor and having different tsconfig configurations would also be appreciated. Tried my best not too, but it's hard to know I haven't introduced a regression with the cjs/esm mess... :man_shrugging:

hoangngocthanh commented 1 year ago

Should be fixed with v1.1.1. @hoangngocthanh please let me know how that works for you.

Also, any feedback about the new release's compatibility with existing repos importing ts-xor and having different tsconfig configurations would also be appreciated. Tried my best not too, but it's hard to know I haven't introduced a regression with the cjs/esm mess... 🤷‍♂️

I find it working well with v1.1.1, thanks for the support!