Skip to content
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

Move final libs contents to app: libs/api and libs/util #1977

Merged
merged 1 commit into from
Feb 23, 2024
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 7 additions & 1 deletion app/util/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -42,3 +46,5 @@ export const timeAgoAbbr = (d: Date, options?: FormatDistanceToNowStrictOptions)
},
},
})

export const formatDateTime = (d: Date) => format(d, 'MMM d, yyyy H:mm aa')
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 0 additions & 10 deletions libs/util/date.ts

This file was deleted.

6 changes: 3 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading