Skip to content

Commit

Permalink
Merge pull request #124 from GTD-IT-XXIV/gillbert/migrate-trpc-11
Browse files Browse the repository at this point in the history
Migrate to tRPC v11 and Next 14.1.4
  • Loading branch information
gillwong authored Mar 21, 2024
2 parents 4846aab + 1862012 commit 6752485
Show file tree
Hide file tree
Showing 31 changed files with 736 additions and 798 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ Use the tRPC client `api` defined in `src/trpc/server`. Example:
import { api } from "@/server/trpc";

export default async function ExamplePage() {
const event = await api.event.getById.query(1);
const event = await api.event.getById(1);
return <main>{event?.name}</main>;
}
```
Expand Down
22 changes: 5 additions & 17 deletions docker/development/web.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ RUN corepack enable pnpm && pnpm build
FROM base AS runner
WORKDIR /app

ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime.
# ENV NEXT_TELEMETRY_DISABLED 1

RUN mkdir .next

# Automatically leverage output traces to reduce image size
Expand All @@ -49,26 +45,18 @@ COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/publi[c] ./public
COPY --from=builder /app/.env* ./

# Copy sharp optionalDependencies due to @vercel/nft bug: https://github.com/lovell/sharp/issues/3967
# For linux/arm64 platform
COPY --from=deps /app/node_modules/.pnpm/@[email protected].[1] ./node_modules/.pnpm/@[email protected]
COPY --from=deps /app/node_modules/.pnpm/@[email protected].[1] ./node_modules/.pnpm/@[email protected]
COPY --from=deps /app/node_modules/.pnpm/@[email protected].[2] ./node_modules/.pnpm/@[email protected]
COPY --from=deps /app/node_modules/.pnpm/@[email protected].[2] ./node_modules/.pnpm/@[email protected]
# For linux/amd64 platform
COPY --from=deps /app/node_modules/.pnpm/@[email protected].[1] ./node_modules/.pnpm/@[email protected]
COPY --from=deps /app/node_modules/.pnpm/@[email protected].[1] ./node_modules/.pnpm/@[email protected]
COPY --from=deps /app/node_modules/.pnpm/@[email protected].[2] ./node_modules/.pnpm/@[email protected]
COPY --from=deps /app/node_modules/.pnpm/@[email protected].[2] ./node_modules/.pnpm/@[email protected]

FROM gcr.io/distroless/nodejs20-debian11
COPY --from=runner --chown=nonroot:nonroot /app /app
WORKDIR /app

COPY --from=runner --chown=nonroot:nonroot /app ./

USER nonroot

EXPOSE 3000

ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime.
# ENV NEXT_TELEMETRY_DISABLED 1
ENV PORT 3000
# set hostname to localhost
ENV HOSTNAME "0.0.0.0"
Expand Down
12 changes: 0 additions & 12 deletions docker/production/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,6 @@ COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/publi[c] ./public
COPY --from=builder /app/.env* ./

# Copy sharp optionalDependencies due to @vercel/nft bug: https://github.com/lovell/sharp/issues/3967
# For linux/arm64 platform
COPY --from=deps /app/node_modules/.pnpm/@[email protected].[1] ./node_modules/.pnpm/@[email protected]
COPY --from=deps /app/node_modules/.pnpm/@[email protected].[1] ./node_modules/.pnpm/@[email protected]
COPY --from=deps /app/node_modules/.pnpm/@[email protected].[2] ./node_modules/.pnpm/@[email protected]
COPY --from=deps /app/node_modules/.pnpm/@[email protected].[2] ./node_modules/.pnpm/@[email protected]
# For linux/amd64 platform
COPY --from=deps /app/node_modules/.pnpm/@[email protected].[1] ./node_modules/.pnpm/@[email protected]
COPY --from=deps /app/node_modules/.pnpm/@[email protected].[1] ./node_modules/.pnpm/@[email protected]
COPY --from=deps /app/node_modules/.pnpm/@[email protected].[2] ./node_modules/.pnpm/@[email protected]
COPY --from=deps /app/node_modules/.pnpm/@[email protected].[2] ./node_modules/.pnpm/@[email protected]

FROM gcr.io/distroless/nodejs20-debian11
COPY --from=runner --chown=nonroot:nonroot /app /app
WORKDIR /app
Expand Down
28 changes: 15 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"prepare": "husky",
"postinstall": "prisma generate",
"test": "vitest",
"ts:check": "tsc",
"\n========== Development ==========": "",
"dev": "next dev",
"dev:prisma": "dotenv -c development -- prisma",
Expand Down Expand Up @@ -43,7 +44,7 @@
"dependencies": {
"@hookform/resolvers": "^3.3.4",
"@lucia-auth/adapter-prisma": "^3.0.2",
"@prisma/client": "^5.10.2",
"@prisma/client": "^5.11.0",
"@radix-ui/react-alert-dialog": "^1.0.5",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-icons": "^1.3.0",
Expand All @@ -58,11 +59,12 @@
"@stripe/react-stripe-js": "^2.6.2",
"@stripe/stripe-js": "^3.0.10",
"@t3-oss/env-nextjs": "^0.9.2",
"@tanstack/react-query": "^4.36.1",
"@trpc/client": "^10.45.2",
"@trpc/next": "^10.45.2",
"@trpc/react-query": "^10.45.2",
"@trpc/server": "^10.45.2",
"@tanstack/react-query": "^5.28.4",
"@tanstack/react-query-devtools": "^5.28.4",
"@trpc/client": "11.0.0-next-beta.318",
"@trpc/next": "11.0.0-next-beta.318",
"@trpc/react-query": "11.0.0-next-beta.318",
"@trpc/server": "11.0.0-next-beta.318",
"class-variance-authority": "^0.7.0",
"client-only": "0.0.1",
"clsx": "^2.1.0",
Expand All @@ -71,14 +73,14 @@
"embla-carousel-react": "8.0.0",
"framer-motion": "^11.0.14",
"fuse.js": "^7.0.0",
"google-auth-library": "^9.6.3",
"google-auth-library": "^9.7.0",
"google-spreadsheet": "^4.1.1",
"jiti": "^1.21.0",
"jotai": "^2.7.1",
"lodash.isequal": "^4.5.0",
"lucia": "^2.7.7",
"lucide-react": "^0.294.0",
"next": "14.1.3",
"next": "14.1.4",
"qr-scanner": "^1.4.2",
"qrcode": "^1.5.3",
"react": "~18.2.0",
Expand All @@ -98,26 +100,26 @@
"zod-validation-error": "^3.0.3"
},
"devDependencies": {
"@next/bundle-analyzer": "14.1.3",
"@next/bundle-analyzer": "14.1.4",
"@swc-jotai/react-refresh": "^0.1.0",
"@testcontainers/postgresql": "^10.7.2",
"@testing-library/react": "^14.2.1",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/lodash.isequal": "^4.5.8",
"@types/node": "^20.11.28",
"@types/qrcode": "^1.5.5",
"@types/react": "~18.2.64",
"@types/react": "~18.2.66",
"@types/react-dom": "~18.2.22",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.1.1",
"@typescript-eslint/parser": "^7.2.0",
"@vitejs/plugin-react": "^4.2.1",
"@vitest/ui": "^1.3.1",
"@vitest/ui": "^1.4.0",
"autoprefixer": "^10.4.18",
"cross-env": "^7.0.3",
"dotenv": "^16.4.5",
"dotenv-cli": "^7.4.1",
"eslint": "^8.57.0",
"eslint-config-next": "14.1.3",
"eslint-config-next": "14.1.4",
"eslint-plugin-unicorn": "^51.0.1",
"gzip-size": "^6.0.0",
"husky": "^9.0.11",
Expand Down
Loading

0 comments on commit 6752485

Please sign in to comment.