### Install Prerelease Package (Main Branch) Source: https://github.com/opennextjs/opennextjs-aws/blob/main/README.md Install the latest prerelease version from the main branch using npm. This provides the most up-to-date, reasonably stable version. ```bash npm i https://pkg.pr.new/@opennextjs/aws@main ``` -------------------------------- ### Run OpenNext in Watch Mode Source: https://github.com/opennextjs/opennextjs-aws/blob/main/README.md Starts OpenNext in watch mode for local development, allowing for continuous building and testing of changes. ```bash pnpm dev ``` -------------------------------- ### Run End-to-End Tests Source: https://github.com/opennextjs/opennextjs-aws/blob/main/README.md Executes the end-to-end tests after the local build and start processes have been initiated. ```bash pnpm e2e:test ``` -------------------------------- ### Run Local End-to-End Tests (Part 1) Source: https://github.com/opennextjs/opennextjs-aws/blob/main/README.md Initiates the local build process for end-to-end testing. This is the first step in running e2e tests locally. ```bash pnpm -r openbuild:local pnpm -r openbuild:local:start ``` -------------------------------- ### Run Unit Tests Source: https://github.com/opennextjs/opennextjs-aws/blob/main/README.md Execute the unit tests for the OpenNext project using pnpm. ```bash pnpm test ``` -------------------------------- ### Build OpenNext Locally Source: https://github.com/opennextjs/opennextjs-aws/blob/main/README.md Steps to build the OpenNext package locally after cloning the repository. This is part of the contribution workflow. ```bash cd packages/open-next pnpm build ``` -------------------------------- ### Run e2e tests locally Source: https://github.com/opennextjs/opennextjs-aws/blob/main/packages/tests-e2e/README.md Navigate to the e2e test package and run the tests using pnpm. ```bash cd ../../packages/tests-e2e pnpm run e2e:dev ``` -------------------------------- ### Deploy the app with SST Source: https://github.com/opennextjs/opennextjs-aws/blob/main/packages/tests-e2e/README.md Use this command to deploy the Next.js application using SST for end-to-end testing. ```bash cd examples/sst npx sst deploy --stage e2e ``` -------------------------------- ### Build Next.js App with Local OpenNext Source: https://github.com/opennextjs/opennextjs-aws/blob/main/README.md Build a Next.js application using a locally built version of OpenNext. This command should be run from your Next.js app directory. ```bash cd path/to/my/nextjs/app path/to/opennextjs-aws/packages/open-next/dist/index.js build ``` -------------------------------- ### Export deployed app URLs Source: https://github.com/opennextjs/opennextjs-aws/blob/main/packages/tests-e2e/README.md After deployment, export the URLs of the different Next.js app permutations to environment variables for testing. ```bash export APP_ROUTER_URL=$(jq -r '.["e2e-example-AppRouter"].url' .sst/outputs.json) export PAGES_ROUTER_URL=$(jq -r '.["e2e-example-PagesRouter"].url' .sst/outputs.json) export APP_PAGES_ROUTER_URL=$(jq -r '.["e2e-example-AppPagesRouter"].url' .sst/outputs.json) ``` -------------------------------- ### Handling Types with esbuild Overrides Source: https://github.com/opennextjs/opennextjs-aws/blob/main/packages/open-next/src/adapters/plugins/README.md When using esbuild overrides, do not include `types` within `#override` and `#imports` directives. Place `import type` statements outside these directives to prevent esbuild from removing preceding comments. ```typescript import type { PluginHandler } from "../next-types.js"; import type { IncomingMessage } from "../request.js"; import type { ServerResponse } from "../response.js"; //#override imports import { requestHandler } from "./util.js"; //#endOverride ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.