@storybook/nextjs 10.1.0-alpha.10 → 10.1.0-alpha.12
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-I5MJCTYB.js +205 -0
- package/dist/_node-chunks/chunk-JAEO4VGQ.js +57 -0
- package/dist/_node-chunks/chunk-SPI7THNW.js +76 -0
- package/dist/_node-chunks/configureNextFont-P3MJYT64.js +28 -0
- package/dist/_node-chunks/{loader-UJGK53PP.js → loader-3IYHA3WU.js} +15 -25
- package/dist/_node-chunks/{loader-WPDBQYKQ.js → loader-UMVQYXEA.js} +11 -16
- package/dist/_node-chunks/{utils-G77XBOCW.js → utils-GZ6CYSKH.js} +8 -9
- package/dist/_node-chunks/webpack-46LSIGW4.js +30 -0
- package/dist/_node-chunks/webpack-4NLNKMAN.js +23 -0
- package/dist/_node-chunks/webpack-M24ZHGEQ.js +24 -0
- package/dist/_node-chunks/webpack-SAA5HZ6G.js +97 -0
- package/dist/_node-chunks/webpack-WRQPCAQU.js +23 -0
- package/dist/_node-chunks/{webpack-AIYB3HRJ.js → webpack-WSIHU2O4.js} +13 -19
- package/dist/_node-chunks/{webpack-QCUACIS6.js → webpack-XBSB4YQC.js} +9 -12
- package/dist/_node-chunks/webpack-XOZBU654.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-2ADK3PCH.js +0 -74
- package/dist/_node-chunks/chunk-EVMWO5FG.js +0 -102
- package/dist/_node-chunks/chunk-RSBRC6AY.js +0 -475
- package/dist/_node-chunks/chunk-Z2RESD5M.js +0 -17
- package/dist/_node-chunks/configureNextFont-ZETH4V45.js +0 -36
- package/dist/_node-chunks/webpack-4ZO2PLAG.js +0 -107
- package/dist/_node-chunks/webpack-6QTUYRFB.js +0 -30
- package/dist/_node-chunks/webpack-KRJ4EWQZ.js +0 -27
- package/dist/_node-chunks/webpack-L5YFG573.js +0 -38
- package/dist/_node-chunks/webpack-QPCUFYIY.js +0 -77
- package/dist/_node-chunks/webpack-R5RMXZWI.js +0 -26
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hgmz08r9eac from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hgmz08r9eac from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hgmz08r9eac from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hgmz08r9eac.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hgmz08r9eac.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hgmz08r9eac.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-I5MJCTYB.js";
|
|
15
|
+
|
|
16
|
+
// src/utils.ts
|
|
17
|
+
import { readFileSync } from "node:fs";
|
|
18
|
+
import { dirname, join, sep } from "node:path";
|
|
19
|
+
import { fileURLToPath } from "node:url";
|
|
20
|
+
import { getProjectRoot } from "storybook/internal/common";
|
|
21
|
+
import { WebpackDefinePlugin } from "@storybook/builder-webpack5";
|
|
22
|
+
import { PHASE_DEVELOPMENT_SERVER } from "next/constants.js";
|
|
23
|
+
import nextJsLoadConfigModule from "next/dist/server/config.js";
|
|
24
|
+
import semver from "semver";
|
|
25
|
+
var configureRuntimeNextjsVersionResolution = (baseConfig) => {
|
|
26
|
+
baseConfig.plugins?.push(
|
|
27
|
+
new WebpackDefinePlugin({
|
|
28
|
+
"process.env.__NEXT_VERSION": JSON.stringify(getNextjsVersion())
|
|
29
|
+
})
|
|
30
|
+
);
|
|
31
|
+
}, getNextjsVersion = () => JSON.parse(readFileSync(join(resolvePackageDir("next"), "package.json"), "utf8")).version, isNextVersionGte = (version) => {
|
|
32
|
+
let currentVersion = getNextjsVersion(), coercedVersion = semver.coerce(currentVersion);
|
|
33
|
+
return coercedVersion ? semver.gte(coercedVersion, version) : !1;
|
|
34
|
+
}, resolveNextConfig = async ({
|
|
35
|
+
nextConfigPath
|
|
36
|
+
}) => {
|
|
37
|
+
let dir = nextConfigPath ? dirname(nextConfigPath) : getProjectRoot(), loadConfig = nextJsLoadConfigModule.default ?? nextJsLoadConfigModule, nextPrivateRenderWorker = process.env.__NEXT_PRIVATE_RENDER_WORKER;
|
|
38
|
+
process.env.__NEXT_PRIVATE_RENDER_WORKER = "defined";
|
|
39
|
+
let config = loadConfig(PHASE_DEVELOPMENT_SERVER, dir, void 0);
|
|
40
|
+
return typeof nextPrivateRenderWorker > "u" ? delete process.env.__NEXT_PRIVATE_RENDER_WORKER : process.env.__NEXT_PRIVATE_RENDER_WORKER = nextPrivateRenderWorker, config;
|
|
41
|
+
};
|
|
42
|
+
function setAlias(baseConfig, name, alias) {
|
|
43
|
+
baseConfig.resolve ??= {}, baseConfig.resolve.alias ??= {};
|
|
44
|
+
let aliasConfig = baseConfig.resolve.alias;
|
|
45
|
+
Array.isArray(aliasConfig) ? aliasConfig.push({
|
|
46
|
+
name,
|
|
47
|
+
alias
|
|
48
|
+
}) : aliasConfig[name] = alias;
|
|
49
|
+
}
|
|
50
|
+
var addScopedAlias = (baseConfig, name, alias) => {
|
|
51
|
+
let scopedAlias = scopedResolve(`${alias ?? name}`);
|
|
52
|
+
setAlias(baseConfig, name, scopedAlias);
|
|
53
|
+
}, scopedResolve = (id) => {
|
|
54
|
+
let scopedModulePath = fileURLToPath(import.meta.resolve(id)), idWithNativePathSep = id.replace(/\//g, sep);
|
|
55
|
+
if (scopedModulePath.endsWith(idWithNativePathSep))
|
|
56
|
+
return scopedModulePath;
|
|
57
|
+
let beginningOfMainScriptPath = scopedModulePath.lastIndexOf(idWithNativePathSep) + id.length;
|
|
58
|
+
return scopedModulePath.substring(0, beginningOfMainScriptPath);
|
|
59
|
+
};
|
|
60
|
+
function getNodeModulesExcludeRegex(transpilePackages) {
|
|
61
|
+
if (!transpilePackages || transpilePackages.length === 0)
|
|
62
|
+
return /node_modules/;
|
|
63
|
+
let escaped = transpilePackages.map((pkg) => pkg.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
|
|
64
|
+
return new RegExp(`node_modules/(?!(${escaped})/)`);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
configureRuntimeNextjsVersionResolution,
|
|
69
|
+
getNextjsVersion,
|
|
70
|
+
isNextVersionGte,
|
|
71
|
+
resolveNextConfig,
|
|
72
|
+
setAlias,
|
|
73
|
+
addScopedAlias,
|
|
74
|
+
scopedResolve,
|
|
75
|
+
getNodeModulesExcludeRegex
|
|
76
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hgmz08r9eac from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hgmz08r9eac from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hgmz08r9eac from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hgmz08r9eac.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hgmz08r9eac.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hgmz08r9eac.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
// src/font/webpack/configureNextFont.ts
|
|
14
|
+
function configureNextFont(baseConfig, isSWC) {
|
|
15
|
+
isSWC ? baseConfig.module?.rules?.push({
|
|
16
|
+
test: /next(\\|\/|\\\\).*(\\|\/|\\\\)target\.css$/,
|
|
17
|
+
loader: "@storybook/nextjs/storybook-nextjs-font-loader"
|
|
18
|
+
}) : baseConfig.resolveLoader = {
|
|
19
|
+
...baseConfig.resolveLoader,
|
|
20
|
+
alias: {
|
|
21
|
+
...baseConfig.resolveLoader?.alias,
|
|
22
|
+
"storybook-nextjs-font-loader": "@storybook/nextjs/storybook-nextjs-font-loader"
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
configureNextFont
|
|
28
|
+
};
|
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hgmz08r9eac from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hgmz08r9eac from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hgmz08r9eac from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hgmz08r9eac.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hgmz08r9eac.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hgmz08r9eac.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
getNodeModulesExcludeRegex
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
__name
|
|
18
|
-
} from "./chunk-Z2RESD5M.js";
|
|
14
|
+
} from "./chunk-SPI7THNW.js";
|
|
15
|
+
import "./chunk-I5MJCTYB.js";
|
|
19
16
|
|
|
20
17
|
// src/swc/loader.ts
|
|
21
18
|
import { join } from "node:path";
|
|
@@ -23,19 +20,12 @@ import { getProjectRoot } from "storybook/internal/common";
|
|
|
23
20
|
import { getVirtualModules } from "@storybook/builder-webpack5";
|
|
24
21
|
import nextJSLoadConfigModule from "next/dist/build/load-jsconfig.js";
|
|
25
22
|
import { getSupportedBrowsers } from "next/dist/build/utils.js";
|
|
26
|
-
var configureSWCLoader =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const projectRoot = getProjectRoot();
|
|
30
|
-
const loadJsConfig = nextJSLoadConfigModule.default ?? nextJSLoadConfigModule;
|
|
31
|
-
const { jsConfig } = await loadJsConfig(projectRoot, nextConfig);
|
|
32
|
-
const rawRule = baseConfig.module?.rules?.find(
|
|
33
|
-
(rule) => typeof rule === "object" && rule?.resourceQuery?.toString() === "/raw/"
|
|
23
|
+
var configureSWCLoader = async (baseConfig, options, nextConfig) => {
|
|
24
|
+
let isDevelopment = options.configType !== "PRODUCTION", { virtualModules } = await getVirtualModules(options), projectRoot = getProjectRoot(), loadJsConfig = nextJSLoadConfigModule.default ?? nextJSLoadConfigModule, { jsConfig } = await loadJsConfig(projectRoot, nextConfig), rawRule = baseConfig.module?.rules?.find(
|
|
25
|
+
(rule) => typeof rule == "object" && rule?.resourceQuery?.toString() === "/raw/"
|
|
34
26
|
);
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
const transpilePackages = nextConfig.transpilePackages ?? [];
|
|
27
|
+
rawRule && typeof rawRule == "object" && (rawRule.exclude = /^__barrel_optimize__/);
|
|
28
|
+
let transpilePackages = nextConfig.transpilePackages ?? [];
|
|
39
29
|
baseConfig.module?.rules?.push({
|
|
40
30
|
test: /\.((c|m)?(j|t)sx?)$/,
|
|
41
31
|
include: [projectRoot],
|
|
@@ -45,7 +35,7 @@ var configureSWCLoader = /* @__PURE__ */ __name(async (baseConfig, options, next
|
|
|
45
35
|
// which is not possible otherwise
|
|
46
36
|
loader: "@storybook/nextjs/next-swc-loader-patch",
|
|
47
37
|
options: {
|
|
48
|
-
isServer:
|
|
38
|
+
isServer: !1,
|
|
49
39
|
rootDir: projectRoot,
|
|
50
40
|
pagesDir: `${projectRoot}/pages`,
|
|
51
41
|
appDir: `${projectRoot}/apps`,
|
|
@@ -58,7 +48,7 @@ var configureSWCLoader = /* @__PURE__ */ __name(async (baseConfig, options, next
|
|
|
58
48
|
}
|
|
59
49
|
}
|
|
60
50
|
});
|
|
61
|
-
}
|
|
51
|
+
};
|
|
62
52
|
export {
|
|
63
53
|
configureSWCLoader
|
|
64
54
|
};
|
|
@@ -1,30 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hgmz08r9eac from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hgmz08r9eac from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hgmz08r9eac from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hgmz08r9eac.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hgmz08r9eac.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hgmz08r9eac.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
getNodeModulesExcludeRegex
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
__name
|
|
18
|
-
} from "./chunk-Z2RESD5M.js";
|
|
14
|
+
} from "./chunk-SPI7THNW.js";
|
|
15
|
+
import "./chunk-I5MJCTYB.js";
|
|
19
16
|
|
|
20
17
|
// src/babel/loader.ts
|
|
21
18
|
import { fileURLToPath } from "node:url";
|
|
22
19
|
import { getProjectRoot, resolvePathInStorybookCache } from "storybook/internal/common";
|
|
23
20
|
import { getVirtualModules } from "@storybook/builder-webpack5";
|
|
24
|
-
var configureBabelLoader =
|
|
25
|
-
|
|
26
|
-
const babelOptions = await options.presets.apply("babel", {}, options);
|
|
27
|
-
const typescriptOptions = await options.presets.apply("typescript", {}, options);
|
|
21
|
+
var configureBabelLoader = async (baseConfig, options, nextConfig) => {
|
|
22
|
+
let { virtualModules } = await getVirtualModules(options), babelOptions = await options.presets.apply("babel", {}, options), typescriptOptions = await options.presets.apply("typescript", {}, options);
|
|
28
23
|
baseConfig.module.rules = [
|
|
29
24
|
...baseConfig.module.rules,
|
|
30
25
|
{
|
|
@@ -45,7 +40,7 @@ var configureBabelLoader = /* @__PURE__ */ __name(async (baseConfig, options, ne
|
|
|
45
40
|
]
|
|
46
41
|
}
|
|
47
42
|
];
|
|
48
|
-
}
|
|
43
|
+
};
|
|
49
44
|
export {
|
|
50
45
|
configureBabelLoader
|
|
51
46
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hgmz08r9eac from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hgmz08r9eac from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hgmz08r9eac from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hgmz08r9eac.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hgmz08r9eac.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hgmz08r9eac.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -18,9 +18,8 @@ import {
|
|
|
18
18
|
resolveNextConfig,
|
|
19
19
|
scopedResolve,
|
|
20
20
|
setAlias
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-Z2RESD5M.js";
|
|
21
|
+
} from "./chunk-SPI7THNW.js";
|
|
22
|
+
import "./chunk-I5MJCTYB.js";
|
|
24
23
|
export {
|
|
25
24
|
addScopedAlias,
|
|
26
25
|
configureRuntimeNextjsVersionResolution,
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hgmz08r9eac from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hgmz08r9eac from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hgmz08r9eac from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hgmz08r9eac.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hgmz08r9eac.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hgmz08r9eac.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
// src/imports/webpack.ts
|
|
14
|
+
import { loadConfig } from "tsconfig-paths";
|
|
15
|
+
import TsconfigPathsPlugin from "tsconfig-paths-webpack-plugin";
|
|
16
|
+
var configureImports = ({
|
|
17
|
+
baseConfig,
|
|
18
|
+
configDir
|
|
19
|
+
}) => {
|
|
20
|
+
let configLoadResult = loadConfig(configDir);
|
|
21
|
+
configLoadResult.resultType !== "failed" && (baseConfig.resolve ??= {}, baseConfig.resolve.plugins ??= [], baseConfig.resolve.plugins.push(
|
|
22
|
+
new TsconfigPathsPlugin({
|
|
23
|
+
configFile: configLoadResult.configFileAbsolutePath,
|
|
24
|
+
extensions: [".js", ".jsx", ".ts", ".tsx"]
|
|
25
|
+
})
|
|
26
|
+
));
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
configureImports
|
|
30
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hgmz08r9eac from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hgmz08r9eac from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hgmz08r9eac from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hgmz08r9eac.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hgmz08r9eac.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hgmz08r9eac.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
// src/nodePolyfills/webpack.ts
|
|
14
|
+
import NodePolyfillPlugin from "node-polyfill-webpack-plugin";
|
|
15
|
+
var configureNodePolyfills = (baseConfig) => (baseConfig.plugins = [...baseConfig.plugins || [], new NodePolyfillPlugin()], baseConfig.resolve = {
|
|
16
|
+
...baseConfig.resolve,
|
|
17
|
+
fallback: {
|
|
18
|
+
fs: !1
|
|
19
|
+
}
|
|
20
|
+
}, baseConfig);
|
|
21
|
+
export {
|
|
22
|
+
configureNodePolyfills
|
|
23
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hgmz08r9eac from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hgmz08r9eac from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hgmz08r9eac from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hgmz08r9eac.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hgmz08r9eac.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hgmz08r9eac.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
// src/rsc/webpack.ts
|
|
14
|
+
import { fileURLToPath } from "node:url";
|
|
15
|
+
var configureRSC = (baseConfig) => {
|
|
16
|
+
let resolve = baseConfig.resolve ?? {};
|
|
17
|
+
resolve.alias = {
|
|
18
|
+
...resolve.alias,
|
|
19
|
+
"server-only$": fileURLToPath(import.meta.resolve("@storybook/nextjs/rsc/server-only"))
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
configureRSC
|
|
24
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hgmz08r9eac from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hgmz08r9eac from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hgmz08r9eac from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hgmz08r9eac.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hgmz08r9eac.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hgmz08r9eac.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-I5MJCTYB.js";
|
|
15
|
+
|
|
16
|
+
// src/css/webpack.ts
|
|
17
|
+
import { readFileSync } from "node:fs";
|
|
18
|
+
import { join } from "node:path";
|
|
19
|
+
import { fileURLToPath } from "node:url";
|
|
20
|
+
import { cssFileResolve } from "next/dist/build/webpack/config/blocks/css/loaders/file-resolve.js";
|
|
21
|
+
import { getCssModuleLocalIdent } from "next/dist/build/webpack/config/blocks/css/loaders/getCssModuleLocalIdent.js";
|
|
22
|
+
import semver from "semver";
|
|
23
|
+
var configureCss = (baseConfig, nextConfig) => {
|
|
24
|
+
let rules = baseConfig.module?.rules;
|
|
25
|
+
rules?.forEach((rule, i) => {
|
|
26
|
+
rule && typeof rule != "string" && rule.test instanceof RegExp && rule.test.test("test.css") && (rules[i] = {
|
|
27
|
+
test: /\.css$/,
|
|
28
|
+
use: [
|
|
29
|
+
fileURLToPath(import.meta.resolve("style-loader")),
|
|
30
|
+
{
|
|
31
|
+
loader: fileURLToPath(import.meta.resolve("css-loader")),
|
|
32
|
+
options: {
|
|
33
|
+
importLoaders: 1,
|
|
34
|
+
...getImportAndUrlCssLoaderOptions(nextConfig),
|
|
35
|
+
modules: {
|
|
36
|
+
auto: !0,
|
|
37
|
+
getLocalIdent: getCssModuleLocalIdent
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
fileURLToPath(import.meta.resolve("postcss-loader"))
|
|
42
|
+
],
|
|
43
|
+
// We transform the "target.css" files from next.js into Javascript
|
|
44
|
+
// for Next.js to support fonts, so it should be ignored by the css-loader.
|
|
45
|
+
exclude: /next(\\|\/|\\\\).*(\\|\/|\\\\)target\.css$/
|
|
46
|
+
});
|
|
47
|
+
}), rules?.push({
|
|
48
|
+
test: /\.(scss|sass)$/,
|
|
49
|
+
use: [
|
|
50
|
+
fileURLToPath(import.meta.resolve("style-loader")),
|
|
51
|
+
{
|
|
52
|
+
loader: fileURLToPath(import.meta.resolve("css-loader")),
|
|
53
|
+
options: {
|
|
54
|
+
importLoaders: 3,
|
|
55
|
+
...getImportAndUrlCssLoaderOptions(nextConfig),
|
|
56
|
+
modules: { auto: !0, getLocalIdent: getCssModuleLocalIdent }
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
fileURLToPath(import.meta.resolve("postcss-loader")),
|
|
60
|
+
fileURLToPath(import.meta.resolve("resolve-url-loader")),
|
|
61
|
+
{
|
|
62
|
+
loader: fileURLToPath(import.meta.resolve("sass-loader")),
|
|
63
|
+
options: {
|
|
64
|
+
sourceMap: !0,
|
|
65
|
+
sassOptions: nextConfig.sassOptions,
|
|
66
|
+
additionalData: nextConfig.sassOptions?.prependData || nextConfig.sassOptions?.additionalData
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
});
|
|
71
|
+
}, getImportAndUrlCssLoaderOptions = (nextConfig) => isCssLoaderV6() ? {
|
|
72
|
+
url: {
|
|
73
|
+
filter: getUrlResolver(nextConfig)
|
|
74
|
+
},
|
|
75
|
+
import: {
|
|
76
|
+
filter: getImportResolver(nextConfig)
|
|
77
|
+
}
|
|
78
|
+
} : {
|
|
79
|
+
url: getUrlResolver(nextConfig),
|
|
80
|
+
import: getImportResolver(nextConfig)
|
|
81
|
+
}, getUrlResolver = (nextConfig) => (url, resourcePath) => cssFileResolve(url, resourcePath, nextConfig.experimental?.urlImports), getImportResolver = (nextConfig) => (url, _, resourcePath) => cssFileResolve(
|
|
82
|
+
typeof url == "string" ? url : url.url,
|
|
83
|
+
resourcePath,
|
|
84
|
+
nextConfig.experimental?.urlImports
|
|
85
|
+
), isCssLoaderV6 = () => {
|
|
86
|
+
try {
|
|
87
|
+
let cssLoaderVersion = JSON.parse(
|
|
88
|
+
readFileSync(join(resolvePackageDir("css-loader"), "package.json"), "utf8")
|
|
89
|
+
).version;
|
|
90
|
+
return semver.gte(cssLoaderVersion, "6.0.0");
|
|
91
|
+
} catch {
|
|
92
|
+
return !1;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
export {
|
|
96
|
+
configureCss
|
|
97
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hgmz08r9eac from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hgmz08r9eac from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hgmz08r9eac from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hgmz08r9eac.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hgmz08r9eac.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hgmz08r9eac.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-SPI7THNW.js";
|
|
15
|
+
import "./chunk-I5MJCTYB.js";
|
|
16
|
+
|
|
17
|
+
// src/styledJsx/webpack.ts
|
|
18
|
+
var configureStyledJsx = (baseConfig) => {
|
|
19
|
+
addScopedAlias(baseConfig, "styled-jsx");
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
configureStyledJsx
|
|
23
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hgmz08r9eac from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hgmz08r9eac from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hgmz08r9eac from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hgmz08r9eac.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hgmz08r9eac.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hgmz08r9eac.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,32 +12,26 @@ var require = CJS_COMPAT_NODE_MODULE_1wy8hqz8e24.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
configureCompatibilityAliases,
|
|
14
14
|
configureNextExportMocks
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-JAEO4VGQ.js";
|
|
16
|
+
import "./chunk-SPI7THNW.js";
|
|
17
17
|
import {
|
|
18
18
|
resolvePackageDir
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import {
|
|
21
|
-
__name
|
|
22
|
-
} from "./chunk-Z2RESD5M.js";
|
|
19
|
+
} from "./chunk-I5MJCTYB.js";
|
|
23
20
|
|
|
24
21
|
// src/aliases/webpack.ts
|
|
25
|
-
var configureAliases =
|
|
26
|
-
configureNextExportMocks(baseConfig)
|
|
27
|
-
configureCompatibilityAliases(baseConfig);
|
|
28
|
-
baseConfig.resolve = {
|
|
22
|
+
var configureAliases = (baseConfig) => {
|
|
23
|
+
configureNextExportMocks(baseConfig), configureCompatibilityAliases(baseConfig), baseConfig.resolve = {
|
|
29
24
|
...baseConfig.resolve ?? {},
|
|
30
25
|
alias: {
|
|
31
26
|
...baseConfig.resolve?.alias ?? {},
|
|
32
27
|
"@opentelemetry/api": "next/dist/compiled/@opentelemetry/api",
|
|
33
28
|
next: resolvePackageDir("next")
|
|
34
29
|
}
|
|
35
|
-
}
|
|
36
|
-
baseConfig.ignoreWarnings = [
|
|
30
|
+
}, baseConfig.ignoreWarnings = [
|
|
37
31
|
...baseConfig.ignoreWarnings ?? [],
|
|
38
32
|
(warning) => warning.message.includes("export 'draftMode'") && warning.message.includes("next/dist/server/request/headers")
|
|
39
33
|
];
|
|
40
|
-
}
|
|
34
|
+
};
|
|
41
35
|
export {
|
|
42
36
|
configureAliases
|
|
43
37
|
};
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hgmz08r9eac from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hgmz08r9eac from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hgmz08r9eac from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hgmz08r9eac.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hgmz08r9eac.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hgmz08r9eac.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import {
|
|
13
|
-
__name
|
|
14
|
-
} from "./chunk-Z2RESD5M.js";
|
|
15
12
|
|
|
16
13
|
// src/fastRefresh/webpack.ts
|
|
17
14
|
import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin";
|
|
18
|
-
var configureFastRefresh =
|
|
15
|
+
var configureFastRefresh = (baseConfig) => {
|
|
19
16
|
baseConfig.plugins = [
|
|
20
17
|
...baseConfig.plugins ?? [],
|
|
21
18
|
// overlay is disabled as it is shown with caught errors in error boundaries
|
|
22
19
|
// and the next app router is using error boundaries to redirect
|
|
23
20
|
// TODO use the Next error overlay
|
|
24
|
-
new ReactRefreshWebpackPlugin({ overlay:
|
|
21
|
+
new ReactRefreshWebpackPlugin({ overlay: !1 })
|
|
25
22
|
];
|
|
26
|
-
}
|
|
23
|
+
};
|
|
27
24
|
export {
|
|
28
25
|
configureFastRefresh
|
|
29
26
|
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_hgmz08r9eac from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_hgmz08r9eac from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_hgmz08r9eac from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_hgmz08r9eac.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_hgmz08r9eac.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_hgmz08r9eac.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-SPI7THNW.js";
|
|
15
|
+
import "./chunk-I5MJCTYB.js";
|
|
16
|
+
|
|
17
|
+
// src/images/webpack.ts
|
|
18
|
+
import { fileURLToPath } from "node:url";
|
|
19
|
+
import semver from "semver";
|
|
20
|
+
var configureImages = (baseConfig, nextConfig) => {
|
|
21
|
+
configureStaticImageImport(baseConfig, nextConfig), configureImageDefaults(baseConfig);
|
|
22
|
+
}, fallbackFilename = "static/media/[path][name][ext]", configureImageDefaults = (baseConfig) => {
|
|
23
|
+
let version = getNextjsVersion(), resolve = baseConfig.resolve ?? {};
|
|
24
|
+
resolve.alias = {
|
|
25
|
+
...resolve.alias,
|
|
26
|
+
"sb-original/next/image": fileURLToPath(import.meta.resolve("next/image")),
|
|
27
|
+
"next/image": "@storybook/nextjs/images/next-image"
|
|
28
|
+
}, semver.satisfies(version, ">=13.0.0") && (resolve.alias = {
|
|
29
|
+
...resolve.alias,
|
|
30
|
+
"sb-original/next/legacy/image": fileURLToPath(import.meta.resolve("next/legacy/image")),
|
|
31
|
+
"next/legacy/image": "@storybook/nextjs/images/next-legacy-image"
|
|
32
|
+
});
|
|
33
|
+
}, configureStaticImageImport = (baseConfig, nextConfig) => {
|
|
34
|
+
let rules = baseConfig.module?.rules, assetRule = rules?.find(
|
|
35
|
+
(rule) => rule && typeof rule != "string" && rule.test instanceof RegExp && rule.test.test("test.jpg")
|
|
36
|
+
);
|
|
37
|
+
assetRule && (assetRule.test = /\.(apng|eot|otf|ttf|woff|woff2|cur|ani|pdf)(\?.*)?$/, rules?.push({
|
|
38
|
+
test: /\.(png|jpg|jpeg|gif|webp|avif|ico|bmp|svg)$/i,
|
|
39
|
+
issuer: { not: /\.(css|scss|sass)$/ },
|
|
40
|
+
use: [
|
|
41
|
+
{
|
|
42
|
+
loader: fileURLToPath(import.meta.resolve("@storybook/nextjs/next-image-loader-stub")),
|
|
43
|
+
options: {
|
|
44
|
+
filename: assetRule.generator?.filename ?? fallbackFilename,
|
|
45
|
+
nextConfig
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}), rules?.push({
|
|
50
|
+
test: /\.(png|jpg|jpeg|gif|webp|avif|ico|bmp|svg)$/i,
|
|
51
|
+
issuer: /\.(css|scss|sass)$/,
|
|
52
|
+
type: "asset/resource",
|
|
53
|
+
generator: {
|
|
54
|
+
filename: assetRule.generator?.filename ?? fallbackFilename
|
|
55
|
+
}
|
|
56
|
+
}));
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
configureImages
|
|
60
|
+
};
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import "../../_browser-chunks/chunk-
|
|
1
|
+
import "../../_browser-chunks/chunk-SL3VIQZ3.js";
|
|
2
2
|
|
|
3
3
|
// src/export-mocks/cache/index.ts
|
|
4
4
|
import { unstable_cache } from "next/dist/server/web/spec-extension/unstable-cache";
|
|
5
5
|
import { unstable_noStore } from "next/dist/server/web/spec-extension/unstable-no-store";
|
|
6
6
|
import { fn } from "storybook/test";
|
|
7
|
-
var revalidatePath = fn().mockName("next/cache::revalidatePath")
|
|
8
|
-
var revalidateTag = fn().mockName("next/cache::revalidateTag");
|
|
9
|
-
var cacheExports = {
|
|
7
|
+
var revalidatePath = fn().mockName("next/cache::revalidatePath"), revalidateTag = fn().mockName("next/cache::revalidateTag"), cacheExports = {
|
|
10
8
|
unstable_cache,
|
|
11
9
|
revalidateTag,
|
|
12
10
|
revalidatePath,
|
|
13
11
|
unstable_noStore
|
|
14
|
-
};
|
|
15
|
-
var cache_default = cacheExports;
|
|
12
|
+
}, cache_default = cacheExports;
|
|
16
13
|
export {
|
|
17
14
|
cache_default as default,
|
|
18
15
|
revalidatePath,
|