Closed SnarkBoojum closed 2 years ago
Are these problems causing issues for you or were you just trying to update TS because it was older?
Well, I'm packaging node-pty for Debian, so I need to be able to compile the code.
Oh I see, the package.json shows "typescript": "^3.8.3"
:
https://github.com/microsoft/node-pty/blob/1674722e1caf3ff4dd52438b70ed68d46af83a6d/package.json#L58
To get it working try running npm i -D typescript@3.8.3
to pin the right version.
No, npm is a distribution, Debian is another: we don't use npm packages to build Debian ones.
And we start from sources, not pre-built binaries.
So I want to improve the code so it "works" with recent versions of tsc.
If the above works you can make a PR, the ^
means that package minor versions will be updated automatically and TS doesn't follow semantic versioning which breaks this model.
The above:
Updating/validating typescript will take more effort than I'm willing to invest right now as I have too much to do. Looking into this just now there is no problem. We use yarn.lock to pin dependencies and that ensures that npm/yarn will only install typescript 3.8.3:
You seem to be assuming you can take a library and build it with the latest version of typescript, that's not how it works and you're bound to run into problems building code that has not been validating with the newer compiler. It's similar to taking a Python 2 program and assuming it will work in Python 3, since tsc contains breaking changes.
I appreciate you want to improve the code but it's not necessary, things work fine with the older version of tsc and it still compiles valid JS.
There seem to be a number of typing problems with node-pty 0.10.0 and newer typescript (here: 4.6.3).
I can go further with the following patch:
where you'll notice most chunks are commenting out code: I don't know if the lines should just be dropped or if there's an api call to use - I just wanted to see if I could get further.
I'm still stuck with:
I hope that helps.