Skip to content
Open
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
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
force=true
6 changes: 3 additions & 3 deletions apps/csk-marketing-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@uniformdev/context": "20.7.1-alpha.81",
"@uniformdev/csk-components": "*",
"@uniformdev/design-extensions-tools": "*",
"next": "^15.5.2",
"next": "^15.6.0-canary.16",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"use-debounce": "^10.0.5"
Expand All @@ -59,7 +59,7 @@
"@uniformdev/csk-cli": "*",
"cross-env": "^7.0.3",
"eslint": "^9.31.0",
"eslint-config-next": "^15.5.2",
"eslint-config-next": "^15.6.0-canary.16",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.3",
Expand All @@ -71,4 +71,4 @@
"tsx": "^4.19.2",
"typescript": "^5.7.3"
}
}
}
2 changes: 1 addition & 1 deletion apps/csk/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const compat = new FlatCompat({

const eslintConfig = [
...compat.config({
extends: ['next/core-web-vitals', 'next/typescript', 'prettier', 'plugin:@next/next/recommended'],
extends: ['next/core-web-vitals', 'next/typescript', 'prettier'],
plugins: ['prettier'],
ignorePatterns: ['next-env.d.ts'],
rules: {
Expand Down
8 changes: 6 additions & 2 deletions apps/csk/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NextConfig } from 'next';
import type { NextConfig } from 'next';
import { withUniformConfig } from '@uniformdev/canvas-next-rsc-v2/config';

/** @type {NextConfig} */
Expand All @@ -7,6 +7,10 @@ const nextConfig: NextConfig = {
remotePatterns: [{ protocol: 'https', hostname: '*' }],
deviceSizes: [320, 420, 640, 768, 1024, 1280, 1536],
},
experimental: {
ppr: 'incremental',
},
};

export default withUniformConfig(nextConfig);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export default withUniformConfig(nextConfig as any);
4 changes: 2 additions & 2 deletions apps/csk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"drizzle-zod": "^0.7.1",
"lucide-react": "^0.525.0",
"nanoid": "^5.1.5",
"next": "^15.5.2",
"next": "^15.6.0-canary.16",
"next-intl": "^3.26.3",
"postgres": "^3.4.5",
"react": "^19.1.0",
Expand All @@ -87,7 +87,7 @@
"cross-env": "^7.0.3",
"drizzle-kit": "^0.31.0",
"eslint": "^9.31.0",
"eslint-config-next": "^15.5.2",
"eslint-config-next": "^15.6.0-canary.16",
"eslint-config-prettier": "^10.0.1",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-prettier": "^5.2.3",
Expand Down
22 changes: 19 additions & 3 deletions apps/csk/src/app/api/preview/route.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
import { NextRequest } from 'next/server';

import {
createPreviewGETRouteHandler,
createPreviewPOSTRouteHandler,
createPreviewOPTIONSRouteHandler,
} from '@uniformdev/canvas-next-rsc-v2/handler';

export const GET = createPreviewGETRouteHandler();
export const POST = createPreviewPOSTRouteHandler();
export const OPTIONS = createPreviewOPTIONSRouteHandler();
const getHandler = createPreviewGETRouteHandler();
const postHandler = createPreviewPOSTRouteHandler();
const optionsHandler = createPreviewOPTIONSRouteHandler();

export async function GET(request: NextRequest, _context: { params: Promise<Record<string, unknown>> }) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return getHandler(request as any);
}

export async function POST(request: NextRequest, _context: { params: Promise<Record<string, unknown>> }) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return postHandler(request as any);
}

export async function OPTIONS(_request: NextRequest, _context: { params: Promise<Record<string, unknown>> }) {
return optionsHandler();
}
17 changes: 6 additions & 11 deletions apps/csk/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { formatPath } from './utils/formatPath';

export async function middleware(request: NextRequest) {
if (request.nextUrl.pathname === '/playground') {
return uniformMiddleware()(request);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
return uniformMiddleware()(request as any);
}

const baseResponse = NextResponse.next();
Expand All @@ -16,21 +17,17 @@ export async function middleware(request: NextRequest) {
const response = await uniformMiddleware({
rewriteRequestPath: async ({ url }) => ({
path: formatPath(url.pathname, locales.defaultLocale),
keys: {
search: url.toString(),
},
}),
})(request).then(result =>
// eslint-disable-next-line @typescript-eslint/no-explicit-any
})(request as any).then(result =>
result.headers.get('x-middleware-rewrite')
? result
: uniformMiddleware({
rewriteRequestPath: async ({ url }) => ({
path: formatPath(url.pathname, undefined),
keys: {
search: url.toString(),
},
}),
})(request)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
})(request as any)
);

baseResponse.cookies.getAll().forEach(cookie => {
Expand All @@ -47,5 +44,3 @@ export async function middleware(request: NextRequest) {
export const config = {
matcher: ['/((?!api|_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt).*)'],
};

export const runtime = 'nodejs';
4 changes: 2 additions & 2 deletions apps/csk/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"jsx": "react-jsx",
"incremental": true,
"plugins": [
{
Expand All @@ -37,4 +37,4 @@
"exclude": [
"node_modules"
]
}
}
Loading