Skip to content

Commit 43065a8

Browse files
authored
Merge pull request #54 from jaegermoritz/feat/version-and-release-management
fix(web-app): 🐛 fix bugs that break the build
2 parents e84237c + 222e55a commit 43065a8

File tree

13 files changed

+75
-276
lines changed

13 files changed

+75
-276
lines changed

.github/workflows/conventional_commits.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "🚨 Lint PR 🚨"
1+
name: "🚨 Lint PR"
22

33
on:
44
pull_request_target:
@@ -30,18 +30,18 @@ jobs:
3030
header: pr-title-lint-error
3131
message: |
3232
Hey there and thank you for opening this pull request! 👋🏼
33-
33+
3434
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted.
3535
3636
Details:
37-
37+
3838
```
3939
${{ steps.lint_pr_title.outputs.error_message }}
4040
```
4141
4242
# Delete a previous comment when the issue has been resolved
4343
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
4444
uses: marocchino/sticky-pull-request-comment@v2
45-
with:
45+
with:
4646
header: pr-title-lint-error
4747
delete: true

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release
1+
name: 🔖 Release
22

33
on:
44
push:

.vscode/settings.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"graphql-server",
99
"deps",
1010
"database",
11-
"release"
11+
"release",
12+
"web-app"
1213
]
1314
}

apps/docs/next-env.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.

apps/web/app/[locale]/layout.tsx

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
import { NextIntlClientProvider } from 'next-intl'
22
import { getMessages } from 'next-intl/server'
33
import { ApolloWrapper } from '@/apollo-client/ApolloWrapper'
4-
import { Metadata } from 'next'
4+
import type { Metadata, ResolvingMetadata } from 'next'
55
import { Header } from '@/components/header'
66
import { Footer } from '@/components/footer'
77

8-
export const metaData: Metadata = {
9-
title: 'Homepage',
10-
description: 'This is the homepage',
11-
}
12-
13-
export default async function LocaleLayout({
14-
children,
15-
params: { locale },
16-
}: {
8+
type Props = {
179
children: React.ReactNode
1810
params: { locale: string }
19-
}) {
11+
}
12+
13+
export async function generateMetadata({ params }: Props, parent: ResolvingMetadata): Promise<Metadata> {
14+
return {
15+
title: 'Homepage',
16+
description: 'This is the homepage',
17+
}
18+
}
19+
20+
export default async function LocaleLayout({ children, params: { locale } }: Props) {
2021
// Providing all messages to the client
2122
// side is the easiest way to get started
2223
const messages = await getMessages()
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import { handlers } from '@/auth' // Referring to the auth.ts we just created
1+
import { handlers } from '../../../../auth'
22
export const { GET, POST } = handlers

apps/web/app/api/protected/route.ts

-9
This file was deleted.

apps/web/jest.config.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@
66
*
77
* * For more information on how next confiures Jest review this file:
88
* {@link https://github.com/vercel/next.js/blob/v14.2.3/packages/next/src/build/jest/jest.ts}
9+
*
10+
* As the official documentation is not providing a working example for next.js
11+
* I reworked the implementation following this discussion:
12+
* {@link https://github.com/vercel/next.js/discussions/73894}
913
*/
10-
import type { Config } from 'jest'
14+
import { Config } from '@jest/types'
1115
import nextJest from 'next/jest.js'
1216
import { compilerOptions } from './tsconfig.json'
1317

@@ -17,7 +21,7 @@ const createJestConfig = nextJest({
1721
})
1822

1923
// Add any custom config to be passed to Jest
20-
const config: Config = {
24+
const config: Config.InitialOptions = {
2125
collectCoverage: true,
2226
coverageProvider: 'v8',
2327

apps/web/jest.setup.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
import '@testing-library/jest-dom'
2+
import 'whatwg-fetch'
3+
import { TextDecoder, TextEncoder } from 'util'
4+
Object.assign(global, { TextDecoder, TextEncoder })

apps/web/next-env.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/// <reference types="next/image-types/global" />
33

44
// NOTE: This file should not be edited
5-
// see https://nextjs.org/docs/basic-features/typescript for more information.
5+
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.

apps/web/package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@
4141
"@commitlint/config-conventional": "^19.2.2",
4242
"@graphql-codegen/cli": "^5.0.2",
4343
"@graphql-codegen/named-operations-object": "^3.0.0",
44+
"@jest/types": "^29.6.3",
4445
"@next/eslint-plugin-next": "^14.1.1",
4546
"@repo/eslint-config": "workspace:*",
4647
"@repo/typescript-config": "workspace:*",
4748
"@testing-library/jest-dom": "^6.4.5",
4849
"@testing-library/react": "^15.0.7",
4950
"@types/eslint": "^8.56.5",
51+
"@types/jest": "^29.5.14",
5052
"@types/node": "^20.11.24",
5153
"@types/react": "^18.2.61",
5254
"@types/react-dom": "^18.2.19",
@@ -60,7 +62,8 @@
6062
"prettier": "^3.2.5",
6163
"ts-jest": "^29.1.2",
6264
"ts-node": "^10.9.2",
63-
"typescript": "^5.4.5"
65+
"typescript": "^5.4.5",
66+
"whatwg-fetch": "^3.6.20"
6467
},
6568
"engines": {
6669
"node": ">=20"

apps/web/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
},
1212
"resolveJsonModule": true,
1313
"skipLibCheck": true,
14-
"strict": true
14+
"strict": true,
15+
"typeRoots": ["./node_modules/@types"]
1516
},
1617
"include": [
1718
"**/*.config.js",

0 commit comments

Comments
 (0)