tsdjs / tsd

Check TypeScript type definitions
MIT License
2.38k stars 68 forks source link

`node_modules/.bin/tsc` conflict with TypeScript in my package.json #122

Open huan opened 3 years ago

huan commented 3 years ago

I ran into https://github.com/huan/sidecar/issues/18 today and found that the @tsd/typescript has a { bin: { tsc: 'typescript/bin/tsc' }} and it overwrites the TypeScript version from my package.json:

https://github.com/SamVerschueren/tsd-typescript/blob/10f4da67ee72ce4005141bc2bef1830d3ae14512/package.json#L14-L16

I'd like to suggest that we should remove the bin entry in the package.json so that it will not overwrite the system version.

zardoy commented 2 years ago

This is a case if you use NPM only, but not Yarn or pnpm.

huan commented 2 years ago

Yes, this behaviour can be different via implementations because module A and B both want to put a binary with the same name, and the NPM can not know which one should be preferred.

BendingBender commented 2 years ago

The way I see it, we should remove the tsc (and other binaries) from our tsc fork (@tsd/typescript).

voxpelli commented 2 years ago

I'm 👍 on this as it apparently has indirectly broken xo on npm 6 for all repos depending on both tsd and xo (which at least @sindresorhus does quite a bit I think + even this repo uses xo, though the raweslint-config-xo packages instead): https://github.com/xojs/xo/issues/555#issuecomment-935062115

SamVerschueren commented 2 years ago

I removed the bin from @tsd/typescript but didn't re-release any patches yet. I'm open to feedback if I should manually release a patch for every major TS version from the past, or if it's ok if this is only the case for newer versions?

shadowspawn commented 2 years ago

I'm looking forward to the change for future versions, don't care about the past versions.