diff --git a/.eslintrc.js b/.eslintrc.js index 2861d375e..a4b2692da 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -441,6 +441,10 @@ module.exports = { }, { selector: 'ImportDeclaration[source.value=/^@uppy\\x2Futils\\x2Flib\\x2F.+\\.[mc]?[jt]sx?$/]', message: 'Do not use file extension when importing from @uppy/utils', + }, + { + selector: 'ImportDeclaration[source.value=/^@uppy\\x2F[a-z-0-9]+\\x2Fsrc\\x2F/]', + message: 'Importing from "src/" is not allowed. Import from root or from "lib/" if you must.', }], 'import/extensions': ['error', 'ignorePackages'], 'import/prefer-default-export': 'off', diff --git a/packages/@uppy/audio/src/Audio.tsx b/packages/@uppy/audio/src/Audio.tsx index 113d969f1..1428e7eca 100644 --- a/packages/@uppy/audio/src/Audio.tsx +++ b/packages/@uppy/audio/src/Audio.tsx @@ -1,12 +1,13 @@ import { h } from 'preact' -import { UIPlugin, type UIPluginOptions } from '@uppy/core' +import { UIPlugin } from '@uppy/core' import type { + Uppy, + UIPluginOptions, Body, Meta, MinimalRequiredUppyFile, -} from '@uppy/utils/lib/UppyFile' -import type { Uppy } from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import getFileTypeExtension from '@uppy/utils/lib/getFileTypeExtension' import supportsMediaRecorder from './supportsMediaRecorder.js' diff --git a/packages/@uppy/aws-s3/src/HTTPCommunicationQueue.ts b/packages/@uppy/aws-s3/src/HTTPCommunicationQueue.ts index 9f2a92389..ebadfa6f0 100644 --- a/packages/@uppy/aws-s3/src/HTTPCommunicationQueue.ts +++ b/packages/@uppy/aws-s3/src/HTTPCommunicationQueue.ts @@ -1,4 +1,4 @@ -import type { Meta, Body, UppyFile } from '@uppy/utils/lib/UppyFile' +import type { Meta, Body, UppyFile } from '@uppy/core' import type { RateLimitedQueue, WrapPromiseFunctionType, diff --git a/packages/@uppy/aws-s3/src/index.ts b/packages/@uppy/aws-s3/src/index.ts index d8112b222..18b895b84 100644 --- a/packages/@uppy/aws-s3/src/index.ts +++ b/packages/@uppy/aws-s3/src/index.ts @@ -1,11 +1,12 @@ -import BasePlugin, { +import { type DefinePluginOpts, type PluginOpts, -} from '@uppy/core/lib/BasePlugin.js' + Uppy, + BasePlugin, +} from '@uppy/core' import { RequestClient } from '@uppy/companion-client' import type { RequestOptions } from '@uppy/utils/lib/CompanionClientProvider' import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile' -import type { Uppy } from '@uppy/core' import EventManager from '@uppy/core/lib/EventManager.js' import { RateLimitedQueue } from '@uppy/utils/lib/RateLimitedQueue' import { diff --git a/packages/@uppy/box/src/Box.tsx b/packages/@uppy/box/src/Box.tsx index 1d3b558f7..3171f269e 100644 --- a/packages/@uppy/box/src/Box.tsx +++ b/packages/@uppy/box/src/Box.tsx @@ -8,12 +8,14 @@ import { UIPlugin, Uppy } from '@uppy/core' import { ProviderViews } from '@uppy/provider-views' import { h, type ComponentChild } from 'preact' -import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile' import type { + UppyFile, + Body, + Meta, AsyncStore, UnknownProviderPlugin, UnknownProviderPluginState, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import locale from './locale.js' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json diff --git a/packages/@uppy/companion-client/src/CompanionPluginOptions.ts b/packages/@uppy/companion-client/src/CompanionPluginOptions.ts index a923952e7..decfdecab 100644 --- a/packages/@uppy/companion-client/src/CompanionPluginOptions.ts +++ b/packages/@uppy/companion-client/src/CompanionPluginOptions.ts @@ -1,5 +1,4 @@ -import type { UIPluginOptions } from '@uppy/core' -import type { AsyncStore } from '@uppy/core/lib/Uppy.js' +import type { UIPluginOptions, AsyncStore } from '@uppy/core' export interface CompanionPluginOptions extends UIPluginOptions { storage?: AsyncStore diff --git a/packages/@uppy/companion-client/src/Provider.ts b/packages/@uppy/companion-client/src/Provider.ts index 0aaa06b91..3a716c3df 100644 --- a/packages/@uppy/companion-client/src/Provider.ts +++ b/packages/@uppy/companion-client/src/Provider.ts @@ -1,11 +1,14 @@ -import type { Uppy } from '@uppy/core' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' -import type { PluginOpts } from '@uppy/core/lib/BasePlugin.js' +import type { + Uppy, + Body, + Meta, + PluginOpts, + UnknownProviderPlugin, +} from '@uppy/core' import type { RequestOptions, CompanionClientProvider, } from '@uppy/utils/lib/CompanionClientProvider' -import type { UnknownProviderPlugin } from '@uppy/core/lib/Uppy.js' import RequestClient, { authErrorStatusCode } from './RequestClient.js' import type { CompanionPluginOptions } from './index.js' import { isOriginAllowed } from './getAllowedHosts.js' diff --git a/packages/@uppy/companion-client/src/SearchProvider.ts b/packages/@uppy/companion-client/src/SearchProvider.ts index 44904d0c7..7a9b266c7 100644 --- a/packages/@uppy/companion-client/src/SearchProvider.ts +++ b/packages/@uppy/companion-client/src/SearchProvider.ts @@ -1,5 +1,4 @@ -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' -import type { Uppy } from '@uppy/core' +import type { Body, Meta, Uppy } from '@uppy/core' import type { CompanionClientSearchProvider } from '@uppy/utils/lib/CompanionClientProvider' import RequestClient, { type Opts } from './RequestClient.js' diff --git a/packages/@uppy/compressor/src/index.ts b/packages/@uppy/compressor/src/index.ts index be75a3cd4..2e7d2d87b 100644 --- a/packages/@uppy/compressor/src/index.ts +++ b/packages/@uppy/compressor/src/index.ts @@ -7,7 +7,7 @@ import prettierBytes from '@transloadit/prettier-bytes' import CompressorJS from 'compressorjs' import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile' -import type { DefinePluginOpts, PluginOpts } from '@uppy/core/lib/BasePlugin.js' +import type { DefinePluginOpts, PluginOpts } from '@uppy/core' import locale from './locale.js' diff --git a/packages/@uppy/core/src/Uppy.test.ts b/packages/@uppy/core/src/Uppy.test.ts index b88a16e82..86815dba6 100644 --- a/packages/@uppy/core/src/Uppy.test.ts +++ b/packages/@uppy/core/src/Uppy.test.ts @@ -6,7 +6,7 @@ import assert from 'node:assert' import fs from 'node:fs' import path from 'node:path' import prettierBytes from '@transloadit/prettier-bytes' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' +import type { Body, Meta } from '@uppy/core' import type { Locale } from '@uppy/utils/lib/Translator' import Core from './index.js' import UIPlugin from './UIPlugin.js' diff --git a/packages/@uppy/core/src/index.ts b/packages/@uppy/core/src/index.ts index 236c57a17..1e860537e 100644 --- a/packages/@uppy/core/src/index.ts +++ b/packages/@uppy/core/src/index.ts @@ -1,13 +1,22 @@ -export { default } from './Uppy.js' -export { - default as Uppy, - type State, - type UnknownPlugin, - type UnknownProviderPlugin, - type UnknownSearchProviderPlugin, - type UploadResult, - type UppyEventMap, - type UppyOptions, +export { default, default as Uppy } from './Uppy.js' +export type { + State, + BaseProviderPlugin, + PartialTree, + PartialTreeFile, + PartialTreeFolder, + PartialTreeFolderNode, + PartialTreeFolderRoot, + PartialTreeId, + UnknownPlugin, + UnknownProviderPlugin, + UnknownProviderPluginState, + UnknownSearchProviderPlugin, + UnknownSearchProviderPluginState, + UploadResult, + UppyEventMap, + UppyOptions, + AsyncStore, } from './Uppy.js' export { default as UIPlugin } from './UIPlugin.js' @@ -20,4 +29,9 @@ export { debugLogger } from './loggers.js' export type { Store } from '@uppy/store-default' -export type { UppyFile, Meta, Body } from '@uppy/utils/lib/UppyFile' +export type { + UppyFile, + MinimalRequiredUppyFile, + Meta, + Body, +} from '@uppy/utils/lib/UppyFile' diff --git a/packages/@uppy/dashboard/src/Dashboard.tsx b/packages/@uppy/dashboard/src/Dashboard.tsx index ad0ec9b03..644f5c2cd 100644 --- a/packages/@uppy/dashboard/src/Dashboard.tsx +++ b/packages/@uppy/dashboard/src/Dashboard.tsx @@ -1,14 +1,16 @@ -import { - UIPlugin, - type UIPluginOptions, - type UnknownPlugin, - type Uppy, - type UploadResult, - type State, -} from '@uppy/core' import type { ComponentChild, VNode } from 'preact' -import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js' -import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile' +import { UIPlugin } from '@uppy/core' +import type { + Body, + Meta, + UppyFile, + UIPluginOptions, + UnknownPlugin, + Uppy, + UploadResult, + State, + DefinePluginOpts, +} from '@uppy/core' import StatusBar from '@uppy/status-bar' import Informer from '@uppy/informer' import ThumbnailGenerator from '@uppy/thumbnail-generator' diff --git a/packages/@uppy/dashboard/src/components/Dashboard.tsx b/packages/@uppy/dashboard/src/components/Dashboard.tsx index dbb47c6fa..4caa2936a 100644 --- a/packages/@uppy/dashboard/src/components/Dashboard.tsx +++ b/packages/@uppy/dashboard/src/components/Dashboard.tsx @@ -2,8 +2,15 @@ import { h } from 'preact' import classNames from 'classnames' import isDragDropSupported from '@uppy/utils/lib/isDragDropSupported' -import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile' -import type { State, UIPlugin, UIPluginOptions, Uppy } from '@uppy/core' +import type { + Body, + Meta, + UppyFile, + State, + UIPlugin, + UIPluginOptions, + Uppy, +} from '@uppy/core' import type { I18n } from '@uppy/utils/lib/Translator' import type Translator from '@uppy/utils/lib/Translator' import type { TargetedEvent } from 'preact/compat' diff --git a/packages/@uppy/dashboard/src/components/FileItem/Buttons/index.tsx b/packages/@uppy/dashboard/src/components/FileItem/Buttons/index.tsx index c9421f27b..d7d6fbd3f 100644 --- a/packages/@uppy/dashboard/src/components/FileItem/Buttons/index.tsx +++ b/packages/@uppy/dashboard/src/components/FileItem/Buttons/index.tsx @@ -1,5 +1,5 @@ import { h } from 'preact' -import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile' +import type { Body, Meta, UppyFile } from '@uppy/core' import type Uppy from '@uppy/core' import type { I18n } from '@uppy/utils/lib/Translator' import copyToClipboard from '../../../utils/copyToClipboard.js' diff --git a/packages/@uppy/dashboard/src/components/FileItem/FileProgress/index.tsx b/packages/@uppy/dashboard/src/components/FileItem/FileProgress/index.tsx index 1147d7a9d..f3cc2566c 100644 --- a/packages/@uppy/dashboard/src/components/FileItem/FileProgress/index.tsx +++ b/packages/@uppy/dashboard/src/components/FileItem/FileProgress/index.tsx @@ -1,8 +1,7 @@ /* eslint-disable react/no-unused-prop-types */ /* eslint-disable react/destructuring-assignment */ -import type { State, Uppy, UppyFile } from '@uppy/core' +import type { Body, Meta, State, Uppy, UppyFile } from '@uppy/core' import type { I18n } from '@uppy/utils/lib/Translator' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' import { h, type ComponentChild } from 'preact' interface Props { diff --git a/packages/@uppy/dashboard/src/components/FileItem/index.tsx b/packages/@uppy/dashboard/src/components/FileItem/index.tsx index a962c1055..86246fd47 100644 --- a/packages/@uppy/dashboard/src/components/FileItem/index.tsx +++ b/packages/@uppy/dashboard/src/components/FileItem/index.tsx @@ -2,10 +2,9 @@ import { h, Component, type ComponentChild } from 'preact' import classNames from 'classnames' import { shallowEqualObjects } from 'shallow-equal' -import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile' +import type { UppyFile, Body, Meta, State } from '@uppy/core' import type { I18n } from '@uppy/utils/lib/Translator' import type Uppy from '@uppy/core' -import type { State } from '@uppy/core' import FilePreviewAndLink from './FilePreviewAndLink/index.jsx' import FileProgress from './FileProgress/index.jsx' import FileInfo from './FileInfo/index.jsx' diff --git a/packages/@uppy/dashboard/src/components/FileList.tsx b/packages/@uppy/dashboard/src/components/FileList.tsx index 6f67460b8..8c8fdba14 100644 --- a/packages/@uppy/dashboard/src/components/FileList.tsx +++ b/packages/@uppy/dashboard/src/components/FileList.tsx @@ -3,9 +3,8 @@ import { useMemo } from 'preact/hooks' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore untyped import VirtualList from '@uppy/utils/lib/VirtualList' -import type { UppyFile, Uppy, State } from '@uppy/core' +import type { UppyFile, Uppy, State, Body, Meta } from '@uppy/core' import type { I18n } from '@uppy/utils/lib/Translator' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' import FileItem from './FileItem/index.jsx' import type { DashboardState } from '../Dashboard.js' diff --git a/packages/@uppy/dashboard/src/components/PickerPanelTopBar.tsx b/packages/@uppy/dashboard/src/components/PickerPanelTopBar.tsx index f00d1fb7a..02a19abf6 100644 --- a/packages/@uppy/dashboard/src/components/PickerPanelTopBar.tsx +++ b/packages/@uppy/dashboard/src/components/PickerPanelTopBar.tsx @@ -1,4 +1,4 @@ -import type { UppyFile } from '@uppy/utils/lib/UppyFile' +import type { UppyFile } from '@uppy/core' import { h } from 'preact' type $TSFixMe = any diff --git a/packages/@uppy/drag-drop/src/DragDrop.tsx b/packages/@uppy/drag-drop/src/DragDrop.tsx index 02ce832d4..2b2c9ab6b 100644 --- a/packages/@uppy/drag-drop/src/DragDrop.tsx +++ b/packages/@uppy/drag-drop/src/DragDrop.tsx @@ -1,7 +1,11 @@ -import { UIPlugin, type Uppy } from '@uppy/core' -import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js' -import type { UIPluginOptions } from '@uppy/core/lib/UIPlugin.js' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' +import { UIPlugin } from '@uppy/core' +import type { + UIPluginOptions, + Uppy, + DefinePluginOpts, + Body, + Meta, +} from '@uppy/core' import type { TargetedEvent } from 'preact/compat' import toArray from '@uppy/utils/lib/toArray' import isDragDropSupported from '@uppy/utils/lib/isDragDropSupported' diff --git a/packages/@uppy/drop-target/src/index.ts b/packages/@uppy/drop-target/src/index.ts index 6f3067fb7..b66e1ac51 100644 --- a/packages/@uppy/drop-target/src/index.ts +++ b/packages/@uppy/drop-target/src/index.ts @@ -1,7 +1,5 @@ -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' -import type { Uppy } from '@uppy/core/lib/Uppy.js' -import type { DefinePluginOpts, PluginOpts } from '@uppy/core/lib/BasePlugin.js' -import BasePlugin from '@uppy/core/lib/BasePlugin.js' +import type { Uppy, Body, Meta, DefinePluginOpts, PluginOpts } from '@uppy/core' +import { BasePlugin } from '@uppy/core' import getDroppedFiles from '@uppy/utils/lib/getDroppedFiles' import toArray from '@uppy/utils/lib/toArray' // eslint-disable-next-line @typescript-eslint/ban-ts-comment diff --git a/packages/@uppy/dropbox/src/Dropbox.tsx b/packages/@uppy/dropbox/src/Dropbox.tsx index 94421bdff..f57a47b93 100644 --- a/packages/@uppy/dropbox/src/Dropbox.tsx +++ b/packages/@uppy/dropbox/src/Dropbox.tsx @@ -8,12 +8,14 @@ import { UIPlugin, Uppy } from '@uppy/core' import { ProviderViews } from '@uppy/provider-views' import { h, type ComponentChild } from 'preact' -import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile' import type { + UppyFile, + Body, + Meta, AsyncStore, UnknownProviderPlugin, UnknownProviderPluginState, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import locale from './locale.js' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json diff --git a/packages/@uppy/facebook/src/Facebook.tsx b/packages/@uppy/facebook/src/Facebook.tsx index 1fef41fd5..3b4732791 100644 --- a/packages/@uppy/facebook/src/Facebook.tsx +++ b/packages/@uppy/facebook/src/Facebook.tsx @@ -8,12 +8,14 @@ import { UIPlugin, Uppy } from '@uppy/core' import { ProviderViews } from '@uppy/provider-views' import { h, type ComponentChild } from 'preact' -import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile' import type { + UppyFile, + Body, + Meta, AsyncStore, UnknownProviderPlugin, UnknownProviderPluginState, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import locale from './locale.js' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json diff --git a/packages/@uppy/file-input/src/FileInput.tsx b/packages/@uppy/file-input/src/FileInput.tsx index 90002d402..e36987da4 100644 --- a/packages/@uppy/file-input/src/FileInput.tsx +++ b/packages/@uppy/file-input/src/FileInput.tsx @@ -1,9 +1,14 @@ import { h, type ComponentChild } from 'preact' -import { UIPlugin, Uppy, type UIPluginOptions } from '@uppy/core' +import { UIPlugin } from '@uppy/core' +import type { + Uppy, + UIPluginOptions, + Body, + Meta, + DefinePluginOpts, +} from '@uppy/core' import toArray from '@uppy/utils/lib/toArray' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' -import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js' import type { TargetedEvent } from 'preact/compat' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json diff --git a/packages/@uppy/form/src/index.ts b/packages/@uppy/form/src/index.ts index 3c541866e..6d4cb0541 100644 --- a/packages/@uppy/form/src/index.ts +++ b/packages/@uppy/form/src/index.ts @@ -1,4 +1,12 @@ -import BasePlugin, { type DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js' +import { BasePlugin } from '@uppy/core' +import type { + DefinePluginOpts, + UIPluginOptions, + Uppy, + UppyEventMap, + Body, + Meta, +} from '@uppy/core' import findDOMElement from '@uppy/utils/lib/findDOMElement' import toArray from '@uppy/utils/lib/toArray' @@ -6,8 +14,6 @@ import toArray from '@uppy/utils/lib/toArray' // @ts-ignore untyped import getFormData from 'get-form-data' -import type { UIPluginOptions, Uppy, UppyEventMap } from '@uppy/core' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json import packageJson from '../package.json' diff --git a/packages/@uppy/golden-retriever/src/MetaDataStore.ts b/packages/@uppy/golden-retriever/src/MetaDataStore.ts index 5435964e4..2f80084c0 100644 --- a/packages/@uppy/golden-retriever/src/MetaDataStore.ts +++ b/packages/@uppy/golden-retriever/src/MetaDataStore.ts @@ -1,5 +1,4 @@ -import type { State as UppyState } from '@uppy/core' -import type { Meta, Body } from '@uppy/utils/lib/UppyFile' +import type { State as UppyState, Meta, Body } from '@uppy/core' export type StoredState = { expires: number diff --git a/packages/@uppy/golden-retriever/src/index.ts b/packages/@uppy/golden-retriever/src/index.ts index 566f03e60..cd279cd19 100644 --- a/packages/@uppy/golden-retriever/src/index.ts +++ b/packages/@uppy/golden-retriever/src/index.ts @@ -1,9 +1,14 @@ import throttle from 'lodash/throttle.js' -import BasePlugin from '@uppy/core/lib/BasePlugin.js' -import type { PluginOpts, DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js' -import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile' -import type Uppy from '@uppy/core' -import type { UploadResult } from '@uppy/core' +import { BasePlugin } from '@uppy/core' +import type { + Body, + Meta, + UppyFile, + Uppy, + UploadResult, + PluginOpts, + DefinePluginOpts, +} from '@uppy/core' import ServiceWorkerStore, { type ServiceWorkerStoredFile, } from './ServiceWorkerStore.js' diff --git a/packages/@uppy/google-drive-picker/src/GoogleDrivePicker.tsx b/packages/@uppy/google-drive-picker/src/GoogleDrivePicker.tsx index af7b61567..cc3b51945 100644 --- a/packages/@uppy/google-drive-picker/src/GoogleDrivePicker.tsx +++ b/packages/@uppy/google-drive-picker/src/GoogleDrivePicker.tsx @@ -9,8 +9,7 @@ import { } from '@uppy/companion-client' import type { PickedItem } from '@uppy/provider-views/lib/GooglePicker/googlePicker.js' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' -import type { AsyncStore, BaseProviderPlugin } from '@uppy/core/lib/Uppy.js' +import type { Body, Meta, AsyncStore, BaseProviderPlugin } from '@uppy/core' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json diff --git a/packages/@uppy/google-drive/src/DriveProviderViews.ts b/packages/@uppy/google-drive/src/DriveProviderViews.ts index 3ea16e5da..ca060b9e9 100644 --- a/packages/@uppy/google-drive/src/DriveProviderViews.ts +++ b/packages/@uppy/google-drive/src/DriveProviderViews.ts @@ -1,9 +1,10 @@ import type { PartialTreeFile, PartialTreeFolderNode, -} from '@uppy/core/lib/Uppy.js' + Body, + Meta, +} from '@uppy/core' import { ProviderViews } from '@uppy/provider-views' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' export default class DriveProviderViews< M extends Meta, diff --git a/packages/@uppy/google-drive/src/GoogleDrive.tsx b/packages/@uppy/google-drive/src/GoogleDrive.tsx index 21e6f221f..9ed1b065d 100644 --- a/packages/@uppy/google-drive/src/GoogleDrive.tsx +++ b/packages/@uppy/google-drive/src/GoogleDrive.tsx @@ -8,12 +8,14 @@ import { UIPlugin, Uppy } from '@uppy/core' import { ProviderViews } from '@uppy/provider-views' import { h, type ComponentChild } from 'preact' -import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile' import type { + UppyFile, + Body, + Meta, AsyncStore, UnknownProviderPlugin, UnknownProviderPluginState, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import DriveProviderViews from './DriveProviderViews.js' import locale from './locale.js' // eslint-disable-next-line @typescript-eslint/ban-ts-comment diff --git a/packages/@uppy/google-photos-picker/src/GooglePhotosPicker.tsx b/packages/@uppy/google-photos-picker/src/GooglePhotosPicker.tsx index e6594d4ba..e859285af 100644 --- a/packages/@uppy/google-photos-picker/src/GooglePhotosPicker.tsx +++ b/packages/@uppy/google-photos-picker/src/GooglePhotosPicker.tsx @@ -9,8 +9,7 @@ import { } from '@uppy/companion-client' import type { PickedItem } from '@uppy/provider-views/lib/GooglePicker/googlePicker.js' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' -import type { AsyncStore, BaseProviderPlugin } from '@uppy/core/lib/Uppy.js' +import type { Body, Meta, AsyncStore, BaseProviderPlugin } from '@uppy/core' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json diff --git a/packages/@uppy/google-photos/src/GooglePhotos.tsx b/packages/@uppy/google-photos/src/GooglePhotos.tsx index b32ce7b90..393342849 100644 --- a/packages/@uppy/google-photos/src/GooglePhotos.tsx +++ b/packages/@uppy/google-photos/src/GooglePhotos.tsx @@ -8,12 +8,14 @@ import { } from '@uppy/companion-client' import { h, type ComponentChild } from 'preact' -import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile' import type { + UppyFile, + Body, + Meta, AsyncStore, UnknownProviderPlugin, UnknownProviderPluginState, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json diff --git a/packages/@uppy/image-editor/src/Editor.tsx b/packages/@uppy/image-editor/src/Editor.tsx index ae646952b..b2e84cf2f 100644 --- a/packages/@uppy/image-editor/src/Editor.tsx +++ b/packages/@uppy/image-editor/src/Editor.tsx @@ -1,7 +1,7 @@ /* eslint-disable jsx-a11y/label-has-associated-control */ import Cropper from 'cropperjs' import { h, Component } from 'preact' -import type { Meta, Body, UppyFile } from '@uppy/utils/lib/UppyFile' +import type { Meta, Body, UppyFile } from '@uppy/core' import type { I18n } from '@uppy/utils/lib/Translator' import getCanvasDataThatFitsPerfectlyIntoContainer from './utils/getCanvasDataThatFitsPerfectlyIntoContainer.js' import getScaleFactorThatRemovesDarkCorners from './utils/getScaleFactorThatRemovesDarkCorners.js' diff --git a/packages/@uppy/image-editor/src/ImageEditor.tsx b/packages/@uppy/image-editor/src/ImageEditor.tsx index 52a3583df..1f896ef39 100644 --- a/packages/@uppy/image-editor/src/ImageEditor.tsx +++ b/packages/@uppy/image-editor/src/ImageEditor.tsx @@ -1,9 +1,15 @@ -import { UIPlugin, type UIPluginOptions, type Uppy } from '@uppy/core' -import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js' +import { UIPlugin } from '@uppy/core' +import type { + UIPluginOptions, + Uppy, + DefinePluginOpts, + Meta, + Body, + UppyFile, +} from '@uppy/core' import type Cropper from 'cropperjs' import { h } from 'preact' -import type { Meta, Body, UppyFile } from '@uppy/utils/lib/UppyFile' import Editor from './Editor.jsx' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json diff --git a/packages/@uppy/informer/src/Informer.tsx b/packages/@uppy/informer/src/Informer.tsx index f8fd7cc31..cfb49d159 100644 --- a/packages/@uppy/informer/src/Informer.tsx +++ b/packages/@uppy/informer/src/Informer.tsx @@ -2,8 +2,7 @@ /* eslint-disable jsx-a11y/click-events-have-key-events */ import { h, type ComponentChild } from 'preact' import { UIPlugin } from '@uppy/core' -import type { State, UIPluginOptions, Uppy } from '@uppy/core' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' +import type { State, UIPluginOptions, Uppy, Body, Meta } from '@uppy/core' import FadeIn from './FadeIn.jsx' import TransitionGroup from './TransitionGroup.js' diff --git a/packages/@uppy/instagram/src/Instagram.tsx b/packages/@uppy/instagram/src/Instagram.tsx index 0f5cb7cf5..b3175832c 100644 --- a/packages/@uppy/instagram/src/Instagram.tsx +++ b/packages/@uppy/instagram/src/Instagram.tsx @@ -8,12 +8,14 @@ import { UIPlugin, Uppy } from '@uppy/core' import { ProviderViews } from '@uppy/provider-views' import { h, type ComponentChild } from 'preact' -import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile' import type { + UppyFile, + Body, + Meta, AsyncStore, UnknownProviderPlugin, UnknownProviderPluginState, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import locale from './locale.js' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json diff --git a/packages/@uppy/onedrive/src/OneDrive.tsx b/packages/@uppy/onedrive/src/OneDrive.tsx index f08ba79fd..f224899e2 100644 --- a/packages/@uppy/onedrive/src/OneDrive.tsx +++ b/packages/@uppy/onedrive/src/OneDrive.tsx @@ -8,12 +8,14 @@ import { UIPlugin, Uppy } from '@uppy/core' import { ProviderViews } from '@uppy/provider-views' import { h, type ComponentChild } from 'preact' -import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile' import type { + UppyFile, + Body, + Meta, AsyncStore, UnknownProviderPlugin, UnknownProviderPluginState, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import locale from './locale.js' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json diff --git a/packages/@uppy/progress-bar/src/ProgressBar.tsx b/packages/@uppy/progress-bar/src/ProgressBar.tsx index 42a2036ca..d48a6c362 100644 --- a/packages/@uppy/progress-bar/src/ProgressBar.tsx +++ b/packages/@uppy/progress-bar/src/ProgressBar.tsx @@ -1,8 +1,13 @@ import { h, type ComponentChild } from 'preact' -import { UIPlugin, type UIPluginOptions } from '@uppy/core' -import type { Uppy, State } from '@uppy/core/lib/Uppy.js' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' -import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js' +import { UIPlugin } from '@uppy/core' +import type { + Uppy, + State, + UIPluginOptions, + Body, + Meta, + DefinePluginOpts, +} from '@uppy/core' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json diff --git a/packages/@uppy/provider-views/src/Breadcrumbs.tsx b/packages/@uppy/provider-views/src/Breadcrumbs.tsx index 16f2c39e2..3e0d4c6d8 100644 --- a/packages/@uppy/provider-views/src/Breadcrumbs.tsx +++ b/packages/@uppy/provider-views/src/Breadcrumbs.tsx @@ -1,6 +1,5 @@ -import type { PartialTreeFolder } from '@uppy/core/lib/Uppy.js' +import type { PartialTreeFolder, Body, Meta } from '@uppy/core' import { h, Fragment } from 'preact' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' import type ProviderView from './ProviderView/index.js' type BreadcrumbsProps = { diff --git a/packages/@uppy/provider-views/src/Browser.tsx b/packages/@uppy/provider-views/src/Browser.tsx index 7cecf3d23..926dc9988 100644 --- a/packages/@uppy/provider-views/src/Browser.tsx +++ b/packages/@uppy/provider-views/src/Browser.tsx @@ -3,12 +3,13 @@ import { h } from 'preact' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore untyped import VirtualList from '@uppy/utils/lib/VirtualList' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' -import type { I18n } from '@uppy/utils/lib/Translator' import type { + Body, + Meta, PartialTreeFile, PartialTreeFolderNode, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' +import type { I18n } from '@uppy/utils/lib/Translator' import { useEffect, useState } from 'preact/hooks' import Item from './Item/index.jsx' import ProviderView from './ProviderView/ProviderView.jsx' diff --git a/packages/@uppy/provider-views/src/FooterActions.tsx b/packages/@uppy/provider-views/src/FooterActions.tsx index c215a6eaa..3b8155c7d 100644 --- a/packages/@uppy/provider-views/src/FooterActions.tsx +++ b/packages/@uppy/provider-views/src/FooterActions.tsx @@ -1,8 +1,7 @@ import { h } from 'preact' import type { I18n } from '@uppy/utils/lib/Translator' -import type { Meta, Body } from '@uppy/utils/lib/UppyFile' +import type { Meta, Body, PartialTree } from '@uppy/core' import classNames from 'classnames' -import type { PartialTree } from '@uppy/core/lib/Uppy.js' import { useMemo } from 'preact/hooks' import getNumberOfSelectedFiles from './utils/PartialTreeUtils/getNumberOfSelectedFiles.js' import ProviderView from './ProviderView/ProviderView.jsx' diff --git a/packages/@uppy/provider-views/src/GooglePicker/GooglePickerView.tsx b/packages/@uppy/provider-views/src/GooglePicker/GooglePickerView.tsx index 798ac3420..139e0296b 100644 --- a/packages/@uppy/provider-views/src/GooglePicker/GooglePickerView.tsx +++ b/packages/@uppy/provider-views/src/GooglePicker/GooglePickerView.tsx @@ -1,8 +1,7 @@ import { h } from 'preact' import { useCallback, useEffect, useRef, useState } from 'preact/hooks' -import type { Uppy } from '@uppy/core' -import type { AsyncStore } from '@uppy/core/lib/Uppy.js' +import type { Uppy, AsyncStore } from '@uppy/core' import { authorize, diff --git a/packages/@uppy/provider-views/src/Item/components/GridItem.tsx b/packages/@uppy/provider-views/src/Item/components/GridItem.tsx index 6ec3930a5..858b26e81 100644 --- a/packages/@uppy/provider-views/src/Item/components/GridItem.tsx +++ b/packages/@uppy/provider-views/src/Item/components/GridItem.tsx @@ -1,8 +1,5 @@ import { h } from 'preact' -import type { - PartialTreeFile, - PartialTreeFolderNode, -} from '@uppy/core/lib/Uppy.js' +import type { PartialTreeFile, PartialTreeFolderNode } from '@uppy/core' import ItemIcon from './ItemIcon.jsx' type GridItemProps = { diff --git a/packages/@uppy/provider-views/src/Item/components/ListItem.tsx b/packages/@uppy/provider-views/src/Item/components/ListItem.tsx index 6185953fd..0f0058457 100644 --- a/packages/@uppy/provider-views/src/Item/components/ListItem.tsx +++ b/packages/@uppy/provider-views/src/Item/components/ListItem.tsx @@ -2,7 +2,7 @@ import type { PartialTreeFile, PartialTreeFolderNode, PartialTreeId, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import { h } from 'preact' import ItemIcon from './ItemIcon.jsx' diff --git a/packages/@uppy/provider-views/src/Item/index.tsx b/packages/@uppy/provider-views/src/Item/index.tsx index b94e84d3c..5a2d22c1b 100644 --- a/packages/@uppy/provider-views/src/Item/index.tsx +++ b/packages/@uppy/provider-views/src/Item/index.tsx @@ -7,7 +7,7 @@ import type { PartialTreeFile, PartialTreeFolderNode, PartialTreeId, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import GridItem from './components/GridItem.jsx' import ListItem from './components/ListItem.jsx' diff --git a/packages/@uppy/provider-views/src/ProviderView/AuthView.tsx b/packages/@uppy/provider-views/src/ProviderView/AuthView.tsx index 4a07909a8..d98be3889 100644 --- a/packages/@uppy/provider-views/src/ProviderView/AuthView.tsx +++ b/packages/@uppy/provider-views/src/ProviderView/AuthView.tsx @@ -1,6 +1,6 @@ import { h } from 'preact' import { useCallback } from 'preact/hooks' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' +import type { Body, Meta } from '@uppy/core' import type { I18n } from '@uppy/utils/lib/Translator' import type { Opts } from './ProviderView.js' import type ProviderViews from './ProviderView.js' diff --git a/packages/@uppy/provider-views/src/ProviderView/Header.tsx b/packages/@uppy/provider-views/src/ProviderView/Header.tsx index 1dc897e58..61e3fe958 100644 --- a/packages/@uppy/provider-views/src/ProviderView/Header.tsx +++ b/packages/@uppy/provider-views/src/ProviderView/Header.tsx @@ -1,8 +1,7 @@ /* eslint-disable react/destructuring-assignment */ import { h } from 'preact' import type { I18n } from '@uppy/utils/lib/Translator' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' -import type { PartialTreeFolder } from '@uppy/core/lib/Uppy.js' +import type { Body, Meta, PartialTreeFolder } from '@uppy/core' import classNames from 'classnames' import User from './User.jsx' import Breadcrumbs from '../Breadcrumbs.jsx' diff --git a/packages/@uppy/provider-views/src/ProviderView/ProviderView.tsx b/packages/@uppy/provider-views/src/ProviderView/ProviderView.tsx index 6bc5e4cd2..fbcbd720d 100644 --- a/packages/@uppy/provider-views/src/ProviderView/ProviderView.tsx +++ b/packages/@uppy/provider-views/src/ProviderView/ProviderView.tsx @@ -7,8 +7,9 @@ import type { UnknownProviderPluginState, PartialTreeId, PartialTree, -} from '@uppy/core/lib/Uppy.js' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' + Body, + Meta, +} from '@uppy/core' import type { CompanionFile } from '@uppy/utils/lib/CompanionFile' import classNames from 'classnames' import type { ValidateableFile } from '@uppy/core/lib/Restricter.js' diff --git a/packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.tsx b/packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.tsx index 5b8069cb9..399955e81 100644 --- a/packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.tsx +++ b/packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.tsx @@ -1,19 +1,20 @@ import { h } from 'preact' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' import type { + Body, + Meta, + DefinePluginOpts, PartialTree, PartialTreeFile, PartialTreeFolderNode, PartialTreeFolderRoot, UnknownSearchProviderPlugin, UnknownSearchProviderPluginState, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import type { CompanionFile } from '@uppy/utils/lib/CompanionFile' import classNames from 'classnames' import type { ValidateableFile } from '@uppy/core/lib/Restricter.js' import remoteFileObjToLocal from '@uppy/utils/lib/remoteFileObjToLocal' -import type { DefinePluginOpts } from '@uppy/core' import SearchInput from '../SearchInput.jsx' import Browser from '../Browser.jsx' diff --git a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/afterFill.ts b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/afterFill.ts index 417dbd76e..eb0390d6c 100644 --- a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/afterFill.ts +++ b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/afterFill.ts @@ -4,7 +4,7 @@ import type { PartialTreeFile, PartialTreeFolderNode, PartialTreeId, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import type { CompanionFile } from '@uppy/utils/lib/CompanionFile' // p-queue does not have a `"main"` field in its `package.json`, and that makes `import/no-unresolved` freak out. // We can safely ignore it because bundlers will happily use the `"exports"` field instead. diff --git a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/afterOpenFolder.ts b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/afterOpenFolder.ts index 182fc1f6a..b81cd537a 100644 --- a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/afterOpenFolder.ts +++ b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/afterOpenFolder.ts @@ -3,7 +3,7 @@ import type { PartialTreeFile, PartialTreeFolder, PartialTreeFolderNode, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import type { CompanionFile } from '@uppy/utils/lib/CompanionFile' const afterOpenFolder = ( diff --git a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/afterScrollFolder.ts b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/afterScrollFolder.ts index 632c97017..8ec176983 100644 --- a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/afterScrollFolder.ts +++ b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/afterScrollFolder.ts @@ -4,7 +4,7 @@ import type { PartialTreeFolder, PartialTreeFolderNode, PartialTreeId, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import type { CompanionFile } from '@uppy/utils/lib/CompanionFile' const afterScrollFolder = ( diff --git a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/afterToggleCheckbox.ts b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/afterToggleCheckbox.ts index ccb2d736d..101085c81 100644 --- a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/afterToggleCheckbox.ts +++ b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/afterToggleCheckbox.ts @@ -5,7 +5,7 @@ import type { PartialTreeFolder, PartialTreeFolderNode, PartialTreeId, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import shallowClone from './shallowClone.js' /* diff --git a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/getBreadcrumbs.ts b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/getBreadcrumbs.ts index 9a1942472..c5785a925 100644 --- a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/getBreadcrumbs.ts +++ b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/getBreadcrumbs.ts @@ -3,7 +3,7 @@ import type { PartialTreeFolder, PartialTreeFolderNode, PartialTreeId, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' const getBreadcrumbs = ( partialTree: PartialTree, diff --git a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/getCheckedFilesWithPaths.ts b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/getCheckedFilesWithPaths.ts index 8ebc72540..742fdf665 100644 --- a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/getCheckedFilesWithPaths.ts +++ b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/getCheckedFilesWithPaths.ts @@ -4,7 +4,7 @@ import type { PartialTreeFile, PartialTreeFolderNode, PartialTreeId, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import type { CompanionFile } from '@uppy/utils/lib/CompanionFile' export interface Cache { diff --git a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/getNumberOfSelectedFiles.ts b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/getNumberOfSelectedFiles.ts index 3d8635f13..1c6643509 100644 --- a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/getNumberOfSelectedFiles.ts +++ b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/getNumberOfSelectedFiles.ts @@ -1,4 +1,4 @@ -import type { PartialTree } from '@uppy/core/lib/Uppy.js' +import type { PartialTree } from '@uppy/core' /** * We're interested in all 'checked' leaves of this tree, diff --git a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/index.test.ts b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/index.test.ts index 3d813cb00..74b32d205 100644 --- a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/index.test.ts +++ b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/index.test.ts @@ -7,7 +7,7 @@ import type { PartialTreeFolderNode, PartialTreeFolderRoot, PartialTreeId, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import afterToggleCheckbox from './afterToggleCheckbox.js' import afterOpenFolder from './afterOpenFolder.js' import afterScrollFolder from './afterScrollFolder.js' diff --git a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/shallowClone.ts b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/shallowClone.ts index fa61ed586..a68cdbf3c 100644 --- a/packages/@uppy/provider-views/src/utils/PartialTreeUtils/shallowClone.ts +++ b/packages/@uppy/provider-views/src/utils/PartialTreeUtils/shallowClone.ts @@ -1,4 +1,4 @@ -import type { PartialTree } from '@uppy/core/lib/Uppy.js' +import type { PartialTree } from '@uppy/core' /** * One-level copying is sufficient as mutations within our `partialTree` are limited to properties diff --git a/packages/@uppy/provider-views/src/utils/getClickedRange.ts b/packages/@uppy/provider-views/src/utils/getClickedRange.ts index 637885f0f..71d8c6eac 100644 --- a/packages/@uppy/provider-views/src/utils/getClickedRange.ts +++ b/packages/@uppy/provider-views/src/utils/getClickedRange.ts @@ -1,7 +1,4 @@ -import type { - PartialTreeFile, - PartialTreeFolderNode, -} from '@uppy/core/lib/Uppy.js' +import type { PartialTreeFile, PartialTreeFolderNode } from '@uppy/core' // Shift-clicking selects a single consecutive list of items // starting at the previous click. diff --git a/packages/@uppy/react/src/Dashboard.ts b/packages/@uppy/react/src/Dashboard.ts index 8a135c777..2c164a66e 100644 --- a/packages/@uppy/react/src/Dashboard.ts +++ b/packages/@uppy/react/src/Dashboard.ts @@ -1,8 +1,7 @@ import { createElement as h, Component } from 'react' import type React from 'react' -import type { UnknownPlugin, Uppy } from '@uppy/core' +import type { UnknownPlugin, Uppy, Body, Meta } from '@uppy/core' import DashboardPlugin from '@uppy/dashboard' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' import type { DashboardOptions } from '@uppy/dashboard' import getHTMLProps from './getHTMLProps.js' import nonHtmlPropsHaveChanged from './nonHtmlPropsHaveChanged.js' diff --git a/packages/@uppy/react/src/DashboardModal.ts b/packages/@uppy/react/src/DashboardModal.ts index 401fc3581..c623f21cf 100644 --- a/packages/@uppy/react/src/DashboardModal.ts +++ b/packages/@uppy/react/src/DashboardModal.ts @@ -1,8 +1,7 @@ import { createElement as h, Component } from 'react' import type React from 'react' import DashboardPlugin, { type DashboardOptions } from '@uppy/dashboard' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' -import type { Uppy } from '@uppy/core' +import type { Body, Meta, Uppy } from '@uppy/core' import getHTMLProps from './getHTMLProps.js' import nonHtmlPropsHaveChanged from './nonHtmlPropsHaveChanged.js' diff --git a/packages/@uppy/react/src/DragDrop.ts b/packages/@uppy/react/src/DragDrop.ts index 19aed5456..5c6dce867 100644 --- a/packages/@uppy/react/src/DragDrop.ts +++ b/packages/@uppy/react/src/DragDrop.ts @@ -1,7 +1,6 @@ import { createElement as h, Component } from 'react' -import type { UnknownPlugin, Uppy } from '@uppy/core' +import type { UnknownPlugin, Uppy, Body, Meta } from '@uppy/core' import DragDropPlugin, { type DragDropOptions } from '@uppy/drag-drop' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' import getHTMLProps from './getHTMLProps.js' import nonHtmlPropsHaveChanged from './nonHtmlPropsHaveChanged.js' diff --git a/packages/@uppy/react/src/FileInput.ts b/packages/@uppy/react/src/FileInput.ts index 740c389f3..6885b9123 100644 --- a/packages/@uppy/react/src/FileInput.ts +++ b/packages/@uppy/react/src/FileInput.ts @@ -1,7 +1,12 @@ import { createElement as h, Component } from 'react' -import type { UIPluginOptions, UnknownPlugin, Uppy } from '@uppy/core' +import type { + UIPluginOptions, + UnknownPlugin, + Uppy, + Body, + Meta, +} from '@uppy/core' import FileInputPlugin from '@uppy/file-input' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' import type { Locale } from '@uppy/utils/lib/Translator' interface FileInputProps diff --git a/packages/@uppy/react/src/ProgressBar.ts b/packages/@uppy/react/src/ProgressBar.ts index ec528b83c..e3ae8b8cb 100644 --- a/packages/@uppy/react/src/ProgressBar.ts +++ b/packages/@uppy/react/src/ProgressBar.ts @@ -1,7 +1,6 @@ import { createElement as h, Component } from 'react' -import type { UnknownPlugin, Uppy } from '@uppy/core' +import type { UnknownPlugin, Uppy, Body, Meta } from '@uppy/core' import ProgressBarPlugin, { type ProgressBarOptions } from '@uppy/progress-bar' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' import getHTMLProps from './getHTMLProps.js' import nonHtmlPropsHaveChanged from './nonHtmlPropsHaveChanged.js' diff --git a/packages/@uppy/react/src/StatusBar.ts b/packages/@uppy/react/src/StatusBar.ts index 8a35e7cc2..8319d20de 100644 --- a/packages/@uppy/react/src/StatusBar.ts +++ b/packages/@uppy/react/src/StatusBar.ts @@ -1,7 +1,6 @@ import { createElement as h, Component } from 'react' -import type { UnknownPlugin, Uppy } from '@uppy/core' +import type { UnknownPlugin, Uppy, Body, Meta } from '@uppy/core' import StatusBarPlugin, { type StatusBarOptions } from '@uppy/status-bar' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' import getHTMLProps from './getHTMLProps.js' import nonHtmlPropsHaveChanged from './nonHtmlPropsHaveChanged.js' diff --git a/packages/@uppy/react/src/useUppyEvent.ts b/packages/@uppy/react/src/useUppyEvent.ts index 54f23a95c..4e1ae2648 100644 --- a/packages/@uppy/react/src/useUppyEvent.ts +++ b/packages/@uppy/react/src/useUppyEvent.ts @@ -1,5 +1,4 @@ -import type { Uppy, UppyEventMap } from '@uppy/core' -import type { Meta, Body } from '@uppy/utils/lib/UppyFile' +import type { Meta, Body, Uppy, UppyEventMap } from '@uppy/core' import { useEffect, useState } from 'react' type EventResults< diff --git a/packages/@uppy/react/src/useUppyState.ts b/packages/@uppy/react/src/useUppyState.ts index b811e89a7..f22c8d7d1 100644 --- a/packages/@uppy/react/src/useUppyState.ts +++ b/packages/@uppy/react/src/useUppyState.ts @@ -1,5 +1,4 @@ -import type { Uppy, State } from '@uppy/core' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' +import type { Uppy, State, Body, Meta } from '@uppy/core' import { useMemo, useCallback } from 'react' import { useSyncExternalStoreWithSelector } from 'use-sync-external-store/with-selector.js' diff --git a/packages/@uppy/remote-sources/src/index.ts b/packages/@uppy/remote-sources/src/index.ts index 460e6123e..c7ec1d867 100644 --- a/packages/@uppy/remote-sources/src/index.ts +++ b/packages/@uppy/remote-sources/src/index.ts @@ -1,4 +1,11 @@ -import { BasePlugin, Uppy, type UnknownProviderPlugin } from '@uppy/core' +import { BasePlugin } from '@uppy/core' +import type { + Uppy, + UnknownProviderPlugin, + DefinePluginOpts, + Body, + Meta, +} from '@uppy/core' import Dropbox from '@uppy/dropbox' import GoogleDrive from '@uppy/google-drive' import GooglePhotos from '@uppy/google-photos' @@ -10,8 +17,6 @@ import Unsplash from '@uppy/unsplash' import Url from '@uppy/url' import Zoom from '@uppy/zoom' -import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' import type { CompanionPluginOptions } from '@uppy/companion-client' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json diff --git a/packages/@uppy/screen-capture/src/RecorderScreen.tsx b/packages/@uppy/screen-capture/src/RecorderScreen.tsx index a59079583..924c7a1b5 100644 --- a/packages/@uppy/screen-capture/src/RecorderScreen.tsx +++ b/packages/@uppy/screen-capture/src/RecorderScreen.tsx @@ -1,6 +1,6 @@ /* eslint-disable react/jsx-props-no-spreading */ import { h, Component, type ComponentChild } from 'preact' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' +import type { Body, Meta } from '@uppy/core' import RecordButton from './RecordButton.jsx' import SubmitButton from './SubmitButton.jsx' import StopWatch from './StopWatch.jsx' diff --git a/packages/@uppy/screen-capture/src/ScreenCapture.tsx b/packages/@uppy/screen-capture/src/ScreenCapture.tsx index 82d262ba7..22ab7f93f 100644 --- a/packages/@uppy/screen-capture/src/ScreenCapture.tsx +++ b/packages/@uppy/screen-capture/src/ScreenCapture.tsx @@ -1,8 +1,13 @@ import { h, type ComponentChild } from 'preact' -import { UIPlugin, Uppy, type UIPluginOptions } from '@uppy/core' +import { UIPlugin } from '@uppy/core' +import type { + Uppy, + UIPluginOptions, + DefinePluginOpts, + Body, + Meta, +} from '@uppy/core' import getFileTypeExtension from '@uppy/utils/lib/getFileTypeExtension' -import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' import ScreenRecIcon from './ScreenRecIcon.jsx' import RecorderScreen from './RecorderScreen.jsx' diff --git a/packages/@uppy/status-bar/src/Components.tsx b/packages/@uppy/status-bar/src/Components.tsx index d7cfc49d3..41e56b20d 100644 --- a/packages/@uppy/status-bar/src/Components.tsx +++ b/packages/@uppy/status-bar/src/Components.tsx @@ -1,5 +1,4 @@ -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' -import type { State, Uppy } from '@uppy/core/lib/Uppy.js' +import type { Body, Meta, State, Uppy } from '@uppy/core' import type { FileProcessingInfo } from '@uppy/utils/lib/FileProgress' import type { I18n } from '@uppy/utils/lib/Translator' import { h } from 'preact' diff --git a/packages/@uppy/status-bar/src/StatusBar.tsx b/packages/@uppy/status-bar/src/StatusBar.tsx index 5e5e3859a..5113450f0 100644 --- a/packages/@uppy/status-bar/src/StatusBar.tsx +++ b/packages/@uppy/status-bar/src/StatusBar.tsx @@ -1,7 +1,12 @@ import type { ComponentChild } from 'preact' -import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile' -import type { Uppy, State } from '@uppy/core/lib/Uppy.js' -import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js' +import type { + Body, + Meta, + UppyFile, + DefinePluginOpts, + Uppy, + State, +} from '@uppy/core' import { UIPlugin } from '@uppy/core' import emaFilter from '@uppy/utils/lib/emaFilter' import getTextDirection from '@uppy/utils/lib/getTextDirection' diff --git a/packages/@uppy/status-bar/src/StatusBarUI.tsx b/packages/@uppy/status-bar/src/StatusBarUI.tsx index 6e7abc941..f10b87096 100644 --- a/packages/@uppy/status-bar/src/StatusBarUI.tsx +++ b/packages/@uppy/status-bar/src/StatusBarUI.tsx @@ -1,6 +1,5 @@ -import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile' +import type { Body, Meta, UppyFile, Uppy, State } from '@uppy/core' import type { I18n } from '@uppy/utils/lib/Translator' -import type { Uppy, State } from '@uppy/core/lib/Uppy.js' import { h } from 'preact' import classNames from 'classnames' import statusBarStates from './StatusBarStates.js' diff --git a/packages/@uppy/thumbnail-generator/src/index.ts b/packages/@uppy/thumbnail-generator/src/index.ts index 0c3aab419..8b699c125 100644 --- a/packages/@uppy/thumbnail-generator/src/index.ts +++ b/packages/@uppy/thumbnail-generator/src/index.ts @@ -1,4 +1,5 @@ -import { UIPlugin, Uppy, type UIPluginOptions } from '@uppy/core' +import { UIPlugin } from '@uppy/core' +import type { Uppy, UIPluginOptions, DefinePluginOpts } from '@uppy/core' import dataURItoBlob from '@uppy/utils/lib/dataURItoBlob' import isObjectURL from '@uppy/utils/lib/isObjectURL' import isPreviewSupported from '@uppy/utils/lib/isPreviewSupported' @@ -6,7 +7,6 @@ import isPreviewSupported from '@uppy/utils/lib/isPreviewSupported' // @ts-ignore untyped import { rotation } from 'exifr/dist/mini.esm.mjs' -import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js' import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile' import locale from './locale.js' // eslint-disable-next-line @typescript-eslint/ban-ts-comment diff --git a/packages/@uppy/transloadit/src/AssemblyWatcher.ts b/packages/@uppy/transloadit/src/AssemblyWatcher.ts index 6982316dc..72682d314 100644 --- a/packages/@uppy/transloadit/src/AssemblyWatcher.ts +++ b/packages/@uppy/transloadit/src/AssemblyWatcher.ts @@ -1,5 +1,4 @@ -import type { Uppy } from '@uppy/core' -import type { Body, Meta } from '@uppy/utils/lib/UppyFile' +import type { Uppy, Body, Meta } from '@uppy/core' import Emitter from 'component-emitter' import type { AssemblyResponse } from './index.js' diff --git a/packages/@uppy/transloadit/src/index.ts b/packages/@uppy/transloadit/src/index.ts index 57de81128..f4b69fd99 100644 --- a/packages/@uppy/transloadit/src/index.ts +++ b/packages/@uppy/transloadit/src/index.ts @@ -1,11 +1,16 @@ import hasProperty from '@uppy/utils/lib/hasProperty' import ErrorWithCause from '@uppy/utils/lib/ErrorWithCause' import { RateLimitedQueue } from '@uppy/utils/lib/RateLimitedQueue' -import BasePlugin from '@uppy/core/lib/BasePlugin.js' -import type { DefinePluginOpts, PluginOpts } from '@uppy/core/lib/BasePlugin.js' import Tus, { type TusDetailedError, type TusOpts } from '@uppy/tus' -import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile' -import type { Uppy } from '@uppy/core' +import { BasePlugin } from '@uppy/core' +import type { + DefinePluginOpts, + PluginOpts, + Uppy, + Body, + Meta, + UppyFile, +} from '@uppy/core' import Assembly from './Assembly.js' import Client, { AssemblyError } from './Client.js' import AssemblyWatcher from './AssemblyWatcher.js' diff --git a/packages/@uppy/tus/src/index.ts b/packages/@uppy/tus/src/index.ts index f4e62fe93..20dde1484 100644 --- a/packages/@uppy/tus/src/index.ts +++ b/packages/@uppy/tus/src/index.ts @@ -1,7 +1,12 @@ -import BasePlugin, { - type DefinePluginOpts, - type PluginOpts, -} from '@uppy/core/lib/BasePlugin.js' +import { BasePlugin } from '@uppy/core' +import type { + Uppy, + DefinePluginOpts, + PluginOpts, + Meta, + Body, + UppyFile, +} from '@uppy/core' import * as tus from 'tus-js-client' import EventManager from '@uppy/core/lib/EventManager.js' import NetworkError from '@uppy/utils/lib/NetworkError' @@ -14,8 +19,6 @@ import { filterNonFailedFiles, filterFilesToEmitUploadStarted, } from '@uppy/utils/lib/fileFilters' -import type { Meta, Body, UppyFile } from '@uppy/utils/lib/UppyFile' -import type { Uppy } from '@uppy/core' import type { RequestClient } from '@uppy/companion-client' import getAllowedMetaFields from '@uppy/utils/lib/getAllowedMetaFields' import getFingerprint from './getFingerprint.js' diff --git a/packages/@uppy/unsplash/src/Unsplash.tsx b/packages/@uppy/unsplash/src/Unsplash.tsx index 0979e95d2..22225e70d 100644 --- a/packages/@uppy/unsplash/src/Unsplash.tsx +++ b/packages/@uppy/unsplash/src/Unsplash.tsx @@ -8,12 +8,14 @@ import { UIPlugin, Uppy } from '@uppy/core' import { SearchProviderViews } from '@uppy/provider-views' import { h, type ComponentChild } from 'preact' -import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile' import type { + UppyFile, + Body, + Meta, AsyncStore, UnknownSearchProviderPlugin, UnknownSearchProviderPluginState, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import locale from './locale.js' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json diff --git a/packages/@uppy/url/src/Url.tsx b/packages/@uppy/url/src/Url.tsx index 07d879940..1dc8b82fc 100644 --- a/packages/@uppy/url/src/Url.tsx +++ b/packages/@uppy/url/src/Url.tsx @@ -5,7 +5,8 @@ import { type CompanionPluginOptions, } from '@uppy/companion-client' import toArray from '@uppy/utils/lib/toArray' -import type { TagFile, Meta, Body } from '@uppy/utils/lib/UppyFile' +import type { Meta, Body } from '@uppy/core' +import type { TagFile } from '@uppy/utils/lib/UppyFile' import UrlUI from './UrlUI.jsx' import forEachDroppedOrPastedUrl from './utils/forEachDroppedOrPastedUrl.js' diff --git a/packages/@uppy/vue/src/dashboard-modal.ts b/packages/@uppy/vue/src/dashboard-modal.ts index 1bfff7cd7..a0df22ce3 100644 --- a/packages/@uppy/vue/src/dashboard-modal.ts +++ b/packages/@uppy/vue/src/dashboard-modal.ts @@ -1,7 +1,7 @@ import { defineComponent, ref, watch, h, type PropType } from 'vue' import DashboardPlugin, { type DashboardOptions } from '@uppy/dashboard' import { Uppy } from '@uppy/core' -import type { Meta, Body } from '@uppy/utils/lib/UppyFile' +import type { Meta, Body } from '@uppy/core' import useUppy from './useUppy.js' type DashboardModalOptions = Omit< diff --git a/packages/@uppy/vue/src/dashboard.ts b/packages/@uppy/vue/src/dashboard.ts index 3cf663c87..7b5383f76 100644 --- a/packages/@uppy/vue/src/dashboard.ts +++ b/packages/@uppy/vue/src/dashboard.ts @@ -1,7 +1,6 @@ import { defineComponent, ref, h, type PropType } from 'vue' import DashboardPlugin, { type DashboardOptions } from '@uppy/dashboard' -import type { Uppy } from '@uppy/core' -import type { Meta, Body } from '@uppy/utils/lib/UppyFile' +import type { Uppy, Meta, Body } from '@uppy/core' import useUppy from './useUppy.js' type DashboardInlineOptions = Omit< diff --git a/packages/@uppy/webcam/src/Webcam.tsx b/packages/@uppy/webcam/src/Webcam.tsx index 9ee079037..104ffaac9 100644 --- a/packages/@uppy/webcam/src/Webcam.tsx +++ b/packages/@uppy/webcam/src/Webcam.tsx @@ -1,13 +1,14 @@ import { h, type ComponentChild } from 'preact' import { UIPlugin } from '@uppy/core' -import type { Uppy, UIPluginOptions } from '@uppy/core' -import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js' import type { + Uppy, + UIPluginOptions, + DefinePluginOpts, Body, Meta, MinimalRequiredUppyFile, -} from '@uppy/utils/lib/UppyFile' +} from '@uppy/core' import type { PluginTarget } from '@uppy/core/lib/UIPlugin.js' import getFileTypeExtension from '@uppy/utils/lib/getFileTypeExtension' import mimeTypes from '@uppy/utils/lib/mimeTypes' diff --git a/packages/@uppy/webdav/src/Webdav.tsx b/packages/@uppy/webdav/src/Webdav.tsx index 48a8b749f..71c96b8e7 100644 --- a/packages/@uppy/webdav/src/Webdav.tsx +++ b/packages/@uppy/webdav/src/Webdav.tsx @@ -1,12 +1,15 @@ import { h, type ComponentChild } from 'preact' import { useState, useCallback } from 'preact/hooks' -import { - UIPlugin, - type Body, - type Meta, - type UnknownProviderPlugin, - type UppyFile, +import { UIPlugin } from '@uppy/core' +import type { + Body, + Meta, + UnknownProviderPlugin, + UppyFile, + AsyncStore, + UnknownProviderPluginState, + Uppy, } from '@uppy/core' import { Provider, @@ -15,11 +18,6 @@ import { } from '@uppy/companion-client' import { SearchInput, ProviderViews } from '@uppy/provider-views' -import type { - AsyncStore, - UnknownProviderPluginState, - Uppy, -} from '@uppy/core/lib/Uppy.js' import type { I18n } from '@uppy/utils/lib/Translator' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json diff --git a/packages/@uppy/xhr-upload/src/index.ts b/packages/@uppy/xhr-upload/src/index.ts index d9f3fb936..c219ab779 100644 --- a/packages/@uppy/xhr-upload/src/index.ts +++ b/packages/@uppy/xhr-upload/src/index.ts @@ -1,5 +1,13 @@ -import BasePlugin from '@uppy/core/lib/BasePlugin.js' -import type { DefinePluginOpts, PluginOpts } from '@uppy/core/lib/BasePlugin.js' +import { BasePlugin } from '@uppy/core' +import type { + State, + Uppy, + DefinePluginOpts, + PluginOpts, + Meta, + Body, + UppyFile, +} from '@uppy/core' import type { RequestClient } from '@uppy/companion-client' import EventManager from '@uppy/core/lib/EventManager.js' import { @@ -15,10 +23,6 @@ import { filterNonFailedFiles, filterFilesToEmitUploadStarted, } from '@uppy/utils/lib/fileFilters' -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-ignore We don't want TS to generate types for the package.json -import type { Meta, Body, UppyFile } from '@uppy/utils/lib/UppyFile' -import type { State, Uppy } from '@uppy/core' import getAllowedMetaFields from '@uppy/utils/lib/getAllowedMetaFields' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json diff --git a/packages/@uppy/zoom/src/Zoom.tsx b/packages/@uppy/zoom/src/Zoom.tsx index 93e954b4f..af326f7a0 100644 --- a/packages/@uppy/zoom/src/Zoom.tsx +++ b/packages/@uppy/zoom/src/Zoom.tsx @@ -8,12 +8,14 @@ import { UIPlugin, Uppy } from '@uppy/core' import { ProviderViews } from '@uppy/provider-views' import { h, type ComponentChild } from 'preact' -import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile' import type { + UppyFile, + Body, + Meta, AsyncStore, UnknownProviderPlugin, UnknownProviderPluginState, -} from '@uppy/core/lib/Uppy.js' +} from '@uppy/core' import locale from './locale.js' // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore We don't want TS to generate types for the package.json diff --git a/packages/uppy/src/bundle.ts b/packages/uppy/src/bundle.ts index 297347300..14aca4eda 100644 --- a/packages/uppy/src/bundle.ts +++ b/packages/uppy/src/bundle.ts @@ -4,7 +4,7 @@ export { default as Uppy, debugLogger } from '@uppy/core' // Plugin base classes export { default as UIPlugin } from '@uppy/core/lib/UIPlugin.js' -export { default as BasePlugin } from '@uppy/core/lib/BasePlugin.js' +export { default as BasePlugin } from '@uppy/core' /** * @deprecated Use `Uppy` instead of `Core`