Quellcode durchsuchen

@uppy/react: move `@uppy/` packages to peer dependencies (#4004)

Antoine du Hamel vor 2 Jahren
Ursprung
Commit
ef7cbea10f

+ 22 - 5
packages/@uppy/react/package.json

@@ -22,11 +22,6 @@
     "url": "git+https://github.com/transloadit/uppy.git"
     "url": "git+https://github.com/transloadit/uppy.git"
   },
   },
   "dependencies": {
   "dependencies": {
-    "@uppy/dashboard": "workspace:^",
-    "@uppy/drag-drop": "workspace:^",
-    "@uppy/file-input": "workspace:^",
-    "@uppy/progress-bar": "workspace:^",
-    "@uppy/status-bar": "workspace:^",
     "@uppy/utils": "workspace:^",
     "@uppy/utils": "workspace:^",
     "prop-types": "^15.6.1"
     "prop-types": "^15.6.1"
   },
   },
@@ -36,6 +31,28 @@
   },
   },
   "peerDependencies": {
   "peerDependencies": {
     "@uppy/core": "workspace:^",
     "@uppy/core": "workspace:^",
+    "@uppy/dashboard": "workspace:^",
+    "@uppy/drag-drop": "workspace:^",
+    "@uppy/file-input": "workspace:^",
+    "@uppy/progress-bar": "workspace:^",
+    "@uppy/status-bar": "workspace:^",
     "react": "^16.0.0 || ^17.0.0 || ^18.0.0"
     "react": "^16.0.0 || ^17.0.0 || ^18.0.0"
+  },
+  "peerDependenciesMeta": {
+    "@uppy/dashboard": {
+      "optional": true
+    },
+    "@uppy/drag-drop": {
+      "optional": true
+    },
+    "@uppy/file-input": {
+      "optional": true
+    },
+    "@uppy/progress-bar": {
+      "optional": true
+    },
+    "@uppy/status-bar": {
+      "optional": true
+    }
   }
   }
 }
 }

+ 1 - 1
website/src/docs/react-dashboard-modal.md

@@ -14,7 +14,7 @@ The `<DashboardModal />` component wraps the [`@uppy/dashboard`][] plugin, allow
 Install from NPM:
 Install from NPM:
 
 
 ```shell
 ```shell
-npm install @uppy/react
+npm install @uppy/react @uppy/dashboard @uppy/core
 ```
 ```
 
 
 ```js
 ```js

+ 1 - 1
website/src/docs/react-dashboard.md

@@ -14,7 +14,7 @@ The `<Dashboard />` component wraps the [`@uppy/dashboard`][] plugin. It only re
 Install from NPM:
 Install from NPM:
 
 
 ```shell
 ```shell
-npm install @uppy/react
+npm install @uppy/react @uppy/dashboard @uppy/core
 ```
 ```
 
 
 ```js
 ```js

+ 1 - 1
website/src/docs/react-dragdrop.md

@@ -15,7 +15,7 @@ The `<DragDrop />` component wraps the [`@uppy/drag-drop`](/docs/drag-drop/) plu
 Install from NPM:
 Install from NPM:
 
 
 ```shell
 ```shell
-npm install @uppy/react
+npm install @uppy/react @uppy/drag-drop @uppy/core
 ```
 ```
 
 
 ```js
 ```js

+ 1 - 1
website/src/docs/react-fileinput.md

@@ -15,7 +15,7 @@ The `<FileInput />` component wraps the [`@uppy/file-input`](/docs/file-input/)
 Install from NPM:
 Install from NPM:
 
 
 ```shell
 ```shell
-npm install @uppy/react
+npm install @uppy/react @uppy/file-input @uppy/core
 ```
 ```
 
 
 ```js
 ```js

+ 1 - 1
website/src/docs/react-progressbar.md

@@ -15,7 +15,7 @@ The `<ProgressBar />` component wraps the [`@uppy/progress-bar`][] plugin.
 Install from NPM:
 Install from NPM:
 
 
 ```shell
 ```shell
-npm install @uppy/react
+npm install @uppy/react @uppy/progress-bar @uppy/core
 ```
 ```
 
 
 ```js
 ```js

+ 1 - 1
website/src/docs/react-statusbar.md

@@ -15,7 +15,7 @@ The `<StatusBar />` component wraps the [`@uppy/status-bar`][] plugin.
 Install from NPM:
 Install from NPM:
 
 
 ```shell
 ```shell
-npm install @uppy/react
+npm install @uppy/react @uppy/status-bar @uppy/core
 ```
 ```
 
 
 ```js
 ```js

+ 8 - 7
website/src/docs/react.md

@@ -73,13 +73,14 @@ const AvatarPicker = ({ currentAvatar }) => {
 }
 }
 ```
 ```
 
 
-The following plugins are available as React component wrappers:
-
-* [\<Dashboard />][<Dashboard />] - renders an inline [`@uppy/dashboard`][]
-* [\<DashboardModal />][<DashboardModal />] - renders a [`@uppy/dashboard`][] modal
-* [\<DragDrop />][<DragDrop />] - renders a [`@uppy/drag-drop`][] area
-* [\<ProgressBar />][<ProgressBar />] - renders a [`@uppy/progress-bar`][]
-* [\<StatusBar />][<StatusBar />] - renders a [`@uppy/status-bar`][]
+The following plugins are available as React component wrappers (you need to
+install each package separately):
+
+* [\<Dashboard />][<Dashboard />] - renders an inline [`@uppy/dashboard`][].
+* [\<DashboardModal />][<DashboardModal />] - renders a [`@uppy/dashboard`][] modal.
+* [\<DragDrop />][<DragDrop />] - renders a [`@uppy/drag-drop`][] area.
+* [\<ProgressBar />][<ProgressBar />] - renders a [`@uppy/progress-bar`][].
+* [\<StatusBar />][<StatusBar />] - renders a [`@uppy/status-bar`][].
 
 
 [React]: https://facebook.github.io/react
 [React]: https://facebook.github.io/react
 
 

+ 16 - 5
yarn.lock

@@ -8749,17 +8749,28 @@ __metadata:
   resolution: "@uppy/react@workspace:packages/@uppy/react"
   resolution: "@uppy/react@workspace:packages/@uppy/react"
   dependencies:
   dependencies:
     "@types/react": ^18.0.8
     "@types/react": ^18.0.8
-    "@uppy/dashboard": "workspace:^"
-    "@uppy/drag-drop": "workspace:^"
-    "@uppy/file-input": "workspace:^"
-    "@uppy/progress-bar": "workspace:^"
-    "@uppy/status-bar": "workspace:^"
     "@uppy/utils": "workspace:^"
     "@uppy/utils": "workspace:^"
     prop-types: ^15.6.1
     prop-types: ^15.6.1
     react: ^18.1.0
     react: ^18.1.0
   peerDependencies:
   peerDependencies:
     "@uppy/core": "workspace:^"
     "@uppy/core": "workspace:^"
+    "@uppy/dashboard": "workspace:^"
+    "@uppy/drag-drop": "workspace:^"
+    "@uppy/file-input": "workspace:^"
+    "@uppy/progress-bar": "workspace:^"
+    "@uppy/status-bar": "workspace:^"
     react: ^16.0.0 || ^17.0.0 || ^18.0.0
     react: ^16.0.0 || ^17.0.0 || ^18.0.0
+  peerDependenciesMeta:
+    "@uppy/dashboard":
+      optional: true
+    "@uppy/drag-drop":
+      optional: true
+    "@uppy/file-input":
+      optional: true
+    "@uppy/progress-bar":
+      optional: true
+    "@uppy/status-bar":
+      optional: true
   languageName: unknown
   languageName: unknown
   linkType: soft
   linkType: soft