Skip to content

Commit

Permalink
chore(deps): move styled-component from deps to peerDeps
Browse files Browse the repository at this point in the history
This is considered "the right way", as styled-components generally don't work
well when there are multiple versions on the same page (because of mismatch in
theme context providers, the provided theme values won't be available).

This is step #1 - we'll have to actually make sure styled-components is
installed in each studio (we can't strictly rely on npm7s peer dep behavior).

That task will be handled by the Sanity CLI tool - we'll check on startup,
build, deploy and similar whether or not we have the necessary dependencies
installed, and prompt to install them if not.
  • Loading branch information
rexxars committed Sep 3, 2021
1 parent 02895c8 commit 54e0d1e
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 40 deletions.
6 changes: 3 additions & 3 deletions packages/@sanity/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@
"rxjs-etc": "^10.6.0",
"rxjs-exhaustmap-with-trailing": "^1.0.0",
"semver-compare": "^1.0.0",
"shallow-equals": "^1.0.0",
"styled-components": "^5.2.1"
"shallow-equals": "^1.0.0"
},
"devDependencies": {
"@types/chance": "^1.1.0",
Expand All @@ -110,6 +109,7 @@
"peerDependencies": {
"prop-types": "^15.6 || ^16",
"react": "^16.9 || ^17",
"react-dom": "^16.9 || ^17"
"react-dom": "^16.9 || ^17",
"styled-components": "^5.2.0"
}
}
6 changes: 3 additions & 3 deletions packages/@sanity/code-input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
"@sanity/util": "2.17.1",
"brace": "^0.11.1",
"lodash": "^4.17.15",
"react-ace": "^5.0.1",
"styled-components": "^5.2.1"
"react-ace": "^5.0.1"
},
"devDependencies": {
"rimraf": "^2.7.1"
},
"peerDependencies": {
"prop-types": "^15.6 || ^16",
"react": "^16.9 || ^17"
"react": "^16.9 || ^17",
"styled-components": "^5.2.1"
},
"bugs": {
"url": "https://github.com/sanity-io/sanity/issues"
Expand Down
6 changes: 3 additions & 3 deletions packages/@sanity/color-input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
"@sanity/icons": "^1.1.4",
"@sanity/ui": "^0.36.3",
"lodash": "^4.17.15",
"react-color": "^2.13.8",
"styled-components": "^5.2.1"
"react-color": "^2.13.8"
},
"devDependencies": {
"@sanity/base": "2.17.2",
Expand All @@ -34,7 +33,8 @@
"@sanity/base": "^2.14",
"@sanity/types": "^2.14",
"prop-types": "^15.6 || ^16",
"react": "^16.9 || ^17"
"react": "^16.9 || ^17",
"styled-components": "^5.2.0"
},
"bugs": {
"url": "https://github.com/sanity-io/sanity/issues"
Expand Down
6 changes: 3 additions & 3 deletions packages/@sanity/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"@sanity/types": "2.17.1",
"@sanity/ui": "^0.36.3",
"lodash": "^4.17.15",
"rxjs": "^6.5.3",
"styled-components": "^5.2.1"
"rxjs": "^6.5.3"
},
"devDependencies": {
"@sanity/base": "2.17.2",
Expand All @@ -36,7 +35,8 @@
"peerDependencies": {
"@sanity/base": "^2.0.0",
"prop-types": "^15.6 || ^16",
"react": "^16.9 || ^17"
"react": "^16.9 || ^17",
"styled-components": "^5.2.0"
},
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions packages/@sanity/default-layout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
"lodash": "^4.17.15",
"react-click-outside": "^3.0.0",
"react-props-stream": "^1.0.0",
"rxjs": "^6.5.3",
"styled-components": "^5.2.1"
"rxjs": "^6.5.3"
},
"devDependencies": {
"@sanity/types": "2.17.1",
Expand All @@ -55,6 +54,7 @@
"@sanity/base": "^2.0.0",
"prop-types": "^15.6 || ^16",
"react": "^16.9 || ^17",
"react-dom": "^16.9 || ^17"
"react-dom": "^16.9 || ^17",
"styled-components": "^5.2.0"
}
}
6 changes: 3 additions & 3 deletions packages/@sanity/default-login/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
"@sanity/logos": "^1.1.4",
"@sanity/ui": "^0.36.3",
"prop-types": "^15.6.0",
"rxjs": "^6.5.3",
"styled-components": "^5.2.1"
"rxjs": "^6.5.3"
},
"devDependencies": {
"@sanity/types": "2.17.1",
"rimraf": "^2.7.1"
},
"peerDependencies": {
"react": "^16.9 || ^17"
"react": "^16.9 || ^17",
"styled-components": "^5.2.0"
},
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions packages/@sanity/desk-tool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@
"react-rx": "^1.0.0-beta.6",
"react-tiny-virtual-list": "^2.0.5",
"rxjs": "^6.5.3",
"shallow-equals": "^1.0.0",
"styled-components": "^5.2.1"
"shallow-equals": "^1.0.0"
},
"devDependencies": {
"@types/classnames": "^2.2.10",
Expand All @@ -69,7 +68,8 @@
"peerDependencies": {
"@sanity/base": "^2.0.0",
"prop-types": "^15.6 || ^16",
"react": "^16.9 || ^17"
"react": "^16.9 || ^17",
"styled-components": "^5.2.0"
},
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions packages/@sanity/field/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@
"@sanity/util": "2.17.1",
"diff-match-patch": "^1.0.4",
"lodash": "^4.17.15",
"sanity-diff-patch": "^1.0.9",
"styled-components": "^5.2.1"
"sanity-diff-patch": "^1.0.9"
},
"devDependencies": {
"@sanity/ui-workshop": "^0.2.0",
"react": "17.0.1",
"rimraf": "^2.7.1"
},
"peerDependencies": {
"react": "^16.2.0 || ^17"
"react": "^16.2.0 || ^17",
"styled-components": "^5.2.0"
},
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions packages/@sanity/form-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
"rxjs": "^6.5.3",
"scroll-into-view-if-needed": "^2.2.26",
"shallow-equals": "^1.0.0",
"speakingurl": "^13.0.0",
"styled-components": "^5.2.1"
"speakingurl": "^13.0.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.11.10",
Expand All @@ -71,7 +70,8 @@
"peerDependencies": {
"prop-types": "^15.6 || ^16",
"react": "^16.9 || ^17",
"react-dom": "^16.9 || ^17"
"react-dom": "^16.9 || ^17",
"styled-components": "^5.2.1"
},
"directories": {
"test": "test"
Expand Down
6 changes: 3 additions & 3 deletions packages/@sanity/google-maps-input/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"@sanity/types": "2.17.1",
"@sanity/ui": "^0.36.3",
"lodash": "^4.17.15",
"rxjs": "^6.5.3",
"styled-components": "^5.2.1"
"rxjs": "^6.5.3"
},
"devDependencies": {
"@sanity/base": "2.17.2",
Expand All @@ -35,7 +34,8 @@
"peerDependencies": {
"@sanity/base": "^2.0.0",
"react": "^16.9 || ^17",
"react-dom": "^16.9 || ^17"
"react-dom": "^16.9 || ^17",
"styled-components": "^5.2.0"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions packages/@sanity/imagetool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
"remon": "^1.0.2",
"rimraf": "^2.7.1",
"staticr": "^4.0.2",
"styled-components": "^5.2.1",
"ts-node": "^9.1.1"
},
"peerDependencies": {
"prop-types": "^15.6 || ^16",
"react": "^16.9 || ^17",
"react-dom": "^16.9 || ^17"
"react-dom": "^16.9 || ^17",
"styled-components": "^5.2.0"
},
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions packages/@sanity/portable-text-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
"debug": "^3.2.7",
"is-hotkey": "^0.1.6",
"lodash": "^4.17.15",
"slate": "^0.58.4",
"styled-components": "^5.2.1"
"slate": "^0.58.4"
},
"devDependencies": {
"@babel/core": "^7.11.6",
Expand All @@ -70,7 +69,8 @@
},
"peerDependencies": {
"react": ">=16.8.0",
"rxjs": ">=6.5.3"
"rxjs": ">=6.5.3",
"styled-components": "^5.2.0"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions packages/@sanity/storybook/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@
"express": "^4.16.1",
"react-addons-create-fragment": "^15.4.2",
"shelljs": "^0.7.6",
"styled-components": "^5.2.1",
"webpack": "^3.8.1"
},
"peerDependencies": {
"prop-types": "^15.6 || ^16",
"react": "^16.9 || ^17",
"react-dom": "^16.9 || ^17"
"react-dom": "^16.9 || ^17",
"styled-components": "^5.2.1"
}
}
6 changes: 3 additions & 3 deletions packages/@sanity/studio-hints/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
],
"dependencies": {
"@sanity/icons": "^1.1.4",
"@sanity/ui": "^0.36.3",
"styled-components": "^5.2.1"
"@sanity/ui": "^0.36.3"
},
"devDependencies": {
"rimraf": "^2.7.1"
},
"peerDependencies": {
"prop-types": "^15.6 || ^16",
"react": "^16.8 || ^17"
"react": "^16.8 || ^17",
"styled-components": "^5.2.0"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 54e0d1e

Please sign in to comment.