diff --git a/.eslintrc.js b/.eslintrc.js index 51e03ad1c..8df12192f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -22,7 +22,6 @@ module.exports = { window: true, }, plugins: [ - '@babel/eslint-plugin', 'jest', 'markdown', 'node', @@ -30,12 +29,11 @@ module.exports = { 'promise', 'react', // extra: - 'compat', 'jsdoc', 'no-only-tests', 'unicorn', ], - parser: '@babel/eslint-parser', + parser: '@typescript-eslint/parser', parserOptions: { sourceType: 'script', ecmaVersion: 2022, @@ -107,9 +105,6 @@ module.exports = { 'jsx-a11y/no-noninteractive-element-interactions': 'error', 'jsx-a11y/no-static-element-interactions': 'error', - // compat - 'compat/compat': ['error'], - // jsdoc 'jsdoc/check-alignment': 'error', 'jsdoc/check-examples': 'off', // cannot yet be supported for ESLint 8, see https://github.com/eslint/eslint/issues/14745 @@ -310,17 +305,6 @@ module.exports = { 'no-underscore-dangle': 'off', }, }, - { - files: [ - '*.test.js', - '*.test.ts', - 'test/endtoend/*.js', - 'bin/**.js', - ], - rules: { - 'compat/compat': ['off'], - }, - }, { files: [ 'bin/**.js', diff --git a/.github/workflows/bundlers.yml b/.github/workflows/bundlers.yml index b66982ae3..acf58cea2 100644 --- a/.github/workflows/bundlers.yml +++ b/.github/workflows/bundlers.yml @@ -97,12 +97,13 @@ jobs: - name: Add Rollup as a dev dependency run: >- npm i --save-dev @rollup/plugin-commonjs @rollup/plugin-node-resolve - rollup@${{matrix.bundler-version}} + @rollup/plugin-json rollup@${{matrix.bundler-version}} - run: npx rollup --version - name: Create Rollup config file run: >- echo ' import cjs from "@rollup/plugin-commonjs"; import { nodeResolve - } from "@rollup/plugin-node-resolve"; + } from "@rollup/plugin-node-resolve"; import json from + "@rollup/plugin-json"; export default { input: "./lib/index.js", @@ -110,6 +111,7 @@ jobs: file: "/dev/null", }, plugins: [ + json(), cjs(), nodeResolve({ browser: true, exportConditions: ["browser"] }), ], diff --git a/.yarn/patches/preact-npm-10.10.0-dd04de05e8.patch b/.yarn/patches/preact-npm-10.10.0-dd04de05e8.patch deleted file mode 100644 index 08aba7da0..000000000 --- a/.yarn/patches/preact-npm-10.10.0-dd04de05e8.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git a/debug/package.json b/debug/package.json -index 054944f5478a0a5cf7b6b8791950c595f956157b..06a4fe2719605eb42c5ee795101c21cfd10b59ce 100644 ---- a/debug/package.json -+++ b/debug/package.json -@@ -9,6 +9,7 @@ - "umd:main": "dist/debug.umd.js", - "source": "src/index.js", - "license": "MIT", -+ "type": "module", - "mangle": { - "regex": "^(?!_renderer)^_" - }, -diff --git a/devtools/package.json b/devtools/package.json -index 09b04a77690bdfba01083939ff9eaf987dd50bcb..92c159fbb3cf312c6674202085fb237d6fb921ad 100644 ---- a/devtools/package.json -+++ b/devtools/package.json -@@ -10,6 +10,7 @@ - "source": "src/index.js", - "license": "MIT", - "types": "src/index.d.ts", -+ "type": "module", - "peerDependencies": { - "preact": "^10.0.0" - }, -diff --git a/hooks/package.json b/hooks/package.json -index 74807025bf3de273ebada2cd355428a2c972503d..98501726ffbfe55ffa09928e56a9dcafb9a348ff 100644 ---- a/hooks/package.json -+++ b/hooks/package.json -@@ -10,6 +10,7 @@ - "source": "src/index.js", - "license": "MIT", - "types": "src/index.d.ts", -+ "type": "module", - "scripts": { - "build": "microbundle build --raw", - "dev": "microbundle watch --raw --format cjs", -diff --git a/jsx-runtime/package.json b/jsx-runtime/package.json -index 7a4027831223f16519a74e3028c34f2f8f5f011a..6b58d17dbacce81894467ef43c0a8e2435e388c4 100644 ---- a/jsx-runtime/package.json -+++ b/jsx-runtime/package.json -@@ -10,6 +10,7 @@ - "source": "src/index.js", - "types": "src/index.d.ts", - "license": "MIT", -+ "type": "module", - "peerDependencies": { - "preact": "^10.0.0" - }, -diff --git a/package.json b/package.json -index 60279c24a08b808ffbf7dc64a038272bddb6785d..088f35fb2c92f2e9b7248557857af2839988d1aa 100644 ---- a/package.json -+++ b/package.json -@@ -9,6 +9,7 @@ - "umd:main": "dist/preact.umd.js", - "unpkg": "dist/preact.min.js", - "source": "src/index.js", -+ "type": "module", - "exports": { - ".": { - "types": "./src/index.d.ts", diff --git a/babel.config.js b/babel.config.js deleted file mode 100644 index 529ea982d..000000000 --- a/babel.config.js +++ /dev/null @@ -1,26 +0,0 @@ -module.exports = (api) => { - const targets = {} - if (api.env('test')) { - targets.node = 'current' - } - - return { - presets: [ - ['@babel/preset-env', { - include: [ - '@babel/plugin-proposal-nullish-coalescing-operator', - '@babel/plugin-proposal-optional-chaining', - '@babel/plugin-proposal-numeric-separator', - ], - loose: true, - targets, - useBuiltIns: false, // Don't add polyfills automatically. - modules: false, - }], - ], - plugins: [ - ['@babel/plugin-transform-react-jsx', { pragma: 'h', pragmaFrag: 'Fragment' }], - process.env.NODE_ENV !== 'dev' && 'babel-plugin-inline-package-json', - ].filter(Boolean), - } -} diff --git a/bin/build-lib.mjs b/bin/build-lib.mjs deleted file mode 100644 index 51664c763..000000000 --- a/bin/build-lib.mjs +++ /dev/null @@ -1,145 +0,0 @@ -import babel from '@babel/core' -import t from '@babel/types' -import { promisify } from 'node:util' -import { fileURLToPath } from 'node:url' -import globRaw from 'glob' -import { mkdir, stat, writeFile, readFile } from 'node:fs/promises' -import path from 'node:path' - -const glob = promisify(globRaw) - - -const PACKAGE_JSON_IMPORT = /^\..*\/package.json$/ -const SOURCE = 'packages/{*,@uppy/*}/src/**/*.{js,ts}?(x)' -// Files not to build (such as tests) -const IGNORE = /\.test\.jsx?$|\.test\.tsx?$|__mocks__|svelte|angular|companion\//; -// Files that should trigger a rebuild of everything on change -const META_FILES = [ - 'babel.config.js', - 'package.json', - 'package-lock.json', - 'yarn.lock', - 'bin/build-lib.js', -] - -function lastModified (file, createParentDir = false) { - return stat(file).then((s) => s.mtime, async (err) => { - if (err.code === 'ENOENT') { - if (createParentDir) { - await mkdir(path.dirname(file), { recursive: true }) - } - return 0 - } - throw err - }) -} - -const versionCache = new Map() - -// eslint-disable-next-line no-underscore-dangle -const __dirname = path.dirname(fileURLToPath(import.meta.url)); - -async function preparePackage (file) { - const packageFolder = file.slice(0, file.indexOf('/src/')) - if (versionCache.has(packageFolder)) return - - // eslint-disable-next-line import/no-dynamic-require, global-require - const { version } = JSON.parse(await readFile(path.join(__dirname, '..', packageFolder, 'package.json'), 'utf8')) - if (process.env.FRESH) { - // in case it hasn't been done before. - await mkdir(path.join(packageFolder, 'lib'), { recursive: true }) - } - versionCache.set(packageFolder, version) -} - -const nonJSImport = /^\.\.?\/.+\.([jt]sx|ts)$/ -// eslint-disable-next-line no-shadow -function rewriteNonJSImportsToJS (path) { - const match = nonJSImport.exec(path.node.source.value) - if (match) { - // eslint-disable-next-line no-param-reassign - path.node.source.value = `${match[0].slice(0, -match[1].length)}js` - } -} - -console.log('Using Babel version:', JSON.parse(await readFile(fileURLToPath(import.meta.resolve('@babel/core/package.json')), 'utf8')).version) - -const metaMtimes = await Promise.all(META_FILES.map((filename) => lastModified(path.join(__dirname, '..', filename)))) -const metaMtime = Math.max(...metaMtimes) - -const files = await glob(SOURCE) -/* eslint-disable no-continue */ -for (const file of files) { - if (IGNORE.test(file)) { - continue - } - await preparePackage(file) - const libFile = file.replace('/src/', '/lib/').replace(/\.[jt]sx?$/, '.js') - - // on a fresh build, rebuild everything. - if (!process.env.FRESH) { - const [srcMtime, libMtime] = await Promise.all([ - lastModified(file), - lastModified(libFile, true), - ]) - // Skip files that haven't changed - if (srcMtime < libMtime && metaMtime < libMtime) { - continue - } - } - - const plugins = [{ - visitor: { - // eslint-disable-next-line no-shadow - ImportDeclaration (path) { - rewriteNonJSImportsToJS(path) - if (PACKAGE_JSON_IMPORT.test(path.node.source.value) - && path.node.specifiers.length === 1 - && path.node.specifiers[0].type === 'ImportDefaultSpecifier') { - // Vendor-in version number from package.json files: - const version = versionCache.get(file.slice(0, file.indexOf('/src/'))) - if (version != null) { - const [{ local }] = path.node.specifiers - path.replaceWith( - t.variableDeclaration('const', [t.variableDeclarator(local, - t.objectExpression([ - t.objectProperty(t.stringLiteral('version'), t.stringLiteral(version)), - ]))]), - ) - } - } - }, - - ExportAllDeclaration: rewriteNonJSImportsToJS, - // eslint-disable-next-line no-shadow - ExportNamedDeclaration (path) { - if (path.node.source != null) { - rewriteNonJSImportsToJS(path) - } - }, - }, - }] - const isTSX = file.endsWith('.tsx') - if (isTSX || file.endsWith('.ts')) { - plugins.push(['@babel/plugin-transform-typescript', { - disallowAmbiguousJSXLike: true, - isTSX, - jsxPragma: 'h', - jsxPragmaFrag: 'Fragment', - }]) - } - - const { code, map } = await babel.transformFileAsync(file, { - sourceMaps: true, - plugins, - // no comments because https://github.com/transloadit/uppy/pull/4868#issuecomment-1897717779 - comments: !process.env.DIFF_BUILDER, - }) - const [{ default: chalk }] = await Promise.all([ - import('chalk'), - writeFile(libFile, code), - writeFile(`${libFile}.map`, JSON.stringify(map)), - ]) - console.log(chalk.green('Compiled lib:'), chalk.magenta(libFile)) -} -/* eslint-enable no-continue */ diff --git a/e2e/clients/dashboard-aws-multipart/app.js b/e2e/clients/dashboard-aws-multipart/app.js index 8abb12ff9..e3a14ea62 100644 --- a/e2e/clients/dashboard-aws-multipart/app.js +++ b/e2e/clients/dashboard-aws-multipart/app.js @@ -1,6 +1,6 @@ import { Uppy } from '@uppy/core' import Dashboard from '@uppy/dashboard' -import AwsS3Multipart from '@uppy/aws-s3-multipart' +import AwsS3Multipart from '@uppy/aws-s3' import '@uppy/core/dist/style.css' import '@uppy/dashboard/dist/style.css' diff --git a/examples/bundled/index.js b/examples/bundled/index.js index d4878eb71..0bbcf0c3f 100644 --- a/examples/bundled/index.js +++ b/examples/bundled/index.js @@ -57,7 +57,6 @@ uppy.on('complete', (result) => { // uncomment if you enable Golden Retriever // -/* eslint-disable compat/compat */ // if ('serviceWorker' in navigator) { // navigator.serviceWorker // .register('/sw.js') diff --git a/examples/transloadit/server.js b/examples/transloadit/server.js index 0769b2bf0..27b505107 100755 --- a/examples/transloadit/server.js +++ b/examples/transloadit/server.js @@ -1,6 +1,6 @@ #!/usr/bin/env node -/* eslint-disable compat/compat */ + import http from 'node:http' import qs from 'node:querystring' import he from 'he' diff --git a/package.json b/package.json index 42d290669..093836386 100644 --- a/package.json +++ b/package.json @@ -14,19 +14,18 @@ "e2e" ], "scripts": { - "build": "npm-run-all --serial build:ts --parallel build:js build:css --serial build:components size", + "build": "yarn build:lib && npm-run-all --parallel build:js build:css --serial build:components size", + "build:lib": "tsc --build tsconfig.build.json", "build:angular": "yarn workspace angular build", - "build:bundle": "yarn node ./bin/build-bundle.mjs", + "build:bundle": "yarn workspace uppy build:bundle", "build:clean": "cp .gitignore .gitignore.bak && printf '!node_modules\n!**/node_modules/**/*\n' >> .gitignore; git clean -Xfd packages e2e .parcel-cache coverage; mv .gitignore.bak .gitignore", "build:companion": "yarn workspace @uppy/companion build", "build:components": "node bin/build-components.mjs", "build:css": "yarn node ./bin/build-css.js && yarn workspace @uppy/components build:tailwind && yarn node ./bin/copy-tailwind-css.mjs", "build:js": "npm-run-all build:js:typeless build:locale-pack build:angular build:bundle", - "build:js:typeless": "npm-run-all build:lib build:companion build:svelte", - "build:lib": "yarn build:ts && yarn node ./bin/build-lib.mjs && yarn build:css", + "build:js:typeless": "npm-run-all build:companion build:svelte", "build:locale-pack": "yarn workspace @uppy-dev/locale-pack build && eslint packages/@uppy/locales/src/en_US.ts --fix && yarn workspace @uppy-dev/locale-pack test unused", "build:svelte": "yarn workspace @uppy/svelte build", - "build:ts": "yarn tsc -b tsconfig.build.json && yarn workspace @uppy/svelte build", "contributors:save": "yarn node ./bin/update-contributors.mjs", "dev": "yarn workspace @uppy-dev/dev dev", "dev:with-companion": "npm-run-all --parallel start:companion dev", @@ -57,13 +56,13 @@ "test:locale-packs:unused": "yarn workspace @uppy-dev/locale-pack test unused", "test:locale-packs:warnings": "yarn workspace @uppy-dev/locale-pack test warnings", "test:ts": "yarn tsc -b && yarn workspace @uppy/svelte check", - "test:unit": "yarn run build:lib && yarn test:watch --run", + "test:unit": "yarn run build && yarn test:watch --run", "test:watch": "vitest --environment jsdom --dir packages/@uppy", "uploadcdn": "yarn node ./private/upload-to-cdn/index.js", "version": "yarn node ./bin/after-version-bump.js", "watch": "npm-run-all --parallel watch:js:bundle watch:js:lib", "watch:js:bundle": "onchange 'packages/{@uppy/,}*/src/**/*.{js,ts,jsx,tsx,svelte,scss,css}' --initial --verbose -- yarn run build:bundle", - "watch:js:lib": "onchange 'packages/{@uppy/,}*/src/**/*.{js,ts,jsx,tsx,svelte,scss,css}' --initial --verbose -- yarn run build:lib" + "watch:js:lib": "onchange 'packages/{@uppy/,}*/src/**/*.{js,ts,jsx,tsx,svelte,scss,css}' --initial --verbose -- yarn run build" }, "pre-commit": "lint:staged", "lint-staged": { @@ -78,9 +77,6 @@ "eslint --fix", "prettier -w", "eslint" - ], - "*.mdx": [ - "prettier -w" ] }, "resolutions": { @@ -90,7 +86,6 @@ "@vitest/utils": "patch:@vitest/utils@npm%3A1.2.1#./.yarn/patches/@vitest-utils-npm-1.2.1-3028846845.patch", "p-queue": "patch:p-queue@npm%3A8.0.1#~/.yarn/patches/p-queue-npm-8.0.1-fe1ddcd827.patch", "pre-commit": "patch:pre-commit@npm:1.2.2#.yarn/patches/pre-commit-npm-1.2.2-f30af83877.patch", - "preact": "patch:preact@npm:10.10.0#.yarn/patches/preact-npm-10.10.0-dd04de05e8.patch", "resize-observer-polyfill": "patch:resize-observer-polyfill@npm%3A1.5.1#./.yarn/patches/resize-observer-polyfill-npm-1.5.1-603120e8a0.patch", "start-server-and-test": "patch:start-server-and-test@npm:1.14.0#.yarn/patches/start-server-and-test-npm-1.14.0-841aa34fdf.patch", "stylelint-order": "^6.0.0", @@ -98,29 +93,16 @@ "uuid@^8.3.2": "patch:uuid@npm:8.3.2#.yarn/patches/uuid-npm-8.3.2-eca0baba53.patch" }, "devDependencies": { - "@babel/cli": "^7.14.5", - "@babel/core": "^7.14.6", - "@babel/eslint-parser": "^7.11.3", - "@babel/eslint-plugin": "^7.11.3", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5", - "@babel/plugin-proposal-optional-chaining": "^7.16.0", - "@babel/plugin-transform-modules-commonjs": "^7.16.8", - "@babel/plugin-transform-react-jsx": "^7.10.4", - "@babel/plugin-transform-typescript": "^7.22.10", - "@babel/preset-env": "^7.14.7", - "@babel/register": "^7.10.5", - "@babel/types": "^7.17.0", + "@babel/eslint-plugin": "^7.27.1", "@types/jasmine": "file:./private/@types/jasmine", "@types/jasminewd2": "file:./private/@types/jasmine", "@typescript-eslint/eslint-plugin": "^7.0.0", - "@typescript-eslint/parser": "^7.0.0", + "@typescript-eslint/parser": "^8.35.0", "autoprefixer": "^10.2.6", - "babel-plugin-inline-package-json": "^2.0.0", "chalk": "^5.0.0", "cssnano": "^7.0.0", "dotenv": "^16.0.0", "esbuild": "^0.25.0", - "esbuild-plugin-babel": "^0.2.3", "eslint": "^8.0.0", "eslint-config-prettier": "^9.0.0", "eslint-config-transloadit": "^2.0.0", @@ -157,7 +139,7 @@ "stylelint-config-rational-order": "^0.1.2", "stylelint-config-standard": "^36.0.0", "stylelint-config-standard-scss": "^13.0.0", - "typescript": "~5.4", + "typescript": "^5.8.3", "vitest": "^1.6.1", "vue-template-compiler": "workspace:*" }, @@ -165,8 +147,5 @@ "engines": { "node": "^16.15.0 || >=18.0.0", "yarn": "3.6.1" - }, - "alias": { - "preact/jsx-dev-runtime": "preact/jsx-runtime" } } diff --git a/packages/@uppy/audio/package.json b/packages/@uppy/audio/package.json index a7da3fc25..d554c1512 100644 --- a/packages/@uppy/audio/package.json +++ b/packages/@uppy/audio/package.json @@ -29,6 +29,7 @@ "preact": "^10.5.13" }, "devDependencies": { + "typescript": "^5.8.3", "vitest": "^1.6.1" }, "peerDependencies": { @@ -36,5 +37,8 @@ }, "publishConfig": { "access": "public" + }, + "scripts": { + "build": "tsc --build tsconfig.build.json" } } diff --git a/packages/@uppy/audio/src/Audio.tsx b/packages/@uppy/audio/src/Audio.tsx index 7662e6120..8fe836a91 100644 --- a/packages/@uppy/audio/src/Audio.tsx +++ b/packages/@uppy/audio/src/Audio.tsx @@ -12,12 +12,10 @@ import type { import type { LocaleStrings } from '@uppy/utils/lib/Translator' import getFileTypeExtension from '@uppy/utils/lib/getFileTypeExtension' import supportsMediaRecorder from './supportsMediaRecorder.js' -import RecordingScreen from './RecordingScreen.jsx' -import PermissionsScreen from './PermissionsScreen.jsx' +import RecordingScreen from './RecordingScreen.js' +import PermissionsScreen from './PermissionsScreen.js' 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 -import packageJson from '../package.json' +import packageJson from '../package.json' with { type: 'json' } export interface AudioOptions extends UIPluginOptions { showAudioSourceDropdown?: boolean @@ -165,7 +163,6 @@ export default class Audio extends UIPlugin< #startRecording = (): void => { // only used if supportsMediaRecorder() returned true - // eslint-disable-next-line compat/compat this.#recorder = new MediaRecorder(this.#stream!) this.#recordingChunks = [] let stoppingBecauseOfMaxSize = false diff --git a/packages/@uppy/audio/src/RecordingScreen.tsx b/packages/@uppy/audio/src/RecordingScreen.tsx index dd2ecc908..2d87a4bcd 100644 --- a/packages/@uppy/audio/src/RecordingScreen.tsx +++ b/packages/@uppy/audio/src/RecordingScreen.tsx @@ -2,14 +2,14 @@ import { h } from 'preact' import { useEffect, useRef } from 'preact/hooks' import type { I18n } from '@uppy/utils/lib/Translator' -import RecordButton from './RecordButton.jsx' -import RecordingLength from './RecordingLength.jsx' +import RecordButton from './RecordButton.js' +import RecordingLength from './RecordingLength.js' import AudioSourceSelect, { type AudioSourceSelectProps, -} from './AudioSourceSelect.jsx' +} from './AudioSourceSelect.js' import AudioOscilloscope from './audio-oscilloscope/index.js' -import SubmitButton from './SubmitButton.jsx' -import DiscardButton from './DiscardButton.jsx' +import SubmitButton from './SubmitButton.js' +import DiscardButton from './DiscardButton.js' interface RecordingScreenProps extends AudioSourceSelectProps { stream: MediaStream | null | undefined diff --git a/packages/@uppy/audio/src/audio-oscilloscope/index.ts b/packages/@uppy/audio/src/audio-oscilloscope/index.ts index bd70a0eca..1f134859c 100644 --- a/packages/@uppy/audio/src/audio-oscilloscope/index.ts +++ b/packages/@uppy/audio/src/audio-oscilloscope/index.ts @@ -3,7 +3,7 @@ function isFunction(v: any): v is Function { return typeof v === 'function' } -function result(v: T): T extends (...args: any) => any ? ReturnType : T { +function result(v: T | (() => T)): T { return isFunction(v) ? v() : v } diff --git a/packages/@uppy/audio/src/index.ts b/packages/@uppy/audio/src/index.ts index dcc93c664..c3ab9c670 100644 --- a/packages/@uppy/audio/src/index.ts +++ b/packages/@uppy/audio/src/index.ts @@ -1,2 +1,2 @@ -export { default } from './Audio.jsx' -export type { AudioOptions } from './Audio.jsx' +export { default } from './Audio.js' +export type { AudioOptions } from './Audio.js' diff --git a/packages/@uppy/audio/src/supportsMediaRecorder.test.ts b/packages/@uppy/audio/src/supportsMediaRecorder.test.ts index 04c0fcaf4..c8d6ac88e 100644 --- a/packages/@uppy/audio/src/supportsMediaRecorder.test.ts +++ b/packages/@uppy/audio/src/supportsMediaRecorder.test.ts @@ -1,4 +1,4 @@ -/* eslint-disable max-classes-per-file, compat/compat */ +/* eslint-disable max-classes-per-file */ import { describe, expect, it } from 'vitest' import supportsMediaRecorder from './supportsMediaRecorder.js' diff --git a/packages/@uppy/audio/src/supportsMediaRecorder.ts b/packages/@uppy/audio/src/supportsMediaRecorder.ts index 4cee898ed..d40a2e7cd 100644 --- a/packages/@uppy/audio/src/supportsMediaRecorder.ts +++ b/packages/@uppy/audio/src/supportsMediaRecorder.ts @@ -1,8 +1,6 @@ export default function supportsMediaRecorder(): boolean { - /* eslint-disable compat/compat */ return ( typeof MediaRecorder === 'function' && typeof MediaRecorder.prototype?.start === 'function' ) - /* eslint-enable compat/compat */ } diff --git a/packages/@uppy/audio/tsconfig.build.json b/packages/@uppy/audio/tsconfig.build.json index bbf30b5b4..389eb1387 100644 --- a/packages/@uppy/audio/tsconfig.build.json +++ b/packages/@uppy/audio/tsconfig.build.json @@ -2,7 +2,6 @@ "extends": "../../../tsconfig.shared", "compilerOptions": { "outDir": "./lib", - "resolveJsonModule": false, "rootDir": "./src" }, "include": ["./src/**/*.*"], diff --git a/packages/@uppy/aws-s3-multipart/package.json b/packages/@uppy/aws-s3-multipart/package.json index 98579cea8..e90aab5e6 100644 --- a/packages/@uppy/aws-s3-multipart/package.json +++ b/packages/@uppy/aws-s3-multipart/package.json @@ -5,6 +5,9 @@ "license": "MIT", "main": "lib/index.js", "type": "module", + "scripts": { + "build": "tsc --build tsconfig.build.json" + }, "keywords": [ "file uploader", "aws s3", @@ -24,5 +27,8 @@ }, "dependencies": { "@uppy/aws-s3": "workspace:^" + }, + "devDependencies": { + "typescript": "^5.8.3" } } diff --git a/packages/@uppy/aws-s3/package.json b/packages/@uppy/aws-s3/package.json index 7d9554c01..75d90dfb0 100644 --- a/packages/@uppy/aws-s3/package.json +++ b/packages/@uppy/aws-s3/package.json @@ -5,6 +5,9 @@ "license": "MIT", "main": "lib/index.js", "type": "module", + "scripts": { + "build": "tsc --build tsconfig.build.json" + }, "keywords": [ "file uploader", "aws s3", @@ -30,6 +33,7 @@ "@aws-sdk/client-s3": "^3.362.0", "@aws-sdk/s3-request-presigner": "^3.362.0", "nock": "^13.1.0", + "typescript": "^5.8.3", "vitest": "^1.6.1", "whatwg-fetch": "3.6.2" }, diff --git a/packages/@uppy/aws-s3/src/index.ts b/packages/@uppy/aws-s3/src/index.ts index e58d8fb44..8eaf72bf8 100644 --- a/packages/@uppy/aws-s3/src/index.ts +++ b/packages/@uppy/aws-s3/src/index.ts @@ -25,9 +25,7 @@ import type { } from './utils.js' import createSignedURL from './createSignedURL.js' import { HTTPCommunicationQueue } from './HTTPCommunicationQueue.js' -// 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' +import packageJson from '../package.json' with { type: 'json' } interface MultipartFile extends UppyFile { s3Multipart: UploadResult diff --git a/packages/@uppy/aws-s3/tsconfig.build.json b/packages/@uppy/aws-s3/tsconfig.build.json index bd96ae4f3..6fc447531 100644 --- a/packages/@uppy/aws-s3/tsconfig.build.json +++ b/packages/@uppy/aws-s3/tsconfig.build.json @@ -2,7 +2,6 @@ "extends": "../../../tsconfig.shared", "compilerOptions": { "outDir": "./lib", - "resolveJsonModule": false, "rootDir": "./src" }, "include": ["./src/**/*.*"], diff --git a/packages/@uppy/box/package.json b/packages/@uppy/box/package.json index 667e4e295..df652f920 100644 --- a/packages/@uppy/box/package.json +++ b/packages/@uppy/box/package.json @@ -5,6 +5,9 @@ "license": "MIT", "main": "lib/index.js", "type": "module", + "scripts": { + "build": "tsc --build tsconfig.build.json" + }, "keywords": [ "file uploader", "uppy", @@ -30,5 +33,8 @@ }, "publishConfig": { "access": "public" + }, + "devDependencies": { + "typescript": "^5.8.3" } } diff --git a/packages/@uppy/box/src/Box.tsx b/packages/@uppy/box/src/Box.tsx index dba0cc859..7ad159fae 100644 --- a/packages/@uppy/box/src/Box.tsx +++ b/packages/@uppy/box/src/Box.tsx @@ -18,9 +18,7 @@ import type { UnknownProviderPluginState, } 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 -import packageJson from '../package.json' +import packageJson from '../package.json' with { type: 'json' } export type BoxOptions = CompanionPluginOptions & { locale?: LocaleStrings diff --git a/packages/@uppy/box/src/index.ts b/packages/@uppy/box/src/index.ts index 466dbe9bc..96ab1934f 100644 --- a/packages/@uppy/box/src/index.ts +++ b/packages/@uppy/box/src/index.ts @@ -1,2 +1,2 @@ -export { default } from './Box.jsx' -export type { BoxOptions } from './Box.jsx' +export { default } from './Box.js' +export type { BoxOptions } from './Box.js' diff --git a/packages/@uppy/box/tsconfig.build.json b/packages/@uppy/box/tsconfig.build.json index 82e187bca..afabb530f 100644 --- a/packages/@uppy/box/tsconfig.build.json +++ b/packages/@uppy/box/tsconfig.build.json @@ -2,7 +2,6 @@ "extends": "../../../tsconfig.shared", "compilerOptions": { "outDir": "./lib", - "resolveJsonModule": false, "rootDir": "./src" }, "include": ["./src/**/*.*"], diff --git a/packages/@uppy/companion-client/package.json b/packages/@uppy/companion-client/package.json index 5c6a4565b..89150c9c2 100644 --- a/packages/@uppy/companion-client/package.json +++ b/packages/@uppy/companion-client/package.json @@ -5,6 +5,9 @@ "license": "MIT", "main": "lib/index.js", "type": "module", + "scripts": { + "build": "tsc --build tsconfig.build.json" + }, "keywords": [ "file uploader", "uppy", @@ -26,6 +29,7 @@ "p-retry": "^6.1.0" }, "devDependencies": { + "typescript": "^5.8.3", "vitest": "^1.6.1" }, "peerDependencies": { diff --git a/packages/@uppy/companion-client/src/RequestClient.ts b/packages/@uppy/companion-client/src/RequestClient.ts index 4ac1199fe..de848f35d 100644 --- a/packages/@uppy/companion-client/src/RequestClient.ts +++ b/packages/@uppy/companion-client/src/RequestClient.ts @@ -10,9 +10,7 @@ import type Uppy from '@uppy/core' import type { UppyFile, Meta, Body } from '@uppy/utils/lib/UppyFile' import type { RequestOptions } from '@uppy/utils/lib/CompanionClientProvider' import AuthError from './AuthError.js' -// 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' +import packageJson from '../package.json' with { type: 'json' } type CompanionHeaders = Record | undefined diff --git a/packages/@uppy/companion-client/tsconfig.build.json b/packages/@uppy/companion-client/tsconfig.build.json index bbf30b5b4..389eb1387 100644 --- a/packages/@uppy/companion-client/tsconfig.build.json +++ b/packages/@uppy/companion-client/tsconfig.build.json @@ -2,7 +2,6 @@ "extends": "../../../tsconfig.shared", "compilerOptions": { "outDir": "./lib", - "resolveJsonModule": false, "rootDir": "./src" }, "include": ["./src/**/*.*"], diff --git a/packages/@uppy/companion/package.json b/packages/@uppy/companion/package.json index 7375c58cd..852eb2d8c 100644 --- a/packages/@uppy/companion/package.json +++ b/packages/@uppy/companion/package.json @@ -87,7 +87,7 @@ "jest": "^29.0.0", "nock": "^13.1.3", "supertest": "6.2.4", - "typescript": "~5.4" + "typescript": "^5.8.3" }, "files": [ "bin/", diff --git a/packages/@uppy/companion/src/server/Uploader.js b/packages/@uppy/companion/src/server/Uploader.js index d9652c5f5..306bfb43e 100644 --- a/packages/@uppy/companion/src/server/Uploader.js +++ b/packages/@uppy/companion/src/server/Uploader.js @@ -393,7 +393,6 @@ class Uploader { logger.debug('waiting for socket connection', 'uploader.socket.wait', this.shortToken) const eventName = `connection:${this.token}` - // eslint-disable-next-line compat/compat await once(emitter(), eventName, timeout && { signal: AbortSignal.timeout(timeout) }) logger.debug('socket connection received', 'uploader.socket.wait', this.shortToken) diff --git a/packages/@uppy/components/package.json b/packages/@uppy/components/package.json index 3aca5817b..c7564943e 100644 --- a/packages/@uppy/components/package.json +++ b/packages/@uppy/components/package.json @@ -21,6 +21,7 @@ "url": "git+https://github.com/transloadit/uppy.git" }, "scripts": { + "build": "tsc --build tsconfig.build.json", "build:tailwind": "tailwindcss -i ./src/input.css -o ./dist/styles.css" }, "dependencies": { @@ -59,5 +60,8 @@ "@uppy/webcam": { "optional": true } + }, + "devDependencies": { + "typescript": "^5.8.3" } } diff --git a/packages/@uppy/components/src/ProviderIcon.tsx b/packages/@uppy/components/src/ProviderIcon.tsx index f82a2b6ef..6102921c0 100644 --- a/packages/@uppy/components/src/ProviderIcon.tsx +++ b/packages/@uppy/components/src/ProviderIcon.tsx @@ -1,6 +1,6 @@ /* eslint-disable react/destructuring-assignment */ import { h } from 'preact' -import type { UppyContext } from './types' +import type { UppyContext } from './types.js' export type ProviderIconProps = { provider: diff --git a/packages/@uppy/components/src/Thumbnail.tsx b/packages/@uppy/components/src/Thumbnail.tsx index ea200de9c..df6519c7a 100644 --- a/packages/@uppy/components/src/Thumbnail.tsx +++ b/packages/@uppy/components/src/Thumbnail.tsx @@ -2,7 +2,7 @@ import { h } from 'preact' import { useMemo, useEffect } from 'preact/hooks' import type { Body, Meta, UppyFile } from '@uppy/core' -import type { UppyContext } from './types' +import type { UppyContext } from './types.js' export type ThumbnailProps = { file: UppyFile diff --git a/packages/@uppy/components/src/UploadButton.tsx b/packages/@uppy/components/src/UploadButton.tsx index 27994e318..691307225 100644 --- a/packages/@uppy/components/src/UploadButton.tsx +++ b/packages/@uppy/components/src/UploadButton.tsx @@ -2,7 +2,7 @@ /* eslint-disable react/destructuring-assignment */ import { h } from 'preact' import { clsx } from 'clsx' -import type { UppyContext } from './types' +import type { UppyContext } from './types.js' export type UploadButtonProps = { ctx: UppyContext diff --git a/packages/@uppy/components/src/uppyEventAdapter.ts b/packages/@uppy/components/src/uppyEventAdapter.ts index 409f65474..7f73b7f07 100644 --- a/packages/@uppy/components/src/uppyEventAdapter.ts +++ b/packages/@uppy/components/src/uppyEventAdapter.ts @@ -1,5 +1,5 @@ import Uppy, { type UppyEventMap } from '@uppy/core' -import type { UploadStatus } from './types' +import type { UploadStatus } from './types.js' export function createUppyEventAdapter({ uppy, diff --git a/packages/@uppy/components/tsconfig.build.json b/packages/@uppy/components/tsconfig.build.json index b34629f00..87681cfb3 100644 --- a/packages/@uppy/components/tsconfig.build.json +++ b/packages/@uppy/components/tsconfig.build.json @@ -2,7 +2,6 @@ "extends": "../../../tsconfig.shared", "compilerOptions": { "outDir": "./lib", - "resolveJsonModule": false, "rootDir": "./src" }, "include": ["./src/**/*.*"], diff --git a/packages/@uppy/compressor/package.json b/packages/@uppy/compressor/package.json index b52d3510e..40b08215a 100644 --- a/packages/@uppy/compressor/package.json +++ b/packages/@uppy/compressor/package.json @@ -35,6 +35,10 @@ "access": "public" }, "devDependencies": { + "typescript": "^5.8.3", "vitest": "^1.6.1" + }, + "scripts": { + "build": "tsc --build tsconfig.build.json" } } diff --git a/packages/@uppy/compressor/tsconfig.build.json b/packages/@uppy/compressor/tsconfig.build.json index bbf30b5b4..389eb1387 100644 --- a/packages/@uppy/compressor/tsconfig.build.json +++ b/packages/@uppy/compressor/tsconfig.build.json @@ -2,7 +2,6 @@ "extends": "../../../tsconfig.shared", "compilerOptions": { "outDir": "./lib", - "resolveJsonModule": false, "rootDir": "./src" }, "include": ["./src/**/*.*"], diff --git a/packages/@uppy/core/package.json b/packages/@uppy/core/package.json index 80adfde07..c8d993a79 100644 --- a/packages/@uppy/core/package.json +++ b/packages/@uppy/core/package.json @@ -9,6 +9,9 @@ "sideEffects": [ "*.css" ], + "scripts": { + "build": "tsc --build tsconfig.build.json" + }, "keywords": [ "file uploader", "uppy", @@ -33,6 +36,7 @@ "preact": "^10.5.13" }, "devDependencies": { + "typescript": "^5.8.3", "vitest": "^1.6.1" } } diff --git a/packages/@uppy/core/src/Uppy.ts b/packages/@uppy/core/src/Uppy.ts index 7744a66fa..f47957ee7 100644 --- a/packages/@uppy/core/src/Uppy.ts +++ b/packages/@uppy/core/src/Uppy.ts @@ -40,9 +40,7 @@ import { defaultOptions as defaultRestrictionOptions, RestrictionError, } from './Restricter.js' -// 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' +import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' import type BasePlugin from './BasePlugin.js' diff --git a/packages/@uppy/core/tsconfig.build.json b/packages/@uppy/core/tsconfig.build.json index 1a780f2c3..7af4ec3f9 100644 --- a/packages/@uppy/core/tsconfig.build.json +++ b/packages/@uppy/core/tsconfig.build.json @@ -2,8 +2,7 @@ "extends": "../../../tsconfig.shared", "compilerOptions": { "outDir": "./lib", - "rootDir": "./src", - "resolveJsonModule": false + "rootDir": "./src" }, "include": ["./src/**/*.*"], "exclude": ["./src/**/*.test.ts"], diff --git a/packages/@uppy/dashboard/package.json b/packages/@uppy/dashboard/package.json index bea2db799..422f3db13 100644 --- a/packages/@uppy/dashboard/package.json +++ b/packages/@uppy/dashboard/package.json @@ -6,6 +6,9 @@ "main": "lib/index.js", "style": "dist/style.min.css", "type": "module", + "scripts": { + "build": "tsc --build tsconfig.build.json" + }, "keywords": [ "file uploader", "uppy", @@ -30,7 +33,6 @@ "@uppy/utils": "workspace:^", "classnames": "^2.2.6", "lodash": "^4.17.21", - "memoize-one": "^6.0.0", "nanoid": "^5.0.9", "preact": "^10.5.13", "shallow-equal": "^3.0.0" @@ -41,6 +43,7 @@ "@uppy/url": "workspace:^", "@uppy/webcam": "workspace:^", "resize-observer-polyfill": "^1.5.0", + "typescript": "^5.8.3", "vitest": "^1.6.1" }, "peerDependencies": { diff --git a/packages/@uppy/dashboard/src/Dashboard.tsx b/packages/@uppy/dashboard/src/Dashboard.tsx index 03839a4a1..c4fd4a601 100644 --- a/packages/@uppy/dashboard/src/Dashboard.tsx +++ b/packages/@uppy/dashboard/src/Dashboard.tsx @@ -23,14 +23,11 @@ import type StatusBarLocale from '@uppy/status-bar/lib/locale.js' import type { TargetedEvent } from 'preact/compat' import { nanoid } from 'nanoid/non-secure' -import memoizeOne from 'memoize-one' import * as trapFocus from './utils/trapFocus.js' import createSuperFocus from './utils/createSuperFocus.js' -import DashboardUI from './components/Dashboard.jsx' +import DashboardUI from './components/Dashboard.js' -// 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' +import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' type GenericEventCallback = () => void @@ -60,8 +57,6 @@ interface PromiseWithResolvers { reject: (reason?: any) => void } -const memoize = ((memoizeOne as any).default as false) || memoizeOne - const TAB_KEY = 9 const ESC_KEY = 27 @@ -1132,26 +1127,26 @@ export default class Dashboard extends UIPlugin< return plugin.isSupported() } - #getAcquirers = memoize((targets: Target[]) => { + #getAcquirers = (targets: Target[]) => { return targets .filter( (target) => target.type === 'acquirer' && this.#isTargetSupported(target), ) .map(this.#attachRenderFunctionToTarget) - }) + } - #getProgressIndicators = memoize((targets: Target[]) => { + #getProgressIndicators = (targets: Target[]) => { return targets .filter((target) => target.type === 'progressindicator') .map(this.#attachRenderFunctionToTarget) - }) + } - #getEditors = memoize((targets: Target[]) => { + #getEditors = (targets: Target[]) => { return targets .filter((target) => target.type === 'editor') .map(this.#attachRenderFunctionToTarget) - }) + } render = (state: State) => { const pluginState = this.getPluginState() diff --git a/packages/@uppy/dashboard/src/components/AddFiles.tsx b/packages/@uppy/dashboard/src/components/AddFiles.tsx index 68bd75ca4..e96a3e8ff 100644 --- a/packages/@uppy/dashboard/src/components/AddFiles.tsx +++ b/packages/@uppy/dashboard/src/components/AddFiles.tsx @@ -3,7 +3,7 @@ import { h, Component, Fragment, type ComponentChild } from 'preact' import type { I18n } from '@uppy/utils/lib/Translator' import type Translator from '@uppy/utils/lib/Translator' import type { TargetedEvent } from 'preact/compat' -import type { DashboardState, TargetWithRender } from '../Dashboard' +import type { DashboardState, TargetWithRender } from '../Dashboard.js' interface AddFilesProps { i18n: I18n @@ -98,7 +98,9 @@ class AddFiles extends Component { type="file" name={`camera-${type}`} onChange={this.onFileInputChange} - capture={nativeCameraFacingMode} + capture={ + nativeCameraFacingMode === '' ? 'environment' : nativeCameraFacingMode + } accept={accept} ref={refCallback} /> diff --git a/packages/@uppy/dashboard/src/components/AddFilesPanel.tsx b/packages/@uppy/dashboard/src/components/AddFilesPanel.tsx index 9b85dd63f..99a63390a 100644 --- a/packages/@uppy/dashboard/src/components/AddFilesPanel.tsx +++ b/packages/@uppy/dashboard/src/components/AddFilesPanel.tsx @@ -1,7 +1,7 @@ /* eslint-disable react/destructuring-assignment */ import { h } from 'preact' import classNames from 'classnames' -import AddFiles from './AddFiles.jsx' +import AddFiles from './AddFiles.js' type $TSFixMe = any @@ -16,7 +16,7 @@ const AddFilesPanel = (props: $TSFixMe): $TSFixMe => {
{props.i18n('addingMoreFiles')}
diff --git a/packages/@uppy/dashboard/src/components/Dashboard.tsx b/packages/@uppy/dashboard/src/components/Dashboard.tsx index 4caa2936a..fff5e0b26 100644 --- a/packages/@uppy/dashboard/src/components/Dashboard.tsx +++ b/packages/@uppy/dashboard/src/components/Dashboard.tsx @@ -14,15 +14,15 @@ import type { import type { I18n } from '@uppy/utils/lib/Translator' import type Translator from '@uppy/utils/lib/Translator' import type { TargetedEvent } from 'preact/compat' -import FileList from './FileList.jsx' -import AddFiles from './AddFiles.jsx' -import AddFilesPanel from './AddFilesPanel.jsx' -import PickerPanelContent from './PickerPanelContent.jsx' -import EditorPanel from './EditorPanel.jsx' -import PanelTopBar from './PickerPanelTopBar.jsx' -import FileCard from './FileCard/index.jsx' -import Slide from './Slide.jsx' -import type { DashboardState, TargetWithRender } from '../Dashboard' +import FileList from './FileList.js' +import AddFiles from './AddFiles.js' +import AddFilesPanel from './AddFilesPanel.js' +import PickerPanelContent from './PickerPanelContent.js' +import EditorPanel from './EditorPanel.js' +import PanelTopBar from './PickerPanelTopBar.js' +import FileCard from './FileCard/index.js' +import Slide from './Slide.js' +import type { DashboardState, TargetWithRender } from '../Dashboard.js' // http://dev.edenspiekermann.com/2016/02/11/introducing-accessible-modal-dialog // https://github.com/ghosh/micromodal diff --git a/packages/@uppy/dashboard/src/components/EditorPanel.tsx b/packages/@uppy/dashboard/src/components/EditorPanel.tsx index 9f9b4ad44..0dd13a703 100644 --- a/packages/@uppy/dashboard/src/components/EditorPanel.tsx +++ b/packages/@uppy/dashboard/src/components/EditorPanel.tsx @@ -23,7 +23,7 @@ function EditorPanel(props: $TSFixMe) {
{props.i18nArray('editing', { file: ( diff --git a/packages/@uppy/dashboard/src/components/FileCard/index.tsx b/packages/@uppy/dashboard/src/components/FileCard/index.tsx index 8bb890db0..c561ed65c 100644 --- a/packages/@uppy/dashboard/src/components/FileCard/index.tsx +++ b/packages/@uppy/dashboard/src/components/FileCard/index.tsx @@ -2,10 +2,10 @@ import { h } from 'preact' import { useEffect, useState, useCallback } from 'preact/hooks' import classNames from 'classnames' import { nanoid } from 'nanoid/non-secure' -import getFileTypeIcon from '../../utils/getFileTypeIcon.jsx' +import getFileTypeIcon from '../../utils/getFileTypeIcon.js' import ignoreEvent from '../../utils/ignoreEvent.js' -import FilePreview from '../FilePreview.jsx' -import RenderMetaFields from './RenderMetaFields.jsx' +import FilePreview from '../FilePreview.js' +import RenderMetaFields from './RenderMetaFields.js' type $TSFixMe = any @@ -89,7 +89,7 @@ export default function FileCard(props: $TSFixMe) {
{i18nArray('editing', { file: ( diff --git a/packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.tsx b/packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.tsx index 3def4903e..f0202d48a 100644 --- a/packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.tsx +++ b/packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.tsx @@ -4,7 +4,7 @@ import prettierBytes from '@transloadit/prettier-bytes' import truncateString from '@uppy/utils/lib/truncateString' import type { I18n } from '@uppy/utils/lib/Translator' import type { UppyFile } from '@uppy/core' -import MetaErrorMessage from '../MetaErrorMessage.jsx' +import MetaErrorMessage from '../MetaErrorMessage.js' import type { DashboardState } from '../../../Dashboard.js' const renderFileName = (props: { @@ -150,6 +150,7 @@ export default function FileInfo(props: FileInfoProps) { containerHeight, containerWidth, })} + {/* eslint-disable-next-line no-alert */} alert(file.error)} />
diff --git a/packages/@uppy/dashboard/src/components/FileItem/FilePreviewAndLink/index.tsx b/packages/@uppy/dashboard/src/components/FileItem/FilePreviewAndLink/index.tsx index d7709c2a0..ca9b777f7 100644 --- a/packages/@uppy/dashboard/src/components/FileItem/FilePreviewAndLink/index.tsx +++ b/packages/@uppy/dashboard/src/components/FileItem/FilePreviewAndLink/index.tsx @@ -1,7 +1,7 @@ import { h } from 'preact' -import FilePreview from '../../FilePreview.jsx' -import MetaErrorMessage from '../MetaErrorMessage.jsx' -import getFileTypeIcon from '../../../utils/getFileTypeIcon.jsx' +import FilePreview from '../../FilePreview.js' +import MetaErrorMessage from '../MetaErrorMessage.js' +import getFileTypeIcon from '../../../utils/getFileTypeIcon.js' type $TSFixMe = any diff --git a/packages/@uppy/dashboard/src/components/FileItem/index.tsx b/packages/@uppy/dashboard/src/components/FileItem/index.tsx index 86246fd47..fcca4494f 100644 --- a/packages/@uppy/dashboard/src/components/FileItem/index.tsx +++ b/packages/@uppy/dashboard/src/components/FileItem/index.tsx @@ -5,10 +5,10 @@ import { shallowEqualObjects } from 'shallow-equal' import type { UppyFile, Body, Meta, State } from '@uppy/core' import type { I18n } from '@uppy/utils/lib/Translator' import type Uppy from '@uppy/core' -import FilePreviewAndLink from './FilePreviewAndLink/index.jsx' -import FileProgress from './FileProgress/index.jsx' -import FileInfo from './FileInfo/index.jsx' -import Buttons from './Buttons/index.jsx' +import FilePreviewAndLink from './FilePreviewAndLink/index.js' +import FileProgress from './FileProgress/index.js' +import FileInfo from './FileInfo/index.js' +import Buttons from './Buttons/index.js' import type { DashboardState } from '../../Dashboard.js' type Props = { @@ -108,7 +108,7 @@ export default class FileItem extends Component<
= { diff --git a/packages/@uppy/dashboard/src/components/FilePreview.tsx b/packages/@uppy/dashboard/src/components/FilePreview.tsx index 157c057d9..d8e69ace3 100644 --- a/packages/@uppy/dashboard/src/components/FilePreview.tsx +++ b/packages/@uppy/dashboard/src/components/FilePreview.tsx @@ -1,5 +1,5 @@ import { h } from 'preact' -import getFileTypeIcon from '../utils/getFileTypeIcon.jsx' +import getFileTypeIcon from '../utils/getFileTypeIcon.js' type $TSFixMe = any diff --git a/packages/@uppy/dashboard/src/components/PickerPanelContent.tsx b/packages/@uppy/dashboard/src/components/PickerPanelContent.tsx index 0944002a6..5402d0353 100644 --- a/packages/@uppy/dashboard/src/components/PickerPanelContent.tsx +++ b/packages/@uppy/dashboard/src/components/PickerPanelContent.tsx @@ -29,7 +29,7 @@ function PickerPanelContent({
{i18n('importFrom', { name: activePickerPanel.name })}
diff --git a/packages/@uppy/dashboard/src/components/PickerPanelTopBar.tsx b/packages/@uppy/dashboard/src/components/PickerPanelTopBar.tsx index 02a19abf6..28963927b 100644 --- a/packages/@uppy/dashboard/src/components/PickerPanelTopBar.tsx +++ b/packages/@uppy/dashboard/src/components/PickerPanelTopBar.tsx @@ -104,7 +104,7 @@ function PanelTopBar(props: $TSFixMe) { uppy, } = props let { allowNewUpload } = props - // TODO maybe this should be done in ../Dashboard.jsx, then just pass that down as `allowNewUpload` + // TODO maybe this should be done in ../Dashboard.js, then just pass that down as `allowNewUpload` if (allowNewUpload && maxNumberOfFiles) { // eslint-disable-next-line react/destructuring-assignment allowNewUpload = props.totalFileCount < props.maxNumberOfFiles @@ -125,7 +125,7 @@ function PanelTopBar(props: $TSFixMe) {
{/* eslint-disable-next-line react/jsx-props-no-spreading */} diff --git a/packages/@uppy/dashboard/src/index.ts b/packages/@uppy/dashboard/src/index.ts index a0dda11bb..3a86ad89d 100644 --- a/packages/@uppy/dashboard/src/index.ts +++ b/packages/@uppy/dashboard/src/index.ts @@ -1,2 +1,2 @@ -export { default } from './Dashboard.jsx' -export type { DashboardOptions } from './Dashboard.jsx' +export { default } from './Dashboard.js' +export type { DashboardOptions } from './Dashboard.js' diff --git a/packages/@uppy/dashboard/tsconfig.build.json b/packages/@uppy/dashboard/tsconfig.build.json index 4e7253b38..f9aac32a5 100644 --- a/packages/@uppy/dashboard/tsconfig.build.json +++ b/packages/@uppy/dashboard/tsconfig.build.json @@ -2,7 +2,6 @@ "extends": "../../../tsconfig.shared", "compilerOptions": { "outDir": "./lib", - "resolveJsonModule": false, "rootDir": "./src" }, "include": ["./src/**/*.*"], diff --git a/packages/@uppy/drag-drop/package.json b/packages/@uppy/drag-drop/package.json index a8f79a349..49c31cfc2 100644 --- a/packages/@uppy/drag-drop/package.json +++ b/packages/@uppy/drag-drop/package.json @@ -6,6 +6,9 @@ "main": "lib/index.js", "style": "dist/style.min.css", "type": "module", + "scripts": { + "build": "tsc --build tsconfig.build.json" + }, "keywords": [ "file uploader", "uppy", @@ -30,5 +33,8 @@ }, "peerDependencies": { "@uppy/core": "workspace:^" + }, + "devDependencies": { + "typescript": "^5.8.3" } } diff --git a/packages/@uppy/drag-drop/src/DragDrop.tsx b/packages/@uppy/drag-drop/src/DragDrop.tsx index 7ed1a07fe..7e81df778 100644 --- a/packages/@uppy/drag-drop/src/DragDrop.tsx +++ b/packages/@uppy/drag-drop/src/DragDrop.tsx @@ -13,9 +13,7 @@ import getDroppedFiles from '@uppy/utils/lib/getDroppedFiles' import { h, type ComponentChild } from 'preact' import type { LocaleStrings } 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 -import packageJson from '../package.json' +import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' export interface DragDropOptions extends UIPluginOptions { diff --git a/packages/@uppy/drag-drop/src/index.ts b/packages/@uppy/drag-drop/src/index.ts index f2e89e241..22db92098 100644 --- a/packages/@uppy/drag-drop/src/index.ts +++ b/packages/@uppy/drag-drop/src/index.ts @@ -1,2 +1,2 @@ -export { default } from './DragDrop.jsx' -export type { DragDropOptions } from './DragDrop.jsx' +export { default } from './DragDrop.js' +export type { DragDropOptions } from './DragDrop.js' diff --git a/packages/@uppy/drag-drop/tsconfig.build.json b/packages/@uppy/drag-drop/tsconfig.build.json index bbf30b5b4..389eb1387 100644 --- a/packages/@uppy/drag-drop/tsconfig.build.json +++ b/packages/@uppy/drag-drop/tsconfig.build.json @@ -2,7 +2,6 @@ "extends": "../../../tsconfig.shared", "compilerOptions": { "outDir": "./lib", - "resolveJsonModule": false, "rootDir": "./src" }, "include": ["./src/**/*.*"], diff --git a/packages/@uppy/drop-target/package.json b/packages/@uppy/drop-target/package.json index d96c14947..d2f89aed2 100644 --- a/packages/@uppy/drop-target/package.json +++ b/packages/@uppy/drop-target/package.json @@ -5,6 +5,9 @@ "license": "MIT", "main": "lib/index.js", "type": "module", + "scripts": { + "build": "tsc --build tsconfig.build.json" + }, "keywords": [ "file uploader", "uppy", @@ -31,5 +34,8 @@ }, "publishConfig": { "access": "public" + }, + "devDependencies": { + "typescript": "^5.8.3" } } diff --git a/packages/@uppy/drop-target/src/index.ts b/packages/@uppy/drop-target/src/index.ts index b66e1ac51..956e5f333 100644 --- a/packages/@uppy/drop-target/src/index.ts +++ b/packages/@uppy/drop-target/src/index.ts @@ -2,9 +2,7 @@ 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 -// @ts-ignore We don't want TS to generate types for the package.json -import packageJson from '../package.json' +import packageJson from '../package.json' with { type: 'json' } export interface DropTargetOptions extends PluginOpts { target?: HTMLElement | string | null diff --git a/packages/@uppy/drop-target/tsconfig.build.json b/packages/@uppy/drop-target/tsconfig.build.json index bbf30b5b4..389eb1387 100644 --- a/packages/@uppy/drop-target/tsconfig.build.json +++ b/packages/@uppy/drop-target/tsconfig.build.json @@ -2,7 +2,6 @@ "extends": "../../../tsconfig.shared", "compilerOptions": { "outDir": "./lib", - "resolveJsonModule": false, "rootDir": "./src" }, "include": ["./src/**/*.*"], diff --git a/packages/@uppy/dropbox/package.json b/packages/@uppy/dropbox/package.json index a9393a23b..b36172309 100644 --- a/packages/@uppy/dropbox/package.json +++ b/packages/@uppy/dropbox/package.json @@ -5,6 +5,9 @@ "license": "MIT", "main": "lib/index.js", "type": "module", + "scripts": { + "build": "tsc --build tsconfig.build.json" + }, "keywords": [ "file uploader", "uppy", @@ -27,5 +30,8 @@ }, "peerDependencies": { "@uppy/core": "workspace:^" + }, + "devDependencies": { + "typescript": "^5.8.3" } } diff --git a/packages/@uppy/dropbox/src/Dropbox.tsx b/packages/@uppy/dropbox/src/Dropbox.tsx index 57a891635..b85fd3f7b 100644 --- a/packages/@uppy/dropbox/src/Dropbox.tsx +++ b/packages/@uppy/dropbox/src/Dropbox.tsx @@ -18,9 +18,7 @@ import type { UnknownProviderPluginState, } 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 -import packageJson from '../package.json' +import packageJson from '../package.json' with { type: 'json' } export type DropboxOptions = CompanionPluginOptions & { locale?: LocaleStrings diff --git a/packages/@uppy/dropbox/src/index.ts b/packages/@uppy/dropbox/src/index.ts index 563c0047a..5f226f5ad 100644 --- a/packages/@uppy/dropbox/src/index.ts +++ b/packages/@uppy/dropbox/src/index.ts @@ -1,2 +1,2 @@ -export { default } from './Dropbox.jsx' -export type { DropboxOptions } from './Dropbox.jsx' +export { default } from './Dropbox.js' +export type { DropboxOptions } from './Dropbox.js' diff --git a/packages/@uppy/dropbox/tsconfig.build.json b/packages/@uppy/dropbox/tsconfig.build.json index 82e187bca..afabb530f 100644 --- a/packages/@uppy/dropbox/tsconfig.build.json +++ b/packages/@uppy/dropbox/tsconfig.build.json @@ -2,7 +2,6 @@ "extends": "../../../tsconfig.shared", "compilerOptions": { "outDir": "./lib", - "resolveJsonModule": false, "rootDir": "./src" }, "include": ["./src/**/*.*"], diff --git a/packages/@uppy/facebook/package.json b/packages/@uppy/facebook/package.json index 5bd40e6c2..4b13eb4d8 100644 --- a/packages/@uppy/facebook/package.json +++ b/packages/@uppy/facebook/package.json @@ -5,6 +5,9 @@ "license": "MIT", "main": "lib/index.js", "type": "module", + "scripts": { + "build": "tsc --build tsconfig.build.json" + }, "keywords": [ "file uploader", "uppy", @@ -27,5 +30,8 @@ }, "peerDependencies": { "@uppy/core": "workspace:^" + }, + "devDependencies": { + "typescript": "^5.8.3" } } diff --git a/packages/@uppy/facebook/src/Facebook.tsx b/packages/@uppy/facebook/src/Facebook.tsx index 0ccc75d0e..1d31ff557 100644 --- a/packages/@uppy/facebook/src/Facebook.tsx +++ b/packages/@uppy/facebook/src/Facebook.tsx @@ -18,9 +18,7 @@ import type { UnknownProviderPluginState, } 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 -import packageJson from '../package.json' +import packageJson from '../package.json' with { type: 'json' } export type FacebookOptions = CompanionPluginOptions & { locale?: LocaleStrings diff --git a/packages/@uppy/facebook/src/index.ts b/packages/@uppy/facebook/src/index.ts index 4984d641d..1e5a9990e 100644 --- a/packages/@uppy/facebook/src/index.ts +++ b/packages/@uppy/facebook/src/index.ts @@ -1,2 +1,2 @@ -export { default } from './Facebook.jsx' -export type { FacebookOptions } from './Facebook.jsx' +export { default } from './Facebook.js' +export type { FacebookOptions } from './Facebook.js' diff --git a/packages/@uppy/facebook/tsconfig.build.json b/packages/@uppy/facebook/tsconfig.build.json index 82e187bca..afabb530f 100644 --- a/packages/@uppy/facebook/tsconfig.build.json +++ b/packages/@uppy/facebook/tsconfig.build.json @@ -2,7 +2,6 @@ "extends": "../../../tsconfig.shared", "compilerOptions": { "outDir": "./lib", - "resolveJsonModule": false, "rootDir": "./src" }, "include": ["./src/**/*.*"], diff --git a/packages/@uppy/file-input/package.json b/packages/@uppy/file-input/package.json index 28cdb8298..4fc63eb2f 100644 --- a/packages/@uppy/file-input/package.json +++ b/packages/@uppy/file-input/package.json @@ -6,6 +6,9 @@ "main": "lib/index.js", "style": "dist/style.min.css", "type": "module", + "scripts": { + "build": "tsc --build tsconfig.build.json" + }, "keywords": [ "file uploader", "upload", @@ -27,5 +30,8 @@ }, "peerDependencies": { "@uppy/core": "workspace:^" + }, + "devDependencies": { + "typescript": "^5.8.3" } } diff --git a/packages/@uppy/file-input/src/FileInput.tsx b/packages/@uppy/file-input/src/FileInput.tsx index 06503a8bf..2069b02f6 100644 --- a/packages/@uppy/file-input/src/FileInput.tsx +++ b/packages/@uppy/file-input/src/FileInput.tsx @@ -11,9 +11,7 @@ import type { } from '@uppy/core' import toArray from '@uppy/utils/lib/toArray' 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 -import packageJson from '../package.json' +import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' export interface FileInputOptions extends UIPluginOptions { diff --git a/packages/@uppy/file-input/src/index.ts b/packages/@uppy/file-input/src/index.ts index 9dea6a716..8be0a3f04 100644 --- a/packages/@uppy/file-input/src/index.ts +++ b/packages/@uppy/file-input/src/index.ts @@ -1,2 +1,2 @@ -export { default } from './FileInput.jsx' -export type { FileInputOptions } from './FileInput.jsx' +export { default } from './FileInput.js' +export type { FileInputOptions } from './FileInput.js' diff --git a/packages/@uppy/file-input/tsconfig.build.json b/packages/@uppy/file-input/tsconfig.build.json index bbf30b5b4..389eb1387 100644 --- a/packages/@uppy/file-input/tsconfig.build.json +++ b/packages/@uppy/file-input/tsconfig.build.json @@ -2,7 +2,6 @@ "extends": "../../../tsconfig.shared", "compilerOptions": { "outDir": "./lib", - "resolveJsonModule": false, "rootDir": "./src" }, "include": ["./src/**/*.*"], diff --git a/packages/@uppy/form/package.json b/packages/@uppy/form/package.json index 82ff5e8fc..c152f441b 100644 --- a/packages/@uppy/form/package.json +++ b/packages/@uppy/form/package.json @@ -5,6 +5,9 @@ "license": "MIT", "main": "lib/index.js", "type": "module", + "scripts": { + "build": "tsc --build tsconfig.build.json" + }, "keywords": [ "file uploader", "uppy", @@ -25,5 +28,8 @@ }, "peerDependencies": { "@uppy/core": "workspace:^" + }, + "devDependencies": { + "typescript": "^5.8.3" } } diff --git a/packages/@uppy/form/src/index.ts b/packages/@uppy/form/src/index.ts index 6d4cb0541..17c5b8691 100644 --- a/packages/@uppy/form/src/index.ts +++ b/packages/@uppy/form/src/index.ts @@ -14,9 +14,7 @@ import toArray from '@uppy/utils/lib/toArray' // @ts-ignore untyped import getFormData from 'get-form-data' -// 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' +import packageJson from '../package.json' with { type: 'json' } type Result = Parameters< UppyEventMap['complete'] diff --git a/packages/@uppy/form/tsconfig.build.json b/packages/@uppy/form/tsconfig.build.json index bbf30b5b4..389eb1387 100644 --- a/packages/@uppy/form/tsconfig.build.json +++ b/packages/@uppy/form/tsconfig.build.json @@ -2,7 +2,6 @@ "extends": "../../../tsconfig.shared", "compilerOptions": { "outDir": "./lib", - "resolveJsonModule": false, "rootDir": "./src" }, "include": ["./src/**/*.*"], diff --git a/packages/@uppy/golden-retriever/package.json b/packages/@uppy/golden-retriever/package.json index 3f615f8ed..edf626469 100644 --- a/packages/@uppy/golden-retriever/package.json +++ b/packages/@uppy/golden-retriever/package.json @@ -5,6 +5,9 @@ "license": "MIT", "main": "lib/index.js", "type": "module", + "scripts": { + "build": "tsc --build tsconfig.build.json" + }, "keywords": [ "file uploader", "restore files", @@ -28,5 +31,8 @@ }, "peerDependencies": { "@uppy/core": "workspace:^" + }, + "devDependencies": { + "typescript": "^5.8.3" } } diff --git a/packages/@uppy/golden-retriever/src/index.ts b/packages/@uppy/golden-retriever/src/index.ts index cd279cd19..56d2ae950 100644 --- a/packages/@uppy/golden-retriever/src/index.ts +++ b/packages/@uppy/golden-retriever/src/index.ts @@ -15,9 +15,7 @@ import ServiceWorkerStore, { import IndexedDBStore from './IndexedDBStore.js' import MetaDataStore from './MetaDataStore.js' -// 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' +import packageJson from '../package.json' with { type: 'json' } declare module '@uppy/core' { // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/packages/@uppy/golden-retriever/tsconfig.build.json b/packages/@uppy/golden-retriever/tsconfig.build.json index bbf30b5b4..389eb1387 100644 --- a/packages/@uppy/golden-retriever/tsconfig.build.json +++ b/packages/@uppy/golden-retriever/tsconfig.build.json @@ -2,7 +2,6 @@ "extends": "../../../tsconfig.shared", "compilerOptions": { "outDir": "./lib", - "resolveJsonModule": false, "rootDir": "./src" }, "include": ["./src/**/*.*"], diff --git a/packages/@uppy/google-drive-picker/package.json b/packages/@uppy/google-drive-picker/package.json index f9fcfe2c6..04e58fead 100644 --- a/packages/@uppy/google-drive-picker/package.json +++ b/packages/@uppy/google-drive-picker/package.json @@ -5,6 +5,9 @@ "license": "MIT", "main": "lib/index.js", "type": "module", + "scripts": { + "build": "tsc --build tsconfig.build.json" + }, "keywords": [ "file uploader", "google drive", @@ -29,5 +32,8 @@ }, "peerDependencies": { "@uppy/core": "workspace:^" + }, + "devDependencies": { + "typescript": "^5.8.3" } } diff --git a/packages/@uppy/google-drive-picker/src/GoogleDrivePicker.tsx b/packages/@uppy/google-drive-picker/src/GoogleDrivePicker.tsx index 01a730855..a95a10721 100644 --- a/packages/@uppy/google-drive-picker/src/GoogleDrivePicker.tsx +++ b/packages/@uppy/google-drive-picker/src/GoogleDrivePicker.tsx @@ -12,9 +12,7 @@ import type { PickedItem } from '@uppy/provider-views/lib/GooglePicker/googlePic import type { Body, Meta, AsyncStore, BaseProviderPlugin } from '@uppy/core' import type { LocaleStrings } 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 -import packageJson from '../package.json' +import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' export type GoogleDrivePickerOptions = CompanionPluginOptions & { diff --git a/packages/@uppy/google-drive-picker/src/index.ts b/packages/@uppy/google-drive-picker/src/index.ts index 2c9b1495b..78b75b3a4 100644 --- a/packages/@uppy/google-drive-picker/src/index.ts +++ b/packages/@uppy/google-drive-picker/src/index.ts @@ -1 +1 @@ -export { default } from './GoogleDrivePicker.jsx' +export { default } from './GoogleDrivePicker.js' diff --git a/packages/@uppy/google-drive-picker/tsconfig.build.json b/packages/@uppy/google-drive-picker/tsconfig.build.json index 7c3cc957c..c9ee07067 100644 --- a/packages/@uppy/google-drive-picker/tsconfig.build.json +++ b/packages/@uppy/google-drive-picker/tsconfig.build.json @@ -3,7 +3,6 @@ "compilerOptions": { "noImplicitAny": false, "outDir": "./lib", - "resolveJsonModule": false, "rootDir": "./src", "skipLibCheck": true }, diff --git a/packages/@uppy/google-drive/package.json b/packages/@uppy/google-drive/package.json index 9c4ec972f..282ef8440 100644 --- a/packages/@uppy/google-drive/package.json +++ b/packages/@uppy/google-drive/package.json @@ -5,6 +5,9 @@ "license": "MIT", "main": "lib/index.js", "type": "module", + "scripts": { + "build": "tsc --build tsconfig.build.json" + }, "keywords": [ "file uploader", "google drive", @@ -28,5 +31,8 @@ }, "peerDependencies": { "@uppy/core": "workspace:^" + }, + "devDependencies": { + "typescript": "^5.8.3" } } diff --git a/packages/@uppy/google-drive/src/GoogleDrive.tsx b/packages/@uppy/google-drive/src/GoogleDrive.tsx index 8f5766f06..8fd8e7c52 100644 --- a/packages/@uppy/google-drive/src/GoogleDrive.tsx +++ b/packages/@uppy/google-drive/src/GoogleDrive.tsx @@ -19,9 +19,7 @@ import type { } from '@uppy/core' import DriveProviderViews from './DriveProviderViews.js' 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 -import packageJson from '../package.json' +import packageJson from '../package.json' with { type: 'json' } export type GoogleDriveOptions = CompanionPluginOptions & { locale?: LocaleStrings diff --git a/packages/@uppy/google-drive/src/index.ts b/packages/@uppy/google-drive/src/index.ts index 5ba47c744..7891e5d57 100644 --- a/packages/@uppy/google-drive/src/index.ts +++ b/packages/@uppy/google-drive/src/index.ts @@ -1,2 +1,2 @@ -export { default } from './GoogleDrive.jsx' -export type { GoogleDriveOptions } from './GoogleDrive.jsx' +export { default } from './GoogleDrive.js' +export type { GoogleDriveOptions } from './GoogleDrive.js' diff --git a/packages/@uppy/google-drive/tsconfig.build.json b/packages/@uppy/google-drive/tsconfig.build.json index 82e187bca..afabb530f 100644 --- a/packages/@uppy/google-drive/tsconfig.build.json +++ b/packages/@uppy/google-drive/tsconfig.build.json @@ -2,7 +2,6 @@ "extends": "../../../tsconfig.shared", "compilerOptions": { "outDir": "./lib", - "resolveJsonModule": false, "rootDir": "./src" }, "include": ["./src/**/*.*"], diff --git a/packages/@uppy/google-photos-picker/package.json b/packages/@uppy/google-photos-picker/package.json index eec0b66bb..dbe17b86d 100644 --- a/packages/@uppy/google-photos-picker/package.json +++ b/packages/@uppy/google-photos-picker/package.json @@ -5,6 +5,9 @@ "license": "MIT", "main": "lib/index.js", "type": "module", + "scripts": { + "build": "tsc --build tsconfig.build.json" + }, "keywords": [ "file uploader", "google photos", @@ -29,5 +32,8 @@ }, "peerDependencies": { "@uppy/core": "workspace:^" + }, + "devDependencies": { + "typescript": "^5.8.3" } } diff --git a/packages/@uppy/google-photos-picker/src/GooglePhotosPicker.tsx b/packages/@uppy/google-photos-picker/src/GooglePhotosPicker.tsx index 7b0a43ab3..13c1e6c27 100644 --- a/packages/@uppy/google-photos-picker/src/GooglePhotosPicker.tsx +++ b/packages/@uppy/google-photos-picker/src/GooglePhotosPicker.tsx @@ -12,9 +12,7 @@ import type { PickedItem } from '@uppy/provider-views/lib/GooglePicker/googlePic import type { Body, Meta, AsyncStore, BaseProviderPlugin } from '@uppy/core' import type { LocaleStrings } 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 -import packageJson from '../package.json' +import packageJson from '../package.json' with { type: 'json' } import locale from './locale.js' export type GooglePhotosPickerOptions = CompanionPluginOptions & { diff --git a/packages/@uppy/google-photos-picker/src/index.ts b/packages/@uppy/google-photos-picker/src/index.ts index 97684c2cb..adcb5d66c 100644 --- a/packages/@uppy/google-photos-picker/src/index.ts +++ b/packages/@uppy/google-photos-picker/src/index.ts @@ -1 +1 @@ -export { default } from './GooglePhotosPicker.jsx' +export { default } from './GooglePhotosPicker.js' diff --git a/packages/@uppy/google-photos-picker/tsconfig.build.json b/packages/@uppy/google-photos-picker/tsconfig.build.json index 7c3cc957c..c9ee07067 100644 --- a/packages/@uppy/google-photos-picker/tsconfig.build.json +++ b/packages/@uppy/google-photos-picker/tsconfig.build.json @@ -3,7 +3,6 @@ "compilerOptions": { "noImplicitAny": false, "outDir": "./lib", - "resolveJsonModule": false, "rootDir": "./src", "skipLibCheck": true }, diff --git a/packages/@uppy/image-editor/package.json b/packages/@uppy/image-editor/package.json index 2f6ffb925..c6916fa09 100644 --- a/packages/@uppy/image-editor/package.json +++ b/packages/@uppy/image-editor/package.json @@ -6,6 +6,9 @@ "main": "lib/index.js", "style": "dist/style.min.css", "type": "module", + "scripts": { + "build": "tsc --build tsconfig.build.json" + }, "keywords": [ "file uploader", "upload", @@ -35,5 +38,8 @@ }, "publishConfig": { "access": "public" + }, + "devDependencies": { + "typescript": "^5.8.3" } } diff --git a/packages/@uppy/image-editor/src/Editor.tsx b/packages/@uppy/image-editor/src/Editor.tsx index b2e84cf2f..6e9434670 100644 --- a/packages/@uppy/image-editor/src/Editor.tsx +++ b/packages/@uppy/image-editor/src/Editor.tsx @@ -171,7 +171,6 @@ export default class Editor extends Component< return (