From 26675607b7dea0120fca9680dccc953dd657fdd1 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Mon, 22 Jan 2024 10:44:59 +0000 Subject: [PATCH] introduce NextConfigExperimental as suggested in PR review --- packages/next-on-pages/build-metadata.d.ts | 6 ++---- .../next-on-pages/src/buildApplication/nextConfig.ts | 12 +++++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/next-on-pages/build-metadata.d.ts b/packages/next-on-pages/build-metadata.d.ts index 5e8c69fb7..4416e8236 100644 --- a/packages/next-on-pages/build-metadata.d.ts +++ b/packages/next-on-pages/build-metadata.d.ts @@ -7,10 +7,8 @@ type NextOnPagesBuildMetadata = { /** (subset of) values obtained from the user's next.config.js (if any was found) */ config?: { experimental?: Pick< - NonNullable< - // eslint-disable-next-line @typescript-eslint/consistent-type-imports -- the import needs to be dynamic since the nextConfig file itself uses this type - import('./src/buildApplication/nextConfig').NextConfig['experimental'] - >, + // eslint-disable-next-line @typescript-eslint/consistent-type-imports -- the import needs to be dynamic since the nextConfig file itself uses this type + import('./src/buildApplication/nextConfig').NextConfigExperimental, 'allowedRevalidateHeaderKeys' | 'fetchCacheKeyPrefix' >; }; diff --git a/packages/next-on-pages/src/buildApplication/nextConfig.ts b/packages/next-on-pages/src/buildApplication/nextConfig.ts index 52bfd181f..d24d530bd 100644 --- a/packages/next-on-pages/src/buildApplication/nextConfig.ts +++ b/packages/next-on-pages/src/buildApplication/nextConfig.ts @@ -9,11 +9,13 @@ import * as os from 'os'; * version of it which includes just what we need in next-on-pages. */ export type NextConfig = Record & { - experimental?: { - incrementalCacheHandlerPath?: string; - allowedRevalidateHeaderKeys?: string[]; - fetchCacheKeyPrefix?: string; - }; + experimental?: NextConfigExperimental; +}; + +export type NextConfigExperimental = { + incrementalCacheHandlerPath?: string; + allowedRevalidateHeaderKeys?: string[]; + fetchCacheKeyPrefix?: string; }; /**