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

refactor: Make TS a peer dep #1798

Merged
merged 2 commits into from
Jul 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .changeset/empty-experts-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'preact-cli': minor
---

TypeScript is now an optional peer dependency, rather than a direct dependency, of `preact-cli`.

If you use TypeScript in your projects (`.ts` or `.tsx`), you will need to have your own version of TypeScript installed and added to your `package.json`. This gives you greator control over the version of TypeScript used and most already have TypeScript listed as a dependency anyways.

For those not using TypeScript, no change is needed, and this should make your `node_modules` directory a bit smaller (~20% w/ barebones dependency list).
10 changes: 7 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
"stack-trace": "0.0.10",
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^4.2.3",
"typescript": "~4.6.4",
"update-notifier": "^5.1.0",
"url-loader": "^4.1.1",
"validate-npm-package-name": "^4.0.0",
Expand Down Expand Up @@ -133,14 +132,16 @@
"shelljs": "^0.8.3",
"sirv": "^1.0.11",
"stylus": "^0.54.8",
"stylus-loader": "^4.3.3"
"stylus-loader": "^4.3.3",
"typescript": "~4.6.4"
},
"peerDependencies": {
"less-loader": "^7.3.0",
"preact": "*",
"preact-render-to-string": "*",
"sass-loader": "^10.2.0",
"stylus-loader": "^4.3.3"
"stylus-loader": "^4.3.3",
"typescript": "^4.6.4"
},
"peerDependenciesMeta": {
"less-loader": {
Expand All @@ -151,6 +152,9 @@
},
"stylus-loader": {
"optional": true
},
"typescript": {
"optional": true
}
},
"engines": {
Expand Down