diff --git a/.prettierrc.js b/.prettierrc.js index 0a64eadc10..dbce9f0a1d 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -18,6 +18,7 @@ export default { '', '^@oxide/(.*)$', '', + '^~/(.*)$', '^app/(.*)$', '', '^[./]', diff --git a/libs/pagination/Pagination.tsx b/app/components/Pagination.tsx similarity index 100% rename from libs/pagination/Pagination.tsx rename to app/components/Pagination.tsx diff --git a/libs/pagination/__tests__/use-pagination.spec.ts b/app/hooks/use-pagination.spec.ts similarity index 97% rename from libs/pagination/__tests__/use-pagination.spec.ts rename to app/hooks/use-pagination.spec.ts index 81c3523e89..62e12865e0 100644 --- a/libs/pagination/__tests__/use-pagination.spec.ts +++ b/app/hooks/use-pagination.spec.ts @@ -8,7 +8,7 @@ import { act, renderHook } from '@testing-library/react' import { describe, expect, it } from 'vitest' -import { usePagination } from '../use-pagination' +import { usePagination } from './use-pagination' describe('usePagination', () => { it('starts with empty state', () => { diff --git a/libs/pagination/use-pagination.tsx b/app/hooks/use-pagination.ts similarity index 100% rename from libs/pagination/use-pagination.tsx rename to app/hooks/use-pagination.ts diff --git a/app/layouts/helpers.tsx b/app/layouts/helpers.tsx index c2e8aed343..e5137b610d 100644 --- a/app/layouts/helpers.tsx +++ b/app/layouts/helpers.tsx @@ -8,10 +8,10 @@ import { useRef } from 'react' import { Outlet } from 'react-router-dom' -import { Pagination } from '@oxide/pagination' import { SkipLinkTarget } from '@oxide/ui' import { classed } from '@oxide/util' +import { Pagination } from '~/components/Pagination' import { PageActionsTarget } from 'app/components/PageActions' import { useScrollRestoration } from 'app/hooks/use-scroll-restoration' diff --git a/libs/table/QueryTable.tsx b/app/table/QueryTable.tsx similarity index 98% rename from libs/table/QueryTable.tsx rename to app/table/QueryTable.tsx index f0851fd50a..f53effeb36 100644 --- a/libs/table/QueryTable.tsx +++ b/app/table/QueryTable.tsx @@ -31,10 +31,12 @@ import { type Result, type ResultItem, } from '@oxide/api' -import { Pagination, usePagination } from '@oxide/pagination' import { EmptyMessage, TableEmptyBox } from '@oxide/ui' import { invariant, isOneOf } from '@oxide/util' +import { Pagination } from '~/components/Pagination' +import { usePagination } from '~/hooks/use-pagination' + import { DefaultCell } from './cells' import { getActionsCol, getMultiSelectCol, getSelectCol, type MakeActions } from './columns' import { Table } from './Table' diff --git a/libs/table/Table.tsx b/app/table/Table.tsx similarity index 100% rename from libs/table/Table.tsx rename to app/table/Table.tsx diff --git a/libs/table/cells/BooleanCell.tsx b/app/table/cells/BooleanCell.tsx similarity index 100% rename from libs/table/cells/BooleanCell.tsx rename to app/table/cells/BooleanCell.tsx diff --git a/libs/table/cells/Cell.tsx b/app/table/cells/Cell.tsx similarity index 100% rename from libs/table/cells/Cell.tsx rename to app/table/cells/Cell.tsx diff --git a/libs/table/cells/DateCell.tsx b/app/table/cells/DateCell.tsx similarity index 100% rename from libs/table/cells/DateCell.tsx rename to app/table/cells/DateCell.tsx diff --git a/libs/table/cells/DefaultCell.tsx b/app/table/cells/DefaultCell.tsx similarity index 100% rename from libs/table/cells/DefaultCell.tsx rename to app/table/cells/DefaultCell.tsx diff --git a/libs/table/cells/EmptyCell.tsx b/app/table/cells/EmptyCell.tsx similarity index 100% rename from libs/table/cells/EmptyCell.tsx rename to app/table/cells/EmptyCell.tsx diff --git a/libs/table/cells/EnabledCell.tsx b/app/table/cells/EnabledCell.tsx similarity index 100% rename from libs/table/cells/EnabledCell.tsx rename to app/table/cells/EnabledCell.tsx diff --git a/libs/table/cells/FirewallFilterCell.tsx b/app/table/cells/FirewallFilterCell.tsx similarity index 100% rename from libs/table/cells/FirewallFilterCell.tsx rename to app/table/cells/FirewallFilterCell.tsx diff --git a/libs/table/cells/InstanceLinkCell.tsx b/app/table/cells/InstanceLinkCell.tsx similarity index 100% rename from libs/table/cells/InstanceLinkCell.tsx rename to app/table/cells/InstanceLinkCell.tsx diff --git a/libs/table/cells/InstanceResourceCell.tsx b/app/table/cells/InstanceResourceCell.tsx similarity index 100% rename from libs/table/cells/InstanceResourceCell.tsx rename to app/table/cells/InstanceResourceCell.tsx diff --git a/libs/table/cells/InstanceStatusCell.tsx b/app/table/cells/InstanceStatusCell.tsx similarity index 100% rename from libs/table/cells/InstanceStatusCell.tsx rename to app/table/cells/InstanceStatusCell.tsx diff --git a/libs/table/cells/LabelCell.tsx b/app/table/cells/LabelCell.tsx similarity index 100% rename from libs/table/cells/LabelCell.tsx rename to app/table/cells/LabelCell.tsx diff --git a/libs/table/cells/LinkCell.tsx b/app/table/cells/LinkCell.tsx similarity index 100% rename from libs/table/cells/LinkCell.tsx rename to app/table/cells/LinkCell.tsx diff --git a/libs/table/cells/SizeCell.tsx b/app/table/cells/SizeCell.tsx similarity index 100% rename from libs/table/cells/SizeCell.tsx rename to app/table/cells/SizeCell.tsx diff --git a/libs/table/cells/TruncateCell.tsx b/app/table/cells/TruncateCell.tsx similarity index 100% rename from libs/table/cells/TruncateCell.tsx rename to app/table/cells/TruncateCell.tsx diff --git a/libs/table/cells/TwoLineCell.tsx b/app/table/cells/TwoLineCell.tsx similarity index 100% rename from libs/table/cells/TwoLineCell.tsx rename to app/table/cells/TwoLineCell.tsx diff --git a/libs/table/cells/TypeValueCell.tsx b/app/table/cells/TypeValueCell.tsx similarity index 100% rename from libs/table/cells/TypeValueCell.tsx rename to app/table/cells/TypeValueCell.tsx diff --git a/libs/table/cells/TypeValueListCell.tsx b/app/table/cells/TypeValueListCell.tsx similarity index 100% rename from libs/table/cells/TypeValueListCell.tsx rename to app/table/cells/TypeValueListCell.tsx diff --git a/libs/table/cells/index.ts b/app/table/cells/index.ts similarity index 100% rename from libs/table/cells/index.ts rename to app/table/cells/index.ts diff --git a/libs/table/columns/action-col.tsx b/app/table/columns/action-col.tsx similarity index 100% rename from libs/table/columns/action-col.tsx rename to app/table/columns/action-col.tsx diff --git a/libs/table/columns/index.ts b/app/table/columns/index.ts similarity index 100% rename from libs/table/columns/index.ts rename to app/table/columns/index.ts diff --git a/libs/table/columns/select-col.tsx b/app/table/columns/select-col.tsx similarity index 100% rename from libs/table/columns/select-col.tsx rename to app/table/columns/select-col.tsx diff --git a/libs/table/headers/DefaultHeader.tsx b/app/table/headers/DefaultHeader.tsx similarity index 100% rename from libs/table/headers/DefaultHeader.tsx rename to app/table/headers/DefaultHeader.tsx diff --git a/libs/table/headers/index.ts b/app/table/headers/index.ts similarity index 100% rename from libs/table/headers/index.ts rename to app/table/headers/index.ts diff --git a/libs/table/index.ts b/app/table/index.ts similarity index 100% rename from libs/table/index.ts rename to app/table/index.ts diff --git a/libs/table/react-table.ts b/app/table/react-table.ts similarity index 100% rename from libs/table/react-table.ts rename to app/table/react-table.ts diff --git a/libs/pagination/index.ts b/libs/pagination/index.ts deleted file mode 100644 index 6d3969ed29..0000000000 --- a/libs/pagination/index.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, you can obtain one at https://mozilla.org/MPL/2.0/. - * - * Copyright Oxide Computer Company - */ - -export * from './Pagination' -export * from './use-pagination' diff --git a/tsconfig.json b/tsconfig.json index 757bc08ebd..69b8fc99bd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,14 +12,14 @@ "noEmit": true, "outDir": "dist", "paths": { + "~/*": ["app/*"], "app/*": ["app/*"], "@oxide/gen/*": ["libs/api/__generated__/*"], "@oxide/api": ["libs/api/index.ts"], "@oxide/api-mocks": ["libs/api-mocks/index.ts"], "@oxide/ui": ["libs/ui/index.ts"], "@oxide/util": ["libs/util/index.ts"], - "@oxide/table": ["libs/table/index.ts"], - "@oxide/pagination": ["libs/pagination/index.ts"] + "@oxide/table": ["app/table/index.ts"] }, "resolveJsonModule": true, "rootDir": ".",