Skip to content

Commit 02b77eb

Browse files
committed
fix(studio): accept .next/dev/types include and fix type errors surfaced by App Router typegen
1 parent 2297a3d commit 02b77eb

5 files changed

Lines changed: 22 additions & 10 deletions

File tree

apps/studio/components/grid/SupabaseGrid.utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ export function useSyncTableEditorStateFromLocalStorageWithUrl({
242242
// Use nextjs useSearchParams to get the latest URL params
243243
const searchParams = useSearchParams()
244244
const urlParams = useMemo(() => {
245-
const sort = searchParams.getAll('sort')
246-
const filter = searchParams.getAll('filter')
245+
const sort = searchParams?.getAll('sort') ?? []
246+
const filter = searchParams?.getAll('filter') ?? []
247247
return { sort, filter }
248248
}, [searchParams])
249249

apps/studio/components/layouts/ProjectLayout/UpgradingState/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const UpgradingState = () => {
3636
{
3737
projectRef: ref,
3838
projectStatus: project?.status,
39-
trackingId: queryParams.get('trackingId'),
39+
trackingId: queryParams?.get('trackingId'),
4040
},
4141
{
4242
enabled: IS_PLATFORM,

apps/studio/pages/project/[ref]/sql/quickstarts.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { NextPageWithLayout } from 'types'
1212

1313
const SqlQuickstarts: NextPageWithLayout = () => {
1414
const router = useRouter()
15-
const { ref } = useParams<{ ref: string }>()
15+
const ref = useParams<{ ref: string }>()?.ref
1616
const tabs = useTabsStateSnapshot()
1717

1818
useEffect(() => {

apps/studio/pages/project/[ref]/sql/templates.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { NextPageWithLayout } from 'types'
1212

1313
const SqlTemplates: NextPageWithLayout = () => {
1414
const router = useRouter()
15-
const { ref } = useParams<{ ref: string }>()
15+
const ref = useParams<{ ref: string }>()?.ref
1616
const tabs = useTabsStateSnapshot()
1717

1818
useEffect(() => {

apps/studio/tsconfig.json

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
22
"compilerOptions": {
33
"target": "ES2021",
4-
"lib": ["dom", "dom.iterable", "esnext"],
4+
"lib": [
5+
"dom",
6+
"dom.iterable",
7+
"esnext"
8+
],
59
"allowJs": false,
610
"skipLibCheck": true,
711
"strict": true,
@@ -18,8 +22,12 @@
1822
"downlevelIteration": true,
1923
"incremental": true,
2024
"paths": {
21-
"@/*": ["./*"],
22-
"@ui/*": ["./../../packages/ui/src/*"] // handle ui package paths
25+
"@/*": [
26+
"./*"
27+
],
28+
"@ui/*": [
29+
"./../../packages/ui/src/*"
30+
] // handle ui package paths
2331
},
2432
"useDefineForClassFields": true,
2533
"plugins": [
@@ -36,7 +44,11 @@
3644
"**/*.js",
3745
"**/*.jsx",
3846
".next/types/**/*.ts",
39-
"./../../packages/ui/src/**/*.d.ts"
47+
"./../../packages/ui/src/**/*.d.ts",
48+
".next/dev/types/**/*.ts"
4049
],
41-
"exclude": ["node_modules", "public/deno/*.ts"]
50+
"exclude": [
51+
"node_modules",
52+
"public/deno/*.ts"
53+
]
4254
}

0 commit comments

Comments
 (0)