Skip to content

Commit

Permalink
introduce NextConfigExperimental as suggested in PR review
Browse files Browse the repository at this point in the history
  • Loading branch information
dario-piotrowicz committed Jan 22, 2024
1 parent 689bad8 commit de839e0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 2 additions & 4 deletions packages/next-on-pages/build-metadata.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
>;
};
Expand Down
12 changes: 7 additions & 5 deletions packages/next-on-pages/src/buildApplication/nextConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, unknown> & {
experimental?: {
incrementalCacheHandlerPath?: string;
allowedRevalidateHeaderKeys?: string[];
fetchCacheKeyPrefix?: string;
};
experimental?: NextConfigExperimental;
};

export type NextConfigExperimental = {
incrementalCacheHandlerPath?: string;
allowedRevalidateHeaderKeys?: string[];
fetchCacheKeyPrefix?: string;
};

/**
Expand Down

0 comments on commit de839e0

Please sign in to comment.