From 54e0d1e96c4525c062a05fb279b3f89d2fe364d3 Mon Sep 17 00:00:00 2001 From: Espen Hovlandsdal Date: Fri, 3 Sep 2021 14:32:07 +0200 Subject: [PATCH] chore(deps): move styled-component from deps to peerDeps 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. --- packages/@sanity/base/package.json | 6 +++--- packages/@sanity/code-input/package.json | 6 +++--- packages/@sanity/color-input/package.json | 6 +++--- packages/@sanity/dashboard/package.json | 6 +++--- packages/@sanity/default-layout/package.json | 6 +++--- packages/@sanity/default-login/package.json | 6 +++--- packages/@sanity/desk-tool/package.json | 6 +++--- packages/@sanity/field/package.json | 6 +++--- packages/@sanity/form-builder/package.json | 6 +++--- packages/@sanity/google-maps-input/package.json | 6 +++--- packages/@sanity/imagetool/package.json | 4 ++-- packages/@sanity/portable-text-editor/package.json | 6 +++--- packages/@sanity/storybook/package.json | 4 ++-- packages/@sanity/studio-hints/package.json | 6 +++--- 14 files changed, 40 insertions(+), 40 deletions(-) diff --git a/packages/@sanity/base/package.json b/packages/@sanity/base/package.json index bd449af76053..229c8ad100ea 100644 --- a/packages/@sanity/base/package.json +++ b/packages/@sanity/base/package.json @@ -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", @@ -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" } } diff --git a/packages/@sanity/code-input/package.json b/packages/@sanity/code-input/package.json index b01f088aa385..00ae79929b76 100644 --- a/packages/@sanity/code-input/package.json +++ b/packages/@sanity/code-input/package.json @@ -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" diff --git a/packages/@sanity/color-input/package.json b/packages/@sanity/color-input/package.json index b40127c89b31..5137b3776a35 100644 --- a/packages/@sanity/color-input/package.json +++ b/packages/@sanity/color-input/package.json @@ -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", @@ -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" diff --git a/packages/@sanity/dashboard/package.json b/packages/@sanity/dashboard/package.json index 7225d9b1d8aa..580d611627b8 100644 --- a/packages/@sanity/dashboard/package.json +++ b/packages/@sanity/dashboard/package.json @@ -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", @@ -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", diff --git a/packages/@sanity/default-layout/package.json b/packages/@sanity/default-layout/package.json index 556d5e378888..dacee3ff39e6 100644 --- a/packages/@sanity/default-layout/package.json +++ b/packages/@sanity/default-layout/package.json @@ -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", @@ -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" } } diff --git a/packages/@sanity/default-login/package.json b/packages/@sanity/default-login/package.json index 4ebcd0ab030c..b430dd3b9c5d 100644 --- a/packages/@sanity/default-login/package.json +++ b/packages/@sanity/default-login/package.json @@ -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", diff --git a/packages/@sanity/desk-tool/package.json b/packages/@sanity/desk-tool/package.json index 6863b94be832..409c74cf841c 100644 --- a/packages/@sanity/desk-tool/package.json +++ b/packages/@sanity/desk-tool/package.json @@ -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", @@ -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", diff --git a/packages/@sanity/field/package.json b/packages/@sanity/field/package.json index 89e072b777e0..8bb6aa1e099e 100644 --- a/packages/@sanity/field/package.json +++ b/packages/@sanity/field/package.json @@ -49,8 +49,7 @@ "@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", @@ -58,7 +57,8 @@ "rimraf": "^2.7.1" }, "peerDependencies": { - "react": "^16.2.0 || ^17" + "react": "^16.2.0 || ^17", + "styled-components": "^5.2.0" }, "repository": { "type": "git", diff --git a/packages/@sanity/form-builder/package.json b/packages/@sanity/form-builder/package.json index 40649884a79f..488dcdd1bbc9 100644 --- a/packages/@sanity/form-builder/package.json +++ b/packages/@sanity/form-builder/package.json @@ -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", @@ -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" diff --git a/packages/@sanity/google-maps-input/package.json b/packages/@sanity/google-maps-input/package.json index befafffe6472..ca2cf64694d0 100644 --- a/packages/@sanity/google-maps-input/package.json +++ b/packages/@sanity/google-maps-input/package.json @@ -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", @@ -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", diff --git a/packages/@sanity/imagetool/package.json b/packages/@sanity/imagetool/package.json index 27d15b4a5a5d..c731ee093df7 100644 --- a/packages/@sanity/imagetool/package.json +++ b/packages/@sanity/imagetool/package.json @@ -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", diff --git a/packages/@sanity/portable-text-editor/package.json b/packages/@sanity/portable-text-editor/package.json index 2007ea4f0a78..d5c0062af29c 100644 --- a/packages/@sanity/portable-text-editor/package.json +++ b/packages/@sanity/portable-text-editor/package.json @@ -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", @@ -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", diff --git a/packages/@sanity/storybook/package.json b/packages/@sanity/storybook/package.json index 559677c3299a..0b2939b4301c 100644 --- a/packages/@sanity/storybook/package.json +++ b/packages/@sanity/storybook/package.json @@ -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" } } diff --git a/packages/@sanity/studio-hints/package.json b/packages/@sanity/studio-hints/package.json index 3d5ea75c1026..54e91ed19085 100644 --- a/packages/@sanity/studio-hints/package.json +++ b/packages/@sanity/studio-hints/package.json @@ -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",