瀏覽代碼

@uppy/vue: move `@uppy/` packages to peer dependencies (#4024)

Antoine du Hamel 2 年之前
父節點
當前提交
524b783ac5
共有 3 個文件被更改,包括 56 次插入17 次删除
  1. 22 5
      packages/@uppy/vue/package.json
  2. 19 8
      website/src/docs/vue.md
  3. 15 4
      yarn.lock

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

@@ -5,11 +5,6 @@
   "main": "lib/index.js",
   "types": "types/index.d.ts",
   "dependencies": {
-    "@uppy/dashboard": "workspace:^",
-    "@uppy/drag-drop": "workspace:^",
-    "@uppy/file-input": "workspace:^",
-    "@uppy/progress-bar": "workspace:^",
-    "@uppy/status-bar": "workspace:^",
     "shallow-equal": "^1.2.1"
   },
   "devDependencies": {
@@ -17,8 +12,30 @@
   },
   "peerDependencies": {
     "@uppy/core": "workspace:^",
+    "@uppy/dashboard": "workspace:^",
+    "@uppy/drag-drop": "workspace:^",
+    "@uppy/file-input": "workspace:^",
+    "@uppy/progress-bar": "workspace:^",
+    "@uppy/status-bar": "workspace:^",
     "vue": ">=2.6.11"
   },
+  "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
+    }
+  },
   "publishConfig": {
     "access": "public"
   }

+ 19 - 8
website/src/docs/vue.md

@@ -7,13 +7,15 @@ order: 0
 category: "Other Integrations"
 ---
 
-Uppy provides [Vue][] components for the included UI plugins.
+Uppy provides [Vue][] components for some Uppy UI plugins.
 
 Note: _All plugin names are in kebab-case for the HTML element, and in CamelCase for the JavaScript imports, following Vue conventions_
 
 ## Installation
 
-All Vue components are provided through the `@uppy/vue` package
+All Vue components are provided through the `@uppy/vue` package, note that the
+underling Uppy plugin is no longer provided and you would need to install it
+explicitly. See [Usage](#usage) for more info.
 
 Install from NPM:
 
@@ -64,13 +66,14 @@ export default {
 </script>
 ```
 
-The following plugins are available as Vue component wrappers:
+The following plugins are available as Vue component wrappers (you need to
+install each package separately):
 
-* `<dashboard />` - renders an inline `@uppy/dashboard`
-* `<dashboard-modal />` - renders a `@uppy/dashboard` modal
-* `<drag-drop />` - renders a `@uppy/drag-drop` area
-* `<progress-bar />` - renders a `@uppy/progress-bar`
-* `<status-bar />` - renders a `@uppy/status-bar`
+* `<dashboard />` - renders an inline [`@uppy/dashboard`][].
+* `<dashboard-modal />` - renders a [`@uppy/dashboard`][] modal.
+* `<drag-drop />` - renders a [`@uppy/drag-drop`][] area.
+* `<progress-bar />` - renders a [`@uppy/progress-bar`][].
+* `<status-bar />` - renders a [`@uppy/status-bar`][].
 
 Each component takes a `props` prop that will be passed to the UI Plugin. Both `@uppy/dashboard` based plugins also take a `plugins` array as a props, making it easier to add your plugins.
 
@@ -196,6 +199,14 @@ Import general Core styles from `@uppy/core/dist/style.css` first, then add the
 
 The `<status-bar />` component supports all `@uppy/status-bar` options to be passed as an object on the `props` prop. An Uppy instance must be provided in the `:uppy=''` prop.
 
+[`@uppy/dashboard`]: /docs/dashboard
+
+[`@uppy/drag-drop`]: /docs/drag-drop
+
+[`@uppy/progress-bar`]: /docs/progress-bar
+
+[`@uppy/status-bar`]: /docs/status-bar
+
 [`@uppy/webcam`]: /docs/webcam/
 
 [Nuxt]: https://nuxtjs.org

+ 15 - 4
yarn.lock

@@ -8954,16 +8954,27 @@ __metadata:
   version: 0.0.0-use.local
   resolution: "@uppy/vue@workspace:packages/@uppy/vue"
   dependencies:
+    shallow-equal: ^1.2.1
+    vue: ^2.6.14
+  peerDependencies:
+    "@uppy/core": "workspace:^"
     "@uppy/dashboard": "workspace:^"
     "@uppy/drag-drop": "workspace:^"
     "@uppy/file-input": "workspace:^"
     "@uppy/progress-bar": "workspace:^"
     "@uppy/status-bar": "workspace:^"
-    shallow-equal: ^1.2.1
-    vue: ^2.6.14
-  peerDependencies:
-    "@uppy/core": "workspace:^"
     vue: ">=2.6.11"
+  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
   linkType: soft