From 9fef1d1f4e6d8d24add6d118de1edbd4c26ab720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Wed, 23 Oct 2024 15:26:55 +0200 Subject: [PATCH] pl-hooks: Prefer kebab case for file names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- ...AccountLookup.ts => use-account-lookup.ts} | 2 +- ...ionship.ts => use-account-relationship.ts} | 0 .../{useAccount.ts => use-account.ts} | 4 ++-- .../{useInstance.ts => use-instance.ts} | 0 ...guages.ts => use-translation-languages.ts} | 2 +- .../markers/{useMarkers.ts => use-markers.ts} | 0 ...ation.ts => use-update-marker-mutation.ts} | 2 +- ...cationList.ts => use-notification-list.ts} | 2 +- ...useNotification.ts => use-notification.ts} | 10 ++++----- .../hooks/polls/{usePoll.ts => use-poll.ts} | 0 .../statuses/{useStatus.ts => use-status.ts} | 4 ++-- packages/pl-hooks/lib/importer.ts | 4 ++-- packages/pl-hooks/lib/main.ts | 22 +++++++++---------- .../{normalizeAccount.ts => account.ts} | 0 ...malizeNotifications.ts => notification.ts} | 0 .../{normalizeStatus.ts => status.ts} | 0 16 files changed, 26 insertions(+), 26 deletions(-) rename packages/pl-hooks/lib/hooks/accounts/{useAccountLookup.ts => use-account-lookup.ts} (93%) rename packages/pl-hooks/lib/hooks/accounts/{useAccountRelationship.ts => use-account-relationship.ts} (100%) rename packages/pl-hooks/lib/hooks/accounts/{useAccount.ts => use-account.ts} (94%) rename packages/pl-hooks/lib/hooks/instance/{useInstance.ts => use-instance.ts} (100%) rename packages/pl-hooks/lib/hooks/instance/{useTranslationLanguages.ts => use-translation-languages.ts} (96%) rename packages/pl-hooks/lib/hooks/markers/{useMarkers.ts => use-markers.ts} (100%) rename packages/pl-hooks/lib/hooks/markers/{useUpdateMarkerMutation.ts => use-update-marker-mutation.ts} (94%) rename packages/pl-hooks/lib/hooks/notifications/{useNotificationList.ts => use-notification-list.ts} (99%) rename packages/pl-hooks/lib/hooks/notifications/{useNotification.ts => use-notification.ts} (88%) rename packages/pl-hooks/lib/hooks/polls/{usePoll.ts => use-poll.ts} (100%) rename packages/pl-hooks/lib/hooks/statuses/{useStatus.ts => use-status.ts} (98%) rename packages/pl-hooks/lib/normalizers/{normalizeAccount.ts => account.ts} (100%) rename packages/pl-hooks/lib/normalizers/{normalizeNotifications.ts => notification.ts} (100%) rename packages/pl-hooks/lib/normalizers/{normalizeStatus.ts => status.ts} (100%) diff --git a/packages/pl-hooks/lib/hooks/accounts/useAccountLookup.ts b/packages/pl-hooks/lib/hooks/accounts/use-account-lookup.ts similarity index 93% rename from packages/pl-hooks/lib/hooks/accounts/useAccountLookup.ts rename to packages/pl-hooks/lib/hooks/accounts/use-account-lookup.ts index 4db410267..1184ea107 100644 --- a/packages/pl-hooks/lib/hooks/accounts/useAccountLookup.ts +++ b/packages/pl-hooks/lib/hooks/accounts/use-account-lookup.ts @@ -4,7 +4,7 @@ import { usePlHooksApiClient } from 'pl-hooks/contexts/api-client'; import { usePlHooksQueryClient } from 'pl-hooks/contexts/query-client'; import { importEntities } from 'pl-hooks/importer'; -import { useAccount, type UseAccountOpts } from './useAccount'; +import { useAccount, type UseAccountOpts } from './use-account'; const useAccountLookup = (acct?: string, opts: UseAccountOpts = {}) => { const { client } = usePlHooksApiClient(); diff --git a/packages/pl-hooks/lib/hooks/accounts/useAccountRelationship.ts b/packages/pl-hooks/lib/hooks/accounts/use-account-relationship.ts similarity index 100% rename from packages/pl-hooks/lib/hooks/accounts/useAccountRelationship.ts rename to packages/pl-hooks/lib/hooks/accounts/use-account-relationship.ts diff --git a/packages/pl-hooks/lib/hooks/accounts/useAccount.ts b/packages/pl-hooks/lib/hooks/accounts/use-account.ts similarity index 94% rename from packages/pl-hooks/lib/hooks/accounts/useAccount.ts rename to packages/pl-hooks/lib/hooks/accounts/use-account.ts index 89d3944c4..fe0572a5c 100644 --- a/packages/pl-hooks/lib/hooks/accounts/useAccount.ts +++ b/packages/pl-hooks/lib/hooks/accounts/use-account.ts @@ -3,9 +3,9 @@ import { useQuery } from '@tanstack/react-query'; import { usePlHooksApiClient } from 'pl-hooks/contexts/api-client'; import { queryClient, usePlHooksQueryClient } from 'pl-hooks/contexts/query-client'; import { importEntities } from 'pl-hooks/importer'; -import { type Account, normalizeAccount } from 'pl-hooks/normalizers/normalizeAccount'; +import { type Account, normalizeAccount } from 'pl-hooks/normalizers/account'; -import { useAccountRelationship } from './useAccountRelationship'; +import { useAccountRelationship } from './use-account-relationship'; import type { PlApiClient } from 'pl-api'; diff --git a/packages/pl-hooks/lib/hooks/instance/useInstance.ts b/packages/pl-hooks/lib/hooks/instance/use-instance.ts similarity index 100% rename from packages/pl-hooks/lib/hooks/instance/useInstance.ts rename to packages/pl-hooks/lib/hooks/instance/use-instance.ts diff --git a/packages/pl-hooks/lib/hooks/instance/useTranslationLanguages.ts b/packages/pl-hooks/lib/hooks/instance/use-translation-languages.ts similarity index 96% rename from packages/pl-hooks/lib/hooks/instance/useTranslationLanguages.ts rename to packages/pl-hooks/lib/hooks/instance/use-translation-languages.ts index cd1a713d2..28fb0bf9c 100644 --- a/packages/pl-hooks/lib/hooks/instance/useTranslationLanguages.ts +++ b/packages/pl-hooks/lib/hooks/instance/use-translation-languages.ts @@ -3,7 +3,7 @@ import { useQuery } from '@tanstack/react-query'; import { usePlHooksApiClient } from 'pl-hooks/contexts/api-client'; import { usePlHooksQueryClient } from 'pl-hooks/contexts/query-client'; -import { useInstance } from './useInstance'; +import { useInstance } from './use-instance'; const useTranslationLanguages = () => { const { client } = usePlHooksApiClient(); diff --git a/packages/pl-hooks/lib/hooks/markers/useMarkers.ts b/packages/pl-hooks/lib/hooks/markers/use-markers.ts similarity index 100% rename from packages/pl-hooks/lib/hooks/markers/useMarkers.ts rename to packages/pl-hooks/lib/hooks/markers/use-markers.ts diff --git a/packages/pl-hooks/lib/hooks/markers/useUpdateMarkerMutation.ts b/packages/pl-hooks/lib/hooks/markers/use-update-marker-mutation.ts similarity index 94% rename from packages/pl-hooks/lib/hooks/markers/useUpdateMarkerMutation.ts rename to packages/pl-hooks/lib/hooks/markers/use-update-marker-mutation.ts index 96d9bdb99..e83a76cad 100644 --- a/packages/pl-hooks/lib/hooks/markers/useUpdateMarkerMutation.ts +++ b/packages/pl-hooks/lib/hooks/markers/use-update-marker-mutation.ts @@ -3,7 +3,7 @@ import { useMutation } from '@tanstack/react-query'; import { usePlHooksApiClient } from 'pl-hooks/contexts/api-client'; import { usePlHooksQueryClient } from 'pl-hooks/contexts/query-client'; -import type { Timeline } from './useMarkers'; +import type { Timeline } from './use-markers'; import type { Marker } from 'pl-api'; const useUpdateMarkerMutation = (timeline: Timeline) => { diff --git a/packages/pl-hooks/lib/hooks/notifications/useNotificationList.ts b/packages/pl-hooks/lib/hooks/notifications/use-notification-list.ts similarity index 99% rename from packages/pl-hooks/lib/hooks/notifications/useNotificationList.ts rename to packages/pl-hooks/lib/hooks/notifications/use-notification-list.ts index 7d2d5ca8d..cb224d21a 100644 --- a/packages/pl-hooks/lib/hooks/notifications/useNotificationList.ts +++ b/packages/pl-hooks/lib/hooks/notifications/use-notification-list.ts @@ -3,7 +3,7 @@ import { InfiniteData, useInfiniteQuery, UseInfiniteQueryResult } from '@tanstac import { usePlHooksApiClient } from 'pl-hooks/contexts/api-client'; import { queryClient, usePlHooksQueryClient } from 'pl-hooks/contexts/query-client'; import { importEntities } from 'pl-hooks/importer'; -import { deduplicateNotifications } from 'pl-hooks/normalizers/normalizeNotifications'; +import { deduplicateNotifications } from 'pl-hooks/normalizers/notification'; import { flattenPages } from 'pl-hooks/utils/queries'; import type { Notification as BaseNotification, PaginatedResponse, PlApiClient } from 'pl-api'; diff --git a/packages/pl-hooks/lib/hooks/notifications/useNotification.ts b/packages/pl-hooks/lib/hooks/notifications/use-notification.ts similarity index 88% rename from packages/pl-hooks/lib/hooks/notifications/useNotification.ts rename to packages/pl-hooks/lib/hooks/notifications/use-notification.ts index d03d0b961..a70c6db36 100644 --- a/packages/pl-hooks/lib/hooks/notifications/useNotification.ts +++ b/packages/pl-hooks/lib/hooks/notifications/use-notification.ts @@ -2,13 +2,13 @@ import { useQuery } from '@tanstack/react-query'; import { usePlHooksApiClient } from 'pl-hooks/contexts/api-client'; import { queryClient, usePlHooksQueryClient } from 'pl-hooks/contexts/query-client'; -import { type NormalizedNotification, normalizeNotification } from 'pl-hooks/normalizers/normalizeNotifications'; +import { type NormalizedNotification, normalizeNotification } from 'pl-hooks/normalizers/notification'; -import { useAccount } from '../accounts/useAccount'; -import { useStatus } from '../statuses/useStatus'; +import { useAccount } from '../accounts/use-account'; +import { useStatus } from '../statuses/use-status'; -import type { Account } from 'pl-hooks/normalizers/normalizeAccount'; -import type { Status } from 'pl-hooks/normalizers/normalizeStatus'; +import type { Account } from 'pl-hooks/normalizers/account'; +import type { Status } from 'pl-hooks/normalizers/status'; const getNotificationStatusId = (n: NormalizedNotification) => { if (['mention', 'status', 'reblog', 'favourite', 'poll', 'update', 'emoji_reaction', 'event_reminder', 'participation_accepted', 'participation_request'].includes(n.type)) diff --git a/packages/pl-hooks/lib/hooks/polls/usePoll.ts b/packages/pl-hooks/lib/hooks/polls/use-poll.ts similarity index 100% rename from packages/pl-hooks/lib/hooks/polls/usePoll.ts rename to packages/pl-hooks/lib/hooks/polls/use-poll.ts diff --git a/packages/pl-hooks/lib/hooks/statuses/useStatus.ts b/packages/pl-hooks/lib/hooks/statuses/use-status.ts similarity index 98% rename from packages/pl-hooks/lib/hooks/statuses/useStatus.ts rename to packages/pl-hooks/lib/hooks/statuses/use-status.ts index 36698b075..6c1634e19 100644 --- a/packages/pl-hooks/lib/hooks/statuses/useStatus.ts +++ b/packages/pl-hooks/lib/hooks/statuses/use-status.ts @@ -3,9 +3,9 @@ import { useQueries, useQuery } from '@tanstack/react-query'; import { usePlHooksApiClient } from 'pl-hooks/contexts/api-client'; import { queryClient, usePlHooksQueryClient } from 'pl-hooks/contexts/query-client'; import { importEntities } from 'pl-hooks/importer'; -import { type Account, normalizeAccount } from 'pl-hooks/normalizers/normalizeAccount'; +import { type Account, normalizeAccount } from 'pl-hooks/normalizers/account'; -import { normalizeStatus, type Status } from '../../normalizers/normalizeStatus'; +import { normalizeStatus, type Status } from '../../normalizers/status'; // const toServerSideType = (columnType: string): Filter['context'][0] => { // switch (columnType) { diff --git a/packages/pl-hooks/lib/importer.ts b/packages/pl-hooks/lib/importer.ts index a203c98aa..cd1bb4131 100644 --- a/packages/pl-hooks/lib/importer.ts +++ b/packages/pl-hooks/lib/importer.ts @@ -1,7 +1,7 @@ import { queryClient } from 'pl-hooks/contexts/query-client'; -import { type DeduplicatedNotification, type NormalizedNotification, normalizeNotification } from './normalizers/normalizeNotifications'; -import { normalizeStatus, type Status } from './normalizers/normalizeStatus'; +import { type DeduplicatedNotification, type NormalizedNotification, normalizeNotification } from './normalizers/notification'; +import { normalizeStatus, type Status } from './normalizers/status'; import type { Account as BaseAccount, diff --git a/packages/pl-hooks/lib/main.ts b/packages/pl-hooks/lib/main.ts index 8ba82bc4f..859227b4e 100644 --- a/packages/pl-hooks/lib/main.ts +++ b/packages/pl-hooks/lib/main.ts @@ -1,16 +1,16 @@ export * from './contexts/api-client'; export * from './contexts/query-client'; -export * from './hooks/accounts/useAccount'; -export * from './hooks/accounts/useAccountLookup'; -export * from './hooks/accounts/useAccountRelationship'; -export * from './hooks/instance/useInstance'; -export * from './hooks/instance/useTranslationLanguages'; -export * from './hooks/markers/useMarkers'; -export * from './hooks/markers/useUpdateMarkerMutation'; -export * from './hooks/notifications/useNotification'; -export * from './hooks/notifications/useNotificationList'; -export * from './hooks/polls/usePoll'; -export * from './hooks/statuses/useStatus'; +export * from './hooks/accounts/use-account'; +export * from './hooks/accounts/use-account-lookup'; +export * from './hooks/accounts/use-account-relationship'; +export * from './hooks/instance/use-instance'; +export * from './hooks/instance/use-translation-languages'; +export * from './hooks/markers/use-markers'; +export * from './hooks/markers/use-update-marker-mutation'; +export * from './hooks/notifications/use-notification'; +export * from './hooks/notifications/use-notification-list'; +export * from './hooks/polls/use-poll'; +export * from './hooks/statuses/use-status'; export * from './importer'; diff --git a/packages/pl-hooks/lib/normalizers/normalizeAccount.ts b/packages/pl-hooks/lib/normalizers/account.ts similarity index 100% rename from packages/pl-hooks/lib/normalizers/normalizeAccount.ts rename to packages/pl-hooks/lib/normalizers/account.ts diff --git a/packages/pl-hooks/lib/normalizers/normalizeNotifications.ts b/packages/pl-hooks/lib/normalizers/notification.ts similarity index 100% rename from packages/pl-hooks/lib/normalizers/normalizeNotifications.ts rename to packages/pl-hooks/lib/normalizers/notification.ts diff --git a/packages/pl-hooks/lib/normalizers/normalizeStatus.ts b/packages/pl-hooks/lib/normalizers/status.ts similarity index 100% rename from packages/pl-hooks/lib/normalizers/normalizeStatus.ts rename to packages/pl-hooks/lib/normalizers/status.ts