Skip to content

Commit 553c9fc

Browse files
committed
fix: upgrade to typescript 5.1 to allow for async components
1 parent afeb6aa commit 553c9fc

5 files changed

Lines changed: 581 additions & 768 deletions

File tree

Lines changed: 22 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { NextSeo, NextSeoProps } from 'next-seo';
2-
import Link from 'next/link';
3-
import { AnalyticsWrapper } from './components/Analytics';
4-
import { Footer } from './components/Footer';
5-
import { Overpass, Open_Sans } from '@next/font/google';
1+
import { NextSeo, NextSeoProps } from 'next-seo'
2+
import Link from 'next/link'
3+
import { AnalyticsWrapper } from './components/Analytics'
4+
import { Footer } from './components/Footer'
5+
import { Overpass, Open_Sans } from '@next/font/google'
66

7-
import '../styles/globals.css';
8-
import { Nav } from './components/Nav';
9-
import Script from 'next/script';
10-
import { env } from '../env/server.mjs';
7+
import '../styles/globals.css'
8+
import { Nav } from './components/Nav'
9+
import Script from 'next/script'
10+
import { env } from '../env/server.mjs'
1111
// If loading a variable font, you don't need to specify the font weight
1212
const overpass = Overpass({
1313
//weight: ['600', '900'],
@@ -16,7 +16,7 @@ const overpass = Overpass({
1616
variable: '--font-overpass',
1717
// default, can also use "swap" to ensure custom font always shows
1818
display: 'swap',
19-
});
19+
})
2020

2121
const open_sans = Open_Sans({
2222
//weight: ['400', '600'],
@@ -25,9 +25,9 @@ const open_sans = Open_Sans({
2525
variable: '--font-open-sans',
2626
// default, can also use "swap" to ensure custom font always shows
2727
display: 'swap',
28-
});
28+
})
2929

30-
export const ogURL = `${env.OG_URL}/api/og/jote`;
30+
export const ogURL = `${env.OG_URL}/api/og/jote`
3131

3232
// next-seo.config.js
3333
export const SEO = (
@@ -43,7 +43,7 @@ export const SEO = (
4343
locale = 'en_US',
4444
alt = '',
4545
} = {},
46-
otherProps?: NextSeoProps
46+
otherProps?: NextSeoProps,
4747
) => (
4848
<NextSeo
4949
{...{
@@ -60,13 +60,9 @@ export const SEO = (
6060
{
6161
url:
6262
image ||
63-
`${ogURL}?title=${encodeURIComponent(
64-
ogTitle || title
65-
)}&author=${encodeURIComponent(
66-
description ?? '%20'
67-
)}&name=${encodeURIComponent(
68-
!canonical ? '' : 'Center of Trial and Error'
69-
)}`,
63+
`${ogURL}?title=${encodeURIComponent(ogTitle || title)}&author=${encodeURIComponent(
64+
description ?? '%20',
65+
)}&name=${encodeURIComponent(!canonical ? '' : 'Center of Trial and Error')}`,
7066
width: 1200,
7167
height: 630,
7268
alt,
@@ -83,45 +79,25 @@ export const SEO = (
8379
...otherProps,
8480
}}
8581
/>
86-
);
82+
)
8783

88-
export default function RootLayout({
89-
children,
90-
}: {
91-
children: React.ReactNode;
92-
}) {
84+
export default function RootLayout({ children }: { children: React.ReactNode }) {
9385
return (
9486
<html lang="en" className={`${open_sans.variable} ${overpass.variable}`}>
9587
<head>
9688
<meta charSet="UTF-8" />
9789
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
98-
<link
99-
rel="apple-touch-icon"
100-
sizes="180x180"
101-
href="/apple-touch-icon.png"
102-
/>
103-
<link
104-
rel="icon"
105-
type="image/png"
106-
sizes="32x32"
107-
href="/favicon-32x32.png"
108-
/>
109-
<link
110-
rel="icon"
111-
type="image/png"
112-
sizes="16x16"
113-
href="/favicon-16x16.png"
114-
/>
90+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
91+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
92+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
11593
<link rel="manifest" href="/site.webmanifest" />
11694
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#002642" />
11795
<meta name="msapplication-TileColor" content="#002642" />
11896
<meta name="theme-color" content="#ffffff" />
11997
</head>
12098
<body>
121-
{/* @ts-expect-error TODO: fix once Typescript is able to deal with async components or Next's typescript plugin is less ass */}
12299
<Nav />
123100
{children}
124-
{/* @ts-expect-error TODO: fix once Typescript is able to deal with async components or Next's typescript plugin is less ass */}
125101
<Footer />
126102
<AnalyticsWrapper />
127103
<Script
@@ -132,5 +108,5 @@ export default function RootLayout({
132108
/>
133109
</body>
134110
</html>
135-
);
111+
)
136112
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { ReactNode } from 'react'
2+
declare global {
3+
namespace JSX {
4+
type ElementType =
5+
| keyof JSX.IntrinsicElements
6+
| ((props: any) => Promise<ReactNode> | ReactNode)
7+
}
8+
}

migrations.json

Lines changed: 0 additions & 148 deletions
This file was deleted.

package.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"github-slugger": "^2.0.0",
6060
"image-size": "^1.0.2",
6161
"mime": "^3.0.0",
62-
"next": "13.3.5-canary.12",
62+
"next": "13.4.1-canary.2",
6363
"next-auth": "^4.22.1",
6464
"next-compose-plugins": "^2.2.1",
6565
"next-seo": "^6.0.0",
@@ -101,19 +101,19 @@
101101
"@jscutlery/semver": "^2.30.1",
102102
"@next/bundle-analyzer": "^13.4.0",
103103
"@nx-extend/strapi": "^3.5.1",
104-
"@nx/cypress": "16.0.3",
105-
"@nx/devkit": "16.0.3",
106-
"@nx/eslint-plugin": "16.0.3",
107-
"@nx/jest": "16.0.3",
108-
"@nx/js": "16.0.3",
109-
"@nx/linter": "16.0.3",
110-
"@nx/next": "16.0.3",
111-
"@nx/node": "16.0.3",
112-
"@nx/plugin": "16.0.3",
113-
"@nx/react": "16.0.3",
114-
"@nx/storybook": "16.0.3",
115-
"@nx/web": "16.0.3",
116-
"@nx/workspace": "16.0.3",
104+
"@nx/cypress": "16.1.1",
105+
"@nx/devkit": "16.1.1",
106+
"@nx/eslint-plugin": "16.1.1",
107+
"@nx/jest": "16.1.1",
108+
"@nx/js": "16.1.1",
109+
"@nx/linter": "16.1.1",
110+
"@nx/next": "16.1.1",
111+
"@nx/node": "16.1.1",
112+
"@nx/plugin": "16.1.1",
113+
"@nx/react": "16.1.1",
114+
"@nx/storybook": "16.1.1",
115+
"@nx/web": "16.1.1",
116+
"@nx/workspace": "16.1.1",
117117
"@nxtensions/astro": "^3.5.0",
118118
"@storybook/addon-essentials": "7.0.8",
119119
"@storybook/builder-vite": "^7.0.8",
@@ -137,7 +137,7 @@
137137
"@types/lodash": "^4.14.194",
138138
"@types/mdast": "^3.0.11",
139139
"@types/node": "18.16.3",
140-
"@types/react": "18.2.5",
140+
"@types/react": "18.2.6",
141141
"@types/react-dom": "18.2.3",
142142
"@typescript-eslint/eslint-plugin": "5.59.2",
143143
"@typescript-eslint/parser": "5.59.2",
@@ -147,7 +147,7 @@
147147
"autoprefixer": "^10.4.14",
148148
"babel-jest": "29.5.0",
149149
"babel-loader": "9.1.2",
150-
"cypress": "^12.2.0",
150+
"cypress": "12.11.0",
151151
"eslint": "~8.39.0",
152152
"eslint-config-airbnb": "^19.0.4",
153153
"eslint-config-airbnb-typescript": "^17.0.0",
@@ -169,7 +169,7 @@
169169
"jest-environment-jsdom": "29.5.0",
170170
"jsonc-eslint-parser": "^2.1.0",
171171
"limax": "^4.0.0",
172-
"nx": "16.0.3",
172+
"nx": "16.1.1",
173173
"nx-cloud": "16.0.5",
174174
"postcss": "^8.4.23",
175175
"prettier": "^2.8.8",
@@ -185,7 +185,7 @@
185185
"ts-node": "10.9.1",
186186
"tsconfig-paths": "^4.2.0",
187187
"tsx": "^3.12.7",
188-
"typescript": "^5.0.4",
188+
"typescript": "5.1.0-beta",
189189
"url-loader": "^4.1.1",
190190
"webpack-cli": "^5.0.2"
191191
},

0 commit comments

Comments
 (0)