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

Turbo #170

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Turbo #170

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
13 changes: 13 additions & 0 deletions apps/api/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { ReactNode } from 'react';

type RootLayoutProperties = {
readonly children: ReactNode;
};

const RootLayout = ({ children }: RootLayoutProperties) => (
<html lang="en">
<body>{children}</body>
</html>
);
Comment on lines +7 to +11
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Enhance the layout component with Next.js best practices.

The component should be enhanced with:

  1. React.FC type annotation (per coding guidelines)
  2. Metadata implementation
  3. Required head and viewport meta tags
-const RootLayout = ({ children }: RootLayoutProperties) => (
+export const metadata: Metadata = {
+  title: 'API',
+  description: 'API documentation'
+};
+
+const RootLayout: React.FC<RootLayoutProperties> = ({ children }) => (
   <html lang="en">
+    <head>
+      <meta name="viewport" content="width=device-width, initial-scale=1" />
+    </head>
     <body>{children}</body>
   </html>
 );

Committable suggestion skipped: line range outside the PR's diff.


export default RootLayout;
2 changes: 1 addition & 1 deletion apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"scripts": {
"dev": "concurrently \"pnpm:next\" \"pnpm:stripe\"",
"next": "next dev -p 3002",
"next": "next dev -p 3002 --turbopack",
"build": "next build",
"start": "next start",
"lint": "next lint",
Expand Down
7 changes: 5 additions & 2 deletions apps/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "app",
"private": true,
"scripts": {
"dev": "next dev -p 3000",
"dev": "next dev -p 3000 --turbopack",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Turbopack is compatible but requires security updates

The Next.js version 15.0.3 fully supports Turbopack, however there are two important points to address:

  • The import-in-the-middle dependency has a HIGH severity security vulnerability (versions <= 1.4.1). Please update to the latest version.
  • Consider explicitly enabling Turbopack in next.config.js instead of using the CLI flag for better maintainability.
🔗 Analysis chain

Verify Turbopack compatibility with Next.js version

While enabling Turbopack can improve development speed, please note that it's still in beta and has some limitations. Ensure all team members are aware of:

  1. Potential compatibility issues with certain Next.js features
  2. The requirement for root layouts as mentioned in the PR discussion

Let me gather more information about the Next.js version and Turbopack configuration.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if the Next.js version supports Turbopack
# and if there are any known issues

# Get the Next.js version from package.json
NEXT_VERSION=$(cat apps/app/package.json | jq -r '.dependencies.next')

# Check Next.js docs for Turbopack compatibility
echo "Checking Next.js $NEXT_VERSION for Turbopack compatibility..."
curl -s "https://nextjs.org/docs/app/api-reference/next-config-js/turbopack"

# Look for any Turbopack-related issues in the codebase
echo "Checking for potential Turbopack configuration issues..."
fd --type f --extension js,ts,tsx . apps/ --exec grep -l "use client"

Length of output: 877


Script:

#!/bin/bash
# Check Next.js version and Turbopack configuration
echo "Next.js version:"
cat apps/app/package.json | jq '.dependencies.next'

# Check for Turbopack configuration in next.config.js
echo -e "\nTurbopack configuration:"
fd next.config.js apps/ --exec cat {}

# Check for any experimental features
echo -e "\nChecking for experimental features:"
fd next.config.js apps/ --exec grep -A 5 "experimental"

Length of output: 353

"build": "next build",
"start": "next start",
"lint": "next lint",
Expand All @@ -11,6 +11,7 @@
},
"dependencies": {
"@clerk/nextjs": "^6.3.0",
"@prisma/client": "5.22.0",
"@repo/analytics": "workspace:*",
"@repo/database": "workspace:*",
"@repo/design-system": "workspace:*",
Expand All @@ -21,11 +22,13 @@
"@repo/seo": "workspace:*",
"@repo/tailwind-config": "workspace:*",
"@sentry/nextjs": "^8.37.1",
"import-in-the-middle": "^1.11.2",
"lucide-react": "^0.456.0",
"next": "15.0.3",
"next-themes": "^0.4.3",
"react": "18.3.1",
"react-dom": "18.3.1"
"react-dom": "18.3.1",
"require-in-the-middle": "^7.4.0"
},
"devDependencies": {
"@repo/typescript-config": "workspace:*",
Expand Down
7 changes: 6 additions & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "web",
"private": true,
"scripts": {
"dev": "next dev -p 3001",
"dev": "next dev -p 3001 --turbopack",
"build": "next build",
"start": "next start",
"lint": "next lint",
Expand All @@ -25,12 +25,17 @@
"@sentry/nextjs": "^8.37.1",
"date-fns": "^4.1.0",
"fumadocs-core": "^14.3.1",
"import-in-the-middle": "^1.11.2",
"lucide-react": "^0.456.0",
"mdx-bundler": "^10.0.3",
"next": "15.0.3",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-wrap-balancer": "^1.1.1",
"reading-time": "^1.5.0",
"require-in-the-middle": "^7.4.0",
"sharp": "^0.33.5",
"shiki": "^1.22.2",
"sqip": "1.0.0-alpha.51",
"sqip-plugin-data-uri": "1.0.0-alpha.52",
"sqip-plugin-primitive": "1.0.0-alpha.53",
Expand Down
7 changes: 6 additions & 1 deletion apps/web/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
{
"extends": "@repo/typescript-config/nextjs.json",
"compilerOptions": {
"baseUrl": "."
"baseUrl": ".",
"paths": {
"@/*": ["./*"],
"@repo/*": ["../../packages/*"],
"content-collections": ["./.content-collections/generated"]
}
},
"include": [
"next-env.d.ts",
Expand Down
3 changes: 1 addition & 2 deletions packages/typescript-config/nextjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"noEmit": true,
"paths": {
"@/*": ["./*"],
"@repo/*": ["../../packages/*"],
"content-collections": ["./.content-collections/generated"]
"@repo/*": ["../../packages/*"]
}
},
"exclude": ["node_modules"]
Expand Down
41 changes: 32 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion splash/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"build": "next build",
"dev": "next dev",
"dev": "next dev --turbopack",
"start": "next start"
},
"dependencies": {
Expand Down