diff --git a/libs/api/__generated__/Api.ts b/app/api/__generated__/Api.ts similarity index 100% rename from libs/api/__generated__/Api.ts rename to app/api/__generated__/Api.ts diff --git a/libs/api/__generated__/OMICRON_VERSION b/app/api/__generated__/OMICRON_VERSION similarity index 100% rename from libs/api/__generated__/OMICRON_VERSION rename to app/api/__generated__/OMICRON_VERSION diff --git a/libs/api/__generated__/http-client.ts b/app/api/__generated__/http-client.ts similarity index 100% rename from libs/api/__generated__/http-client.ts rename to app/api/__generated__/http-client.ts diff --git a/libs/api/__generated__/msw-handlers.ts b/app/api/__generated__/msw-handlers.ts similarity index 100% rename from libs/api/__generated__/msw-handlers.ts rename to app/api/__generated__/msw-handlers.ts diff --git a/libs/api/__generated__/util.ts b/app/api/__generated__/util.ts similarity index 100% rename from libs/api/__generated__/util.ts rename to app/api/__generated__/util.ts diff --git a/libs/api/__generated__/validate.ts b/app/api/__generated__/validate.ts similarity index 100% rename from libs/api/__generated__/validate.ts rename to app/api/__generated__/validate.ts diff --git a/libs/api/__tests__/errors.spec.ts b/app/api/__tests__/errors.spec.ts similarity index 100% rename from libs/api/__tests__/errors.spec.ts rename to app/api/__tests__/errors.spec.ts diff --git a/libs/api/__tests__/hooks.spec.tsx b/app/api/__tests__/hooks.spec.tsx similarity index 100% rename from libs/api/__tests__/hooks.spec.tsx rename to app/api/__tests__/hooks.spec.tsx diff --git a/libs/api/__tests__/nav-to-login.spec.ts b/app/api/__tests__/nav-to-login.spec.ts similarity index 100% rename from libs/api/__tests__/nav-to-login.spec.ts rename to app/api/__tests__/nav-to-login.spec.ts diff --git a/libs/api/__tests__/safety.spec.ts b/app/api/__tests__/safety.spec.ts similarity index 98% rename from libs/api/__tests__/safety.spec.ts rename to app/api/__tests__/safety.spec.ts index 51ccaced16..8a51bd14a1 100644 --- a/libs/api/__tests__/safety.spec.ts +++ b/app/api/__tests__/safety.spec.ts @@ -35,8 +35,8 @@ const grepFiles = (s: string) => it('@oxide/api-mocks is only referenced in test files', () => { expect(grepFiles('api-mocks')).toMatchInlineSnapshot(` [ + "app/api/__tests__/hooks.spec.tsx", "app/msw-mock-api.ts", - "libs/api/__tests__/hooks.spec.tsx", "mock-api/msw/db.ts", "test/e2e/instance-create.e2e.ts", "test/e2e/inventory.e2e.ts", diff --git a/libs/api/client.ts b/app/api/client.ts similarity index 100% rename from libs/api/client.ts rename to app/api/client.ts diff --git a/libs/api/errors.ts b/app/api/errors.ts similarity index 100% rename from libs/api/errors.ts rename to app/api/errors.ts diff --git a/libs/api/hooks.ts b/app/api/hooks.ts similarity index 100% rename from libs/api/hooks.ts rename to app/api/hooks.ts diff --git a/libs/api/index.ts b/app/api/index.ts similarity index 100% rename from libs/api/index.ts rename to app/api/index.ts diff --git a/libs/api/nav-to-login.ts b/app/api/nav-to-login.ts similarity index 100% rename from libs/api/nav-to-login.ts rename to app/api/nav-to-login.ts diff --git a/libs/api/path-params.ts b/app/api/path-params.ts similarity index 100% rename from libs/api/path-params.ts rename to app/api/path-params.ts diff --git a/libs/api/roles.spec.ts b/app/api/roles.spec.ts similarity index 100% rename from libs/api/roles.spec.ts rename to app/api/roles.spec.ts diff --git a/libs/api/roles.ts b/app/api/roles.ts similarity index 100% rename from libs/api/roles.ts rename to app/api/roles.ts diff --git a/libs/api/util.spec.ts b/app/api/util.spec.ts similarity index 100% rename from libs/api/util.spec.ts rename to app/api/util.spec.ts diff --git a/libs/api/util.ts b/app/api/util.ts similarity index 100% rename from libs/api/util.ts rename to app/api/util.ts diff --git a/libs/util/array.spec.tsx b/app/util/array.spec.tsx similarity index 100% rename from libs/util/array.spec.tsx rename to app/util/array.spec.tsx diff --git a/libs/util/array.ts b/app/util/array.ts similarity index 100% rename from libs/util/array.ts rename to app/util/array.ts diff --git a/libs/util/children.spec.tsx b/app/util/children.spec.tsx similarity index 100% rename from libs/util/children.spec.tsx rename to app/util/children.spec.tsx diff --git a/libs/util/children.tsx b/app/util/children.tsx similarity index 100% rename from libs/util/children.tsx rename to app/util/children.tsx diff --git a/libs/util/classed.ts b/app/util/classed.ts similarity index 100% rename from libs/util/classed.ts rename to app/util/classed.ts diff --git a/app/util/date.ts b/app/util/date.ts index 1a9b2317be..8715641522 100644 --- a/app/util/date.ts +++ b/app/util/date.ts @@ -5,7 +5,11 @@ * * Copyright Oxide Computer Company */ -import { formatDistanceToNowStrict, type FormatDistanceToNowStrictOptions } from 'date-fns' +import { + format, + formatDistanceToNowStrict, + type FormatDistanceToNowStrictOptions, +} from 'date-fns' // locale setup and formatDistance function copied from here and modified // https://github.com/date-fns/date-fns/blob/56a3856/src/locale/en-US/_lib/formatDistance/index.js @@ -42,3 +46,5 @@ export const timeAgoAbbr = (d: Date, options?: FormatDistanceToNowStrictOptions) }, }, }) + +export const formatDateTime = (d: Date) => format(d, 'MMM d, yyyy H:mm aa') diff --git a/libs/util/index.ts b/app/util/index.ts similarity index 100% rename from libs/util/index.ts rename to app/util/index.ts diff --git a/libs/util/invariant.ts b/app/util/invariant.ts similarity index 100% rename from libs/util/invariant.ts rename to app/util/invariant.ts diff --git a/libs/util/math.spec.ts b/app/util/math.spec.ts similarity index 100% rename from libs/util/math.spec.ts rename to app/util/math.spec.ts diff --git a/libs/util/math.ts b/app/util/math.ts similarity index 100% rename from libs/util/math.ts rename to app/util/math.ts diff --git a/libs/util/object.spec.ts b/app/util/object.spec.ts similarity index 100% rename from libs/util/object.spec.ts rename to app/util/object.spec.ts diff --git a/libs/util/object.ts b/app/util/object.ts similarity index 100% rename from libs/util/object.ts rename to app/util/object.ts diff --git a/libs/util/str.spec.ts b/app/util/str.spec.ts similarity index 100% rename from libs/util/str.spec.ts rename to app/util/str.spec.ts diff --git a/libs/util/str.ts b/app/util/str.ts similarity index 100% rename from libs/util/str.ts rename to app/util/str.ts diff --git a/libs/util/units.ts b/app/util/units.ts similarity index 100% rename from libs/util/units.ts rename to app/util/units.ts diff --git a/libs/util/date.ts b/libs/util/date.ts deleted file mode 100644 index c5dd78c4ae..0000000000 --- a/libs/util/date.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 - */ -import { format } from 'date-fns' - -export const formatDateTime = (d: Date) => format(d, 'MMM d, yyyy H:mm aa') diff --git a/tsconfig.json b/tsconfig.json index a2f0318a99..68a55889a6 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,11 +14,11 @@ "paths": { "~/*": ["app/*"], "app/*": ["app/*"], - "@oxide/gen/*": ["libs/api/__generated__/*"], - "@oxide/api": ["libs/api/index.ts"], + "@oxide/gen/*": ["app/api/__generated__/*"], + "@oxide/api": ["app/api/index.ts"], "@oxide/api-mocks": ["mock-api/index.ts"], "@oxide/ui": ["app/ui/index.ts"], - "@oxide/util": ["libs/util/index.ts"], + "@oxide/util": ["app/util/index.ts"], "@oxide/table": ["app/table/index.ts"] }, "resolveJsonModule": true,