Each example app utilizes open-next's example Next.js apps. open-next's example apps are built to test core Next.js functionality so they're helpful for testing cdk-nextjs-standalone
. We also don't want to reinvent the wheel. In order to use open-next's code within this repository we use git submodules. Read this guide for more info.
git clone https://github.com/jetbridge/cdk-nextjs.git
yarn install
yarn build
After cloning this repository in order to run the example apps or e2e tests, run:
- Initialize git submodule:
git submodule init && git submodule update
- Install dependencies:
cd open-next && pnpm i
- Build packages
pnpm build
To deploy an app manually to test them out for yourself, run:
cd app-router # or any other example
pnpm install
- Inject AWS Credentials into your terminal
cdk deploy
- Change directory into package with tests:
cd open-next/packages/tests-e2e
. - Set URL environment variable for the project you want to test:
APP_ROUTER_URL
forappRouter
project,PAGES_ROUTER_URL
forpagesRouter
project, and/orAPP_PAGE_ROUTER_URL
forappPagesRouter
project. These urls will be the CloudFront domains from deployedexamples/
CDK apps. You can find these in AWS Console or they'll be printed in your terminal after runningcdk deploy
. - Run e2e tests with ui:
pnpm playwright test --ui
. - Hit play (green play button) and watch tests run!
See .projenrc.ts run-e2e-tests
workflow towards bottom. This functionality is commented out until an AWS account can be used to deploy the example apps and run the tests.