Skip to content

refactor: aliases #1158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions scripts/verifyTourStepIdsUniqueness.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import fs from "fs";
import path from "path";
import { fileURLToPath } from "url";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const FileName = fileURLToPath(import.meta.url);
const DirectoryName = path.dirname(FileName);

function verifyTourStepIdsUniqueness() {
try {
const tourConstantsPath = path.resolve(__dirname, "../src/constants/tour.constants.ts");
const tourConstantsPath = path.resolve(DirectoryName, "../src/constants/tour.constants.ts");
const fileContent = fs.readFileSync(tourConstantsPath, "utf8");

const tourStepsMatch = fileContent.match(/export const tourSteps = ({[\s\S]*?}) as const;/);
Expand Down
6 changes: 3 additions & 3 deletions src/api/grpc/transport.grpc.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import {
import { createConnectTransport } from "@connectrpc/connect-web";

import { apiRequestTimeout, descopeProjectId } from "@constants";
import { LocalStorageKeys } from "@src/enums";
import { useOrganizationStore } from "@src/store/useOrganizationStore";
import { getApiBaseUrl, getLocalStorageValue } from "@src/utilities";
import { LocalStorageKeys } from "@enums";
import { useOrganizationStore } from "@store/useOrganizationStore";
import { getApiBaseUrl, getLocalStorageValue } from "@utilities";

type RequestType = UnaryRequest<any, any> | StreamRequest<any, any>;
type ResponseType = UnaryResponse<any, any> | StreamResponse<any, any>;
Expand Down
2 changes: 1 addition & 1 deletion src/autokitteh
Submodule autokitteh updated 323 files
4 changes: 2 additions & 2 deletions src/components/atoms/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from "react";

import { AnimatePresence, motion } from "motion/react";

import { BadgeProps } from "@src/interfaces/components";
import { cn } from "@src/utilities";
import { BadgeProps } from "@interfaces/components";
import { cn } from "@utilities";

export const Badge = ({
anchorOrigin = { vertical: "top", horizontal: "right" },
Expand Down
4 changes: 2 additions & 2 deletions src/components/atoms/checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { KeyboardEvent, useId } from "react";

import { IconSvg } from "./icons";
import { CheckboxProps } from "@src/interfaces/components";
import { cn } from "@src/utilities";
import { CheckboxProps } from "@interfaces/components";
import { cn } from "@utilities";

import { Loader } from "@components/atoms/loader";

Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/dashedArrow.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

import { cn } from "@src/utilities";
import { cn } from "@utilities";

export const DashedArrow = ({ style, className }: { className: string; style: React.CSSProperties }) => {
const arrowClass = cn("dashed-arrow", className);
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/radioButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

import { RadioButtonProps } from "@src/interfaces/components";
import { RadioButtonProps } from "@interfaces/components";

import { IconSvg } from "@components/atoms/icons";

Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/statusBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from "react";

import { t } from "i18next";

import { DeploymentStateVariant } from "@enums";
import { DeploymentStatusBadgeProps } from "@interfaces/components";
import { DeploymentStateVariant } from "@src/enums";
import { cn } from "@utilities";

export const StatusBadge = ({ className, deploymentStatus }: DeploymentStatusBadgeProps) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/table/table.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";

import { TableProps } from "@interfaces/components";
import { ColorSchemes } from "@src/types";
import { ColorSchemes } from "@type";
import { cn } from "@utilities";

import { TableVariantProvider } from "@components/atoms/table";
Expand Down
2 changes: 1 addition & 1 deletion src/components/atoms/table/tableVariantProvider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { ReactNode, createContext, useContext } from "react";

import { TableVariantContextType } from "@interfaces/components";
import { ColorSchemes } from "@src/types";
import { ColorSchemes } from "@type";

const TableVariantContext = createContext<TableVariantContextType>({ variant: "dark" });

Expand Down
4 changes: 2 additions & 2 deletions src/components/atoms/tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { useState } from "react";

import { FloatingPortal, offset, useFloating, useHover, useInteractions, shift } from "@floating-ui/react";

import { TooltipProps } from "@src/interfaces/components";
import { cn } from "@src/utilities";
import { TooltipProps } from "@interfaces/components";
import { cn } from "@utilities";

export const Tooltip = ({
content,
Expand Down
4 changes: 2 additions & 2 deletions src/components/molecules/accordion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { useCallback, useState } from "react";

import { AnimatePresence, motion } from "motion/react";

import { AccordionProps } from "@src/interfaces/components";
import { cn } from "@src/utilities";
import { AccordionProps } from "@interfaces/components";
import { cn } from "@utilities";

import { Button, IconSvg } from "@components/atoms";

Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/connectionTableStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import React from "react";
import { useTranslation } from "react-i18next";

import { ConnectionStatus } from "@enums";
import { cn } from "@src/utilities";
import { ConnectionStatusType } from "@type/models";
import { cn } from "@utilities";

export const ConnectionTableStatus = ({ status }: { status: ConnectionStatusType }) => {
const { t } = useTranslation("tabs");
Expand Down
7 changes: 4 additions & 3 deletions src/components/molecules/copyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import React from "react";
import { debounce } from "lodash";
import { useTranslation } from "react-i18next";

import { useToastStore } from "@src/store";
import { SystemSizes } from "@src/types";
import { cn, copyToClipboard } from "@src/utilities";
import { SystemSizes } from "@type";
import { cn, copyToClipboard } from "@utilities";

import { useToastStore } from "@store";

import { Button } from "@components/atoms";

Expand Down
7 changes: 4 additions & 3 deletions src/components/molecules/drawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import React from "react";

import { AnimatePresence, motion } from "motion/react";

import { DrawerProps } from "@src/interfaces/components";
import { useDrawerStore } from "@src/store";
import { cn } from "@src/utilities";
import { DrawerProps } from "@interfaces/components";
import { cn } from "@utilities";

import { useDrawerStore } from "@store";

export const Drawer = ({
children,
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/emptyTableAddButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";

import { cn } from "@src/utilities";
import { cn } from "@utilities";

import { Button } from "@components/atoms";

Expand Down
9 changes: 5 additions & 4 deletions src/components/molecules/idCopyButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ import React from "react";

import { useTranslation } from "react-i18next";

import { namespaces } from "@constants";
import { ButtonVariant } from "@enums/components";
import { LoggerService } from "@services/logger.service";
import { namespaces } from "@src/constants";
import { ButtonVariant } from "@src/enums/components";
import { useToastStore } from "@src/store";
import { getShortId } from "@src/utilities";
import { getShortId } from "@utilities";

import { useToastStore } from "@store";

import { Button } from "@components/atoms";
import { CopyButton } from "@components/molecules/copyButton";
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/imageMotion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useRef, useState } from "react";

import { motion, useDomEvent } from "motion/react";

import { cn } from "@src/utilities";
import { cn } from "@utilities";

const transitions = {
open: { type: "spring", damping: 25, stiffness: 120 },
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/loadingOverlay.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useId } from "react";

import { cn } from "@src/utilities";
import { cn } from "@utilities";

import { Loader } from "@components/atoms";

Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/menu/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { AnimatePresence, motion } from "motion/react";
import { useTranslation } from "react-i18next";
import { useNavigate, useParams } from "react-router-dom";

import { descopeProjectId, namespaces } from "@constants";
import { ModalName, SidebarHrefMenu } from "@enums/components";
import { MenuProps } from "@interfaces/components";
import { LoggerService } from "@services/logger.service";
import { descopeProjectId, namespaces } from "@src/constants";
import { Project } from "@type/models";
import { cn } from "@utilities";

Expand Down
5 changes: 3 additions & 2 deletions src/components/molecules/popover/popover.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from "react";

import { PopoverContext } from "@contexts";
import { usePopover } from "@src/hooks";
import { PopoverOptions } from "@src/interfaces/components";
import { PopoverOptions } from "@interfaces/components";

import { usePopover } from "@hooks";

export const PopoverWrapper = ({
children,
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/popover/popoverContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from "react";

import { PopoverContentBase } from "./popoverContentBase";
import { usePopoverContext } from "@contexts/usePopover";
import { PopoverTriggerProps } from "@src/interfaces/components";
import { PopoverTriggerProps } from "@interfaces/components";

import { useMergeRefsCustom } from "@components/molecules/popover/utilities";

Expand Down
4 changes: 2 additions & 2 deletions src/components/molecules/popover/popoverContentBase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { forwardRef } from "react";

import { FloatingFocusManager, FloatingPortal } from "@floating-ui/react";

import { PopoverContentBaseProps } from "@src/interfaces/components";
import { cn } from "@src/utilities";
import { PopoverContentBaseProps } from "@interfaces/components";
import { cn } from "@utilities";

import { useMergeRefsCustom } from "@components/molecules/popover/utilities";

Expand Down
5 changes: 3 additions & 2 deletions src/components/molecules/popover/popoverList.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from "react";

import { PopoverListContext } from "@contexts";
import { usePopoverList } from "@src/hooks";
import { PopoverOptions } from "@src/interfaces/components";
import { PopoverOptions } from "@interfaces/components";

import { usePopoverList } from "@hooks";

export const PopoverListWrapper = ({
children,
Expand Down
6 changes: 3 additions & 3 deletions src/components/molecules/popover/popoverListContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import React, { useEffect, useMemo, useRef, useState } from "react";
import { debounce } from "lodash";

import { PopoverContentBase } from "./popoverContentBase";
import { searchByTermDebounceTime } from "@constants";
import { usePopoverListContext } from "@contexts/usePopover";
import { searchByTermDebounceTime } from "@src/constants";
import { PopoverListItem } from "@src/interfaces/components/popover.interface";
import { cn } from "@src/utilities";
import { PopoverListItem } from "@interfaces/components/popover.interface";
import { cn } from "@utilities";

import { SearchInput } from "@components/atoms";
import { useMergeRefsCustom } from "@components/molecules/popover/utilities";
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/popover/popoverListTrigger.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { forwardRef, isValidElement } from "react";

import { usePopoverListContext } from "@contexts";
import { PopoverTriggerProps } from "@src/interfaces/components";
import { PopoverTriggerProps } from "@interfaces/components";

import { useMergeRefsCustom } from "@components/molecules/popover/utilities";

Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/popover/popoverTrigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { forwardRef, isValidElement } from "react";
import { useMergeRefs } from "@floating-ui/react";

import { usePopoverContext } from "@contexts";
import { PopoverTriggerProps } from "@src/interfaces/components";
import { PopoverTriggerProps } from "@interfaces/components";

export const PopoverTrigger = forwardRef<HTMLElement, React.HTMLProps<HTMLElement> & PopoverTriggerProps>(
function PopoverTrigger({ children, ...props }, propRef) {
Expand Down
4 changes: 2 additions & 2 deletions src/components/molecules/refreshButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React, { useEffect, useMemo, useState } from "react";

import { useTranslation } from "react-i18next";

import { RefreshButtonProps } from "@src/interfaces/components";
import { cn } from "@src/utilities";
import { RefreshButtonProps } from "@interfaces/components";
import { cn } from "@utilities";

import { IconButton, IconSvg } from "@components/atoms";

Expand Down
6 changes: 3 additions & 3 deletions src/components/molecules/templateIntegrationsIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
IntegrationForTemplates,
Integrations,
IntegrationsMap,
} from "@src/enums/components/connection.enum";
import { TemplateMetadata } from "@src/interfaces/store";
import { cn } from "@src/utilities";
} from "@enums/components/connection.enum";
import { TemplateMetadata } from "@interfaces/store";
import { cn } from "@utilities";

import { IconSvg } from "@components/atoms";

Expand Down
7 changes: 4 additions & 3 deletions src/components/molecules/toursProgressStepper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import { useTranslation } from "react-i18next";
import { useLocation } from "react-router-dom";

import { tours } from "@constants";
import { ModalName } from "@src/enums/components";
import { TutorialProgressModalProps } from "@src/interfaces/store";
import { useModalStore, useProjectStore, useTemplatesStore, useTourStore } from "@src/store";
import { ModalName } from "@enums/components";
import { TutorialProgressModalProps } from "@interfaces/store";

import { useModalStore, useProjectStore, useTemplatesStore, useTourStore } from "@store";

import { Button, Loader, RadioButton, Typography } from "@components/atoms";
import { LoadingOverlay, Modal } from "@components/molecules";
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/welcomeCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import { useTranslation } from "react-i18next";

import { WelcomeCardProps } from "@interfaces/components";
import { cn } from "@src/utilities";
import { cn } from "@utilities";

import { Button, IconSvg, Loader, Typography } from "@components/atoms";

Expand Down
3 changes: 2 additions & 1 deletion src/components/organisms/activeDeploymentWarningModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { useTranslation } from "react-i18next";

import { ModalName } from "@enums/components";
import { ActiveDeploymentWarningModalProps } from "@interfaces/components";
import { useModalStore } from "@src/store";

import { useModalStore } from "@store";

import { Button } from "@components/atoms";
import { Modal } from "@components/molecules";
Expand Down
2 changes: 1 addition & 1 deletion src/components/organisms/code/addModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { useParams } from "react-router-dom";

import { defalutFileExtension, monacoLanguages, namespaces } from "@constants";
import { ModalName } from "@enums/components";
import { fileOperations } from "@factories";
import { LoggerService } from "@services";
import { fileOperations } from "@src/factories";
import { codeAssetsSchema } from "@validations";

import { useFileStore, useModalStore, useToastStore } from "@store";
Expand Down
6 changes: 3 additions & 3 deletions src/components/organisms/code/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ import { useTranslation } from "react-i18next";
import { useLocation, useParams } from "react-router-dom";

import { fileSizeUploadLimit, monacoLanguages, namespaces, tours } from "@constants";
import { EventListenerName } from "@enums";
import { ModalName } from "@enums/components";
import { fileOperations } from "@factories";
import { LoggerService } from "@services";
import { EventListenerName } from "@src/enums";
import { fileOperations } from "@src/factories";
import { triggerEvent } from "@src/hooks";
import { cn } from "@utilities";

import { triggerEvent } from "@hooks";
import { useCacheStore, useFileStore, useModalStore, useToastStore } from "@store";

import { Button, IconButton, Loader, TBody, THead, Table, Td, Th, Tr } from "@components/atoms";
Expand Down
8 changes: 4 additions & 4 deletions src/components/organisms/connections/add.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import React from "react";

import { useTranslation } from "react-i18next";

import { integrationAddFormComponents } from "@constants/connections";
import { integrationTypes } from "@constants/lists";
import { Integrations } from "@enums/components";
import { SelectOption } from "@interfaces/components";
import { integrationAddFormComponents } from "@src/constants/connections";
import { Integrations } from "@src/enums/components";
import { useHasActiveDeployments } from "@src/store";
import { stripGoogleConnectionName } from "@src/utilities";
import { stripGoogleConnectionName } from "@utilities";
import { connectionSchema } from "@validations";

import { useConnectionForm } from "@hooks";
import { useHasActiveDeployments } from "@store";

import { ErrorMessage, Input } from "@components/atoms";
import { ActiveDeploymentWarning, Select, TabFormHeader } from "@components/molecules";
Expand Down
Loading
Loading