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

Latest Updates #10

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ next-env.d.ts
.expo/
expo-env.d.ts
apps/expo/.gitignore
apps/expo/ios
apps/expo/android

# production
build
Expand All @@ -43,8 +45,8 @@ yarn-error.log*
.vercel

# typescript
*.tsbuildinfo
dist/
.cache

# turbo
.turbo
.turbo
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node-linker=hoisted
link-workspace-packages=true
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"eslint.rules.customizations": [{ "rule": "*", "severity": "warn" }],
"eslint.useFlatConfig": true,
"eslint.runtime": "node",
"eslint.workingDirectories": [
{ "pattern": "apps/*/" },
{ "pattern": "packages/*/" },
{ "pattern": "tooling/*/" }
],
"prettier.ignorePath": ".gitignore",
"tailwindCSS.experimental.classRegex": [
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
Expand Down
30 changes: 15 additions & 15 deletions apps/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@
"@acme/db": "workspace:*",
"@acme/locales": "workspace:*",
"@acme/ui": "workspace:*",
"@hookform/resolvers": "3.7.0",
"@t3-oss/env-nextjs": "0.10.1",
"@tanstack/react-query": "5.49.2",
"@trpc/client": "11.0.0-rc.364",
"@trpc/react-query": "11.0.0-rc.364",
"@trpc/server": "11.0.0-rc.364",
"geist": "1.3.0",
"next": "14.2.4",
"@hookform/resolvers": "3.9.0",
"@t3-oss/env-nextjs": "0.11.1",
"@tanstack/react-query": "5.55.0",
"@trpc/client": "11.0.0-rc.477",
"@trpc/react-query": "11.0.0-rc.477",
"@trpc/server": "11.0.0-rc.477",
"geist": "1.3.1",
"next": "14.2.8",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-hook-form": "7.52.1",
"react-hook-form": "7.53.0",
"superjson": "2.2.1",
"zod": "3.23.8"
},
Expand All @@ -38,15 +38,15 @@
"@acme/prettier-config": "workspace:*",
"@acme/tailwind-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"@types/node": "20.14.9",
"@types/react": "18.3.3",
"@types/node": "22.5.4",
"@types/react": "18.3.5",
"@types/react-dom": "18.3.0",
"dotenv-cli": "7.4.2",
"eslint": "9.6.0",
"eslint": "9.9.1",
"jiti": "1.21.6",
"prettier": "3.3.2",
"tailwindcss": "3.4.4",
"typescript": "5.5.3"
"prettier": "3.3.3",
"tailwindcss": "3.4.10",
"typescript": "5.5.4"
},
"prettier": "@acme/prettier-config"
}
153 changes: 153 additions & 0 deletions apps/nextjs/src/app/_components/posts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,159 @@ import { useToast } from "@acme/ui/use-toast"

import { api } from "~/trpc/react"

// export function CreatePostForm2() {
// const t = useI18n()
// const toast = useToast()

// const form = useForm({
// schema: CreatePostSchema,
// defaultValues: {
// content: "",
// title: "",
// },
// })

// const utils = api.useUtils()
// const createPost = api.post.create.useMutation({
// onSuccess: async () => {
// form.reset()
// await utils.post.invalidate()
// },
// onError: (err) => {
// toast.error(
// err.data?.code === "UNAUTHORIZED"
// ? t("error.not_authorized")
// : t("posts.create.failed"),
// )
// },
// })

// return (
// <Form {...form}>
// <form
// className="flex w-full max-w-2xl flex-col gap-4"
// onSubmit={form.handleSubmit((data) => {
// createPost.mutate(data)
// })}
// >
// <FormField
// control={form.control}
// name="title"
// render={({ field }) => (
// <FormItem>
// <FormControl>
// <Input {...field} placeholder="Title" />
// </FormControl>
// <FormMessage />
// </FormItem>
// )}
// />
// <FormField
// control={form.control}
// name="content"
// render={({ field }) => (
// <FormItem>
// <FormControl>
// <Input {...field} placeholder="Content" />
// </FormControl>
// <FormMessage />
// </FormItem>
// )}
// />
// <Button>Create</Button>
// </form>
// </Form>
// )
// }

// export function PostList2() {
// const [posts] = api.post.all.useSuspenseQuery()

// if (posts.length === 0) {
// return (
// <div className="relative flex w-full flex-col gap-4">
// <PostCardSkeleton pulse={false} />
// <PostCardSkeleton pulse={false} />
// <PostCardSkeleton pulse={false} />

// <div className="absolute inset-0 flex flex-col items-center justify-center bg-black/10">
// <p className="text-2xl font-bold text-white">No posts yet</p>
// </div>
// </div>
// )
// }

// return (
// <div className="flex w-full flex-col gap-4">
// {posts.map((p) => {
// return <PostCard key={p.id} post={p} />
// })}
// </div>
// )
// }

// export function PostCard2(props: {
// post: RouterOutputs["post"]["all"][number]
// }) {
// const utils = api.useUtils()
// const deletePost = api.post.delete.useMutation({
// onSuccess: async () => {
// await utils.post.invalidate()
// },
// onError: (err) => {
// toast.error(
// err.data?.code === "UNAUTHORIZED"
// ? "You must be logged in to delete a post"
// : "Failed to delete post",
// )
// },
// })

// return (
// <div className="flex flex-row rounded-lg bg-muted p-4">
// <div className="flex-grow">
// <h2 className="text-2xl font-bold text-primary">{props.post.title}</h2>
// <p className="mt-2 text-sm">{props.post.content}</p>
// </div>
// <div>
// <Button
// variant="ghost"
// className="cursor-pointer text-sm font-bold uppercase text-primary hover:bg-transparent hover:text-white"
// onClick={() => deletePost.mutate(props.post.id)}
// >
// Delete
// </Button>
// </div>
// </div>
// )
// }

// export function PostCardSkeleton2(props: { pulse?: boolean }) {
// const { pulse = true } = props
// return (
// <div className="flex flex-row rounded-lg bg-muted p-4">
// <div className="flex-grow">
// <h2
// className={cn(
// "w-1/4 rounded bg-primary text-2xl font-bold",
// pulse && "animate-pulse",
// )}
// >
// &nbsp;
// </h2>
// <p
// className={cn(
// "mt-2 w-1/3 rounded bg-current text-sm",
// pulse && "animate-pulse",
// )}
// >
// &nbsp;
// </p>
// </div>
// </div>
// )
// }

export function CreatePostForm() {
const t = useI18n()

Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "t3-turbo-lucia",
"private": true,
"engines": {
"node": ">=20.12.0"
"node": ">=22"
},
"packageManager": "pnpm@9.4.0",
"packageManager": "pnpm@9.9.0",
"scripts": {
"build": "turbo run build",
"dev": "turbo watch dev",
Expand Down Expand Up @@ -32,11 +32,11 @@
},
"devDependencies": {
"@acme/prettier-config": "workspace:*",
"@turbo/gen": "2.0.6",
"prettier": "3.3.2",
"sherif": "0.9.0",
"turbo": "2.0.6",
"typescript": "5.5.3"
"@turbo/gen": "2.1.1",
"prettier": "3.3.3",
"sherif": "1.0.0",
"turbo": "2.1.1",
"typescript": "5.5.4"
},
"prettier": "@acme/prettier-config"
}
12 changes: 6 additions & 6 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"license": "MIT",
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"clean": "rm -rf .turbo node_modules",
"dev": "tsc",
"clean": "git clean -xdf .cache .turbo node_modules",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint",
"typecheck": "tsc --noEmit --emitDeclarationOnly false"
Expand All @@ -22,17 +22,17 @@
"@acme/auth": "workspace:*",
"@acme/db": "workspace:*",
"@acme/validators": "workspace:*",
"@trpc/server": "11.0.0-rc.364",
"@trpc/server": "11.0.0-rc.477",
"superjson": "2.2.1",
"zod": "3.23.8"
},
"devDependencies": {
"@acme/eslint-config": "workspace:*",
"@acme/prettier-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"eslint": "9.6.0",
"prettier": "3.3.2",
"typescript": "5.5.3"
"eslint": "9.9.1",
"prettier": "3.3.3",
"typescript": "5.5.4"
},
"prettier": "@acme/prettier-config"
}
18 changes: 9 additions & 9 deletions packages/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@
},
"license": "MIT",
"scripts": {
"clean": "rm -rf .turbo node_modules",
"clean": "git clean -xdf .cache .turbo node_modules",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@acme/db": "workspace:*",
"@lucia-auth/adapter-drizzle": "1.0.7",
"@t3-oss/env-nextjs": "0.10.1",
"arctic": "1.9.1",
"@lucia-auth/adapter-drizzle": "1.1.0",
"@t3-oss/env-nextjs": "0.11.1",
"arctic": "1.9.2",
"lucia": "3.2.0",
"next": "14.2.4",
"next": "14.2.8",
"oslo": "1.2.1",
"react": "18.3.1",
"react-dom": "18.3.1",
Expand All @@ -33,10 +33,10 @@
"@acme/prettier-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"@octokit/types": "13.5.0",
"discord-api-types": "0.37.91",
"eslint": "9.6.0",
"prettier": "3.3.2",
"typescript": "5.5.3"
"discord-api-types": "0.37.100",
"eslint": "9.9.1",
"prettier": "3.3.3",
"typescript": "5.5.4"
},
"prettier": "@acme/prettier-config"
}
16 changes: 8 additions & 8 deletions packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"license": "MIT",
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"clean": "rm -rf .turbo node_modules",
"dev": "tsc",
"clean": "git clean -xdf .cache .turbo node_modules",
"format": "prettier --check . --ignore-path ../../.gitignore",
"lint": "eslint",
"migrate": "pnpm with-env drizzle-kit migrate",
Expand All @@ -33,8 +33,8 @@
"with-env": "dotenv -e ../../.env --"
},
"dependencies": {
"@t3-oss/env-core": "0.10.1",
"drizzle-orm": "0.31.2",
"@t3-oss/env-core": "0.11.1",
"drizzle-orm": "0.33.0",
"drizzle-zod": "0.5.1",
"postgres": "3.4.4",
"zod": "3.23.8"
Expand All @@ -44,10 +44,10 @@
"@acme/prettier-config": "workspace:*",
"@acme/tsconfig": "workspace:*",
"dotenv-cli": "7.4.2",
"drizzle-kit": "0.22.8",
"eslint": "9.6.0",
"prettier": "3.3.2",
"typescript": "5.5.3"
"drizzle-kit": "0.24.2",
"eslint": "9.9.1",
"prettier": "3.3.3",
"typescript": "5.5.4"
},
"prettier": "@acme/prettier-config"
}
Loading