@storybook/nextjs 9.2.0-alpha.3 → 10.0.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/README.md +3 -1
- package/dist/_browser-chunks/chunk-I5RFHXDS.js +40 -0
- package/dist/_browser-chunks/chunk-JOMP7DUK.js +261 -0
- package/dist/_browser-chunks/chunk-L5NVL7MD.js +37 -0
- package/dist/_browser-chunks/react-18-G7Q4PNHD.js +71 -0
- package/dist/_node-chunks/chunk-24UYJEDD.js +74 -0
- package/dist/_node-chunks/chunk-EZEBG77A.js +88 -0
- package/dist/_node-chunks/chunk-WCSGFZKZ.js +17 -0
- package/dist/_node-chunks/chunk-YMVPQWBH.js +167 -0
- package/dist/_node-chunks/configureNextFont-HBRWHAUG.js +36 -0
- package/dist/_node-chunks/loader-KXTZ5PJ5.js +51 -0
- package/dist/_node-chunks/loader-Z4IXWF5M.js +64 -0
- package/dist/_node-chunks/utils-4LRBHVQD.js +31 -0
- package/dist/_node-chunks/webpack-6HAXGE7X.js +38 -0
- package/dist/_node-chunks/webpack-AGNCA7HZ.js +77 -0
- package/dist/_node-chunks/webpack-CXSD35E6.js +30 -0
- package/dist/_node-chunks/webpack-EWT6TRQB.js +26 -0
- package/dist/_node-chunks/webpack-K2R3GUFU.js +29 -0
- package/dist/_node-chunks/webpack-PD7PIB6X.js +43 -0
- package/dist/_node-chunks/webpack-QFTZE3CE.js +27 -0
- package/dist/_node-chunks/webpack-SWQY6JJY.js +107 -0
- package/dist/compatibility/draft-mode.compat.js +7 -1
- package/dist/export-mocks/cache/index.d.ts +309 -1
- package/dist/export-mocks/cache/index.js +22 -1
- package/dist/export-mocks/headers/index.d.ts +309 -1
- package/dist/export-mocks/headers/index.js +77 -1
- package/dist/export-mocks/index.js +20 -1
- package/dist/export-mocks/navigation/index.js +88 -1
- package/dist/export-mocks/router/index.d.ts +2 -2
- package/dist/export-mocks/router/index.js +97 -1
- package/dist/font/webpack/loader/storybook-nextjs-font-loader.js +201 -14
- package/dist/image-context.js +8 -1
- package/dist/images/next-image.js +35 -1
- package/dist/images/next-legacy-image.js +21 -1
- package/dist/index.d.ts +53 -8
- package/dist/index.js +20237 -45
- package/dist/next-image-loader-stub.js +33 -1
- package/dist/node/index.d.ts +27 -6
- package/dist/node/index.js +23 -1
- package/dist/preset.js +830 -1
- package/dist/preview.d.ts +3 -18
- package/dist/preview.d.tsx +18 -0
- package/dist/preview.js +11 -1
- package/dist/rsc/server-only.js +7 -1
- package/dist/swc/next-swc-loader-patch.js +136 -1
- package/package.json +41 -122
- package/preset.js +1 -1
- package/template/cli/js/Configure.mdx +11 -11
- package/template/cli/ts/Configure.mdx +11 -11
- package/dist/chunk-2TZKD6A5.mjs +0 -20
- package/dist/chunk-ETFXNGLC.mjs +0 -3
- package/dist/chunk-L66KIASX.mjs +0 -3
- package/dist/chunk-NQ32RFK2.mjs +0 -6
- package/dist/compatibility/draft-mode.compat.d.ts +0 -1
- package/dist/compatibility/draft-mode.compat.mjs +0 -2
- package/dist/export-mocks/cache/index.mjs +0 -10
- package/dist/export-mocks/headers/index.mjs +0 -12
- package/dist/export-mocks/index.d.ts +0 -7
- package/dist/export-mocks/index.mjs +0 -11
- package/dist/export-mocks/navigation/index.mjs +0 -11
- package/dist/export-mocks/router/index.mjs +0 -10
- package/dist/font/webpack/loader/storybook-nextjs-font-loader.d.ts +0 -3
- package/dist/font/webpack/loader/storybook-nextjs-font-loader.mjs +0 -56
- package/dist/image-context.d.ts +0 -13
- package/dist/image-context.mjs +0 -6
- package/dist/images/decorator.d.ts +0 -6
- package/dist/images/decorator.js +0 -1
- package/dist/images/decorator.mjs +0 -2
- package/dist/images/next-image.d.ts +0 -28
- package/dist/images/next-image.mjs +0 -9
- package/dist/images/next-legacy-image.d.ts +0 -6
- package/dist/images/next-legacy-image.mjs +0 -9
- package/dist/index.d-ff220430.d.ts +0 -310
- package/dist/index.mjs +0 -58
- package/dist/next-image-loader-stub.d.ts +0 -10
- package/dist/next-image-loader-stub.mjs +0 -7
- package/dist/node/index.mjs +0 -5
- package/dist/preset.d.ts +0 -14
- package/dist/preview.mjs +0 -3
- package/dist/react-18-WSPZ3BUV.mjs +0 -7
- package/dist/rsc/server-only.d.ts +0 -3
- package/dist/rsc/server-only.mjs +0 -5
- package/dist/swc/next-swc-loader-patch.d.ts +0 -21
- package/dist/swc/next-swc-loader-patch.mjs +0 -8
- package/dist/types-f6ea2c09.d.ts +0 -54
package/dist/preview.d.ts
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
declare const loaders: Addon_LoaderFunction;
|
|
5
|
-
declare const parameters: {
|
|
6
|
-
docs: {
|
|
7
|
-
source: {
|
|
8
|
-
excludeDecorators: boolean;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
react: {
|
|
12
|
-
rootOptions: {
|
|
13
|
-
onCaughtError(error: unknown): void;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export { decorators, loaders, parameters };
|
|
1
|
+
// auto generated file from file:///home/runner/work/storybook/storybook/scripts/build/utils/generate-type-mappers.ts, do not edit
|
|
2
|
+
export * from '../src/preview.tsx';
|
|
3
|
+
export type * from '../src/preview.tsx';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Addon_DecoratorFunction, Addon_LoaderFunction } from 'storybook/internal/types';
|
|
2
|
+
|
|
3
|
+
declare const decorators: Addon_DecoratorFunction<any>[];
|
|
4
|
+
declare const loaders: Addon_LoaderFunction;
|
|
5
|
+
declare const parameters: {
|
|
6
|
+
docs: {
|
|
7
|
+
source: {
|
|
8
|
+
excludeDecorators: boolean;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
react: {
|
|
12
|
+
rootOptions: {
|
|
13
|
+
onCaughtError(error: unknown): void;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { decorators, loaders, parameters };
|
package/dist/preview.js
CHANGED
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
decorators,
|
|
3
|
+
loaders,
|
|
4
|
+
parameters
|
|
5
|
+
} from "./_browser-chunks/chunk-JOMP7DUK.js";
|
|
6
|
+
import "./_browser-chunks/chunk-L5NVL7MD.js";
|
|
7
|
+
export {
|
|
8
|
+
decorators,
|
|
9
|
+
loaders,
|
|
10
|
+
parameters
|
|
11
|
+
};
|
package/dist/rsc/server-only.js
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import "../_browser-chunks/chunk-L5NVL7MD.js";
|
|
2
|
+
|
|
3
|
+
// src/rsc/server-only.ts
|
|
4
|
+
var server_only_default = {};
|
|
5
|
+
export {
|
|
6
|
+
server_only_default as default
|
|
7
|
+
};
|
|
@@ -1 +1,136 @@
|
|
|
1
|
-
|
|
1
|
+
import CJS_COMPAT_NODE_URL_e3twfmexlgl from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_e3twfmexlgl from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_e3twfmexlgl from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_e3twfmexlgl.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_e3twfmexlgl.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_e3twfmexlgl.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 "../_node-chunks/chunk-WCSGFZKZ.js";
|
|
15
|
+
|
|
16
|
+
// src/swc/next-swc-loader-patch.ts
|
|
17
|
+
import { isAbsolute, relative } from "node:path";
|
|
18
|
+
import { isWasm, transform } from "next/dist/build/swc/index.js";
|
|
19
|
+
import { getLoaderSWCOptions } from "next/dist/build/swc/options.js";
|
|
20
|
+
var mockCurrentTraceSpan = {
|
|
21
|
+
traceChild: /* @__PURE__ */ __name((name) => mockCurrentTraceSpan, "traceChild"),
|
|
22
|
+
traceAsyncFn: /* @__PURE__ */ __name(async (fn) => fn(), "traceAsyncFn")
|
|
23
|
+
};
|
|
24
|
+
async function loaderTransform(parentTrace, source, inputSourceMap) {
|
|
25
|
+
const filename = this.resourcePath;
|
|
26
|
+
const loaderOptions = this.getOptions() || {};
|
|
27
|
+
const {
|
|
28
|
+
isServer,
|
|
29
|
+
rootDir,
|
|
30
|
+
pagesDir,
|
|
31
|
+
appDir,
|
|
32
|
+
hasReactRefresh,
|
|
33
|
+
nextConfig,
|
|
34
|
+
jsConfig,
|
|
35
|
+
supportedBrowsers,
|
|
36
|
+
swcCacheDir,
|
|
37
|
+
serverComponents,
|
|
38
|
+
isReactServerLayer
|
|
39
|
+
} = loaderOptions;
|
|
40
|
+
const isPageFile = filename.startsWith(pagesDir);
|
|
41
|
+
const relativeFilePathFromRoot = relative(rootDir, filename);
|
|
42
|
+
const swcOptions = getLoaderSWCOptions({
|
|
43
|
+
pagesDir,
|
|
44
|
+
appDir,
|
|
45
|
+
filename,
|
|
46
|
+
isServer,
|
|
47
|
+
isPageFile,
|
|
48
|
+
development: this.mode === "development",
|
|
49
|
+
hasReactRefresh,
|
|
50
|
+
modularizeImports: nextConfig?.modularizeImports,
|
|
51
|
+
optimizePackageImports: nextConfig?.experimental?.optimizePackageImports,
|
|
52
|
+
swcPlugins: nextConfig?.experimental?.swcPlugins,
|
|
53
|
+
compilerOptions: nextConfig?.compiler,
|
|
54
|
+
optimizeServerReact: nextConfig?.experimental?.optimizeServerReact,
|
|
55
|
+
jsConfig,
|
|
56
|
+
supportedBrowsers,
|
|
57
|
+
swcCacheDir,
|
|
58
|
+
relativeFilePathFromRoot,
|
|
59
|
+
serverComponents,
|
|
60
|
+
// @ts-expect-error Relevant for Next.js < 14.1
|
|
61
|
+
// TODO: Remove this when Next.js < 14.1 is no longer supported
|
|
62
|
+
isReactServerLayer
|
|
63
|
+
});
|
|
64
|
+
const programmaticOptions = {
|
|
65
|
+
...swcOptions,
|
|
66
|
+
filename,
|
|
67
|
+
inputSourceMap: inputSourceMap && typeof inputSourceMap === "object" ? JSON.stringify(inputSourceMap) : void 0,
|
|
68
|
+
// Set the default sourcemap behavior based on Webpack's mapping flag,
|
|
69
|
+
sourceMaps: this.sourceMap,
|
|
70
|
+
inlineSourcesContent: this.sourceMap,
|
|
71
|
+
// Ensure that Webpack will get a full absolute path in the sourcemap
|
|
72
|
+
// so that it can properly map the module back to its internal cached
|
|
73
|
+
// modules.
|
|
74
|
+
sourceFileName: filename
|
|
75
|
+
};
|
|
76
|
+
programmaticOptions.env.bugfixes = true;
|
|
77
|
+
if (!programmaticOptions.inputSourceMap) {
|
|
78
|
+
delete programmaticOptions.inputSourceMap;
|
|
79
|
+
}
|
|
80
|
+
if (this.mode && programmaticOptions.jsc && programmaticOptions.jsc.transform && programmaticOptions.jsc.transform.react && !Object.prototype.hasOwnProperty.call(programmaticOptions.jsc.transform.react, "development")) {
|
|
81
|
+
programmaticOptions.jsc.transform.react.development = this.mode === "development";
|
|
82
|
+
}
|
|
83
|
+
const swcSpan = parentTrace.traceChild("next-swc-transform");
|
|
84
|
+
return swcSpan.traceAsyncFn(
|
|
85
|
+
() => transform(source, programmaticOptions).then((output) => {
|
|
86
|
+
if (output.eliminatedPackages && this.eliminatedPackages) {
|
|
87
|
+
for (const pkg of JSON.parse(output.eliminatedPackages)) {
|
|
88
|
+
this.eliminatedPackages.add(pkg);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return [output.code, output.map ? JSON.parse(output.map) : void 0];
|
|
92
|
+
})
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
__name(loaderTransform, "loaderTransform");
|
|
96
|
+
var EXCLUDED_PATHS = /[\\/](cache[\\/][^\\/]+\.zip[\\/]node_modules|__virtual__)[\\/]/g;
|
|
97
|
+
function pitch() {
|
|
98
|
+
const callback = this.async();
|
|
99
|
+
(async () => {
|
|
100
|
+
if (
|
|
101
|
+
// TODO: investigate swc file reading in PnP mode?
|
|
102
|
+
!process.versions.pnp && !EXCLUDED_PATHS.test(this.resourcePath) && this.loaders.length - 1 === this.loaderIndex && isAbsolute(this.resourcePath) && !await isWasm()
|
|
103
|
+
) {
|
|
104
|
+
const loaderSpan = mockCurrentTraceSpan.traceChild("next-swc-loader");
|
|
105
|
+
this.addDependency(this.resourcePath);
|
|
106
|
+
return loaderSpan.traceAsyncFn(() => loaderTransform.call(this, loaderSpan));
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
109
|
+
})().then((r) => {
|
|
110
|
+
if (r) {
|
|
111
|
+
return callback(null, ...r);
|
|
112
|
+
}
|
|
113
|
+
callback();
|
|
114
|
+
return null;
|
|
115
|
+
}, callback);
|
|
116
|
+
}
|
|
117
|
+
__name(pitch, "pitch");
|
|
118
|
+
function swcLoader(inputSource, inputSourceMap) {
|
|
119
|
+
const loaderSpan = mockCurrentTraceSpan.traceChild("next-swc-loader");
|
|
120
|
+
const callback = this.async();
|
|
121
|
+
loaderSpan.traceAsyncFn(() => loaderTransform.call(this, loaderSpan, inputSource, inputSourceMap)).then(
|
|
122
|
+
([transformedSource, outputSourceMap]) => {
|
|
123
|
+
callback(null, transformedSource, outputSourceMap || inputSourceMap);
|
|
124
|
+
},
|
|
125
|
+
(err) => {
|
|
126
|
+
callback(err);
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
__name(swcLoader, "swcLoader");
|
|
131
|
+
var raw = true;
|
|
132
|
+
export {
|
|
133
|
+
swcLoader as default,
|
|
134
|
+
pitch,
|
|
135
|
+
raw
|
|
136
|
+
};
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/nextjs",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Storybook for Next.js",
|
|
3
|
+
"version": "10.0.0-beta.0",
|
|
4
|
+
"description": "Storybook for Next.js: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
7
|
-
"
|
|
7
|
+
"next",
|
|
8
|
+
"next.js",
|
|
9
|
+
"webpack",
|
|
10
|
+
"component",
|
|
11
|
+
"components"
|
|
8
12
|
],
|
|
9
13
|
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/nextjs",
|
|
10
14
|
"bugs": {
|
|
@@ -20,101 +24,47 @@
|
|
|
20
24
|
"url": "https://opencollective.com/storybook"
|
|
21
25
|
},
|
|
22
26
|
"license": "MIT",
|
|
27
|
+
"type": "module",
|
|
23
28
|
"exports": {
|
|
24
29
|
".": {
|
|
25
30
|
"types": "./dist/index.d.ts",
|
|
26
|
-
"
|
|
27
|
-
"import": "./dist/index.mjs",
|
|
28
|
-
"require": "./dist/index.js"
|
|
29
|
-
},
|
|
30
|
-
"./dist/image-context": {
|
|
31
|
-
"types": "./dist/image-context.d.ts",
|
|
32
|
-
"import": "./dist/image-context.mjs",
|
|
33
|
-
"require": "./dist/image-context.js"
|
|
34
|
-
},
|
|
35
|
-
"./preset": {
|
|
36
|
-
"types": "./dist/preset.d.ts",
|
|
37
|
-
"require": "./dist/preset.js"
|
|
38
|
-
},
|
|
39
|
-
"./font/webpack/loader/storybook-nextjs-font-loader": {
|
|
40
|
-
"types": "./dist/font/webpack/loader/storybook-nextjs-font-loader.d.ts",
|
|
41
|
-
"import": "./dist/font/webpack/loader/storybook-nextjs-font-loader.mjs",
|
|
42
|
-
"require": "./dist/font/webpack/loader/storybook-nextjs-font-loader.js"
|
|
43
|
-
},
|
|
44
|
-
"./dist/preview.mjs": "./dist/preview.mjs",
|
|
45
|
-
"./next-image-loader-stub.js": {
|
|
46
|
-
"types": "./dist/next-image-loader-stub.d.ts",
|
|
47
|
-
"import": "./dist/next-image-loader-stub.mjs",
|
|
48
|
-
"require": "./dist/next-image-loader-stub.js"
|
|
49
|
-
},
|
|
50
|
-
"./dist/compatibility/draft-mode.compat": {
|
|
51
|
-
"types": "./dist/compatibility/draft-mode.compat.d.ts",
|
|
52
|
-
"import": "./dist/compatibility/draft-mode.compat.mjs",
|
|
53
|
-
"require": "./dist/compatibility/draft-mode.compat.js"
|
|
54
|
-
},
|
|
55
|
-
"./export-mocks": {
|
|
56
|
-
"types": "./dist/export-mocks/index.d.ts",
|
|
57
|
-
"import": "./dist/export-mocks/index.mjs",
|
|
58
|
-
"require": "./dist/export-mocks/index.js"
|
|
31
|
+
"default": "./dist/index.js"
|
|
59
32
|
},
|
|
60
33
|
"./cache.mock": {
|
|
61
34
|
"types": "./dist/export-mocks/cache/index.d.ts",
|
|
62
|
-
"
|
|
63
|
-
"require": "./dist/export-mocks/cache/index.js"
|
|
35
|
+
"default": "./dist/export-mocks/cache/index.js"
|
|
64
36
|
},
|
|
37
|
+
"./compatibility/draft-mode.compat": "./dist/compatibility/draft-mode.compat.js",
|
|
38
|
+
"./export-mocks": "./dist/export-mocks/index.js",
|
|
65
39
|
"./headers.mock": {
|
|
66
40
|
"types": "./dist/export-mocks/headers/index.d.ts",
|
|
67
|
-
"
|
|
68
|
-
"require": "./dist/export-mocks/headers/index.js"
|
|
41
|
+
"default": "./dist/export-mocks/headers/index.js"
|
|
69
42
|
},
|
|
43
|
+
"./image-context": "./dist/image-context.js",
|
|
44
|
+
"./images/next-image": "./dist/images/next-image.js",
|
|
45
|
+
"./images/next-legacy-image": "./dist/images/next-legacy-image.js",
|
|
70
46
|
"./navigation.mock": {
|
|
71
47
|
"types": "./dist/export-mocks/navigation/index.d.ts",
|
|
72
|
-
"
|
|
73
|
-
"require": "./dist/export-mocks/navigation/index.js"
|
|
74
|
-
},
|
|
75
|
-
"./router.mock": {
|
|
76
|
-
"types": "./dist/export-mocks/router/index.d.ts",
|
|
77
|
-
"import": "./dist/export-mocks/router/index.mjs",
|
|
78
|
-
"require": "./dist/export-mocks/router/index.js"
|
|
48
|
+
"default": "./dist/export-mocks/navigation/index.js"
|
|
79
49
|
},
|
|
50
|
+
"./next-image-loader-stub": "./dist/next-image-loader-stub.js",
|
|
51
|
+
"./next-swc-loader-patch": "./dist/swc/next-swc-loader-patch.js",
|
|
80
52
|
"./node": {
|
|
81
53
|
"types": "./dist/node/index.d.ts",
|
|
82
|
-
"
|
|
83
|
-
"import": "./dist/node/index.mjs",
|
|
84
|
-
"require": "./dist/node/index.js"
|
|
54
|
+
"default": "./dist/node/index.js"
|
|
85
55
|
},
|
|
86
|
-
"./package.json": "./package.json"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
],
|
|
99
|
-
"export-mocks": [
|
|
100
|
-
"dist/export-mocks/index.d.ts"
|
|
101
|
-
],
|
|
102
|
-
"cache.mock": [
|
|
103
|
-
"dist/export-mocks/cache/index.d.ts"
|
|
104
|
-
],
|
|
105
|
-
"headers.mock": [
|
|
106
|
-
"dist/export-mocks/headers/index.d.ts"
|
|
107
|
-
],
|
|
108
|
-
"router.mock": [
|
|
109
|
-
"dist/export-mocks/router/index.d.ts"
|
|
110
|
-
],
|
|
111
|
-
"navigation.mock": [
|
|
112
|
-
"dist/export-mocks/navigation/index.d.ts"
|
|
113
|
-
],
|
|
114
|
-
"node": [
|
|
115
|
-
"dist/node/index.d.ts"
|
|
116
|
-
]
|
|
117
|
-
}
|
|
56
|
+
"./package.json": "./package.json",
|
|
57
|
+
"./preset": "./dist/preset.js",
|
|
58
|
+
"./preview": {
|
|
59
|
+
"types": "./dist/preview.d.ts",
|
|
60
|
+
"default": "./dist/preview.js"
|
|
61
|
+
},
|
|
62
|
+
"./router.mock": {
|
|
63
|
+
"types": "./dist/export-mocks/router/index.d.ts",
|
|
64
|
+
"default": "./dist/export-mocks/router/index.js"
|
|
65
|
+
},
|
|
66
|
+
"./rsc/server-only": "./dist/rsc/server-only.js",
|
|
67
|
+
"./storybook-nextjs-font-loader": "./dist/font/webpack/loader/storybook-nextjs-font-loader.js"
|
|
118
68
|
},
|
|
119
69
|
"files": [
|
|
120
70
|
"dist/**/*",
|
|
@@ -125,8 +75,8 @@
|
|
|
125
75
|
"!src/**/*"
|
|
126
76
|
],
|
|
127
77
|
"scripts": {
|
|
128
|
-
"check": "jiti ../../../scripts/
|
|
129
|
-
"prep": "jiti ../../../scripts/
|
|
78
|
+
"check": "jiti ../../../scripts/check/check-package.ts",
|
|
79
|
+
"prep": "jiti ../../../scripts/build/build-package.ts"
|
|
130
80
|
},
|
|
131
81
|
"dependencies": {
|
|
132
82
|
"@babel/core": "^7.24.4",
|
|
@@ -143,9 +93,9 @@
|
|
|
143
93
|
"@babel/preset-typescript": "^7.24.1",
|
|
144
94
|
"@babel/runtime": "^7.24.4",
|
|
145
95
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
|
|
146
|
-
"@storybook/builder-webpack5": "
|
|
147
|
-
"@storybook/preset-react-webpack": "
|
|
148
|
-
"@storybook/react": "
|
|
96
|
+
"@storybook/builder-webpack5": "10.0.0-beta.0",
|
|
97
|
+
"@storybook/preset-react-webpack": "10.0.0-beta.0",
|
|
98
|
+
"@storybook/react": "10.0.0-beta.0",
|
|
149
99
|
"@types/semver": "^7.3.4",
|
|
150
100
|
"babel-loader": "^9.1.3",
|
|
151
101
|
"css-loader": "^6.7.3",
|
|
@@ -177,9 +127,9 @@
|
|
|
177
127
|
},
|
|
178
128
|
"peerDependencies": {
|
|
179
129
|
"next": "^14.1.0 || ^15.0.0",
|
|
180
|
-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
|
181
|
-
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
|
182
|
-
"storybook": "^
|
|
130
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
131
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
132
|
+
"storybook": "^10.0.0-beta.0",
|
|
183
133
|
"webpack": "^5.0.0"
|
|
184
134
|
},
|
|
185
135
|
"peerDependenciesMeta": {
|
|
@@ -190,39 +140,8 @@
|
|
|
190
140
|
"optional": true
|
|
191
141
|
}
|
|
192
142
|
},
|
|
193
|
-
"engines": {
|
|
194
|
-
"node": ">=20.0.0"
|
|
195
|
-
},
|
|
196
143
|
"publishConfig": {
|
|
197
144
|
"access": "public"
|
|
198
145
|
},
|
|
199
|
-
"
|
|
200
|
-
"entries": [
|
|
201
|
-
"./src/image-context.ts",
|
|
202
|
-
"./src/index.ts",
|
|
203
|
-
"./src/preset.ts",
|
|
204
|
-
"./src/node/index.ts",
|
|
205
|
-
"./src/preview.tsx",
|
|
206
|
-
"./src/export-mocks/index.ts",
|
|
207
|
-
"./src/export-mocks/cache/index.ts",
|
|
208
|
-
"./src/export-mocks/headers/index.ts",
|
|
209
|
-
"./src/export-mocks/router/index.ts",
|
|
210
|
-
"./src/export-mocks/navigation/index.ts",
|
|
211
|
-
"./src/compatibility/draft-mode.compat.ts",
|
|
212
|
-
"./src/next-image-loader-stub.ts",
|
|
213
|
-
"./src/images/decorator.tsx",
|
|
214
|
-
"./src/images/next-legacy-image.tsx",
|
|
215
|
-
"./src/images/next-image.tsx",
|
|
216
|
-
"./src/font/webpack/loader/storybook-nextjs-font-loader.ts",
|
|
217
|
-
"./src/rsc/server-only.ts",
|
|
218
|
-
"./src/swc/next-swc-loader-patch.ts"
|
|
219
|
-
],
|
|
220
|
-
"externals": [
|
|
221
|
-
"sb-original/next/image",
|
|
222
|
-
"sb-original/next/future/image",
|
|
223
|
-
"sb-original/next/legacy/image"
|
|
224
|
-
],
|
|
225
|
-
"platform": "node"
|
|
226
|
-
},
|
|
227
|
-
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
|
|
146
|
+
"gitHead": "a8e7fd8a655c69780bc20b9749d2699e45beae16"
|
|
228
147
|
}
|
package/preset.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export * from './dist/preset.js';
|
|
@@ -52,7 +52,7 @@ export const RightArrow = () => <svg
|
|
|
52
52
|
<h4 className="sb-section-item-heading">Add styling and CSS</h4>
|
|
53
53
|
<p className="sb-section-item-paragraph">Like with web applications, there are many ways to include CSS within Storybook. Learn more about setting up styling within Storybook.</p>
|
|
54
54
|
<a
|
|
55
|
-
href="https://storybook.js.org/docs/configure/styling-and-css/?renderer=react"
|
|
55
|
+
href="https://storybook.js.org/docs/configure/styling-and-css/?renderer=react&ref=configure"
|
|
56
56
|
target="_blank"
|
|
57
57
|
>Learn more<RightArrow /></a>
|
|
58
58
|
</div>
|
|
@@ -67,7 +67,7 @@ export const RightArrow = () => <svg
|
|
|
67
67
|
<h4 className="sb-section-item-heading">Provide context and mocking</h4>
|
|
68
68
|
<p className="sb-section-item-paragraph">Often when a story doesn't render, it's because your component is expecting a specific environment or context (like a theme provider) to be available.</p>
|
|
69
69
|
<a
|
|
70
|
-
href="https://storybook.js.org/docs/writing-stories/decorators/?renderer=react#context-for-mocking"
|
|
70
|
+
href="https://storybook.js.org/docs/writing-stories/decorators/?renderer=react&ref=configure#context-for-mocking"
|
|
71
71
|
target="_blank"
|
|
72
72
|
>Learn more<RightArrow /></a>
|
|
73
73
|
</div>
|
|
@@ -85,7 +85,7 @@ export const RightArrow = () => <svg
|
|
|
85
85
|
`staticDirs` configuration option to specify folders to load when
|
|
86
86
|
starting Storybook.</p>
|
|
87
87
|
<a
|
|
88
|
-
href="https://storybook.js.org/docs/configure/images-and-assets/?renderer=react"
|
|
88
|
+
href="https://storybook.js.org/docs/configure/images-and-assets/?renderer=react&ref=configure"
|
|
89
89
|
target="_blank"
|
|
90
90
|
>Learn more<RightArrow /></a>
|
|
91
91
|
</div>
|
|
@@ -113,7 +113,7 @@ export const RightArrow = () => <svg
|
|
|
113
113
|
<p className="sb-section-item-paragraph">Auto-generate living,
|
|
114
114
|
interactive reference documentation from your components and stories.</p>
|
|
115
115
|
<a
|
|
116
|
-
href="https://storybook.js.org/docs/writing-docs/autodocs/?renderer=react"
|
|
116
|
+
href="https://storybook.js.org/docs/writing-docs/autodocs/?renderer=react&ref=configure"
|
|
117
117
|
target="_blank"
|
|
118
118
|
>Learn more<RightArrow /></a>
|
|
119
119
|
</div>
|
|
@@ -128,7 +128,7 @@ export const RightArrow = () => <svg
|
|
|
128
128
|
<h4 className="sb-section-item-heading">Publish to Chromatic</h4>
|
|
129
129
|
<p className="sb-section-item-paragraph">Publish your Storybook to review and collaborate with your entire team.</p>
|
|
130
130
|
<a
|
|
131
|
-
href="https://storybook.js.org/docs/sharing/publish-storybook/?renderer=react#publish-storybook-with-chromatic"
|
|
131
|
+
href="https://storybook.js.org/docs/sharing/publish-storybook/?renderer=react&ref=configure#publish-storybook-with-chromatic"
|
|
132
132
|
target="_blank"
|
|
133
133
|
>Learn more<RightArrow /></a>
|
|
134
134
|
</div>
|
|
@@ -144,7 +144,7 @@ export const RightArrow = () => <svg
|
|
|
144
144
|
<p className="sb-section-item-paragraph">Embed your stories into Figma to cross-reference the design and live
|
|
145
145
|
implementation in one place.</p>
|
|
146
146
|
<a
|
|
147
|
-
href="https://storybook.js.org/docs/sharing/design-integrations/?renderer=react#embed-storybook-in-figma-with-the-plugin"
|
|
147
|
+
href="https://storybook.js.org/docs/sharing/design-integrations/?renderer=react&ref=configure#embed-storybook-in-figma-with-the-plugin"
|
|
148
148
|
target="_blank"
|
|
149
149
|
>Learn more<RightArrow /></a>
|
|
150
150
|
</div>
|
|
@@ -160,7 +160,7 @@ export const RightArrow = () => <svg
|
|
|
160
160
|
<p className="sb-section-item-paragraph">Use stories to test a component in all its variations, no matter how
|
|
161
161
|
complex.</p>
|
|
162
162
|
<a
|
|
163
|
-
href="https://storybook.js.org/docs/writing-tests/?renderer=react"
|
|
163
|
+
href="https://storybook.js.org/docs/writing-tests/?renderer=react&ref=configure"
|
|
164
164
|
target="_blank"
|
|
165
165
|
>Learn more<RightArrow /></a>
|
|
166
166
|
</div>
|
|
@@ -175,7 +175,7 @@ export const RightArrow = () => <svg
|
|
|
175
175
|
<h4 className="sb-section-item-heading">Accessibility</h4>
|
|
176
176
|
<p className="sb-section-item-paragraph">Automatically test your components for a11y issues as you develop.</p>
|
|
177
177
|
<a
|
|
178
|
-
href="https://storybook.js.org/docs/writing-tests/accessibility-testing/?renderer=react"
|
|
178
|
+
href="https://storybook.js.org/docs/writing-tests/accessibility-testing/?renderer=react&ref=configure"
|
|
179
179
|
target="_blank"
|
|
180
180
|
>Learn more<RightArrow /></a>
|
|
181
181
|
</div>
|
|
@@ -190,7 +190,7 @@ export const RightArrow = () => <svg
|
|
|
190
190
|
<h4 className="sb-section-item-heading">Theming</h4>
|
|
191
191
|
<p className="sb-section-item-paragraph">Theme Storybook's UI to personalize it to your project.</p>
|
|
192
192
|
<a
|
|
193
|
-
href="https://storybook.js.org/docs/configure/theming/?renderer=react"
|
|
193
|
+
href="https://storybook.js.org/docs/configure/theming/?renderer=react&ref=configure"
|
|
194
194
|
target="_blank"
|
|
195
195
|
>Learn more<RightArrow /></a>
|
|
196
196
|
</div>
|
|
@@ -202,7 +202,7 @@ export const RightArrow = () => <svg
|
|
|
202
202
|
<h4>Addons</h4>
|
|
203
203
|
<p className="sb-section-item-paragraph">Integrate your tools with Storybook to connect workflows.</p>
|
|
204
204
|
<a
|
|
205
|
-
href="https://storybook.js.org/addons
|
|
205
|
+
href="https://storybook.js.org/addons/?ref=configure"
|
|
206
206
|
target="_blank"
|
|
207
207
|
>Discover all addons<RightArrow /></a>
|
|
208
208
|
</div>
|
|
@@ -281,7 +281,7 @@ export const RightArrow = () => <svg
|
|
|
281
281
|
<p>Follow guided walkthroughs on for key workflows.</p>
|
|
282
282
|
|
|
283
283
|
<a
|
|
284
|
-
href="https://storybook.js.org/tutorials
|
|
284
|
+
href="https://storybook.js.org/tutorials/?ref=configure"
|
|
285
285
|
target="_blank"
|
|
286
286
|
>Discover tutorials<RightArrow /></a>
|
|
287
287
|
</div>
|
|
@@ -52,7 +52,7 @@ export const RightArrow = () => <svg
|
|
|
52
52
|
<h4 className="sb-section-item-heading">Add styling and CSS</h4>
|
|
53
53
|
<p className="sb-section-item-paragraph">Like with web applications, there are many ways to include CSS within Storybook. Learn more about setting up styling within Storybook.</p>
|
|
54
54
|
<a
|
|
55
|
-
href="https://storybook.js.org/docs/configure/styling-and-css/?renderer=react"
|
|
55
|
+
href="https://storybook.js.org/docs/configure/styling-and-css/?renderer=react&ref=configure"
|
|
56
56
|
target="_blank"
|
|
57
57
|
>Learn more<RightArrow /></a>
|
|
58
58
|
</div>
|
|
@@ -67,7 +67,7 @@ export const RightArrow = () => <svg
|
|
|
67
67
|
<h4 className="sb-section-item-heading">Provide context and mocking</h4>
|
|
68
68
|
<p className="sb-section-item-paragraph">Often when a story doesn't render, it's because your component is expecting a specific environment or context (like a theme provider) to be available.</p>
|
|
69
69
|
<a
|
|
70
|
-
href="https://storybook.js.org/docs/writing-stories/decorators/?renderer=react#context-for-mocking"
|
|
70
|
+
href="https://storybook.js.org/docs/writing-stories/decorators/?renderer=react&ref=configure#context-for-mocking"
|
|
71
71
|
target="_blank"
|
|
72
72
|
>Learn more<RightArrow /></a>
|
|
73
73
|
</div>
|
|
@@ -85,7 +85,7 @@ export const RightArrow = () => <svg
|
|
|
85
85
|
`staticDirs` configuration option to specify folders to load when
|
|
86
86
|
starting Storybook.</p>
|
|
87
87
|
<a
|
|
88
|
-
href="https://storybook.js.org/docs/configure/images-and-assets/?renderer=react"
|
|
88
|
+
href="https://storybook.js.org/docs/configure/images-and-assets/?renderer=react&ref=configure"
|
|
89
89
|
target="_blank"
|
|
90
90
|
>Learn more<RightArrow /></a>
|
|
91
91
|
</div>
|
|
@@ -113,7 +113,7 @@ export const RightArrow = () => <svg
|
|
|
113
113
|
<p className="sb-section-item-paragraph">Auto-generate living,
|
|
114
114
|
interactive reference documentation from your components and stories.</p>
|
|
115
115
|
<a
|
|
116
|
-
href="https://storybook.js.org/docs/writing-docs/autodocs/?renderer=react"
|
|
116
|
+
href="https://storybook.js.org/docs/writing-docs/autodocs/?renderer=react&ref=configure"
|
|
117
117
|
target="_blank"
|
|
118
118
|
>Learn more<RightArrow /></a>
|
|
119
119
|
</div>
|
|
@@ -128,7 +128,7 @@ export const RightArrow = () => <svg
|
|
|
128
128
|
<h4 className="sb-section-item-heading">Publish to Chromatic</h4>
|
|
129
129
|
<p className="sb-section-item-paragraph">Publish your Storybook to review and collaborate with your entire team.</p>
|
|
130
130
|
<a
|
|
131
|
-
href="https://storybook.js.org/docs/sharing/publish-storybook/?renderer=react#publish-storybook-with-chromatic"
|
|
131
|
+
href="https://storybook.js.org/docs/sharing/publish-storybook/?renderer=react&ref=configure#publish-storybook-with-chromatic"
|
|
132
132
|
target="_blank"
|
|
133
133
|
>Learn more<RightArrow /></a>
|
|
134
134
|
</div>
|
|
@@ -144,7 +144,7 @@ export const RightArrow = () => <svg
|
|
|
144
144
|
<p className="sb-section-item-paragraph">Embed your stories into Figma to cross-reference the design and live
|
|
145
145
|
implementation in one place.</p>
|
|
146
146
|
<a
|
|
147
|
-
href="https://storybook.js.org/docs/sharing/design-integrations/?renderer=react#embed-storybook-in-figma-with-the-plugin"
|
|
147
|
+
href="https://storybook.js.org/docs/sharing/design-integrations/?renderer=react&ref=configure#embed-storybook-in-figma-with-the-plugin"
|
|
148
148
|
target="_blank"
|
|
149
149
|
>Learn more<RightArrow /></a>
|
|
150
150
|
</div>
|
|
@@ -160,7 +160,7 @@ export const RightArrow = () => <svg
|
|
|
160
160
|
<p className="sb-section-item-paragraph">Use stories to test a component in all its variations, no matter how
|
|
161
161
|
complex.</p>
|
|
162
162
|
<a
|
|
163
|
-
href="https://storybook.js.org/docs/writing-tests/?renderer=react"
|
|
163
|
+
href="https://storybook.js.org/docs/writing-tests/?renderer=react&ref=configure"
|
|
164
164
|
target="_blank"
|
|
165
165
|
>Learn more<RightArrow /></a>
|
|
166
166
|
</div>
|
|
@@ -175,7 +175,7 @@ export const RightArrow = () => <svg
|
|
|
175
175
|
<h4 className="sb-section-item-heading">Accessibility</h4>
|
|
176
176
|
<p className="sb-section-item-paragraph">Automatically test your components for a11y issues as you develop.</p>
|
|
177
177
|
<a
|
|
178
|
-
href="https://storybook.js.org/docs/writing-tests/accessibility-testing/?renderer=react"
|
|
178
|
+
href="https://storybook.js.org/docs/writing-tests/accessibility-testing/?renderer=react&ref=configure"
|
|
179
179
|
target="_blank"
|
|
180
180
|
>Learn more<RightArrow /></a>
|
|
181
181
|
</div>
|
|
@@ -190,7 +190,7 @@ export const RightArrow = () => <svg
|
|
|
190
190
|
<h4 className="sb-section-item-heading">Theming</h4>
|
|
191
191
|
<p className="sb-section-item-paragraph">Theme Storybook's UI to personalize it to your project.</p>
|
|
192
192
|
<a
|
|
193
|
-
href="https://storybook.js.org/docs/configure/theming/?renderer=react"
|
|
193
|
+
href="https://storybook.js.org/docs/configure/theming/?renderer=react&ref=configure"
|
|
194
194
|
target="_blank"
|
|
195
195
|
>Learn more<RightArrow /></a>
|
|
196
196
|
</div>
|
|
@@ -202,7 +202,7 @@ export const RightArrow = () => <svg
|
|
|
202
202
|
<h4>Addons</h4>
|
|
203
203
|
<p className="sb-section-item-paragraph">Integrate your tools with Storybook to connect workflows.</p>
|
|
204
204
|
<a
|
|
205
|
-
href="https://storybook.js.org/addons
|
|
205
|
+
href="https://storybook.js.org/addons/?ref=configure"
|
|
206
206
|
target="_blank"
|
|
207
207
|
>Discover all addons<RightArrow /></a>
|
|
208
208
|
</div>
|
|
@@ -281,7 +281,7 @@ export const RightArrow = () => <svg
|
|
|
281
281
|
<p>Follow guided walkthroughs on for key workflows.</p>
|
|
282
282
|
|
|
283
283
|
<a
|
|
284
|
-
href="https://storybook.js.org/tutorials
|
|
284
|
+
href="https://storybook.js.org/tutorials/?ref=configure"
|
|
285
285
|
target="_blank"
|
|
286
286
|
>Discover tutorials<RightArrow /></a>
|
|
287
287
|
</div>
|