Skip to content

Commit

Permalink
Merge branch 'main'
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Jan 3, 2024
2 parents c5e1b14 + a356f10 commit f62ae48
Show file tree
Hide file tree
Showing 19 changed files with 167 additions and 134 deletions.
181 changes: 95 additions & 86 deletions examples/aws-php/composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/@uppy/companion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"redis": "4.2.0",
"serialize-error": "^2.1.0",
"serialize-javascript": "^6.0.0",
"tus-js-client": "^3.0.0",
"tus-js-client": "^3.1.3",
"validator": "^13.0.0",
"ws": "8.8.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/compressor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"url": "git+https://github.com/transloadit/uppy.git"
},
"dependencies": {
"@transloadit/prettier-bytes": "^0.0.9",
"@transloadit/prettier-bytes": "^0.2.0",
"@uppy/utils": "workspace:^",
"compressorjs": "^1.1.1",
"preact": "^10.5.13",
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"url": "git+https://github.com/transloadit/uppy.git"
},
"dependencies": {
"@transloadit/prettier-bytes": "0.0.9",
"@transloadit/prettier-bytes": "^0.2.0",
"@uppy/store-default": "workspace:^",
"@uppy/utils": "workspace:^",
"lodash": "^4.17.21",
Expand Down
1 change: 0 additions & 1 deletion packages/@uppy/core/src/Restricter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
/* eslint-disable max-classes-per-file, class-methods-use-this */
// @ts-ignore untyped
import prettierBytes from '@transloadit/prettier-bytes'
// @ts-ignore untyped
import match from 'mime-match'
Expand Down
1 change: 0 additions & 1 deletion packages/@uppy/core/src/Uppy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import assert from 'node:assert'
import fs from 'node:fs'
import path from 'node:path'
// @ts-expect-error untyped
import prettierBytes from '@transloadit/prettier-bytes'
import Core from './index.ts'
import UIPlugin from './UIPlugin.ts'
Expand Down
5 changes: 5 additions & 0 deletions packages/@uppy/core/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"rootDir": "./src",
"resolveJsonModule": false,
"noImplicitAny": false,
"paths": {
"@uppy/store-default": ["../store-default/src/index.js"],
"@uppy/store-default/lib/*": ["../store-default/src/*"],
"@uppy/utils/lib/*": ["../utils/src/*"]
},
"skipLibCheck": true
},
"include": ["./src/**/*.*"],
Expand Down
7 changes: 6 additions & 1 deletion packages/@uppy/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
"extends": "../../../tsconfig.shared",
"compilerOptions": {
"emitDeclarationOnly": false,
"noEmit": true
"noEmit": true,
"paths": {
"@uppy/store-default": ["../store-default/src/index.js"],
"@uppy/store-default/lib/*": ["../store-default/src/*"],
"@uppy/utils/lib/*": ["../utils/src/*"]
}
},
"include": ["./package.json", "./src/**/*.*"],
"references": [
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"url": "git+https://github.com/transloadit/uppy.git"
},
"dependencies": {
"@transloadit/prettier-bytes": "0.0.7",
"@transloadit/prettier-bytes": "^0.2.0",
"@uppy/informer": "workspace:^",
"@uppy/provider-views": "workspace:^",
"@uppy/status-bar": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const renderFileName = (props) => {

const renderAuthor = (props) => {
const { author } = props.file.meta
const { providerName } = props.file.remote
const providerName = props.file.remote?.providerName
const dot = `\u00B7`

if (!author) {
Expand Down
6 changes: 0 additions & 6 deletions packages/@uppy/dashboard/src/components/FileItem/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,6 @@
}
}

.uppy-Dashboard-Item.is-inprogress:not(.is-resumable) {
.uppy-Dashboard-Item-action--remove {
display: none;
}
}

.uppy-Dashboard-Item-errorDetails {
position: relative;
top: 0;
Expand Down
1 change: 0 additions & 1 deletion packages/@uppy/golden-retriever/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"url": "git+https://github.com/transloadit/uppy.git"
},
"dependencies": {
"@transloadit/prettier-bytes": "0.0.9",
"@uppy/utils": "workspace:^",
"lodash": "^4.17.21"
},
Expand Down
1 change: 1 addition & 0 deletions packages/@uppy/locales/src/hr_HR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ hr_HR.strings = {
resumeUpload: 'Nastavi prijenos',
retry: 'Pokušaj ponovo',
retryUpload: 'Ponovno pokušaj prenijeti datoteku',
save: 'Spremi',
saveChanges: 'Spremi promjene',
selectX: {
'0': 'Izaberi datoteku',
Expand Down
3 changes: 3 additions & 0 deletions packages/@uppy/locales/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"compilerOptions": {
"outDir": "./lib",
"rootDir": "./src",
"paths": {
"@uppy/utils/lib/*": ["../utils/src/*"]
},
"skipLibCheck": true
},
"include": ["./src/**/*.*"],
Expand Down
3 changes: 3 additions & 0 deletions packages/@uppy/locales/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"extends": "../../../tsconfig.shared",
"compilerOptions": {
"emitDeclarationOnly": false,
"paths": {
"@uppy/utils/lib/*": ["../utils/src/*"]
},
"noEmit": true
},
"include": ["./package.json", "./src/**/*.*"],
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/status-bar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"url": "git+https://github.com/transloadit/uppy.git"
},
"dependencies": {
"@transloadit/prettier-bytes": "0.0.9",
"@transloadit/prettier-bytes": "^0.2.0",
"@uppy/utils": "workspace:^",
"classnames": "^2.2.6",
"preact": "^10.5.13"
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/tus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"dependencies": {
"@uppy/companion-client": "workspace:^",
"@uppy/utils": "workspace:^",
"tus-js-client": "^3.0.0"
"tus-js-client": "^3.1.3"
},
"devDependencies": {
"vitest": "^0.34.5"
Expand Down
42 changes: 33 additions & 9 deletions private/js2ts/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

import { opendir, readFile, open, writeFile, rm } from 'node:fs/promises'
import { createRequire } from 'node:module'
import { argv } from 'node:process'
import { basename, extname, join } from 'node:path'
import { existsSync } from 'node:fs'
Expand All @@ -26,13 +27,34 @@ if (packageJSON.type !== 'module') {
throw new Error('Cannot convert non-ESM package to TS')
}

const references = Object.keys(packageJSON.dependencies || {})
.concat(Object.keys(packageJSON.peerDependencies || {}))
.concat(Object.keys(packageJSON.devDependencies || {}))
.filter((pkg) => pkg.startsWith('@uppy/'))
.map((pkg) => ({
path: `../${pkg.slice('@uppy/'.length)}/tsconfig.build.json`,
}))
const uppyDeps = new Set(
Object.keys(packageJSON.dependencies || {})
.concat(Object.keys(packageJSON.peerDependencies || {}))
.concat(Object.keys(packageJSON.devDependencies || {}))
.filter((pkg) => pkg.startsWith('@uppy/')),
)

// We want TS to check the source files so it doesn't use outdated (or missing) types:
const paths = Object.fromEntries(
(function* generatePaths() {
const require = createRequire(packageRoot)
for (const pkg of uppyDeps) {
const nickname = pkg.slice('@uppy/'.length)
// eslint-disable-next-line import/no-dynamic-require
const pkgJson = require(`../${nickname}/package.json`)
if (pkgJson.main) {
yield [
pkg,
[`../${nickname}/${pkgJson.main.replace(/^(\.\/)?lib\//, 'src/')}`],
]
}
yield [`${pkg}/lib/*`, [`../${nickname}/src/*`]]
}
})(),
)
const references = Array.from(uppyDeps, (pkg) => ({
path: `../${pkg.slice('@uppy/'.length)}/tsconfig.build.json`,
}))

const depsNotYetConvertedToTS = references.filter(
(ref) => !existsSync(new URL(ref.path, packageRoot)),
Expand Down Expand Up @@ -93,6 +115,7 @@ await tsConfig.writeFile(
compilerOptions: {
emitDeclarationOnly: false,
noEmit: true,
paths,
},
include: ['./package.json', './src/**/*.*'],
references,
Expand All @@ -110,10 +133,11 @@ await writeFile(
{
extends: '../../../tsconfig.shared',
compilerOptions: {
noImplicitAny: false,
outDir: './lib',
rootDir: './src',
paths,
resolveJsonModule: false,
noImplicitAny: false,
rootDir: './src',
skipLibCheck: true,
},
include: ['./src/**/*.*'],
Expand Down
36 changes: 14 additions & 22 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7718,17 +7718,10 @@ __metadata:
languageName: node
linkType: hard

"@transloadit/prettier-bytes@npm:0.0.7":
version: 0.0.7
resolution: "@transloadit/prettier-bytes@npm:0.0.7"
checksum: af075e1b2b045cac55d5ab854b5c94273ef7f4bd825f05fe578559465f206d2a1535343b50170252a9efb31ffdc2d6420e64eb32d2faeabeeb8b7d81d5d46ef0
languageName: node
linkType: hard

"@transloadit/prettier-bytes@npm:0.0.9, @transloadit/prettier-bytes@npm:^0.0.9":
version: 0.0.9
resolution: "@transloadit/prettier-bytes@npm:0.0.9"
checksum: efa5a723c41e7bce7ad17d1affe6a43209df857e17dc2b12a7c7bd6d3c921df8298086dbfb62ed740ca3e617d8c7f47485bb311adb637b20f2f75a28b08bac4f
"@transloadit/prettier-bytes@npm:^0.2.0":
version: 0.2.0
resolution: "@transloadit/prettier-bytes@npm:0.2.0"
checksum: 0faaeffc879754e18103bd576510d4349ec5253c2ebe846f7f8e52f2e9bc4c6877a9197adf4d2f196fa9b442a64cd43c5a742b5b51268e7f56bb3451299af1ce
languageName: node
linkType: hard

Expand Down Expand Up @@ -9325,7 +9318,7 @@ __metadata:
serialize-error: ^2.1.0
serialize-javascript: ^6.0.0
supertest: 6.2.4
tus-js-client: ^3.0.0
tus-js-client: ^3.1.3
typescript: ~5.1
validator: ^13.0.0
ws: 8.8.1
Expand All @@ -9338,7 +9331,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@uppy/compressor@workspace:packages/@uppy/compressor"
dependencies:
"@transloadit/prettier-bytes": ^0.0.9
"@transloadit/prettier-bytes": ^0.2.0
"@uppy/utils": "workspace:^"
compressorjs: ^1.1.1
preact: ^10.5.13
Expand All @@ -9353,7 +9346,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@uppy/core@workspace:packages/@uppy/core"
dependencies:
"@transloadit/prettier-bytes": 0.0.9
"@transloadit/prettier-bytes": ^0.2.0
"@uppy/store-default": "workspace:^"
"@uppy/utils": "workspace:^"
lodash: ^4.17.21
Expand All @@ -9369,7 +9362,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@uppy/dashboard@workspace:packages/@uppy/dashboard"
dependencies:
"@transloadit/prettier-bytes": 0.0.7
"@transloadit/prettier-bytes": ^0.2.0
"@uppy/google-drive": "workspace:^"
"@uppy/informer": "workspace:^"
"@uppy/provider-views": "workspace:^"
Expand Down Expand Up @@ -9464,7 +9457,6 @@ __metadata:
version: 0.0.0-use.local
resolution: "@uppy/golden-retriever@workspace:packages/@uppy/golden-retriever"
dependencies:
"@transloadit/prettier-bytes": 0.0.9
"@uppy/utils": "workspace:^"
lodash: ^4.17.21
peerDependencies:
Expand Down Expand Up @@ -9658,7 +9650,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@uppy/status-bar@workspace:packages/@uppy/status-bar"
dependencies:
"@transloadit/prettier-bytes": 0.0.9
"@transloadit/prettier-bytes": ^0.2.0
"@uppy/utils": "workspace:^"
classnames: ^2.2.6
preact: ^10.5.13
Expand Down Expand Up @@ -9741,7 +9733,7 @@ __metadata:
dependencies:
"@uppy/companion-client": "workspace:^"
"@uppy/utils": "workspace:^"
tus-js-client: ^3.0.0
tus-js-client: ^3.1.3
vitest: ^0.34.5
peerDependencies:
"@uppy/core": "workspace:^"
Expand Down Expand Up @@ -30143,9 +30135,9 @@ __metadata:
languageName: node
linkType: hard

"tus-js-client@npm:^3.0.0":
version: 3.0.0
resolution: "tus-js-client@npm:3.0.0"
"tus-js-client@npm:^3.1.3":
version: 3.1.3
resolution: "tus-js-client@npm:3.1.3"
dependencies:
buffer-from: ^1.1.2
combine-errors: ^3.0.3
Expand All @@ -30154,7 +30146,7 @@ __metadata:
lodash.throttle: ^4.1.1
proper-lockfile: ^4.1.2
url-parse: ^1.5.7
checksum: dda7921a0d55f3a15535590adb6eb98edfbf6c88dfbcad9bf1013cfa16bc2244fb937ad1d6bc05f34005ee103da31ccbae5ca650d46dc23d6e653946994c9015
checksum: 6f25dbbdbe1de51f44688dfb9ee78cae8deb987ac0a8e5d7d3e09a52ed0a7bfa5e2c3e39e82f0913beb241da78ddf42bdcb4c44369ea57f7cf15fad17e5b954f
languageName: node
linkType: hard

Expand Down

0 comments on commit f62ae48

Please sign in to comment.