@storybook/nextjs 10.1.0-alpha.10 → 10.1.0-alpha.11
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-KG2CEDQ6.js +76 -0
- package/dist/_node-chunks/chunk-NVSKNSJK.js +205 -0
- package/dist/_node-chunks/chunk-XVBKFOBF.js +57 -0
- package/dist/_node-chunks/configureNextFont-QR356EAI.js +28 -0
- package/dist/_node-chunks/{loader-WPDBQYKQ.js → loader-GUPXITUF.js} +11 -16
- package/dist/_node-chunks/{loader-UJGK53PP.js → loader-VIIL5HSY.js} +15 -25
- package/dist/_node-chunks/{utils-G77XBOCW.js → utils-GFLYVHHC.js} +8 -9
- package/dist/_node-chunks/webpack-A6CKSXQU.js +24 -0
- package/dist/_node-chunks/webpack-HDYOTQDH.js +23 -0
- package/dist/_node-chunks/{webpack-AIYB3HRJ.js → webpack-K7FNPCWL.js} +13 -19
- package/dist/_node-chunks/webpack-KEI74OHK.js +30 -0
- package/dist/_node-chunks/{webpack-QCUACIS6.js → webpack-O4VJM34G.js} +9 -12
- package/dist/_node-chunks/webpack-S3SWBOVU.js +97 -0
- package/dist/_node-chunks/webpack-YFKESEJQ.js +60 -0
- package/dist/_node-chunks/webpack-YOXZVRLP.js +23 -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.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,57 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h9mxauk5xyo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h9mxauk5xyo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h9mxauk5xyo from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h9mxauk5xyo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h9mxauk5xyo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h9mxauk5xyo.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
addScopedAlias,
|
|
14
|
+
getNextjsVersion,
|
|
15
|
+
setAlias
|
|
16
|
+
} from "./chunk-KG2CEDQ6.js";
|
|
17
|
+
|
|
18
|
+
// src/compatibility/compatibility-map.ts
|
|
19
|
+
import semver from "semver";
|
|
20
|
+
var mapping = {
|
|
21
|
+
"<15.0.0": {
|
|
22
|
+
"next/dist/server/request/headers": "next/dist/client/components/headers",
|
|
23
|
+
// this path only exists from Next 15 onwards
|
|
24
|
+
"next/dist/server/request/draft-mode": "@storybook/nextjs/compatibility/draft-mode.compat"
|
|
25
|
+
}
|
|
26
|
+
}, getCompatibilityAliases = () => {
|
|
27
|
+
let version = getNextjsVersion(), result = {};
|
|
28
|
+
return Object.keys(mapping).forEach((key) => {
|
|
29
|
+
semver.intersects(version, key) && Object.assign(result, mapping[key]);
|
|
30
|
+
}), result;
|
|
31
|
+
}, configureCompatibilityAliases = (baseConfig) => {
|
|
32
|
+
let aliases = getCompatibilityAliases();
|
|
33
|
+
Object.entries(aliases).forEach(([name, alias]) => {
|
|
34
|
+
typeof alias == "string" ? addScopedAlias(baseConfig, name, alias) : setAlias(baseConfig, name, alias);
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// src/export-mocks/webpack.ts
|
|
39
|
+
var mapping2 = {
|
|
40
|
+
"next/headers": "@storybook/nextjs/headers.mock",
|
|
41
|
+
"next/navigation": "@storybook/nextjs/navigation.mock",
|
|
42
|
+
"next/router": "@storybook/nextjs/router.mock",
|
|
43
|
+
"next/cache": "@storybook/nextjs/cache.mock",
|
|
44
|
+
...getCompatibilityAliases()
|
|
45
|
+
}, getPackageAliases = () => mapping2, configureNextExportMocks = (baseConfig) => {
|
|
46
|
+
let resolve = baseConfig.resolve ?? {};
|
|
47
|
+
resolve.alias = {
|
|
48
|
+
...resolve.alias,
|
|
49
|
+
...mapping2
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
configureCompatibilityAliases,
|
|
55
|
+
getPackageAliases,
|
|
56
|
+
configureNextExportMocks
|
|
57
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h9mxauk5xyo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h9mxauk5xyo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h9mxauk5xyo from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h9mxauk5xyo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h9mxauk5xyo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h9mxauk5xyo.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,30 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h9mxauk5xyo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h9mxauk5xyo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h9mxauk5xyo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h9mxauk5xyo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h9mxauk5xyo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h9mxauk5xyo.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-KG2CEDQ6.js";
|
|
15
|
+
import "./chunk-NVSKNSJK.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,21 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h9mxauk5xyo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h9mxauk5xyo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h9mxauk5xyo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h9mxauk5xyo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h9mxauk5xyo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h9mxauk5xyo.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-KG2CEDQ6.js";
|
|
15
|
+
import "./chunk-NVSKNSJK.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,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h9mxauk5xyo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h9mxauk5xyo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h9mxauk5xyo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h9mxauk5xyo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h9mxauk5xyo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h9mxauk5xyo.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-KG2CEDQ6.js";
|
|
22
|
+
import "./chunk-NVSKNSJK.js";
|
|
24
23
|
export {
|
|
25
24
|
addScopedAlias,
|
|
26
25
|
configureRuntimeNextjsVersionResolution,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h9mxauk5xyo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h9mxauk5xyo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h9mxauk5xyo from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h9mxauk5xyo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h9mxauk5xyo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h9mxauk5xyo.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,23 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h9mxauk5xyo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h9mxauk5xyo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h9mxauk5xyo from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h9mxauk5xyo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h9mxauk5xyo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h9mxauk5xyo.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-KG2CEDQ6.js";
|
|
15
|
+
import "./chunk-NVSKNSJK.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_h9mxauk5xyo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h9mxauk5xyo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h9mxauk5xyo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h9mxauk5xyo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h9mxauk5xyo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h9mxauk5xyo.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-XVBKFOBF.js";
|
|
16
|
+
import "./chunk-KG2CEDQ6.js";
|
|
17
17
|
import {
|
|
18
18
|
resolvePackageDir
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import {
|
|
21
|
-
__name
|
|
22
|
-
} from "./chunk-Z2RESD5M.js";
|
|
19
|
+
} from "./chunk-NVSKNSJK.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
|
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h9mxauk5xyo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h9mxauk5xyo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h9mxauk5xyo from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h9mxauk5xyo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h9mxauk5xyo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h9mxauk5xyo.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
|
+
};
|
|
@@ -1,29 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h9mxauk5xyo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h9mxauk5xyo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h9mxauk5xyo from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h9mxauk5xyo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h9mxauk5xyo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h9mxauk5xyo.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,97 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h9mxauk5xyo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h9mxauk5xyo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h9mxauk5xyo from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h9mxauk5xyo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h9mxauk5xyo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h9mxauk5xyo.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-NVSKNSJK.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,60 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h9mxauk5xyo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h9mxauk5xyo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h9mxauk5xyo from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h9mxauk5xyo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h9mxauk5xyo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h9mxauk5xyo.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-KG2CEDQ6.js";
|
|
15
|
+
import "./chunk-NVSKNSJK.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
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h9mxauk5xyo from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h9mxauk5xyo from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h9mxauk5xyo from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h9mxauk5xyo.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h9mxauk5xyo.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h9mxauk5xyo.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
|
+
};
|
|
@@ -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,
|