From 44eafe69acdc40d8517276e881009011ca88410f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 21:13:13 -0800 Subject: [PATCH] fix(deps): update dependency date-fns to v3 (#3619) * fix(deps): update dependency date-fns to v3 * fix(deps): update usage of date-fns format --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Gabe Kangas --- web/components/admin/BannedIPsTable.tsx | 2 +- web/components/admin/Chart.tsx | 2 +- web/components/admin/LogTable.tsx | 2 +- web/components/admin/NewsFeed.tsx | 2 +- web/components/admin/UserPopover.tsx | 3 +- web/components/admin/UserTable.tsx | 2 +- .../ChatModerationDetailsModal.tsx | 2 +- .../ui/OfflineBanner/OfflineBanner.tsx | 2 +- web/components/ui/Statusbar/Statusbar.tsx | 3 +- web/package-lock.json | 33 ++++++++++++------- web/package.json | 2 +- web/pages/admin/access-tokens.tsx | 2 +- web/pages/admin/chat/messages.tsx | 2 +- web/pages/admin/federation/actions.tsx | 2 +- web/pages/admin/federation/followers.tsx | 2 +- 15 files changed, 35 insertions(+), 28 deletions(-) diff --git a/web/components/admin/BannedIPsTable.tsx b/web/components/admin/BannedIPsTable.tsx index 3de714367..347f72866 100644 --- a/web/components/admin/BannedIPsTable.tsx +++ b/web/components/admin/BannedIPsTable.tsx @@ -1,6 +1,6 @@ import { Table, Button } from 'antd'; -import format from 'date-fns/format'; import { SortOrder } from 'antd/lib/table/interface'; +import { format } from 'date-fns'; import React, { FC } from 'react'; import dynamic from 'next/dynamic'; import { User } from '../../types/chat'; diff --git a/web/components/admin/Chart.tsx b/web/components/admin/Chart.tsx index 7b6c08669..63c490b08 100644 --- a/web/components/admin/Chart.tsx +++ b/web/components/admin/Chart.tsx @@ -1,4 +1,4 @@ -import format from 'date-fns/format'; +import { format } from 'date-fns'; import { FC, useRef } from 'react'; import { DownloadOutlined } from '@ant-design/icons'; diff --git a/web/components/admin/LogTable.tsx b/web/components/admin/LogTable.tsx index aad62658b..7c5ec6e68 100644 --- a/web/components/admin/LogTable.tsx +++ b/web/components/admin/LogTable.tsx @@ -2,7 +2,7 @@ import React, { FC, useState } from 'react'; import { Table, Tag, Typography } from 'antd'; import Linkify from 'react-linkify'; import { SortOrder, TablePaginationConfig } from 'antd/lib/table/interface'; -import format from 'date-fns/format'; +import { format } from 'date-fns'; const { Title } = Typography; diff --git a/web/components/admin/NewsFeed.tsx b/web/components/admin/NewsFeed.tsx index 02202b44f..f78e683a6 100644 --- a/web/components/admin/NewsFeed.tsx +++ b/web/components/admin/NewsFeed.tsx @@ -2,7 +2,7 @@ /* eslint-disable react/no-danger */ import React, { useState, useEffect, FC } from 'react'; import { Collapse, Typography, Skeleton } from 'antd'; -import format from 'date-fns/format'; +import { format } from 'date-fns'; import { fetchExternalData } from '../../utils/apis'; diff --git a/web/components/admin/UserPopover.tsx b/web/components/admin/UserPopover.tsx index a2ad3150b..27b5a3ccc 100644 --- a/web/components/admin/UserPopover.tsx +++ b/web/components/admin/UserPopover.tsx @@ -2,8 +2,7 @@ import { useState, ReactNode, FC } from 'react'; import { Divider, Modal, Typography, Row, Col, Space, Tooltip } from 'antd'; -import formatDistanceToNow from 'date-fns/formatDistanceToNow'; -import format from 'date-fns/format'; +import { format, formatDistanceToNow } from 'date-fns'; import { uniq } from 'lodash'; import { BanUserButton } from './BanUserButton'; diff --git a/web/components/admin/UserTable.tsx b/web/components/admin/UserTable.tsx index 8a6e54b41..b5d92e4a3 100644 --- a/web/components/admin/UserTable.tsx +++ b/web/components/admin/UserTable.tsx @@ -1,5 +1,5 @@ import { Table } from 'antd'; -import format from 'date-fns/format'; +import { format } from 'date-fns'; import { SortOrder } from 'antd/lib/table/interface'; import { FC } from 'react'; import { User } from '../../types/chat'; diff --git a/web/components/chat/ChatModerationDetailsModal/ChatModerationDetailsModal.tsx b/web/components/chat/ChatModerationDetailsModal/ChatModerationDetailsModal.tsx index 5bde45f73..5e9023c94 100644 --- a/web/components/chat/ChatModerationDetailsModal/ChatModerationDetailsModal.tsx +++ b/web/components/chat/ChatModerationDetailsModal/ChatModerationDetailsModal.tsx @@ -1,6 +1,6 @@ import { Button, Col, Collapse, Row, Spin, Table, Tag } from 'antd'; import { FC, useEffect, useState } from 'react'; -import format from 'date-fns/format'; +import { format } from 'date-fns'; import { ColumnsType } from 'antd/lib/table'; import dynamic from 'next/dynamic'; import { ErrorBoundary } from 'react-error-boundary'; diff --git a/web/components/ui/OfflineBanner/OfflineBanner.tsx b/web/components/ui/OfflineBanner/OfflineBanner.tsx index a874366a5..49a7022e3 100644 --- a/web/components/ui/OfflineBanner/OfflineBanner.tsx +++ b/web/components/ui/OfflineBanner/OfflineBanner.tsx @@ -2,7 +2,7 @@ /* eslint-disable jsx-a11y/click-events-have-key-events */ import { Divider } from 'antd'; import { FC } from 'react'; -import formatDistanceToNow from 'date-fns/formatDistanceToNow'; +import { formatDistanceToNow } from 'date-fns'; import dynamic from 'next/dynamic'; import classNames from 'classnames'; import styles from './OfflineBanner.module.scss'; diff --git a/web/components/ui/Statusbar/Statusbar.tsx b/web/components/ui/Statusbar/Statusbar.tsx index 66c86578c..f3b612feb 100644 --- a/web/components/ui/Statusbar/Statusbar.tsx +++ b/web/components/ui/Statusbar/Statusbar.tsx @@ -1,5 +1,4 @@ -import formatDistanceToNow from 'date-fns/formatDistanceToNow'; -import intervalToDuration from 'date-fns/intervalToDuration'; +import { intervalToDuration, formatDistanceToNow } from 'date-fns'; import { FC, useEffect, useState } from 'react'; import dynamic from 'next/dynamic'; import classNames from 'classnames'; diff --git a/web/package-lock.json b/web/package-lock.json index 7b13edf1f..4f60c32f8 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -24,7 +24,7 @@ "autoprefixer": "^10.4.14", "chart.js": "^4.2.0", "classnames": "2.5.1", - "date-fns": "^2.29.3", + "date-fns": "^3.0.0", "graphemer": "^1.4.0", "interweave": "^13.0.0", "interweave-autolink": "^5.1.0", @@ -14161,18 +14161,12 @@ } }, "node_modules/date-fns": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", - "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", - "dependencies": { - "@babel/runtime": "^7.21.0" - }, - "engines": { - "node": ">=0.11" - }, + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-3.3.1.tgz", + "integrity": "sha512-y8e109LYGgoQDveiEBD3DYXKba1jWf5BA8YU1FL5Tvm0BTdEfy54WLCwnuYWZNnzzvALy/QQ4Hov+Q9RVRv+Zw==", "funding": { - "type": "opencollective", - "url": "https://opencollective.com/date-fns" + "type": "github", + "url": "https://github.com/sponsors/kossnocorp" } }, "node_modules/dayjs": { @@ -30712,6 +30706,21 @@ "react-dom": ">=16.9.0" } }, + "node_modules/rc-picker/node_modules/date-fns": { + "version": "2.30.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", + "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "dependencies": { + "@babel/runtime": "^7.21.0" + }, + "engines": { + "node": ">=0.11" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/date-fns" + } + }, "node_modules/rc-progress": { "version": "3.4.2", "resolved": "https://registry.npmjs.org/rc-progress/-/rc-progress-3.4.2.tgz", diff --git a/web/package.json b/web/package.json index 7ab2ed253..c08874748 100644 --- a/web/package.json +++ b/web/package.json @@ -30,7 +30,7 @@ "autoprefixer": "^10.4.14", "chart.js": "^4.2.0", "classnames": "2.5.1", - "date-fns": "^2.29.3", + "date-fns": "^3.0.0", "graphemer": "^1.4.0", "interweave": "^13.0.0", "interweave-autolink": "^5.1.0", diff --git a/web/pages/admin/access-tokens.tsx b/web/pages/admin/access-tokens.tsx index 2ba93afa8..ff5ed93c4 100644 --- a/web/pages/admin/access-tokens.tsx +++ b/web/pages/admin/access-tokens.tsx @@ -13,7 +13,7 @@ import { Tooltip, } from 'antd'; -import format from 'date-fns/format'; +import { format } from 'date-fns'; import dynamic from 'next/dynamic'; import { diff --git a/web/pages/admin/chat/messages.tsx b/web/pages/admin/chat/messages.tsx index 2ada49cca..288cac8da 100644 --- a/web/pages/admin/chat/messages.tsx +++ b/web/pages/admin/chat/messages.tsx @@ -2,7 +2,7 @@ import React, { useState, useEffect, ReactElement } from 'react'; import { Table, Typography, Button } from 'antd'; import classNames from 'classnames'; import { ColumnsType } from 'antd/es/table'; -import format from 'date-fns/format'; +import { format } from 'date-fns'; import dynamic from 'next/dynamic'; import { MessageType } from '../../../types/chat'; diff --git a/web/pages/admin/federation/actions.tsx b/web/pages/admin/federation/actions.tsx index 2a00e876a..befcfdd01 100644 --- a/web/pages/admin/federation/actions.tsx +++ b/web/pages/admin/federation/actions.tsx @@ -1,7 +1,7 @@ import React, { ReactElement, useEffect, useState } from 'react'; import { Table, Typography } from 'antd'; import { ColumnsType } from 'antd/lib/table/interface'; -import format from 'date-fns/format'; +import { format } from 'date-fns'; import { FEDERATION_ACTIONS, fetchData } from '../../../utils/apis'; import { isEmptyObject } from '../../../utils/format'; diff --git a/web/pages/admin/federation/followers.tsx b/web/pages/admin/federation/followers.tsx index a01e75215..c38848c4b 100644 --- a/web/pages/admin/federation/followers.tsx +++ b/web/pages/admin/federation/followers.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState, useContext, ReactElement } from 'react'; import { Table, Avatar, Button, Tabs } from 'antd'; import { ColumnsType, SortOrder } from 'antd/lib/table/interface'; -import format from 'date-fns/format'; +import { format } from 'date-fns'; import dynamic from 'next/dynamic'; import { ServerStatusContext } from '../../../utils/server-status-context'; import {