From 4a2645c4be6c2593370931d13caaab034e952c44 Mon Sep 17 00:00:00 2001 From: mazuh Date: Sat, 24 Feb 2024 16:56:04 -0300 Subject: [PATCH] reorganize entities and adopt no-default-imports --- src/App.tsx | 2 +- src/entities/{management.ts => project-entities.ts} | 0 src/entities/{info.ts => runtime-entities.ts} | 0 src/features/project-workspace/ProjectWorkspacePage.tsx | 2 +- src/features/project-workspace/RequestsSpecsContext.ts | 2 +- src/features/project-workspace/RequestsSpecsContextProvider.tsx | 2 +- src/features/project-workspace/opfs-project-service.ts | 2 +- src/hooks/useClientSession.ts | 2 +- src/services/opfs-projects-shared-internals.ts | 2 +- 9 files changed, 7 insertions(+), 7 deletions(-) rename src/entities/{management.ts => project-entities.ts} (100%) rename src/entities/{info.ts => runtime-entities.ts} (100%) diff --git a/src/App.tsx b/src/App.tsx index c0c056f..503accf 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,6 +1,6 @@ import { useEffect } from "react"; import { Switch, Router, Route } from "wouter"; -import useClientSession from "./hooks/useClientSession"; +import { useClientSession } from "./hooks/useClientSession"; import { ProjectsManagementPage } from "./features/projects-management/ProjectsManagementPage"; import { Button } from "./components/ui/button"; import { ErrorPageTemplate } from "./components/template/ErrorPage"; diff --git a/src/entities/management.ts b/src/entities/project-entities.ts similarity index 100% rename from src/entities/management.ts rename to src/entities/project-entities.ts diff --git a/src/entities/info.ts b/src/entities/runtime-entities.ts similarity index 100% rename from src/entities/info.ts rename to src/entities/runtime-entities.ts diff --git a/src/features/project-workspace/ProjectWorkspacePage.tsx b/src/features/project-workspace/ProjectWorkspacePage.tsx index 08569e6..1d2e43c 100644 --- a/src/features/project-workspace/ProjectWorkspacePage.tsx +++ b/src/features/project-workspace/ProjectWorkspacePage.tsx @@ -11,7 +11,7 @@ import { } from "@fortawesome/free-solid-svg-icons"; import { AppPageTemplate } from "@/components/template/AppPageTemplate"; import { Anchor, Title } from "@/components/ui/typography"; -import { ProjectRequestSpec } from "@/entities/management"; +import { ProjectRequestSpec } from "@/entities/project-entities"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import { diff --git a/src/features/project-workspace/RequestsSpecsContext.ts b/src/features/project-workspace/RequestsSpecsContext.ts index e2f89d0..4bb4b56 100644 --- a/src/features/project-workspace/RequestsSpecsContext.ts +++ b/src/features/project-workspace/RequestsSpecsContext.ts @@ -1,7 +1,7 @@ /** * Basic definitions for `RequestsSpecsContextProvider` and its access hook. */ -import { ProjectRequestSpec } from "@/entities/management"; +import { ProjectRequestSpec } from "@/entities/project-entities"; import { createContext, useContext } from "react"; export interface RequestsSpecsContextValue { diff --git a/src/features/project-workspace/RequestsSpecsContextProvider.tsx b/src/features/project-workspace/RequestsSpecsContextProvider.tsx index 728e2b1..0134194 100644 --- a/src/features/project-workspace/RequestsSpecsContextProvider.tsx +++ b/src/features/project-workspace/RequestsSpecsContextProvider.tsx @@ -5,7 +5,7 @@ */ import { ReactNode, useCallback, useEffect, useState } from "react"; import tap from "lodash/tap"; -import { ProjectRequestSpec } from "@/entities/management"; +import { ProjectRequestSpec } from "@/entities/project-entities"; import { retrieveProject, createRequestSpec, diff --git a/src/features/project-workspace/opfs-project-service.ts b/src/features/project-workspace/opfs-project-service.ts index f40a1b7..56a81ee 100644 --- a/src/features/project-workspace/opfs-project-service.ts +++ b/src/features/project-workspace/opfs-project-service.ts @@ -6,7 +6,7 @@ import type { Project, ProjectRequestSpec, ProjectRequestSpecHeader, -} from "@/entities/management"; +} from "@/entities/project-entities"; import { persistProject } from "@/services/opfs-projects-shared-internals"; import { retrieveProject } from "./opfs-project-service"; diff --git a/src/hooks/useClientSession.ts b/src/hooks/useClientSession.ts index e905b67..e09ed69 100644 --- a/src/hooks/useClientSession.ts +++ b/src/hooks/useClientSession.ts @@ -16,7 +16,7 @@ interface UseClientSessionResult { * Manage client session, assuring that only one per tab is active, * so it doesn't have to handle conflicts for Private File System access. */ -export default function useClientSession(): UseClientSessionResult { +export function useClientSession(): UseClientSessionResult { const isOfflineModeSupported = isPersistenceSupported(); const [isActive, setActive] = useState(isOfflineModeSupported); diff --git a/src/services/opfs-projects-shared-internals.ts b/src/services/opfs-projects-shared-internals.ts index b4144c7..fd6e977 100644 --- a/src/services/opfs-projects-shared-internals.ts +++ b/src/services/opfs-projects-shared-internals.ts @@ -7,7 +7,7 @@ import { makeOpfsFileAdapter, makeOpfsMainDirAdapter, } from "./origin-private-file-system"; -import { Project } from "@/entities/management"; +import { Project } from "@/entities/project-entities"; /** * Retrieve a project from the private file system based on its UUID.