Skip to content

Commit

Permalink
Move final libs contents to app: libs/api and libs/util (#1977)
Browse files Browse the repository at this point in the history
libs/api -> app/api and libs/util -> app/util
  • Loading branch information
david-crespo authored Feb 23, 2024
1 parent 6c5883d commit d731de2
Show file tree
Hide file tree
Showing 37 changed files with 11 additions and 15 deletions.
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.
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

0 comments on commit d731de2

Please sign in to comment.