-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(nextjs): add support for experimental appDir
- Loading branch information
1 parent
ee1f7c1
commit 90603c4
Showing
20 changed files
with
128 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/next/src/generators/application/files/app/api/hello/route.ts__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export async function GET(request: Request) { | ||
return new Response('Hello, from API!') | ||
} | ||
|
Binary file not shown.
1 change: 1 addition & 0 deletions
1
packages/next/src/generators/application/files/app/global.__stylesExt____tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%- styleContent %> |
22 changes: 22 additions & 0 deletions
22
packages/next/src/generators/application/files/app/layout.tsx__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Head from 'next/head'; | ||
import './global.<%= stylesExt %>'; | ||
|
||
export const metadata = { | ||
title: 'Nx Next App', | ||
description: 'Generated by create-nx-workspace', | ||
} | ||
|
||
export default function RootLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode | ||
}) { | ||
return ( | ||
<html lang="en"> | ||
<Head> | ||
<title>Welcome to <%= name %>!</title> | ||
</Head> | ||
<body>{children}</body> | ||
</html> | ||
) | ||
} |
1 change: 1 addition & 0 deletions
1
packages/next/src/generators/application/files/app/page.module.__style__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%- pageStyleContent %> |
28 changes: 28 additions & 0 deletions
28
packages/next/src/generators/application/files/app/page.tsx__tmpl__
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<% if (styledModule && styledModule !== 'styled-jsx') { | ||
var wrapper = 'StyledPage'; | ||
%>import styled from '<%= styledModule %>';<% } else { | ||
var wrapper = 'div'; | ||
%> | ||
<%- style !== 'styled-jsx' ? `import styles from './page.module.${style}';` : '' %> | ||
<% } | ||
%> | ||
|
||
<% if (styledModule && styledModule !== 'styled-jsx') { %> | ||
const StyledPage = styled.div`<%- pageStyleContent %>`; | ||
<% }%> | ||
|
||
export async function Index() { | ||
/* | ||
* Replace the elements below with your own. | ||
* | ||
* Note: The corresponding styles are in the ./<%= fileName %>.<%= style %> file. | ||
*/ | ||
return ( | ||
<<%= wrapper %><% if (!styledModule) {%> className={styles.page}<% } %>> | ||
<%- styledModule === 'styled-jsx' ? `<style jsx>{\`${pageStyleContent}\`}</style>` : `` %> | ||
<%- appContent %> | ||
</<%= wrapper %>> | ||
); | ||
}; | ||
|
||
export default Index; |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,5 @@ export interface Schema { | |
swc?: boolean; | ||
customServer?: boolean; | ||
skipPackageJson?: boolean; | ||
appDir?: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters