Skip to content

Commit

Permalink
refactor: Make TS a peer dep (#1798)
Browse files Browse the repository at this point in the history
* refactor: Makes TS an optional peer dependency

* docs: Adding changeset
  • Loading branch information
rschristian authored Jul 6, 2023
1 parent 73232fd commit 96fc0f3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
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

0 comments on commit 96fc0f3

Please sign in to comment.