jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.21k stars 505 forks source link

TSDX uses `node_modules/tsdx/node_modules/typescript`, rather than the package version #1044

Closed colemars closed 2 years ago

colemars commented 3 years ago

This leads to some wonky build errors when there are some types relying on more recent ts functionality.

{
    "node_modules/tsdx/node_modules/typescript": {
      "version": "3.9.9",
      "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz",
      "integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==",
      "dev": true,
      "bin": {
        "tsc": "bin/tsc",
        "tsserver": "bin/tsserver"
      },
      "engines": {
        "node": ">=4.2.0"
      }
    },
}

A work around is to specify:

  "resolutions": {
    "typescript": "4.3.2" // your ts version
  }

in your package.json, however, this seems less than ideal.

agilgur5 commented 2 years ago

I think my answer in https://github.com/jaredpalmer/tsdx/issues/1121#issuecomment-1095281489 would answer this as well. Per my comment there, unfortunately it's much easier said than done to do this because of how many of TSDX's deps depend on TS.