-
Notifications
You must be signed in to change notification settings - Fork 24
Move typescript to a peer dependency #110
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
Conversation
|
My suggestion (which I already suggested to @wagenet in a Discord DM, just noting here for posterity): go ahead and move TS to |
efa8518 to
6fbf877
Compare
6fbf877 to
3134817
Compare
|
Unfortunately, I'm not sure how to fix these test failures. |
| "typescript": "^4.5.5" | ||
| }, | ||
| "peerDependencies": { | ||
| "typescript": "^4.0.3" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wagenet I may be wrong, but this not gonna make any difference as still will install typescript@4.0.3 by npm 7+
It's technically the same as replacing "typescript": "~4.0.3" with "typescript": "^4.0.3".
To truly decouple typescript version from broccoli-typescript-compiler, maybe you meant to make this
"peerDependencies": {
"typescript": "*"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
},There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@SergeAstapov ah, you may be correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that this means that, if a newer compatible version is installed, it will use that one. So this should be correct. I've been having some trouble validating it in practice either way.
721dd02 to
81edec3
Compare
a504267 to
2483596
Compare
2483596 to
bccc957
Compare
chancancode
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we assert that TypeScript is actually installed (with require.resolve maybe?) and that it actually matches the semver range we asked for, since peer dependencies are just a "recommendation" in multiple versions of NPM? (It would have failed anyway, but we can give a nicer error message)
Otherwise looks good
|
This probably needs to be a breaking change since you automatically get typescript from having this package before, and that no longer happens after this change. (Probably should update the install instructions as well) |
|
@chancancode sounds good. |
This will allow the version of typescript to be determined by whoever is using this.