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

Core: Add typescript as optional peer dependency #13330

Merged
merged 3 commits into from Dec 1, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/react/package.json
Expand Up @@ -67,6 +67,11 @@
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"typescript": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't typescript be listed as peerDependencies too? Or having this peerDependenciesMeta info is enough and Yarn will "do it" for us under the hood?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically it would be more correct to list it, yes. However when we introduced the feature some maintainers were concerned that it would print more warnings on older package managers (for example for their users running npm 5), so we improved it by making peerDependenciesMeta imply a corresponding peer dependency on * (this way older package managers just ignore the peer dependency). So in short, it's as you prefer, we support both 🙂

"optional": true
}
},
"engines": {
"node": ">=8.0.0"
},
Expand Down
5 changes: 5 additions & 0 deletions lib/core/package.json
Expand Up @@ -159,6 +159,11 @@
"react": "^16.8.0 || ^17.0.0",
"react-dom": "^16.8.0 || ^17.0.0"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
},
"publishConfig": {
"access": "public"
},
Expand Down