diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index 7b6a9b81..cf0c818d 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -1,8 +1,8 @@ import createJiti from 'jiti' -import { fileURLToPath } from 'node:url' +import {fileURLToPath} from 'node:url' import withBundleAnalyzer from '@next/bundle-analyzer' import withPWAInit from '@ducanh2912/next-pwa' -import { withAxiom } from 'next-axiom' +import {withAxiomNextConfig} from 'next-axiom' const withPWA = withPWAInit({ dest: 'public', @@ -28,7 +28,7 @@ jiti('@weatherio/api/env') /** @type {import("next").NextConfig} */ const config = withMyBundleAnalyzer(withPWA( - withAxiom({ + withAxiomNextConfig({ reactStrictMode: true, /** Enables hot reloading for local packages without a build step */ diff --git a/apps/web/package.json b/apps/web/package.json index feb469fb..ed16bb19 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -20,10 +20,10 @@ "@t3-oss/env-nextjs": "^0.9.2", "@tanstack/react-query": "^5.28.6", "@tanstack/react-query-devtools": "^5.28.6", - "@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", + "@trpc/client": "^11.0.0-rc.403", + "@trpc/next": "^11.0.0-rc.403", + "@trpc/react-query": "^11.0.0-rc.403", + "@trpc/server": "^11.0.0-rc.403", "@vercel/analytics": "^1.2.2", "@vercel/speed-insights": "^1.0.10", "@weatherio/api": "workspace:^0.1.0", diff --git a/apps/web/src/pages/api/trpc/[trpc].ts b/apps/web/src/pages/api/trpc/[trpc].ts index 749f76c0..523d6d7c 100644 --- a/apps/web/src/pages/api/trpc/[trpc].ts +++ b/apps/web/src/pages/api/trpc/[trpc].ts @@ -1,5 +1,6 @@ import type { NextRequest } from "next/server"; import { fetchRequestHandler } from "@trpc/server/adapters/fetch"; +import { withAxiomRouteHandler } from "next-axiom"; import { appRouter, createTRPCContext } from "@weatherio/api"; @@ -8,7 +9,7 @@ import { env } from "~/env"; export const config = { runtime: "edge" }; // export API handler -export default async function handler(req: NextRequest) { +const handler = withAxiomRouteHandler((req: NextRequest) => { return fetchRequestHandler({ endpoint: "/api/trpc", router: appRouter, @@ -23,4 +24,6 @@ export default async function handler(req: NextRequest) { } : undefined, }); -} +}); + +export default handler; diff --git a/package.json b/package.json index 16a5eff9..07303f4f 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "engines": { "node": ">=20.11.1" }, - "packageManager": "pnpm@9.1.2", + "packageManager": "pnpm@9.3.0", "scripts": { "build": "turbo build", "clean": "git clean -xdf node_modules", @@ -29,7 +29,7 @@ "@turbo/gen": "^1.12.5", "@weatherio/prettier-config": "workspace:^0.1.0", "prettier": "^3.2.5", - "turbo": "^1.13.2", + "turbo": "^2.0.3", "typescript": "^5.4.2" }, "prettier": "@weatherio/prettier-config" diff --git a/packages/api/package.json b/packages/api/package.json index 969577bf..2f33ab90 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -16,12 +16,13 @@ }, "dependencies": { "@t3-oss/env-nextjs": "^0.9.2", - "@trpc/client": "^11.0.0-next-beta.318", - "@trpc/server": "^11.0.0-next-beta.318", + "@trpc/client": "^11.0.0-rc.403", + "@trpc/server": "^11.0.0-rc.403", "@upstash/ratelimit": "^1.0.1", "@upstash/redis": "^1.28.4", "@weatherio/types": "workspace:^0.1.0", "dayjs": "^1.11.10", + "next": "^14.1.3", "next-axiom": "^1.3.0", "resend": "^3.2.0", "superjson": "2.2.1", diff --git a/packages/api/src/routers/email.ts b/packages/api/src/routers/email.ts index be1f4c10..ad964a4c 100644 --- a/packages/api/src/routers/email.ts +++ b/packages/api/src/routers/email.ts @@ -1,4 +1,3 @@ -import { log } from "next-axiom"; import { Resend } from "resend"; import { z } from "zod"; @@ -19,7 +18,7 @@ export const emailRouter = createTRPCRouter({ }), ) .mutation(async ({ input, ctx }) => { - log.info("User sent email", { + ctx.log.info("User sent email", { firstName: input.firstName, lastName: input.lastName, email: input.email, diff --git a/packages/api/src/routers/weather.ts b/packages/api/src/routers/weather.ts index fe652d17..3229c327 100644 --- a/packages/api/src/routers/weather.ts +++ b/packages/api/src/routers/weather.ts @@ -1,7 +1,6 @@ import dayjs from "dayjs"; import timezone from "dayjs/plugin/timezone"; import utc from "dayjs/plugin/utc"; -import { log } from "next-axiom"; import { z } from "zod"; import type { IDailyForecast, IHourlyForecast } from "@weatherio/types"; @@ -166,7 +165,7 @@ function calculateAirQualityIndex( pm25: number, nitrogenDioxide: number, ): number { - // log.debug("start running calculateAirQualityIndex"); + // ctx.log.debug("start running calculateAirQualityIndex"); const maxPm10Value = 100; const maxPm25Value = 71; const maxNitrogenDioxideValue = 601; @@ -180,9 +179,9 @@ function calculateAirQualityIndex( ? (nitrogenDioxide / maxNitrogenDioxideValue) * 100 : 100; - // log.debug("aqiPm10", { aqiPm10 }); - // log.debug("aqiPm25", { aqiPm25 }); - // log.debug("aqiNitrogenDioxide", { aqiNitrogenDioxide }); + // ctx.log.debug("aqiPm10", { aqiPm10 }); + // ctx.log.debug("aqiPm25", { aqiPm25 }); + // ctx.log.debug("aqiNitrogenDioxide", { aqiNitrogenDioxide }); return Math.max(aqiPm10, aqiPm25, aqiNitrogenDioxide); } @@ -199,7 +198,7 @@ export const weatherRouter = createTRPCRouter({ }), ) .query(async ({ input, ctx }) => { - log.info("User requested weather data for coordinates", { + ctx.log.info("User requested weather data for coordinates", { coordinates: input.coordinates, timezone: input.timezone, user: ctx.ip, @@ -266,21 +265,21 @@ export const weatherRouter = createTRPCRouter({ } } catch (error) { if (error instanceof z.ZodError) { - log.error(`Zod Errors in the ${errorMessage}`, { + ctx.log.error(`Zod Errors in the ${errorMessage}`, { errorIssues: error.issues, resultStatus: result.status, resultValue: result.value, }); } else { - log.error(`Else Error in the ${errorMessage}`, { + ctx.log.error(`Else Error in the ${errorMessage}`, { error, result, }); } } } else { - log.debug("result", result); - log.error(`${errorMessage} request failed`, { + ctx.log.debug("result", result); + ctx.log.error(`${errorMessage} request failed`, { status: result.status, reason: typeof result.reason === "string" @@ -336,7 +335,7 @@ export const weatherRouter = createTRPCRouter({ ); } - // log.debug("presentAirQualityIndex", { presentAirQualityIndex }); + // ctx.log.debug("presentAirQualityIndex", { presentAirQualityIndex }); const hourlyForecast: IHourlyForecast[] = []; @@ -408,7 +407,7 @@ export const weatherRouter = createTRPCRouter({ // console.log("temperatureSumNight", temperatureSumNight); } } else { - log.debug("undefined value temperature: ", { j }); + ctx.log.debug("undefined value temperature: ", { j }); } if (hourlyAndDailyData.hourly.rain[j] !== undefined) { @@ -417,7 +416,7 @@ export const weatherRouter = createTRPCRouter({ // console.log(hourlyAndDailyData.hourly.rain[j]!); // console.log("rainSum", rainSum); } else { - log.debug("undefined value rain: ", { j }); + ctx.log.debug("undefined value rain: ", { j }); } if (hourlyAndDailyData.hourly.showers[j] !== undefined) { @@ -426,7 +425,7 @@ export const weatherRouter = createTRPCRouter({ // console.log(hourlyAndDailyData.hourly.showers[j]!); // console.log("showersSum", showersSum); } else { - log.debug("undefined value showers: ", { j }); + ctx.log.debug("undefined value showers: ", { j }); } if (hourlyAndDailyData.hourly.snowfall[j] !== undefined) { @@ -435,7 +434,7 @@ export const weatherRouter = createTRPCRouter({ // console.log(hourlyAndDailyData.hourly.snowfall[j]!); // console.log("snowfallSum", snowfallSum); } else { - log.debug("undefined value snowfall: ", { j }); + ctx.log.debug("undefined value snowfall: ", { j }); } if (hourlyAndDailyData.hourly.cloudcover[j] !== undefined) { @@ -545,7 +544,7 @@ export const weatherRouter = createTRPCRouter({ return (probabilities[startIndex]! + probabilities[endIndex]!) / 2; } - /* log.debug("getTimeSlotAverage", { + /* ctx.log.debug("getTimeSlotAverage", { startIndex, endIndex, probabilities, diff --git a/packages/api/src/trpc.ts b/packages/api/src/trpc.ts index 5b30901b..30d40602 100644 --- a/packages/api/src/trpc.ts +++ b/packages/api/src/trpc.ts @@ -8,9 +8,11 @@ */ import type { FetchCreateContextFnOptions } from "@trpc/server/adapters/fetch"; +import type { AxiomRequest } from "next-axiom"; +import type { NextRequest } from "next/server"; import { initTRPC, TRPCError } from "@trpc/server"; import { Ratelimit } from "@upstash/ratelimit"; -import { log } from "next-axiom"; +import { log, Logger } from "next-axiom"; import superjson from "superjson"; import { ZodError } from "zod"; @@ -54,6 +56,10 @@ const UPSTASH_RATELIMITER_TIME_INTERVAL: Duration = validateDuration( ? env.UPSTASH_RATELIMITER_TIME_INTERVAL : "1d"; +function isAxiomRequest(req: unknown): req is AxiomRequest { + return (req as NextRequest & { log: Logger }).log instanceof Logger; +} + /** * This is the actual context you will use in your router. It will be used to process every request * that goes through your tRPC endpoint. @@ -65,11 +71,13 @@ export const createTRPCContext = ({ resHeaders, }: FetchCreateContextFnOptions) => { const ip = req.headers.get("x-forwarded-for") ?? ""; + return { ...createInnerTRPCContext({}), req, resHeaders, ip, + axiomTRPCMeta: {}, }; }; @@ -155,6 +163,22 @@ const rateLimitMiddleware = t.middleware(async ({ ctx, path, next }) => { return next(); }); +const axiomMiddleware = t.middleware(async ({ ctx, next }) => { + const req = ctx.req; + + if (!isAxiomRequest(req)) { + throw new Error( + "`nextAxiomTRPCMiddleware` could not find logger. Did you forget to wrap your route handler in `withAxiom`? See: TODO: link to docs", + ); + } + + const log = req.log.with({ axiomTRPCMeta: ctx.axiomTRPCMeta }); + + return next({ + ctx: { log }, + }); +}); + export const createTRPCRouter = t.router; /** @@ -164,5 +188,6 @@ export const createTRPCRouter = t.router; * It does not guarantee that a user querying is authorized, but you can still access user session data if they * are logged in. */ -export const publicProcedure = t.procedure; -export const rateLimitedProcedure = t.procedure.use(rateLimitMiddleware); +export const axiomPublicProcedure = t.procedure.use(axiomMiddleware); +export const rateLimitedProcedure = + axiomPublicProcedure.use(rateLimitMiddleware); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5b0f3889..ec93b08f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,8 +24,8 @@ importers: specifier: ^3.2.5 version: 3.2.5 turbo: - specifier: ^1.13.2 - version: 1.13.2 + specifier: ^2.0.3 + version: 2.0.3 typescript: specifier: ^5.4.2 version: 5.4.2 @@ -54,17 +54,17 @@ importers: specifier: ^5.28.6 version: 5.28.6(@tanstack/react-query@5.28.6(react@18.2.0))(react@18.2.0) '@trpc/client': - specifier: ^11.0.0-next-beta.318 - version: 11.0.0-next-beta.318(@trpc/server@11.0.0-next-beta.318) + specifier: ^11.0.0-rc.403 + version: 11.0.0-rc.403(@trpc/server@11.0.0-rc.403) '@trpc/next': - specifier: ^11.0.0-next-beta.318 - version: 11.0.0-next-beta.318(@tanstack/react-query@5.28.6(react@18.2.0))(@trpc/client@11.0.0-next-beta.318(@trpc/server@11.0.0-next-beta.318))(@trpc/react-query@11.0.0-next-beta.318(@tanstack/react-query@5.28.6(react@18.2.0))(@trpc/client@11.0.0-next-beta.318(@trpc/server@11.0.0-next-beta.318))(@trpc/server@11.0.0-next-beta.318)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@trpc/server@11.0.0-next-beta.318)(next@14.1.3(@babel/core@7.23.7)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + specifier: ^11.0.0-rc.403 + version: 11.0.0-rc.403(@tanstack/react-query@5.28.6(react@18.2.0))(@trpc/client@11.0.0-rc.403(@trpc/server@11.0.0-rc.403))(@trpc/react-query@11.0.0-rc.403(@tanstack/react-query@5.28.6(react@18.2.0))(@trpc/client@11.0.0-rc.403(@trpc/server@11.0.0-rc.403))(@trpc/server@11.0.0-rc.403)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@trpc/server@11.0.0-rc.403)(next@14.1.3(@babel/core@7.23.7)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@trpc/react-query': - specifier: ^11.0.0-next-beta.318 - version: 11.0.0-next-beta.318(@tanstack/react-query@5.28.6(react@18.2.0))(@trpc/client@11.0.0-next-beta.318(@trpc/server@11.0.0-next-beta.318))(@trpc/server@11.0.0-next-beta.318)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + specifier: ^11.0.0-rc.403 + version: 11.0.0-rc.403(@tanstack/react-query@5.28.6(react@18.2.0))(@trpc/client@11.0.0-rc.403(@trpc/server@11.0.0-rc.403))(@trpc/server@11.0.0-rc.403)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@trpc/server': - specifier: ^11.0.0-next-beta.318 - version: 11.0.0-next-beta.318 + specifier: ^11.0.0-rc.403 + version: 11.0.0-rc.403 '@vercel/analytics': specifier: ^1.2.2 version: 1.2.2(next@14.1.3(@babel/core@7.23.7)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0) @@ -181,11 +181,11 @@ importers: specifier: ^0.9.2 version: 0.9.2(typescript@5.4.2)(zod@3.22.4) '@trpc/client': - specifier: ^11.0.0-next-beta.318 - version: 11.0.0-next-beta.318(@trpc/server@11.0.0-next-beta.318) + specifier: ^11.0.0-rc.403 + version: 11.0.0-rc.403(@trpc/server@11.0.0-rc.403) '@trpc/server': - specifier: ^11.0.0-next-beta.318 - version: 11.0.0-next-beta.318 + specifier: ^11.0.0-rc.403 + version: 11.0.0-rc.403 '@upstash/ratelimit': specifier: ^1.0.1 version: 1.0.1 @@ -198,6 +198,9 @@ importers: dayjs: specifier: ^1.11.10 version: 1.11.10 + next: + specifier: ^14.1.3 + version: 14.1.3(@babel/core@7.23.7)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) next-axiom: specifier: ^1.3.0 version: 1.3.0(@types/node@20.11.28)(next@14.1.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0)(terser@5.26.0) @@ -2276,18 +2279,18 @@ packages: '@total-typescript/ts-reset@0.5.1': resolution: {integrity: sha512-AqlrT8YA1o7Ff5wPfMOL0pvL+1X+sw60NN6CcOCqs658emD6RfiXhF7Gu9QcfKBH7ELY2nInLhKSCWVoNL70MQ==} - '@trpc/client@11.0.0-next-beta.318': - resolution: {integrity: sha512-R3IlUZqN3WKNNWsayMiVP6JqWVdyNSuwQmBQY7VqVepUBV210uo4GoFLv2vmmegOlHzgx9IUZG7u1grN1v1nAg==} + '@trpc/client@11.0.0-rc.403': + resolution: {integrity: sha512-4Elc4/PQI1H2Mpt3VWVINtYI8HhuPkvu/xowGDlHhYemmuvR3OqnE4H3I1XiPS9EXDOT397VadTJ5eGhQIZxPA==} peerDependencies: - '@trpc/server': 11.0.0-next-beta.318+e9899d002 + '@trpc/server': 11.0.0-rc.403+ab71a1be6 - '@trpc/next@11.0.0-next-beta.318': - resolution: {integrity: sha512-qeWfJ1vPm7GchLmMZz5Gj+mBka0CRci0bCKEhGoG8RSvI/+9GbbhZHKRRDnlsN81CgexJ2e2nULET9ESO6rt+Q==} + '@trpc/next@11.0.0-rc.403': + resolution: {integrity: sha512-QasW/7BzBlSuCbjmeRjL3dn1sodJBfX/rRP7Tu5W87Oy+ZlgCYhIOpHY8gjUd6Dts8O7O7r43ynGv9Zu7lejXg==} peerDependencies: - '@tanstack/react-query': ^5.25.0 - '@trpc/client': 11.0.0-next-beta.318+e9899d002 - '@trpc/react-query': 11.0.0-next-beta.318+e9899d002 - '@trpc/server': 11.0.0-next-beta.318+e9899d002 + '@tanstack/react-query': ^5.40.0 + '@trpc/client': 11.0.0-rc.403+ab71a1be6 + '@trpc/react-query': 11.0.0-rc.403+ab71a1be6 + '@trpc/server': 11.0.0-rc.403+ab71a1be6 next: '*' react: '>=16.8.0' react-dom: '>=16.8.0' @@ -2297,17 +2300,17 @@ packages: '@trpc/react-query': optional: true - '@trpc/react-query@11.0.0-next-beta.318': - resolution: {integrity: sha512-T6l4+OuOkE4yylUqtT5EiLXo0M5+XW6YaKqnTCMkELQrrPmq3Ok0eKfhWy1Xk+ayx02POO9fTzNhITz3BID21Q==} + '@trpc/react-query@11.0.0-rc.403': + resolution: {integrity: sha512-a4emDWo0EBTPULqzC92pJaJYTjM71GzdZfYcKYMxGMaevruUQAgmnXumeTkUUrj3QP6eszxVgolSu69Jw+iiSQ==} peerDependencies: - '@tanstack/react-query': ^5.25.0 - '@trpc/client': 11.0.0-next-beta.318+e9899d002 - '@trpc/server': 11.0.0-next-beta.318+e9899d002 + '@tanstack/react-query': ^5.40.0 + '@trpc/client': 11.0.0-rc.403+ab71a1be6 + '@trpc/server': 11.0.0-rc.403+ab71a1be6 react: '>=18.2.0' react-dom: '>=18.2.0' - '@trpc/server@11.0.0-next-beta.318': - resolution: {integrity: sha512-lxwWfqgv3LvIfhagCElDtNEY6C2sQU3o43OH0vn9hQ+7o9j+JHwEZjZz1ixvm3wUZvwZ68LheXuKL9RdVn1d4w==} + '@trpc/server@11.0.0-rc.403': + resolution: {integrity: sha512-DIt0GijW3nzq3zk9rFw1Ly/b6E9eTcsKV+caOMSeJl6A7Pby8QpdKaN8yJZDHhEojULeIVFNE4Izals5T0fQgg==} '@tsconfig/node10@1.0.9': resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} @@ -5240,38 +5243,38 @@ packages: engines: {node: '>=18.0.0'} hasBin: true - turbo-darwin-64@1.13.2: - resolution: {integrity: sha512-CCSuD8CfmtncpohCuIgq7eAzUas0IwSbHfI8/Q3vKObTdXyN8vAo01gwqXjDGpzG9bTEVedD0GmLbD23dR0MLA==} + turbo-darwin-64@2.0.3: + resolution: {integrity: sha512-v7ztJ8sxdHw3SLfO2MhGFeeU4LQhFii1hIGs9uBiXns/0YTGOvxLeifnfGqhfSrAIIhrCoByXO7nR9wlm10n3Q==} cpu: [x64] os: [darwin] - turbo-darwin-arm64@1.13.2: - resolution: {integrity: sha512-0HySm06/D2N91rJJ89FbiI/AodmY8B3WDSFTVEpu2+8spUw7hOJ8okWOT0e5iGlyayUP9gr31eOeL3VFZkpfCw==} + turbo-darwin-arm64@2.0.3: + resolution: {integrity: sha512-LUcqvkV9Bxtng6QHbevp8IK8zzwbIxM6HMjCE7FEW6yJBN1KwvTtRtsGBwwmTxaaLO0wD1Jgl3vgkXAmQ4fqUw==} cpu: [arm64] os: [darwin] - turbo-linux-64@1.13.2: - resolution: {integrity: sha512-7HnibgbqZrjn4lcfIouzlPu8ZHSBtURG4c7Bedu7WJUDeZo+RE1crlrQm8wuwO54S0siYqUqo7GNHxu4IXbioQ==} + turbo-linux-64@2.0.3: + resolution: {integrity: sha512-xpdY1suXoEbsQsu0kPep2zrB8ijv/S5aKKrntGuQ62hCiwDFoDcA/Z7FZ8IHQ2u+dpJARa7yfiByHmizFE0r5Q==} cpu: [x64] os: [linux] - turbo-linux-arm64@1.13.2: - resolution: {integrity: sha512-sUq4dbpk6SNKg/Hkwn256Vj2AEYSQdG96repio894h5/LEfauIK2QYiC/xxAeW3WBMc6BngmvNyURIg7ltrePg==} + turbo-linux-arm64@2.0.3: + resolution: {integrity: sha512-MBACTcSR874L1FtLL7gkgbI4yYJWBUCqeBN/iE29D+8EFe0d3fAyviFlbQP4K/HaDYet1i26xkkOiWr0z7/V9A==} cpu: [arm64] os: [linux] - turbo-windows-64@1.13.2: - resolution: {integrity: sha512-DqzhcrciWq3dpzllJR2VVIyOhSlXYCo4mNEWl98DJ3FZ08PEzcI3ceudlH6F0t/nIcfSItK1bDP39cs7YoZHEA==} + turbo-windows-64@2.0.3: + resolution: {integrity: sha512-zi3YuKPkM9JxMTshZo3excPk37hUrj5WfnCqh4FjI26ux6j/LJK+Dh3SebMHd9mR7wP9CMam4GhmLCT+gDfM+w==} cpu: [x64] os: [win32] - turbo-windows-arm64@1.13.2: - resolution: {integrity: sha512-WnPMrwfCXxK69CdDfS1/j2DlzcKxSmycgDAqV0XCYpK/812KB0KlvsVAt5PjEbZGXkY88pCJ1BLZHAjF5FcbqA==} + turbo-windows-arm64@2.0.3: + resolution: {integrity: sha512-wmed4kkenLvRbidi7gISB4PU77ujBuZfgVGDZ4DXTFslE/kYpINulwzkVwJIvNXsJtHqyOq0n6jL8Zwl3BrwDg==} cpu: [arm64] os: [win32] - turbo@1.13.2: - resolution: {integrity: sha512-rX/d9f4MgRT3yK6cERPAkfavIxbpBZowDQpgvkYwGMGDQ0Nvw1nc0NVjruE76GrzXQqoxR1UpnmEP54vBARFHQ==} + turbo@2.0.3: + resolution: {integrity: sha512-jF1K0tTUyryEWmgqk1V0ALbSz3VdeZ8FXUo6B64WsPksCMCE48N5jUezGOH2MN0+epdaRMH8/WcPU0QQaVfeLA==} hasBin: true type-check@0.4.0: @@ -7308,30 +7311,30 @@ snapshots: '@total-typescript/ts-reset@0.5.1': {} - '@trpc/client@11.0.0-next-beta.318(@trpc/server@11.0.0-next-beta.318)': + '@trpc/client@11.0.0-rc.403(@trpc/server@11.0.0-rc.403)': dependencies: - '@trpc/server': 11.0.0-next-beta.318 + '@trpc/server': 11.0.0-rc.403 - '@trpc/next@11.0.0-next-beta.318(@tanstack/react-query@5.28.6(react@18.2.0))(@trpc/client@11.0.0-next-beta.318(@trpc/server@11.0.0-next-beta.318))(@trpc/react-query@11.0.0-next-beta.318(@tanstack/react-query@5.28.6(react@18.2.0))(@trpc/client@11.0.0-next-beta.318(@trpc/server@11.0.0-next-beta.318))(@trpc/server@11.0.0-next-beta.318)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@trpc/server@11.0.0-next-beta.318)(next@14.1.3(@babel/core@7.23.7)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + '@trpc/next@11.0.0-rc.403(@tanstack/react-query@5.28.6(react@18.2.0))(@trpc/client@11.0.0-rc.403(@trpc/server@11.0.0-rc.403))(@trpc/react-query@11.0.0-rc.403(@tanstack/react-query@5.28.6(react@18.2.0))(@trpc/client@11.0.0-rc.403(@trpc/server@11.0.0-rc.403))(@trpc/server@11.0.0-rc.403)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@trpc/server@11.0.0-rc.403)(next@14.1.3(@babel/core@7.23.7)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: - '@trpc/client': 11.0.0-next-beta.318(@trpc/server@11.0.0-next-beta.318) - '@trpc/server': 11.0.0-next-beta.318 + '@trpc/client': 11.0.0-rc.403(@trpc/server@11.0.0-rc.403) + '@trpc/server': 11.0.0-rc.403 next: 14.1.3(@babel/core@7.23.7)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) optionalDependencies: '@tanstack/react-query': 5.28.6(react@18.2.0) - '@trpc/react-query': 11.0.0-next-beta.318(@tanstack/react-query@5.28.6(react@18.2.0))(@trpc/client@11.0.0-next-beta.318(@trpc/server@11.0.0-next-beta.318))(@trpc/server@11.0.0-next-beta.318)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@trpc/react-query': 11.0.0-rc.403(@tanstack/react-query@5.28.6(react@18.2.0))(@trpc/client@11.0.0-rc.403(@trpc/server@11.0.0-rc.403))(@trpc/server@11.0.0-rc.403)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@trpc/react-query@11.0.0-next-beta.318(@tanstack/react-query@5.28.6(react@18.2.0))(@trpc/client@11.0.0-next-beta.318(@trpc/server@11.0.0-next-beta.318))(@trpc/server@11.0.0-next-beta.318)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + '@trpc/react-query@11.0.0-rc.403(@tanstack/react-query@5.28.6(react@18.2.0))(@trpc/client@11.0.0-rc.403(@trpc/server@11.0.0-rc.403))(@trpc/server@11.0.0-rc.403)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: '@tanstack/react-query': 5.28.6(react@18.2.0) - '@trpc/client': 11.0.0-next-beta.318(@trpc/server@11.0.0-next-beta.318) - '@trpc/server': 11.0.0-next-beta.318 + '@trpc/client': 11.0.0-rc.403(@trpc/server@11.0.0-rc.403) + '@trpc/server': 11.0.0-rc.403 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) - '@trpc/server@11.0.0-next-beta.318': {} + '@trpc/server@11.0.0-rc.403': {} '@tsconfig/node10@1.0.9': {} @@ -9953,7 +9956,7 @@ snapshots: dependencies: nanoid: 3.3.7 picocolors: 1.0.0 - source-map-js: 1.0.2 + source-map-js: 1.2.0 postcss@8.4.32: dependencies: @@ -10693,32 +10696,32 @@ snapshots: optionalDependencies: fsevents: 2.3.3 - turbo-darwin-64@1.13.2: + turbo-darwin-64@2.0.3: optional: true - turbo-darwin-arm64@1.13.2: + turbo-darwin-arm64@2.0.3: optional: true - turbo-linux-64@1.13.2: + turbo-linux-64@2.0.3: optional: true - turbo-linux-arm64@1.13.2: + turbo-linux-arm64@2.0.3: optional: true - turbo-windows-64@1.13.2: + turbo-windows-64@2.0.3: optional: true - turbo-windows-arm64@1.13.2: + turbo-windows-arm64@2.0.3: optional: true - turbo@1.13.2: + turbo@2.0.3: optionalDependencies: - turbo-darwin-64: 1.13.2 - turbo-darwin-arm64: 1.13.2 - turbo-linux-64: 1.13.2 - turbo-linux-arm64: 1.13.2 - turbo-windows-64: 1.13.2 - turbo-windows-arm64: 1.13.2 + turbo-darwin-64: 2.0.3 + turbo-darwin-arm64: 2.0.3 + turbo-linux-64: 2.0.3 + turbo-linux-arm64: 2.0.3 + turbo-windows-64: 2.0.3 + turbo-windows-arm64: 2.0.3 type-check@0.4.0: dependencies: diff --git a/turbo.json b/turbo.json index 4f56f424..8dac0db4 100644 --- a/turbo.json +++ b/turbo.json @@ -1,12 +1,35 @@ { "$schema": "https://turborepo.org/schema.json", - "globalDependencies": ["**/.env"], - "pipeline": { + "globalDependencies": [ + "**/.env" + ], + "globalEnv": [ + "OPEN_WEATHER_API_KEY", + "UPSTASH_REDIS_REST_URL", + "UPSTASH_REDIS_REST_TOKEN", + "UPSTASH_RATELIMITER_TOKENS_PER_TIME", + "UPSTASH_RATELIMITER_TIME_INTERVAL", + "UPSTASH_RATELIMITER_EXCLUDED_IPS", + "RESEND_API_KEY", + "QWEATHER_API_KEY", + "API_NINJA_API_KEY", + "TEST_MODE", + "NEXT_PUBLIC_CONVEX_URL", + "CONVEX_DEPLOY_KEY" + ], + "globalPassThroughEnv": [ + "CONVEX_URL" + ], + "tasks": { "topo": { - "dependsOn": ["^topo"] + "dependsOn": [ + "^topo" + ] }, "build": { - "dependsOn": ["^build"], + "dependsOn": [ + "^build" + ], "outputs": [ ".next/**", "!.next/cache/**", @@ -20,8 +43,10 @@ "cache": false }, "format": { - "outputs": ["node_modules/.cache/.prettiercache"], - "outputMode": "new-only" + "outputs": [ + "node_modules/.cache/.prettiercache" + ], + "outputLogs": "new-only" }, "dev:test": { "cache": false @@ -30,15 +55,25 @@ "cache": false }, "e2e:test": { - "dependsOn": ["^build"] + "dependsOn": [ + "^build" + ] }, "lint": { - "dependsOn": ["^topo"], - "outputs": ["node_modules/.cache/.eslintcache"] + "dependsOn": [ + "^topo" + ], + "outputs": [ + "node_modules/.cache/.eslintcache" + ] }, "typecheck": { - "dependsOn": ["^topo"], - "outputs": ["node_modules/.cache/tsbuildinfo.json"] + "dependsOn": [ + "^topo" + ], + "outputs": [ + "node_modules/.cache/tsbuildinfo.json" + ] }, "clean": { "cache": false @@ -46,23 +81,5 @@ "//#clean": { "cache": false } - }, - "globalEnv": [ - "OPEN_WEATHER_API_KEY", - "UPSTASH_REDIS_REST_URL", - "UPSTASH_REDIS_REST_TOKEN", - "UPSTASH_RATELIMITER_TOKENS_PER_TIME", - "UPSTASH_RATELIMITER_TIME_INTERVAL", - "UPSTASH_RATELIMITER_EXCLUDED_IPS", - "RESEND_API_KEY", - "QWEATHER_API_KEY", - "API_NINJA_API_KEY", - "TEST_MODE", - "NEXT_PUBLIC_CONVEX_URL", - "CONVEX_DEPLOY_KEY" - ], - "globalPassThroughEnv": [ - "CONVEX_URL" - ] - + } }