Dependencies upgrade
This commit is contained in:
@@ -9,7 +9,9 @@
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@effect/schema": "^0.68.17",
|
||||
"@tanstack/react-query": "4",
|
||||
"@thilawyn/thilalib": "^0.1.5",
|
||||
"@trpc/client": "^10.45.2",
|
||||
"@trpc/react-query": "^10.45.2",
|
||||
"react": "^18.3.1",
|
||||
@@ -19,8 +21,8 @@
|
||||
"@todo-tests/common": "workspace:*",
|
||||
"@types/react": "^18.3.3",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"@typescript-eslint/eslint-plugin": "^7.13.1",
|
||||
"@typescript-eslint/parser": "^7.13.1",
|
||||
"@typescript-eslint/eslint-plugin": "^7.15.0",
|
||||
"@typescript-eslint/parser": "^7.15.0",
|
||||
"@vitejs/plugin-react": "^4.3.1",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"eslint": "^8.57.0",
|
||||
@@ -28,6 +30,6 @@
|
||||
"eslint-plugin-react-refresh": "^0.4.7",
|
||||
"postcss": "^8.4.39",
|
||||
"tailwindcss": "^3.4.4",
|
||||
"vite": "^5.3.1"
|
||||
"vite": "^5.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
import { Index } from "./Index"
|
||||
import "./index.css"
|
||||
import { TRPCClientProvider } from "./trpc/TRPCClientProvider"
|
||||
|
||||
|
||||
export function App() {
|
||||
|
||||
return (
|
||||
<TRPCClientProvider>
|
||||
<Index />
|
||||
</TRPCClientProvider>
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
29
packages/webui/src/Index.tsx
Normal file
29
packages/webui/src/Index.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import { Schema as S } from "@effect/schema"
|
||||
import { JsonifiableTodo } from "@todo-tests/common/data"
|
||||
import { Todo } from "./data"
|
||||
import { trpc } from "./trpc/trpc"
|
||||
|
||||
|
||||
const decodeTodos = S.decodeSync(
|
||||
S.mutable(
|
||||
S.Array(
|
||||
JsonifiableTodo.pipe(S.compose(Todo))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
export function Index() {
|
||||
|
||||
const todosQuery = trpc.todos.all.useQuery(undefined, { select: decodeTodos })
|
||||
|
||||
|
||||
return <>
|
||||
<div className="container mx-auto">
|
||||
<p className="text-4xl text-center">Todos</p>
|
||||
|
||||
|
||||
</div>
|
||||
</>
|
||||
|
||||
}
|
||||
9
packages/webui/src/data/Todo.ts
Normal file
9
packages/webui/src/data/Todo.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { MobXObservable, MutableClass } from "@thilawyn/thilalib/effect/schema/class"
|
||||
import { Todo as CommonTodo } from "@todo-tests/common/data"
|
||||
|
||||
|
||||
export class Todo
|
||||
extends MutableClass<Todo>("Todo")(CommonTodo.fields).pipe(
|
||||
MobXObservable
|
||||
)
|
||||
{}
|
||||
1
packages/webui/src/data/index.ts
Normal file
1
packages/webui/src/data/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from "./Todo"
|
||||
Reference in New Issue
Block a user