vite-plugin-storybook-nextjs 2.1.0--canary.62.12de69e.0 → 3.0.1--canary.0d58c8c.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +103 -123
- package/dist/index.js +104 -124
- package/dist/mocks/storybook.global.cjs +91 -121
- package/dist/mocks/storybook.global.js +91 -121
- package/dist/plugins/next-image/alias/next-image.d.cts +1 -2
- package/dist/plugins/next-image/alias/next-image.d.ts +1 -2
- package/dist/plugins/next-mocks/alias/cache/index.cjs +0 -6
- package/dist/plugins/next-mocks/alias/cache/index.d.cts +1 -5
- package/dist/plugins/next-mocks/alias/cache/index.d.ts +1 -5
- package/dist/plugins/next-mocks/alias/cache/index.js +1 -5
- package/dist/plugins/next-mocks/alias/headers/cookies.cjs +0 -2
- package/dist/plugins/next-mocks/alias/headers/cookies.js +0 -2
- package/dist/plugins/next-mocks/alias/headers/index.cjs +4 -2
- package/dist/plugins/next-mocks/alias/headers/index.d.cts +1 -0
- package/dist/plugins/next-mocks/alias/headers/index.d.ts +1 -0
- package/dist/plugins/next-mocks/alias/headers/index.js +1 -2
- package/package.json +8 -11
- package/dist/plugins/next-mocks/alias/safe-stable-stringify/index.cjs +0 -12
- package/dist/plugins/next-mocks/alias/safe-stable-stringify/index.d.cts +0 -11
- package/dist/plugins/next-mocks/alias/safe-stable-stringify/index.d.ts +0 -11
- package/dist/plugins/next-mocks/alias/safe-stable-stringify/index.js +0 -10
|
@@ -3,17 +3,13 @@ import { Mock } from 'vitest';
|
|
|
3
3
|
type Procedure = (...args: any[]) => any;
|
|
4
4
|
declare const revalidatePath: Mock<Procedure>;
|
|
5
5
|
declare const revalidateTag: Mock<Procedure>;
|
|
6
|
-
declare const updateTag: Mock<Procedure>;
|
|
7
6
|
declare const unstable_cache: Mock<Procedure>;
|
|
8
7
|
declare const unstable_noStore: Mock<Procedure>;
|
|
9
|
-
declare const refresh: Mock<Procedure>;
|
|
10
8
|
declare const cacheExports: {
|
|
11
9
|
unstable_cache: Mock<Procedure>;
|
|
12
10
|
revalidateTag: Mock<Procedure>;
|
|
13
11
|
revalidatePath: Mock<Procedure>;
|
|
14
|
-
updateTag: Mock<Procedure>;
|
|
15
|
-
refresh: Mock<Procedure>;
|
|
16
12
|
unstable_noStore: Mock<Procedure>;
|
|
17
13
|
};
|
|
18
14
|
|
|
19
|
-
export { cacheExports as default,
|
|
15
|
+
export { cacheExports as default, revalidatePath, revalidateTag, unstable_cache, unstable_noStore };
|
|
@@ -3,17 +3,13 @@ import { Mock } from 'vitest';
|
|
|
3
3
|
type Procedure = (...args: any[]) => any;
|
|
4
4
|
declare const revalidatePath: Mock<Procedure>;
|
|
5
5
|
declare const revalidateTag: Mock<Procedure>;
|
|
6
|
-
declare const updateTag: Mock<Procedure>;
|
|
7
6
|
declare const unstable_cache: Mock<Procedure>;
|
|
8
7
|
declare const unstable_noStore: Mock<Procedure>;
|
|
9
|
-
declare const refresh: Mock<Procedure>;
|
|
10
8
|
declare const cacheExports: {
|
|
11
9
|
unstable_cache: Mock<Procedure>;
|
|
12
10
|
revalidateTag: Mock<Procedure>;
|
|
13
11
|
revalidatePath: Mock<Procedure>;
|
|
14
|
-
updateTag: Mock<Procedure>;
|
|
15
|
-
refresh: Mock<Procedure>;
|
|
16
12
|
unstable_noStore: Mock<Procedure>;
|
|
17
13
|
};
|
|
18
14
|
|
|
19
|
-
export { cacheExports as default,
|
|
15
|
+
export { cacheExports as default, revalidatePath, revalidateTag, unstable_cache, unstable_noStore };
|
|
@@ -7,20 +7,16 @@ var revalidatePath = fn().mockName(
|
|
|
7
7
|
var revalidateTag = fn().mockName(
|
|
8
8
|
"next/cache::revalidateTag"
|
|
9
9
|
);
|
|
10
|
-
var updateTag = fn().mockName("next/cache::updateTag");
|
|
11
10
|
var unstable_cache = fn().mockName("next/cache::unstable_cache").mockImplementation((cb) => cb);
|
|
12
11
|
var unstable_noStore = fn().mockName(
|
|
13
12
|
"next/cache::unstable_noStore"
|
|
14
13
|
);
|
|
15
|
-
var refresh = fn().mockName("next/cache::refresh");
|
|
16
14
|
var cacheExports = {
|
|
17
15
|
unstable_cache,
|
|
18
16
|
revalidateTag,
|
|
19
17
|
revalidatePath,
|
|
20
|
-
updateTag,
|
|
21
|
-
refresh,
|
|
22
18
|
unstable_noStore
|
|
23
19
|
};
|
|
24
20
|
var cache_default = cacheExports;
|
|
25
21
|
|
|
26
|
-
export { cache_default as default,
|
|
22
|
+
export { cache_default as default, revalidatePath, revalidateTag, unstable_cache, unstable_noStore };
|
|
@@ -65,8 +65,6 @@ var headers = () => {
|
|
|
65
65
|
headers.mockRestore = () => {
|
|
66
66
|
headersAdapterMock = new HeadersAdapterMock();
|
|
67
67
|
};
|
|
68
|
-
|
|
69
|
-
// src/plugins/next-mocks/alias/headers/index.ts
|
|
70
68
|
test.fn(
|
|
71
69
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
72
70
|
draftMode.draftMode ?? headers2__namespace.draftMode
|
|
@@ -43,8 +43,6 @@ var headers = () => {
|
|
|
43
43
|
headers.mockRestore = () => {
|
|
44
44
|
headersAdapterMock = new HeadersAdapterMock();
|
|
45
45
|
};
|
|
46
|
-
|
|
47
|
-
// src/plugins/next-mocks/alias/headers/index.ts
|
|
48
46
|
fn(
|
|
49
47
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
50
48
|
draftMode ?? headers2.draftMode
|
|
@@ -92,13 +92,15 @@ cookies.mockRestore = () => {
|
|
|
92
92
|
headers.mockRestore();
|
|
93
93
|
requestCookiesMock = new RequestCookiesMock(headers());
|
|
94
94
|
};
|
|
95
|
-
|
|
96
|
-
// src/plugins/next-mocks/alias/headers/index.ts
|
|
97
95
|
var draftMode2 = test.fn(
|
|
98
96
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
99
97
|
draftMode.draftMode ?? headers2__namespace.draftMode
|
|
100
98
|
).mockName("draftMode");
|
|
101
99
|
|
|
100
|
+
Object.defineProperty(exports, "UnsafeUnwrappedHeaders", {
|
|
101
|
+
enumerable: true,
|
|
102
|
+
get: function () { return headers2.UnsafeUnwrappedHeaders; }
|
|
103
|
+
});
|
|
102
104
|
exports.cookies = cookies;
|
|
103
105
|
exports.draftMode = draftMode2;
|
|
104
106
|
exports.headers = headers;
|
|
@@ -2,6 +2,7 @@ import { draftMode as draftMode$1 } from 'next/dist/server/request/draft-mode';
|
|
|
2
2
|
import { Mock } from 'vitest';
|
|
3
3
|
export { headers } from './headers.cjs';
|
|
4
4
|
export { cookies } from './cookies.cjs';
|
|
5
|
+
export { UnsafeUnwrappedHeaders } from 'next/dist/server/request/headers';
|
|
5
6
|
import 'next/dist/server/web/spec-extension/adapters/headers.js';
|
|
6
7
|
import 'next/dist/compiled/@edge-runtime/cookies/index.js';
|
|
7
8
|
|
|
@@ -2,6 +2,7 @@ import { draftMode as draftMode$1 } from 'next/dist/server/request/draft-mode';
|
|
|
2
2
|
import { Mock } from 'vitest';
|
|
3
3
|
export { headers } from './headers.js';
|
|
4
4
|
export { cookies } from './cookies.js';
|
|
5
|
+
export { UnsafeUnwrappedHeaders } from 'next/dist/server/request/headers';
|
|
5
6
|
import 'next/dist/server/web/spec-extension/adapters/headers.js';
|
|
6
7
|
import 'next/dist/compiled/@edge-runtime/cookies/index.js';
|
|
7
8
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { draftMode } from 'next/dist/server/request/draft-mode';
|
|
2
2
|
import * as headers2 from 'next/dist/server/request/headers';
|
|
3
|
+
export { UnsafeUnwrappedHeaders } from 'next/dist/server/request/headers';
|
|
3
4
|
import { fn } from 'storybook/test';
|
|
4
5
|
import { HeadersAdapter } from 'next/dist/server/web/spec-extension/adapters/headers.js';
|
|
5
6
|
import { RequestCookies } from 'next/dist/compiled/@edge-runtime/cookies/index.js';
|
|
@@ -70,8 +71,6 @@ cookies.mockRestore = () => {
|
|
|
70
71
|
headers.mockRestore();
|
|
71
72
|
requestCookiesMock = new RequestCookiesMock(headers());
|
|
72
73
|
};
|
|
73
|
-
|
|
74
|
-
// src/plugins/next-mocks/alias/headers/index.ts
|
|
75
74
|
var draftMode2 = fn(
|
|
76
75
|
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
77
76
|
draftMode ?? headers2.draftMode
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-storybook-nextjs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1--canary.0d58c8c.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vite-plugin",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"default": "./dist/index.cjs"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
|
-
"./browser/mocks/safe-stable-stringify": "./dist/plugins/next-mocks/alias/safe-stable-stringify/index.js",
|
|
33
32
|
"./browser/mocks/cache": "./dist/plugins/next-mocks/alias/cache/index.js",
|
|
34
33
|
"./browser/mocks/navigation": "./dist/plugins/next-mocks/alias/navigation/index.js",
|
|
35
34
|
"./browser/mocks/headers": "./dist/plugins/next-mocks/alias/headers/index.js",
|
|
@@ -51,8 +50,7 @@
|
|
|
51
50
|
"./node/mocks/legacy-image": "./dist/plugins/next-image/alias/next-legacy-image.cjs",
|
|
52
51
|
"./node/mocks/image-default-loader": "./dist/plugins/next-image/alias/image-default-loader.cjs",
|
|
53
52
|
"./node/mocks/image-context": "./dist/plugins/next-image/alias/image-context.cjs",
|
|
54
|
-
"./node/mocks/draft-mode.compat": "./dist/plugins/next-mocks/compatibility/draft-mode.compat.cjs"
|
|
55
|
-
"./node/mocks/safe-stable-stringify": "./dist/plugins/next-mocks/alias/safe-stable-stringify/index.cjs"
|
|
53
|
+
"./node/mocks/draft-mode.compat": "./dist/plugins/next-mocks/compatibility/draft-mode.compat.cjs"
|
|
56
54
|
},
|
|
57
55
|
"scripts": {
|
|
58
56
|
"prepublishOnly": "pnpm build",
|
|
@@ -63,8 +61,8 @@
|
|
|
63
61
|
"release": "auto shipit"
|
|
64
62
|
},
|
|
65
63
|
"peerDependencies": {
|
|
66
|
-
"next": "^14.1.0 || ^15.0.0
|
|
67
|
-
"storybook": "^0.0.0-0 || ^9.0.0 || ^
|
|
64
|
+
"next": "^14.1.0 || ^15.0.0",
|
|
65
|
+
"storybook": "^0.0.0-0 || ^9.0.0 || ^9.1.0-0",
|
|
68
66
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0"
|
|
69
67
|
},
|
|
70
68
|
"devDependencies": {
|
|
@@ -74,8 +72,8 @@
|
|
|
74
72
|
"@types/semver": "^7.5.8",
|
|
75
73
|
"auto": "^11.2.0",
|
|
76
74
|
"lefthook": "^1.6.16",
|
|
77
|
-
"next": "
|
|
78
|
-
"react": "19.
|
|
75
|
+
"next": "^15.4.0-canary.87",
|
|
76
|
+
"react": "19.1.0",
|
|
79
77
|
"rollup": "^4.18.0",
|
|
80
78
|
"semver": "^7.6.3",
|
|
81
79
|
"storybook": "^9.0.0",
|
|
@@ -86,7 +84,7 @@
|
|
|
86
84
|
},
|
|
87
85
|
"packageManager": "pnpm@9.4.0",
|
|
88
86
|
"dependencies": {
|
|
89
|
-
"@next/env": "
|
|
87
|
+
"@next/env": "^15.0.3",
|
|
90
88
|
"image-size": "^2.0.0",
|
|
91
89
|
"magic-string": "^0.30.11",
|
|
92
90
|
"module-alias": "^2.2.3",
|
|
@@ -98,8 +96,7 @@
|
|
|
98
96
|
},
|
|
99
97
|
"pnpm": {
|
|
100
98
|
"overrides": {
|
|
101
|
-
"vite-plugin-storybook-nextjs": "workspace:*"
|
|
102
|
-
"next": "^16.0.0"
|
|
99
|
+
"vite-plugin-storybook-nextjs": "workspace:*"
|
|
103
100
|
}
|
|
104
101
|
}
|
|
105
102
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is a replacement for next/dist/compiled/safe-stable-stringify
|
|
3
|
-
*
|
|
4
|
-
* Because it is CJS and needs access to __dirname, which causes Storybook to break.
|
|
5
|
-
*
|
|
6
|
-
* Original file can be found here:
|
|
7
|
-
* https://github.com/vercel/next.js/blob/canary/packages/next/src/compiled/safe-stable-stringify/index.js
|
|
8
|
-
*/
|
|
9
|
-
declare function safeStableStringify(value: unknown): string;
|
|
10
|
-
|
|
11
|
-
export { safeStableStringify as default };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is a replacement for next/dist/compiled/safe-stable-stringify
|
|
3
|
-
*
|
|
4
|
-
* Because it is CJS and needs access to __dirname, which causes Storybook to break.
|
|
5
|
-
*
|
|
6
|
-
* Original file can be found here:
|
|
7
|
-
* https://github.com/vercel/next.js/blob/canary/packages/next/src/compiled/safe-stable-stringify/index.js
|
|
8
|
-
*/
|
|
9
|
-
declare function safeStableStringify(value: unknown): string;
|
|
10
|
-
|
|
11
|
-
export { safeStableStringify as default };
|