Skip to content

Commit

Permalink
Migrated 'with-absolute-imports' to App-router Convention (#68666)
Browse files Browse the repository at this point in the history
Hey There 👋 
This PR Includes the following changes 
-> Migration of with-absolute-imports example to App Router
-> Updated all packages
-> Added the Layout page as per App router Convention. 


cc - @samcx

Co-authored-by: Sam Ko <[email protected]>
  • Loading branch information
Hemanshu-Upadhyay and samcx authored Aug 8, 2024
1 parent 3131049 commit 51892eb
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
16 changes: 16 additions & 0 deletions examples/with-absolute-imports/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export const metadata = {
title: "Next.js",
description: "Generated by Next.js",
};

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
File renamed without changes.
12 changes: 6 additions & 6 deletions examples/with-absolute-imports/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
},
"dependencies": {
"next": "latest",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react": "^18.3.1",
"react-dom": "^18.3.1"
},
"devDependencies": {
"@types/node": "^18.11.9",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.8",
"typescript": "^4.8.4"
"@types/node": "^22.1.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"typescript": "^5.5.4"
}
}
9 changes: 7 additions & 2 deletions examples/with-absolute-imports/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@
// Using "paths" allows you to configure module path aliases
"paths": {
"@/components/*": ["components/*"]
}
},
"plugins": [
{
"name": "next"
}
]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}

0 comments on commit 51892eb

Please sign in to comment.