Skip to content

Commit c664bbb

Browse files
refactor(dashboard): move tabs to route segments (#317)
1 parent fa38e5e commit c664bbb

56 files changed

Lines changed: 899 additions & 315 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bun.lock

Lines changed: 42 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

next.config.mjs

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
// NOTE: related to src/configs/rewrites.ts
2+
import path from 'node:path'
3+
24
export const DOCUMENTATION_DOMAIN = 'e2b.mintlify.app'
35

6+
const browserStub = (file) => path.resolve(process.cwd(), 'stubs', file)
7+
8+
const browserNodeModuleStubs = {
9+
crypto: browserStub('crypto.ts'),
10+
fs: browserStub('fs.ts'),
11+
'fs/promises': browserStub('fs-promises.ts'),
12+
path: browserStub('path.ts'),
13+
'node:crypto': browserStub('crypto.ts'),
14+
'node:fs': browserStub('fs.ts'),
15+
'node:fs/promises': browserStub('fs-promises.ts'),
16+
'node:path': browserStub('path.ts'),
17+
}
18+
419
/** @type {import('next').NextConfig} */
520
const config = {
621
reactStrictMode: true,
@@ -15,14 +30,32 @@ const config = {
1530
},
1631
turbopack: {
1732
resolveAlias: {
18-
// Stub Node.js modules for browser builds
19-
// e2b package bundles these packages. when dealing with browser chunks,
20-
// we need to stub these packages for builds.
33+
crypto: { browser: './stubs/crypto.ts' },
2134
fs: { browser: './stubs/fs.ts' },
35+
'fs/promises': { browser: './stubs/fs-promises.ts' },
36+
path: { browser: './stubs/path.ts' },
37+
'node:crypto': { browser: './stubs/crypto.ts' },
2238
'node:fs': { browser: './stubs/fs.ts' },
2339
'node:fs/promises': { browser: './stubs/fs-promises.ts' },
40+
'node:path': { browser: './stubs/path.ts' },
2441
},
2542
},
43+
webpack: (webpackConfig, { isServer, webpack }) => {
44+
if (!isServer) {
45+
webpackConfig.resolve.alias = {
46+
...webpackConfig.resolve.alias,
47+
...browserNodeModuleStubs,
48+
}
49+
50+
webpackConfig.plugins.push(
51+
new webpack.NormalModuleReplacementPlugin(/^node:/, (resource) => {
52+
resource.request = resource.request.replace(/^node:/, '')
53+
})
54+
)
55+
}
56+
57+
return webpackConfig
58+
},
2659
logging: {
2760
fetches: {
2861
fullUrl: true,

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
"private": true,
55
"scripts": {
66
"<<<<<<< Next.js": "",
7-
"dev": "bun scripts:check-app-env && next dev --turbopack | pino-pretty --colorize",
8-
"build": "next build --turbopack",
7+
"dev": "bun scripts:check-app-env && next dev | pino-pretty --colorize",
8+
"build": "next build --webpack",
99
"start": "next start | pino-pretty --colorize",
10-
"preview": "next build --turbopack && next start | pino-pretty --colorize",
10+
"preview": "next build --webpack && next start | pino-pretty --colorize",
1111
"lint": "biome lint .",
1212
"lint:fix": "biome lint --write .",
1313
"format": "biome check --write --linter-enabled=false --assist-enabled=true . --max-diagnostics none",
@@ -54,7 +54,7 @@
5454
"@hookform/resolvers": "^5.2.2",
5555
"@marsidev/react-turnstile": "^1.4.1",
5656
"@next-safe-action/adapter-react-hook-form": "^2.0.0",
57-
"@next/env": "16.1.5",
57+
"@next/env": "^16.2.6",
5858
"@opentelemetry/api": "^1.9.0",
5959
"@opentelemetry/auto-instrumentations-node": "^0.62.1",
6060
"@opentelemetry/exporter-logs-otlp-http": "^0.203.0",
@@ -114,7 +114,7 @@
114114
"micromatch": "^4.0.8",
115115
"motion": "^12.23.25",
116116
"nanoid": "^5.0.9",
117-
"next": "16.1.5",
117+
"next": "^16.2.6",
118118
"next-safe-action": "^8.0.11",
119119
"next-themes": "^0.4.6",
120120
"nuqs": "^2.7.0",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use client'
2+
3+
import { DashboardRouteError } from '@/features/dashboard/shared/route-error'
4+
5+
export default function AccountPageError({
6+
error,
7+
reset,
8+
}: {
9+
error: Error & { digest?: string }
10+
reset: () => void
11+
}) {
12+
return <DashboardRouteError error={error} reset={reset} />
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use client'
2+
3+
import { DashboardRouteError } from '@/features/dashboard/shared/route-error'
4+
5+
export default function BillingPageError({
6+
error,
7+
reset,
8+
}: {
9+
error: Error & { digest?: string }
10+
reset: () => void
11+
}) {
12+
return <DashboardRouteError error={error} reset={reset} />
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use client'
2+
3+
import { DashboardRouteError } from '@/features/dashboard/shared/route-error'
4+
5+
export default function BillingPlanPageError({
6+
error,
7+
reset,
8+
}: {
9+
error: Error & { digest?: string }
10+
reset: () => void
11+
}) {
12+
return <DashboardRouteError error={error} reset={reset} />
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use client'
2+
3+
import { DashboardRouteError } from '@/features/dashboard/shared/route-error'
4+
5+
export default function BillingPlanSelectPageError({
6+
error,
7+
reset,
8+
}: {
9+
error: Error & { digest?: string }
10+
reset: () => void
11+
}) {
12+
return <DashboardRouteError error={error} reset={reset} />
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use client'
2+
3+
import { DashboardRouteError } from '@/features/dashboard/shared/route-error'
4+
5+
export default function TeamDashboardError({
6+
error,
7+
reset,
8+
}: {
9+
error: Error & { digest?: string }
10+
reset: () => void
11+
}) {
12+
return <DashboardRouteError error={error} reset={reset} />
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use client'
2+
3+
import { DashboardRouteError } from '@/features/dashboard/shared/route-error'
4+
5+
export default function GeneralPageError({
6+
error,
7+
reset,
8+
}: {
9+
error: Error & { digest?: string }
10+
reset: () => void
11+
}) {
12+
return <DashboardRouteError error={error} reset={reset} />
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use client'
2+
3+
import { DashboardRouteError } from '@/features/dashboard/shared/route-error'
4+
5+
export default function KeysPageError({
6+
error,
7+
reset,
8+
}: {
9+
error: Error & { digest?: string }
10+
reset: () => void
11+
}) {
12+
return <DashboardRouteError error={error} reset={reset} />
13+
}

0 commit comments

Comments
 (0)