diff --git a/npm-packages/dashboard-common/package.json b/npm-packages/dashboard-common/package.json index 15b65d6e..c0e7560c 100644 --- a/npm-packages/dashboard-common/package.json +++ b/npm-packages/dashboard-common/package.json @@ -3,8 +3,6 @@ "version": "0.1.0", "private": true, "type": "module", - "main": "./src/index.js", - "types": "./src/index.ts", "sideEffects": false, "scripts": { "build": "npm run build:generated && tsc --noEmit", diff --git a/npm-packages/dashboard-common/src/index.ts b/npm-packages/dashboard-common/src/index.ts deleted file mode 100644 index 64b95784..00000000 --- a/npm-packages/dashboard-common/src/index.ts +++ /dev/null @@ -1,114 +0,0 @@ -/** - * This barrel file exports all code that is shared between the - * self-hosted dashboard and the cloud dashboard. - */ - -// General dashboard exports -export { toast, dismissToast, backoffWithJitter } from "@common/lib/utils"; -export * from "@common/lib/fetching"; -export * from "@common/lib/useGlobalLocalStorage"; -export * from "@common/lib/useCopy"; -export * from "@common/lib/useIsOverflowing"; -export { - formatBytes, - formatNumber, - formatNumberCompact, - formatDate, - msFormat, - toNumericUTC, -} from "@common/lib/format"; - -// Deployment-related exports for Insights -export { useFunctionUrl } from "@common/lib/deploymentApi"; -export { - functionIdentifierFromValue, - functionIdentifierValue, -} from "@common/lib/functions/generateFileTree"; -export * from "@common/lib/useNents"; -export { useDeploymentAuditLogs } from "@common/lib/useDeploymentAuditLog"; -export { - useModuleFunctions, - itemIdentifier, -} from "@common/lib/functions/FunctionsProvider"; -export { documentHref } from "@common/lib/utils"; -export * from "@common/elements/FunctionNameOption"; -export * from "@common/elements/HealthCard"; -export * from "@common/features/health/components/DeploymentTimes"; - -// Re-used in the cloud dashboard for deployment pages -export { - PROVISION_PROD_PAGE_NAME, - DeploymentInfoContext, - ConnectedDeploymentContext, - DeploymentApiProvider, - WaitForDeploymentApi, -} from "@common/lib/deploymentContext"; -export type { - DeploymentInfo, - DeploymentApiProviderProps, -} from "@common/lib/deploymentContext"; - -// These are used for some deployment-related settings pages -// that are not available in the self-hosted dashboard. -export { - useDeploymentUrl, - useDeploymentAuthHeader, - useAdminKey, -} from "@common/lib/deploymentApi"; -export * from "@common/lib/integrationHelpers"; -export * from "@common/lib/stringifyValue"; - -// Re-usable elements -export * from "@common/elements/Button"; -export * from "@common/elements/Callout"; -export * from "@common/elements/ChartTooltip"; -export * from "@common/elements/Checkbox"; -export * from "@common/elements/ConvexLogo"; -export * from "@common/elements/ClosePanelButton"; -export * from "@common/elements/Combobox"; -export * from "@common/elements/ConfirmationDialog"; -export * from "@common/elements/CopyButton"; -export * from "@common/elements/CopyTextButton"; -export * from "@common/elements/DateRangePicker"; -export * from "@common/elements/DetailPanel"; -export * from "@common/elements/EmptySection"; -export { PuzzlePieceIcon } from "@common/elements/icons"; -export * from "@common/elements/Loading"; -export * from "@common/elements/Menu"; -export * from "@common/elements/Modal"; -export * from "@common/elements/MultiSelectCombobox"; -export * from "@common/elements/PageContent"; -export * from "@common/elements/Popover"; -export * from "@common/elements/ReadonlyCode"; -export * from "@common/elements/Sheet"; -export { SidebarLink, sidebarLinkClassNames } from "@common/elements/Sidebar"; -export * from "@common/elements/Snippet"; -export * from "@common/elements/Spinner"; -export * from "@common/elements/TextInput"; -export * from "@common/elements/ToggleTheme"; -export * from "@common/elements/TimestampDistance"; -export * from "@common/elements/Tooltip"; - -// For rendering the dashboard itself -- consider refactoring into a basic provider -export * from "@common/elements/Favicon"; -export * from "@common/elements/ToastContainer"; -export * from "@common/elements/ThemeConsumer"; - -// For rendering deployment pages in self-hosted dashboard -export * from "@common/layouts/DeploymentDashboardLayout"; -export * from "@common/layouts/DeploymentSettingsLayout"; -export * from "@common/features/health/components/HealthView"; -export * from "@common/features/data/components/DataView"; -export * from "@common/features/functions/components/FunctionsView"; -export * from "@common/features/files/components/FileStorageView"; -export * from "@common/features/logs/components/LogsView"; -export * from "@common/features/history/components/HistoryView"; -export * from "@common/features/schedules/components/ScheduledFunctionsView"; -export * from "@common/features/settings/components/EnvironmentVariablesView"; -export * from "@common/features/settings/components/AuthenticationView"; -export * from "@common/features/settings/components/ComponentsView"; - -export * from "@common/features/settings/components/DeploymentUrl"; -export * from "@common/features/settings/components/EnvironmentVariables"; -export * from "@common/features/settings/components/DeploymentEnvironmentVariables"; -export * from "@common/features/settings/lib/types"; diff --git a/npm-packages/dashboard-self-hosted/src/pages/404.tsx b/npm-packages/dashboard-self-hosted/src/pages/404.tsx index 5a8a5bbf..5353294d 100644 --- a/npm-packages/dashboard-self-hosted/src/pages/404.tsx +++ b/npm-packages/dashboard-self-hosted/src/pages/404.tsx @@ -1,4 +1,4 @@ -import { Button } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; export default function Custom404() { return ( diff --git a/npm-packages/dashboard-self-hosted/src/pages/500.tsx b/npm-packages/dashboard-self-hosted/src/pages/500.tsx index 793bd70e..ec008e58 100644 --- a/npm-packages/dashboard-self-hosted/src/pages/500.tsx +++ b/npm-packages/dashboard-self-hosted/src/pages/500.tsx @@ -1,4 +1,4 @@ -import { Callout } from "dashboard-common"; +import { Callout } from "dashboard-common/elements/Callout"; export default function Custom500() { return ; diff --git a/npm-packages/dashboard-self-hosted/src/pages/_app.tsx b/npm-packages/dashboard-self-hosted/src/pages/_app.tsx index 828639d5..68a58f35 100644 --- a/npm-packages/dashboard-self-hosted/src/pages/_app.tsx +++ b/npm-packages/dashboard-self-hosted/src/pages/_app.tsx @@ -12,25 +12,24 @@ import { EyeOpenIcon, GearIcon, } from "@radix-ui/react-icons"; +import { ConvexLogo } from "dashboard-common/elements/ConvexLogo"; +import { ToastContainer } from "dashboard-common/elements/ToastContainer"; +import { ThemeConsumer } from "dashboard-common/elements/ThemeConsumer"; +import { Favicon } from "dashboard-common/elements/Favicon"; +import { ToggleTheme } from "dashboard-common/elements/ToggleTheme"; +import { Menu, MenuItem } from "dashboard-common/elements/Menu"; +import { TextInput } from "dashboard-common/elements/TextInput"; +import { Button } from "dashboard-common/elements/Button"; +import { ThemeProvider } from "next-themes"; +import React, { useEffect, useMemo, useState } from "react"; +import { ErrorBoundary } from "components/ErrorBoundary"; +import { DeploymentDashboardLayout } from "dashboard-common/layouts/DeploymentDashboardLayout"; import { - ConvexLogo, DeploymentApiProvider, + WaitForDeploymentApi, DeploymentInfo, DeploymentInfoContext, - WaitForDeploymentApi, - ToastContainer, - DeploymentDashboardLayout, - ThemeConsumer, - Favicon, - ToggleTheme, - Menu, - MenuItem, - TextInput, - Button, -} from "dashboard-common"; -import { ThemeProvider } from "next-themes"; -import React, { useEffect, useMemo, useState } from "react"; -import { ErrorBoundary } from "components/ErrorBoundary"; +} from "dashboard-common/lib/deploymentContext"; function App({ Component, diff --git a/npm-packages/dashboard-self-hosted/src/pages/data.tsx b/npm-packages/dashboard-self-hosted/src/pages/data.tsx index 43b33e1c..68e9f31a 100644 --- a/npm-packages/dashboard-self-hosted/src/pages/data.tsx +++ b/npm-packages/dashboard-self-hosted/src/pages/data.tsx @@ -1,3 +1,3 @@ -import { DataView } from "dashboard-common"; +import { DataView } from "dashboard-common/features/data/components/DataView"; export default DataView; diff --git a/npm-packages/dashboard-self-hosted/src/pages/files.tsx b/npm-packages/dashboard-self-hosted/src/pages/files.tsx index ed906f70..f3755603 100644 --- a/npm-packages/dashboard-self-hosted/src/pages/files.tsx +++ b/npm-packages/dashboard-self-hosted/src/pages/files.tsx @@ -1,3 +1,3 @@ -import { FileStorageView } from "dashboard-common"; +import { FileStorageView } from "dashboard-common/features/files/components/FileStorageView"; export default FileStorageView; diff --git a/npm-packages/dashboard-self-hosted/src/pages/functions.tsx b/npm-packages/dashboard-self-hosted/src/pages/functions.tsx index b0bec1ea..d1158bac 100644 --- a/npm-packages/dashboard-self-hosted/src/pages/functions.tsx +++ b/npm-packages/dashboard-self-hosted/src/pages/functions.tsx @@ -1,3 +1,3 @@ -import { FunctionsView } from "dashboard-common"; +import { FunctionsView } from "dashboard-common/features/functions/components/FunctionsView"; export default FunctionsView; diff --git a/npm-packages/dashboard-self-hosted/src/pages/history.tsx b/npm-packages/dashboard-self-hosted/src/pages/history.tsx index 08c959a3..8b7cf2a9 100644 --- a/npm-packages/dashboard-self-hosted/src/pages/history.tsx +++ b/npm-packages/dashboard-self-hosted/src/pages/history.tsx @@ -1,3 +1,3 @@ -import { HistoryView } from "dashboard-common"; +import { HistoryView } from "dashboard-common/features/history/components/HistoryView"; export default HistoryView; diff --git a/npm-packages/dashboard-self-hosted/src/pages/index.tsx b/npm-packages/dashboard-self-hosted/src/pages/index.tsx index 14c16e92..43b12314 100644 --- a/npm-packages/dashboard-self-hosted/src/pages/index.tsx +++ b/npm-packages/dashboard-self-hosted/src/pages/index.tsx @@ -1,4 +1,4 @@ -import { HealthView } from "dashboard-common"; +import { HealthView } from "dashboard-common/features/health/components/HealthView"; export default function Page() { return ( diff --git a/npm-packages/dashboard-self-hosted/src/pages/logs.tsx b/npm-packages/dashboard-self-hosted/src/pages/logs.tsx index 4bbc2505..7df55261 100644 --- a/npm-packages/dashboard-self-hosted/src/pages/logs.tsx +++ b/npm-packages/dashboard-self-hosted/src/pages/logs.tsx @@ -1,3 +1,3 @@ -import { LogsView } from "dashboard-common"; +import { LogsView } from "dashboard-common/features/logs/components/LogsView"; export default LogsView; diff --git a/npm-packages/dashboard-self-hosted/src/pages/schedules/functions.tsx b/npm-packages/dashboard-self-hosted/src/pages/schedules/functions.tsx index fc860595..51534152 100644 --- a/npm-packages/dashboard-self-hosted/src/pages/schedules/functions.tsx +++ b/npm-packages/dashboard-self-hosted/src/pages/schedules/functions.tsx @@ -1,3 +1,3 @@ -import { ScheduledFunctionsView } from "dashboard-common"; +import { ScheduledFunctionsView } from "dashboard-common/features/schedules/components/ScheduledFunctionsView"; export default ScheduledFunctionsView; diff --git a/npm-packages/dashboard-self-hosted/src/pages/settings/authentication.tsx b/npm-packages/dashboard-self-hosted/src/pages/settings/authentication.tsx index 17a846af..f647a47a 100644 --- a/npm-packages/dashboard-self-hosted/src/pages/settings/authentication.tsx +++ b/npm-packages/dashboard-self-hosted/src/pages/settings/authentication.tsx @@ -1,3 +1,3 @@ -import { AuthenticationView } from "dashboard-common"; +import { AuthenticationView } from "dashboard-common/features/settings/components/AuthenticationView"; export default AuthenticationView; diff --git a/npm-packages/dashboard-self-hosted/src/pages/settings/components.tsx b/npm-packages/dashboard-self-hosted/src/pages/settings/components.tsx index 91bfda29..636898b4 100644 --- a/npm-packages/dashboard-self-hosted/src/pages/settings/components.tsx +++ b/npm-packages/dashboard-self-hosted/src/pages/settings/components.tsx @@ -1,3 +1,3 @@ -import { ComponentsView } from "dashboard-common"; +import { ComponentsView } from "dashboard-common/features/settings/components/ComponentsView"; export default ComponentsView; diff --git a/npm-packages/dashboard-self-hosted/src/pages/settings/environment-variables.tsx b/npm-packages/dashboard-self-hosted/src/pages/settings/environment-variables.tsx index ab230d2b..26c09f4d 100644 --- a/npm-packages/dashboard-self-hosted/src/pages/settings/environment-variables.tsx +++ b/npm-packages/dashboard-self-hosted/src/pages/settings/environment-variables.tsx @@ -1,3 +1,3 @@ -import { EnvironmentVariablesView } from "dashboard-common"; +import { EnvironmentVariablesView } from "dashboard-common/features/settings/components/EnvironmentVariablesView"; export default EnvironmentVariablesView; diff --git a/npm-packages/dashboard-self-hosted/src/pages/settings/index.tsx b/npm-packages/dashboard-self-hosted/src/pages/settings/index.tsx index e0ad015a..71a070d6 100644 --- a/npm-packages/dashboard-self-hosted/src/pages/settings/index.tsx +++ b/npm-packages/dashboard-self-hosted/src/pages/settings/index.tsx @@ -1,9 +1,9 @@ +import { Sheet } from "dashboard-common/elements/Sheet"; import { - Sheet, DeploymentUrl, HttpActionsUrl, - DeploymentSettingsLayout, -} from "dashboard-common"; +} from "dashboard-common/features/settings/components/DeploymentUrl"; +import { DeploymentSettingsLayout } from "dashboard-common/layouts/DeploymentSettingsLayout"; export default function Settings() { return ( diff --git a/npm-packages/dashboard-self-hosted/tsconfig.json b/npm-packages/dashboard-self-hosted/tsconfig.json index a86f87eb..5611e410 100644 --- a/npm-packages/dashboard-self-hosted/tsconfig.json +++ b/npm-packages/dashboard-self-hosted/tsconfig.json @@ -18,7 +18,6 @@ "baseUrl": "src", "customConditions": ["convex-internal-types"], "paths": { - "dashboard-common": ["../../dashboard-common/src"], "dashboard-common/*": ["../../dashboard-common/src/*"], "@common/*": ["../../dashboard-common/src/*"] } diff --git a/npm-packages/dashboard/.storybook/main.ts b/npm-packages/dashboard/.storybook/main.ts index d57d97d4..2cb92abc 100644 --- a/npm-packages/dashboard/.storybook/main.ts +++ b/npm-packages/dashboard/.storybook/main.ts @@ -20,19 +20,16 @@ const config: StorybookConfig = { options: { webpackFinal: async (config) => { // Configure aliases - if (!config.resolve) { - config.resolve = {}; - } - if (!config.resolve.alias) { - config.resolve.alias = {}; - } - config.resolve.alias = { - ...config.resolve.alias, - "dashboard-common": path.resolve( - __dirname, - "../../dashboard-common/src", - ), - "@common": path.resolve(__dirname, "../../dashboard-common/src"), + config.resolve = { + ...config.resolve, + alias: { + ...config.resolve?.alias, + "dashboard-common": path.resolve( + __dirname, + "../../dashboard-common/src", + ), + "@common": path.resolve(__dirname, "../../dashboard-common/src"), + }, }; return config; diff --git a/npm-packages/dashboard/jest.config.ts b/npm-packages/dashboard/jest.config.ts index a8666e74..954fbb54 100644 --- a/npm-packages/dashboard/jest.config.ts +++ b/npm-packages/dashboard/jest.config.ts @@ -11,7 +11,7 @@ const customJestConfig = { moduleNameMapper: { "react-dnd": "/__mocks__/fileMock.js", "react-dnd-scrolling": "/__mocks__/fileMock.js", - "dashboard-common": "/../dashboard-common/src/$1", + "^dashboard-common/(.*)$": "/../dashboard-common/src/$1", }, }; diff --git a/npm-packages/dashboard/src/api/api.ts b/npm-packages/dashboard/src/api/api.ts index b05a7b76..e7bcfa16 100644 --- a/npm-packages/dashboard/src/api/api.ts +++ b/npm-packages/dashboard/src/api/api.ts @@ -8,7 +8,7 @@ import { PathsWithMethod } from "openapi-typescript-helpers"; import { createMutateHook, createQueryHook } from "swr-openapi"; import isMatch from "lodash/isMatch"; import { fireGoogleAnalyticsEvent } from "elements/GoogleAnalytics"; -import { toast } from "dashboard-common"; +import { toast } from "dashboard-common/lib/utils"; import type { paths as BigBrainPaths } from "generatedApi"; import { SWRConfiguration } from "swr"; import { useAccessToken } from "hooks/useServerSideData"; diff --git a/npm-packages/dashboard/src/api/insights.ts b/npm-packages/dashboard/src/api/insights.ts index 6e45af03..122c71dc 100644 --- a/npm-packages/dashboard/src/api/insights.ts +++ b/npm-packages/dashboard/src/api/insights.ts @@ -1,14 +1,15 @@ import { useCurrentDeployment } from "api/deployments"; import { useCurrentTeam } from "api/teams"; -import { - functionIdentifierValue, - itemIdentifier, - useModuleFunctions, -} from "dashboard-common"; + import { rootComponentPath, useUsageQuery } from "hooks/usageMetrics"; import omit from "lodash/omit"; import { useMemo } from "react"; import { useRouter } from "next/router"; +import { + itemIdentifier, + useModuleFunctions, +} from "dashboard-common/lib/functions/FunctionsProvider"; +import { functionIdentifierValue } from "dashboard-common/lib/functions/generateFileTree"; const queryIds = { bytesRead: "5bebdf6d-921a-42dc-9ee6-2d5c577111b6", diff --git a/npm-packages/dashboard/src/components/billing/BillingContactInputs.tsx b/npm-packages/dashboard/src/components/billing/BillingContactInputs.tsx index e2187a0b..23fd1704 100644 --- a/npm-packages/dashboard/src/components/billing/BillingContactInputs.tsx +++ b/npm-packages/dashboard/src/components/billing/BillingContactInputs.tsx @@ -1,4 +1,4 @@ -import { TextInput } from "dashboard-common"; +import { TextInput } from "dashboard-common/elements/TextInput"; import { useFormik } from "formik"; import { BillingContactResponse, CreateSubscriptionArgs } from "generatedApi"; diff --git a/npm-packages/dashboard/src/components/billing/PaymentDetailsForm.tsx b/npm-packages/dashboard/src/components/billing/PaymentDetailsForm.tsx index ff788de7..ec0470ba 100644 --- a/npm-packages/dashboard/src/components/billing/PaymentDetailsForm.tsx +++ b/npm-packages/dashboard/src/components/billing/PaymentDetailsForm.tsx @@ -9,7 +9,8 @@ import { StripeElements, SetupIntent, } from "@stripe/stripe-js"; -import { Button, Spinner } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { Spinner } from "dashboard-common/elements/Spinner"; export function PaymentDetailsForm({ retrieveSetupIntent, diff --git a/npm-packages/dashboard/src/components/billing/Plans.tsx b/npm-packages/dashboard/src/components/billing/Plans.tsx index 47324949..ad2c6e8a 100644 --- a/npm-packages/dashboard/src/components/billing/Plans.tsx +++ b/npm-packages/dashboard/src/components/billing/Plans.tsx @@ -1,5 +1,5 @@ import { useListPlans } from "api/billing"; -import { Loading } from "dashboard-common"; +import { Loading } from "dashboard-common/elements/Loading"; import { OrbSubscriptionResponse, Team } from "generatedApi"; import { BusinessPlan } from "./planCards/BusinessPlan"; import { OrbSelfServePlan } from "./planCards/OrbSelfServePlan"; diff --git a/npm-packages/dashboard/src/components/billing/SubscriptionOverview.test.tsx b/npm-packages/dashboard/src/components/billing/SubscriptionOverview.test.tsx index 65361049..89832d81 100644 --- a/npm-packages/dashboard/src/components/billing/SubscriptionOverview.test.tsx +++ b/npm-packages/dashboard/src/components/billing/SubscriptionOverview.test.tsx @@ -1,5 +1,5 @@ import { act, fireEvent, render, screen } from "@testing-library/react"; -import { formatDate } from "dashboard-common"; +import { formatDate } from "dashboard-common/lib/format"; import { OrbSubscriptionResponse, Team } from "generatedApi"; import { SubscriptionOverview } from "./SubscriptionOverview"; diff --git a/npm-packages/dashboard/src/components/billing/SubscriptionOverview.tsx b/npm-packages/dashboard/src/components/billing/SubscriptionOverview.tsx index 1607cfc4..30eebe97 100644 --- a/npm-packages/dashboard/src/components/billing/SubscriptionOverview.tsx +++ b/npm-packages/dashboard/src/components/billing/SubscriptionOverview.tsx @@ -5,7 +5,11 @@ import { useUpdatePaymentMethod, useResumeSubscription, } from "api/billing"; -import { Loading, Button, Spinner, formatDate, Sheet } from "dashboard-common"; +import { Loading } from "dashboard-common/elements/Loading"; +import { Button } from "dashboard-common/elements/Button"; +import { Spinner } from "dashboard-common/elements/Spinner"; +import { formatDate } from "dashboard-common/lib/format"; +import { Sheet } from "dashboard-common/elements/Sheet"; import { useFormik } from "formik"; import { useStripeAddressSetup, useStripePaymentSetup } from "hooks/useStripe"; import { Elements } from "@stripe/react-stripe-js"; diff --git a/npm-packages/dashboard/src/components/billing/TeamUsage.tsx b/npm-packages/dashboard/src/components/billing/TeamUsage.tsx index e79dc809..b703bd3b 100644 --- a/npm-packages/dashboard/src/components/billing/TeamUsage.tsx +++ b/npm-packages/dashboard/src/components/billing/TeamUsage.tsx @@ -1,12 +1,9 @@ import { PlanSummary, UsageOverview } from "components/billing/PlanSummary"; -import { - Sheet, - Loading, - sidebarLinkClassNames, - Button, - formatBytes, - formatNumberCompact, -} from "dashboard-common"; +import { Sheet } from "dashboard-common/elements/Sheet"; +import { Loading } from "dashboard-common/elements/Loading"; +import { Button } from "dashboard-common/elements/Button"; +import { formatBytes, formatNumberCompact } from "dashboard-common/lib/format"; +import { sidebarLinkClassNames } from "dashboard-common/elements/Sidebar"; import { AggregatedFunctionMetrics, DateRange, diff --git a/npm-packages/dashboard/src/components/billing/TeamUsageByFunctionChart.tsx b/npm-packages/dashboard/src/components/billing/TeamUsageByFunctionChart.tsx index a17c428d..bde09283 100644 --- a/npm-packages/dashboard/src/components/billing/TeamUsageByFunctionChart.tsx +++ b/npm-packages/dashboard/src/components/billing/TeamUsageByFunctionChart.tsx @@ -1,6 +1,7 @@ import { ChevronDownIcon, DesktopIcon } from "@radix-ui/react-icons"; import classNames from "classnames"; -import { Button, PuzzlePieceIcon, Tooltip } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { Tooltip } from "dashboard-common/elements/Tooltip"; import { QuantityType, formatQuantity, @@ -20,6 +21,7 @@ import { Team, ProjectDetails, } from "generatedApi"; +import { PuzzlePieceIcon } from "dashboard-common/elements/icons"; const ITEMS_SHOWN_INITIALLY = 6; diff --git a/npm-packages/dashboard/src/components/billing/TeamUsageToolbar.tsx b/npm-packages/dashboard/src/components/billing/TeamUsageToolbar.tsx index a16e182e..e538e552 100644 --- a/npm-packages/dashboard/src/components/billing/TeamUsageToolbar.tsx +++ b/npm-packages/dashboard/src/components/billing/TeamUsageToolbar.tsx @@ -1,12 +1,10 @@ import { Period, UsagePeriodSelector } from "elements/UsagePeriodSelector"; -import { - Combobox, - PuzzlePieceIcon, - Tooltip, - TextInput, -} from "dashboard-common"; +import { Combobox } from "dashboard-common/elements/Combobox"; +import { Tooltip } from "dashboard-common/elements/Tooltip"; +import { TextInput } from "dashboard-common/elements/TextInput"; import { useRouter } from "next/router"; import { ProjectDetails } from "generatedApi"; +import { PuzzlePieceIcon } from "dashboard-common/elements/icons"; export function TeamUsageToolbar({ shownBillingPeriod, diff --git a/npm-packages/dashboard/src/components/billing/planCards/BusinessPlan.tsx b/npm-packages/dashboard/src/components/billing/planCards/BusinessPlan.tsx index 4438afb9..fe1e587c 100644 --- a/npm-packages/dashboard/src/components/billing/planCards/BusinessPlan.tsx +++ b/npm-packages/dashboard/src/components/billing/planCards/BusinessPlan.tsx @@ -1,4 +1,4 @@ -import { Button } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; import { useSupportFormOpen } from "elements/SupportWidget"; import { PlanCard } from "./PlanCard"; diff --git a/npm-packages/dashboard/src/components/billing/planCards/OrbSelfServePlan.tsx b/npm-packages/dashboard/src/components/billing/planCards/OrbSelfServePlan.tsx index 83345874..e97c9a7f 100644 --- a/npm-packages/dashboard/src/components/billing/planCards/OrbSelfServePlan.tsx +++ b/npm-packages/dashboard/src/components/billing/planCards/OrbSelfServePlan.tsx @@ -1,5 +1,5 @@ import { useIsCurrentMemberTeamAdmin } from "api/roles"; -import { Button } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; import { useSupportFormOpen } from "elements/SupportWidget"; import { OrbSubscriptionResponse, PlanResponse, Team } from "generatedApi"; import { useRouter } from "next/router"; diff --git a/npm-packages/dashboard/src/components/billing/planCards/StarterPlan.tsx b/npm-packages/dashboard/src/components/billing/planCards/StarterPlan.tsx index 0c526030..e752d205 100644 --- a/npm-packages/dashboard/src/components/billing/planCards/StarterPlan.tsx +++ b/npm-packages/dashboard/src/components/billing/planCards/StarterPlan.tsx @@ -1,10 +1,8 @@ -import { - Button, - Tooltip, - formatDate, - ConfirmationDialog, - Checkbox, -} from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { Tooltip } from "dashboard-common/elements/Tooltip"; +import { formatDate } from "dashboard-common/lib/format"; +import { ConfirmationDialog } from "dashboard-common/elements/ConfirmationDialog"; +import { Checkbox } from "dashboard-common/elements/Checkbox"; import { useState } from "react"; import Link from "next/link"; import { useCancelSubscription } from "api/billing"; diff --git a/npm-packages/dashboard/src/components/deploymentSettings/BackupDeploymentSelector.tsx b/npm-packages/dashboard/src/components/deploymentSettings/BackupDeploymentSelector.tsx index e0ba2fc3..4bc6d376 100644 --- a/npm-packages/dashboard/src/components/deploymentSettings/BackupDeploymentSelector.tsx +++ b/npm-packages/dashboard/src/components/deploymentSettings/BackupDeploymentSelector.tsx @@ -1,6 +1,8 @@ import { Listbox, Transition } from "@headlessui/react"; import { CaretSortIcon, ChevronLeftIcon } from "@radix-ui/react-icons"; -import { Button, Loading, Tooltip } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { Loading } from "dashboard-common/elements/Loading"; +import { Tooltip } from "dashboard-common/elements/Tooltip"; import { useDeployments } from "api/deployments"; import { useProjects } from "api/projects"; import { useProfile } from "api/profile"; diff --git a/npm-packages/dashboard/src/components/deploymentSettings/BackupList.tsx b/npm-packages/dashboard/src/components/deploymentSettings/BackupList.tsx index 0783436f..8c33409f 100644 --- a/npm-packages/dashboard/src/components/deploymentSettings/BackupList.tsx +++ b/npm-packages/dashboard/src/components/deploymentSettings/BackupList.tsx @@ -3,7 +3,8 @@ import { ArchiveIcon } from "@radix-ui/react-icons"; import { useState } from "react"; import { useGetZipExport } from "hooks/deploymentApi"; import { BackupResponse, useListCloudBackups } from "api/backups"; -import { Loading, EmptySection } from "dashboard-common"; +import { Loading } from "dashboard-common/elements/Loading"; +import { EmptySection } from "dashboard-common/elements/EmptySection"; import { useQuery } from "convex/react"; import udfs from "udfs"; import { BackupListItem, progressMessageForBackup } from "./BackupListItem"; diff --git a/npm-packages/dashboard/src/components/deploymentSettings/BackupListItem.tsx b/npm-packages/dashboard/src/components/deploymentSettings/BackupListItem.tsx index be642a40..89b006c3 100644 --- a/npm-packages/dashboard/src/components/deploymentSettings/BackupListItem.tsx +++ b/npm-packages/dashboard/src/components/deploymentSettings/BackupListItem.tsx @@ -7,19 +7,16 @@ import { ExclamationTriangleIcon, MinusCircledIcon, } from "@radix-ui/react-icons"; -import { - Button, - Tooltip, - Loading, - Spinner, - TimestampDistance, - toast, - Callout, - Modal, - Checkbox, - Menu, - MenuItem, -} from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { Tooltip } from "dashboard-common/elements/Tooltip"; +import { Loading } from "dashboard-common/elements/Loading"; +import { Spinner } from "dashboard-common/elements/Spinner"; +import { TimestampDistance } from "dashboard-common/elements/TimestampDistance"; +import { toast } from "dashboard-common/lib/utils"; +import { Callout } from "dashboard-common/elements/Callout"; +import { Modal } from "dashboard-common/elements/Modal"; +import { Checkbox } from "dashboard-common/elements/Checkbox"; +import { Menu, MenuItem } from "dashboard-common/elements/Menu"; import { useEffect, useId, useRef, useState } from "react"; import { DeploymentResponse, ProjectDetails, Team } from "generatedApi"; import { useDeploymentById } from "api/deployments"; diff --git a/npm-packages/dashboard/src/components/deploymentSettings/Backups.tsx b/npm-packages/dashboard/src/components/deploymentSettings/Backups.tsx index 843af053..86d543d7 100644 --- a/npm-packages/dashboard/src/components/deploymentSettings/Backups.tsx +++ b/npm-packages/dashboard/src/components/deploymentSettings/Backups.tsx @@ -1,16 +1,13 @@ -import { - Button, - Tooltip, - Spinner, - TimestampDistance, - toast, - Sheet, - Callout, - LocalDevCallout, - Checkbox, - TextInput, - Popover, -} from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { Tooltip } from "dashboard-common/elements/Tooltip"; +import { Spinner } from "dashboard-common/elements/Spinner"; +import { TimestampDistance } from "dashboard-common/elements/TimestampDistance"; +import { toast } from "dashboard-common/lib/utils"; +import { Sheet } from "dashboard-common/elements/Sheet"; +import { Callout, LocalDevCallout } from "dashboard-common/elements/Callout"; +import { Checkbox } from "dashboard-common/elements/Checkbox"; +import { TextInput } from "dashboard-common/elements/TextInput"; +import { Popover } from "dashboard-common/elements/Popover"; import { useDisablePeriodicBackup, useGetPeriodicBackupConfig, diff --git a/npm-packages/dashboard/src/components/deploymentSettings/CustomDomains.tsx b/npm-packages/dashboard/src/components/deploymentSettings/CustomDomains.tsx index 4b8a686a..6af8c08f 100644 --- a/npm-packages/dashboard/src/components/deploymentSettings/CustomDomains.tsx +++ b/npm-packages/dashboard/src/components/deploymentSettings/CustomDomains.tsx @@ -5,18 +5,17 @@ import { TrashIcon, } from "@radix-ui/react-icons"; import classNames from "classnames"; +import { Button } from "dashboard-common/elements/Button"; +import { Tooltip } from "dashboard-common/elements/Tooltip"; +import { Combobox } from "dashboard-common/elements/Combobox"; +import { Callout, LocalDevCallout } from "dashboard-common/elements/Callout"; import { - Button, - Tooltip, - Combobox, - Callout, - LocalDevCallout, - Sheet, - ConfirmationDialog, - TextInput, ENVIRONMENT_VARIABLES_ROW_CLASSES, ENVIRONMENT_VARIABLE_NAME_COLUMN, -} from "dashboard-common"; +} from "dashboard-common/features/settings/components/EnvironmentVariables"; +import { Sheet } from "dashboard-common/elements/Sheet"; +import { ConfirmationDialog } from "dashboard-common/elements/ConfirmationDialog"; +import { TextInput } from "dashboard-common/elements/TextInput"; import { useFormik } from "formik"; import { useDeployments } from "api/deployments"; import { useCurrentProject } from "api/projects"; @@ -281,7 +280,7 @@ function DisplayVanityDomain({ >
{vanityDomain.domain} - {vanityDomain.verificationTs && ( + {vanityDomain.verificationTime && ( [] = [ diff --git a/npm-packages/dashboard/src/components/integrations/HealthIndicator.tsx b/npm-packages/dashboard/src/components/integrations/HealthIndicator.tsx index 24f4b898..f7cc9ca7 100644 --- a/npm-packages/dashboard/src/components/integrations/HealthIndicator.tsx +++ b/npm-packages/dashboard/src/components/integrations/HealthIndicator.tsx @@ -1,6 +1,6 @@ import classNames from "classnames"; import { Integration } from "system-udfs/convex/_system/frontend/common"; -import { Tooltip } from "dashboard-common"; +import { Tooltip } from "dashboard-common/elements/Tooltip"; type HealthStatusMetadata = { lightTextColor: string; diff --git a/npm-packages/dashboard/src/components/integrations/IntegrationOverflowMenu.tsx b/npm-packages/dashboard/src/components/integrations/IntegrationOverflowMenu.tsx index 5179dfe1..80423ff4 100644 --- a/npm-packages/dashboard/src/components/integrations/IntegrationOverflowMenu.tsx +++ b/npm-packages/dashboard/src/components/integrations/IntegrationOverflowMenu.tsx @@ -1,16 +1,15 @@ import { DotsVerticalIcon, PlusIcon } from "@radix-ui/react-icons"; +import { Button } from "dashboard-common/elements/Button"; +import { Menu, MenuItem } from "dashboard-common/elements/Menu"; +import { ConfirmationDialog } from "dashboard-common/elements/ConfirmationDialog"; +import { useDeleteSink } from "hooks/deploymentApi"; +import { useState } from "react"; import { - Button, - configToUrl, + LogIntegration, ExceptionReportingIntegration, integrationName, - LogIntegration, - Menu, - MenuItem, - ConfirmationDialog, -} from "dashboard-common"; -import { useDeleteSink } from "hooks/deploymentApi"; -import { useState } from "react"; + configToUrl, +} from "dashboard-common/lib/integrationHelpers"; export function IntegrationOverflowMenu({ integration, diff --git a/npm-packages/dashboard/src/components/integrations/IntegrationStatus.tsx b/npm-packages/dashboard/src/components/integrations/IntegrationStatus.tsx index ad6f74d0..6b564300 100644 --- a/npm-packages/dashboard/src/components/integrations/IntegrationStatus.tsx +++ b/npm-packages/dashboard/src/components/integrations/IntegrationStatus.tsx @@ -1,11 +1,11 @@ +import { Tooltip } from "dashboard-common/elements/Tooltip"; +import { TimestampDistance } from "dashboard-common/elements/TimestampDistance"; +import { ExclamationTriangleIcon } from "@radix-ui/react-icons"; import { - Tooltip, - TimestampDistance, + LogIntegration, ExceptionReportingIntegration, integrationUsingLegacyFormat, - LogIntegration, -} from "dashboard-common"; -import { ExclamationTriangleIcon } from "@radix-ui/react-icons"; +} from "dashboard-common/lib/integrationHelpers"; import { HealthIndicator } from "./HealthIndicator"; export function IntegrationStatus({ diff --git a/npm-packages/dashboard/src/components/integrations/IntegrationTitle.tsx b/npm-packages/dashboard/src/components/integrations/IntegrationTitle.tsx index 18a50b3c..edad9e79 100644 --- a/npm-packages/dashboard/src/components/integrations/IntegrationTitle.tsx +++ b/npm-packages/dashboard/src/components/integrations/IntegrationTitle.tsx @@ -1,4 +1,4 @@ -import { Tooltip } from "dashboard-common"; +import { Tooltip } from "dashboard-common/elements/Tooltip"; import { ReactNode } from "react"; import { IntegrationType } from "system-udfs/convex/_system/frontend/common"; diff --git a/npm-packages/dashboard/src/components/integrations/Integrations.tsx b/npm-packages/dashboard/src/components/integrations/Integrations.tsx index 0d35e0e1..2aaabaed 100644 --- a/npm-packages/dashboard/src/components/integrations/Integrations.tsx +++ b/npm-packages/dashboard/src/components/integrations/Integrations.tsx @@ -1,17 +1,16 @@ import React from "react"; import { Integration } from "system-udfs/convex/_system/frontend/common"; import { Team, TeamEntitlementsResponse } from "generatedApi"; +import { Callout, LocalDevCallout } from "dashboard-common/elements/Callout"; +import { Button } from "dashboard-common/elements/Button"; +import { Sheet } from "dashboard-common/elements/Sheet"; import { - Callout, - LocalDevCallout, - Button, - Sheet, EXC_INTEGRATIONS, EXPORT_INTEGRATIONS, ExceptionReportingIntegration, LOG_INTEGRATIONS, LogIntegration, -} from "dashboard-common"; +} from "dashboard-common/lib/integrationHelpers"; import { useCurrentDeployment } from "api/deployments"; import { useHasProjectAdminPermissions } from "api/roles"; diff --git a/npm-packages/dashboard/src/components/integrations/PanelCard.tsx b/npm-packages/dashboard/src/components/integrations/PanelCard.tsx index 5893b660..6adb7b15 100644 --- a/npm-packages/dashboard/src/components/integrations/PanelCard.tsx +++ b/npm-packages/dashboard/src/components/integrations/PanelCard.tsx @@ -1,16 +1,16 @@ import classNames from "classnames"; import { ExportIntegrationType } from "system-udfs/convex/_system/frontend/common"; import { ExternalLinkIcon } from "@radix-ui/react-icons"; +import { Button } from "dashboard-common/elements/Button"; +import { Modal } from "dashboard-common/elements/Modal"; import { - Button, - ExceptionReportingIntegration, - integrationToLogo, IntegrationUnavailableReason, - LOG_STREAMS_DESCRIPTION, LogIntegration, + ExceptionReportingIntegration, + integrationToLogo, STREAMING_EXPORT_DESCRIPTION, - Modal, -} from "dashboard-common"; + LOG_STREAMS_DESCRIPTION, +} from "dashboard-common/lib/integrationHelpers"; import { useState, ReactNode, useCallback } from "react"; import { IntegrationTitle } from "./IntegrationTitle"; import { IntegrationOverflowMenu } from "./IntegrationOverflowMenu"; diff --git a/npm-packages/dashboard/src/components/integrations/SentryConfigurationForm.tsx b/npm-packages/dashboard/src/components/integrations/SentryConfigurationForm.tsx index ae7a17ff..91eb66df 100644 --- a/npm-packages/dashboard/src/components/integrations/SentryConfigurationForm.tsx +++ b/npm-packages/dashboard/src/components/integrations/SentryConfigurationForm.tsx @@ -1,4 +1,5 @@ -import { Button, TextInput } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { TextInput } from "dashboard-common/elements/TextInput"; import { Infer } from "convex/values"; import { useFormik } from "formik"; import { useCreateSentrySink } from "hooks/deploymentApi"; diff --git a/npm-packages/dashboard/src/components/integrations/WebhookConfigurationForm.tsx b/npm-packages/dashboard/src/components/integrations/WebhookConfigurationForm.tsx index bfdd1754..31adb37e 100644 --- a/npm-packages/dashboard/src/components/integrations/WebhookConfigurationForm.tsx +++ b/npm-packages/dashboard/src/components/integrations/WebhookConfigurationForm.tsx @@ -2,7 +2,8 @@ import * as Yup from "yup"; import { useFormik } from "formik"; import { Infer } from "convex/values"; import { webhookConfig } from "system-udfs/convex/schema"; -import { Button, TextInput } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { TextInput } from "dashboard-common/elements/TextInput"; import { useCreateWebhookSink } from "../../hooks/deploymentApi"; const webhookValidationSchema = Yup.object().shape({ diff --git a/npm-packages/dashboard/src/components/login/LoginPage.tsx b/npm-packages/dashboard/src/components/login/LoginPage.tsx index 10e3c368..81261d38 100644 --- a/npm-packages/dashboard/src/components/login/LoginPage.tsx +++ b/npm-packages/dashboard/src/components/login/LoginPage.tsx @@ -1,6 +1,7 @@ import classNames from "classnames"; import { useState } from "react"; -import { buttonClasses, Spinner } from "dashboard-common"; +import { Spinner } from "dashboard-common/elements/Spinner"; +import { buttonClasses } from "dashboard-common/elements/Button"; import GithubLogo from "./logos/github-logo.svg"; diff --git a/npm-packages/dashboard/src/components/login/LoginTerms.tsx b/npm-packages/dashboard/src/components/login/LoginTerms.tsx index f917c244..8008591a 100644 --- a/npm-packages/dashboard/src/components/login/LoginTerms.tsx +++ b/npm-packages/dashboard/src/components/login/LoginTerms.tsx @@ -1,4 +1,6 @@ -import { Button, LoadingLogo, Sheet } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { Sheet } from "dashboard-common/elements/Sheet"; +import { LoadingLogo } from "dashboard-common/elements/Loading"; import { useAcceptOptIns, useHasOptedIn } from "api/optins"; import { useRouter } from "next/router"; import { ChangeEvent, useEffect, useState } from "react"; diff --git a/npm-packages/dashboard/src/components/login/LoginWithEmail.tsx b/npm-packages/dashboard/src/components/login/LoginWithEmail.tsx index 20c8de76..1acf97e2 100644 --- a/npm-packages/dashboard/src/components/login/LoginWithEmail.tsx +++ b/npm-packages/dashboard/src/components/login/LoginWithEmail.tsx @@ -1,6 +1,7 @@ import { ArrowRightIcon } from "@radix-ui/react-icons"; import classNames from "classnames"; -import { buttonClasses } from "dashboard-common"; +import { buttonClasses } from "dashboard-common/elements/Button"; + import { useRouter } from "next/router"; export function LoginWithEmail({ returnTo }: { returnTo?: string }) { diff --git a/npm-packages/dashboard/src/components/productionProvision/ProvisionProductionDeploymentPage.test.tsx b/npm-packages/dashboard/src/components/productionProvision/ProvisionProductionDeploymentPage.test.tsx index c9481959..e50c8be8 100644 --- a/npm-packages/dashboard/src/components/productionProvision/ProvisionProductionDeploymentPage.test.tsx +++ b/npm-packages/dashboard/src/components/productionProvision/ProvisionProductionDeploymentPage.test.tsx @@ -1,5 +1,6 @@ import { render, cleanup } from "@testing-library/react"; -import { PROVISION_PROD_PAGE_NAME } from "dashboard-common"; + +import { PROVISION_PROD_PAGE_NAME } from "dashboard-common/lib/deploymentContext"; import { ProvisionProductionDeploymentPage } from "./ProvisionProductionDeploymentPage"; jest.mock("api/profile", () => {}); diff --git a/npm-packages/dashboard/src/components/productionProvision/ProvisionProductionDeploymentPage.tsx b/npm-packages/dashboard/src/components/productionProvision/ProvisionProductionDeploymentPage.tsx index e4eda28e..4dc9e7e3 100644 --- a/npm-packages/dashboard/src/components/productionProvision/ProvisionProductionDeploymentPage.tsx +++ b/npm-packages/dashboard/src/components/productionProvision/ProvisionProductionDeploymentPage.tsx @@ -1,5 +1,5 @@ import { useCurrentTeam } from "api/teams"; -import { Sheet } from "dashboard-common"; +import { Sheet } from "dashboard-common/elements/Sheet"; import { useProvisionDeployment } from "api/deployments"; import { useCurrentProject } from "api/projects"; import { useRouter } from "next/router"; diff --git a/npm-packages/dashboard/src/components/profile/EmailCreateForm.tsx b/npm-packages/dashboard/src/components/profile/EmailCreateForm.tsx index fbea8b84..ec6110f1 100644 --- a/npm-packages/dashboard/src/components/profile/EmailCreateForm.tsx +++ b/npm-packages/dashboard/src/components/profile/EmailCreateForm.tsx @@ -1,4 +1,5 @@ -import { Button, TextInput } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { TextInput } from "dashboard-common/elements/TextInput"; import { useFormik } from "formik"; import { useCreateProfileEmail } from "api/profile"; import * as Yup from "yup"; diff --git a/npm-packages/dashboard/src/components/profile/EmailList.tsx b/npm-packages/dashboard/src/components/profile/EmailList.tsx index 1bad66e4..95471677 100644 --- a/npm-packages/dashboard/src/components/profile/EmailList.tsx +++ b/npm-packages/dashboard/src/components/profile/EmailList.tsx @@ -1,5 +1,6 @@ import { PlusIcon } from "@radix-ui/react-icons"; -import { Button, Modal } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { Modal } from "dashboard-common/elements/Modal"; import { useState } from "react"; import { MemberEmailResponse } from "generatedApi"; import { EmailCreateForm } from "./EmailCreateForm"; diff --git a/npm-packages/dashboard/src/components/profile/EmailListItem.tsx b/npm-packages/dashboard/src/components/profile/EmailListItem.tsx index d9f1a962..2cb48861 100644 --- a/npm-packages/dashboard/src/components/profile/EmailListItem.tsx +++ b/npm-packages/dashboard/src/components/profile/EmailListItem.tsx @@ -1,5 +1,6 @@ import { DotsVerticalIcon } from "@radix-ui/react-icons"; -import { ConfirmationDialog, Menu, MenuItem } from "dashboard-common"; +import { ConfirmationDialog } from "dashboard-common/elements/ConfirmationDialog"; +import { Menu, MenuItem } from "dashboard-common/elements/Menu"; import { useDeleteProfileEmail, useResendProfileEmailVerification, diff --git a/npm-packages/dashboard/src/components/profile/Emails.tsx b/npm-packages/dashboard/src/components/profile/Emails.tsx index 09f1867e..4dc88e8e 100644 --- a/npm-packages/dashboard/src/components/profile/Emails.tsx +++ b/npm-packages/dashboard/src/components/profile/Emails.tsx @@ -1,4 +1,4 @@ -import { Sheet } from "dashboard-common"; +import { Sheet } from "dashboard-common/elements/Sheet"; import { MemberEmailResponse } from "generatedApi"; import { EmailList } from "./EmailList"; diff --git a/npm-packages/dashboard/src/components/projects/MemberProjectRoles.tsx b/npm-packages/dashboard/src/components/projects/MemberProjectRoles.tsx index 56560b51..8b809bea 100644 --- a/npm-packages/dashboard/src/components/projects/MemberProjectRoles.tsx +++ b/npm-packages/dashboard/src/components/projects/MemberProjectRoles.tsx @@ -1,4 +1,7 @@ -import { Button, LoadingTransition, Tooltip, Sheet } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { Tooltip } from "dashboard-common/elements/Tooltip"; +import { Sheet } from "dashboard-common/elements/Sheet"; +import { LoadingTransition } from "dashboard-common/elements/Loading"; import { useCurrentProject } from "api/projects"; import { useCurrentTeam, useTeamMembers } from "api/teams"; import { diff --git a/npm-packages/dashboard/src/components/projects/ProjectAdminsFormModal.tsx b/npm-packages/dashboard/src/components/projects/ProjectAdminsFormModal.tsx index c68255b6..31292c4e 100644 --- a/npm-packages/dashboard/src/components/projects/ProjectAdminsFormModal.tsx +++ b/npm-packages/dashboard/src/components/projects/ProjectAdminsFormModal.tsx @@ -1,4 +1,7 @@ -import { Button, Spinner, Checkbox, Modal } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { Spinner } from "dashboard-common/elements/Spinner"; +import { Checkbox } from "dashboard-common/elements/Checkbox"; +import { Modal } from "dashboard-common/elements/Modal"; import { TeamMemberLink } from "elements/TeamMemberLink"; import { ProjectMemberRoleResponse, TeamMemberResponse } from "generatedApi"; import difference from "lodash/difference"; diff --git a/npm-packages/dashboard/src/components/projects/ProjectCard.tsx b/npm-packages/dashboard/src/components/projects/ProjectCard.tsx index f534b071..f99e5f71 100644 --- a/npm-packages/dashboard/src/components/projects/ProjectCard.tsx +++ b/npm-packages/dashboard/src/components/projects/ProjectCard.tsx @@ -4,7 +4,9 @@ import { TrashIcon, } from "@radix-ui/react-icons"; import { Card, CardProps } from "elements/Card"; -import { Tooltip, Loading, TimestampDistance } from "dashboard-common"; +import { Tooltip } from "dashboard-common/elements/Tooltip"; +import { Loading } from "dashboard-common/elements/Loading"; +import { TimestampDistance } from "dashboard-common/elements/TimestampDistance"; import { LostAccessModal } from "components/projects/modals/LostAccessModal"; import { useDeploymentUris } from "hooks/useDeploymentUris"; import classNames from "classnames"; diff --git a/npm-packages/dashboard/src/components/projects/ProjectForm.tsx b/npm-packages/dashboard/src/components/projects/ProjectForm.tsx index f69c1892..ac8aba42 100644 --- a/npm-packages/dashboard/src/components/projects/ProjectForm.tsx +++ b/npm-packages/dashboard/src/components/projects/ProjectForm.tsx @@ -1,4 +1,8 @@ -import { Button, Tooltip, Sheet, useCopy, TextInput } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { Tooltip } from "dashboard-common/elements/Tooltip"; +import { Sheet } from "dashboard-common/elements/Sheet"; +import { TextInput } from "dashboard-common/elements/TextInput"; +import { useCopy } from "dashboard-common/lib/useCopy"; import { CopyIcon } from "@radix-ui/react-icons"; import { useFormik } from "formik"; import { useUpdateProject } from "api/projects"; diff --git a/npm-packages/dashboard/src/components/projects/TransferProject.tsx b/npm-packages/dashboard/src/components/projects/TransferProject.tsx index 97776bba..541278d8 100644 --- a/npm-packages/dashboard/src/components/projects/TransferProject.tsx +++ b/npm-packages/dashboard/src/components/projects/TransferProject.tsx @@ -8,14 +8,12 @@ import { useTeamMembers, useTeamEntitlements, } from "api/teams"; -import { - Sheet, - Combobox, - Button, - Spinner, - Callout, - ConfirmationDialog, -} from "dashboard-common"; +import { Sheet } from "dashboard-common/elements/Sheet"; +import { Combobox } from "dashboard-common/elements/Combobox"; +import { Button } from "dashboard-common/elements/Button"; +import { Spinner } from "dashboard-common/elements/Spinner"; +import { Callout } from "dashboard-common/elements/Callout"; +import { ConfirmationDialog } from "dashboard-common/elements/ConfirmationDialog"; import { useRouter } from "next/router"; import { useState } from "react"; diff --git a/npm-packages/dashboard/src/components/projects/modals/DeleteProjectModal.tsx b/npm-packages/dashboard/src/components/projects/modals/DeleteProjectModal.tsx index 071e7f6e..a91c233f 100644 --- a/npm-packages/dashboard/src/components/projects/modals/DeleteProjectModal.tsx +++ b/npm-packages/dashboard/src/components/projects/modals/DeleteProjectModal.tsx @@ -1,11 +1,9 @@ import { ExclamationTriangleIcon } from "@radix-ui/react-icons"; -import { - Callout, - WaitForDeploymentApi, - LoadingTransition, - ConfirmationDialog, - Checkbox, -} from "dashboard-common"; +import { Callout } from "dashboard-common/elements/Callout"; +import { ConfirmationDialog } from "dashboard-common/elements/ConfirmationDialog"; +import { Checkbox } from "dashboard-common/elements/Checkbox"; +import { LoadingTransition } from "dashboard-common/elements/Loading"; +import { WaitForDeploymentApi } from "dashboard-common/lib/deploymentContext"; import { useDeployments } from "api/deployments"; import { useTeamMembers } from "api/teams"; import { useDeleteProject } from "api/projects"; diff --git a/npm-packages/dashboard/src/components/projects/modals/LostAccessModal.tsx b/npm-packages/dashboard/src/components/projects/modals/LostAccessModal.tsx index 27bb0476..06d420e0 100644 --- a/npm-packages/dashboard/src/components/projects/modals/LostAccessModal.tsx +++ b/npm-packages/dashboard/src/components/projects/modals/LostAccessModal.tsx @@ -1,5 +1,5 @@ import { CodeLine } from "elements/CodeLine"; -import { Modal } from "dashboard-common"; +import { Modal } from "dashboard-common/elements/Modal"; export function LostAccessModal({ onClose, diff --git a/npm-packages/dashboard/src/components/teamSettings/AuditLog.test.tsx b/npm-packages/dashboard/src/components/teamSettings/AuditLog.test.tsx index 8f034529..6a0901df 100644 --- a/npm-packages/dashboard/src/components/teamSettings/AuditLog.test.tsx +++ b/npm-packages/dashboard/src/components/teamSettings/AuditLog.test.tsx @@ -2,7 +2,8 @@ import { render, screen } from "@testing-library/react"; import mockRouter from "next-router-mock"; import { endOfDay, parse, startOfDay } from "date-fns"; import { act } from "react"; -import { DATE_FORMAT } from "dashboard-common"; +import { DATE_FORMAT } from "dashboard-common/elements/DateRangePicker"; + import { AuditLog } from "./AuditLog"; jest.mock("next/router", () => jest.requireActual("next-router-mock")); @@ -30,11 +31,6 @@ jest.mock("api/teams", () => ({ useTeamMembers: () => [], })); -jest.mock("dashboard-common", () => ({ - ...jest.requireActual("dashboard-common"), - DateRangePicker: jest.fn(), -})); - describe("AuditLog", () => { beforeEach(() => { jest.clearAllMocks(); diff --git a/npm-packages/dashboard/src/components/teamSettings/AuditLog.tsx b/npm-packages/dashboard/src/components/teamSettings/AuditLog.tsx index f41ff812..324e80ab 100644 --- a/npm-packages/dashboard/src/components/teamSettings/AuditLog.tsx +++ b/npm-packages/dashboard/src/components/teamSettings/AuditLog.tsx @@ -1,5 +1,7 @@ -import { LoadingTransition, Button, useDateFilters } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; import { endOfDay } from "date-fns"; +import { LoadingTransition } from "dashboard-common/elements/Loading"; +import { useDateFilters } from "dashboard-common/elements/DateRangePicker"; import { useTeamAuditLog } from "hooks/api"; import { useProjects } from "api/projects"; import { useTeamMembers } from "api/teams"; diff --git a/npm-packages/dashboard/src/components/teamSettings/AuditLogContent.test.tsx b/npm-packages/dashboard/src/components/teamSettings/AuditLogContent.test.tsx index 2cebdcef..4b339ee9 100644 --- a/npm-packages/dashboard/src/components/teamSettings/AuditLogContent.test.tsx +++ b/npm-packages/dashboard/src/components/teamSettings/AuditLogContent.test.tsx @@ -18,10 +18,6 @@ jest.mock("../../elements/TeamMemberLink", () => ({ __esModule: true, TeamMemberLink: jest.fn().mockReturnValue(
Mocked TeamMemberLink
), })); -jest.mock("dashboard-common", () => ({ - ...jest.requireActual("dashboard-common"), - DateRangePicker: jest.fn(), -})); describe("AuditLogContent", () => { const team: Team = { diff --git a/npm-packages/dashboard/src/components/teamSettings/AuditLogContent.tsx b/npm-packages/dashboard/src/components/teamSettings/AuditLogContent.tsx index 358f3e41..6a4d25f5 100644 --- a/npm-packages/dashboard/src/components/teamSettings/AuditLogContent.tsx +++ b/npm-packages/dashboard/src/components/teamSettings/AuditLogContent.tsx @@ -1,4 +1,4 @@ -import { Sheet } from "dashboard-common"; +import { Sheet } from "dashboard-common/elements/Sheet"; import { AuditLogEventResponse, MemberResponse, diff --git a/npm-packages/dashboard/src/components/teamSettings/AuditLogItem.tsx b/npm-packages/dashboard/src/components/teamSettings/AuditLogItem.tsx index a47ab8c9..89dfacef 100644 --- a/npm-packages/dashboard/src/components/teamSettings/AuditLogItem.tsx +++ b/npm-packages/dashboard/src/components/teamSettings/AuditLogItem.tsx @@ -1,11 +1,9 @@ import { Disclosure } from "@headlessui/react"; import { ChevronUpIcon, ChevronDownIcon } from "@radix-ui/react-icons"; -import { - stringifyValue, - Button, - ReadonlyCode, - TimestampDistance, -} from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { ReadonlyCode } from "dashboard-common/elements/ReadonlyCode"; +import { TimestampDistance } from "dashboard-common/elements/TimestampDistance"; +import { stringifyValue } from "dashboard-common/lib/stringifyValue"; import { Team, MemberResponse, diff --git a/npm-packages/dashboard/src/components/teamSettings/AuditLogToolbar.tsx b/npm-packages/dashboard/src/components/teamSettings/AuditLogToolbar.tsx index 5c7a0a08..4f35e401 100644 --- a/npm-packages/dashboard/src/components/teamSettings/AuditLogToolbar.tsx +++ b/npm-packages/dashboard/src/components/teamSettings/AuditLogToolbar.tsx @@ -1,4 +1,5 @@ -import { Combobox, Option, DateRangePicker } from "dashboard-common"; +import { Combobox, Option } from "dashboard-common/elements/Combobox"; +import { DateRangePicker } from "dashboard-common/elements/DateRangePicker"; import startCase from "lodash/startCase"; import { endOfToday, startOfDay } from "date-fns"; import sortBy from "lodash/sortBy"; diff --git a/npm-packages/dashboard/src/components/teamSettings/MemberProjectRolesModal.tsx b/npm-packages/dashboard/src/components/teamSettings/MemberProjectRolesModal.tsx index 5e0e32ea..875dc997 100644 --- a/npm-packages/dashboard/src/components/teamSettings/MemberProjectRolesModal.tsx +++ b/npm-packages/dashboard/src/components/teamSettings/MemberProjectRolesModal.tsx @@ -1,4 +1,8 @@ -import { Button, Tooltip, Spinner, Checkbox, Modal } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { Tooltip } from "dashboard-common/elements/Tooltip"; +import { Spinner } from "dashboard-common/elements/Spinner"; +import { Checkbox } from "dashboard-common/elements/Checkbox"; +import { Modal } from "dashboard-common/elements/Modal"; import difference from "lodash/difference"; import React, { useState } from "react"; import type { diff --git a/npm-packages/dashboard/src/components/teamSettings/TeamForm.tsx b/npm-packages/dashboard/src/components/teamSettings/TeamForm.tsx index 4940abca..bcab5090 100644 --- a/npm-packages/dashboard/src/components/teamSettings/TeamForm.tsx +++ b/npm-packages/dashboard/src/components/teamSettings/TeamForm.tsx @@ -1,8 +1,12 @@ import { CopyIcon } from "@radix-ui/react-icons"; -import { Button, Tooltip, Sheet, useCopy, TextInput } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { Tooltip } from "dashboard-common/elements/Tooltip"; +import { Sheet } from "dashboard-common/elements/Sheet"; +import { TextInput } from "dashboard-common/elements/TextInput"; import { useFormik } from "formik"; import { Team } from "generatedApi"; import * as Yup from "yup"; +import { useCopy } from "dashboard-common/lib/useCopy"; export type TeamFormProps = { team: Team; diff --git a/npm-packages/dashboard/src/components/teamSettings/TeamMemberInviteListItem.tsx b/npm-packages/dashboard/src/components/teamSettings/TeamMemberInviteListItem.tsx index cd80f2f1..0aa05936 100644 --- a/npm-packages/dashboard/src/components/teamSettings/TeamMemberInviteListItem.tsx +++ b/npm-packages/dashboard/src/components/teamSettings/TeamMemberInviteListItem.tsx @@ -1,4 +1,4 @@ -import { Button } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; import { Cross2Icon, ReloadIcon } from "@radix-ui/react-icons"; import startCase from "lodash/startCase"; import { diff --git a/npm-packages/dashboard/src/components/teamSettings/TeamMemberListItem.tsx b/npm-packages/dashboard/src/components/teamSettings/TeamMemberListItem.tsx index 286bb544..df32b505 100644 --- a/npm-packages/dashboard/src/components/teamSettings/TeamMemberListItem.tsx +++ b/npm-packages/dashboard/src/components/teamSettings/TeamMemberListItem.tsx @@ -8,14 +8,11 @@ import type { } from "generatedApi"; import { useRouter } from "next/router"; import { useRef, useState } from "react"; -import { - Button, - Tooltip, - Combobox, - Option, - Spinner, - ConfirmationDialog, -} from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { Tooltip } from "dashboard-common/elements/Tooltip"; +import { Combobox, Option } from "dashboard-common/elements/Combobox"; +import { Spinner } from "dashboard-common/elements/Spinner"; +import { ConfirmationDialog } from "dashboard-common/elements/ConfirmationDialog"; import { CaretSortIcon } from "@radix-ui/react-icons"; import { useMount } from "react-use"; import classNames from "classnames"; diff --git a/npm-packages/dashboard/src/components/teamSettings/TeamMemberListSkeleton.tsx b/npm-packages/dashboard/src/components/teamSettings/TeamMemberListSkeleton.tsx index 06d26cd8..d8e799fb 100644 --- a/npm-packages/dashboard/src/components/teamSettings/TeamMemberListSkeleton.tsx +++ b/npm-packages/dashboard/src/components/teamSettings/TeamMemberListSkeleton.tsx @@ -1,4 +1,4 @@ -import { Loading } from "dashboard-common"; +import { Loading } from "dashboard-common/elements/Loading"; export function TeamMemberListSkeleton() { return ( diff --git a/npm-packages/dashboard/src/components/teamSettings/TeamMembers.tsx b/npm-packages/dashboard/src/components/teamSettings/TeamMembers.tsx index 1c99cf03..63b568e8 100644 --- a/npm-packages/dashboard/src/components/teamSettings/TeamMembers.tsx +++ b/npm-packages/dashboard/src/components/teamSettings/TeamMembers.tsx @@ -1,5 +1,6 @@ import { EnvelopeClosedIcon } from "@radix-ui/react-icons"; -import { Callout, Loading } from "dashboard-common"; +import { Callout } from "dashboard-common/elements/Callout"; +import { Loading } from "dashboard-common/elements/Loading"; import { useTeamMembers, useTeamEntitlements } from "api/teams"; import { useTeamInvites } from "api/invitations"; import { useIsCurrentMemberTeamAdmin } from "api/roles"; diff --git a/npm-packages/dashboard/src/components/teamSettings/TeamSettings.tsx b/npm-packages/dashboard/src/components/teamSettings/TeamSettings.tsx index 679186da..4ee336b6 100644 --- a/npm-packages/dashboard/src/components/teamSettings/TeamSettings.tsx +++ b/npm-packages/dashboard/src/components/teamSettings/TeamSettings.tsx @@ -8,7 +8,9 @@ import { useProjects } from "api/projects"; import { useTeamOrbSubscription } from "api/billing"; import { useIsCurrentMemberTeamAdmin } from "api/roles"; import { Team } from "generatedApi"; -import { Sheet, Button, ConfirmationDialog } from "dashboard-common"; +import { Sheet } from "dashboard-common/elements/Sheet"; +import { Button } from "dashboard-common/elements/Button"; +import { ConfirmationDialog } from "dashboard-common/elements/ConfirmationDialog"; import { useState } from "react"; import { TeamForm } from "./TeamForm"; diff --git a/npm-packages/dashboard/src/data/Charts/formatQuantity.ts b/npm-packages/dashboard/src/data/Charts/formatQuantity.ts index 5b7ce27f..624cefe1 100644 --- a/npm-packages/dashboard/src/data/Charts/formatQuantity.ts +++ b/npm-packages/dashboard/src/data/Charts/formatQuantity.ts @@ -2,7 +2,7 @@ import { formatBytes, formatNumber, formatNumberCompact, -} from "dashboard-common"; +} from "dashboard-common/lib/format"; export type QuantityType = // Receives data in units of the given entity name diff --git a/npm-packages/dashboard/src/elements/AskAI.tsx b/npm-packages/dashboard/src/elements/AskAI.tsx index d4b11918..50aed80f 100644 --- a/npm-packages/dashboard/src/elements/AskAI.tsx +++ b/npm-packages/dashboard/src/elements/AskAI.tsx @@ -1,6 +1,6 @@ import Script from "next/script"; import { SparklesIcon } from "@heroicons/react/24/outline"; -import { Button } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; export function AskAI() { return ( diff --git a/npm-packages/dashboard/src/elements/BackupIdentifier.tsx b/npm-packages/dashboard/src/elements/BackupIdentifier.tsx index df057ea7..533b2bad 100644 --- a/npm-packages/dashboard/src/elements/BackupIdentifier.tsx +++ b/npm-packages/dashboard/src/elements/BackupIdentifier.tsx @@ -2,7 +2,7 @@ import { BackupResponse, useGetCloudBackup } from "api/backups"; import { useDeploymentById } from "api/deployments"; import { useCurrentTeam } from "api/teams"; import { useProjectById } from "api/projects"; -import { Loading } from "dashboard-common"; +import { Loading } from "dashboard-common/elements/Loading"; export function BackupIdentifier({ backup }: { backup: BackupResponse }) { const team = useCurrentTeam(); diff --git a/npm-packages/dashboard/src/elements/Card.tsx b/npm-packages/dashboard/src/elements/Card.tsx index 89297b18..1c9ef1e8 100644 --- a/npm-packages/dashboard/src/elements/Card.tsx +++ b/npm-packages/dashboard/src/elements/Card.tsx @@ -3,7 +3,7 @@ import Link from "next/link"; import classNames from "classnames"; import { UrlObject } from "url"; import { DotsVerticalIcon } from "@radix-ui/react-icons"; -import { Menu, MenuItem } from "dashboard-common"; +import { Menu, MenuItem } from "dashboard-common/elements/Menu"; export type CardProps = { cardClassName?: string; diff --git a/npm-packages/dashboard/src/elements/CodeLine.tsx b/npm-packages/dashboard/src/elements/CodeLine.tsx index d548b104..40452705 100644 --- a/npm-packages/dashboard/src/elements/CodeLine.tsx +++ b/npm-packages/dashboard/src/elements/CodeLine.tsx @@ -1,5 +1,5 @@ import classNames from "classnames"; -import { CopyButton } from "dashboard-common"; +import { CopyButton } from "dashboard-common/elements/CopyButton"; // Pass a list of words/tokens to prevent line-wrapping in the middle // of them, like in `--foo=bar`. diff --git a/npm-packages/dashboard/src/elements/SelectorItem.tsx b/npm-packages/dashboard/src/elements/SelectorItem.tsx index 5444b933..d877936d 100644 --- a/npm-packages/dashboard/src/elements/SelectorItem.tsx +++ b/npm-packages/dashboard/src/elements/SelectorItem.tsx @@ -3,7 +3,8 @@ import { ChevronDownIcon, SewingPinFilledIcon, } from "@radix-ui/react-icons"; -import { Button, Tooltip } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { Tooltip } from "dashboard-common/elements/Tooltip"; import { HTMLAttributeAnchorTarget, ReactNode } from "react"; import Link, { LinkProps } from "next/link"; import { cn } from "lib/cn"; diff --git a/npm-packages/dashboard/src/elements/SupportWidget.tsx b/npm-packages/dashboard/src/elements/SupportWidget.tsx index fa40f0f4..dfebe73b 100644 --- a/npm-packages/dashboard/src/elements/SupportWidget.tsx +++ b/npm-packages/dashboard/src/elements/SupportWidget.tsx @@ -6,14 +6,12 @@ import { ExternalLinkIcon, } from "@radix-ui/react-icons"; import { captureException, captureMessage } from "@sentry/nextjs"; -import { - Button, - ClosePanelButton, - Spinner, - toast, - Sheet, - TextInput, -} from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { ClosePanelButton } from "dashboard-common/elements/ClosePanelButton"; +import { Spinner } from "dashboard-common/elements/Spinner"; +import { toast } from "dashboard-common/lib/utils"; +import { Sheet } from "dashboard-common/elements/Sheet"; +import { TextInput } from "dashboard-common/elements/TextInput"; import { useFormik } from "formik"; import { useCurrentDeployment } from "api/deployments"; import { useCurrentTeam } from "api/teams"; diff --git a/npm-packages/dashboard/src/elements/UserErrorBoundary.tsx b/npm-packages/dashboard/src/elements/UserErrorBoundary.tsx index 714e1ead..f2a72733 100644 --- a/npm-packages/dashboard/src/elements/UserErrorBoundary.tsx +++ b/npm-packages/dashboard/src/elements/UserErrorBoundary.tsx @@ -2,7 +2,7 @@ import { captureException } from "@sentry/nextjs"; import Link from "next/link"; import React from "react"; -import { Callout } from "dashboard-common"; +import { Callout } from "dashboard-common/elements/Callout"; export function Fallback({ eventId }: { eventId: string | null }) { return ( diff --git a/npm-packages/dashboard/src/hooks/api.tsx b/npm-packages/dashboard/src/hooks/api.tsx index 0beb4e1b..ee920bea 100644 --- a/npm-packages/dashboard/src/hooks/api.tsx +++ b/npm-packages/dashboard/src/hooks/api.tsx @@ -1,17 +1,15 @@ import useSWR, { SWRConfiguration } from "swr"; import useSWRInfinite from "swr/infinite"; -import { - toast, - Button, - LocalDevCallout, - ProjectEnvVarConfig, -} from "dashboard-common"; +import { toast } from "dashboard-common/lib/utils"; +import { Button } from "dashboard-common/elements/Button"; import { SymbolIcon } from "@radix-ui/react-icons"; import { captureMessage } from "@sentry/nextjs"; import flatMap from "lodash/flatMap"; import { useCallback } from "react"; import { AuditLogAction, AuditLogEventResponse } from "generatedApi"; +import { LocalDevCallout } from "dashboard-common/elements/Callout"; +import { ProjectEnvVarConfig } from "dashboard-common/features/settings/lib/types"; import { fetchWithAuthHeader, useAuthHeader } from "./fetching"; import { useMutation } from "./useMutation"; diff --git a/npm-packages/dashboard/src/hooks/deploymentApi.tsx b/npm-packages/dashboard/src/hooks/deploymentApi.tsx index 7fbbd944..1cd8e330 100644 --- a/npm-packages/dashboard/src/hooks/deploymentApi.tsx +++ b/npm-packages/dashboard/src/hooks/deploymentApi.tsx @@ -7,16 +7,11 @@ import { } from "react"; import { useRouter } from "next/router"; import { - DeploymentApiProviderProps, - DeploymentApiProvider, - ConnectedDeploymentContext, - DeploymentInfoContext, - DeploymentInfo, useAdminKey, useDeploymentAuthHeader, useDeploymentUrl, - toast, -} from "dashboard-common"; +} from "dashboard-common/lib/deploymentApi"; +import { toast } from "dashboard-common/lib/utils"; import { CompletedExport, DatadogSiteLocation, @@ -39,6 +34,13 @@ import { } from "@sentry/nextjs"; import { reportHttpError } from "hooks/fetching"; import { Fallback } from "pages/500"; +import { + ConnectedDeploymentContext, + DeploymentApiProvider, + DeploymentApiProviderProps, + DeploymentInfo, + DeploymentInfoContext, +} from "dashboard-common/lib/deploymentContext"; import { useAccessToken } from "./useServerSideData"; import { useCurrentProject } from "../api/projects"; import { useTeamUsageState } from "./useTeamUsageState"; diff --git a/npm-packages/dashboard/src/hooks/fetching.ts b/npm-packages/dashboard/src/hooks/fetching.ts index ff7d87b6..f59ebbd9 100644 --- a/npm-packages/dashboard/src/hooks/fetching.ts +++ b/npm-packages/dashboard/src/hooks/fetching.ts @@ -1,6 +1,10 @@ import { Middleware } from "swr"; import { captureException, captureMessage } from "@sentry/nextjs"; -import { deploymentFetch, translateResponse } from "dashboard-common"; + +import { + deploymentFetch, + translateResponse, +} from "dashboard-common/lib/fetching"; import { useAccessToken } from "./useServerSideData"; export function useAuthHeader() { diff --git a/npm-packages/dashboard/src/hooks/swrConfig.tsx b/npm-packages/dashboard/src/hooks/swrConfig.tsx index 5bc796ad..b1a41f86 100644 --- a/npm-packages/dashboard/src/hooks/swrConfig.tsx +++ b/npm-packages/dashboard/src/hooks/swrConfig.tsx @@ -1,6 +1,6 @@ import { SWRConfiguration } from "swr"; import { captureException } from "@sentry/nextjs"; -import { backoffWithJitter, toast } from "dashboard-common"; +import { backoffWithJitter, toast } from "dashboard-common/lib/utils"; import Link from "next/link"; import React from "react"; import { bigBrainAuth, fetchWithAuthHeader } from "./fetching"; diff --git a/npm-packages/dashboard/src/hooks/useCreateProjectModal.tsx b/npm-packages/dashboard/src/hooks/useCreateProjectModal.tsx index 02606f3b..c967e27c 100644 --- a/npm-packages/dashboard/src/hooks/useCreateProjectModal.tsx +++ b/npm-packages/dashboard/src/hooks/useCreateProjectModal.tsx @@ -1,4 +1,8 @@ -import { Modal, TextInput, Button, Loading, Spinner } from "dashboard-common"; +import { Modal } from "dashboard-common/elements/Modal"; +import { TextInput } from "dashboard-common/elements/TextInput"; +import { Button } from "dashboard-common/elements/Button"; +import { Loading } from "dashboard-common/elements/Loading"; +import { Spinner } from "dashboard-common/elements/Spinner"; import { ReactElement, useState } from "react"; import { useRouter } from "next/router"; import { useFormik } from "formik"; diff --git a/npm-packages/dashboard/src/hooks/useDeploymentUris.tsx b/npm-packages/dashboard/src/hooks/useDeploymentUris.tsx index 34d1f4d1..312905f0 100644 --- a/npm-packages/dashboard/src/hooks/useDeploymentUris.tsx +++ b/npm-packages/dashboard/src/hooks/useDeploymentUris.tsx @@ -1,7 +1,7 @@ -import { PROVISION_PROD_PAGE_NAME } from "dashboard-common"; import { useRouter } from "next/router"; import { useTeams } from "api/teams"; import { useDefaultDevDeployment, useDeployments } from "api/deployments"; +import { PROVISION_PROD_PAGE_NAME } from "dashboard-common/lib/deploymentContext"; import { useLaunchDarkly } from "./useLaunchDarkly"; export function useDeploymentUris( diff --git a/npm-packages/dashboard/src/hooks/useMutation.ts b/npm-packages/dashboard/src/hooks/useMutation.ts index e3c84df4..ad264707 100644 --- a/npm-packages/dashboard/src/hooks/useMutation.ts +++ b/npm-packages/dashboard/src/hooks/useMutation.ts @@ -1,4 +1,4 @@ -import { toast } from "dashboard-common"; +import { toast } from "dashboard-common/lib/utils"; import { useCallback } from "react"; import { useSWRConfig } from "swr"; import { reportHttpError, useAuthHeader } from "./fetching"; diff --git a/npm-packages/dashboard/src/layouts/DeploymentDashboardLayout.tsx b/npm-packages/dashboard/src/layouts/DeploymentDashboardLayout.tsx index 2b80d5bd..f4f3aaaf 100644 --- a/npm-packages/dashboard/src/layouts/DeploymentDashboardLayout.tsx +++ b/npm-packages/dashboard/src/layouts/DeploymentDashboardLayout.tsx @@ -1,8 +1,5 @@ import { GoogleAnalytics } from "elements/GoogleAnalytics"; -import { - WaitForDeploymentApi, - DeploymentDashboardLayout as CommonDeploymentDashboardLayout, -} from "dashboard-common"; + import { useCurrentDeployment, useDeployments } from "api/deployments"; import { useTeamEntitlements } from "api/teams"; import { useCurrentProject } from "api/projects"; @@ -14,6 +11,8 @@ import { useGlobalLDContext, useLDContextWithDeployment, } from "hooks/useLaunchDarklyContext"; +import { WaitForDeploymentApi } from "dashboard-common/lib/deploymentContext"; +import { DeploymentDashboardLayout as CommonDeploymentDashboardLayout } from "dashboard-common/layouts/DeploymentDashboardLayout"; type LayoutProps = { children: JSX.Element; diff --git a/npm-packages/dashboard/src/layouts/LoginLayout.tsx b/npm-packages/dashboard/src/layouts/LoginLayout.tsx index ca3f82b0..a6108333 100644 --- a/npm-packages/dashboard/src/layouts/LoginLayout.tsx +++ b/npm-packages/dashboard/src/layouts/LoginLayout.tsx @@ -1,5 +1,5 @@ import React, { ReactNode } from "react"; -import { ConvexLogo } from "dashboard-common"; +import { ConvexLogo } from "dashboard-common/elements/ConvexLogo"; import { GoogleAnalytics } from "elements/GoogleAnalytics"; import FlourishTop from "components/login/images/flourish-top.svg"; diff --git a/npm-packages/dashboard/src/layouts/TeamSettingsLayout.tsx b/npm-packages/dashboard/src/layouts/TeamSettingsLayout.tsx index afb90902..93a0f6e3 100644 --- a/npm-packages/dashboard/src/layouts/TeamSettingsLayout.tsx +++ b/npm-packages/dashboard/src/layouts/TeamSettingsLayout.tsx @@ -1,10 +1,12 @@ import classNames from "classnames"; -import { Loading, SidebarLink, PageContent } from "dashboard-common"; +import { Loading } from "dashboard-common/elements/Loading"; +import { PageContent } from "dashboard-common/elements/PageContent"; import { useCurrentTeam, useTeamEntitlements } from "api/teams"; import startCase from "lodash/startCase"; import Head from "next/head"; import React from "react"; import { Team } from "generatedApi"; +import { SidebarLink } from "dashboard-common/elements/Sidebar"; export function TeamSettingsLayout({ page: selectedPage, diff --git a/npm-packages/dashboard/src/lib/withAuthenticatedPage.tsx b/npm-packages/dashboard/src/lib/withAuthenticatedPage.tsx index 6c09aeab..71f15c60 100644 --- a/npm-packages/dashboard/src/lib/withAuthenticatedPage.tsx +++ b/npm-packages/dashboard/src/lib/withAuthenticatedPage.tsx @@ -7,7 +7,9 @@ import type { InferGetServerSidePropsType, NextPage } from "next"; import { getServerSideProps } from "lib/ssr"; import { useEffect } from "react"; import { useAccessToken, useInitialData } from "hooks/useServerSideData"; -import { LoadingLogo, Button, Callout } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { Callout } from "dashboard-common/elements/Callout"; +import { LoadingLogo } from "dashboard-common/elements/Loading"; import Link from "next/link"; interface UserProps { diff --git a/npm-packages/dashboard/src/pages/404.tsx b/npm-packages/dashboard/src/pages/404.tsx index d1dd79be..8870658e 100644 --- a/npm-packages/dashboard/src/pages/404.tsx +++ b/npm-packages/dashboard/src/pages/404.tsx @@ -1,4 +1,4 @@ -import { Button } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; import { LoginLayout } from "layouts/LoginLayout"; import { useRouter } from "next/router"; diff --git a/npm-packages/dashboard/src/pages/500.tsx b/npm-packages/dashboard/src/pages/500.tsx index f18e8a3a..7944ba31 100644 --- a/npm-packages/dashboard/src/pages/500.tsx +++ b/npm-packages/dashboard/src/pages/500.tsx @@ -1,4 +1,4 @@ -import { Callout } from "dashboard-common"; +import { Callout } from "dashboard-common/elements/Callout"; import Link from "next/link"; export default function Custom500() { diff --git a/npm-packages/dashboard/src/pages/[[...route]].tsx b/npm-packages/dashboard/src/pages/[[...route]].tsx index 4f8fd962..2ae1eed2 100644 --- a/npm-packages/dashboard/src/pages/[[...route]].tsx +++ b/npm-packages/dashboard/src/pages/[[...route]].tsx @@ -1,7 +1,7 @@ import { useRouter } from "next/router"; import { useTeams } from "api/teams"; import { useEffect } from "react"; -import { Loading } from "dashboard-common"; +import { Loading } from "dashboard-common/elements/Loading"; import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; export { getServerSideProps } from "lib/ssr"; diff --git a/npm-packages/dashboard/src/pages/_app.tsx b/npm-packages/dashboard/src/pages/_app.tsx index f48d0611..26836c06 100644 --- a/npm-packages/dashboard/src/pages/_app.tsx +++ b/npm-packages/dashboard/src/pages/_app.tsx @@ -28,12 +28,10 @@ import { RefreshSession } from "components/login/RefreshSession"; import { useDashboardVersion } from "hooks/api"; import { useProfile } from "api/profile"; import { useGlobalLDContext, useLDContext } from "hooks/useLaunchDarklyContext"; -import { - Favicon, - LoadingLogo, - ThemeConsumer, - ToastContainer, -} from "dashboard-common"; +import { Favicon } from "dashboard-common/elements/Favicon"; +import { ThemeConsumer } from "dashboard-common/elements/ThemeConsumer"; +import { ToastContainer } from "dashboard-common/elements/ToastContainer"; +import { LoadingLogo } from "dashboard-common/elements/Loading"; import { ThemeProvider } from "next-themes"; import { CurrentDeploymentDashboardLayout } from "layouts/DeploymentDashboardLayout"; import posthog from "posthog-js"; diff --git a/npm-packages/dashboard/src/pages/auth.tsx b/npm-packages/dashboard/src/pages/auth.tsx index 3c16674e..cace1e52 100644 --- a/npm-packages/dashboard/src/pages/auth.tsx +++ b/npm-packages/dashboard/src/pages/auth.tsx @@ -1,7 +1,9 @@ import { LoginLayout } from "layouts/LoginLayout"; import { useAuth0 } from "hooks/useAuth0"; import classNames from "classnames"; -import { Snippet, Loading, Button } from "dashboard-common"; +import { Snippet } from "dashboard-common/elements/Snippet"; +import { Loading } from "dashboard-common/elements/Loading"; +import { Button } from "dashboard-common/elements/Button"; import { GoogleAnalytics } from "elements/GoogleAnalytics"; import { useRouter } from "next/router"; import { useAccessToken } from "hooks/useServerSideData"; diff --git a/npm-packages/dashboard/src/pages/discord.tsx b/npm-packages/dashboard/src/pages/discord.tsx index 1a280f96..57cc0d77 100644 --- a/npm-packages/dashboard/src/pages/discord.tsx +++ b/npm-packages/dashboard/src/pages/discord.tsx @@ -1,4 +1,5 @@ -import { Loading, toast } from "dashboard-common"; +import { Loading } from "dashboard-common/elements/Loading"; +import { toast } from "dashboard-common/lib/utils"; import { useDiscordAuthorize } from "api/discord"; import { useAuthHeader } from "hooks/fetching"; import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; diff --git a/npm-packages/dashboard/src/pages/invite/[inviteId].tsx b/npm-packages/dashboard/src/pages/invite/[inviteId].tsx index bebd7bce..2fb04a75 100644 --- a/npm-packages/dashboard/src/pages/invite/[inviteId].tsx +++ b/npm-packages/dashboard/src/pages/invite/[inviteId].tsx @@ -3,10 +3,14 @@ import { useAuthHeader } from "hooks/fetching"; import { useEffect, useState } from "react"; import { LoginLayout } from "layouts/LoginLayout"; import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; -import { Sheet, LoadingLogo, LoadingTransition } from "dashboard-common"; +import { Sheet } from "dashboard-common/elements/Sheet"; import { useProfileEmails } from "api/profile"; import { EmailList } from "components/profile/EmailList"; import { useAcceptInvite } from "api/invitations"; +import { + LoadingTransition, + LoadingLogo, +} from "dashboard-common/elements/Loading"; export { getServerSideProps } from "lib/ssr"; diff --git a/npm-packages/dashboard/src/pages/profile.tsx b/npm-packages/dashboard/src/pages/profile.tsx index 39bbca74..781ffa99 100644 --- a/npm-packages/dashboard/src/pages/profile.tsx +++ b/npm-packages/dashboard/src/pages/profile.tsx @@ -1,14 +1,11 @@ import { useAuth0 } from "hooks/useAuth0"; -import { - Sheet, - LoadingTransition, - Button, - Tooltip, - Spinner, - TextInput, - ConfirmationDialog, -} from "dashboard-common"; -import { useTheme } from "next-themes"; +import { Sheet } from "dashboard-common/elements/Sheet"; +import { Button } from "dashboard-common/elements/Button"; +import { Tooltip } from "dashboard-common/elements/Tooltip"; +import { Spinner } from "dashboard-common/elements/Spinner"; +import { TextInput } from "dashboard-common/elements/TextInput"; +import { ConfirmationDialog } from "dashboard-common/elements/ConfirmationDialog"; + import { RadioGroup } from "@headlessui/react"; import classNames from "classnames"; import { CheckCircledIcon } from "@radix-ui/react-icons"; @@ -25,6 +22,8 @@ import { UserProfile } from "@auth0/nextjs-auth0/client"; import { Emails } from "components/profile/Emails"; import { DiscordAccounts } from "components/profile/DiscordAccounts"; import { MemberResponse } from "generatedApi"; +import { LoadingTransition } from "dashboard-common/elements/Loading"; +import { useTheme } from "next-themes"; export { getServerSideProps } from "lib/ssr"; diff --git a/npm-packages/dashboard/src/pages/settings/billing.tsx b/npm-packages/dashboard/src/pages/settings/billing.tsx index 0907660b..633db52a 100644 --- a/npm-packages/dashboard/src/pages/settings/billing.tsx +++ b/npm-packages/dashboard/src/pages/settings/billing.tsx @@ -1,6 +1,6 @@ import { useRouter } from "next/router"; import { useEffect } from "react"; -import { Loading } from "dashboard-common"; +import { Loading } from "dashboard-common/elements/Loading"; import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; import { useCurrentTeam } from "api/teams"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/data.tsx b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/data.tsx index 11d7a32c..a60274fd 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/data.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/data.tsx @@ -1,5 +1,5 @@ -import { DataView } from "dashboard-common"; import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; +import { DataView } from "dashboard-common/features/data/components/DataView"; export { getServerSideProps } from "lib/ssr"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/files.tsx b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/files.tsx index eb55845a..f38dd78a 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/files.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/files.tsx @@ -1,5 +1,5 @@ -import { FileStorageView } from "dashboard-common"; import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; +import { FileStorageView } from "dashboard-common/features/files/components/FileStorageView"; export { getServerSideProps } from "lib/ssr"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/functions.tsx b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/functions.tsx index 63f1519c..1eac3939 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/functions.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/functions.tsx @@ -1,5 +1,5 @@ import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; -import { FunctionsView } from "dashboard-common"; +import { FunctionsView } from "dashboard-common/features/functions/components/FunctionsView"; export { getServerSideProps } from "lib/ssr"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/history.tsx b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/history.tsx index 1ca8d207..d50294d1 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/history.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/history.tsx @@ -1,5 +1,5 @@ -import { HistoryView } from "dashboard-common"; import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; +import { HistoryView } from "dashboard-common/features/history/components/HistoryView"; export { getServerSideProps } from "lib/ssr"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/logs.tsx b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/logs.tsx index 24d771b9..0a5758dd 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/logs.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/logs.tsx @@ -1,5 +1,5 @@ -import { LogsView } from "dashboard-common"; import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; +import { LogsView } from "dashboard-common/features/logs/components/LogsView"; export { getServerSideProps } from "lib/ssr"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/schedules/functions.tsx b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/schedules/functions.tsx index 59f71599..316c16f7 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/schedules/functions.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/schedules/functions.tsx @@ -1,5 +1,5 @@ import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; -import { ScheduledFunctionsView } from "dashboard-common"; +import { ScheduledFunctionsView } from "dashboard-common/features/schedules/components/ScheduledFunctionsView"; export { getServerSideProps } from "lib/ssr"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/authentication.tsx b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/authentication.tsx index f21b4002..e025f5a4 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/authentication.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/authentication.tsx @@ -1,5 +1,5 @@ import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; -import { AuthenticationView } from "dashboard-common"; +import { AuthenticationView } from "dashboard-common/features/settings/components/AuthenticationView"; export { getServerSideProps } from "lib/ssr"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/backups.tsx b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/backups.tsx index 29038595..1d873673 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/backups.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/backups.tsx @@ -1,5 +1,6 @@ import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; -import { DeploymentSettingsLayout, Loading } from "dashboard-common"; +import { Loading } from "dashboard-common/elements/Loading"; +import { DeploymentSettingsLayout } from "dashboard-common/layouts/DeploymentSettingsLayout"; import { Backups } from "components/deploymentSettings/Backups"; import { useCurrentDeployment } from "api/deployments"; import { useCurrentTeam, useTeamEntitlements } from "api/teams"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/components.tsx b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/components.tsx index 2006f149..bdb5808f 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/components.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/components.tsx @@ -1,5 +1,5 @@ import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; -import { ComponentsView } from "dashboard-common"; +import { ComponentsView } from "dashboard-common/features/settings/components/ComponentsView"; export { getServerSideProps } from "lib/ssr"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/environment-variables.tsx b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/environment-variables.tsx index 04713251..299b2b4c 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/environment-variables.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/environment-variables.tsx @@ -1,5 +1,5 @@ import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; -import { EnvironmentVariablesView } from "dashboard-common"; +import { EnvironmentVariablesView } from "dashboard-common/features/settings/components/EnvironmentVariablesView"; export { getServerSideProps } from "lib/ssr"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/index.tsx b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/index.tsx index b01fd127..c584a200 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/index.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/index.tsx @@ -1,16 +1,16 @@ import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; -import { - DeploymentSettingsLayout, - Sheet, - DeploymentUrl, - HttpActionsUrl, -} from "dashboard-common"; +import { Sheet } from "dashboard-common/elements/Sheet"; import { NonProdDeploymentWarning } from "components/deploymentSettings/NonProdDeploymentWarning"; import { DeployKeysForDeployment } from "components/deploymentSettings/DeployKeysForDeployment"; import { useCurrentDeployment } from "api/deployments"; import { useRouter } from "next/router"; import { usePathname } from "next/navigation"; import { DeletePreviewDeployment } from "components/deploymentSettings/DeletePreviewDeployment"; +import { DeploymentSettingsLayout } from "dashboard-common/layouts/DeploymentSettingsLayout"; +import { + DeploymentUrl, + HttpActionsUrl, +} from "dashboard-common/features/settings/components/DeploymentUrl"; export { getServerSideProps } from "lib/ssr"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/integrations.tsx b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/integrations.tsx index 9dde1ada..e23847c6 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/integrations.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/integrations.tsx @@ -2,7 +2,8 @@ import { useQuery } from "convex/react"; import udfs from "udfs"; import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; import { Integrations } from "components/integrations/Integrations"; -import { DeploymentSettingsLayout, LoadingTransition } from "dashboard-common"; +import { DeploymentSettingsLayout } from "dashboard-common/layouts/DeploymentSettingsLayout"; +import { LoadingTransition } from "dashboard-common/elements/Loading"; import { useCurrentTeam, useTeamEntitlements } from "api/teams"; export { getServerSideProps } from "lib/ssr"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/pause-deployment.tsx b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/pause-deployment.tsx index 7dd0d914..c30ff448 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/pause-deployment.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/pause-deployment.tsx @@ -1,6 +1,7 @@ import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; -import { DeploymentSettingsLayout } from "dashboard-common"; + import { PauseDeployment } from "components/deploymentSettings/PauseDeployment"; +import { DeploymentSettingsLayout } from "dashboard-common/layouts/DeploymentSettingsLayout"; export { getServerSideProps } from "lib/ssr"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/snapshots.tsx b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/snapshots.tsx index b9b30d6e..8ad4dcb0 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/snapshots.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/[project]/[deploymentName]/settings/snapshots.tsx @@ -1,7 +1,8 @@ import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; -import { DeploymentSettingsLayout } from "dashboard-common"; + import { SnapshotExport } from "components/deploymentSettings/SnapshotExport"; import { SnapshotImport } from "components/deploymentSettings/SnapshotImport"; +import { DeploymentSettingsLayout } from "dashboard-common/layouts/DeploymentSettingsLayout"; export { getServerSideProps } from "lib/ssr"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/[project]/index.tsx b/npm-packages/dashboard/src/pages/t/[team]/[project]/index.tsx index f4b5e21a..bf66a6b8 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/[project]/index.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/[project]/index.tsx @@ -3,7 +3,7 @@ import { useCurrentTeam } from "api/teams"; import { useProjects } from "api/projects"; import { useProfile } from "api/profile"; import { useRouter } from "next/router"; -import { Loading } from "dashboard-common"; +import { Loading } from "dashboard-common/elements/Loading"; import { useEffect } from "react"; import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/[project]/settings.tsx b/npm-packages/dashboard/src/pages/t/[team]/[project]/settings.tsx index 8a6e81cb..d4f05e96 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/[project]/settings.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/[project]/settings.tsx @@ -1,13 +1,10 @@ import { DeleteProjectModal } from "components/projects/modals/DeleteProjectModal"; -import { - PageContent, - Loading, - Button, - Sheet, - Callout, - LocalDevCallout, - DeploymentType, -} from "dashboard-common"; +import { PageContent } from "dashboard-common/elements/PageContent"; +import { Loading } from "dashboard-common/elements/Loading"; +import { Button } from "dashboard-common/elements/Button"; +import { Sheet } from "dashboard-common/elements/Sheet"; +import { Callout, LocalDevCallout } from "dashboard-common/elements/Callout"; +import { DeploymentType } from "dashboard-common/features/settings/components/DeploymentUrl"; import { useDeployments } from "api/deployments"; import { useCurrentTeam, useTeamEntitlements } from "api/teams"; import { useCurrentProject } from "api/projects"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/index.tsx b/npm-packages/dashboard/src/pages/t/[team]/index.tsx index a708b3a5..5052c4df 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/index.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/index.tsx @@ -4,12 +4,10 @@ import { PlusIcon, RocketIcon, } from "@radix-ui/react-icons"; -import { - Button, - useGlobalLocalStorage, - Callout, - TextInput, -} from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; +import { Callout } from "dashboard-common/elements/Callout"; +import { TextInput } from "dashboard-common/elements/TextInput"; +import { useGlobalLocalStorage } from "dashboard-common/lib/useGlobalLocalStorage"; import { ProjectCard } from "components/projects/ProjectCard"; import { useProjects } from "api/projects"; import { useCurrentTeam, useTeamEntitlements } from "api/teams"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/settings/audit-log.tsx b/npm-packages/dashboard/src/pages/t/[team]/settings/audit-log.tsx index 2e28cd9e..d6400762 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/settings/audit-log.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/settings/audit-log.tsx @@ -1,4 +1,5 @@ -import { Loading, toast } from "dashboard-common"; +import { Loading } from "dashboard-common/elements/Loading"; +import { toast } from "dashboard-common/lib/utils"; import { AuditLog } from "components/teamSettings/AuditLog"; import { useCurrentTeam, useTeamEntitlements } from "api/teams"; import { TeamSettingsLayout } from "layouts/TeamSettingsLayout"; diff --git a/npm-packages/dashboard/src/pages/t/[team]/settings/billing.tsx b/npm-packages/dashboard/src/pages/t/[team]/settings/billing.tsx index f0a8357f..fd4d739a 100644 --- a/npm-packages/dashboard/src/pages/t/[team]/settings/billing.tsx +++ b/npm-packages/dashboard/src/pages/t/[team]/settings/billing.tsx @@ -1,4 +1,6 @@ -import { Sheet, Callout, LocalDevCallout, Button } from "dashboard-common"; +import { Sheet } from "dashboard-common/elements/Sheet"; +import { Callout, LocalDevCallout } from "dashboard-common/elements/Callout"; +import { Button } from "dashboard-common/elements/Button"; import { useTeamMembers } from "api/teams"; import { useListPlans, useTeamOrbSubscription } from "api/billing"; import { useIsCurrentMemberTeamAdmin } from "api/roles"; diff --git a/npm-packages/dashboard/src/pages/verify.tsx b/npm-packages/dashboard/src/pages/verify.tsx index ebc4a411..cfd58ac8 100644 --- a/npm-packages/dashboard/src/pages/verify.tsx +++ b/npm-packages/dashboard/src/pages/verify.tsx @@ -1,4 +1,4 @@ -import { Button } from "dashboard-common"; +import { Button } from "dashboard-common/elements/Button"; import { useVerifyProfileEmail } from "api/profile"; import { LoginLayout } from "layouts/LoginLayout"; import { withAuthenticatedPage } from "lib/withAuthenticatedPage"; diff --git a/npm-packages/dashboard/tsconfig.json b/npm-packages/dashboard/tsconfig.json index 1fc7fa7e..d6af0624 100644 --- a/npm-packages/dashboard/tsconfig.json +++ b/npm-packages/dashboard/tsconfig.json @@ -18,7 +18,6 @@ "baseUrl": "src", "customConditions": ["convex-internal-types"], "paths": { - "dashboard-common": ["../../dashboard-common/src"], "dashboard-common/*": ["../../dashboard-common/src/*"], "@common/*": ["../../dashboard-common/src/*"] }