Skip to content

Commit 57fd454

Browse files
authored
Merge pull request #390 from duyet/renovate/major-nextjs-monorepo
chore(deps): update nextjs monorepo to v15 (major)
2 parents 5f917a6 + 0af29ed commit 57fd454

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+15863
-2165
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,12 @@ jobs:
139139
restore-keys: |
140140
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
141141
142-
- name: Install dependencies
143-
run: yarn install
144-
145142
- name: Test components
146143
uses: cypress-io/github-action@v6
147144
with:
148145
component: true
149-
command: yarn component:headless
146+
install-command: npm install --legacy-peer-deps
147+
command: npm run component:headless
150148
browser: ${{ matrix.browser }}
151149
parallel: true
152150
record: true

app/[host]/[query]/page.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,18 @@ import { Suspense } from 'react'
99
import { getQueryConfigByName } from './clickhouse-queries'
1010

1111
interface PageProps {
12-
params: {
12+
params: Promise<{
1313
query: string
14-
}
15-
searchParams: { [key: string]: string | string[] | undefined }
14+
}>
15+
searchParams: Promise<{ [key: string]: string | string[] | undefined }>
1616
}
1717

1818
export const dynamic = 'force-dynamic'
1919
export const revalidate = 300
2020

21-
export default async function Page({
22-
params: { query },
23-
searchParams,
24-
}: PageProps) {
21+
export default async function Page({ params, searchParams }: PageProps) {
22+
const { query } = await params
23+
2524
noStore()
2625

2726
// Retrieves the query configuration by name.
@@ -40,7 +39,7 @@ export default async function Page({
4039
<Table
4140
title={query.replaceAll('-', ' ')}
4241
queryConfig={queryConfig}
43-
searchParams={searchParams}
42+
searchParams={await searchParams}
4443
/>
4544
</Suspense>
4645
</div>

app/[host]/charts/[charts]/page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@ import { notFound } from 'next/navigation'
33
import { Suspense } from 'react'
44

55
interface PageProps {
6-
params: {
6+
params: Promise<{
77
charts: string
8-
}
8+
}>
99
}
1010

1111
export const dynamic = 'force-dynamic'
1212
export const revalidate = 30
1313

14-
export default async function Page({ params: { charts } }: PageProps) {
14+
export default async function Page({ params }: PageProps) {
15+
const { charts } = await params
1516
let chartComponents = []
1617
let props = {}
1718

app/[host]/clusters/[cluster]/breadcrumb.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { ChevronDownIcon, SlashIcon } from '@radix-ui/react-icons'
22
import Link from 'next/link'
3+
import { use } from 'react'
34

45
import { ErrorAlert } from '@/components/error-alert'
56
import {
@@ -76,7 +77,7 @@ function Internal({ cluster, clusters }: Props & { clusters: Row[] }) {
7677
<Breadcrumb>
7778
<BreadcrumbList>
7879
<BreadcrumbItem>
79-
<BreadcrumbLink href={getScopedLink('/clusters')}>
80+
<BreadcrumbLink href={use(getScopedLink('/clusters'))}>
8081
Clusters
8182
</BreadcrumbLink>
8283
</BreadcrumbItem>
@@ -94,7 +95,7 @@ function Internal({ cluster, clusters }: Props & { clusters: Row[] }) {
9495
{clusters.map(({ cluster: name, replica_count }) => (
9596
<DropdownMenuItem key={name}>
9697
<Link
97-
href={getScopedLink(`/clusters/${name}/replicas-status`)}
98+
href={use(getScopedLink(`/clusters/${name}/replicas-status`))}
9899
className={name == cluster ? 'font-bold' : ''}
99100
>
100101
{name} ({replica_count}{' '}

app/[host]/clusters/[cluster]/count-across-replicas/page.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ import { ColumnFormat } from '@/types/column-format'
55
import type { QueryConfig } from '@/types/query-config'
66

77
interface PageProps {
8-
params: {
8+
params: Promise<{
99
cluster: string
10-
}
10+
}>
1111
}
1212

13-
export default async function Page({ params: { cluster } }: PageProps) {
13+
export default async function Page({ params }: PageProps) {
14+
const { cluster } = await params
15+
1416
const { data: replicas } = await fetchData<{ replica: string }[]>({
1517
query: `SELECT hostName() as replica FROM clusterAllReplicas({cluster: String}) ORDER BY 1`,
1618
query_params: { cluster },

app/[host]/clusters/[cluster]/layout.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@ import {
55
} from './breadcrumb'
66

77
interface ClusterListProps {
8-
params: {
8+
params: Promise<{
99
cluster: string
10-
}
10+
}>
1111
children: React.ReactNode
1212
}
1313

1414
export const revalidate = 600
1515

1616
export default async function ClusterTabListLayout({
17-
params: { cluster },
17+
params,
1818
children,
1919
}: ClusterListProps) {
20+
const { cluster } = await params
21+
2022
return (
2123
<div className="flex flex-col gap-5">
2224
<Suspense fallback={<ClusterListBreadcrumbSkeleton cluster={cluster} />}>
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { redirect } from 'next/navigation'
22

33
interface PageProps {
4-
params: {
4+
params: Promise<{
55
cluster: string
6-
}
6+
}>
77
}
88

99
// Redirects to the replicas status page.
10-
export default async function ClusterPage({ params: { cluster } }: PageProps) {
10+
export default async function ClusterPage({ params }: PageProps) {
11+
const { cluster } = await params
12+
1113
redirect(`/clusters/${cluster}/replicas-status`)
1214
}

app/[host]/clusters/[cluster]/parts-across-replicas/page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ import { ColumnFormat } from '@/types/column-format'
55
import type { QueryConfig } from '@/types/query-config'
66

77
interface PageProps {
8-
params: {
8+
params: Promise<{
99
cluster: string
10-
}
10+
}>
1111
}
1212

13-
export default async function Page({ params: { cluster } }: PageProps) {
13+
export default async function Page({ params }: PageProps) {
14+
const { cluster } = await params
1415
const { data: replicas } = await fetchData<{ replica: string }[]>({
1516
query: `SELECT hostName() as replica FROM clusterAllReplicas({cluster: String}) ORDER BY 1`,
1617
query_params: { cluster },

app/[host]/clusters/[cluster]/replicas-status/page.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ import Link from 'next/link'
77
import { queryConfig, type Row } from './config'
88

99
interface PageProps {
10-
params: {
10+
params: Promise<{
1111
cluster: string
12-
}
12+
}>
1313
}
1414

15-
export default async function Page({ params: { cluster } }: PageProps) {
15+
export default async function Page({ params }: PageProps) {
16+
const { cluster } = await params
17+
1618
const { data } = await fetchData<Row[]>({
1719
query: queryConfig.sql,
1820
query_params: { cluster },
@@ -28,17 +30,23 @@ export default async function Page({ params: { cluster } }: PageProps) {
2830
)
2931
}
3032

31-
const TopRightToolbarExtras = ({ cluster }: PageProps['params']) => (
33+
const TopRightToolbarExtras = async ({
34+
cluster,
35+
}: Awaited<PageProps['params']>) => (
3236
<div className="flex flex-row gap-2">
33-
<Link href={getScopedLink(`/clusters/${cluster}/parts-across-replicas`)}>
37+
<Link
38+
href={await getScopedLink(`/clusters/${cluster}/parts-across-replicas`)}
39+
>
3440
<Button
3541
variant="outline"
3642
className="flex flex-row gap-2 text-muted-foreground"
3743
>
3844
Parts on each table
3945
</Button>
4046
</Link>
41-
<Link href={getScopedLink(`/clusters/${cluster}/count-across-replicas`)}>
47+
<Link
48+
href={await getScopedLink(`/clusters/${cluster}/count-across-replicas`)}
49+
>
4250
<Button
4351
variant="outline"
4452
className="flex flex-row gap-2 text-muted-foreground"

app/[host]/dashboard/seeding.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ const migrateSettings = async () => {
4444
})
4545

4646
if (exists.length == 0) {
47-
const resp = await getClient({ web: false }).insert({
47+
const client = await getClient({ web: false })
48+
const resp = await client.insert({
4849
table: TABLE_SETTINGS,
4950
values: [seed],
5051
format: 'JSONEachRow',
@@ -104,7 +105,8 @@ const migrateDashboard = async () => {
104105
})
105106

106107
if (exists.length == 0) {
107-
const resp = await getClient({ web: false }).insert({
108+
const client = await getClient({ web: false })
109+
const resp = await client.insert({
108110
table: TABLE_CHARTS,
109111
values: [seed],
110112
format: 'JSONEachRow',

0 commit comments

Comments
 (0)