Migrates all tRPC code to a monorepo package (#3484)
* WIP * WIP * Type and migration fixes * Adds missing default import * Fixes import * Fixes tRPC imports in App Store * Migrate stripe helpers * WIP * Type fixes * Type fix? * Test fixes * Adds missing stripe packages * Moved queries to lib instead Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
e82bcb6dba
commit
9447f16b82
152 files changed
+1066
-724
No files matched your search
@@ -1,18 +1 @@
|
||||
import i18next from "i18next";
|
||||
import { i18n as nexti18next } from "next-i18next";
|
||||
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
||||
|
||||
export const getTranslation = async (locale: string, ns: string) => {
|
||||
const create = async () => {
|
||||
const { _nextI18Next } = await serverSideTranslations(locale, [ns]);
|
||||
const _i18n = i18next.createInstance();
|
||||
_i18n.init({
|
||||
lng: locale,
|
||||
resources: _nextI18Next.initialI18nStore,
|
||||
fallbackLng: _nextI18Next.userConfig?.i18n.defaultLocale,
|
||||
});
|
||||
return _i18n;
|
||||
};
|
||||
const _i18n = nexti18next != null ? nexti18next : await create();
|
||||
return _i18n.getFixedT(locale, ns);
|
||||
};
|
||||
export * from "@calcom/lib/server/i18n";
|
||||
@@ -3,10 +3,9 @@ import { i18n } from "next-i18next.config";
|
||||
import { serverSideTranslations } from "next-i18next/serverSideTranslations";
|
||||
import superjson from "superjson";
|
||||
|
||||
import prisma from "@lib/prisma";
|
||||
|
||||
import { appRouter } from "@server/routers/_app";
|
||||
import { createSSGHelpers } from "@trpc/react/ssg";
|
||||
import prisma from "@calcom/prisma";
|
||||
import { createSSGHelpers } from "@calcom/trpc/react/ssg";
|
||||
import { appRouter } from "@calcom/trpc/server/routers/_app";
|
||||
|
||||
/**
|
||||
* Initialize static site rendering tRPC helpers.
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
import { GetServerSidePropsContext } from "next";
|
||||
import superjson from "superjson";
|
||||
|
||||
import { createContext } from "@server/createContext";
|
||||
import { createSSGHelpers } from "@trpc/react/ssg";
|
||||
|
||||
import { appRouter } from "../routers/_app";
|
||||
import { createSSGHelpers } from "@calcom/trpc/react/ssg";
|
||||
import { createContext } from "@calcom/trpc/server/createContext";
|
||||
import { appRouter } from "@calcom/trpc/server/routers/_app";
|
||||
|
||||
/**
|
||||
* Initialize server-side rendering tRPC helpers.
|
||||
|
||||
Reference in new issue
Block a user