Skip to content

Commit

Permalink
refactor: esm support
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Dec 20, 2023
1 parent 7de852d commit c990bc1
Show file tree
Hide file tree
Showing 98 changed files with 795 additions and 180 deletions.
18 changes: 18 additions & 0 deletions apps/explorer/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# explorer

## 0.10.3

### Patch Changes

- esm lodash support.

## 0.10.2

### Patch Changes

- lodash esm.

## 0.10.1

### Patch Changes

- lodash es.

## 0.10.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/app/contract/[id]/opengraph-image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { humanBytes, humanDate } from '@siafoundation/units'
import { getOGImage } from '../../../components/OGImageEntity'
import { siaCentralApi } from '../../../config'
import { truncate } from '@siafoundation/design-system'
import { lowerCase } from 'lodash'
import { lowerCase } from 'lodash-es'
import { siacoinToFiat } from '../../../lib/currency'
import { CurrencyOption, currencyOptions } from '@siafoundation/react-core'

Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/components/AddressSkeleton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
EntityList,
DatumSkeleton,
} from '@siafoundation/design-system'
import { times } from 'lodash'
import { times } from 'lodash-es'
import { ContentLayout } from '../ContentLayout'

export function AddressSkeleton() {
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/components/BlockSkeleton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
EntityList,
DatumSkeleton,
} from '@siafoundation/design-system'
import { times } from 'lodash'
import { times } from 'lodash-es'
import { ContentLayout } from '../ContentLayout'

export function BlockSkeleton() {
Expand Down
47 changes: 25 additions & 22 deletions apps/explorer/components/Contract/ContractHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
SiaCentralContract,
getSiaCentralBlockLatest,
} from '@siafoundation/sia-central'
import { lowerCase } from 'lodash'
import { lowerCase } from 'lodash-es'
import { routes } from '../../config/routes'
import { EntityHeading } from '../EntityHeading'
import { siaCentralApi } from '../../config'
Expand Down Expand Up @@ -64,33 +64,36 @@ export async function ContractHeader({
{renewedToId && renewedToId !== id && (
<LinkButton
className="hidden sm:flex"
href={routes.contract.view.replace(':id', renewedToId)}>
href={routes.contract.view.replace(':id', renewedToId)}
>
renewed to
<ArrowRight16 />
</LinkButton>
)}
</div>
</div>
{latest && <div className="px-1">
<ContractTimeline
currentHeight={latest.block.height || 0}
contractHeightStart={contract.negotiation_height}
contractHeightEnd={contract.expiration_height}
proofWindowHeightStart={contract.expiration_height}
proofWindowHeightEnd={contract.proof_deadline}
proofHeight={contract.proof_height}
range={{
startHeight: contract.negotiation_height,
endHeight: Math.max(
latest.block.height || 0,
Math.round(
contract.proof_deadline +
(contract.expiration_height - contract.negotiation_height)
)
),
}}
/>
</div>}
{latest && (
<div className="px-1">
<ContractTimeline
currentHeight={latest.block.height || 0}
contractHeightStart={contract.negotiation_height}
contractHeightEnd={contract.expiration_height}
proofWindowHeightStart={contract.expiration_height}
proofWindowHeightEnd={contract.proof_deadline}
proofHeight={contract.proof_height}
range={{
startHeight: contract.negotiation_height,
endHeight: Math.max(
latest.block.height || 0,
Math.round(
contract.proof_deadline +
(contract.expiration_height - contract.negotiation_height)
)
),
}}
/>
</div>
)}
</div>
)
}
2 changes: 1 addition & 1 deletion apps/explorer/components/ContractSkeleton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
EntityList,
DatumSkeleton,
} from '@siafoundation/design-system'
import { times } from 'lodash'
import { times } from 'lodash-es'
import { ContentLayout } from '../ContentLayout'

export function ContractSkeleton() {
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/components/EntityHeading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
EntityType,
} from '@siafoundation/design-system'
import { Copy16 } from '@siafoundation/react-icons'
import { upperFirst } from 'lodash'
import { upperFirst } from 'lodash-es'

type Props = {
label: string
Expand Down
4 changes: 2 additions & 2 deletions apps/explorer/components/ExplorerDatum.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
EntityType,
} from '@siafoundation/design-system'
import BigNumber from 'bignumber.js'
import { upperFirst } from 'lodash'
import { upperFirst } from 'lodash-es'
import { getHref } from '../lib/utils'

// entityType&entityValue | value | values | sc | sf
Expand Down Expand Up @@ -55,7 +55,7 @@ export function ExplorerDatum({
? Number(entityValue).toLocaleString()
: entityValue
}
// className="relative top-0.5"
// className="relative top-0.5"
/>
) : (
<Text font="mono" weight="semibold" scaleSize="18">
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/components/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { useMemo } from 'react'
import { routes } from '../../config/routes'
import { ContentLayout } from '../ContentLayout'
import { reverse, sortBy } from 'lodash'
import { reverse, sortBy } from 'lodash-es'
import {
SiaCentralBlock,
SiaCentralExchangeRates,
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/components/HostSkeleton/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DatumSkeleton, Panel } from '@siafoundation/design-system'
import { times } from 'lodash'
import { times } from 'lodash-es'
import { ContentLayout } from '../ContentLayout'
import { HostHeaderSkeleton } from './HostHeaderSkeleton'

Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/lib/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
getSiaCentralBlock,
getSiaCentralBlocks,
} from '@siafoundation/sia-central'
import { range } from 'lodash'
import { range } from 'lodash-es'

export async function getLastFewBlocksOneByOne(block?: SiaCentralBlock) {
if (!block) {
Expand Down
2 changes: 1 addition & 1 deletion apps/explorer/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "explorer",
"description": "The `explorer` user interface, a Sia blockchain explorer interface that powers siascan.com.",
"version": "0.10.0",
"version": "0.10.3",
"private": true,
"license": "MIT"
}
18 changes: 18 additions & 0 deletions apps/hostd/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# hostd

## 0.31.3

### Patch Changes

- esm lodash support.

## 0.31.2

### Patch Changes

- lodash esm.

## 0.31.1

### Patch Changes

- lodash es.

## 0.31.0

### Minor Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from '@siafoundation/react-icons'
import { SortField, sortOptions } from '../../contexts/contracts/types'
import { useContracts } from '../../contexts/contracts'
import { groupBy } from 'lodash'
import { groupBy } from 'lodash-es'

export function ContractsViewDropdownMenu() {
const {
Expand Down
2 changes: 1 addition & 1 deletion apps/hostd/components/Node/Logs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
import { useLogsSearch } from '@siafoundation/react-hostd'
import { humanDate } from '@siafoundation/units'
import { cx } from 'class-variance-authority'
import { times } from 'lodash'
import { times } from 'lodash-es'

const filters = []

Expand Down
2 changes: 1 addition & 1 deletion apps/hostd/components/Node/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useDialog } from '../../contexts/dialog'
import { HostdSidenav } from '../HostdSidenav'
import { HostdAuthedLayout } from '../HostdAuthedLayout'
import { useMemo } from 'react'
import { orderBy } from 'lodash'
import { orderBy } from 'lodash-es'
import { useSyncStatus } from '../../hooks/useSyncStatus'

export function Node() {
Expand Down
2 changes: 1 addition & 1 deletion apps/hostd/lib/system.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { trim, trimEnd } from 'lodash'
import { trim, trimEnd } from 'lodash-es'

type Separator = '\\' | '/'

Expand Down
2 changes: 1 addition & 1 deletion apps/hostd/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "hostd",
"description": "The `hostd` user interface, dedicated to hosting related functionality.",
"version": "0.31.0",
"version": "0.31.3",
"private": true,
"license": "MIT"
}
18 changes: 18 additions & 0 deletions apps/renterd/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# renterd

## 0.38.3

### Patch Changes

- esm lodash support.

## 0.38.2

### Patch Changes

- lodash esm.

## 0.38.1

### Patch Changes

- lodash es.

## 0.38.0

### Minor Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from '@siafoundation/react-icons'
import { sortOptions, SortField } from '../../contexts/contracts/types'
import { useContracts } from '../../contexts/contracts'
import { groupBy } from 'lodash'
import { groupBy } from 'lodash-es'

export function ContractsViewDropdownMenu() {
const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '@siafoundation/design-system'
import { useObject } from '@siafoundation/react-renterd'
import { cx } from 'class-variance-authority'
import { sortBy } from 'lodash'
import { sortBy } from 'lodash-es'
import { computeSlabContractSetShards } from '../../../../contexts/files/health'
import { ObjectData } from '../../../../contexts/files/types'
import { useHealthLabel } from '../../../../hooks/useHealthLabel'
Expand Down
4 changes: 3 additions & 1 deletion apps/renterd/components/Files/FilesActionsMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import {
Search16,
} from '@siafoundation/react-icons'
import { useFiles } from '../../contexts/files'
import { useDropzone } from 'react-dropzone'
import * as reactDropzone from 'react-dropzone'
import { FilesViewDropdownMenu } from './FilesViewDropdownMenu'
import { useDialog } from '../../contexts/dialog'
import { useCanUpload } from './useCanUpload'
// esm compat
const { useDropzone } = reactDropzone

export function FilesActionsMenu() {
const { openDialog } = useDialog()
Expand Down
2 changes: 1 addition & 1 deletion apps/renterd/components/Files/FilesViewDropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { CaretDown16, SettingsAdjust16 } from '@siafoundation/react-icons'
import { sortOptions, SortField } from '../../contexts/files/types'
import { useFiles } from '../../contexts/files'
import { groupBy } from 'lodash'
import { groupBy } from 'lodash-es'

export function FilesViewDropdownMenu() {
const {
Expand Down
2 changes: 1 addition & 1 deletion apps/renterd/components/Hosts/HostMap/useRoutes.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from 'react'
import { random, sortBy } from 'lodash'
import { random, sortBy } from 'lodash-es'
import { HostDataWithLocation } from '../../../contexts/hosts/types'

type Props = {
Expand Down
2 changes: 1 addition & 1 deletion apps/renterd/contexts/files/dataset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
useBuckets,
useObjectDirectory,
} from '@siafoundation/react-renterd'
import { sortBy, toPairs } from 'lodash'
import { sortBy, toPairs } from 'lodash-es'
import useSWR from 'swr'
import { useContracts } from '../contracts'
import { ObjectData, SortField } from './types'
Expand Down
2 changes: 1 addition & 1 deletion apps/renterd/contexts/files/downloads.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { triggerErrorToast, triggerToast } from '@siafoundation/design-system'
import { useAppSettings } from '@siafoundation/react-core'
import { useBuckets, useObjectDownloadFunc } from '@siafoundation/react-renterd'
import { throttle } from 'lodash'
import { throttle } from 'lodash-es'
import { useCallback, useMemo, useState } from 'react'
import {
FullPath,
Expand Down
2 changes: 1 addition & 1 deletion apps/renterd/contexts/files/health.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Obj, SlabSlice } from '@siafoundation/react-renterd'
import { min } from 'lodash'
import { min } from 'lodash-es'
import { ContractData } from '../contracts/types'

export function getObjectHealth(
Expand Down
2 changes: 1 addition & 1 deletion apps/renterd/contexts/files/uploads.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
triggerToast,
} from '@siafoundation/design-system'
import { useBuckets, useObjectUpload } from '@siafoundation/react-renterd'
import { throttle } from 'lodash'
import { throttle } from 'lodash-es'
import { useCallback, useMemo, useState } from 'react'
import { ObjectData } from './types'
import {
Expand Down
2 changes: 1 addition & 1 deletion apps/renterd/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "renterd",
"description": "The `renterd` user interface, dedicated to renter related functionality.",
"version": "0.38.0",
"version": "0.38.3",
"private": true,
"license": "MIT"
}
24 changes: 24 additions & 0 deletions apps/walletd/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# walletd

## 0.15.4

### Patch Changes

- esm

## 0.15.3

### Patch Changes

- esm lodash support.

## 0.15.2

### Patch Changes

- lodash esm.

## 0.15.1

### Patch Changes

- lodash es.

## 0.15.0

### Minor Changes
Expand Down
Loading

0 comments on commit c990bc1

Please sign in to comment.