Skip to content

Commit

Permalink
feat: add support for open-next v3
Browse files Browse the repository at this point in the history
  • Loading branch information
jadenv committed Nov 12, 2024
1 parent cf1a9a8 commit 962b41b
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "open-next"]
path = open-next
url = https://github.com/sst/open-next.git
url = https://github.com/opennextjs/opennextjs-aws.git
6 changes: 3 additions & 3 deletions API.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion examples/app-router/src/app-router-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export class AppRouterStack extends Stack {

const nextjs = new Nextjs(this, 'nextjs', {
nextjsPath: '../../open-next/examples/app-router',
buildCommand: 'npx open-next@^2 build',
// skipBuild: true,
});

Expand Down
2 changes: 1 addition & 1 deletion examples/app-router/src/overrides-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export class OverridesStack extends Stack {

const nextjs = new Nextjs(this, 'nextjs', {
nextjsPath: '../../open-next/examples/app-router',
buildCommand: 'npx open-next@^2 build',
buildCommand: 'npx @opennextjs/aws@^3 build',
// skipBuild: true,
overrides: {
nextjs: {
Expand Down
2 changes: 1 addition & 1 deletion open-next
Submodule open-next updated 345 files
4 changes: 2 additions & 2 deletions src/Nextjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export interface NextjsProps {
*/
readonly basePath?: string;
/**
* Optional value used to install NextJS node dependencies.
* @default 'npx --yes open-next@^2 build'
* Optional build command override value.
* @default 'npx @opennextjs/aws@^3 build'
*/
readonly buildCommand?: string;
/**
Expand Down
3 changes: 1 addition & 2 deletions src/NextjsBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,7 @@ export class NextjsBuild extends Construct {

private build() {
const buildPath = this.props.buildPath ?? this.props.nextjsPath;
const defaultBuildCommand = `npx open-next@^2 build ${this.props.streaming ? '--streaming' : ''}`;
const buildCommand = this.props.buildCommand ?? defaultBuildCommand;
const buildCommand = this.props.buildCommand ?? `npx @opennextjs/aws@^3 build`;
// run build
if (!this.props.quiet) {
console.debug(`Running "${buildCommand}" in`, buildPath);
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export const NEXTJS_CACHE_DIR = 'cache';
export const NEXTJS_BUILD_REVALIDATE_FN_DIR = 'revalidation-function';
export const NEXTJS_BUILD_DYNAMODB_PROVIDER_FN_DIR = 'dynamodb-provider';
export const NEXTJS_BUILD_IMAGE_FN_DIR = 'image-optimization-function';
export const NEXTJS_BUILD_SERVER_FN_DIR = 'server-function';
export const NEXTJS_BUILD_SERVER_FN_DIR = 'server-functions/default';

0 comments on commit 962b41b

Please sign in to comment.