Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Fixes to help monorepo builds #1103

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Card, CardProps, HStack, Heading, IconButton, Stack } from '@chakra-ui/react'
import Link from 'next/link'
import { PropsWithChildren } from 'react'
import { ArrowLeft } from 'react-feather'

interface Props extends CardProps, PropsWithChildren {
interface Props extends CardProps {
backLink: string
title: string
}
Expand Down
3 changes: 2 additions & 1 deletion lib/shared/services/api/apollo-global-data.provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ import { getFxRates } from '../../utils/currencies'
import { getPoolCategories } from '@/lib/modules/pool/categories/getPoolCategories'
import { PoolCategoriesProvider } from '@/lib/modules/pool/categories/PoolCategoriesProvider'
import { mins } from '../../utils/time'
import { PropsWithChildren } from 'react'

export const revalidate = 60

export async function ApolloGlobalDataProvider({ children }: React.PropsWithChildren) {
export async function ApolloGlobalDataProvider({ children }: PropsWithChildren) {
const client = getApolloServerClient()

const tokensQueryVariables = {
Expand Down
11 changes: 5 additions & 6 deletions test/utils/custom-renderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ import { apolloTestClient } from './apollo-test-client'
import { AppRouterContextProviderMock } from './app-router-context-provider-mock'
import { testQueryClient } from './react-query'

export type WrapperProps = { children: ReactNode }
export type Wrapper = ({ children }: WrapperProps) => ReactNode
export type Wrapper = ({ children }: PropsWithChildren) => ReactNode

export const EmptyWrapper = ({ children }: WrapperProps) => <>{children}</>
export const EmptyWrapper = ({ children }: PropsWithChildren) => <>{children}</>

export function testHook<TResult, TProps>(
hook: (props: TProps) => TResult,
options?: RenderHookOptions<TProps> | undefined
) {
function MixedProviders({ children }: WrapperProps) {
function MixedProviders({ children }: PropsWithChildren) {
const LocalProviders = options?.wrapper || EmptyWrapper

return (
Expand All @@ -49,7 +48,7 @@ export function testHook<TResult, TProps>(

const result = renderHook<TResult, TProps>(hook, {
...options,
wrapper: MixedProviders,
wrapper: MixedProviders as React.ComponentType<{ children: React.ReactNode }>,
})

return {
Expand All @@ -58,7 +57,7 @@ export function testHook<TResult, TProps>(
}
}

function GlobalProviders({ children }: WrapperProps) {
function GlobalProviders({ children }: PropsWithChildren) {
const defaultRouterOptions = {}

return (
Expand Down
8 changes: 1 addition & 7 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
},
"types": ["vitest/globals"]
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"types/global-ts.d.ts"
],
"include": ["global.d.ts", "next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules", ".next"]
}
Loading