From 6f8f7bb0b77905bb9732136794e3528f03743a15 Mon Sep 17 00:00:00 2001 From: Paul Murray Date: Tue, 15 Aug 2023 17:40:10 -0400 Subject: [PATCH] move components into lib/components --- flatfront-astro/src/lib/.gitignore | 1 + .../src/lib/{ => components}/App.tsx | 0 .../src/lib/{ => components}/Cells.tsx | 6 +++--- .../src/lib/{ => components}/FieldCard.tsx | 6 +++--- .../lib/{ => components}/GlobalControls.tsx | 6 +++--- .../src/lib/{ => components}/Highcharts.tsx | 20 +++---------------- .../src/lib/{ => components}/Katex.tsx | 0 .../src/lib/{ => components}/Table.tsx | 3 +-- flatfront-astro/src/lib/stores.ts | 3 +-- flatfront-astro/src/pages/index.astro | 4 ++-- 10 files changed, 17 insertions(+), 32 deletions(-) create mode 100644 flatfront-astro/src/lib/.gitignore rename flatfront-astro/src/lib/{ => components}/App.tsx (100%) rename flatfront-astro/src/lib/{ => components}/Cells.tsx (99%) rename flatfront-astro/src/lib/{ => components}/FieldCard.tsx (99%) rename flatfront-astro/src/lib/{ => components}/GlobalControls.tsx (96%) rename flatfront-astro/src/lib/{ => components}/Highcharts.tsx (88%) rename flatfront-astro/src/lib/{ => components}/Katex.tsx (100%) rename flatfront-astro/src/lib/{ => components}/Table.tsx (99%) diff --git a/flatfront-astro/src/lib/.gitignore b/flatfront-astro/src/lib/.gitignore new file mode 100644 index 00000000..e859ca9a --- /dev/null +++ b/flatfront-astro/src/lib/.gitignore @@ -0,0 +1 @@ +*copy* \ No newline at end of file diff --git a/flatfront-astro/src/lib/App.tsx b/flatfront-astro/src/lib/components/App.tsx similarity index 100% rename from flatfront-astro/src/lib/App.tsx rename to flatfront-astro/src/lib/components/App.tsx diff --git a/flatfront-astro/src/lib/Cells.tsx b/flatfront-astro/src/lib/components/Cells.tsx similarity index 99% rename from flatfront-astro/src/lib/Cells.tsx rename to flatfront-astro/src/lib/components/Cells.tsx index 3e8d522f..745475fc 100644 --- a/flatfront-astro/src/lib/Cells.tsx +++ b/flatfront-astro/src/lib/components/Cells.tsx @@ -1,4 +1,4 @@ -import type { CatalogCellID, FilterCellID, TableCellID } from "./types"; +import type { CatalogCellID, FilterCellID, TableCellID } from "../types"; import React from "react"; @@ -17,8 +17,8 @@ import { is_catalog_cell_id, log, Providers, -} from "./shared"; -import * as stores from "./stores"; +} from "../shared"; +import * as stores from "../stores"; import Table from "./Table"; import { FieldCard, FilterCard } from "./FieldCard"; diff --git a/flatfront-astro/src/lib/FieldCard.tsx b/flatfront-astro/src/lib/components/FieldCard.tsx similarity index 99% rename from flatfront-astro/src/lib/FieldCard.tsx rename to flatfront-astro/src/lib/components/FieldCard.tsx index 4d61c037..91ade497 100644 --- a/flatfront-astro/src/lib/FieldCard.tsx +++ b/flatfront-astro/src/lib/components/FieldCard.tsx @@ -1,4 +1,4 @@ -import type { FieldMetadata, FilterValueRaw } from "./types"; +import type { FieldMetadata, FilterValueRaw } from "../types"; import React from "react"; @@ -14,8 +14,8 @@ import { set_filter_value, format, Select, -} from "./shared"; -import * as stores from "./stores"; +} from "../shared"; +import * as stores from "../stores"; import Katex from "./Katex"; export function FieldCard(): React.JSX.Element { diff --git a/flatfront-astro/src/lib/GlobalControls.tsx b/flatfront-astro/src/lib/components/GlobalControls.tsx similarity index 96% rename from flatfront-astro/src/lib/GlobalControls.tsx rename to flatfront-astro/src/lib/components/GlobalControls.tsx index 6160ab99..53f34e1c 100644 --- a/flatfront-astro/src/lib/GlobalControls.tsx +++ b/flatfront-astro/src/lib/components/GlobalControls.tsx @@ -1,18 +1,18 @@ -import type { TopResponseEntry } from "./types"; +import type { TopResponseEntry } from "../types"; import React from "react"; import { Switch } from "@headlessui/react"; import * as d3 from "d3"; -import * as stores from "./stores"; +import * as stores from "../stores"; import { dispatch_action, LabeledSelect, log, useStore, CellWrapper, -} from "./shared"; +} from "../shared"; export default function GlobalControls(): React.JSX.Element { return ( diff --git a/flatfront-astro/src/lib/Highcharts.tsx b/flatfront-astro/src/lib/components/Highcharts.tsx similarity index 88% rename from flatfront-astro/src/lib/Highcharts.tsx rename to flatfront-astro/src/lib/components/Highcharts.tsx index a6c600c3..a4fa3068 100644 --- a/flatfront-astro/src/lib/Highcharts.tsx +++ b/flatfront-astro/src/lib/components/Highcharts.tsx @@ -1,21 +1,8 @@ -import type { - Action, - CellAction, - CellID, - CatalogMetadataWrapper, - Filters, - DataRequestBody, - DataResponse, - CatalogHierarchyNode, - CatalogMetadataQuery, - CatalogResponse, - Datum, - PlotControlAction, -} from "./types"; +import type { PlotControlAction } from "../types"; import Highcharts from "highcharts"; import HighchartsReact from "highcharts-react-official"; -import * as stores from "./stores"; +import * as stores from "../stores"; import { LabeledSelect, dispatch_action, @@ -23,8 +10,7 @@ import { usePlotID, useData, useStore, - log, -} from "./shared"; +} from "../shared"; export function Scatterplot() { const cell_id = useCellID(); diff --git a/flatfront-astro/src/lib/Katex.tsx b/flatfront-astro/src/lib/components/Katex.tsx similarity index 100% rename from flatfront-astro/src/lib/Katex.tsx rename to flatfront-astro/src/lib/components/Katex.tsx diff --git a/flatfront-astro/src/lib/Table.tsx b/flatfront-astro/src/lib/components/Table.tsx similarity index 99% rename from flatfront-astro/src/lib/Table.tsx rename to flatfront-astro/src/lib/components/Table.tsx index 93b19746..4b47b3ab 100644 --- a/flatfront-astro/src/lib/Table.tsx +++ b/flatfront-astro/src/lib/components/Table.tsx @@ -3,7 +3,7 @@ import type { CatalogHierarchyNode, FieldMetadata, Datum, -} from "./types"; +} from "../types"; import type { ColumnDef, @@ -18,7 +18,6 @@ import { useReactTable, } from "@tanstack/react-table"; -import { log } from "./shared"; import Katex from "./Katex"; export default function Table({ diff --git a/flatfront-astro/src/lib/stores.ts b/flatfront-astro/src/lib/stores.ts index 7812e611..5c87e98c 100644 --- a/flatfront-astro/src/lib/stores.ts +++ b/flatfront-astro/src/lib/stores.ts @@ -1,7 +1,6 @@ import type { Action, CatalogHierarchyNode, - CatalogMetadataQuery, CatalogMetadataWrapper, CatalogResponse, Cell, @@ -24,7 +23,7 @@ import type { QueryObserverResult, QueryObserverOptions, } from "@tanstack/query-core"; -import type { Readable, Writable } from "svelte/store"; +import type { Readable } from "svelte/store"; import { QueryClient } from "@tanstack/query-core"; import { QueryObserver } from "@tanstack/query-core"; diff --git a/flatfront-astro/src/pages/index.astro b/flatfront-astro/src/pages/index.astro index 54135da0..8653a24a 100644 --- a/flatfront-astro/src/pages/index.astro +++ b/flatfront-astro/src/pages/index.astro @@ -2,7 +2,7 @@ import "../lib/globals.css"; import "highcharts/css/highcharts.css"; -import App from "../lib/App"; +import App from "../lib/components/App"; --- @@ -15,4 +15,4 @@ import App from "../lib/App"; - + \ No newline at end of file