Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
chore(deps): upgrade to nextjs 16
  • Loading branch information
waleedlatif1 committed Dec 5, 2025
commit c9f1ca897071835ac7aadea9cc12ec9611ffdab0
6 changes: 3 additions & 3 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
"fumadocs-mdx": "11.10.1",
"fumadocs-ui": "15.8.2",
"lucide-react": "^0.511.0",
"next": "15.4.8",
"next": "16.0.7",
"next-themes": "^0.4.6",
"react": "19.1.0",
"react-dom": "19.1.0",
"react": "19.2.1",
"react-dom": "19.2.1",
"tailwind-merge": "^3.0.2"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions apps/docs/middleware.ts → apps/docs/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { type NextFetchEvent, type NextRequest, NextResponse } from 'next/server
import { i18n } from '@/lib/i18n'

const { rewrite: rewriteLLM } = rewritePath('/docs/*path', '/llms.mdx/*path')
const i18nMiddleware = createI18nMiddleware(i18n)
const i18nProxy = createI18nMiddleware(i18n)

export default function middleware(request: NextRequest, event: NextFetchEvent) {
export default function proxy(request: NextRequest, event: NextFetchEvent) {
if (isMarkdownPreferred(request)) {
const result = rewriteLLM(request.nextUrl.pathname)

Expand All @@ -15,7 +15,7 @@ export default function middleware(request: NextRequest, event: NextFetchEvent)
}
}

return i18nMiddleware(request, event)
return i18nProxy(request, event)
}

export const config = {
Expand Down
5 changes: 3 additions & 2 deletions apps/docs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"jsx": "react-jsx",
"incremental": true,
"paths": {
"@/.source": ["./.source/index.ts"],
Expand All @@ -31,7 +31,8 @@
"**/*.tsx",
".next/types/**/*.ts",
"content/docs/execution/index.mdx",
"content/docs/connections/index.mdx"
"content/docs/connections/index.mdx",
".next/dev/types/**/*.ts"
],
"exclude": ["node_modules"]
}
10 changes: 3 additions & 7 deletions apps/sim/app/api/mcp/servers/[id]/refresh/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@ export const dynamic = 'force-dynamic'
/**
* POST - Refresh an MCP server connection (requires any workspace permission)
*/
export const POST = withMcpAuth('read')(
async (
request: NextRequest,
{ userId, workspaceId, requestId },
{ params }: { params: { id: string } }
) => {
const serverId = params.id
export const POST = withMcpAuth<{ id: string }>('read')(
async (request: NextRequest, { userId, workspaceId, requestId }, { params }) => {
const { id: serverId } = await params

try {
logger.info(
Expand Down
10 changes: 3 additions & 7 deletions apps/sim/app/api/mcp/servers/[id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@ export const dynamic = 'force-dynamic'
/**
* PATCH - Update an MCP server in the workspace (requires write or admin permission)
*/
export const PATCH = withMcpAuth('write')(
async (
request: NextRequest,
{ userId, workspaceId, requestId },
{ params }: { params: { id: string } }
) => {
const serverId = params.id
export const PATCH = withMcpAuth<{ id: string }>('write')(
async (request: NextRequest, { userId, workspaceId, requestId }, { params }) => {
const { id: serverId } = await params

try {
const body = getParsedBody(request) || (await request.json())
Expand Down
5 changes: 2 additions & 3 deletions apps/sim/app/api/workflows/[id]/paused/[executionId]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ export async function GET(
{
params,
}: {
params: { id: string; executionId: string }
params: Promise<{ id: string; executionId: string }>
}
) {
const workflowId = params.id
const executionId = params.executionId
const { id: workflowId, executionId } = await params

const access = await validateWorkflowAccess(request, workflowId, false)
if (access.error) {
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/app/api/workflows/[id]/paused/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export async function GET(
{
params,
}: {
params: { id: string }
params: Promise<{ id: string }>
}
) {
const workflowId = params.id
const { id: workflowId } = await params

const access = await validateWorkflowAccess(request, workflowId, false)
if (access.error) {
Expand Down
14 changes: 8 additions & 6 deletions apps/sim/lib/mcp/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ export interface McpAuthContext {
requestId: string
}

export type McpRouteHandler = (
export type McpRouteHandler<TParams = Record<string, string>> = (
request: NextRequest,
context: McpAuthContext,
...args: any[]
routeContext: { params: Promise<TParams> }
) => Promise<NextResponse>

interface AuthResult {
Expand Down Expand Up @@ -170,11 +170,13 @@ function getPermissionErrorMessage(permissionLevel: McpPermissionLevel): string
* @returns Middleware wrapper function
*
*/
export function withMcpAuth(permissionLevel: McpPermissionLevel = 'read') {
return function middleware(handler: McpRouteHandler) {
export function withMcpAuth<TParams = Record<string, string>>(
permissionLevel: McpPermissionLevel = 'read'
) {
return function middleware(handler: McpRouteHandler<TParams>) {
return async function wrappedHandler(
request: NextRequest,
...args: any[]
routeContext: { params: Promise<TParams> }
): Promise<NextResponse> {
const authResult = await validateMcpAuth(request, permissionLevel)

Expand All @@ -183,7 +185,7 @@ export function withMcpAuth(permissionLevel: McpPermissionLevel = 'read') {
}

try {
return await handler(request, (authResult as AuthResult).context, ...args)
return await handler(request, (authResult as AuthResult).context, routeContext)
} catch (error) {
logger.error(
`[${(authResult as AuthResult).context.requestId}] Error in MCP route handler:`,
Expand Down
13 changes: 9 additions & 4 deletions apps/sim/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,22 @@ const nextConfig: NextConfig = {
typescript: {
ignoreBuildErrors: isTruthy(env.DOCKER_BUILD),
},
eslint: {
ignoreDuringBuilds: isTruthy(env.DOCKER_BUILD),
},
output: isTruthy(env.DOCKER_BUILD) ? 'standalone' : undefined,
turbopack: {
resolveExtensions: ['.tsx', '.ts', '.jsx', '.js', '.mjs', '.json'],
},
serverExternalPackages: ['unpdf', 'ffmpeg-static', 'fluent-ffmpeg'],
serverExternalPackages: [
'unpdf',
'ffmpeg-static',
'fluent-ffmpeg',
'pino',
'pino-pretty',
'thread-stream',
],
experimental: {
optimizeCss: true,
turbopackSourceMaps: false,
turbopackFileSystemCacheForDev: true,
},
...(isDev && {
allowedDevOrigins: [
Expand Down
16 changes: 8 additions & 8 deletions apps/sim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
"node": ">=20.0.0"
},
"scripts": {
"dev": "next dev --turbo --port 3000",
"dev:classic": "next dev",
"dev": "next dev --port 3000",
"dev:webpack": "next dev --webpack",
"dev:sockets": "bun run socket-server/index.ts",
"dev:full": "concurrently -n \"App,Realtime\" -c \"cyan,magenta\" \"bun run dev\" \"bun run dev:sockets\"",
"build": "next build --turbopack",
"build": "next build",
"start": "next start",
"prepare": "cd ../.. && bun husky",
"test": "vitest run",
Expand Down Expand Up @@ -98,7 +98,7 @@
"mammoth": "^1.9.0",
"mysql2": "3.14.3",
"nanoid": "^3.3.7",
"next": "15.4.8",
"next": "16.0.7",
"next-mdx-remote": "^5.0.0",
"next-runtime-env": "3.3.0",
"next-themes": "^0.4.6",
Expand All @@ -108,9 +108,9 @@
"posthog-js": "1.268.9",
"posthog-node": "5.9.2",
"prismjs": "^1.30.0",
"react": "19.1.0",
"react": "19.2.1",
"react-colorful": "5.6.1",
"react-dom": "19.1.0",
"react-dom": "19.2.1",
"react-google-drive-picker": "^1.2.2",
"react-hook-form": "^7.54.2",
"react-markdown": "^10.1.0",
Expand Down Expand Up @@ -166,8 +166,8 @@
"sharp"
],
"overrides": {
"next": "15.4.8",
"@next/env": "15.4.8",
"next": "16.0.7",
"@next/env": "16.0.7",
"drizzle-orm": "^0.44.5",
"postgres": "^3.4.5"
}
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/middleware.ts → apps/sim/proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { isHosted } from './lib/core/config/environment'
import { generateRuntimeCSP } from './lib/core/security/csp'
import { createLogger } from './lib/logs/console/logger'

const logger = createLogger('Middleware')
const logger = createLogger('Proxy')

const SUSPICIOUS_UA_PATTERNS = [
/^\s*$/, // Empty user agents
Expand Down Expand Up @@ -131,7 +131,7 @@ function handleSecurityFiltering(request: NextRequest): NextResponse | null {
return null
}

export async function middleware(request: NextRequest) {
export async function proxy(request: NextRequest) {
const url = request.nextUrl

const sessionCookie = getSessionCookie(request)
Expand Down
5 changes: 3 additions & 2 deletions apps/sim/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"resolveJsonModule": true,
"isolatedModules": true,
"allowImportingTsExtensions": true,
"jsx": "preserve",
"jsx": "react-jsx",
"plugins": [
{
"name": "next"
Expand All @@ -48,7 +48,8 @@
".next/types/**/*.ts",
"../next-env.d.ts",
"telemetry.config.js",
"trigger.config.ts"
"trigger.config.ts",
".next/dev/types/**/*.ts"
],
"exclude": ["node_modules"]
}
Loading