Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
Update next i18next (#472)
Luke Vella6ac64bbc420c
diff --git a/declarations/i18next.d.ts b/declarations/i18next.d.tsindex a25acbd1b..a54e1c106 100644--- a/declarations/i18next.d.ts+++ b/declarations/i18next.d.ts@@ -5,11 +5,17 @@ import common from "~/public/locales/en/common.json";import errors from "~/public/locales/en/errors.json";import homepage from "~/public/locales/en/homepage.json";-declare module "next-i18next" {- interface Resources {- homepage: typeof homepage;- app: typeof app;- common: typeof common;- errors: typeof errors;+interface I18nNamespaces {+ homepage: typeof homepage;+ app: typeof app;+ common: typeof common;+ errors: typeof errors;+}++declare module "i18next" {+ interface CustomTypeOptions {+ defaultNS: "common";+ resources: I18nNamespaces;+ returnNull: false;}}diff --git a/next-i18next.config.js b/next-i18next.config.jsindex 42ef2a32a..6c11870bb 100644--- a/next-i18next.config.js+++ b/next-i18next.config.js@@ -28,4 +28,5 @@ module.exports = {},reloadOnPrerender: process.env.NODE_ENV === "development",localePath: path.resolve("./public/locales"),+ returnNull: false,};diff --git a/package.json b/package.jsonindex 45be878ba..2a7847bed 100644--- a/package.json+++ b/package.json@@ -48,7 +48,7 @@"lodash": "^4.17.21","nanoid": "^4.0.0","next": "13.0.6",- "next-i18next": "^12.1.0",+ "next-i18next": "^13.0.3","next-seo": "^5.15.0","nodemailer": "^6.7.2","postcss": "^8.4.21",diff --git a/src/components/auth/login-form.tsx b/src/components/auth/login-form.tsxindex f1a93c6ef..9055c6ee2 100644--- a/src/components/auth/login-form.tsx+++ b/src/components/auth/login-form.tsx@@ -65,6 +65,7 @@ const VerifyCode: React.VoidFunctionComponent<{b: <strong className="whitespace-nowrap" />,a: (<a+ className="text-link"href="#"onClick={(e) => {e.preventDefault();diff --git a/src/utils/auth.ts b/src/utils/auth.tsindex be46fb9d9..39582b805 100644--- a/src/utils/auth.ts+++ b/src/utils/auth.ts@@ -124,6 +124,7 @@ export function withSessionSsr(const res = await composedHandler(ctx);if ("props" in res) {return {+ ...res,props: {...res.props,trpcState: ssg.dehydrate(),diff --git a/tests/authentication.spec.ts b/tests/authentication.spec.tsindex 9afdcd510..5d2008477 100644--- a/tests/authentication.spec.ts+++ b/tests/authentication.spec.ts@@ -1,4 +1,4 @@-import { expect, test } from "@playwright/test";+import { expect, Page, test } from "@playwright/test";import { load } from "cheerio";import smtpTester from "smtp-tester";@@ -92,7 +92,7 @@ test.describe.serial(() => {).toBeVisible();});- test("user login", async ({ page }) => {+ const login = async (page: Page) => {await page.goto("/login");await page.getByPlaceholder("[email protected]").type(testUserEmail);@@ -104,7 +104,15 @@ test.describe.serial(() => {await page.getByPlaceholder("Enter your 6-digit code").type(code);await page.getByText("Continue").click();+ };+ test("user login", async ({ page }) => {+ await login(page);await expect(page.getByText("Your details")).toBeVisible();});++ test("logged in user can't access login page", async ({ page }) => {+ await login(page);+ await expect(page).toHaveURL("/profile");+ });});diff --git a/yarn.lock b/yarn.lockindex e397ac181..b86bd4072 100644--- a/yarn.lock+++ b/yarn.lock@@ -997,7 +997,7 @@dependencies:regenerator-runtime "^0.13.4"-"@babel/runtime@^7.10.2", "@babel/runtime@^7.16.3", "@babel/runtime@^7.17.2":+"@babel/runtime@^7.10.2", "@babel/runtime@^7.16.3":version "7.17.8"resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.8.tgz#3e56e4aff81befa55ac3ac6a0967349fd1c5bca2"integrity sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA==@@ -1011,7 +1011,7 @@dependencies:regenerator-runtime "^0.13.4"-"@babel/runtime@^7.13.8", "@babel/runtime@^7.18.6", "@babel/runtime@^7.18.9":+"@babel/runtime@^7.13.8", "@babel/runtime@^7.18.6":version "7.20.1"resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.1.tgz#1148bb33ab252b165a06698fde7576092a78b4a9"integrity sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg==@@ -3963,17 +3963,10 @@ i18n-unused@^0.12.0:esm "^3.2.25"ts-import "^2.0.39"-i18next-fs-backend@^1.1.5:- version "1.2.0"- resolved "https://registry.yarnpkg.com/i18next-fs-backend/-/i18next-fs-backend-1.2.0.tgz#c498c68c8e6a8ae5ed59bea5e5392a11991de696"- integrity sha512-pUx3AcgXCbur0jpFA7U67Z2RJflAcIi698Y8VL+phdOqUchahxriV3Cs+M6UkPNQSS/zPEzWLfdJ8EgjB7HVxg==--i18next@^21.9.1:- version "21.10.0"- resolved "https://registry.yarnpkg.com/i18next/-/i18next-21.10.0.tgz#85429af55fdca4858345d0e16b584ec29520197d"- integrity sha512-YeuIBmFsGjUfO3qBmMOc0rQaun4mIpGKET5WDwvu8lU7gvwpcariZLNtL0Fzj+zazcHUrlXHiptcFhBMFaxzfg==- dependencies:- "@babel/runtime" "^7.17.2"+i18next-fs-backend@^2.1.0:+ version "2.1.1"+ resolved "https://registry.yarnpkg.com/i18next-fs-backend/-/i18next-fs-backend-2.1.1.tgz#07c6393be856c5a398e3dfc1257bf8439841cd89"+ integrity sha512-FTnj+UmNgT3YRml5ruRv0jMZDG7odOL/OP5PF5mOqvXud2vHrPOOs68Zdk6iqzL47cnnM0ZVkK2BAvpFeDJToA==i18next@^22.4.9:version "22.4.9"@@ -4691,18 +4684,16 @@ natural-compare@^1.4.0:resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz"integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=-next-i18next@^12.1.0:- version "12.1.0"- resolved "https://registry.yarnpkg.com/next-i18next/-/next-i18next-12.1.0.tgz#70926fbe966bc4750d2f68573307bfe36eadba46"- integrity sha512-rhos/PVULmZPdC0jpec2MDBQMXdGZ3+Mbh/tZfrDtjgnVN3ucdq7k8BlwsJNww6FnqC8AC31n6dSYuqVzYsGsw==+next-i18next@^13.0.3:+ version "13.0.3"+ resolved "https://registry.yarnpkg.com/next-i18next/-/next-i18next-13.0.3.tgz#f0d5194c9ec3657d114c0c491ba7fbb031788fe1"+ integrity sha512-7AA8J6WbkxRBtSf1+97LSAE7btxWZHsBIJEJ3FuTSBgYtpRiO5NGjcb8XbNAlz6yGU0TtS+yZE+/Wu83KhIT1Q==dependencies:- "@babel/runtime" "^7.18.9"+ "@babel/runtime" "^7.20.6""@types/hoist-non-react-statics" "^3.3.1"core-js "^3"hoist-non-react-statics "^3.3.2"- i18next "^21.9.1"- i18next-fs-backend "^1.1.5"- react-i18next "^11.18.4"+ i18next-fs-backend "^2.1.0"next-seo@^5.15.0:version "5.15.0"@@ -5278,14 +5269,6 @@ react-hot-toast@^2.4.0:dependencies:goober "^2.1.10"-react-i18next@^11.18.4:- version "11.18.6"- resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-11.18.6.tgz#e159c2960c718c1314f1e8fcaa282d1c8b167887"- integrity sha512-yHb2F9BiT0lqoQDt8loZ5gWP331GwctHz9tYQ8A2EIEUu+CcEdjBLQWli1USG3RdWQt3W+jqQLg/d4rrQR96LA==- dependencies:- "@babel/runtime" "^7.14.5"- html-parse-stringify "^3.0.1"-react-i18next@^12.0.0:version "12.0.0"resolved "https://registry.yarnpkg.com/react-i18next/-/react-i18next-12.0.0.tgz#634015a2c035779c5736ae4c2e5c34c1659753b1"