Skip to content

Commit

Permalink
release: 2024-03-13 (#1155)
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Mar 13, 2024
2 parents 890c281 + 7ae6be7 commit 4c2c02b
Show file tree
Hide file tree
Showing 41 changed files with 1,263 additions and 1,234 deletions.
2 changes: 1 addition & 1 deletion apps/app/lib/generators/translationKeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import prettier from 'prettier'

import fs from 'fs'

import { prisma, type Prisma } from '@weareinreach/db'
import { prisma, type Prisma } from '@weareinreach/db/client'
import { type PassedTask } from 'lib/generate'

const localePath = 'public/locales/en'
Expand Down
40 changes: 21 additions & 19 deletions apps/app/next-i18next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,31 +73,33 @@ const config = {
},
defaultNS: 'common',
localePath: path.resolve('./public/locales'),
fallbackLng: ['en'],
fallbackLng: 'en',
reloadOnPrerender: isDev,
debug: isDev && isBrowser && isVerbose,
partialBundledLanguages: true,
nonExplicitSupportedLngs: true,
cleanCode: true,
react: {
useSuspense: false,
bindI18nStore: 'added loaded',
bindI18n: 'languageChanged loaded',
},
// react: {
// useSuspense: false,
// bindI18nStore: 'added loaded',
// bindI18n: 'languageChanged loaded',
// },

backend: {
backendOptions: [
{
backend: HttpBackend,
// debounceInterval: 200,
backendOption: {
loadPath: getUrl(apiPath),
allowMultiLoading: true,
},
},
],
backends: isBrowser ? [multi] : [],
},
backend: isBrowser
? {
backendOptions: [
{
backend: HttpBackend,
// debounceInterval: 200,
backendOption: {
loadPath: getUrl(apiPath),
allowMultiLoading: true,
},
},
],
backends: [multi],
}
: undefined,
serializeConfig: false,
use: plugins(),
maxParallelReads: 20,
Expand Down
36 changes: 18 additions & 18 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@
"@opentelemetry/sdk-trace-base": "1.22.0",
"@opentelemetry/sdk-trace-node": "1.22.0",
"@opentelemetry/semantic-conventions": "1.22.0",
"@prisma/instrumentation": "5.10.2",
"@sentry/browser": "7.105.0",
"@sentry/nextjs": "7.105.0",
"@sentry/node": "7.105.0",
"@sentry/opentelemetry": "7.105.0",
"@sentry/opentelemetry-node": "7.105.0",
"@sentry/profiling-node": "7.105.0",
"@prisma/instrumentation": "5.11.0",
"@sentry/browser": "7.106.1",
"@sentry/nextjs": "7.106.1",
"@sentry/node": "7.106.1",
"@sentry/opentelemetry": "7.106.1",
"@sentry/opentelemetry-node": "7.106.1",
"@sentry/profiling-node": "7.106.1",
"@tanstack/react-query": "4.36.1",
"@tanstack/react-table": "8.13.2",
"@trpc/client": "10.45.1",
"@trpc/next": "10.45.1",
"@trpc/react-query": "10.45.1",
"@trpc/server": "10.45.1",
"@trpc/client": "10.45.2",
"@trpc/next": "10.45.2",
"@trpc/react-query": "10.45.2",
"@trpc/server": "10.45.2",
"@vercel/analytics": "1.2.2",
"@vercel/edge-config": "1.1.0",
"@vercel/kv": "1.0.1",
Expand All @@ -77,7 +77,7 @@
"embla-carousel-autoplay": "7.1.0",
"embla-carousel-react": "7.1.0",
"flat": "6.0.1",
"i18next": "23.10.0",
"i18next": "23.10.1",
"i18next-browser-languagedetector": "7.2.0",
"i18next-chained-backend": "4.6.2",
"i18next-http-backend": "2.5.0",
Expand Down Expand Up @@ -107,19 +107,19 @@
"devDependencies": {
"@hookform/devtools": "4.3.1",
"@playwright/test": "1.42.1",
"@prisma/nextjs-monorepo-workaround-plugin": "5.10.2",
"@prisma/nextjs-monorepo-workaround-plugin": "5.11.0",
"@tanstack/react-query-devtools": "4.36.1",
"@tanstack/react-table-devtools": "8.13.2",
"@total-typescript/ts-reset": "0.5.1",
"@types/eslint": "8.56.5",
"@types/gtag.js": "0.0.19",
"@types/luxon": "3.4.2",
"@types/node": "20.11.25",
"@types/react": "18.2.64",
"@types/node": "20.11.26",
"@types/react": "18.2.65",
"@types/react-dom": "18.2.21",
"@types/umami": "0.1.5",
"@typescript-eslint/eslint-plugin": "7.1.1",
"@typescript-eslint/parser": "7.1.1",
"@typescript-eslint/eslint-plugin": "7.2.0",
"@typescript-eslint/parser": "7.2.0",
"@weareinreach/config": "workspace:*",
"@weareinreach/eslint-config": "0.100.0",
"@welldone-software/why-did-you-render": "8.0.1",
Expand All @@ -133,7 +133,7 @@
"trpc-client-devtools-link": "0.2.1-next",
"trpc-panel": "1.3.4",
"trpc-playground": "1.0.4",
"type-fest": "4.11.1",
"type-fest": "4.12.0",
"typescript": "5.4.2",
"webpack-bundle-analyzer": "4.10.1"
},
Expand Down
2 changes: 1 addition & 1 deletion apps/app/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"share-feedback": "Share feedback",
"subscribe-newsletter": "Subscribe to our newsletter",
"suggest-org": "Suggest an organization",
"tagline": "Seek LGBTQ+ resources.<br/>\nReach safety.<br/>\nFind belonging.",
"tagline": "Seek LGBTQ+ resources.<br/>Reach safety.<br/>Find belonging.",
"vetting-process": "Vetting process"
},
"forgot-password": "Forgot password?",
Expand Down
13 changes: 11 additions & 2 deletions apps/app/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import dynamic from 'next/dynamic'
import Head from 'next/head'
import { useRouter } from 'next/router'
import { type Session } from 'next-auth'
import { appWithTranslation } from 'next-i18next'
import { appWithTranslation, type UserConfig } from 'next-i18next'
import { DefaultSeo, type DefaultSeoProps } from 'next-seo'
import { GoogleAnalytics } from 'nextjs-google-analytics'

Expand Down Expand Up @@ -97,7 +97,16 @@ const MyApp = (appProps: AppPropsWithGridSwitch) => {
)
}

export default api.withTRPC(appWithTranslation(MyApp, nextI18nConfig))
const i18NextSSRConfig: UserConfig = {
i18n: {
defaultLocale: nextI18nConfig.i18n.defaultLocale,
locales: nextI18nConfig.i18n.locales,
},
interpolation: nextI18nConfig.interpolation,
use: nextI18nConfig.use,
}

export default api.withTRPC(appWithTranslation(MyApp, i18NextSSRConfig))

export type NextPageWithOptions<Props = unknown, InitialProps = Props> = NextPage<Props, InitialProps> & {
omitGrid?: boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { createStyles, Grid, rem, Stack } from '@mantine/core'
import { Grid, Stack } from '@mantine/core'
import dynamic from 'next/dynamic'
import { useRouter } from 'next/router'
import { useTranslation } from 'next-i18next'
import { type GetServerSideProps } from 'nextjs-routes'
import { type ReactNode, Suspense, useEffect, useState } from 'react'
import { type Path, useFieldArray, useForm } from 'react-hook-form'
import { /*type Path,*/ useFieldArray, useForm } from 'react-hook-form'
import { Textarea, TextInput } from 'react-hook-form-mantine'
import { type Merge } from 'type-fest'
// import { type Merge } from 'type-fest'
import { z } from 'zod'

import { prefixedId } from '@weareinreach/api/schemas/idPrefix'
Expand All @@ -31,8 +31,7 @@ const FreetextObject = z
})
.nullish()

// eslint-disable-next-line @typescript-eslint/no-explicit-any
type MapValue<A> = A extends Map<any, infer V> ? V : never
// type MapValue<A> = A extends Map<any, infer V> ? V : never

const literalSchema = z.union([z.string(), z.number(), z.boolean(), z.null()])
type Literal = z.infer<typeof literalSchema>
Expand Down Expand Up @@ -95,10 +94,10 @@ const EditServicePage = () => {
const activeServices = form.watch('services') ?? []

type AttrSectionKeys = 'clientsServed' | 'cost' | 'eligibility' | 'languages' | 'additionalInfo'
type AttrSectionVals = Merge<
FormSchemaType['attributes'][number],
{ _rhfName: Path<FormSchemaType>; _rhfLabel: string }
>
// type AttrSectionVals = Merge<
// FormSchemaType['attributes'][number],
// { _rhfName: Path<FormSchemaType>; _rhfLabel: string }
// >

const attributeBase: {
[key in AttrSectionKeys]: ReactNode[]
Expand Down Expand Up @@ -264,7 +263,7 @@ export const getServerSideProps: GetServerSideProps = async ({ locale, params, r
})
.safeParse(params)
if (!urlParams.success) return { notFound: true }
const { slug, orgLocationId, orgServiceId } = urlParams.data
const { slug, orgLocationId: _, orgServiceId } = urlParams.data
const session = await checkServerPermissions({
ctx: { req, res },
permissions: ['dataPortalBasic'],
Expand Down
2 changes: 1 addition & 1 deletion apps/app/src/pages/org/[slug]/[orgLocationId]/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createStyles, Divider, Grid, Skeleton, Stack, Tabs, useMantineTheme } from '@mantine/core'
import { createStyles, Divider, Grid, Stack, Tabs, useMantineTheme } from '@mantine/core'
import { useMediaQuery } from '@mantine/hooks'
// import compact from 'just-compact'
import { type GetStaticPaths, type GetStaticPropsContext, type NextPage } from 'next'
Expand Down
16 changes: 8 additions & 8 deletions apps/app/src/pages/org/[slug]/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createStyles, Divider, Grid, Skeleton, Stack, Tabs, useMantineTheme } from '@mantine/core'
import { createStyles, Divider, Grid, Stack, Tabs, useMantineTheme } from '@mantine/core'
import { useElementSize, useMediaQuery } from '@mantine/hooks'
import { type GetStaticPaths, type GetStaticPropsContext, type InferGetStaticPropsType } from 'next'
import dynamic from 'next/dynamic'
Expand Down Expand Up @@ -46,7 +46,7 @@ const OrganizationPage = ({
const router = useRouter<'/org/[slug]'>()
const { data, status } = api.organization.forOrgPage.useQuery({ slug }, { enabled: !!slug })
// const { query } = router
const { t, i18n, ready: i18nReady } = useTranslation(formatNS(orgId))
const { t } = useTranslation(formatNS(orgId))
const [activeTab, setActiveTab] = useState<string | null>('services')
const [loading, setLoading] = useState(true)
const { data: hasRemote } = api.service.forServiceInfoCard.useQuery(
Expand All @@ -69,16 +69,16 @@ const OrganizationPage = ({
const reviewsRef = useRef<HTMLDivElement>(null)

useEffect(() => {
if (i18nReady && data && status === 'success' && !router.isFallback) {
if (data && status === 'success' && !router.isFallback) {
setLoading(false)
if (data.locations?.length > 1) setActiveTab('locations')
}
}, [data, status, i18nReady, router.isFallback])
}, [data, status, router.isFallback])

useEffect(() => {
orgId && i18n.reloadResources(i18n.resolvedLanguage, formatNS(orgId))
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
// useEffect(() => {
// orgId && i18n.reloadResources(i18n.resolvedLanguage)
// // eslint-disable-next-line react-hooks/exhaustive-deps
// }, [])

if (loading || !data || router.isFallback) return <OrgPageLoading />

Expand Down
Loading

1 comment on commit 4c2c02b

@vercel
Copy link

@vercel vercel bot commented on 4c2c02b Mar 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.