Upgrade @transloadit/prettier-bytes to v1 and Companion type defs

@transloadit/prettier-bytes v1 switched from a default export to a named
export; update the imports in core, compressor, dashboard and status-bar.
@types/jsonwebtoken v9 and the @types/node bump require small type-only
adjustments in Companion's jwt and request helpers.
This commit is contained in:
Prakash 2026-05-21 22:25:16 +05:30
parent 3f0dd05a4e
commit 2b4994a0ad
14 changed files with 436 additions and 1691 deletions

View file

@ -86,12 +86,12 @@
"@types/eslint": "9.6.1",
"@types/express-session": "1.19.0",
"@types/http-proxy": "1.17.17",
"@types/jsonwebtoken": "8.3.7",
"@types/jsonwebtoken": "9.0.10",
"@types/lodash": "4.17.24",
"@types/mime-types": "3.0.1",
"@types/morgan": "1.7.37",
"@types/ms": "2.1.0",
"@types/node": "^20.19.0",
"@types/node": "20.19.41",
"@types/node-schedule": "2.1.8",
"@types/request": "2.48.13",
"@types/serialize-javascript": "5.0.4",

View file

@ -38,7 +38,7 @@ const verifyJwtToken = (token: string, secret: EncryptionSecret) => {
if (!decoded || typeof decoded !== 'object' || !('data' in decoded)) {
throw new Error('Invalid token payload')
}
return decoded.data
return decoded['data']
}
export const generateEncryptedToken = (

View file

@ -122,7 +122,7 @@ function getProtectedHttpAgent({
override createConnection(
options: http.ClientRequestArgs,
callback?: (err: Error | null, stream: Duplex) => void,
): Duplex {
): Duplex | null | undefined {
if (!allowLocalIPs && shouldBlockHost(options.host)) {
const socket = undefined as unknown as Duplex // not sure about this but it's how it always worked
callback?.(new Error(FORBIDDEN_IP_ADDRESS), socket)
@ -140,7 +140,7 @@ function getProtectedHttpAgent({
override createConnection(
options: http.ClientRequestArgs,
callback?: (err: Error | null, stream: Duplex) => void,
): Duplex {
): Duplex | null | undefined {
if (!allowLocalIPs && shouldBlockHost(options.host)) {
const socket = undefined as unknown as Duplex // not sure about this but it's how it always worked
callback?.(new Error(FORBIDDEN_IP_ADDRESS), socket)

View file

@ -31,7 +31,7 @@
"./package.json": "./package.json"
},
"dependencies": {
"@transloadit/prettier-bytes": "^0.3.4",
"@transloadit/prettier-bytes": "^1.1.0",
"@uppy/utils": "workspace:^",
"compressorjs": "^1.3.0",
"preact": "^10.29.2",

View file

@ -1,4 +1,4 @@
import prettierBytes from '@transloadit/prettier-bytes'
import { prettierBytes } from '@transloadit/prettier-bytes'
import type { DefinePluginOpts, PluginOpts } from '@uppy/core'
import { BasePlugin, type Uppy } from '@uppy/core'
import type { Body, LocalUppyFile, Meta, UppyFile } from '@uppy/utils'

View file

@ -41,7 +41,7 @@
"./package.json": "./package.json"
},
"dependencies": {
"@transloadit/prettier-bytes": "^0.3.4",
"@transloadit/prettier-bytes": "^1.1.0",
"@uppy/store-default": "workspace:^",
"@uppy/utils": "workspace:^",
"lodash": "^4.18.1",

View file

@ -1,4 +1,4 @@
import prettierBytes from '@transloadit/prettier-bytes'
import { prettierBytes } from '@transloadit/prettier-bytes'
import type { Body, I18n, Meta, UppyFile } from '@uppy/utils'
// @ts-expect-error untyped
import match from 'mime-match'

View file

@ -1,7 +1,7 @@
import assert from 'node:assert'
import fs from 'node:fs'
import path from 'node:path'
import prettierBytes from '@transloadit/prettier-bytes'
import { prettierBytes } from '@transloadit/prettier-bytes'
import type { Body, Meta } from '@uppy/core'
import type { Locale } from '@uppy/utils'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'

View file

@ -44,7 +44,7 @@
"./package.json": "./package.json"
},
"dependencies": {
"@transloadit/prettier-bytes": "^0.3.4",
"@transloadit/prettier-bytes": "^1.1.0",
"@uppy/provider-views": "workspace:^",
"@uppy/thumbnail-generator": "workspace:^",
"@uppy/utils": "workspace:^",

View file

@ -1,4 +1,4 @@
import prettierBytes from '@transloadit/prettier-bytes'
import { prettierBytes } from '@transloadit/prettier-bytes'
import type { UppyFile } from '@uppy/core'
import type { I18n } from '@uppy/utils'
import { truncateString } from '@uppy/utils'

View file

@ -1,4 +1,4 @@
import prettierBytes from '@transloadit/prettier-bytes'
import { prettierBytes } from '@transloadit/prettier-bytes'
import type { Body, Meta, State, Uppy } from '@uppy/core'
import type { FileProcessingInfo, I18n } from '@uppy/utils'
import { prettyETA } from '@uppy/utils'

View file

@ -46,7 +46,7 @@
"./package.json": "./package.json"
},
"dependencies": {
"@transloadit/prettier-bytes": "^0.3.4",
"@transloadit/prettier-bytes": "^1.1.0",
"@uppy/utils": "workspace:^",
"classnames": "^2.5.1",
"preact": "^10.29.2"

View file

@ -1,4 +1,4 @@
import prettierBytes from '@transloadit/prettier-bytes'
import { prettierBytes } from '@transloadit/prettier-bytes'
import type { Body, Meta, State, Uppy } from '@uppy/core'
import type { FileProcessingInfo, I18n } from '@uppy/utils'
import { prettyETA } from '@uppy/utils'

2097
yarn.lock

File diff suppressed because it is too large Load diff