File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 39
39
"./browser/mocks/legacy-image" : " ./dist/plugins/next-image/alias/next-legacy-image.js" ,
40
40
"./browser/mocks/image-default-loader" : " ./dist/plugins/next-image/alias/image-default-loader.js" ,
41
41
"./browser/mocks/image-context" : " ./dist/plugins/next-image/alias/image-context.js" ,
42
- "./browser/mocks/draft-mode" : " ./dist/plugins/next-mocks/compatibility/draft-mode.compat.js" ,
42
+ "./browser/mocks/draft-mode.compat " : " ./dist/plugins/next-mocks/compatibility/draft-mode.compat.js" ,
43
43
"./node/mocks/cache" : " ./dist/plugins/next-mocks/alias/cache/index.cjs" ,
44
44
"./node/mocks/navigation" : " ./dist/plugins/next-mocks/alias/navigation/index.cjs" ,
45
45
"./node/mocks/headers" : " ./dist/plugins/next-mocks/alias/headers/index.cjs" ,
50
50
"./node/mocks/legacy-image" : " ./dist/plugins/next-image/alias/next-legacy-image.cjs" ,
51
51
"./node/mocks/image-default-loader" : " ./dist/plugins/next-image/alias/image-default-loader.cjs" ,
52
52
"./node/mocks/image-context" : " ./dist/plugins/next-image/alias/image-context.cjs" ,
53
- "./node/mocks/draft-mode" : " ./dist/plugins/next-mocks/compatibility/draft-mode.compat.cjs"
53
+ "./node/mocks/draft-mode.compat " : " ./dist/plugins/next-mocks/compatibility/draft-mode.compat.cjs"
54
54
},
55
55
"scripts" : {
56
56
"prepublishOnly" : " pnpm build" ,
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ export { headers } from "./headers";
8
8
export { cookies } from "./cookies" ;
9
9
10
10
// re-exports of the actual module
11
- export * from "next/dist/server/request/headers" ;
11
+ export { UnsafeUnwrappedHeaders } from "next/dist/server/request/headers" ;
12
12
13
13
// passthrough mocks - keep original implementation but allow for spying
14
14
const draftMode : Mock < ( ) => ReturnType < typeof originalDraftMode > > = fn (
Original file line number Diff line number Diff line change @@ -28,10 +28,12 @@ export const getCompatibilityAliases = (env: Env) => {
28
28
const version = getNextjsVersion ( ) ;
29
29
const result : Record < string , string > = { } ;
30
30
31
+ const compatMap = mapping ( env ) ;
32
+
31
33
// biome-ignore lint/complexity/noForEach: <explanation>
32
- Object . keys ( mapping ) . forEach ( ( key ) => {
34
+ Object . keys ( compatMap ) . forEach ( ( key ) => {
33
35
if ( semver . intersects ( version , key ) ) {
34
- Object . assign ( result , mapping ( env ) [ key ] ) ;
36
+ Object . assign ( result , compatMap [ key ] ) ;
35
37
}
36
38
} ) ;
37
39
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export default defineConfig([
17
17
"src/plugins/next-mocks/alias/rsc/server-only.ts" ,
18
18
"src/plugins/next-mocks/alias/dynamic/index.tsx" ,
19
19
"src/mocks/storybook.global.ts" ,
20
- "src/plugins/next-mocks/alias/ compatibility/draft-mode.compat.ts" ,
20
+ "src/plugins/next-mocks/compatibility/draft-mode.compat.ts" ,
21
21
] ,
22
22
splitting : false ,
23
23
clean : true ,
You can’t perform that action at this time.
0 commit comments