Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict peer-dependency version of TypeScript #1684

Closed
hediet opened this issue Mar 7, 2022 · 4 comments
Closed

Restrict peer-dependency version of TypeScript #1684

hediet opened this issue Mar 7, 2022 · 4 comments

Comments

@hediet
Copy link

hediet commented Mar 7, 2022

To reduce chances of unrelated breaking changes in TypeScript, I suggest that ts-node has a more restrictive peer-dependency constraint on TypeScript.

Currently, it is just >= 2.7:

"typescript": ">=2.7"

However, I think it is better to explicitly list all major versions:
"typescript": "^2.7 || ^3.0 || ^4.0"

@andrewbranch

Again, thanks for creating & maintaining this tool! It allowed us to migrate some ugly untyped JS build scripts to nicely typed TypeScript build scripts :)

@hediet hediet changed the title Restrict version of TypeScript Restrict peer-dependency version of TypeScript Mar 7, 2022
@andrewbranch
Copy link

Since TypeScript doesn’t follow SemVer, I don’t think such a scheme buys ts-node users anything.

@cspotcode
Copy link
Collaborator

Looks like @andrewbranch beat me to it, but since I'd already drafted this reply:

You're very welcome, I'm glad it's useful.

Would this explicit list prevent the breakage we saw? The breakage happened in a nightly build of a minor version of typescript.

In a few issues, I said that this was affecting consumers of stable TS 4.6 but now I'm not so sure, was it only affecting nightly builds?

I'm worried that more restrictive versioning will require ts-node to publish a new version every time TS publishes a new version.

@andrewbranch
Copy link

I believe the breaking API change in TS did not ship in 4.6, so currently only nightly users have been affected, but that change will ship in 4.7 in a few months.

@hediet
Copy link
Author

hediet commented Mar 8, 2022

Since TypeScript doesn’t follow SemVer, I don’t think such a scheme buys ts-node users anything.

Hmm, that is unfortunate.

Thanks anyway!

@hediet hediet closed this as completed Mar 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants