mirror of
https://github.com/transloadit/uppy.git
synced 2026-01-23 02:25:07 +00:00
Fix various deps and peer deps in packages (#6030)
**Fixes**
- `@uppy/components` incorrectly had a lot of packages in `dependencies`
while they should be `peerDependencies`. Also removed `remote-sources`
completely as this drags in a lot of plugins and we don't even need it
there.
- `@uppy/{react,vue,svelte}` now has to have the same `peerDependencies`
as `components` as the requirement has been moved up. We also mark them
as optional, they are only needed if you use a hook such as `useWebcam`
needing `@uppy/webcam`.
- Remove `companion-client` and `provider-views` from `transloadit`.
Those are never used by the package.
- Remove `@uppy/utils` from `@uppy/angular` and `@uppy/react`, we can
just use imports from `core`
- Place `@uppy/status-bar` back in peer deps. This is critical but
forgotten when status bar was put back inside frameworks.
**Implications**
- Moving peer deps to deps in `@uppy/components` now requires people to
install these dependencies. However, they kind of had to anyway before
as we require people to install the plugin on uppy (`.use(Webcam')`) if
you want to use `useWebcam` and if you try to import a dep you did not
install they would have gotten an error already.
- Note: this is not the same situation as with importing dashboard
component from @uppy/react which causes a runtime crash because
@uppy/dashboard is missing. In this case we only depend on _types_, so
we don't have this problem.
This commit is contained in:
parent
9f60e630a2
commit
72d2d68ea3
20 changed files with 128 additions and 35 deletions
8
.changeset/beige-dogs-read.md
Normal file
8
.changeset/beige-dogs-read.md
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
"@uppy/components": minor
|
||||
"@uppy/svelte": minor
|
||||
"@uppy/react": minor
|
||||
"@uppy/vue": minor
|
||||
---
|
||||
|
||||
Add @uppy/{screen-capture,status-bar,webcam} as optional peer dependencies
|
||||
5
.changeset/fluffy-trams-run.md
Normal file
5
.changeset/fluffy-trams-run.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@uppy/transloadit": minor
|
||||
---
|
||||
|
||||
Remove unused @uppy/{companion-client,provider-views} dependencies
|
||||
5
.changeset/silver-areas-refuse.md
Normal file
5
.changeset/silver-areas-refuse.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@uppy/angular": minor
|
||||
---
|
||||
|
||||
Remove @uppy/utils and add @uppy/status-bar to peerDependencies
|
||||
|
|
@ -29,7 +29,15 @@
|
|||
"@angular/core": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0",
|
||||
"@uppy/core": "workspace:^",
|
||||
"@uppy/dashboard": "workspace:^",
|
||||
"@uppy/utils": "workspace:^"
|
||||
"@uppy/status-bar": "workspace:^"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@uppy/dashboard": {
|
||||
"optional": true
|
||||
},
|
||||
"@uppy/status-bar": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"sideEffects": false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { ChangeDetectionStrategy, Component } from "@angular/core";
|
||||
import { Uppy } from "@uppy/core";
|
||||
import type * as Dashboard from "@uppy/dashboard";
|
||||
import type { Body, Meta } from "@uppy/utils";
|
||||
import type { Body, Meta } from "@uppy/core";
|
||||
import { DashboardModalComponent } from "./dashboard-modal.component";
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import {
|
|||
import { Uppy } from "@uppy/core";
|
||||
import type { DashboardOptions } from "@uppy/dashboard";
|
||||
import Dashboard from "@uppy/dashboard";
|
||||
import type { Body, Meta } from "@uppy/utils";
|
||||
import type { Body, Meta } from "@uppy/core";
|
||||
import { UppyAngularWrapper } from "../../utils/wrapper";
|
||||
|
||||
@Component({
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { ChangeDetectionStrategy, Component } from "@angular/core";
|
||||
import { Uppy } from "@uppy/core";
|
||||
import type * as Dashboard from "@uppy/dashboard";
|
||||
import type { Body, Meta } from "@uppy/utils";
|
||||
import type { Body, Meta } from "@uppy/core";
|
||||
import { DashboardComponent } from "./dashboard.component";
|
||||
|
||||
@Component({
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import {
|
|||
import { Uppy } from "@uppy/core";
|
||||
import type { DashboardOptions } from "@uppy/dashboard";
|
||||
import Dashboard from "@uppy/dashboard";
|
||||
import type { Body, Meta } from "@uppy/utils";
|
||||
import type { Body, Meta } from "@uppy/core";
|
||||
import { UppyAngularWrapper } from "../../utils/wrapper";
|
||||
|
||||
@Component({
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { ChangeDetectionStrategy, Component, type OnInit } from "@angular/core";
|
|||
import { Uppy } from "@uppy/core";
|
||||
import type * as StatusBar from "@uppy/status-bar";
|
||||
import Tus from "@uppy/tus";
|
||||
import type { Body, Meta } from "@uppy/utils/lib/UppyFile";
|
||||
import type { Body, Meta } from "@uppy/core";
|
||||
import { StatusBarComponent } from "./status-bar.component";
|
||||
|
||||
@Component({
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import {
|
|||
import { Uppy } from "@uppy/core";
|
||||
import type { StatusBarOptions } from "@uppy/status-bar";
|
||||
import StatusBar from "@uppy/status-bar";
|
||||
import type { Body, Meta } from "@uppy/utils";
|
||||
import type { Body, Meta } from "@uppy/core";
|
||||
import { UppyAngularWrapper } from "../../utils/wrapper";
|
||||
|
||||
@Component({
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import type { ElementRef, SimpleChanges } from "@angular/core";
|
||||
import type { UIPlugin, UIPluginOptions, Uppy } from "@uppy/core";
|
||||
import type { UIPlugin, UIPluginOptions, Uppy, Body, Meta } from "@uppy/core";
|
||||
import type { DashboardOptions } from "@uppy/dashboard";
|
||||
import type { Body, Meta } from "@uppy/utils";
|
||||
|
||||
export abstract class UppyAngularWrapper<
|
||||
M extends Meta,
|
||||
|
|
|
|||
|
|
@ -40,12 +40,6 @@
|
|||
"./package.json": "./package.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@uppy/audio": "workspace:^",
|
||||
"@uppy/core": "workspace:^",
|
||||
"@uppy/image-editor": "workspace:^",
|
||||
"@uppy/remote-sources": "workspace:^",
|
||||
"@uppy/screen-capture": "workspace:^",
|
||||
"@uppy/webcam": "workspace:^",
|
||||
"clsx": "^2.1.1",
|
||||
"dequal": "^2.0.3",
|
||||
"preact": "^10.5.13",
|
||||
|
|
@ -53,7 +47,25 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/cli": "^4.0.6",
|
||||
"@uppy/core": "workspace:^",
|
||||
"tailwindcss": "^4.0.6",
|
||||
"typescript": "^5.8.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@uppy/core": "workspace:^",
|
||||
"@uppy/image-editor": "workspace:^",
|
||||
"@uppy/screen-capture": "workspace:^",
|
||||
"@uppy/webcam": "workspace:^"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@uppy/image-editor": {
|
||||
"optional": true
|
||||
},
|
||||
"@uppy/screen-capture": {
|
||||
"optional": true
|
||||
},
|
||||
"@uppy/webcam": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,11 +6,19 @@ import type {
|
|||
UppyEventMap,
|
||||
} from '@uppy/core'
|
||||
import type { ProviderViews } from '@uppy/provider-views'
|
||||
import type { AvailablePluginsKeys } from '@uppy/remote-sources'
|
||||
import { dequal } from 'dequal/lite'
|
||||
import { Subscribers } from './utils.js'
|
||||
|
||||
export type { AvailablePluginsKeys as RemoteSourceKeys }
|
||||
export type RemoteSourceKeys =
|
||||
| 'Box'
|
||||
| 'Dropbox'
|
||||
| 'Facebook'
|
||||
| 'GoogleDrive'
|
||||
| 'Instagram'
|
||||
| 'OneDrive'
|
||||
| 'Unsplash'
|
||||
| 'Url'
|
||||
| 'Zoom'
|
||||
|
||||
export type RemoteSourceSnapshot = {
|
||||
state: UnknownProviderPluginState & {
|
||||
|
|
@ -35,7 +43,7 @@ export type RemoteSourceStore = {
|
|||
|
||||
export function createRemoteSourceController(
|
||||
uppy: Uppy,
|
||||
sourceId: AvailablePluginsKeys,
|
||||
sourceId: RemoteSourceKeys,
|
||||
): RemoteSourceStore {
|
||||
const plugin = uppy.getPlugin<UnknownProviderPlugin<any, any>>(sourceId)
|
||||
if (!plugin) {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,13 @@
|
|||
"extends": ["//"],
|
||||
"tasks": {
|
||||
"build": {
|
||||
"dependsOn": ["^build", "@uppy/core#build"],
|
||||
"dependsOn": [
|
||||
"^build",
|
||||
"@uppy/core#build",
|
||||
"@uppy/image-editor#build",
|
||||
"@uppy/screen-capture#build",
|
||||
"@uppy/webcam#build"
|
||||
],
|
||||
"outputs": ["lib/**"]
|
||||
},
|
||||
"build:css": {
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@
|
|||
"@uppy/core": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@uppy/core": "workspace:^",
|
||||
"@uppy/dashboard": "workspace:^",
|
||||
"@uppy/xhr-upload": "workspace:^",
|
||||
"@vitest/browser": "^3.2.4",
|
||||
|
|
|
|||
|
|
@ -36,7 +36,6 @@
|
|||
],
|
||||
"dependencies": {
|
||||
"@uppy/components": "workspace:^",
|
||||
"@uppy/utils": "workspace:^",
|
||||
"preact": "^10.5.13",
|
||||
"use-sync-external-store": "^1.3.0"
|
||||
},
|
||||
|
|
@ -65,6 +64,7 @@
|
|||
"@uppy/core": "workspace:^",
|
||||
"@uppy/dashboard": "workspace:^",
|
||||
"@uppy/screen-capture": "workspace:^",
|
||||
"@uppy/status-bar": "workspace:^",
|
||||
"@uppy/webcam": "workspace:^",
|
||||
"react": "^18.0.0 || ^19.0.0",
|
||||
"react-dom": "^18.0.0 || ^19.0.0"
|
||||
|
|
|
|||
|
|
@ -70,14 +70,23 @@
|
|||
"peerDependencies": {
|
||||
"@uppy/core": "workspace:^",
|
||||
"@uppy/dashboard": "workspace:^",
|
||||
"@uppy/screen-capture": "workspace:^",
|
||||
"@uppy/status-bar": "workspace:^",
|
||||
"@uppy/webcam": "workspace:^",
|
||||
"svelte": "^4.0.0 || ^5.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@uppy/dashboard": {
|
||||
"optional": true
|
||||
},
|
||||
"@uppy/screen-capture": {
|
||||
"optional": true
|
||||
},
|
||||
"@uppy/status-bar": {
|
||||
"optional": true
|
||||
},
|
||||
"@uppy/webcam": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
|
|
|
|||
|
|
@ -42,8 +42,6 @@
|
|||
"./package.json": "./package.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@uppy/companion-client": "workspace:^",
|
||||
"@uppy/provider-views": "workspace:^",
|
||||
"@uppy/tus": "workspace:^",
|
||||
"@uppy/utils": "workspace:^",
|
||||
"component-emitter": "^2.0.0",
|
||||
|
|
|
|||
|
|
@ -38,14 +38,23 @@
|
|||
"peerDependencies": {
|
||||
"@uppy/core": "workspace:^",
|
||||
"@uppy/dashboard": "workspace:^",
|
||||
"@uppy/screen-capture": "workspace:^",
|
||||
"@uppy/status-bar": "workspace:^",
|
||||
"@uppy/webcam": "workspace:^",
|
||||
"vue": ">=3.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@uppy/dashboard": {
|
||||
"optional": true
|
||||
},
|
||||
"@uppy/screen-capture": {
|
||||
"optional": true
|
||||
},
|
||||
"@uppy/status-bar": {
|
||||
"optional": true
|
||||
},
|
||||
"@uppy/webcam": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
|
|
|
|||
51
yarn.lock
51
yarn.lock
|
|
@ -10698,11 +10698,16 @@ __metadata:
|
|||
"@angular/core": ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0
|
||||
"@uppy/core": "workspace:^"
|
||||
"@uppy/dashboard": "workspace:^"
|
||||
"@uppy/utils": "workspace:^"
|
||||
"@uppy/status-bar": "workspace:^"
|
||||
peerDependenciesMeta:
|
||||
"@uppy/dashboard":
|
||||
optional: true
|
||||
"@uppy/status-bar":
|
||||
optional: true
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@uppy/audio@workspace:*, @uppy/audio@workspace:^, @uppy/audio@workspace:packages/@uppy/audio":
|
||||
"@uppy/audio@workspace:*, @uppy/audio@workspace:packages/@uppy/audio":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@uppy/audio@workspace:packages/@uppy/audio"
|
||||
dependencies:
|
||||
|
|
@ -10844,18 +10849,25 @@ __metadata:
|
|||
resolution: "@uppy/components@workspace:packages/@uppy/components"
|
||||
dependencies:
|
||||
"@tailwindcss/cli": "npm:^4.0.6"
|
||||
"@uppy/audio": "workspace:^"
|
||||
"@uppy/core": "workspace:^"
|
||||
"@uppy/image-editor": "workspace:^"
|
||||
"@uppy/remote-sources": "workspace:^"
|
||||
"@uppy/screen-capture": "workspace:^"
|
||||
"@uppy/webcam": "workspace:^"
|
||||
clsx: "npm:^2.1.1"
|
||||
dequal: "npm:^2.0.3"
|
||||
preact: "npm:^10.5.13"
|
||||
pretty-bytes: "npm:^6.1.1"
|
||||
tailwindcss: "npm:^4.0.6"
|
||||
typescript: "npm:^5.8.3"
|
||||
peerDependencies:
|
||||
"@uppy/core": "workspace:^"
|
||||
"@uppy/image-editor": "workspace:^"
|
||||
"@uppy/screen-capture": "workspace:^"
|
||||
"@uppy/webcam": "workspace:^"
|
||||
peerDependenciesMeta:
|
||||
"@uppy/image-editor":
|
||||
optional: true
|
||||
"@uppy/screen-capture":
|
||||
optional: true
|
||||
"@uppy/webcam":
|
||||
optional: true
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
|
|
@ -11009,6 +11021,7 @@ __metadata:
|
|||
version: 0.0.0-use.local
|
||||
resolution: "@uppy/golden-retriever@workspace:packages/@uppy/golden-retriever"
|
||||
dependencies:
|
||||
"@uppy/core": "workspace:^"
|
||||
"@uppy/dashboard": "workspace:^"
|
||||
"@uppy/utils": "workspace:^"
|
||||
"@uppy/xhr-upload": "workspace:^"
|
||||
|
|
@ -11066,7 +11079,7 @@ __metadata:
|
|||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@uppy/image-editor@workspace:*, @uppy/image-editor@workspace:^, @uppy/image-editor@workspace:packages/@uppy/image-editor":
|
||||
"@uppy/image-editor@workspace:*, @uppy/image-editor@workspace:packages/@uppy/image-editor":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@uppy/image-editor@workspace:packages/@uppy/image-editor"
|
||||
dependencies:
|
||||
|
|
@ -11160,7 +11173,6 @@ __metadata:
|
|||
"@types/use-sync-external-store": "npm:^0.0.6"
|
||||
"@uppy/components": "workspace:^"
|
||||
"@uppy/core": "workspace:^"
|
||||
"@uppy/utils": "workspace:^"
|
||||
jsdom: "npm:^26.1.0"
|
||||
preact: "npm:^10.5.13"
|
||||
react: "npm:^18.2.0"
|
||||
|
|
@ -11172,6 +11184,7 @@ __metadata:
|
|||
"@uppy/core": "workspace:^"
|
||||
"@uppy/dashboard": "workspace:^"
|
||||
"@uppy/screen-capture": "workspace:^"
|
||||
"@uppy/status-bar": "workspace:^"
|
||||
"@uppy/webcam": "workspace:^"
|
||||
react: ^18.0.0 || ^19.0.0
|
||||
react-dom: ^18.0.0 || ^19.0.0
|
||||
|
|
@ -11187,7 +11200,7 @@ __metadata:
|
|||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@uppy/remote-sources@workspace:*, @uppy/remote-sources@workspace:^, @uppy/remote-sources@workspace:packages/@uppy/remote-sources":
|
||||
"@uppy/remote-sources@workspace:*, @uppy/remote-sources@workspace:packages/@uppy/remote-sources":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@uppy/remote-sources@workspace:packages/@uppy/remote-sources"
|
||||
dependencies:
|
||||
|
|
@ -11211,7 +11224,7 @@ __metadata:
|
|||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@uppy/screen-capture@workspace:*, @uppy/screen-capture@workspace:^, @uppy/screen-capture@workspace:packages/@uppy/screen-capture":
|
||||
"@uppy/screen-capture@workspace:*, @uppy/screen-capture@workspace:packages/@uppy/screen-capture":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@uppy/screen-capture@workspace:packages/@uppy/screen-capture"
|
||||
dependencies:
|
||||
|
|
@ -11274,12 +11287,19 @@ __metadata:
|
|||
peerDependencies:
|
||||
"@uppy/core": "workspace:^"
|
||||
"@uppy/dashboard": "workspace:^"
|
||||
"@uppy/screen-capture": "workspace:^"
|
||||
"@uppy/status-bar": "workspace:^"
|
||||
"@uppy/webcam": "workspace:^"
|
||||
svelte: ^4.0.0 || ^5.0.0
|
||||
peerDependenciesMeta:
|
||||
"@uppy/dashboard":
|
||||
optional: true
|
||||
"@uppy/screen-capture":
|
||||
optional: true
|
||||
"@uppy/status-bar":
|
||||
optional: true
|
||||
"@uppy/webcam":
|
||||
optional: true
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
|
|
@ -11302,9 +11322,7 @@ __metadata:
|
|||
version: 0.0.0-use.local
|
||||
resolution: "@uppy/transloadit@workspace:packages/@uppy/transloadit"
|
||||
dependencies:
|
||||
"@uppy/companion-client": "workspace:^"
|
||||
"@uppy/core": "workspace:^"
|
||||
"@uppy/provider-views": "workspace:^"
|
||||
"@uppy/tus": "workspace:^"
|
||||
"@uppy/utils": "workspace:^"
|
||||
component-emitter: "npm:^2.0.0"
|
||||
|
|
@ -11398,12 +11416,19 @@ __metadata:
|
|||
peerDependencies:
|
||||
"@uppy/core": "workspace:^"
|
||||
"@uppy/dashboard": "workspace:^"
|
||||
"@uppy/screen-capture": "workspace:^"
|
||||
"@uppy/status-bar": "workspace:^"
|
||||
"@uppy/webcam": "workspace:^"
|
||||
vue: ">=3.0.0"
|
||||
peerDependenciesMeta:
|
||||
"@uppy/dashboard":
|
||||
optional: true
|
||||
"@uppy/screen-capture":
|
||||
optional: true
|
||||
"@uppy/status-bar":
|
||||
optional: true
|
||||
"@uppy/webcam":
|
||||
optional: true
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue