Skip to content

Commit

Permalink
Perform typescript upgrade (#1121)
Browse files Browse the repository at this point in the history
* build(ts): upgrade deps

* feat(website): do not throw error

* feat(website): handle invalid otp codes
  • Loading branch information
IgnisDa authored Nov 29, 2024
1 parent 1a7ff30 commit 4f595be
Show file tree
Hide file tree
Showing 8 changed files with 326 additions and 295 deletions.
38 changes: 19 additions & 19 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@
"@formkit/auto-animate": "0.8.2",
"@hello-pangea/dnd": "17.0.0",
"@lukemorales/query-key-factory": "1.3.4",
"@mantine/carousel": "7.14.1",
"@mantine/charts": "7.14.1",
"@mantine/core": "7.14.1",
"@mantine/dates": "7.14.1",
"@mantine/form": "7.14.1",
"@mantine/hooks": "7.14.1",
"@mantine/notifications": "7.14.1",
"@mantine/carousel": "7.14.3",
"@mantine/charts": "7.14.3",
"@mantine/core": "7.14.3",
"@mantine/dates": "7.14.3",
"@mantine/form": "7.14.3",
"@mantine/hooks": "7.14.3",
"@mantine/notifications": "7.14.3",
"@remix-pwa/sw": "3.0.10",
"@remix-pwa/worker-runtime": "2.1.4",
"@remix-run/node": "2.14.0",
"@remix-run/react": "2.14.0",
"@remix-run/serve": "2.14.0",
"@remix-run/node": "2.15.0",
"@remix-run/react": "2.15.0",
"@remix-run/serve": "2.15.0",
"@ryot/generated": "workspace:*",
"@ryot/graphql": "workspace:*",
"@ryot/ts-utils": "workspace:*",
"@tabler/icons-react": "3.17.0",
"@tanstack/react-query": "5.61.0",
"@tanstack/react-query-devtools": "5.61.0",
"@tanstack/react-query": "5.62.0",
"@tanstack/react-query-devtools": "5.62.0",
"buffer": "6.0.3",
"clsx": "2.1.1",
"cookie": "1.0.1",
"cookie": "1.0.2",
"crypto-js": "4.2.0",
"dayjs": "1.11.13",
"dotenv": "16.4.5",
Expand All @@ -47,17 +47,17 @@
"jotai": "2.10.3",
"js-cookie": "3.0.5",
"jwt-decode": "4.0.0",
"mantine-datatable": "7.12.4",
"nanoid": "5.0.8",
"mantine-datatable": "7.14.5",
"nanoid": "5.0.9",
"react": "18.3.1",
"react-confirm": "0.3.0-7",
"react-dom": "18.3.1",
"react-virtuoso": "4.12.0",
"react-virtuoso": "4.12.2",
"react-webcam": "7.2.0",
"recharts": "2.13.3",
"remix-routes": "1.7.7",
"remix-utils": "7.7.0",
"tailwind-merge": "2.5.4",
"tailwind-merge": "2.5.5",
"tiny-invariant": "1.3.3",
"ts-pattern": "5.5.0",
"ufo": "1.5.4",
Expand All @@ -69,7 +69,7 @@
"devDependencies": {
"@bitprojects/umami-logger-typescript": "1.0.10",
"@remix-pwa/dev": "3.1.0",
"@remix-run/dev": "2.14.0",
"@remix-run/dev": "2.15.0",
"@types/cookie": "1.0.0",
"@types/crypto-js": "4.2.2",
"@types/howler": "2.2.12",
Expand All @@ -82,7 +82,7 @@
"postcss-simple-vars": "7.0.1",
"remix-development-tools": "4.7.7",
"ts-essentials": "10.0.3",
"typescript": "5.6.3",
"typescript": "5.7.2",
"typescript-plugin-css-modules": "5.1.0",
"typescript-remix-routes-plugin": "1.0.1",
"vite": "5.4.11",
Expand Down
15 changes: 15 additions & 0 deletions apps/website/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import {
Outlet,
Scripts,
ScrollRestoration,
isRouteErrorResponse,
useLoaderData,
useRouteError,
} from "@remix-run/react";
import { HoneypotProvider } from "remix-utils/honeypot/react";
import "./tailwind.css";
Expand Down Expand Up @@ -131,3 +133,16 @@ export default function App() {
</html>
);
}

export function ErrorBoundary() {
const error = useRouteError() as Error;
const message = isRouteErrorResponse(error)
? error.data.message
: error.message;

return (
<div>
<p>We encountered an error: {message}</p>
</div>
);
}
4 changes: 3 additions & 1 deletion apps/website/app/routes/_index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import TTLCache from "@isaacs/ttlcache";
import {
type ActionFunctionArgs,
type LoaderFunctionArgs,
data,
redirect,
} from "@remix-run/node";
import {
Expand Down Expand Up @@ -95,7 +96,8 @@ export const action = async ({ request }: ActionFunctionArgs) => {
.with("registerWithEmail", async () => {
const submission = processSubmission(formData, registerSchema);
const otpCode = otpCodesCache.get(submission.email);
if (otpCode !== submission.otpCode) throw new Error("Invalid OTP code.");
if (otpCode !== submission.otpCode)
throw data({ message: "Invalid OTP code." }, { status: 400 });
const dbCustomer = await db
.insert(customers)
.values({ email: submission.email })
Expand Down
30 changes: 15 additions & 15 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,45 +10,45 @@
"@conform-to/zod": "1.2.2",
"@isaacs/ttlcache": "1.4.1",
"@paddle/paddle-js": "1.3.2",
"@paddle/paddle-node-sdk": "2.0.0",
"@paddle/paddle-node-sdk": "2.1.2",
"@radix-ui/react-label": "2.1.0",
"@radix-ui/react-slot": "1.1.0",
"@radix-ui/react-tooltip": "1.1.4",
"@react-email/components": "0.0.28",
"@remix-run/node": "2.14.0",
"@remix-run/react": "2.14.0",
"@remix-run/serve": "2.14.0",
"@remix-run/node": "2.15.0",
"@remix-run/react": "2.15.0",
"@remix-run/serve": "2.15.0",
"@ryot/generated": "workspace:*",
"@ryot/graphql": "workspace:*",
"@ryot/transactional": "workspace:*",
"@ryot/ts-utils": "workspace:*",
"@tabler/icons-react": "3.17.0",
"@unkey/api": "0.26.2",
"class-variance-authority": "0.7.0",
"@unkey/api": "0.27.0",
"class-variance-authority": "0.7.1",
"clsx": "2.1.1",
"crypto-js": "4.2.0",
"dayjs": "1.11.13",
"drizzle-orm": "0.36.3",
"embla-carousel-autoplay": "8.4.0",
"embla-carousel-react": "8.4.0",
"drizzle-orm": "0.36.4",
"embla-carousel-autoplay": "8.5.1",
"embla-carousel-react": "8.5.1",
"graphql": "16.9.0",
"graphql-request": "7.1.2",
"humanize-duration-ts": "2.1.1",
"input-otp": "1.4.1",
"isbot": "5.1.17",
"lodash": "4.17.21",
"lucide-react": "0.460.0",
"nanoid": "5.0.8",
"lucide-react": "0.462.0",
"nanoid": "5.0.9",
"next-themes": "0.4.3",
"nodemailer": "6.9.16",
"openid-client": "5.7.0",
"openid-client": "5.7.1",
"postgres": "3.4.5",
"react": "18.3.1",
"react-dom": "18.3.1",
"remix-routes": "1.7.7",
"remix-utils": "7.7.0",
"sonner": "1.7.0",
"tailwind-merge": "2.5.4",
"tailwind-merge": "2.5.5",
"tailwindcss-animate": "1.0.7",
"tiny-invariant": "1.3.3",
"ts-pattern": "5.5.0",
Expand All @@ -57,7 +57,7 @@
"zodix": "0.4.4"
},
"devDependencies": {
"@remix-run/dev": "2.14.0",
"@remix-run/dev": "2.15.0",
"@tailwindcss/typography": "0.5.15",
"@types/crypto-js": "4.2.2",
"@types/lodash": "4.17.13",
Expand All @@ -68,7 +68,7 @@
"drizzle-kit": "0.28.1",
"postcss": "8.4.49",
"tailwindcss": "3.4.15",
"typescript": "5.6.3",
"typescript": "5.7.2",
"typescript-remix-routes-plugin": "1.0.1",
"vite": "5.4.11",
"vite-tsconfig-paths": "5.1.3"
Expand Down
2 changes: 1 addition & 1 deletion libs/generated/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
},
"devDependencies": {
"@graphql-codegen/cli": "5.0.3",
"@graphql-codegen/client-preset": "4.5.0"
"@graphql-codegen/client-preset": "4.5.1"
}
}
2 changes: 1 addition & 1 deletion libs/ts-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dayjs": "1.11.13",
"humanize-duration-ts": "2.1.1",
"lodash": "4.17.21",
"tailwind-merge": "2.5.4",
"tailwind-merge": "2.5.5",
"tiny-invariant": "1.3.3",
"zod": "3.23.8"
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"devDependencies": {
"@biomejs/biome": "1.9.4",
"tsconfig-moon": "1.3.0",
"typescript": "5.6.3"
"typescript": "5.7.2"
},
"resolutions": {
"@types/react": "18.3.4"
Expand Down
Loading

0 comments on commit 4f595be

Please sign in to comment.