Browse Source

fix type imports (#5038)

We sometimes where importing source files, which may not be available in
production. Instead we should target extension-less paths in `lib/`
folders so the generated `.d.ts` files are used.
Antoine du Hamel 1 year ago
parent
commit
00405fb24c
29 changed files with 36 additions and 35 deletions
  1. 1 1
      packages/@uppy/audio/src/Audio.tsx
  2. 1 1
      packages/@uppy/aws-s3-multipart/src/index.ts
  3. 2 2
      packages/@uppy/companion-client/src/Provider.ts
  4. 1 1
      packages/@uppy/companion-client/src/RequestClient.ts
  5. 1 1
      packages/@uppy/companion-client/src/SearchProvider.ts
  6. 1 1
      packages/@uppy/compressor/src/index.ts
  7. 1 1
      packages/@uppy/dashboard/src/Dashboard.tsx
  8. 2 2
      packages/@uppy/drag-drop/src/DragDrop.tsx
  9. 1 1
      packages/@uppy/drop-target/src/index.ts
  10. 1 1
      packages/@uppy/dropbox/src/Dropbox.tsx
  11. 1 1
      packages/@uppy/facebook/src/Facebook.tsx
  12. 1 1
      packages/@uppy/golden-retriever/src/index.ts
  13. 1 1
      packages/@uppy/google-drive/src/GoogleDrive.tsx
  14. 1 1
      packages/@uppy/instagram/src/Instagram.tsx
  15. 1 1
      packages/@uppy/onedrive/src/OneDrive.tsx
  16. 2 1
      packages/@uppy/progress-bar/src/ProgressBar.tsx
  17. 1 1
      packages/@uppy/provider-views/src/Item/index.tsx
  18. 1 1
      packages/@uppy/provider-views/src/ProviderView/Header.tsx
  19. 2 2
      packages/@uppy/provider-views/src/ProviderView/ProviderView.tsx
  20. 2 2
      packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.tsx
  21. 1 1
      packages/@uppy/remote-sources/src/index.ts
  22. 1 1
      packages/@uppy/screen-capture/src/ScreenCapture.tsx
  23. 1 1
      packages/@uppy/status-bar/src/Components.tsx
  24. 2 2
      packages/@uppy/status-bar/src/StatusBar.tsx
  25. 1 1
      packages/@uppy/status-bar/src/StatusBarUI.tsx
  26. 1 1
      packages/@uppy/thumbnail-generator/src/index.ts
  27. 1 1
      packages/@uppy/unsplash/src/Unsplash.tsx
  28. 2 2
      packages/@uppy/webcam/src/Webcam.tsx
  29. 1 1
      packages/@uppy/zoom/src/Zoom.tsx

+ 1 - 1
packages/@uppy/audio/src/Audio.tsx

@@ -6,7 +6,7 @@ import type {
   Meta,
   MinimalRequiredUppyFile,
 } from '@uppy/utils/lib/UppyFile'
-import type { Uppy } from '@uppy/core/lib/Uppy.ts'
+import type { Uppy } from '@uppy/core/lib/Uppy'
 
 import getFileTypeExtension from '@uppy/utils/lib/getFileTypeExtension'
 import supportsMediaRecorder from './supportsMediaRecorder.ts'

+ 1 - 1
packages/@uppy/aws-s3-multipart/src/index.ts

@@ -3,7 +3,7 @@ import BasePlugin, {
   type PluginOpts,
 } from '@uppy/core/lib/BasePlugin.js'
 import { RequestClient } from '@uppy/companion-client'
-import type { RequestOptions } from '@uppy/utils/lib/CompanionClientProvider.ts'
+import type { RequestOptions } from '@uppy/utils/lib/CompanionClientProvider'
 import type { Body as _Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile'
 import type { Uppy } from '@uppy/core'
 import EventManager from '@uppy/core/lib/EventManager.js'

+ 2 - 2
packages/@uppy/companion-client/src/Provider.ts

@@ -1,11 +1,11 @@
 import type { Uppy } from '@uppy/core'
 import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
-import type { PluginOpts } from '@uppy/core/lib/BasePlugin.ts'
+import type { PluginOpts } from '@uppy/core/lib/BasePlugin'
 import type {
   RequestOptions,
   CompanionClientProvider,
 } from '@uppy/utils/lib/CompanionClientProvider'
-import type { UnknownProviderPlugin } from '@uppy/core/lib/Uppy.ts'
+import type { UnknownProviderPlugin } from '@uppy/core/lib/Uppy'
 import RequestClient, { authErrorStatusCode } from './RequestClient.ts'
 import type { CompanionPluginOptions } from '.'
 

+ 1 - 1
packages/@uppy/companion-client/src/RequestClient.ts

@@ -9,7 +9,7 @@ import getSocketHost from '@uppy/utils/lib/getSocketHost'
 
 import type Uppy from '@uppy/core'
 import type { UppyFile, Meta, Body } from '@uppy/utils/lib/UppyFile'
-import type { RequestOptions } from '@uppy/utils/lib/CompanionClientProvider.ts'
+import type { RequestOptions } from '@uppy/utils/lib/CompanionClientProvider'
 import AuthError from './AuthError.ts'
 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-ignore We don't want TS to generate types for the package.json

+ 1 - 1
packages/@uppy/companion-client/src/SearchProvider.ts

@@ -1,4 +1,4 @@
-import type { Body, Meta } from '@uppy/utils/lib/UppyFile.ts'
+import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
 import type { Uppy } from '@uppy/core'
 import type { CompanionClientSearchProvider } from '@uppy/utils/lib/CompanionClientProvider'
 import RequestClient, { type Opts } from './RequestClient.ts'

+ 1 - 1
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 { PluginOpts } from '@uppy/core/lib/BasePlugin.ts'
+import type { PluginOpts } from '@uppy/core/lib/BasePlugin'
 
 import locale from './locale.ts'
 

+ 1 - 1
packages/@uppy/dashboard/src/Dashboard.tsx

@@ -7,7 +7,7 @@ import {
   type State,
 } from '@uppy/core'
 import type { ComponentChild, VNode } from 'preact'
-import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.ts'
+import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin'
 import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile'
 import StatusBar from '@uppy/status-bar'
 import Informer from '@uppy/informer'

+ 2 - 2
packages/@uppy/drag-drop/src/DragDrop.tsx

@@ -1,6 +1,6 @@
 import { UIPlugin, type Uppy } from '@uppy/core'
-import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.ts'
-import type { UIPluginOptions } from '@uppy/core/lib/UIPlugin.ts'
+import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin'
+import type { UIPluginOptions } from '@uppy/core/lib/UIPlugin'
 import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
 import type { ChangeEvent } from 'preact/compat'
 import toArray from '@uppy/utils/lib/toArray'

+ 1 - 1
packages/@uppy/drop-target/src/index.ts

@@ -1,5 +1,5 @@
 import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
-import type { Uppy } from '@uppy/core/src/Uppy.ts'
+import type { Uppy } from '@uppy/core/lib/Uppy'
 import type { DefinePluginOpts, PluginOpts } from '@uppy/core/lib/BasePlugin.js'
 import BasePlugin from '@uppy/core/lib/BasePlugin.js'
 import getDroppedFiles from '@uppy/utils/lib/getDroppedFiles'

+ 1 - 1
packages/@uppy/dropbox/src/Dropbox.tsx

@@ -9,7 +9,7 @@ import { ProviderViews } from '@uppy/provider-views'
 import { h, type ComponentChild } from 'preact'
 
 import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile'
-import type { UnknownProviderPluginState } from '@uppy/core/lib/Uppy.ts'
+import type { UnknownProviderPluginState } from '@uppy/core/lib/Uppy'
 import locale from './locale.ts'
 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-ignore We don't want TS to generate types for the package.json

+ 1 - 1
packages/@uppy/facebook/src/Facebook.tsx

@@ -9,7 +9,7 @@ import { ProviderViews } from '@uppy/provider-views'
 import { h, type ComponentChild } from 'preact'
 
 import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile'
-import type { UnknownProviderPluginState } from '@uppy/core/lib/Uppy.ts'
+import type { UnknownProviderPluginState } from '@uppy/core/lib/Uppy'
 import locale from './locale.ts'
 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-ignore We don't want TS to generate types for the package.json

+ 1 - 1
packages/@uppy/golden-retriever/src/index.ts

@@ -1,6 +1,6 @@
 import throttle from 'lodash/throttle.js'
 import BasePlugin from '@uppy/core/lib/BasePlugin.js'
-import type { PluginOpts, DefinePluginOpts } from '@uppy/core/lib/BasePlugin.ts'
+import type { PluginOpts, DefinePluginOpts } from '@uppy/core/lib/BasePlugin'
 import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile'
 import type Uppy from '@uppy/core'
 import type { UploadResult } from '@uppy/core'

+ 1 - 1
packages/@uppy/google-drive/src/GoogleDrive.tsx

@@ -9,7 +9,7 @@ import { ProviderViews } from '@uppy/provider-views'
 import { h, type ComponentChild } from 'preact'
 
 import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile'
-import type { UnknownProviderPluginState } from '@uppy/core/lib/Uppy.ts'
+import type { UnknownProviderPluginState } from '@uppy/core/lib/Uppy'
 import DriveProviderViews from './DriveProviderViews.ts'
 import locale from './locale.ts'
 // eslint-disable-next-line @typescript-eslint/ban-ts-comment

+ 1 - 1
packages/@uppy/instagram/src/Instagram.tsx

@@ -9,7 +9,7 @@ import { ProviderViews } from '@uppy/provider-views'
 import { h, type ComponentChild } from 'preact'
 
 import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile'
-import type { UnknownProviderPluginState } from '@uppy/core/lib/Uppy.ts'
+import type { UnknownProviderPluginState } from '@uppy/core/lib/Uppy'
 import locale from './locale.ts'
 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-ignore We don't want TS to generate types for the package.json

+ 1 - 1
packages/@uppy/onedrive/src/OneDrive.tsx

@@ -9,7 +9,7 @@ import { ProviderViews } from '@uppy/provider-views'
 import { h, type ComponentChild } from 'preact'
 
 import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile'
-import type { UnknownProviderPluginState } from '@uppy/core/lib/Uppy.ts'
+import type { UnknownProviderPluginState } from '@uppy/core/lib/Uppy'
 import locale from './locale.ts'
 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-ignore We don't want TS to generate types for the package.json

+ 2 - 1
packages/@uppy/progress-bar/src/ProgressBar.tsx

@@ -1,5 +1,6 @@
 import { h, type ComponentChild } from 'preact'
-import { UIPlugin, Uppy, type UIPluginOptions, type State } from '@uppy/core'
+import { UIPlugin, type UIPluginOptions } from '@uppy/core'
+import type { Uppy, State } from '@uppy/core/lib/Uppy'
 import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
 import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.js'
 

+ 1 - 1
packages/@uppy/provider-views/src/Item/index.tsx

@@ -4,7 +4,7 @@ import { h } from 'preact'
 import classNames from 'classnames'
 import type { I18n } from '@uppy/utils/lib/Translator'
 import type { CompanionFile } from '@uppy/utils/lib/CompanionFile'
-import type { RestrictionError } from '@uppy/core/lib/Restricter.ts'
+import type { RestrictionError } from '@uppy/core/lib/Restricter'
 import type { Meta, Body } from '@uppy/utils/lib/UppyFile'
 import ItemIcon from './components/ItemIcon.tsx'
 import GridListItem from './components/GridLi.tsx'

+ 1 - 1
packages/@uppy/provider-views/src/ProviderView/Header.tsx

@@ -2,7 +2,7 @@
 import { h, Fragment } from 'preact'
 import type { I18n } from '@uppy/utils/lib/Translator'
 import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
-import type { UnknownProviderPluginState } from '@uppy/core/lib/Uppy.ts'
+import type { UnknownProviderPluginState } from '@uppy/core/lib/Uppy'
 import User from './User.tsx'
 import Breadcrumbs from '../Breadcrumbs.tsx'
 import type ProviderView from './ProviderView.tsx'

+ 2 - 2
packages/@uppy/provider-views/src/ProviderView/ProviderView.tsx

@@ -9,9 +9,9 @@ import type {
   Uppy,
 } from '@uppy/core/lib/Uppy.ts'
 import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
-import type { CompanionFile } from '@uppy/utils/lib/CompanionFile.ts'
+import type { CompanionFile } from '@uppy/utils/lib/CompanionFile'
 import type Translator from '@uppy/utils/lib/Translator'
-import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.ts'
+import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin'
 import AuthView from './AuthView.tsx'
 import Header from './Header.tsx'
 import Browser from '../Browser.tsx'

+ 2 - 2
packages/@uppy/provider-views/src/SearchProviderView/SearchProviderView.tsx

@@ -1,8 +1,8 @@
 import { h } from 'preact'
 
 import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
-import type { UnknownSearchProviderPlugin } from '@uppy/core/lib/Uppy.ts'
-import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.ts'
+import type { UnknownSearchProviderPlugin } from '@uppy/core/lib/Uppy'
+import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin'
 import type Uppy from '@uppy/core'
 import type { CompanionFile } from '@uppy/utils/lib/CompanionFile'
 import SearchFilterInput from '../SearchFilterInput.tsx'

+ 1 - 1
packages/@uppy/remote-sources/src/index.ts

@@ -15,7 +15,7 @@ import Url from '@uppy/url'
 import Zoom from '@uppy/zoom'
 
 import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin'
-import type { Body, Meta } from '../../utils/src/UppyFile'
+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'

+ 1 - 1
packages/@uppy/screen-capture/src/ScreenCapture.tsx

@@ -1,7 +1,7 @@
 import { h, type ComponentChild } from 'preact'
 import { UIPlugin, Uppy, type UIPluginOptions } from '@uppy/core'
 import getFileTypeExtension from '@uppy/utils/lib/getFileTypeExtension'
-import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.ts'
+import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin'
 import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
 import ScreenRecIcon from './ScreenRecIcon.tsx'
 import RecorderScreen from './RecorderScreen.tsx'

+ 1 - 1
packages/@uppy/status-bar/src/Components.tsx

@@ -1,5 +1,5 @@
 import type { Body, Meta } from '@uppy/utils/lib/UppyFile'
-import type { State, Uppy } from '@uppy/core/src/Uppy.ts'
+import type { State, Uppy } from '@uppy/core/lib/Uppy'
 import type { FileProcessingInfo } from '@uppy/utils/lib/FileProgress'
 import type { I18n } from '@uppy/utils/lib/Translator'
 import { h } from 'preact'

+ 2 - 2
packages/@uppy/status-bar/src/StatusBar.tsx

@@ -1,7 +1,7 @@
 import type { ComponentChild } from 'preact'
 import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile'
-import type { Uppy, State } from '@uppy/core/src/Uppy.ts'
-import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin.ts'
+import type { Uppy, State } from '@uppy/core/lib/Uppy'
+import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin'
 import { UIPlugin } from '@uppy/core'
 import emaFilter from '@uppy/utils/lib/emaFilter'
 import getTextDirection from '@uppy/utils/lib/getTextDirection'

+ 1 - 1
packages/@uppy/status-bar/src/StatusBarUI.tsx

@@ -1,6 +1,6 @@
 import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile'
 import type { I18n } from '@uppy/utils/lib/Translator'
-import type { Uppy, State } from '@uppy/core/src/Uppy.ts'
+import type { Uppy, State } from '@uppy/core/lib/Uppy'
 import { h } from 'preact'
 import classNames from 'classnames'
 import statusBarStates from './StatusBarStates.ts'

+ 1 - 1
packages/@uppy/thumbnail-generator/src/index.ts

@@ -6,7 +6,7 @@ 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.ts'
+import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin'
 import type { Body, Meta, UppyFile } from '@uppy/utils/lib/UppyFile'
 import locale from './locale.ts'
 // eslint-disable-next-line @typescript-eslint/ban-ts-comment

+ 1 - 1
packages/@uppy/unsplash/src/Unsplash.tsx

@@ -9,7 +9,7 @@ import { SearchProviderViews } from '@uppy/provider-views'
 import { h, type ComponentChild } from 'preact'
 
 import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile'
-import type { UnknownSearchProviderPluginState } from '@uppy/core/lib/Uppy.ts'
+import type { UnknownSearchProviderPluginState } from '@uppy/core/lib/Uppy'
 // 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'

+ 2 - 2
packages/@uppy/webcam/src/Webcam.tsx

@@ -2,13 +2,13 @@ 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.ts'
+import type { DefinePluginOpts } from '@uppy/core/lib/BasePlugin'
 import type {
   Body,
   Meta,
   MinimalRequiredUppyFile,
 } from '@uppy/utils/lib/UppyFile.ts'
-import type { PluginTarget } from '@uppy/core/lib/UIPlugin.ts'
+import type { PluginTarget } from '@uppy/core/lib/UIPlugin'
 import getFileTypeExtension from '@uppy/utils/lib/getFileTypeExtension'
 import mimeTypes from '@uppy/utils/lib/mimeTypes'
 import isMobile from 'is-mobile'

+ 1 - 1
packages/@uppy/zoom/src/Zoom.tsx

@@ -9,7 +9,7 @@ import { ProviderViews } from '@uppy/provider-views'
 import { h, type ComponentChild } from 'preact'
 
 import type { UppyFile, Body, Meta } from '@uppy/utils/lib/UppyFile'
-import type { UnknownProviderPluginState } from '@uppy/core/lib/Uppy.ts'
+import type { UnknownProviderPluginState } from '@uppy/core/lib/Uppy'
 import locale from './locale.ts'
 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
 // @ts-ignore We don't want TS to generate types for the package.json