Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Last part of removing barrel files (#39957)

Joshen Limec2733209935
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Bucket.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Bucket.tsx
index d2d17faa3b8..b366b1f17e4 100644
--- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Bucket.tsx
+++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Bucket.tsx
@@ -8,7 +8,7 @@ import { DOCS_RESOURCE_CONTENT } from '../ProjectAPIDocs.constants'
import ResourceContent from '../ResourceContent'
import type { ContentProps } from './Content.types'
-const Bucket = ({ language, apikey, endpoint }: ContentProps) => {
+export const Bucket = ({ language, apikey, endpoint }: ContentProps) => {
const { ref } = useParams()
const snap = useAppStateSnapshot()
const { data } = useBucketsQuery({ projectRef: ref })
@@ -106,5 +106,3 @@ const Bucket = ({ language, apikey, endpoint }: ContentProps) => {
</div>
)
}
-
-export default Bucket
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/EdgeFunction.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/EdgeFunction.tsx
index 9ff1d705b45..89079425beb 100644
--- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/EdgeFunction.tsx
+++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/EdgeFunction.tsx
@@ -6,7 +6,7 @@ import { DOCS_RESOURCE_CONTENT } from '../ProjectAPIDocs.constants'
import ResourceContent from '../ResourceContent'
import type { ContentProps } from './Content.types'
-const Bucket = ({ language, apikey = 'API_KEY', endpoint }: ContentProps) => {
+export const EdgeFunction = ({ language, apikey = 'API_KEY', endpoint }: ContentProps) => {
const { ref } = useParams()
const snap = useAppStateSnapshot()
const { data } = useEdgeFunctionsQuery({ projectRef: ref })
@@ -37,5 +37,3 @@ const Bucket = ({ language, apikey = 'API_KEY', endpoint }: ContentProps) => {
</div>
)
}
-
-export default Bucket
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/EdgeFunctions.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/EdgeFunctions.tsx
index c33ccd8a267..4d2e542aa0c 100644
--- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/EdgeFunctions.tsx
+++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/EdgeFunctions.tsx
@@ -2,7 +2,7 @@ import ContentSnippet from '../ContentSnippet'
import { DOCS_CONTENT } from '../ProjectAPIDocs.constants'
import type { ContentProps } from './Content.types'
-const EdgeFunctions = ({ language }: ContentProps) => {
+export const EdgeFunctions = ({ language }: ContentProps) => {
return (
<>
<ContentSnippet selectedLanguage={language} snippet={DOCS_CONTENT.edgeFunctions} />
@@ -12,5 +12,3 @@ const EdgeFunctions = ({ language }: ContentProps) => {
</>
)
}
-
-export default EdgeFunctions
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entities.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entities.tsx
index 3fc51570a93..53c09429b62 100644
--- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entities.tsx
+++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entities.tsx
@@ -12,7 +12,7 @@ import ContentSnippet from '../ContentSnippet'
import { DOCS_CONTENT } from '../ProjectAPIDocs.constants'
import type { ContentProps } from './Content.types'
-const Entities = ({ language }: ContentProps) => {
+export const Entities = ({ language }: ContentProps) => {
const { ref } = useParams()
const [isGeneratingTypes, setIsGeneratingTypes] = useState(false)
@@ -62,5 +62,3 @@ const Entities = ({ language }: ContentProps) => {
</>
)
}
-
-export default Entities
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entity.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entity.tsx
index 1cd6064f7fb..ba969463c82 100644
--- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entity.tsx
+++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Entity.tsx
@@ -30,7 +30,7 @@ function getColumnType(type: string, format: string) {
}
}
-const Entity = ({ language, apikey = '', endpoint = '' }: ContentProps) => {
+export const Entity = ({ language, apikey = '', endpoint = '' }: ContentProps) => {
const { ref } = useParams()
const snap = useAppStateSnapshot()
const resource = snap.activeDocsSection[1]
@@ -144,5 +144,3 @@ const Entity = ({ language, apikey = '', endpoint = '' }: ContentProps) => {
</div>
)
}
-
-export default Entity
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Introduction.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Introduction.tsx
index 38528091254..cd12e9babf8 100644
--- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Introduction.tsx
+++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Introduction.tsx
@@ -11,7 +11,7 @@ import ContentSnippet from '../ContentSnippet'
import { DOCS_CONTENT } from '../ProjectAPIDocs.constants'
import type { ContentProps } from './Content.types'
-const Introduction = ({ showKeys, language, apikey, endpoint }: ContentProps) => {
+export const Introduction = ({ showKeys, language, apikey, endpoint }: ContentProps) => {
const { ref } = useParams()
const { data: apiKeys } = useAPIKeysQuery({ projectRef: ref })
const { data } = useProjectSettingsV2Query({ projectRef: ref })
@@ -139,5 +139,3 @@ const Introduction = ({ showKeys, language, apikey, endpoint }: ContentProps) =>
</>
)
}
-
-export default Introduction
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Realtime.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Realtime.tsx
index e628ddca522..9fe9c40fcf5 100644
--- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Realtime.tsx
+++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Realtime.tsx
@@ -2,7 +2,7 @@ import ContentSnippet from '../ContentSnippet'
import { DOCS_CONTENT } from '../ProjectAPIDocs.constants'
import type { ContentProps } from './Content.types'
-const Realtime = ({ language }: ContentProps) => {
+export const Realtime = ({ language }: ContentProps) => {
return (
<>
<ContentSnippet selectedLanguage={language} snippet={DOCS_CONTENT.realtime} />
@@ -13,5 +13,3 @@ const Realtime = ({ language }: ContentProps) => {
</>
)
}
-
-export default Realtime
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Storage.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Storage.tsx
index 18f7b851799..a8b754ec407 100644
--- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/Storage.tsx
+++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/Storage.tsx
@@ -2,12 +2,10 @@ import ContentSnippet from '../ContentSnippet'
import { DOCS_CONTENT } from '../ProjectAPIDocs.constants'
import type { ContentProps } from './Content.types'
-const Storage = ({ language }: ContentProps) => {
+export const Storage = ({ language }: ContentProps) => {
return (
<>
<ContentSnippet selectedLanguage={language} snippet={DOCS_CONTENT.storage} />
</>
)
}
-
-export default Storage
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/StoredProcedures.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/StoredProcedures.tsx
index 20ef8e3767c..46828c25039 100644
--- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/StoredProcedures.tsx
+++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/StoredProcedures.tsx
@@ -2,7 +2,7 @@ import ContentSnippet from '../ContentSnippet'
import { DOCS_CONTENT } from '../ProjectAPIDocs.constants'
import type { ContentProps } from './Content.types'
-const StoredProcedures = ({ language }: ContentProps) => {
+export const StoredProcedures = ({ language }: ContentProps) => {
return (
<>
<ContentSnippet
@@ -12,5 +12,3 @@ const StoredProcedures = ({ language }: ContentProps) => {
</>
)
}
-
-export default StoredProcedures
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/UserManagement.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/Content/UserManagement.tsx
index e4bc2e18795..0c502381fca 100644
--- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/UserManagement.tsx
+++ b/apps/studio/components/interfaces/ProjectAPIDocs/Content/UserManagement.tsx
@@ -3,7 +3,7 @@ import ContentSnippet from '../ContentSnippet'
import { DOCS_CONTENT } from '../ProjectAPIDocs.constants'
import type { ContentProps } from './Content.types'
-const UserManagement = ({ language, apikey, endpoint }: ContentProps) => {
+export const UserManagement = ({ language, apikey, endpoint }: ContentProps) => {
const { authenticationSignInProviders } = useIsFeatureEnabled([
'authentication:sign_in_providers',
])
@@ -87,5 +87,3 @@ const UserManagement = ({ language, apikey, endpoint }: ContentProps) => {
</>
)
}
-
-export default UserManagement
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/Content/index.ts b/apps/studio/components/interfaces/ProjectAPIDocs/Content/index.ts
deleted file mode 100644
index 5eff8ef2ab3..00000000000
--- a/apps/studio/components/interfaces/ProjectAPIDocs/Content/index.ts
+++ /dev/null
@@ -1,12 +0,0 @@
-export { default as EdgeFunctions } from './EdgeFunctions'
-export { default as Entities } from './Entities'
-export { default as Introduction } from './Introduction'
-export { default as Realtime } from './Realtime'
-export { default as Storage } from './Storage'
-export { default as StoredProcedures } from './StoredProcedures'
-export { default as UserManagement } from './UserManagement'
-
-export { default as Bucket } from './Bucket'
-export { default as EdgeFunction } from './EdgeFunction'
-export { default as Entity } from './Entity'
-export { RPC } from './RPC'
diff --git a/apps/studio/components/interfaces/ProjectAPIDocs/ProjectAPIDocs.tsx b/apps/studio/components/interfaces/ProjectAPIDocs/ProjectAPIDocs.tsx
index 4ec31a5b9d5..ac99c9d48a2 100644
--- a/apps/studio/components/interfaces/ProjectAPIDocs/ProjectAPIDocs.tsx
+++ b/apps/studio/components/interfaces/ProjectAPIDocs/ProjectAPIDocs.tsx
@@ -6,19 +6,17 @@ import { getKeys, useAPIKeysQuery } from 'data/api-keys/api-keys-query'
import { useProjectSettingsV2Query } from 'data/config/project-settings-v2-query'
import { useCustomDomainsQuery } from 'data/custom-domains/custom-domains-query'
import { useAppStateSnapshot } from 'state/app-state'
-import {
- Bucket,
- EdgeFunction,
- EdgeFunctions,
- Entities,
- Entity,
- Introduction,
- RPC,
- Realtime,
- Storage,
- StoredProcedures,
- UserManagement,
-} from './Content'
+import { Bucket } from './Content/Bucket'
+import { EdgeFunction } from './Content/EdgeFunction'
+import { EdgeFunctions } from './Content/EdgeFunctions'
+import { Entities } from './Content/Entities'
+import { Entity } from './Content/Entity'
+import { Introduction } from './Content/Introduction'
+import { Realtime } from './Content/Realtime'
+import { RPC } from './Content/RPC'
+import { Storage } from './Content/Storage'
+import { StoredProcedures } from './Content/StoredProcedures'
+import { UserManagement } from './Content/UserManagement'
import FirstLevelNav from './FirstLevelNav'
import LanguageSelector from './LanguageSelector'
import SecondLevelNav from './SecondLevelNav'
@@ -34,7 +32,7 @@ import SecondLevelNav from './SecondLevelNav'
* - GraphiQL needs a better home, cannot be placed under Database as its "API"
*/
-const ProjectAPIDocs = () => {
+export const ProjectAPIDocs = () => {
const { ref } = useParams()
const snap = useAppStateSnapshot()
const isIntroduction =
@@ -154,5 +152,3 @@ const ProjectAPIDocs = () => {
</SidePanel>
)
}
-
-export default ProjectAPIDocs
diff --git a/apps/studio/components/interfaces/Reports/GridResize.tsx b/apps/studio/components/interfaces/Reports/GridResize.tsx
index 4283e1658e9..f4634f74834 100644
--- a/apps/studio/components/interfaces/Reports/GridResize.tsx
+++ b/apps/studio/components/interfaces/Reports/GridResize.tsx
@@ -13,8 +13,8 @@ import {
import { useSendEventMutation } from 'data/telemetry/send-event-mutation'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { uuidv4 } from 'lib/helpers'
import { useProfile } from 'lib/profile'
-import uuidv4 from 'lib/uuid'
import { Dashboards } from 'types'
import { createSqlSnippetSkeletonV2 } from '../SQLEditor/SQLEditor.utils'
import { ChartConfig } from '../SQLEditor/UtilityPanel/ChartConfig'
diff --git a/apps/studio/components/interfaces/Settings/General/ComplianceConfig/ProjectComplianceMode.tsx b/apps/studio/components/interfaces/Settings/General/ComplianceConfig/ProjectComplianceMode.tsx
index 6adb08bc153..5f5f30c5df9 100644
--- a/apps/studio/components/interfaces/Settings/General/ComplianceConfig/ProjectComplianceMode.tsx
+++ b/apps/studio/components/interfaces/Settings/General/ComplianceConfig/ProjectComplianceMode.tsx
@@ -17,7 +17,7 @@ import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { DOCS_URL } from 'lib/constants'
import { Switch, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
-const ComplianceConfig = () => {
+export const ComplianceConfig = () => {
const { ref } = useParams()
const { data: project } = useSelectedProjectQuery()
const [isSensitive, setIsSensitive] = useState(false)
@@ -125,5 +125,3 @@ const ComplianceConfig = () => {
</div>
)
}
-
-export default ComplianceConfig
diff --git a/apps/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectButton.tsx b/apps/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectButton.tsx
index d753a214cec..11031ac0335 100644
--- a/apps/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectButton.tsx
+++ b/apps/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectButton.tsx
@@ -10,7 +10,7 @@ export interface DeleteProjectButtonProps {
type?: 'danger' | 'default'
}
-const DeleteProjectButton = ({ type = 'danger' }: DeleteProjectButtonProps) => {
+export const DeleteProjectButton = ({ type = 'danger' }: DeleteProjectButtonProps) => {
const { data: project } = useSelectedProjectQuery()
const [isOpen, setIsOpen] = useState(false)
@@ -39,5 +39,3 @@ const DeleteProjectButton = ({ type = 'danger' }: DeleteProjectButtonProps) => {
</>
)
}
-
-export default DeleteProjectButton
diff --git a/apps/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectPanel.tsx b/apps/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectPanel.tsx
index da7c163192a..2e4d2f5cdf8 100644
--- a/apps/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectPanel.tsx
+++ b/apps/studio/components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectPanel.tsx
@@ -2,7 +2,7 @@ import { FormHeader } from 'components/ui/Forms/FormHeader'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { Alert_Shadcn_, AlertDescription_Shadcn_, AlertTitle_Shadcn_, CriticalIcon } from 'ui'
-import DeleteProjectButton from './DeleteProjectButton'
+import { DeleteProjectButton } from './DeleteProjectButton'
export const DeleteProjectPanel = () => {
const { data: project } = useSelectedProjectQuery()
diff --git a/apps/studio/components/interfaces/Settings/General/General.tsx b/apps/studio/components/interfaces/Settings/General/General.tsx
index fb8b87e4d54..a7c259a7d2a 100644
--- a/apps/studio/components/interfaces/Settings/General/General.tsx
+++ b/apps/studio/components/interfaces/Settings/General/General.tsx
@@ -27,7 +27,7 @@ import {
import PauseProjectButton from './Infrastructure/PauseProjectButton'
import RestartServerButton from './Infrastructure/RestartServerButton'
-const General = () => {
+export const General = () => {
const { data: project } = useSelectedProjectQuery()
const { data: organization } = useSelectedOrganizationQuery()
@@ -199,5 +199,3 @@ const General = () => {
</div>
)
}
-
-export default General
diff --git a/apps/studio/components/interfaces/Settings/General/TransferProjectPanel/TransferProjectButton.tsx b/apps/studio/components/interfaces/Settings/General/TransferProjectPanel/TransferProjectButton.tsx
index e683228a12b..abfea702cda 100644
--- a/apps/studio/components/interfaces/Settings/General/TransferProjectPanel/TransferProjectButton.tsx
+++ b/apps/studio/components/interfaces/Settings/General/TransferProjectPanel/TransferProjectButton.tsx
@@ -15,7 +15,7 @@ import { DOCS_URL } from 'lib/constants'
import { Button, InfoIcon, Listbox, Loading, Modal, WarningIcon } from 'ui'
import { Admonition } from 'ui-patterns'
-const TransferProjectButton = () => {
+export const TransferProjectButton = () => {
const { data: project } = useSelectedProjectQuery()
const projectRef = project?.ref
const projectOrgId = project?.organization_id
@@ -291,5 +291,3 @@ const TransferProjectButton = () => {
</>
)
}
-
-export default TransferProjectButton
diff --git a/apps/studio/components/interfaces/Settings/General/TransferProjectPanel/TransferProjectPanel.tsx b/apps/studio/components/interfaces/Settings/General/TransferProjectPanel/TransferProjectPanel.tsx
index 268a142522c..77935542725 100644
--- a/apps/studio/components/interfaces/Settings/General/TransferProjectPanel/TransferProjectPanel.tsx
+++ b/apps/studio/components/interfaces/Settings/General/TransferProjectPanel/TransferProjectPanel.tsx
@@ -3,9 +3,9 @@ import { Truck } from 'lucide-react'
import { FormHeader } from 'components/ui/Forms/FormHeader'
import Panel from 'components/ui/Panel'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
-import TransferProjectButton from './TransferProjectButton'
+import { TransferProjectButton } from './TransferProjectButton'
-const TransferProjectPanel = () => {
+export const TransferProjectPanel = () => {
const { data: project } = useSelectedProjectQuery()
if (project === undefined) return null
@@ -38,5 +38,3 @@ const TransferProjectPanel = () => {
</section>
)
}
-
-export default TransferProjectPanel
diff --git a/apps/studio/components/interfaces/Settings/General/index.ts b/apps/studio/components/interfaces/Settings/General/index.ts
deleted file mode 100644
index daebfc2f9e4..00000000000
--- a/apps/studio/components/interfaces/Settings/General/index.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-export { default as ComplianceConfig } from './ComplianceConfig/ProjectComplianceMode'
-export { CustomDomainConfig } from './CustomDomainConfig/CustomDomainConfig'
-export { default as DeleteProjectButton } from './DeleteProjectPanel/DeleteProjectButton'
-export { default as General } from './General'
-export { default as TransferProjectButton } from './TransferProjectPanel/TransferProjectButton'
-export { default as TransferProjectPanel } from './TransferProjectPanel/TransferProjectPanel'
diff --git a/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx b/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx
index 68d6e88b359..507121413df 100644
--- a/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx
+++ b/apps/studio/components/layouts/ProjectLayout/ProjectLayout.tsx
@@ -1,12 +1,13 @@
-import { AnimatePresence, motion } from 'framer-motion'
import Head from 'next/head'
import { useRouter } from 'next/router'
import { forwardRef, Fragment, PropsWithChildren, ReactNode, useEffect, useState } from 'react'
-import { useParams, useFlag } from 'common'
+
+import { useFlag, useParams } from 'common'
import { CreateBranchModal } from 'components/interfaces/BranchManagement/CreateBranchModal'
-import ProjectAPIDocs from 'components/interfaces/ProjectAPIDocs/ProjectAPIDocs'
+import { ProjectAPIDocs } from 'components/interfaces/ProjectAPIDocs/ProjectAPIDocs'
import { Loading } from 'components/ui/Loading'
import { ResourceExhaustionWarningBanner } from 'components/ui/ResourceExhaustionWarningBanner/ResourceExhaustionWarningBanner'
+import { AnimatePresence, motion } from 'framer-motion'
import { useCustomContent } from 'hooks/custom-content/useCustomContent'
import { useSelectedOrganizationQuery } from 'hooks/misc/useSelectedOrganization'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
@@ -19,6 +20,8 @@ import MobileSheetNav from 'ui-patterns/MobileSheetNav/MobileSheetNav'
import { useEditorType } from '../editors/EditorsLayout.hooks'
import BuildingState from './BuildingState'
import ConnectingState from './ConnectingState'
+import { LayoutSidebar } from './LayoutSidebar'
+import { LayoutSidebarProvider } from './LayoutSidebar/LayoutSidebarProvider'
import { LoadingState } from './LoadingState'
import { ProjectPausedState } from './PausedState/ProjectPausedState'
import { PauseFailedState } from './PauseFailedState'
@@ -29,8 +32,6 @@ import RestartingState from './RestartingState'
import { RestoreFailedState } from './RestoreFailedState'
import RestoringState from './RestoringState'
import { UpgradingState } from './UpgradingState'
-import { LayoutSidebar } from './LayoutSidebar'
-import { LayoutSidebarProvider } from './LayoutSidebar/LayoutSidebarProvider'
// [Joshen] This is temporary while we unblock users from managing their project
// if their project is not responding well for any reason. Eventually needs a bit of an overhaul
diff --git a/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SQLEditorNav.tsx b/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SQLEditorNav.tsx
index 7cade33d6da..28dda2cedd8 100644
--- a/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SQLEditorNav.tsx
+++ b/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SQLEditorNav.tsx
@@ -19,8 +19,8 @@ import { Snippet, SnippetFolder, useSQLSnippetFoldersQuery } from 'data/content/
import { useSqlSnippetsQuery } from 'data/content/sql-snippets-query'
import { useLocalStorage } from 'hooks/misc/useLocalStorage'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { uuidv4 } from 'lib/helpers'
import { useProfile } from 'lib/profile'
-import uuidv4 from 'lib/uuid'
import { useSnippetFolders, useSqlEditorV2StateSnapshot } from 'state/sql-editor-v2'
import { createTabId, useTabsStateSnapshot } from 'state/tabs'
import { TreeView } from 'ui'
diff --git a/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SQLEditorTreeViewItem.tsx b/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SQLEditorTreeViewItem.tsx
index e22c2d52213..89e82df6d92 100644
--- a/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SQLEditorTreeViewItem.tsx
+++ b/apps/studio/components/layouts/SQLEditorLayout/SQLEditorNavV2/SQLEditorTreeViewItem.tsx
@@ -24,8 +24,8 @@ import { Snippet } from 'data/content/sql-folders-query'
import { useAsyncCheckPermissions } from 'hooks/misc/useCheckPermissions'
import useLatest from 'hooks/misc/useLatest'
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
+import { uuidv4 } from 'lib/helpers'
import { useProfile } from 'lib/profile'
-import uuidv4 from 'lib/uuid'
import { useSqlEditorV2StateSnapshot } from 'state/sql-editor-v2'
import {
Button,
diff --git a/apps/studio/components/ui/AIAssistantPanel/AIAssistant.tsx b/apps/studio/components/ui/AIAssistantPanel/AIAssistant.tsx
index e0eb19df63c..b14e1471059 100644
--- a/apps/studio/components/ui/AIAssistantPanel/AIAssistant.tsx
+++ b/apps/studio/components/ui/AIAssistantPanel/AIAssistant.tsx
@@ -9,6 +9,7 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { LOCAL_STORAGE_KEYS, useFlag } from 'common'
import { useParams, useSearchParamsShallow } from 'common/hooks'
import { Markdown } from 'components/interfaces/Markdown'
+import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider'
import { useCheckOpenAIKeyQuery } from 'data/ai/check-api-key-query'
import { useRateMessageMutation } from 'data/ai/rate-message-mutation'
import { constructHeaders } from 'data/fetchers'
@@ -21,11 +22,10 @@ import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
import { useHotKey } from 'hooks/ui/useHotKey'
import { prepareMessagesForAPI } from 'lib/ai/message-utils'
import { BASE_PATH, IS_PLATFORM } from 'lib/constants'
-import uuidv4 from 'lib/uuid'
+import { uuidv4 } from 'lib/helpers'
import type { AssistantModel } from 'state/ai-assistant-state'
import { useAiAssistantStateSnapshot } from 'state/ai-assistant-state'
import { useSidebarManagerSnapshot } from 'state/sidebar-manager-state'
-import { SIDEBAR_KEYS } from 'components/layouts/ProjectLayout/LayoutSidebar/LayoutSidebarProvider'
import { useSqlEditorV2StateSnapshot } from 'state/sql-editor-v2'
import { Button, cn, KeyboardShortcut } from 'ui'
import { Admonition } from 'ui-patterns'
diff --git a/apps/studio/lib/helpers.test.ts b/apps/studio/lib/helpers.test.ts
index 1c53bda36cd..7699fdd2310 100644
--- a/apps/studio/lib/helpers.test.ts
+++ b/apps/studio/lib/helpers.test.ts
@@ -1,4 +1,6 @@
+import { v4 as _uuidV4 } from 'uuid'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
+
import {
detectBrowser,
detectOS,
@@ -22,10 +24,23 @@ import {
timeout,
tryParseInt,
tryParseJson,
+ uuidv4,
} from './helpers'
import { copyToClipboard } from 'ui'
+vi.mock('uuid', () => ({
+ v4: vi.fn(() => 'mocked-uuid'),
+}))
+
+describe('uuidv4', () => {
+ it('calls uuid.v4 and returns the result', () => {
+ const result = uuidv4()
+ expect(_uuidV4).toHaveBeenCalled()
+ expect(result).toBe('mocked-uuid')
+ })
+})
+
describe('tryParseJson', () => {
it('should return the parsed JSON', () => {
const result = tryParseJson('{"test": "test"}')
diff --git a/apps/studio/lib/helpers.ts b/apps/studio/lib/helpers.ts
index 7c4d38c1b0b..a0a21bd26e8 100644
--- a/apps/studio/lib/helpers.ts
+++ b/apps/studio/lib/helpers.ts
@@ -1,7 +1,12 @@
-export { default as uuidv4 } from './uuid'
import { UIEvent } from 'react'
+import { v4 as _uuidV4 } from 'uuid'
+
import type { TablesData } from '../data/tables/tables-query'
+export const uuidv4 = () => {
+ return _uuidV4()
+}
+
export const isAtBottom = ({ currentTarget }: UIEvent<HTMLElement>): boolean => {
return currentTarget.scrollTop + 10 >= currentTarget.scrollHeight - currentTarget.clientHeight
}
diff --git a/apps/studio/lib/uuid.test.ts b/apps/studio/lib/uuid.test.ts
deleted file mode 100644
index 6ceeb8bf49a..00000000000
--- a/apps/studio/lib/uuid.test.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-import { describe, it, expect, vi } from 'vitest'
-import { v4 as _uuidV4 } from 'uuid'
-import uuidv4 from './uuid'
-
-vi.mock('uuid', () => ({
- v4: vi.fn(() => 'mocked-uuid'),
-}))
-
-describe('uuidv4', () => {
- it('calls uuid.v4 and returns the result', () => {
- const result = uuidv4()
- expect(_uuidV4).toHaveBeenCalled()
- expect(result).toBe('mocked-uuid')
- })
-})
diff --git a/apps/studio/lib/uuid.ts b/apps/studio/lib/uuid.ts
deleted file mode 100644
index c33432b302d..00000000000
--- a/apps/studio/lib/uuid.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { v4 as _uuidV4 } from 'uuid'
-
-const uuidv4 = () => {
- return _uuidV4()
-}
-
-export default uuidv4
diff --git a/apps/studio/pages/project/[ref]/settings/general.tsx b/apps/studio/pages/project/[ref]/settings/general.tsx
index 11943bbd52f..618016b289f 100644
--- a/apps/studio/pages/project/[ref]/settings/general.tsx
+++ b/apps/studio/pages/project/[ref]/settings/general.tsx
@@ -1,11 +1,9 @@
import { subscriptionHasHipaaAddon } from 'components/interfaces/Billing/Subscription/Subscription.utils'
-import {
- ComplianceConfig,
- CustomDomainConfig,
- General,
- TransferProjectPanel,
-} from 'components/interfaces/Settings/General'
+import { ComplianceConfig } from 'components/interfaces/Settings/General/ComplianceConfig/ProjectComplianceMode'
+import { CustomDomainConfig } from 'components/interfaces/Settings/General/CustomDomainConfig/CustomDomainConfig'
import { DeleteProjectPanel } from 'components/interfaces/Settings/General/DeleteProjectPanel/DeleteProjectPanel'
+import { General } from 'components/interfaces/Settings/General/General'
+import { TransferProjectPanel } from 'components/interfaces/Settings/General/TransferProjectPanel/TransferProjectPanel'
import DefaultLayout from 'components/layouts/DefaultLayout'
import SettingsLayout from 'components/layouts/ProjectSettingsLayout/SettingsLayout'
import { ScaffoldContainer, ScaffoldHeader, ScaffoldTitle } from 'components/layouts/Scaffold'