Skip to content

Commit 6c8f7a9

Browse files
committed
upgrade filesize through a major version
1 parent 8f641b9 commit 6c8f7a9

File tree

9 files changed

+20
-20
lines changed

9 files changed

+20
-20
lines changed

app/forms/image-from-snapshot.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright Oxide Computer Company
77
*/
8-
import fileSize from 'filesize'
8+
import { filesize } from 'filesize'
99
import { useNavigate, type LoaderFunctionArgs } from 'react-router-dom'
1010

1111
import {
@@ -83,7 +83,7 @@ export function CreateImageFromSnapshotSideModalForm() {
8383
<PropertiesTable.Row label="Snapshot">{data.name}</PropertiesTable.Row>
8484
<PropertiesTable.Row label="Project">{project}</PropertiesTable.Row>
8585
<PropertiesTable.Row label="Size">
86-
{fileSize(data.size, { base: 2 })}
86+
{filesize(data.size, { base: 2 })}
8787
</PropertiesTable.Row>
8888
</PropertiesTable>
8989

app/forms/image-upload.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright Oxide Computer Company
77
*/
88
import cn from 'classnames'
9-
import filesize from 'filesize'
9+
import { filesize } from 'filesize'
1010
import pMap from 'p-map'
1111
import pRetry from 'p-retry'
1212
import { useRef, useState } from 'react'

app/pages/project/instances/instance/InstancePage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright Oxide Computer Company
77
*/
88
import { format } from 'date-fns'
9-
import filesize from 'filesize'
9+
import { filesize } from 'filesize'
1010
import { useMemo } from 'react'
1111
import { Link, useNavigate, type LoaderFunctionArgs } from 'react-router-dom'
1212

app/pages/system/inventory/sled/SledPage.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright Oxide Computer Company
77
*/
8-
import fileSize from 'filesize'
8+
import { filesize } from 'filesize'
99
import type { LoaderFunctionArgs } from 'react-router-dom'
1010

1111
import { apiQueryClient, usePrefetchedApiQuery } from '@oxide/api'
@@ -27,7 +27,7 @@ export function SledPage() {
2727
const { sledId } = useSledParams()
2828
const { data: sled } = usePrefetchedApiQuery('sledView', { path: { sledId } })
2929

30-
const ram = fileSize(sled.usablePhysicalRam, { output: 'object', base: 2 })
30+
const ram = filesize(sled.usablePhysicalRam, { output: 'object', base: 2 })
3131

3232
return (
3333
<>

libs/table/cells/InstanceResourceCell.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Copyright Oxide Computer Company
77
*/
8-
import fileSize from 'filesize'
8+
import { filesize } from 'filesize'
99

1010
import type { Instance } from '@oxide/api'
1111

@@ -14,7 +14,7 @@ import type { Cell } from './Cell'
1414
export const InstanceResourceCell = ({
1515
value,
1616
}: Cell<Pick<Instance, 'ncpus' | 'memory'>>) => {
17-
const memory = fileSize(value.memory, { output: 'object', base: 2 })
17+
const memory = filesize(value.memory, { output: 'object', base: 2 })
1818
return (
1919
<div className="space-y-0.5">
2020
<div>

libs/table/cells/SizeCell.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
*
66
* Copyright Oxide Computer Company
77
*/
8-
import fileSize from 'filesize'
8+
import { filesize } from 'filesize'
99

1010
import type { Cell } from './Cell'
1111

1212
/** Human-readable format for size in bytes */
1313
export const SizeCell = ({ value: bytes }: Cell<number>) => {
14-
const size = fileSize(bytes, { base: 2, output: 'object' })
14+
const size = filesize(bytes, { base: 2, output: 'object' })
1515
return (
1616
<span className="text-secondary">
1717
{size.value} <span className="text-quaternary">{size.unit}</span>

libs/ui/lib/file-input/FileInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Copyright Oxide Computer Company
77
*/
88
import cn from 'classnames'
9-
import filesize from 'filesize'
9+
import { filesize } from 'filesize'
1010
import {
1111
forwardRef,
1212
useRef,

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@tanstack/react-table": "^8.11.3",
4747
"classnames": "^2.5.1",
4848
"date-fns": "^2.30.0",
49-
"filesize": "^8.0.7",
49+
"filesize": "^10.1.0",
5050
"lodash.throttle": "^4.1.1",
5151
"match-sorter": "^6.3.1",
5252
"mousetrap": "^1.6.5",

0 commit comments

Comments
 (0)