Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/actions/build-docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ name: Build Docs
description: Build docs pages inside /docs directory

runs:
using: 'composite'
steps:
- name: Install dependencies
run: bun install
shell: bash
using: "composite"
steps:
- name: Install dependencies
run: bun install
shell: bash

- name: Build with Next.js
run: bun next build
shell: bash
- name: Build with Next.js
run: bun next build
shell: bash

- name: Export static HTML with Next.js
run: bun next export
shell: bash
- name: Export static HTML with Next.js
run: bun next export
shell: bash
13 changes: 13 additions & 0 deletions .github/actions/format/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Format codebase
description: Run prettier to check codebase formatting

runs:
using: "composite"
steps:
- name: Install dependencies
run: bun install
shell: bash

- name: Run prettier
run: bun run prettier:check
shell: bash
21 changes: 11 additions & 10 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: Validate merge requests

on:
pull_request:
branches:
- main
pull_request:
branches:
- main

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- uses: ./.github/actions/build-docs
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- uses: ./.github/actions/format
- uses: ./.github/actions/build-docs
2 changes: 1 addition & 1 deletion .github/workflows/nextjs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ permissions:

# Allow one concurrent deployment
concurrency:
group: 'pages'
group: "pages"
cancel-in-progress: true

jobs:
Expand Down
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"printWidth": 110,
"singleQuote": false,
"semi": true,
"useTabs": false,
"tabWidth": 2,
"trailingComma": "es5"
}
Binary file modified bun.lockb
Binary file not shown.
4 changes: 1 addition & 3 deletions components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import styles from "../styles/Layout.module.css";
export default function Footer() {
return (
<footer className={styles.footer}>
<span>
Maintained by the OpenNext community
</span>
<span>Maintained by the OpenNext community</span>
<div>
<a target="_blank" href={SITE.github} rel="noopener noreferrer">
GitHub
Expand Down
13 changes: 2 additions & 11 deletions components/Logo.svg.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
export default function Logo() {
return (
<svg
width="195"
height="36"
fill="none"
viewBox="0 0 195 36"
xmlns="http://www.w3.org/2000/svg"
>
<svg width="195" height="36" fill="none" viewBox="0 0 195 36" xmlns="http://www.w3.org/2000/svg">
<path
d="M89.9565 27V2.88H95.8965L108.713 19.908V2.88H113.248V27H108.676L94.4925 8.136V27H89.9565Z"
fill="currentColor"
Expand All @@ -19,10 +13,7 @@ export default function Logo() {
d="M145.8 27L154.764 14.58L145.944 2.88H151.776L158.4 11.592L164.664 2.88H170.1L161.28 15.12L170.28 27H164.412L157.644 18.072L151.236 27H145.8Z"
fill="currentColor"
/>
<path
d="M181.074 27V7.092H172.218V2.88H194.646V7.092H185.79V27H181.074Z"
fill="currentColor"
/>
<path d="M181.074 27V7.092H172.218V2.88H194.646V7.092H185.79V27H181.074Z" fill="currentColor" />
<path
d="M10.2284 27.3516C8.15422 27.3516 6.40813 26.9473 4.99016 26.1387C3.58391 25.3184 2.5175 24.1641 1.79094 22.6758C1.0761 21.1875 0.718674 19.4473 0.718674 17.4551C0.718674 16.0488 0.841721 14.6719 1.08781 13.3242C1.34563 11.9648 1.72063 10.6699 2.21281 9.43945C2.705 8.20898 3.32024 7.07227 4.05852 6.0293C4.80852 4.98633 5.6757 4.08398 6.66008 3.32227C7.64445 2.54883 8.74602 1.95117 9.96477 1.5293C11.1952 1.10742 12.537 0.896484 13.9902 0.896484C16.9902 0.896484 19.287 1.78125 20.8808 3.55078C22.4863 5.32031 23.289 7.72266 23.289 10.7578C23.289 12.1641 23.1718 13.5527 22.9374 14.9238C22.7148 16.2832 22.3632 17.584 21.8827 18.8262C21.414 20.0566 20.8222 21.1934 20.1073 22.2363C19.3925 23.2676 18.5488 24.1641 17.5761 24.9258C16.6152 25.6875 15.5195 26.2852 14.289 26.7188C13.0702 27.1406 11.7167 27.3516 10.2284 27.3516ZM10.4745 23.748C11.33 23.748 12.1327 23.5957 12.8827 23.291C13.6327 22.9863 14.3183 22.5586 14.9394 22.0078C15.5722 21.4453 16.1347 20.7715 16.6269 19.9863C17.1308 19.2012 17.5527 18.3281 17.8925 17.3672C18.2441 16.4062 18.5136 15.375 18.7011 14.2734C18.8886 13.1602 18.9823 12 18.9823 10.793C18.9823 8.83594 18.5195 7.29492 17.5937 6.16992C16.6796 5.04492 15.373 4.48242 13.6738 4.48242C12.7948 4.48242 11.9687 4.64062 11.1952 4.95703C10.4335 5.26172 9.73039 5.70703 9.08586 6.29297C8.44133 6.86719 7.86711 7.55273 7.3632 8.34961C6.87102 9.13477 6.44914 10.0078 6.09758 10.9688C5.74602 11.9297 5.47649 12.9551 5.28899 14.0449C5.1132 15.123 5.02531 16.248 5.02531 17.4199C5.02531 18.7559 5.23625 19.8984 5.65813 20.8477C6.09172 21.7969 6.71281 22.5176 7.52141 23.0098C8.34172 23.502 9.3261 23.748 10.4745 23.748Z"
fill="currentColor"
Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"prettier:check": "prettier --check .",
"prettier:fix": "prettier --write .",
"fix": "bun run prettier:fix"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional? I don't see bun being used anywhere else, and it isn't installed in local dev (just CI) 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This repo uses Bun - there's a bun.lockb for managing deps in here. Looking at it, we have both a bun.lockb and package-lock.json, but the ci has always used bun

},
"dependencies": {
"@types/node": "18.11.9",
Expand All @@ -18,5 +21,8 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"typescript": "4.9.3"
},
"devDependencies": {
"prettier": "^3.5.2"
}
}
4 changes: 2 additions & 2 deletions pages/_app.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default function App({ Component, pageProps }) {
return <Component {...pageProps} />
}
return <Component {...pageProps} />;
}
15 changes: 8 additions & 7 deletions pages/aws/common_issues.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ This can also happen in app router when a client navigates via NextJS `<Link>` c

The issue might be that your having a folder or file in your `public` directory with an overlapping between the name and your route. In this case, you should rename that to something else.


#### `cannot find module './chunks/xxxx.js'` error

Dynamic imports in `instrumentation.ts` will cause this error at runtime. Remove dynamic imports to resolve.
Expand All @@ -75,24 +74,26 @@ The config recommended by Sentry docs uses dynamic imports in `instrumentation.t
Here's a working Sentry config which resolves the error:

`instrumentation.ts`

```typescript
import * as Sentry from '@sentry/nextjs';
import { initSentry } from '../sentry.server.config';
import * as Sentry from "@sentry/nextjs";
import { initSentry } from "../sentry.server.config";

export const onRequestError = Sentry.captureRequestError;

export async function register() {
initSentry(process.env.NEXT_RUNTIME as 'nodejs' | 'edge');
initSentry(process.env.NEXT_RUNTIME as "nodejs" | "edge");
}
```

`sentry.server.config.ts`

```typescript
import * as Sentry from '@sentry/nextjs';
import * as Sentry from "@sentry/nextjs";

export const initSentry = (runtime: 'nodejs' | 'edge') => {
export const initSentry = (runtime: "nodejs" | "edge") => {
Sentry.init({
dsn: 'https://...',
dsn: "https://...",

//...rest of your config
});
Expand Down
6 changes: 3 additions & 3 deletions pages/aws/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ For more advanced use cases, you can check [how to implement custom overrides](/

If you want to look at a full example, you can check [the full example](/aws/config/full_example).


### Opt out of default poweredByHeader

By default Next.js will add the [`x-powered-by`](https://nextjs.org/docs/app/api-reference/config/next-config-js/poweredByHeader) header. OpenNext will also add a header `x-opennext`. To opt-out of this, open `next.config.js` and disable the poweredByHeader property in the configuration:

```ts
module.exports = {
poweredByHeader: false,
}
```
};
```
2 changes: 1 addition & 1 deletion pages/aws/config/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"full_example": "Full Example",
"nx": "Nx Monorepo",
"overrides": "Overrides"
}
}
Loading