Skip to content

Commit

Permalink
fix: lodash esm and cjs support
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfreska committed Dec 21, 2023
1 parent 7a84fe4 commit 027bce1
Show file tree
Hide file tree
Showing 55 changed files with 110 additions and 102 deletions.
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-es'
import { lowerCase } from '@technically/lodash'
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-es'
import { times } from '@technically/lodash'
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-es'
import { times } from '@technically/lodash'
import { ContentLayout } from '../ContentLayout'

export function BlockSkeleton() {
Expand Down
2 changes: 1 addition & 1 deletion 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-es'
import { lowerCase } from '@technically/lodash'
import { routes } from '../../config/routes'
import { EntityHeading } from '../EntityHeading'
import { siaCentralApi } from '../../config'
Expand Down
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-es'
import { times } from '@technically/lodash'
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-es'
import { upperFirst } from '@technically/lodash'

type Props = {
label: string
Expand Down
2 changes: 1 addition & 1 deletion 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-es'
import { upperFirst } from '@technically/lodash'
import { getHref } from '../lib/utils'

// entityType&entityValue | value | values | sc | sf
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-es'
import { reverse, sortBy } from '@technically/lodash'
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-es'
import { times } from '@technically/lodash'
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-es'
import { range } from '@technically/lodash'

export async function getLastFewBlocksOneByOne(block?: SiaCentralBlock) {
if (!block) {
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-es'
import { groupBy } from '@technically/lodash'

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-es'
import { times } from '@technically/lodash'

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-es'
import { orderBy } from '@technically/lodash'
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-es'
import { trim, trimEnd } from '@technically/lodash'

type Separator = '\\' | '/'

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-es'
import { groupBy } from '@technically/lodash'

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-es'
import { sortBy } from '@technically/lodash'
import { computeSlabContractSetShards } from '../../../../contexts/files/health'
import { ObjectData } from '../../../../contexts/files/types'
import { useHealthLabel } from '../../../../hooks/useHealthLabel'
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-es'
import { groupBy } from '@technically/lodash'

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-es'
import { random, sortBy } from '@technically/lodash'
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-es'
import { sortBy, toPairs } from '@technically/lodash'
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-es'
import { throttle } from '@technically/lodash'
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-es'
import { min } from '@technically/lodash'
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-es'
import { throttle } from '@technically/lodash'
import { useCallback, useMemo, useState } from 'react'
import { ObjectData } from './types'
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
Reset16,
} from '@siafoundation/react-icons'
import { SortField, sortOptions } from '../../contexts/addresses/types'
import { groupBy } from 'lodash-es'
import { groupBy } from '@technically/lodash'
import { useAddresses } from '../../contexts/addresses'

export function AddressesViewDropdownMenu() {
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/wallets/types'
import { useWallets } from '../../contexts/wallets'
import { groupBy } from 'lodash-es'
import { groupBy } from '@technically/lodash'

export function WalletsViewDropdownMenu() {
const {
Expand Down
2 changes: 1 addition & 1 deletion apps/walletd/dialogs/WalletAddressesAddDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { useForm } from 'react-hook-form'
import { useDialogFormHelpers } from '../hooks/useDialogFormHelpers'
import { useWallets } from '../contexts/wallets'
import { isValidAddress } from '@siafoundation/units'
import { uniq } from 'lodash-es'
import { uniq } from '@technically/lodash'

export type WalletAddressesAddDialogParams = {
walletId: string
Expand Down
2 changes: 1 addition & 1 deletion apps/website/components/CalloutProject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
webLinks,
WebDomain,
} from '@siafoundation/design-system'
import { random } from 'lodash-es'
import { random } from '@technically/lodash'
import Image from 'next/image'
import { useRouter } from 'next/router'
import { useMemo } from 'react'
Expand Down
2 changes: 1 addition & 1 deletion apps/website/components/CalloutTutorial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
Text,
WebDomain,
} from '@siafoundation/design-system'
import { random } from 'lodash-es'
import { random } from '@technically/lodash'
import Image from 'next/image'
import { useMemo } from 'react'
import { routes } from '../config/routes'
Expand Down
2 changes: 1 addition & 1 deletion apps/website/components/HostMap/Globe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from 'react'
import dynamic from 'next/dynamic'
import { GlobeMethods } from 'react-globe.gl'
import { random, sortBy } from 'lodash-es'
import { random, sortBy } from '@technically/lodash'
import { getHostLabel } from './utils'
import { SiaCentralPartialHost } from '../../content/geoHosts'
import { getAssetUrl } from '../../content/assets'
Expand Down
2 changes: 1 addition & 1 deletion apps/website/components/HostMap/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
useAppSettings,
usePrefersReducedMotion,
} from '@siafoundation/react-core'
import { random, throttle } from 'lodash-es'
import { random, throttle } from '@technically/lodash'
import { HostItem } from './HostItem'
import { Globe } from './Globe'
import { cx } from 'class-variance-authority'
Expand Down
2 changes: 1 addition & 1 deletion apps/website/components/Map/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-es'
import { random, sortBy } from '@technically/lodash'
import { SiaCentralPartialHost } from '../../content/geoHosts'

type Props = {
Expand Down
2 changes: 1 addition & 1 deletion apps/website/content/reports.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from 'fs'
import { toPairs } from 'lodash-es'
import { toPairs } from '@technically/lodash'
import { webLinks } from '@siafoundation/design-system'
import { getMinutesInSeconds } from '../lib/time'
import { getCacheValue } from '../lib/cache'
Expand Down
2 changes: 1 addition & 1 deletion apps/website/hooks/useScrollTop.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { throttle } from 'lodash-es'
import { throttle } from '@technically/lodash'
import { useEffect, useState } from 'react'

export function useScrollTop() {
Expand Down
2 changes: 1 addition & 1 deletion libs/data-sources/src/lib/github.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Axios from 'axios'
import { orderBy } from 'lodash-es'
import { orderBy } from '@technically/lodash'
import { buildErrorResponse500 } from './error'
import { AsyncDataSourceResponse } from './types'

Expand Down
2 changes: 1 addition & 1 deletion libs/design-system/src/app/AlertsDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Text } from '../../core/Text'
import { useDatasetEmptyState } from '../../hooks/useDatasetEmptyState'
import { humanDate } from '@siafoundation/units'
import { cx } from 'class-variance-authority'
import { times } from 'lodash-es'
import { times } from '@technically/lodash'
import { useCallback, useMemo, useState } from 'react'
import { StateEmpty } from './StateEmpty'
import { SWRResponse } from 'swr'
Expand Down
2 changes: 1 addition & 1 deletion libs/design-system/src/app/AppLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { RecentlyViewed16, Settings16 } from '@siafoundation/react-icons'
import { Button } from '../core/Button'
import { Panel } from '../core/Panel'
import { ControlGroup } from '../core/ControlGroup'
import { sortBy } from 'lodash-es'
import { sortBy } from '@technically/lodash'

function getDefaultValues(api: string) {
return {
Expand Down
2 changes: 1 addition & 1 deletion libs/design-system/src/app/MenuSectionLabelToggleAll.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { View16, ViewOff16 } from '@siafoundation/react-icons'
import { Button } from '../core/Button'
import { Label } from '../core/Label'
import { BaseMenuItem, MenuItemRightSlot } from '../core/Menu'
import { difference } from 'lodash-es'
import { difference } from '@technically/lodash'

export function MenuSectionLabelToggleAll({
label,
Expand Down
2 changes: 1 addition & 1 deletion libs/design-system/src/app/TransactionDetailsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Dialog } from '../core/Dialog'
import { getTitleId } from '../lib/utils'
import { Transaction } from '@siafoundation/types'
import { getTxTypeLabel, TxType } from '../lib/entityTypes'
import { upperFirst } from 'lodash-es'
import { upperFirst } from '@technically/lodash'

type Props = {
id: string
Expand Down
2 changes: 1 addition & 1 deletion libs/design-system/src/components/ChartTimeValue/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { ParentSize } from '@visx/responsive'
import { Button } from '../../core/Button'
import { Text } from '../../core/Text'
import { Tooltip as DsTooltip } from '../../core/Tooltip'
import { throttle } from 'lodash-es'
import { throttle } from '@technically/lodash'
import { AreaChart } from './AreaChart'
import { Reset16 } from '@siafoundation/react-icons'
import { Panel } from '../../core/Panel'
Expand Down
2 changes: 1 addition & 1 deletion libs/design-system/src/components/ChartXY/ChartXYGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ChartXYProps } from './useChartXY'
import { Separator } from '../../core/Separator'
import { PatternLines } from '@visx/pattern'
import { cx } from 'class-variance-authority'
import { groupBy } from 'lodash-es'
import { groupBy } from '@technically/lodash'
import { ChartConfig, ChartPoint } from './types'
import { humanDate } from '@siafoundation/units'

Expand Down
2 changes: 1 addition & 1 deletion libs/design-system/src/components/ChartXY/useChartXY.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { RenderTooltipGlyphProps } from '@visx/xychart/lib/components/Tooltip'
import { lightTheme, darkTheme } from './customTheme'
import { getChartComponents } from './getChartComponents'
import { useTheme } from 'next-themes'
import { omit } from 'lodash-es'
import { omit } from '@technically/lodash'
import {
ChartConfig,
ChartData,
Expand Down
2 changes: 1 addition & 1 deletion libs/design-system/src/components/DatumCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ValueSf } from '../components/ValueSf'
import { ValueCopyable } from '../components/ValueCopyable'
import { Tooltip } from '../core/Tooltip'
import BigNumber from 'bignumber.js'
import { upperFirst } from 'lodash-es'
import { upperFirst } from '@technically/lodash'
import { Panel } from '../core/Panel'
import { EntityType, getEntityTypeLabel } from '../lib/entityTypes'
import { cx } from 'class-variance-authority'
Expand Down
2 changes: 1 addition & 1 deletion libs/design-system/src/components/EntityListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '../lib/entityTypes'
import { humanNumber } from '@siafoundation/units'
import { formatDistance } from 'date-fns'
import { upperFirst } from 'lodash-es'
import { upperFirst } from '@technically/lodash'
import BigNumber from 'bignumber.js'
import { DotMark16 } from '@siafoundation/react-icons'
import { EntityListItemLayout } from './EntityListItemLayout'
Expand Down
2 changes: 1 addition & 1 deletion libs/design-system/src/components/EntityListSkeleton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Skeleton } from '../core/Skeleton'
import { times } from 'lodash-es'
import { times } from '@technically/lodash'
import { cx } from 'class-variance-authority'

export function EntityListSkeleton({ skeletonCount = 10 }) {
Expand Down
2 changes: 1 addition & 1 deletion libs/design-system/src/components/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Text } from '../core/Text'
import { useCallback } from 'react'
import { cx } from 'class-variance-authority'
import { CaretDown16, CaretUp16 } from '@siafoundation/react-icons'
import { times } from 'lodash-es'
import { times } from '@technically/lodash'

type Data = {
id: string
Expand Down
2 changes: 1 addition & 1 deletion libs/design-system/src/form/configurationFields.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import BigNumber from 'bignumber.js'
import { entries } from 'lodash-es'
import { entries } from '@technically/lodash'
import React, { MouseEvent, useCallback } from 'react'
import {
FieldErrors,
Expand Down
2 changes: 1 addition & 1 deletion libs/design-system/src/hooks/useSorting.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { intersection } from 'lodash-es'
import { intersection } from '@technically/lodash'
import { useCallback, useMemo } from 'react'
import useLocalStorageState from 'use-local-storage-state'

Expand Down
2 changes: 1 addition & 1 deletion libs/design-system/src/hooks/useTableState.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client'

import { difference, intersection, uniq } from 'lodash-es'
import { difference, intersection, uniq } from '@technically/lodash'
import { useCallback, useMemo } from 'react'
import useLocalStorageState from 'use-local-storage-state'
import { useSorting } from './useSorting'
Expand Down
Loading

0 comments on commit 027bce1

Please sign in to comment.