vite-plugin-storybook-nextjs 1.1.0--canary.27.f775ea2.0 → 1.1.0--canary.27.65f1124.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 +24 -29
- package/dist/index.js +24 -29
- package/dist/mocks/storybook.global.cjs +10 -15
- package/dist/mocks/storybook.global.js +10 -15
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -65,13 +65,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
65
65
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
66
66
|
var __getProtoOf = Object.getPrototypeOf;
|
|
67
67
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
68
|
-
var
|
|
69
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
70
|
-
}) : x)(function(x) {
|
|
71
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
72
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
73
|
-
});
|
|
74
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
68
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
75
69
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
76
70
|
};
|
|
77
71
|
var __copyProps = (to, from, except, desc) => {
|
|
@@ -2781,13 +2775,14 @@ function vitePluginNextImage(nextConfigResolver) {
|
|
|
2781
2775
|
|
|
2782
2776
|
// src/plugins/next-mocks/compatibility/compatibility-map.ts
|
|
2783
2777
|
var import_semver = __toESM(require_semver2());
|
|
2784
|
-
var
|
|
2778
|
+
var require5 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('out.js', document.baseURI).href)));
|
|
2779
|
+
var getNextjsVersion = () => require5(scopedResolve("next/package.json")).version;
|
|
2785
2780
|
var scopedResolve = (id) => {
|
|
2786
2781
|
let scopedModulePath;
|
|
2787
2782
|
try {
|
|
2788
|
-
scopedModulePath =
|
|
2783
|
+
scopedModulePath = require5.resolve(id, { paths: [path2.resolve()] });
|
|
2789
2784
|
} catch (e) {
|
|
2790
|
-
scopedModulePath =
|
|
2785
|
+
scopedModulePath = require5.resolve(id);
|
|
2791
2786
|
}
|
|
2792
2787
|
const idWithNativePathSep = id.replace(/\//g, path2.sep);
|
|
2793
2788
|
if (scopedModulePath.endsWith(idWithNativePathSep)) {
|
|
@@ -2818,8 +2813,8 @@ var getCompatibilityAliases = () => {
|
|
|
2818
2813
|
};
|
|
2819
2814
|
|
|
2820
2815
|
// src/plugins/next-mocks/plugin.ts
|
|
2821
|
-
var
|
|
2822
|
-
var getEntryPoint2 = (subPath, env) =>
|
|
2816
|
+
var require6 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('out.js', document.baseURI).href)));
|
|
2817
|
+
var getEntryPoint2 = (subPath, env) => require6.resolve(`${VITEST_PLUGIN_NAME}/${env}/mocks/${subPath}`);
|
|
2823
2818
|
var getAlias2 = (env) => ({
|
|
2824
2819
|
"next/headers": getEntryPoint2("headers", env),
|
|
2825
2820
|
"@storybook/nextjs/headers.mock": getEntryPoint2("headers", env),
|
|
@@ -2847,7 +2842,7 @@ var getAlias2 = (env) => ({
|
|
|
2847
2842
|
"@storybook/nextjs-vite/cache.mock": getEntryPoint2("cache", env),
|
|
2848
2843
|
"@storybook/experimental-nextjs-vite/cache.mock": getEntryPoint2("cache", env),
|
|
2849
2844
|
"server-only": getEntryPoint2("server-only", env),
|
|
2850
|
-
"@opentelemetry/api":
|
|
2845
|
+
"@opentelemetry/api": require6.resolve(
|
|
2851
2846
|
"next/dist/compiled/@opentelemetry/api"
|
|
2852
2847
|
),
|
|
2853
2848
|
"next/dynamic": getEntryPoint2("dynamic", env),
|
|
@@ -2866,7 +2861,7 @@ var vitePluginNextMocks = () => ({
|
|
|
2866
2861
|
});
|
|
2867
2862
|
|
|
2868
2863
|
// src/index.ts
|
|
2869
|
-
var
|
|
2864
|
+
var require7 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('out.js', document.baseURI).href)));
|
|
2870
2865
|
var loadConfig = (
|
|
2871
2866
|
// biome-ignore lint/suspicious/noExplicitAny: CJS support
|
|
2872
2867
|
nextServerConfig__default.default.default || nextServerConfig__default.default
|
|
@@ -2888,33 +2883,33 @@ function VitePlugin({ dir = process.cwd() } = {}) {
|
|
|
2888
2883
|
alias: [
|
|
2889
2884
|
{
|
|
2890
2885
|
find: /^react$/,
|
|
2891
|
-
replacement:
|
|
2886
|
+
replacement: require7.resolve("next/dist/compiled/react")
|
|
2892
2887
|
},
|
|
2893
2888
|
{
|
|
2894
2889
|
find: /^react-dom$/,
|
|
2895
|
-
replacement:
|
|
2890
|
+
replacement: require7.resolve("next/dist/compiled/react-dom")
|
|
2896
2891
|
},
|
|
2897
2892
|
{
|
|
2898
2893
|
find: /^react-dom\/server$/,
|
|
2899
|
-
replacement:
|
|
2894
|
+
replacement: require7.resolve(
|
|
2900
2895
|
"next/dist/compiled/react-dom/server.browser.js"
|
|
2901
2896
|
)
|
|
2902
2897
|
},
|
|
2903
2898
|
{
|
|
2904
2899
|
find: /^react-dom\/test-utils$/,
|
|
2905
|
-
replacement:
|
|
2900
|
+
replacement: require7.resolve(
|
|
2906
2901
|
"next/dist/compiled/react-dom/cjs/react-dom-test-utils.production.js"
|
|
2907
2902
|
)
|
|
2908
2903
|
},
|
|
2909
2904
|
{
|
|
2910
2905
|
find: /^react-dom\/client$/,
|
|
2911
|
-
replacement:
|
|
2906
|
+
replacement: require7.resolve(
|
|
2912
2907
|
"next/dist/compiled/react-dom/client.js"
|
|
2913
2908
|
)
|
|
2914
2909
|
},
|
|
2915
2910
|
{
|
|
2916
2911
|
find: /^react-dom\/cjs\/react-dom\.development\.js$/,
|
|
2917
|
-
replacement:
|
|
2912
|
+
replacement: require7.resolve(
|
|
2918
2913
|
"next/dist/compiled/react-dom/cjs/react-dom.development.js"
|
|
2919
2914
|
)
|
|
2920
2915
|
}
|
|
@@ -2934,26 +2929,26 @@ function VitePlugin({ dir = process.cwd() } = {}) {
|
|
|
2934
2929
|
},
|
|
2935
2930
|
test: {
|
|
2936
2931
|
alias: {
|
|
2937
|
-
"react/jsx-dev-runtime":
|
|
2932
|
+
"react/jsx-dev-runtime": require7.resolve(
|
|
2938
2933
|
"next/dist/compiled/react/jsx-dev-runtime.js"
|
|
2939
2934
|
),
|
|
2940
|
-
"react/jsx-runtime":
|
|
2935
|
+
"react/jsx-runtime": require7.resolve(
|
|
2941
2936
|
"next/dist/compiled/react/jsx-runtime.js"
|
|
2942
2937
|
),
|
|
2943
|
-
react:
|
|
2944
|
-
"react-dom/server":
|
|
2938
|
+
react: require7.resolve("next/dist/compiled/react"),
|
|
2939
|
+
"react-dom/server": require7.resolve(
|
|
2945
2940
|
executionEnvironment === "node" ? "next/dist/compiled/react-dom/server.js" : "next/dist/compiled/react-dom/server.browser.js"
|
|
2946
2941
|
),
|
|
2947
|
-
"react-dom/test-utils":
|
|
2942
|
+
"react-dom/test-utils": require7.resolve(
|
|
2948
2943
|
"next/dist/compiled/react-dom/cjs/react-dom-test-utils.production.js"
|
|
2949
2944
|
),
|
|
2950
|
-
"react-dom/cjs/react-dom.development.js":
|
|
2945
|
+
"react-dom/cjs/react-dom.development.js": require7.resolve(
|
|
2951
2946
|
"next/dist/compiled/react-dom/cjs/react-dom.development.js"
|
|
2952
2947
|
),
|
|
2953
|
-
"react-dom/client":
|
|
2948
|
+
"react-dom/client": require7.resolve(
|
|
2954
2949
|
"next/dist/compiled/react-dom/client.js"
|
|
2955
2950
|
),
|
|
2956
|
-
"react-dom":
|
|
2951
|
+
"react-dom": require7.resolve("next/dist/compiled/react-dom")
|
|
2957
2952
|
}
|
|
2958
2953
|
}
|
|
2959
2954
|
};
|
|
@@ -2961,7 +2956,7 @@ function VitePlugin({ dir = process.cwd() } = {}) {
|
|
|
2961
2956
|
configResolved(config) {
|
|
2962
2957
|
if (isVitestEnv && !config.test?.browser?.enabled) {
|
|
2963
2958
|
config.test.setupFiles = [
|
|
2964
|
-
|
|
2959
|
+
require7.resolve("./mocks/storybook.global.js"),
|
|
2965
2960
|
...config.test?.setupFiles ?? []
|
|
2966
2961
|
];
|
|
2967
2962
|
}
|
package/dist/index.js
CHANGED
|
@@ -31,13 +31,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
31
31
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
32
32
|
var __getProtoOf = Object.getPrototypeOf;
|
|
33
33
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
34
|
-
var
|
|
35
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
36
|
-
}) : x)(function(x) {
|
|
37
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
38
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
39
|
-
});
|
|
40
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
34
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
41
35
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
42
36
|
};
|
|
43
37
|
var __copyProps = (to, from, except, desc) => {
|
|
@@ -2747,13 +2741,14 @@ function vitePluginNextImage(nextConfigResolver) {
|
|
|
2747
2741
|
|
|
2748
2742
|
// src/plugins/next-mocks/compatibility/compatibility-map.ts
|
|
2749
2743
|
var import_semver = __toESM(require_semver2());
|
|
2750
|
-
var
|
|
2744
|
+
var require5 = createRequire(import.meta.url);
|
|
2745
|
+
var getNextjsVersion = () => require5(scopedResolve("next/package.json")).version;
|
|
2751
2746
|
var scopedResolve = (id) => {
|
|
2752
2747
|
let scopedModulePath;
|
|
2753
2748
|
try {
|
|
2754
|
-
scopedModulePath =
|
|
2749
|
+
scopedModulePath = require5.resolve(id, { paths: [resolve()] });
|
|
2755
2750
|
} catch (e) {
|
|
2756
|
-
scopedModulePath =
|
|
2751
|
+
scopedModulePath = require5.resolve(id);
|
|
2757
2752
|
}
|
|
2758
2753
|
const idWithNativePathSep = id.replace(/\//g, sep);
|
|
2759
2754
|
if (scopedModulePath.endsWith(idWithNativePathSep)) {
|
|
@@ -2784,8 +2779,8 @@ var getCompatibilityAliases = () => {
|
|
|
2784
2779
|
};
|
|
2785
2780
|
|
|
2786
2781
|
// src/plugins/next-mocks/plugin.ts
|
|
2787
|
-
var
|
|
2788
|
-
var getEntryPoint2 = (subPath, env) =>
|
|
2782
|
+
var require6 = createRequire(import.meta.url);
|
|
2783
|
+
var getEntryPoint2 = (subPath, env) => require6.resolve(`${VITEST_PLUGIN_NAME}/${env}/mocks/${subPath}`);
|
|
2789
2784
|
var getAlias2 = (env) => ({
|
|
2790
2785
|
"next/headers": getEntryPoint2("headers", env),
|
|
2791
2786
|
"@storybook/nextjs/headers.mock": getEntryPoint2("headers", env),
|
|
@@ -2813,7 +2808,7 @@ var getAlias2 = (env) => ({
|
|
|
2813
2808
|
"@storybook/nextjs-vite/cache.mock": getEntryPoint2("cache", env),
|
|
2814
2809
|
"@storybook/experimental-nextjs-vite/cache.mock": getEntryPoint2("cache", env),
|
|
2815
2810
|
"server-only": getEntryPoint2("server-only", env),
|
|
2816
|
-
"@opentelemetry/api":
|
|
2811
|
+
"@opentelemetry/api": require6.resolve(
|
|
2817
2812
|
"next/dist/compiled/@opentelemetry/api"
|
|
2818
2813
|
),
|
|
2819
2814
|
"next/dynamic": getEntryPoint2("dynamic", env),
|
|
@@ -2832,7 +2827,7 @@ var vitePluginNextMocks = () => ({
|
|
|
2832
2827
|
});
|
|
2833
2828
|
|
|
2834
2829
|
// src/index.ts
|
|
2835
|
-
var
|
|
2830
|
+
var require7 = createRequire(import.meta.url);
|
|
2836
2831
|
var loadConfig = (
|
|
2837
2832
|
// biome-ignore lint/suspicious/noExplicitAny: CJS support
|
|
2838
2833
|
nextServerConfig.default || nextServerConfig
|
|
@@ -2854,33 +2849,33 @@ function VitePlugin({ dir = process.cwd() } = {}) {
|
|
|
2854
2849
|
alias: [
|
|
2855
2850
|
{
|
|
2856
2851
|
find: /^react$/,
|
|
2857
|
-
replacement:
|
|
2852
|
+
replacement: require7.resolve("next/dist/compiled/react")
|
|
2858
2853
|
},
|
|
2859
2854
|
{
|
|
2860
2855
|
find: /^react-dom$/,
|
|
2861
|
-
replacement:
|
|
2856
|
+
replacement: require7.resolve("next/dist/compiled/react-dom")
|
|
2862
2857
|
},
|
|
2863
2858
|
{
|
|
2864
2859
|
find: /^react-dom\/server$/,
|
|
2865
|
-
replacement:
|
|
2860
|
+
replacement: require7.resolve(
|
|
2866
2861
|
"next/dist/compiled/react-dom/server.browser.js"
|
|
2867
2862
|
)
|
|
2868
2863
|
},
|
|
2869
2864
|
{
|
|
2870
2865
|
find: /^react-dom\/test-utils$/,
|
|
2871
|
-
replacement:
|
|
2866
|
+
replacement: require7.resolve(
|
|
2872
2867
|
"next/dist/compiled/react-dom/cjs/react-dom-test-utils.production.js"
|
|
2873
2868
|
)
|
|
2874
2869
|
},
|
|
2875
2870
|
{
|
|
2876
2871
|
find: /^react-dom\/client$/,
|
|
2877
|
-
replacement:
|
|
2872
|
+
replacement: require7.resolve(
|
|
2878
2873
|
"next/dist/compiled/react-dom/client.js"
|
|
2879
2874
|
)
|
|
2880
2875
|
},
|
|
2881
2876
|
{
|
|
2882
2877
|
find: /^react-dom\/cjs\/react-dom\.development\.js$/,
|
|
2883
|
-
replacement:
|
|
2878
|
+
replacement: require7.resolve(
|
|
2884
2879
|
"next/dist/compiled/react-dom/cjs/react-dom.development.js"
|
|
2885
2880
|
)
|
|
2886
2881
|
}
|
|
@@ -2900,26 +2895,26 @@ function VitePlugin({ dir = process.cwd() } = {}) {
|
|
|
2900
2895
|
},
|
|
2901
2896
|
test: {
|
|
2902
2897
|
alias: {
|
|
2903
|
-
"react/jsx-dev-runtime":
|
|
2898
|
+
"react/jsx-dev-runtime": require7.resolve(
|
|
2904
2899
|
"next/dist/compiled/react/jsx-dev-runtime.js"
|
|
2905
2900
|
),
|
|
2906
|
-
"react/jsx-runtime":
|
|
2901
|
+
"react/jsx-runtime": require7.resolve(
|
|
2907
2902
|
"next/dist/compiled/react/jsx-runtime.js"
|
|
2908
2903
|
),
|
|
2909
|
-
react:
|
|
2910
|
-
"react-dom/server":
|
|
2904
|
+
react: require7.resolve("next/dist/compiled/react"),
|
|
2905
|
+
"react-dom/server": require7.resolve(
|
|
2911
2906
|
executionEnvironment === "node" ? "next/dist/compiled/react-dom/server.js" : "next/dist/compiled/react-dom/server.browser.js"
|
|
2912
2907
|
),
|
|
2913
|
-
"react-dom/test-utils":
|
|
2908
|
+
"react-dom/test-utils": require7.resolve(
|
|
2914
2909
|
"next/dist/compiled/react-dom/cjs/react-dom-test-utils.production.js"
|
|
2915
2910
|
),
|
|
2916
|
-
"react-dom/cjs/react-dom.development.js":
|
|
2911
|
+
"react-dom/cjs/react-dom.development.js": require7.resolve(
|
|
2917
2912
|
"next/dist/compiled/react-dom/cjs/react-dom.development.js"
|
|
2918
2913
|
),
|
|
2919
|
-
"react-dom/client":
|
|
2914
|
+
"react-dom/client": require7.resolve(
|
|
2920
2915
|
"next/dist/compiled/react-dom/client.js"
|
|
2921
2916
|
),
|
|
2922
|
-
"react-dom":
|
|
2917
|
+
"react-dom": require7.resolve("next/dist/compiled/react-dom")
|
|
2923
2918
|
}
|
|
2924
2919
|
}
|
|
2925
2920
|
};
|
|
@@ -2927,7 +2922,7 @@ function VitePlugin({ dir = process.cwd() } = {}) {
|
|
|
2927
2922
|
configResolved(config) {
|
|
2928
2923
|
if (isVitestEnv && !config.test?.browser?.enabled) {
|
|
2929
2924
|
config.test.setupFiles = [
|
|
2930
|
-
|
|
2925
|
+
require7.resolve("./mocks/storybook.global.js"),
|
|
2931
2926
|
...config.test?.setupFiles ?? []
|
|
2932
2927
|
];
|
|
2933
2928
|
}
|
|
@@ -15,13 +15,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
15
15
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
16
16
|
var __getProtoOf = Object.getPrototypeOf;
|
|
17
17
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
18
|
-
var
|
|
19
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
20
|
-
}) : x)(function(x) {
|
|
21
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
22
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
23
|
-
});
|
|
24
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
18
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
25
19
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
26
20
|
};
|
|
27
21
|
var __copyProps = (to, from, except, desc) => {
|
|
@@ -1897,13 +1891,14 @@ var getAlias = (env) => ({
|
|
|
1897
1891
|
|
|
1898
1892
|
// src/plugins/next-mocks/compatibility/compatibility-map.ts
|
|
1899
1893
|
var import_semver = __toESM(require_semver2());
|
|
1900
|
-
var
|
|
1894
|
+
var require3 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('out.js', document.baseURI).href)));
|
|
1895
|
+
var getNextjsVersion = () => require3(scopedResolve("next/package.json")).version;
|
|
1901
1896
|
var scopedResolve = (id) => {
|
|
1902
1897
|
let scopedModulePath;
|
|
1903
1898
|
try {
|
|
1904
|
-
scopedModulePath =
|
|
1899
|
+
scopedModulePath = require3.resolve(id, { paths: [path.resolve()] });
|
|
1905
1900
|
} catch (e) {
|
|
1906
|
-
scopedModulePath =
|
|
1901
|
+
scopedModulePath = require3.resolve(id);
|
|
1907
1902
|
}
|
|
1908
1903
|
const idWithNativePathSep = id.replace(/\//g, path.sep);
|
|
1909
1904
|
if (scopedModulePath.endsWith(idWithNativePathSep)) {
|
|
@@ -1934,8 +1929,8 @@ var getCompatibilityAliases = () => {
|
|
|
1934
1929
|
};
|
|
1935
1930
|
|
|
1936
1931
|
// src/plugins/next-mocks/plugin.ts
|
|
1937
|
-
var
|
|
1938
|
-
var getEntryPoint2 = (subPath, env) =>
|
|
1932
|
+
var require4 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('out.js', document.baseURI).href)));
|
|
1933
|
+
var getEntryPoint2 = (subPath, env) => require4.resolve(`${VITEST_PLUGIN_NAME}/${env}/mocks/${subPath}`);
|
|
1939
1934
|
var getAlias2 = (env) => ({
|
|
1940
1935
|
"next/headers": getEntryPoint2("headers", env),
|
|
1941
1936
|
"@storybook/nextjs/headers.mock": getEntryPoint2("headers", env),
|
|
@@ -1963,7 +1958,7 @@ var getAlias2 = (env) => ({
|
|
|
1963
1958
|
"@storybook/nextjs-vite/cache.mock": getEntryPoint2("cache", env),
|
|
1964
1959
|
"@storybook/experimental-nextjs-vite/cache.mock": getEntryPoint2("cache", env),
|
|
1965
1960
|
"server-only": getEntryPoint2("server-only", env),
|
|
1966
|
-
"@opentelemetry/api":
|
|
1961
|
+
"@opentelemetry/api": require4.resolve(
|
|
1967
1962
|
"next/dist/compiled/@opentelemetry/api"
|
|
1968
1963
|
),
|
|
1969
1964
|
"next/dynamic": getEntryPoint2("dynamic", env),
|
|
@@ -1971,11 +1966,11 @@ var getAlias2 = (env) => ({
|
|
|
1971
1966
|
});
|
|
1972
1967
|
|
|
1973
1968
|
// src/mocks/storybook.global.ts
|
|
1974
|
-
var
|
|
1969
|
+
var require5 = module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('out.js', document.baseURI).href)));
|
|
1975
1970
|
moduleAlias__default.default.addAliases({
|
|
1976
1971
|
react: "next/dist/compiled/react",
|
|
1977
1972
|
"react-dom/server": "next/dist/compiled/react-dom/server.js",
|
|
1978
|
-
"react-dom/test-utils":
|
|
1973
|
+
"react-dom/test-utils": require5.resolve(
|
|
1979
1974
|
"next/dist/compiled/react-dom/cjs/react-dom-test-utils.production.js"
|
|
1980
1975
|
),
|
|
1981
1976
|
"react-dom": "next/dist/compiled/react-dom",
|
|
@@ -8,13 +8,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
8
8
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
9
|
var __getProtoOf = Object.getPrototypeOf;
|
|
10
10
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var
|
|
12
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
13
|
-
}) : x)(function(x) {
|
|
14
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
15
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
16
|
-
});
|
|
17
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
11
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
18
12
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
19
13
|
};
|
|
20
14
|
var __copyProps = (to, from, except, desc) => {
|
|
@@ -1890,13 +1884,14 @@ var getAlias = (env) => ({
|
|
|
1890
1884
|
|
|
1891
1885
|
// src/plugins/next-mocks/compatibility/compatibility-map.ts
|
|
1892
1886
|
var import_semver = __toESM(require_semver2());
|
|
1893
|
-
var
|
|
1887
|
+
var require3 = createRequire(import.meta.url);
|
|
1888
|
+
var getNextjsVersion = () => require3(scopedResolve("next/package.json")).version;
|
|
1894
1889
|
var scopedResolve = (id) => {
|
|
1895
1890
|
let scopedModulePath;
|
|
1896
1891
|
try {
|
|
1897
|
-
scopedModulePath =
|
|
1892
|
+
scopedModulePath = require3.resolve(id, { paths: [resolve()] });
|
|
1898
1893
|
} catch (e) {
|
|
1899
|
-
scopedModulePath =
|
|
1894
|
+
scopedModulePath = require3.resolve(id);
|
|
1900
1895
|
}
|
|
1901
1896
|
const idWithNativePathSep = id.replace(/\//g, sep);
|
|
1902
1897
|
if (scopedModulePath.endsWith(idWithNativePathSep)) {
|
|
@@ -1927,8 +1922,8 @@ var getCompatibilityAliases = () => {
|
|
|
1927
1922
|
};
|
|
1928
1923
|
|
|
1929
1924
|
// src/plugins/next-mocks/plugin.ts
|
|
1930
|
-
var
|
|
1931
|
-
var getEntryPoint2 = (subPath, env) =>
|
|
1925
|
+
var require4 = createRequire(import.meta.url);
|
|
1926
|
+
var getEntryPoint2 = (subPath, env) => require4.resolve(`${VITEST_PLUGIN_NAME}/${env}/mocks/${subPath}`);
|
|
1932
1927
|
var getAlias2 = (env) => ({
|
|
1933
1928
|
"next/headers": getEntryPoint2("headers", env),
|
|
1934
1929
|
"@storybook/nextjs/headers.mock": getEntryPoint2("headers", env),
|
|
@@ -1956,7 +1951,7 @@ var getAlias2 = (env) => ({
|
|
|
1956
1951
|
"@storybook/nextjs-vite/cache.mock": getEntryPoint2("cache", env),
|
|
1957
1952
|
"@storybook/experimental-nextjs-vite/cache.mock": getEntryPoint2("cache", env),
|
|
1958
1953
|
"server-only": getEntryPoint2("server-only", env),
|
|
1959
|
-
"@opentelemetry/api":
|
|
1954
|
+
"@opentelemetry/api": require4.resolve(
|
|
1960
1955
|
"next/dist/compiled/@opentelemetry/api"
|
|
1961
1956
|
),
|
|
1962
1957
|
"next/dynamic": getEntryPoint2("dynamic", env),
|
|
@@ -1964,11 +1959,11 @@ var getAlias2 = (env) => ({
|
|
|
1964
1959
|
});
|
|
1965
1960
|
|
|
1966
1961
|
// src/mocks/storybook.global.ts
|
|
1967
|
-
var
|
|
1962
|
+
var require5 = createRequire(import.meta.url);
|
|
1968
1963
|
moduleAlias.addAliases({
|
|
1969
1964
|
react: "next/dist/compiled/react",
|
|
1970
1965
|
"react-dom/server": "next/dist/compiled/react-dom/server.js",
|
|
1971
|
-
"react-dom/test-utils":
|
|
1966
|
+
"react-dom/test-utils": require5.resolve(
|
|
1972
1967
|
"next/dist/compiled/react-dom/cjs/react-dom-test-utils.production.js"
|
|
1973
1968
|
),
|
|
1974
1969
|
"react-dom": "next/dist/compiled/react-dom",
|