Skip to content

Commit

Permalink
refactor: restructure folder and file (#12)
Browse files Browse the repository at this point in the history
* refactor all filename

* fixing the type error
  • Loading branch information
invisal authored Feb 29, 2024
1 parent b248d04 commit cc64f29
Show file tree
Hide file tree
Showing 41 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/app/client/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import dynamic from "next/dynamic";

const MainScreen = dynamic(() => import("../(components)/MainScreen"), {
const MainScreen = dynamic(() => import("../../components/main-connection"), {
ssr: false,
});

Expand Down
2 changes: 1 addition & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const metadata: Metadata = {
};

const ConnectionConfigScreen = dynamic(
() => import("./(components)/ConnectionConfigScreen"),
() => import("../components/connection-config-list"),
{
ssr: false,
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/storybook/connection_error/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import ConnectingDialog from "@/screens/DatabaseScreen/ConnectingDialog";
import ConnectingDialog from "@/components/connection-dialog";

export default function ConnectionErrorMessageStory() {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/app/storybook/opacity_loading/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import OpacityLoading from "@/app/(components)/OpacityLoading";
import OpacityLoading from "@/components/loading-opacity";

export default function OpacityLoadingStorybook() {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/app/storybook/query_progress/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import QueryProgressLog from "@/app/(components)/QueryProgressLog";
import QueryProgressLog from "@/components/query-progress-log";
import { useMemo } from "react";

export default function QueryProgressStorybook() {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import {
ResizablePanelGroup,
} from "@/components/ui/resizable";
import { useEffect, useState } from "react";
import SchemaView from "./SchemaView";
import WindowTabs, { WindowTabItemProps } from "./WindowTabs";
import TableDataContent from "../(windows)/TableDataWindow";
import SchemaView from "./schema-sidebar";
import WindowTabs, { WindowTabItemProps } from "./windows-tab";
import TableDataContent from "./tabs/table-data-tab";
import useMessageListener from "@/hooks/useMessageListener";
import { MessageChannelName } from "@/messages/const";
import { OpenTabsProps } from "@/messages/openTabs";
import QueryWindow from "@/app/(windows)/QueryWindow";
import SchemaEditorTab from "@/screens/WindowTabs/SchemaEditorTab";
import QueryWindow from "@/components/tabs/query-tab";
import SchemaEditorTab from "@/components/tabs/schema-editor-tab";

export default function DatabaseGui() {
const DEFAULT_WIDTH = 300;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"use client";
import DatabaseDriver from "@/drivers/DatabaseDriver";
import { useMemo, useEffect, useLayoutEffect } from "react";
import DatabaseGui from "./DatabaseGui";
import DatabaseGui from "./database-gui";
import { DatabaseDriverProvider } from "@/context/DatabaseDriverProvider";
import { TooltipProvider } from "@/components/ui/tooltip";
import { AutoCompleteProvider } from "@/context/AutoCompleteProvider";
import ContextMenuHandler from "./ContentMenuHandler";
import ContextMenuHandler from "./context-menu-handler";
import InternalPubSub from "@/lib/internal-pubsub";
import { useRouter } from "next/navigation";
import { normalizeConnectionEndpoint } from "@/lib/validation";
import { SchemaProvider } from "@/screens/DatabaseScreen/SchemaProvider";
import { SchemaProvider } from "@/context/SchemaProvider";

function MainConnection({
credential,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import GenericCell from "@/app/(components)/Cells/GenericCell";
import NumberCell from "@/app/(components)/Cells/NumberCell";
import TextCell from "@/app/(components)/Cells/TextCell";
import GenericCell from "@/components/table-cell/GenericCell";
import NumberCell from "@/components/table-cell/NumberCell";
import TextCell from "@/components/table-cell/TextCell";
import OptimizeTable, {
OptimizeTableCellRenderProps,
OptimizeTableHeaderWithIndexProps,
TableColumnDataType,
} from "@/app/(components)/OptimizeTable";
import OptimizeTableState from "@/app/(components)/OptimizeTable/OptimizeTableState";
} from "@/components/table-optimized";
import OptimizeTableState from "@/components/table-optimized/OptimizeTableState";
import { DatabaseValue } from "@/drivers/DatabaseDriver";
import { exportRowsToExcel, exportRowsToSqlInsert } from "@/lib/export-helper";
import { KEY_BINDING } from "@/lib/key-matcher";
Expand Down
2 changes: 1 addition & 1 deletion src/components/schema-editor/SchemaEditorColumnList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
SelectTrigger,
SelectValue,
} from "../ui/select";
import { TableColumnDataType } from "@/app/(components)/OptimizeTable";
import { TableColumnDataType } from "@/components/table-optimized";
import { convertSqliteType } from "@/lib/sql-helper";
import { Checkbox } from "@/components/ui/checkbox";
import ColumnDefaultValueInput from "./ColumnDefaultValueInput";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
OpenContextMenuList,
openContextMenuFromEvent,
} from "@/messages/openContextMenu";
import { useSchema } from "@/screens/DatabaseScreen/SchemaProvider";
import { useSchema } from "@/context/SchemaProvider";
import { appVersion } from "@/env";

interface SchemaViewItemProps {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/table-combobox/TableCombobox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
CommandItem,
} from "../ui/command";
import { cn } from "@/lib/utils";
import { useSchema } from "@/screens/DatabaseScreen/SchemaProvider";
import { useSchema } from "@/context/SchemaProvider";
import { useState } from "react";
import { Separator } from "../ui/separator";

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useRef, useState } from "react";
import { identify } from "sql-query-identifier";
import { LucidePlay } from "lucide-react";
import SqlEditor from "@/components/SqlEditor";
import SqlEditor from "@/components/sql-editor";
import {
ResizablePanelGroup,
ResizablePanel,
Expand All @@ -10,11 +10,11 @@ import {
import { Separator } from "@/components/ui/separator";
import { Button } from "@/components/ui/button";
import { useDatabaseDriver } from "@/context/DatabaseDriverProvider";
import ResultTable from "@/components/result/ResultTable";
import ResultTable from "@/components/query-result-table";
import { useAutoComplete } from "@/context/AutoCompleteProvider";
import { MultipleQueryProgress, multipleQuery } from "@/lib/multiple-query";
import QueryProgressLog from "../(components)/QueryProgressLog";
import OptimizeTableState from "../(components)/OptimizeTable/OptimizeTableState";
import QueryProgressLog from "../query-progress-log";
import OptimizeTableState from "../table-optimized/OptimizeTableState";
import { KEY_BINDING } from "@/lib/key-matcher";
import { ReactCodeMirrorRef } from "@uiw/react-codemirror";
import { selectStatementFromPosition } from "@/lib/sql-helper";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OpacityLoading from "@/app/(components)/OpacityLoading";
import { useTabsContext } from "@/app/(components)/WindowTabs";
import SqlEditor from "@/components/SqlEditor";
import OpacityLoading from "@/components/loading-opacity";
import { useTabsContext } from "@/components/windows-tab";
import SqlEditor from "@/components/sql-editor";
import SchemaEditor, {
DatabaseTableSchemaChange,
} from "@/components/schema-editor";
Expand All @@ -22,7 +22,7 @@ import { executeQuries } from "@/lib/multiple-query";
import generateSqlSchemaChange from "@/lib/sql-generate.schema";
import { LucideLoader, LucideSave } from "lucide-react";
import { useCallback, useEffect, useMemo, useState } from "react";
import { useSchema } from "../DatabaseScreen/SchemaProvider";
import { useSchema } from "../../context/SchemaProvider";

interface SchemaEditorTabProps {
tableName?: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useDatabaseDriver } from "@/context/DatabaseDriverProvider";
import { useCallback, useEffect, useState } from "react";
import ResultTable from "@/components/result/ResultTable";
import ResultTable from "@/components/query-result-table";
import { Button } from "@/components/ui/button";
import {
LucideArrowLeft,
Expand All @@ -19,8 +19,8 @@ import {
TooltipTrigger,
} from "@/components/ui/tooltip";
import { useAutoComplete } from "@/context/AutoCompleteProvider";
import OpacityLoading from "../(components)/OpacityLoading";
import OptimizeTableState from "../(components)/OptimizeTable/OptimizeTableState";
import OpacityLoading from "../loading-opacity";
import OptimizeTableState from "../table-optimized/OptimizeTableState";
import {
generateDeleteStatement,
generateInsertStatement,
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
useMemo,
useState,
} from "react";
import ConnectingDialog from "./ConnectingDialog";
import ConnectingDialog from "../components/connection-dialog";

const SchemaContext = createContext<{
schema: DatabaseSchemaItem[];
Expand Down
2 changes: 1 addition & 1 deletion src/lib/sql-execute-helper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { OptimizeTableRowValue } from "@/app/(components)/OptimizeTable/OptimizeTableState";
import { OptimizeTableRowValue } from "@/components/table-optimized/OptimizeTableState";
import DatabaseDriver from "@/drivers/DatabaseDriver";
import { generateSelectOneWithConditionStatement } from "./sql-helper";

Expand Down
2 changes: 1 addition & 1 deletion src/lib/sql-helper.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TableColumnDataType } from "@/app/(components)/OptimizeTable";
import { TableColumnDataType } from "@/components/table-optimized";
import { exportRowsToSqlInsert } from "./export-helper";
import {
convertSqliteType,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/sql-helper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { TableColumnDataType } from "@/app/(components)/OptimizeTable";
import { TableColumnDataType } from "@/components/table-optimized";
import { hex } from "./bit-operation";
import { IdentifyResult } from "sql-query-identifier/lib/defines";

Expand Down

0 comments on commit cc64f29

Please sign in to comment.