From 2fcd8a3ba17ecc2d5860d31d410d49689f0875d8 Mon Sep 17 00:00:00 2001 From: Rahulcheryala Date: Mon, 1 Jun 2026 19:25:31 +0530 Subject: [PATCH] refactor: migrate constants (fetch-keys) from apps/web to @plane/constants --- .../[workspaceSlug]/(projects)/profile/[userId]/layout.tsx | 2 +- .../[workspaceSlug]/(projects)/profile/[userId]/page.tsx | 2 +- .../(detail)/[projectId]/archives/issues/(detail)/header.tsx | 2 +- .../(settings)/settings/(workspace)/integrations/page.tsx | 2 +- apps/web/app/(all)/invitations/page.tsx | 2 +- apps/web/app/(all)/onboarding/page.tsx | 2 +- apps/web/app/(all)/workspace-invitations/page.tsx | 2 +- apps/web/core/components/api-token/delete-token-modal.tsx | 2 +- .../core/components/api-token/modal/create-token-modal.tsx | 2 +- .../core/components/cycles/active-cycle/use-cycles-details.ts | 2 +- apps/web/core/components/exporter/guide.tsx | 2 +- apps/web/core/components/exporter/prev-exports.tsx | 2 +- .../core/components/integration/single-integration-card.tsx | 2 +- apps/web/core/components/integration/slack/select-channel.tsx | 2 +- .../components/profile/activity/workspace-activity-list.tsx | 2 +- apps/web/core/components/profile/overview/activity.tsx | 2 +- apps/web/core/components/project/integration-card.tsx | 2 +- .../components/project/project-settings-member-defaults.tsx | 2 +- .../components/settings/profile/content/pages/api-tokens.tsx | 2 +- apps/web/core/hooks/use-workspace-issue-properties.ts | 2 +- apps/web/core/layouts/auth-layout/project-wrapper.tsx | 2 +- apps/web/core/layouts/auth-layout/workspace-wrapper.tsx | 2 +- .../core/constants => packages/constants/src}/fetch-keys.ts | 0 packages/constants/src/index.ts | 4 ++++ 24 files changed, 26 insertions(+), 22 deletions(-) rename {apps/web/core/constants => packages/constants/src}/fetch-keys.ts (100%) diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/layout.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/layout.tsx index a07a9e3119..f5e2d66632 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/layout.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/layout.tsx @@ -15,7 +15,7 @@ import { AppHeader } from "@/components/core/app-header"; import { ContentWrapper } from "@/components/core/content-wrapper"; import { ProfileSidebar } from "@/components/profile/sidebar"; // constants -import { USER_PROFILE_PROJECT_SEGREGATION } from "@/constants/fetch-keys"; +import { USER_PROFILE_PROJECT_SEGREGATION } from "@plane/constants"; // hooks import { useUserPermissions } from "@/hooks/store/user"; import useSize from "@/hooks/use-window-size"; diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/page.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/page.tsx index 0fac006625..6118a867ab 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/page.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/profile/[userId]/page.tsx @@ -18,7 +18,7 @@ import { ProfileStateDistribution } from "@/components/profile/overview/state-di import { ProfileStats } from "@/components/profile/overview/stats"; import { ProfileWorkload } from "@/components/profile/overview/workload"; // constants -import { USER_PROFILE_DATA } from "@/constants/fetch-keys"; +import { USER_PROFILE_DATA } from "@plane/constants"; // services import { UserService } from "@/services/user.service"; import type { Route } from "./+types/page"; diff --git a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/archives/issues/(detail)/header.tsx b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/archives/issues/(detail)/header.tsx index e8324c2f63..4217bae906 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/archives/issues/(detail)/header.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(projects)/projects/(detail)/[projectId]/archives/issues/(detail)/header.tsx @@ -14,7 +14,7 @@ import { Breadcrumbs, Header } from "@plane/ui"; import { BreadcrumbLink } from "@/components/common/breadcrumb-link"; import { IssueDetailQuickActions } from "@/components/issues/issue-detail/issue-detail-quick-actions"; // constants -import { ISSUE_DETAILS } from "@/constants/fetch-keys"; +import { ISSUE_DETAILS } from "@plane/constants"; // hooks import { useProject } from "@/hooks/store/use-project"; // plane web diff --git a/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/integrations/page.tsx b/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/integrations/page.tsx index ea32086874..1636bc8ae0 100644 --- a/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/integrations/page.tsx +++ b/apps/web/app/(all)/[workspaceSlug]/(settings)/settings/(workspace)/integrations/page.tsx @@ -14,7 +14,7 @@ import { SingleIntegrationCard } from "@/components/integration/single-integrati import { IntegrationAndImportExportBanner } from "@/components/ui/integration-and-import-export-banner"; import { IntegrationsSettingsLoader } from "@/components/ui/loader/settings/integration"; // constants -import { APP_INTEGRATIONS } from "@/constants/fetch-keys"; +import { APP_INTEGRATIONS } from "@plane/constants"; // hooks import { useWorkspace } from "@/hooks/store/use-workspace"; import { useUserPermissions } from "@/hooks/store/user"; diff --git a/apps/web/app/(all)/invitations/page.tsx b/apps/web/app/(all)/invitations/page.tsx index dc1e45cc2d..0da54f0a88 100644 --- a/apps/web/app/(all)/invitations/page.tsx +++ b/apps/web/app/(all)/invitations/page.tsx @@ -24,7 +24,7 @@ import emptyInvitation from "@/app/assets/empty-state/invitation.svg?url"; // components import { EmptyState } from "@/components/common/empty-state"; import { WorkspaceLogo } from "@/components/workspace/logo"; -import { USER_WORKSPACES_LIST } from "@/constants/fetch-keys"; +import { USER_WORKSPACES_LIST } from "@plane/constants"; // hooks import { useWorkspace } from "@/hooks/store/use-workspace"; import { useUser, useUserProfile } from "@/hooks/store/user"; diff --git a/apps/web/app/(all)/onboarding/page.tsx b/apps/web/app/(all)/onboarding/page.tsx index 28e677e227..86ef1b1f72 100644 --- a/apps/web/app/(all)/onboarding/page.tsx +++ b/apps/web/app/(all)/onboarding/page.tsx @@ -11,7 +11,7 @@ import useSWR from "swr"; import { LogoSpinner } from "@/components/common/logo-spinner"; import { OnboardingRoot } from "@/components/onboarding"; // constants -import { USER_WORKSPACES_LIST } from "@/constants/fetch-keys"; +import { USER_WORKSPACES_LIST } from "@plane/constants"; // helpers import { EPageTypes } from "@/helpers/authentication.helper"; // hooks diff --git a/apps/web/app/(all)/workspace-invitations/page.tsx b/apps/web/app/(all)/workspace-invitations/page.tsx index 4ab9b02eb8..d6267d1888 100644 --- a/apps/web/app/(all)/workspace-invitations/page.tsx +++ b/apps/web/app/(all)/workspace-invitations/page.tsx @@ -13,7 +13,7 @@ import { CheckIcon, CloseIcon } from "@plane/propel/icons"; import { LogoSpinner } from "@/components/common/logo-spinner"; import { EmptySpace, EmptySpaceItem } from "@/components/ui/empty-space"; // constants -import { WORKSPACE_INVITATION } from "@/constants/fetch-keys"; +import { WORKSPACE_INVITATION } from "@plane/constants"; // helpers import { EPageTypes } from "@/helpers/authentication.helper"; // hooks diff --git a/apps/web/core/components/api-token/delete-token-modal.tsx b/apps/web/core/components/api-token/delete-token-modal.tsx index d2c9d653a4..58a93394c1 100644 --- a/apps/web/core/components/api-token/delete-token-modal.tsx +++ b/apps/web/core/components/api-token/delete-token-modal.tsx @@ -14,7 +14,7 @@ import type { IApiToken } from "@plane/types"; // ui import { AlertModalCore } from "@plane/ui"; // fetch-keys -import { API_TOKENS_LIST } from "@/constants/fetch-keys"; +import { API_TOKENS_LIST } from "@plane/constants"; type Props = { isOpen: boolean; diff --git a/apps/web/core/components/api-token/modal/create-token-modal.tsx b/apps/web/core/components/api-token/modal/create-token-modal.tsx index 9ea6055daf..f9d4872d3f 100644 --- a/apps/web/core/components/api-token/modal/create-token-modal.tsx +++ b/apps/web/core/components/api-token/modal/create-token-modal.tsx @@ -13,7 +13,7 @@ import type { IApiToken } from "@plane/types"; import { EModalPosition, EModalWidth, ModalCore } from "@plane/ui"; import { renderFormattedDate, csvDownload } from "@plane/utils"; // constants -import { API_TOKENS_LIST } from "@/constants/fetch-keys"; +import { API_TOKENS_LIST } from "@plane/constants"; // local imports import { CreateApiTokenForm } from "./form"; import { GeneratedTokenDetails } from "./generated-token-details"; diff --git a/apps/web/core/components/cycles/active-cycle/use-cycles-details.ts b/apps/web/core/components/cycles/active-cycle/use-cycles-details.ts index d404520c59..d9cd8c0c96 100644 --- a/apps/web/core/components/cycles/active-cycle/use-cycles-details.ts +++ b/apps/web/core/components/cycles/active-cycle/use-cycles-details.ts @@ -11,7 +11,7 @@ import useSWR from "swr"; import type { TWorkItemFilterCondition } from "@plane/shared-state"; import { EIssuesStoreType } from "@plane/types"; // constants -import { CYCLE_ISSUES_WITH_PARAMS } from "@/constants/fetch-keys"; +import { CYCLE_ISSUES_WITH_PARAMS } from "@plane/constants"; // hooks import { useCycle } from "@/hooks/store/use-cycle"; import { useIssues } from "@/hooks/store/use-issues"; diff --git a/apps/web/core/components/exporter/guide.tsx b/apps/web/core/components/exporter/guide.tsx index f6a212d904..35aba499d3 100644 --- a/apps/web/core/components/exporter/guide.tsx +++ b/apps/web/core/components/exporter/guide.tsx @@ -9,7 +9,7 @@ import { observer } from "mobx-react"; import { useParams, useSearchParams } from "next/navigation"; import { mutate } from "swr"; // constants -import { EXPORT_SERVICES_LIST } from "@/constants/fetch-keys"; +import { EXPORT_SERVICES_LIST } from "@plane/constants"; // local imports import { ExportForm } from "./export-form"; import { PrevExports } from "./prev-exports"; diff --git a/apps/web/core/components/exporter/prev-exports.tsx b/apps/web/core/components/exporter/prev-exports.tsx index 2d747e00bd..2334a6c159 100644 --- a/apps/web/core/components/exporter/prev-exports.tsx +++ b/apps/web/core/components/exporter/prev-exports.tsx @@ -17,7 +17,7 @@ import { Table } from "@plane/ui"; // components import { ImportExportSettingsLoader } from "@/components/ui/loader/settings/import-and-export"; // constants -import { EXPORT_SERVICES_LIST } from "@/constants/fetch-keys"; +import { EXPORT_SERVICES_LIST } from "@plane/constants"; // services import { IntegrationService } from "@/services/integrations"; // local imports diff --git a/apps/web/core/components/integration/single-integration-card.tsx b/apps/web/core/components/integration/single-integration-card.tsx index d4224eb224..c6773bb92d 100644 --- a/apps/web/core/components/integration/single-integration-card.tsx +++ b/apps/web/core/components/integration/single-integration-card.tsx @@ -20,7 +20,7 @@ import { Loader } from "@plane/ui"; import GithubLogo from "@/app/assets/services/github.png?url"; import SlackLogo from "@/app/assets/services/slack.png?url"; // constants -import { WORKSPACE_INTEGRATIONS } from "@/constants/fetch-keys"; +import { WORKSPACE_INTEGRATIONS } from "@plane/constants"; // hooks import { useInstance } from "@/hooks/store/use-instance"; import { useUserPermissions } from "@/hooks/store/user"; diff --git a/apps/web/core/components/integration/slack/select-channel.tsx b/apps/web/core/components/integration/slack/select-channel.tsx index af38111a36..3838329220 100644 --- a/apps/web/core/components/integration/slack/select-channel.tsx +++ b/apps/web/core/components/integration/slack/select-channel.tsx @@ -13,7 +13,7 @@ import type { IWorkspaceIntegration, ISlackIntegration } from "@plane/types"; // ui import { Loader } from "@plane/ui"; // fetch-keys -import { SLACK_CHANNEL_INFO } from "@/constants/fetch-keys"; +import { SLACK_CHANNEL_INFO } from "@plane/constants"; // hooks import { useInstance } from "@/hooks/store/use-instance"; import useIntegrationPopup from "@/hooks/use-integration-popup"; diff --git a/apps/web/core/components/profile/activity/workspace-activity-list.tsx b/apps/web/core/components/profile/activity/workspace-activity-list.tsx index c1e0a32d9c..fb90b35f3d 100644 --- a/apps/web/core/components/profile/activity/workspace-activity-list.tsx +++ b/apps/web/core/components/profile/activity/workspace-activity-list.tsx @@ -8,7 +8,7 @@ import { useEffect } from "react"; import { useParams } from "next/navigation"; import useSWR from "swr"; // services -import { USER_PROFILE_ACTIVITY } from "@/constants/fetch-keys"; +import { USER_PROFILE_ACTIVITY } from "@plane/constants"; import { UserService } from "@/services/user.service"; // components import { ActivityList } from "./activity-list"; diff --git a/apps/web/core/components/profile/overview/activity.tsx b/apps/web/core/components/profile/overview/activity.tsx index 23bb961f77..0b089ba5ca 100644 --- a/apps/web/core/components/profile/overview/activity.tsx +++ b/apps/web/core/components/profile/overview/activity.tsx @@ -16,7 +16,7 @@ import { calculateTimeAgo, getFileURL } from "@plane/utils"; // components import { ActivityMessage, IssueLink } from "@/components/core/activity"; // constants -import { USER_PROFILE_ACTIVITY } from "@/constants/fetch-keys"; +import { USER_PROFILE_ACTIVITY } from "@plane/constants"; // helpers // hooks import { useUser } from "@/hooks/store/user"; diff --git a/apps/web/core/components/project/integration-card.tsx b/apps/web/core/components/project/integration-card.tsx index 79322e3fae..e4cd4e0534 100644 --- a/apps/web/core/components/project/integration-card.tsx +++ b/apps/web/core/components/project/integration-card.tsx @@ -15,7 +15,7 @@ import SlackLogo from "@/app/assets/services/slack.png?url"; import { SelectChannel } from "@/components/integration/slack/select-channel"; import { SelectRepository } from "@/components/integration/github/select-repository"; // constants -import { PROJECT_GITHUB_REPOSITORY } from "@/constants/fetch-keys"; +import { PROJECT_GITHUB_REPOSITORY } from "@plane/constants"; // services import { ProjectService } from "@/services/project"; diff --git a/apps/web/core/components/project/project-settings-member-defaults.tsx b/apps/web/core/components/project/project-settings-member-defaults.tsx index e505b7beb0..23184e9f41 100644 --- a/apps/web/core/components/project/project-settings-member-defaults.tsx +++ b/apps/web/core/components/project/project-settings-member-defaults.tsx @@ -16,7 +16,7 @@ import { TOAST_TYPE, setToast } from "@plane/propel/toast"; import type { IProject, IUserLite, IWorkspace } from "@plane/types"; import { Loader, ToggleSwitch } from "@plane/ui"; // constants -import { PROJECT_DETAILS } from "@/constants/fetch-keys"; +import { PROJECT_DETAILS } from "@plane/constants"; // hooks import { useProject } from "@/hooks/store/use-project"; import { useUserPermissions } from "@/hooks/store/user"; diff --git a/apps/web/core/components/settings/profile/content/pages/api-tokens.tsx b/apps/web/core/components/settings/profile/content/pages/api-tokens.tsx index 39bd19bc90..0d7217373a 100644 --- a/apps/web/core/components/settings/profile/content/pages/api-tokens.tsx +++ b/apps/web/core/components/settings/profile/content/pages/api-tokens.tsx @@ -18,7 +18,7 @@ import { ApiTokenListItem } from "@/components/api-token/token-list-item"; import { ProfileSettingsHeading } from "@/components/settings/profile/heading"; import { APITokenSettingsLoader } from "@/components/ui/loader/settings/api-token"; // constants -import { API_TOKENS_LIST } from "@/constants/fetch-keys"; +import { API_TOKENS_LIST } from "@plane/constants"; const apiTokenService = new APITokenService(); diff --git a/apps/web/core/hooks/use-workspace-issue-properties.ts b/apps/web/core/hooks/use-workspace-issue-properties.ts index 3c71503d54..02388da172 100644 --- a/apps/web/core/hooks/use-workspace-issue-properties.ts +++ b/apps/web/core/hooks/use-workspace-issue-properties.ts @@ -6,7 +6,7 @@ import useSWR from "swr"; // plane web imports -import { WORKSPACE_ESTIMATES, WORKSPACE_CYCLES, WORKSPACE_LABELS, WORKSPACE_MODULES } from "@/constants/fetch-keys"; +import { WORKSPACE_ESTIMATES, WORKSPACE_CYCLES, WORKSPACE_LABELS, WORKSPACE_MODULES } from "@plane/constants"; import { useWorkspaceIssuePropertiesExtended } from "@/plane-web/hooks/use-workspace-issue-properties-extended"; // plane imports import { useProjectEstimates } from "./store/estimates"; diff --git a/apps/web/core/layouts/auth-layout/project-wrapper.tsx b/apps/web/core/layouts/auth-layout/project-wrapper.tsx index 1c4fac1b50..1a0a441474 100644 --- a/apps/web/core/layouts/auth-layout/project-wrapper.tsx +++ b/apps/web/core/layouts/auth-layout/project-wrapper.tsx @@ -25,7 +25,7 @@ import { PROJECT_MODULES, PROJECT_VIEWS, PROJECT_INTAKE_STATE, -} from "@/constants/fetch-keys"; +} from "@plane/constants"; // hooks import { useProjectEstimates } from "@/hooks/store/estimates"; import { useCycle } from "@/hooks/store/use-cycle"; diff --git a/apps/web/core/layouts/auth-layout/workspace-wrapper.tsx b/apps/web/core/layouts/auth-layout/workspace-wrapper.tsx index ac8c34fb36..e74dfd55db 100644 --- a/apps/web/core/layouts/auth-layout/workspace-wrapper.tsx +++ b/apps/web/core/layouts/auth-layout/workspace-wrapper.tsx @@ -31,7 +31,7 @@ import { WORKSPACE_STATES, WORKSPACE_SIDEBAR_PREFERENCES, WORKSPACE_PROJECT_NAVIGATION_PREFERENCES, -} from "@/constants/fetch-keys"; +} from "@plane/constants"; // hooks import { useFavorite } from "@/hooks/store/use-favorite"; import { useMember } from "@/hooks/store/use-member"; diff --git a/apps/web/core/constants/fetch-keys.ts b/packages/constants/src/fetch-keys.ts similarity index 100% rename from apps/web/core/constants/fetch-keys.ts rename to packages/constants/src/fetch-keys.ts diff --git a/packages/constants/src/index.ts b/packages/constants/src/index.ts index 822c4e770c..e55a3dbe23 100644 --- a/packages/constants/src/index.ts +++ b/packages/constants/src/index.ts @@ -7,6 +7,7 @@ export * from "./ai"; export * from "./analytics"; export * from "./auth"; +export * from "./calendar"; export * from "./chart"; export * from "./cycle"; export * from "./dashboard"; @@ -15,7 +16,9 @@ export * from "./endpoints"; export * from "./estimates"; export * from "./event-tracker"; export * from "./file"; +export * from "./fetch-keys"; export * from "./filter"; +export * from "./gantt-chart"; export * from "./graph"; export * from "./icon"; export * from "./instance"; @@ -32,6 +35,7 @@ export * from "./profile"; export * from "./project"; export * from "./rich-filters"; export * from "./settings"; +export * from "./sidebar-favorites"; export * from "./sidebar"; export * from "./spreadsheet"; export * from "./state";