open-cli-tools / concurrently

Run commands concurrently. Like `npm run watch-js & npm run watch-less` but better.
https://www.npmjs.com/package/concurrently
MIT License
7k stars 228 forks source link

fix: move `types` condition to the front #422

Closed Andarist closed 1 year ago

Andarist commented 1 year ago

I moved types condition to the front. package.json#exports are order-sensitive - they are always matched from the top to the bottom. When a match is found then it should be used and no further matching should occur.

Right now, the current setup works in TypeScript but it's considered a bug and it should not be relied upon, see the thread and the comment here. For that reason, I would like to fix all popular packages that misconfigured their exports this way so the bug can be fixed in TypeScript.

coveralls commented 1 year ago

Coverage Status

Coverage: 99.483%. Remained the same when pulling afade6352da803657176b736142412329b13a5c8 on Andarist:fix/types-condition into 23c32179c7c6b97d3872880d55a8218180bbda2e on open-cli-tools:main.

paescuj commented 1 year ago

Thanks!

Andarist commented 1 year ago

@paescuj note that this is still not 100% correct, see arethetypeswrong:

Imports of "concurrently" under the node16 module resolution setting when the importing module is ESM (its extension is .mts or .mjs, or it has a .ts or .js extension and is in scope of a package.json that contains "type": "module") resolved to CJS types, but ESM implementations.

This PR fixed specifically the other error (🐛 Used fallback condition).

Andarist commented 1 year ago

@paescuj would there be a chance to cut a release with this small fix?

gustavohenke commented 1 year ago

Done @Andarist!

Andarist commented 1 year ago

awesome, thank you very much! ❤️