Unverified Commit 90cd2241 authored by Evan Charalampidis's avatar Evan Charalampidis Committed by GitHub

examples: migrate `with-cypress` example to App Router (#58053)

Co-authored-by: 's avatarEvan <evan.charalampidis@gmail.com>
Co-authored-by: 's avatarLee Robinson <me@leerob.io>
parent 024a0ef2
......@@ -10,9 +10,9 @@
"component:headless": "cypress run --component"
},
"dependencies": {
"next": "latest",
"react": "18.2.0",
"react-dom": "18.2.0"
"next": "^14.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "18.0.6",
......
import type { AppProps } from 'next/app'
import '../styles/globals.css'
function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
}
export default MyApp
import AboutComponent from '../components/about-component'
import styles from '../styles/Home.module.css'
import AboutComponent from '../../components/about-component'
import styles from '../Home.module.css'
export default function About() {
return (
......
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import './globals.css'
import { ReactNode } from 'react'
const inter = Inter({ subsets: ['latin'] })
export const metadata: Metadata = {
title: 'Nextjs with cypress',
description: 'Nextjs with cypress',
}
export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
</html>
)
}
import Head from 'next/head'
import Image from 'next/image'
import Link from 'next/link'
import styles from '../styles/Home.module.css'
import styles from './Home.module.css'
export default function Home() {
return (
......
import AboutComponent from './about-component'
import AboutComponent from '../../src/components/about-component'
/* eslint-disable */
// Disable ESLint to prevent failing linting inside the Next.js repo.
// If you're using ESLint on your project, we recommend installing the ESLint Cypress plugin instead:
......
import Link from 'next/link'
import React from 'react'
import styles from '../styles/Home.module.css'
import styles from '../app/Home.module.css'
export default function AboutComponent() {
return (
......
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
......@@ -13,8 +17,20 @@
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
"incremental": true,
"plugins": [
{
"name": "next"
}
]
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment