Skip to content

Commit

Permalink
Merge pull request #427 from DTS-STN/update-deps
Browse files Browse the repository at this point in the history
Update deps
  • Loading branch information
sebastien-comeau authored Jun 23, 2023
2 parents ef986d8 + a102b99 commit bc9e09c
Show file tree
Hide file tree
Showing 9 changed files with 248 additions and 281 deletions.
8 changes: 0 additions & 8 deletions i18next.d.ts

This file was deleted.

2 changes: 1 addition & 1 deletion next-i18next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ module.exports = {
typeof window === 'undefined'
? require('path').resolve('./public/locales')
: '/locales',
returnNull: false,
react: {
transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p', 'b', 'em'],
},
reloadOnPrerender: process.env.NODE_ENV === 'development',
serializeConfig: false,
}
436 changes: 185 additions & 251 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@
"tsc:validate": "tsc --noEmit --incremental false"
},
"dependencies": {
"@tanstack/react-query": "^4.29.13",
"@tanstack/react-query": "^4.29.15",
"cookies-next": "^2.1.2",
"date-fns": "^2.30.0",
"formik": "^2.4.1",
"i18next": "^22.5.1",
"next": "13.4.5",
"next-i18next": "^13.3.0",
"next-seo": "^6.0.0",
"formik": "^2.4.2",
"i18next": "^23.2.3",
"next": "13.4.7",
"next-i18next": "^14.0.0",
"next-seo": "^6.1.0",
"pino": "^8.14.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-focus-on": "^3.8.1",
"react-i18next": "^12.3.1",
"react-i18next": "^13.0.1",
"react-idle-timer": "^5.7.2",
"sharp": "^0.32.1",
"yup": "^1.2.0"
Expand All @@ -50,11 +50,11 @@
"autoprefixer": "^10.4.14",
"axe-core": "^4.7.2",
"babel-jest": "^29.5.0",
"cypress": "^12.14.0",
"cypress": "^12.15.0",
"cypress-axe": "^1.4.0",
"cypress-multi-reporters": "^1.6.3",
"eslint": "8.42.0",
"eslint-config-next": "^13.4.6",
"eslint": "8.43.0",
"eslint-config-next": "^13.4.7",
"husky": "^8.0.3",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.5.0",
Expand Down
17 changes: 17 additions & 0 deletions src/@types/i18next.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* If you want to enable locale keys typechecking and enhance IDE experience.
*
* Requires `resolveJsonModule:true` in your tsconfig.json.
*
* @link https://www.i18next.com/overview/typescript
*/
import 'i18next'

// resources.ts file is generated with `npm run toc`
import resources from './resources.ts'

declare module 'i18next' {
interface CustomTypeOptions {
resources: typeof resources
}
}
15 changes: 15 additions & 0 deletions src/@types/resources.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import common from '../../public/locales/en/common.json'
import email from '../../public/locales/en/email.json'
import expectations from '../../public/locales/en/expectations.json'
import landing from '../../public/locales/en/landing.json'
import status from '../../public/locales/en/status.json'

const resources = {
common,
email,
expectations,
landing,
status,
} as const

export default resources
3 changes: 2 additions & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import getConfig from 'next/config'
import Head from 'next/head'
import Script from 'next/script'

import nextI18NextConfig from '../../next-i18next.config.js'
import { AppWindow } from '../lib/types'
import { getNextSEOConfig } from '../next-seo.config'
import '../styles/globals.css'
Expand Down Expand Up @@ -75,4 +76,4 @@ const MyApp = ({ Component, pageProps, router }: AppProps) => {
)
}

export default appWithTranslation(MyApp)
export default appWithTranslation(MyApp, nextI18NextConfig)
14 changes: 9 additions & 5 deletions src/pages/email.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const validationSchema = Yup.object({
})

const Email: FC = () => {
const { t } = useTranslation('email')
const { t } = useTranslation(['email', 'common'])

const router = useRouter()
const headingRef = useRef<HTMLHeadingElement>(null)
Expand Down Expand Up @@ -238,7 +238,7 @@ const Email: FC = () => {
label={t('email.label')}
onChange={handleFormikChange}
value={formikValues.email}
errorMessage={formikErrors.email && t(formikErrors.email)}
errorMessage={formikErrors.email && t(formikErrors.email as any)}
textRequired={t('common:required')}
required
helpMessage={
Expand All @@ -259,7 +259,9 @@ const Email: FC = () => {
label={t('given-name.label')}
onChange={handleFormikChange}
value={formikValues.givenName}
errorMessage={formikErrors.givenName && t(formikErrors.givenName)}
errorMessage={
formikErrors.givenName && t(formikErrors.givenName as any)
}
textRequired={t('common:required')}
required
/>
Expand All @@ -269,7 +271,9 @@ const Email: FC = () => {
label={t('surname.label')}
onChange={handleFormikChange}
value={formikValues.surname}
errorMessage={formikErrors.surname && t(formikErrors.surname)}
errorMessage={
formikErrors.surname && t(formikErrors.surname as any)
}
textRequired={t('common:required')}
required
/>
Expand All @@ -279,7 +283,7 @@ const Email: FC = () => {
onChange={handleOnDateOfBirthChange}
value={formikValues.dateOfBirth}
errorMessage={
formikErrors.dateOfBirth && t(formikErrors.dateOfBirth)
formikErrors.dateOfBirth && t(formikErrors.dateOfBirth as any)
}
textRequired={t('common:required')}
required
Expand Down
14 changes: 9 additions & 5 deletions src/pages/status.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const validationSchema = Yup.object({
})

const Status: FC = () => {
const { t } = useTranslation('status')
const { t } = useTranslation(['status', 'common'])

const router = useRouter()
const headingRef = useRef<HTMLHeadingElement>(null)
Expand Down Expand Up @@ -219,7 +219,7 @@ const Status: FC = () => {
label={t('esrf.label')}
onChange={handleOnESRFChange}
value={formikValues.esrf}
errorMessage={formikErrors.esrf && t(formikErrors.esrf)}
errorMessage={formikErrors.esrf && t(formikErrors.esrf as any)}
textRequired={t('common:required')}
required
helpMessage={
Expand All @@ -240,7 +240,9 @@ const Status: FC = () => {
label={t('given-name.label')}
onChange={handleFormikChange}
value={formikValues.givenName}
errorMessage={formikErrors.givenName && t(formikErrors.givenName)}
errorMessage={
formikErrors.givenName && t(formikErrors.givenName as any)
}
textRequired={t('common:required')}
required
/>
Expand All @@ -250,7 +252,9 @@ const Status: FC = () => {
label={t('surname.label')}
onChange={handleFormikChange}
value={formikValues.surname}
errorMessage={formikErrors.surname && t(formikErrors.surname)}
errorMessage={
formikErrors.surname && t(formikErrors.surname as any)
}
textRequired={t('common:required')}
required
/>
Expand All @@ -260,7 +264,7 @@ const Status: FC = () => {
onChange={handleOnDateOfBirthChange}
value={formikValues.dateOfBirth}
errorMessage={
formikErrors.dateOfBirth && t(formikErrors.dateOfBirth)
formikErrors.dateOfBirth && t(formikErrors.dateOfBirth as any)
}
textRequired={t('common:required')}
required
Expand Down

0 comments on commit bc9e09c

Please sign in to comment.