@storybook/nextjs 10.1.0-alpha.9 → 10.1.0-beta.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/_browser-chunks/{chunk-KX5HHFXV.js → chunk-2SBZPHE7.js} +50 -100
- package/dist/_browser-chunks/chunk-RDMFII4N.js +22 -0
- package/dist/_browser-chunks/{chunk-L5NVL7MD.js → chunk-SL3VIQZ3.js} +7 -13
- package/dist/_browser-chunks/react-18-PYSEDAWB.js +43 -0
- package/dist/_node-chunks/chunk-AU547LNK.js +76 -0
- package/dist/_node-chunks/chunk-EONFLREF.js +57 -0
- package/dist/_node-chunks/chunk-NVHRUSN5.js +211 -0
- package/dist/_node-chunks/configureNextFont-3RPVM2N7.js +28 -0
- package/dist/_node-chunks/{loader-7OJQICYP.js → loader-PBLFQE7I.js} +15 -25
- package/dist/_node-chunks/{loader-OFLGZQCU.js → loader-UX42M74F.js} +11 -16
- package/dist/_node-chunks/{utils-NVB3HGRH.js → utils-MPWEOWV4.js} +8 -9
- package/dist/_node-chunks/webpack-5IZRQF33.js +23 -0
- package/dist/_node-chunks/{webpack-E2OB2ZPW.js → webpack-C4DEBGCG.js} +13 -19
- package/dist/_node-chunks/webpack-EFCFZKO7.js +97 -0
- package/dist/_node-chunks/{webpack-VD3FKUZZ.js → webpack-KW7MEY7C.js} +9 -12
- package/dist/_node-chunks/webpack-TVYIGXMK.js +24 -0
- package/dist/_node-chunks/webpack-UAKFJEYJ.js +30 -0
- package/dist/_node-chunks/webpack-WL4FYVO5.js +23 -0
- package/dist/_node-chunks/webpack-WZC6ZANM.js +60 -0
- package/dist/compatibility/draft-mode.compat.js +1 -1
- package/dist/export-mocks/cache/index.js +3 -6
- package/dist/export-mocks/headers/index.js +6 -29
- package/dist/export-mocks/index.js +9 -10
- package/dist/export-mocks/navigation/index.js +17 -41
- package/dist/export-mocks/router/index.d.ts +4 -7
- package/dist/export-mocks/router/index.js +20 -54
- package/dist/font/webpack/loader/storybook-nextjs-font-loader.js +38 -80
- package/dist/image-context.js +1 -1
- package/dist/images/next-image.js +5 -11
- package/dist/images/next-legacy-image.js +3 -6
- package/dist/index.js +2865 -8413
- package/dist/next-image-loader-stub.js +9 -16
- package/dist/node/index.js +6 -10
- package/dist/preset.js +183 -462
- package/dist/preview.js +2 -2
- package/dist/rsc/server-only.js +1 -1
- package/dist/swc/next-swc-loader-patch.js +46 -84
- package/package.json +6 -6
- package/dist/_browser-chunks/chunk-I5RFHXDS.js +0 -40
- package/dist/_browser-chunks/react-18-G7Q4PNHD.js +0 -71
- package/dist/_node-chunks/chunk-PWZWGY6W.js +0 -17
- package/dist/_node-chunks/chunk-UHO3ELD2.js +0 -475
- package/dist/_node-chunks/chunk-WR63XCFA.js +0 -74
- package/dist/_node-chunks/chunk-X47EC6DB.js +0 -102
- package/dist/_node-chunks/configureNextFont-ZL3UHKQ4.js +0 -36
- package/dist/_node-chunks/webpack-3J2WBZ2E.js +0 -30
- package/dist/_node-chunks/webpack-7PUWUCNJ.js +0 -27
- package/dist/_node-chunks/webpack-JVSODHFI.js +0 -38
- package/dist/_node-chunks/webpack-O36IRAFL.js +0 -77
- package/dist/_node-chunks/webpack-SNP77BVT.js +0 -107
- package/dist/_node-chunks/webpack-THQBX5DA.js +0 -26
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_mt98813ktw from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_mt98813ktw from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_mt98813ktw from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_mt98813ktw.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_mt98813ktw.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_mt98813ktw.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
__name
|
|
14
|
-
} from "./chunk-PWZWGY6W.js";
|
|
15
|
-
|
|
16
|
-
// src/nodePolyfills/webpack.ts
|
|
17
|
-
import NodePolyfillPlugin from "node-polyfill-webpack-plugin";
|
|
18
|
-
var configureNodePolyfills = /* @__PURE__ */ __name((baseConfig) => {
|
|
19
|
-
baseConfig.plugins = [...baseConfig.plugins || [], new NodePolyfillPlugin()];
|
|
20
|
-
baseConfig.resolve = {
|
|
21
|
-
...baseConfig.resolve,
|
|
22
|
-
fallback: {
|
|
23
|
-
fs: false
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
return baseConfig;
|
|
27
|
-
}, "configureNodePolyfills");
|
|
28
|
-
export {
|
|
29
|
-
configureNodePolyfills
|
|
30
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_mt98813ktw from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_mt98813ktw from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_mt98813ktw from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_mt98813ktw.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_mt98813ktw.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_mt98813ktw.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
__name
|
|
14
|
-
} from "./chunk-PWZWGY6W.js";
|
|
15
|
-
|
|
16
|
-
// src/rsc/webpack.ts
|
|
17
|
-
import { fileURLToPath } from "node:url";
|
|
18
|
-
var configureRSC = /* @__PURE__ */ __name((baseConfig) => {
|
|
19
|
-
const resolve = baseConfig.resolve ?? {};
|
|
20
|
-
resolve.alias = {
|
|
21
|
-
...resolve.alias,
|
|
22
|
-
"server-only$": fileURLToPath(import.meta.resolve("@storybook/nextjs/rsc/server-only"))
|
|
23
|
-
};
|
|
24
|
-
}, "configureRSC");
|
|
25
|
-
export {
|
|
26
|
-
configureRSC
|
|
27
|
-
};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_mt98813ktw from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_mt98813ktw from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_mt98813ktw from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_mt98813ktw.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_mt98813ktw.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_mt98813ktw.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
__name
|
|
14
|
-
} from "./chunk-PWZWGY6W.js";
|
|
15
|
-
|
|
16
|
-
// src/imports/webpack.ts
|
|
17
|
-
import { loadConfig } from "tsconfig-paths";
|
|
18
|
-
import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin";
|
|
19
|
-
var configureImports = /* @__PURE__ */ __name(({
|
|
20
|
-
baseConfig,
|
|
21
|
-
configDir
|
|
22
|
-
}) => {
|
|
23
|
-
const configLoadResult = loadConfig(configDir);
|
|
24
|
-
if (configLoadResult.resultType === "failed") {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
baseConfig.resolve ??= {};
|
|
28
|
-
baseConfig.resolve.plugins ??= [];
|
|
29
|
-
baseConfig.resolve.plugins.push(
|
|
30
|
-
new TsconfigPathsPlugin({
|
|
31
|
-
configFile: configLoadResult.configFileAbsolutePath,
|
|
32
|
-
extensions: [".js", ".jsx", ".ts", ".tsx"]
|
|
33
|
-
})
|
|
34
|
-
);
|
|
35
|
-
}, "configureImports");
|
|
36
|
-
export {
|
|
37
|
-
configureImports
|
|
38
|
-
};
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_mt98813ktw from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_mt98813ktw from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_mt98813ktw from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_mt98813ktw.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_mt98813ktw.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_mt98813ktw.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
getNextjsVersion
|
|
14
|
-
} from "./chunk-X47EC6DB.js";
|
|
15
|
-
import "./chunk-UHO3ELD2.js";
|
|
16
|
-
import {
|
|
17
|
-
__name
|
|
18
|
-
} from "./chunk-PWZWGY6W.js";
|
|
19
|
-
|
|
20
|
-
// src/images/webpack.ts
|
|
21
|
-
import { fileURLToPath } from "node:url";
|
|
22
|
-
import semver from "semver";
|
|
23
|
-
var configureImages = /* @__PURE__ */ __name((baseConfig, nextConfig) => {
|
|
24
|
-
configureStaticImageImport(baseConfig, nextConfig);
|
|
25
|
-
configureImageDefaults(baseConfig);
|
|
26
|
-
}, "configureImages");
|
|
27
|
-
var fallbackFilename = "static/media/[path][name][ext]";
|
|
28
|
-
var configureImageDefaults = /* @__PURE__ */ __name((baseConfig) => {
|
|
29
|
-
const version = getNextjsVersion();
|
|
30
|
-
const resolve = baseConfig.resolve ?? {};
|
|
31
|
-
resolve.alias = {
|
|
32
|
-
...resolve.alias,
|
|
33
|
-
"sb-original/next/image": fileURLToPath(import.meta.resolve("next/image")),
|
|
34
|
-
"next/image": "@storybook/nextjs/images/next-image"
|
|
35
|
-
};
|
|
36
|
-
if (semver.satisfies(version, ">=13.0.0")) {
|
|
37
|
-
resolve.alias = {
|
|
38
|
-
...resolve.alias,
|
|
39
|
-
"sb-original/next/legacy/image": fileURLToPath(import.meta.resolve("next/legacy/image")),
|
|
40
|
-
"next/legacy/image": "@storybook/nextjs/images/next-legacy-image"
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
}, "configureImageDefaults");
|
|
44
|
-
var configureStaticImageImport = /* @__PURE__ */ __name((baseConfig, nextConfig) => {
|
|
45
|
-
const rules = baseConfig.module?.rules;
|
|
46
|
-
const assetRule = rules?.find(
|
|
47
|
-
(rule) => rule && typeof rule !== "string" && rule.test instanceof RegExp && rule.test.test("test.jpg")
|
|
48
|
-
);
|
|
49
|
-
if (!assetRule) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
assetRule.test = /\.(apng|eot|otf|ttf|woff|woff2|cur|ani|pdf)(\?.*)?$/;
|
|
53
|
-
rules?.push({
|
|
54
|
-
test: /\.(png|jpg|jpeg|gif|webp|avif|ico|bmp|svg)$/i,
|
|
55
|
-
issuer: { not: /\.(css|scss|sass)$/ },
|
|
56
|
-
use: [
|
|
57
|
-
{
|
|
58
|
-
loader: fileURLToPath(import.meta.resolve("@storybook/nextjs/next-image-loader-stub")),
|
|
59
|
-
options: {
|
|
60
|
-
filename: assetRule.generator?.filename ?? fallbackFilename,
|
|
61
|
-
nextConfig
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
]
|
|
65
|
-
});
|
|
66
|
-
rules?.push({
|
|
67
|
-
test: /\.(png|jpg|jpeg|gif|webp|avif|ico|bmp|svg)$/i,
|
|
68
|
-
issuer: /\.(css|scss|sass)$/,
|
|
69
|
-
type: "asset/resource",
|
|
70
|
-
generator: {
|
|
71
|
-
filename: assetRule.generator?.filename ?? fallbackFilename
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}, "configureStaticImageImport");
|
|
75
|
-
export {
|
|
76
|
-
configureImages
|
|
77
|
-
};
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_mt98813ktw from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_mt98813ktw from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_mt98813ktw from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_mt98813ktw.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_mt98813ktw.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_mt98813ktw.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
resolvePackageDir
|
|
14
|
-
} from "./chunk-UHO3ELD2.js";
|
|
15
|
-
import {
|
|
16
|
-
__name
|
|
17
|
-
} from "./chunk-PWZWGY6W.js";
|
|
18
|
-
|
|
19
|
-
// src/css/webpack.ts
|
|
20
|
-
import { readFileSync } from "node:fs";
|
|
21
|
-
import { join } from "node:path";
|
|
22
|
-
import { fileURLToPath } from "node:url";
|
|
23
|
-
import { cssFileResolve } from "next/dist/build/webpack/config/blocks/css/loaders/file-resolve.js";
|
|
24
|
-
import { getCssModuleLocalIdent } from "next/dist/build/webpack/config/blocks/css/loaders/getCssModuleLocalIdent.js";
|
|
25
|
-
import semver from "semver";
|
|
26
|
-
var configureCss = /* @__PURE__ */ __name((baseConfig, nextConfig) => {
|
|
27
|
-
const rules = baseConfig.module?.rules;
|
|
28
|
-
rules?.forEach((rule, i) => {
|
|
29
|
-
if (rule && typeof rule !== "string" && rule.test instanceof RegExp && rule.test.test("test.css")) {
|
|
30
|
-
rules[i] = {
|
|
31
|
-
test: /\.css$/,
|
|
32
|
-
use: [
|
|
33
|
-
fileURLToPath(import.meta.resolve("style-loader")),
|
|
34
|
-
{
|
|
35
|
-
loader: fileURLToPath(import.meta.resolve("css-loader")),
|
|
36
|
-
options: {
|
|
37
|
-
importLoaders: 1,
|
|
38
|
-
...getImportAndUrlCssLoaderOptions(nextConfig),
|
|
39
|
-
modules: {
|
|
40
|
-
auto: true,
|
|
41
|
-
getLocalIdent: getCssModuleLocalIdent
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
fileURLToPath(import.meta.resolve("postcss-loader"))
|
|
46
|
-
],
|
|
47
|
-
// We transform the "target.css" files from next.js into Javascript
|
|
48
|
-
// for Next.js to support fonts, so it should be ignored by the css-loader.
|
|
49
|
-
exclude: /next(\\|\/|\\\\).*(\\|\/|\\\\)target\.css$/
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
rules?.push({
|
|
54
|
-
test: /\.(scss|sass)$/,
|
|
55
|
-
use: [
|
|
56
|
-
fileURLToPath(import.meta.resolve("style-loader")),
|
|
57
|
-
{
|
|
58
|
-
loader: fileURLToPath(import.meta.resolve("css-loader")),
|
|
59
|
-
options: {
|
|
60
|
-
importLoaders: 3,
|
|
61
|
-
...getImportAndUrlCssLoaderOptions(nextConfig),
|
|
62
|
-
modules: { auto: true, getLocalIdent: getCssModuleLocalIdent }
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
fileURLToPath(import.meta.resolve("postcss-loader")),
|
|
66
|
-
fileURLToPath(import.meta.resolve("resolve-url-loader")),
|
|
67
|
-
{
|
|
68
|
-
loader: fileURLToPath(import.meta.resolve("sass-loader")),
|
|
69
|
-
options: {
|
|
70
|
-
sourceMap: true,
|
|
71
|
-
sassOptions: nextConfig.sassOptions,
|
|
72
|
-
additionalData: nextConfig.sassOptions?.prependData || nextConfig.sassOptions?.additionalData
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
});
|
|
77
|
-
}, "configureCss");
|
|
78
|
-
var getImportAndUrlCssLoaderOptions = /* @__PURE__ */ __name((nextConfig) => isCssLoaderV6() ? {
|
|
79
|
-
url: {
|
|
80
|
-
filter: getUrlResolver(nextConfig)
|
|
81
|
-
},
|
|
82
|
-
import: {
|
|
83
|
-
filter: getImportResolver(nextConfig)
|
|
84
|
-
}
|
|
85
|
-
} : {
|
|
86
|
-
url: getUrlResolver(nextConfig),
|
|
87
|
-
import: getImportResolver(nextConfig)
|
|
88
|
-
}, "getImportAndUrlCssLoaderOptions");
|
|
89
|
-
var getUrlResolver = /* @__PURE__ */ __name((nextConfig) => (url, resourcePath) => cssFileResolve(url, resourcePath, nextConfig.experimental?.urlImports), "getUrlResolver");
|
|
90
|
-
var getImportResolver = /* @__PURE__ */ __name((nextConfig) => (url, _, resourcePath) => cssFileResolve(
|
|
91
|
-
typeof url === "string" ? url : url.url,
|
|
92
|
-
resourcePath,
|
|
93
|
-
nextConfig.experimental?.urlImports
|
|
94
|
-
), "getImportResolver");
|
|
95
|
-
var isCssLoaderV6 = /* @__PURE__ */ __name(() => {
|
|
96
|
-
try {
|
|
97
|
-
const cssLoaderVersion = JSON.parse(
|
|
98
|
-
readFileSync(join(resolvePackageDir("css-loader"), "package.json"), "utf8")
|
|
99
|
-
).version;
|
|
100
|
-
return semver.gte(cssLoaderVersion, "6.0.0");
|
|
101
|
-
} catch {
|
|
102
|
-
return false;
|
|
103
|
-
}
|
|
104
|
-
}, "isCssLoaderV6");
|
|
105
|
-
export {
|
|
106
|
-
configureCss
|
|
107
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import CJS_COMPAT_NODE_URL_mt98813ktw from 'node:url';
|
|
2
|
-
import CJS_COMPAT_NODE_PATH_mt98813ktw from 'node:path';
|
|
3
|
-
import CJS_COMPAT_NODE_MODULE_mt98813ktw from "node:module";
|
|
4
|
-
|
|
5
|
-
var __filename = CJS_COMPAT_NODE_URL_mt98813ktw.fileURLToPath(import.meta.url);
|
|
6
|
-
var __dirname = CJS_COMPAT_NODE_PATH_mt98813ktw.dirname(__filename);
|
|
7
|
-
var require = CJS_COMPAT_NODE_MODULE_mt98813ktw.createRequire(import.meta.url);
|
|
8
|
-
|
|
9
|
-
// ------------------------------------------------------------
|
|
10
|
-
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
-
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
addScopedAlias
|
|
14
|
-
} from "./chunk-X47EC6DB.js";
|
|
15
|
-
import "./chunk-UHO3ELD2.js";
|
|
16
|
-
import {
|
|
17
|
-
__name
|
|
18
|
-
} from "./chunk-PWZWGY6W.js";
|
|
19
|
-
|
|
20
|
-
// src/styledJsx/webpack.ts
|
|
21
|
-
var configureStyledJsx = /* @__PURE__ */ __name((baseConfig) => {
|
|
22
|
-
addScopedAlias(baseConfig, "styled-jsx");
|
|
23
|
-
}, "configureStyledJsx");
|
|
24
|
-
export {
|
|
25
|
-
configureStyledJsx
|
|
26
|
-
};
|