@storybook/react-webpack5 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 +5 -1
- package/dist/_node-chunks/chunk-EFZN3O5G.js +17 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -1
- package/dist/node/index.d.ts +24 -5
- package/dist/node/index.js +23 -1
- package/dist/preset.js +54 -1
- package/package.json +22 -37
- package/preset.js +1 -1
- package/dist/index.mjs +0 -2
- package/dist/node/index.mjs +0 -3
- package/dist/preset.d.ts +0 -11
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
# Storybook for React & Webpack
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Develop, document, and test UI components in isolation.
|
|
4
|
+
|
|
5
|
+
See [documentation](https://storybook.js.org/docs/get-started/frameworks/react-webpack5?renderer=react&ref=readme) for installation instructions, usage examples, APIs, and more.
|
|
6
|
+
|
|
7
|
+
Learn more about Storybook at [storybook.js.org](https://storybook.js.org/?ref=readme).
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_1b1ifm7v1tv from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_1b1ifm7v1tv from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_1b1ifm7v1tv from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_1b1ifm7v1tv.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_1b1ifm7v1tv.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_1b1ifm7v1tv.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
var __defProp = Object.defineProperty;
|
|
13
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
__name
|
|
17
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -25,4 +25,4 @@ type StorybookConfigFramework = {
|
|
|
25
25
|
/** The interface for Storybook configuration in `main.ts` files. */
|
|
26
26
|
type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigWebpack | keyof StorybookConfigFramework> & StorybookConfigWebpack & StorybookConfigFramework;
|
|
27
27
|
|
|
28
|
-
export { FrameworkOptions, StorybookConfig };
|
|
28
|
+
export type { FrameworkOptions, StorybookConfig };
|
package/dist/index.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
// src/index.ts
|
|
2
|
+
export * from "@storybook/react";
|
|
3
|
+
import { __definePreview } from "@storybook/react";
|
|
4
|
+
export {
|
|
5
|
+
__definePreview as definePreview
|
|
6
|
+
};
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,8 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '@storybook/
|
|
3
|
-
import 'storybook/
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { CompatibleString } from 'storybook/internal/types';
|
|
2
|
+
import { StorybookConfigWebpack, BuilderOptions, TypescriptOptions } from '@storybook/builder-webpack5';
|
|
3
|
+
import { StorybookConfig as StorybookConfig$1, ReactOptions, TypescriptOptions as TypescriptOptions$1 } from '@storybook/preset-react-webpack';
|
|
4
|
+
|
|
5
|
+
type FrameworkName = CompatibleString<'@storybook/react-webpack5'>;
|
|
6
|
+
type BuilderName = CompatibleString<'@storybook/builder-webpack5'>;
|
|
7
|
+
type FrameworkOptions = ReactOptions & {
|
|
8
|
+
builder?: BuilderOptions;
|
|
9
|
+
};
|
|
10
|
+
type StorybookConfigFramework = {
|
|
11
|
+
framework: FrameworkName | {
|
|
12
|
+
name: FrameworkName;
|
|
13
|
+
options: FrameworkOptions;
|
|
14
|
+
};
|
|
15
|
+
core?: StorybookConfig$1['core'] & {
|
|
16
|
+
builder?: BuilderName | {
|
|
17
|
+
name: BuilderName;
|
|
18
|
+
options: BuilderOptions;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
typescript?: Partial<TypescriptOptions & TypescriptOptions$1> & StorybookConfig$1['typescript'];
|
|
22
|
+
};
|
|
23
|
+
/** The interface for Storybook configuration in `main.ts` files. */
|
|
24
|
+
type StorybookConfig = Omit<StorybookConfig$1, keyof StorybookConfigWebpack | keyof StorybookConfigFramework> & StorybookConfigWebpack & StorybookConfigFramework;
|
|
6
25
|
|
|
7
26
|
declare function defineMain(config: StorybookConfig): StorybookConfig;
|
|
8
27
|
|
package/dist/node/index.js
CHANGED
|
@@ -1 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
import CJS_COMPAT_NODE_URL_1b1ifm7v1tv from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_1b1ifm7v1tv from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_1b1ifm7v1tv from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_1b1ifm7v1tv.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_1b1ifm7v1tv.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_1b1ifm7v1tv.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-EFZN3O5G.js";
|
|
15
|
+
|
|
16
|
+
// src/node/index.ts
|
|
17
|
+
function defineMain(config) {
|
|
18
|
+
return config;
|
|
19
|
+
}
|
|
20
|
+
__name(defineMain, "defineMain");
|
|
21
|
+
export {
|
|
22
|
+
defineMain
|
|
23
|
+
};
|
package/dist/preset.js
CHANGED
|
@@ -1 +1,54 @@
|
|
|
1
|
-
|
|
1
|
+
import CJS_COMPAT_NODE_URL_1b1ifm7v1tv from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_1b1ifm7v1tv from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_1b1ifm7v1tv from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_1b1ifm7v1tv.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_1b1ifm7v1tv.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_1b1ifm7v1tv.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-EFZN3O5G.js";
|
|
15
|
+
|
|
16
|
+
// src/preset.ts
|
|
17
|
+
import { fileURLToPath } from "node:url";
|
|
18
|
+
import { WebpackDefinePlugin } from "@storybook/builder-webpack5";
|
|
19
|
+
var addons = [
|
|
20
|
+
fileURLToPath(import.meta.resolve("@storybook/preset-react-webpack"))
|
|
21
|
+
];
|
|
22
|
+
var core = /* @__PURE__ */ __name(async (config, options) => {
|
|
23
|
+
const framework = await options.presets.apply("framework");
|
|
24
|
+
return {
|
|
25
|
+
...config,
|
|
26
|
+
builder: {
|
|
27
|
+
name: fileURLToPath(import.meta.resolve("@storybook/builder-webpack5")),
|
|
28
|
+
options: typeof framework === "string" ? {} : framework.options.builder || {}
|
|
29
|
+
},
|
|
30
|
+
renderer: fileURLToPath(import.meta.resolve("@storybook/react/preset"))
|
|
31
|
+
};
|
|
32
|
+
}, "core");
|
|
33
|
+
var webpack = /* @__PURE__ */ __name(async (config, options) => {
|
|
34
|
+
config.resolve = config.resolve || {};
|
|
35
|
+
config.resolve.alias = {
|
|
36
|
+
...config.resolve?.alias,
|
|
37
|
+
"@storybook/react": fileURLToPath(import.meta.resolve("@storybook/react"))
|
|
38
|
+
};
|
|
39
|
+
if (options.features?.developmentModeForBuild) {
|
|
40
|
+
config.plugins = [
|
|
41
|
+
// @ts-expect-error Ignore this error, because in the `webpack` preset the user actually hasn't defined a config yet.
|
|
42
|
+
...config.plugins,
|
|
43
|
+
new WebpackDefinePlugin({
|
|
44
|
+
NODE_ENV: JSON.stringify("development")
|
|
45
|
+
})
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
return config;
|
|
49
|
+
}, "webpack");
|
|
50
|
+
export {
|
|
51
|
+
addons,
|
|
52
|
+
core,
|
|
53
|
+
webpack
|
|
54
|
+
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-webpack5",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Storybook for React: Develop
|
|
3
|
+
"version": "10.0.0-beta.0",
|
|
4
|
+
"description": "Storybook for React and Webpack: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
|
-
"storybook"
|
|
6
|
+
"storybook",
|
|
7
|
+
"storybook-framework",
|
|
8
|
+
"react",
|
|
9
|
+
"webpack",
|
|
10
|
+
"component",
|
|
11
|
+
"components"
|
|
7
12
|
],
|
|
8
13
|
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/react-webpack5",
|
|
9
14
|
"bugs": {
|
|
@@ -19,28 +24,19 @@
|
|
|
19
24
|
"url": "https://opencollective.com/storybook"
|
|
20
25
|
},
|
|
21
26
|
"license": "MIT",
|
|
27
|
+
"type": "module",
|
|
22
28
|
"exports": {
|
|
23
29
|
".": {
|
|
24
30
|
"types": "./dist/index.d.ts",
|
|
25
|
-
"
|
|
26
|
-
"import": "./dist/index.mjs",
|
|
27
|
-
"require": "./dist/index.js"
|
|
28
|
-
},
|
|
29
|
-
"./preset": {
|
|
30
|
-
"types": "./dist/preset.d.ts",
|
|
31
|
-
"require": "./dist/preset.js"
|
|
31
|
+
"default": "./dist/index.js"
|
|
32
32
|
},
|
|
33
33
|
"./node": {
|
|
34
34
|
"types": "./dist/node/index.d.ts",
|
|
35
|
-
"
|
|
36
|
-
"import": "./dist/node/index.mjs",
|
|
37
|
-
"require": "./dist/node/index.js"
|
|
35
|
+
"default": "./dist/node/index.js"
|
|
38
36
|
},
|
|
39
|
-
"./package.json": "./package.json"
|
|
37
|
+
"./package.json": "./package.json",
|
|
38
|
+
"./preset": "./dist/preset.js"
|
|
40
39
|
},
|
|
41
|
-
"main": "dist/index.js",
|
|
42
|
-
"module": "dist/index.mjs",
|
|
43
|
-
"types": "dist/index.d.ts",
|
|
44
40
|
"files": [
|
|
45
41
|
"dist/**/*",
|
|
46
42
|
"template/cli/**/*",
|
|
@@ -50,21 +46,21 @@
|
|
|
50
46
|
"!src/**/*"
|
|
51
47
|
],
|
|
52
48
|
"scripts": {
|
|
53
|
-
"check": "jiti ../../../scripts/
|
|
54
|
-
"prep": "jiti ../../../scripts/
|
|
49
|
+
"check": "jiti ../../../scripts/check/check-package.ts",
|
|
50
|
+
"prep": "jiti ../../../scripts/build/build-package.ts"
|
|
55
51
|
},
|
|
56
52
|
"dependencies": {
|
|
57
|
-
"@storybook/builder-webpack5": "
|
|
58
|
-
"@storybook/preset-react-webpack": "
|
|
59
|
-
"@storybook/react": "
|
|
53
|
+
"@storybook/builder-webpack5": "10.0.0-beta.0",
|
|
54
|
+
"@storybook/preset-react-webpack": "10.0.0-beta.0",
|
|
55
|
+
"@storybook/react": "10.0.0-beta.0"
|
|
60
56
|
},
|
|
61
57
|
"devDependencies": {
|
|
62
58
|
"@types/node": "^22.0.0"
|
|
63
59
|
},
|
|
64
60
|
"peerDependencies": {
|
|
65
|
-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
|
66
|
-
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
|
67
|
-
"storybook": "^
|
|
61
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
62
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
63
|
+
"storybook": "^10.0.0-beta.0",
|
|
68
64
|
"typescript": ">= 4.9.x"
|
|
69
65
|
},
|
|
70
66
|
"peerDependenciesMeta": {
|
|
@@ -72,19 +68,8 @@
|
|
|
72
68
|
"optional": true
|
|
73
69
|
}
|
|
74
70
|
},
|
|
75
|
-
"engines": {
|
|
76
|
-
"node": ">=20.0.0"
|
|
77
|
-
},
|
|
78
71
|
"publishConfig": {
|
|
79
72
|
"access": "public"
|
|
80
73
|
},
|
|
81
|
-
"
|
|
82
|
-
"entries": [
|
|
83
|
-
"./src/index.ts",
|
|
84
|
-
"./src/preset.ts",
|
|
85
|
-
"./src/node/index.ts"
|
|
86
|
-
],
|
|
87
|
-
"platform": "node"
|
|
88
|
-
},
|
|
89
|
-
"gitHead": "ce6a1e4a8d5ad69c699021a0b183df89cfc7b684"
|
|
74
|
+
"gitHead": "a8e7fd8a655c69780bc20b9749d2699e45beae16"
|
|
90
75
|
}
|
package/preset.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export * from './dist/preset.js';
|
package/dist/index.mjs
DELETED
package/dist/node/index.mjs
DELETED
package/dist/preset.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { PresetProperty } from 'storybook/internal/types';
|
|
2
|
-
import { StorybookConfig } from './index.js';
|
|
3
|
-
import '@storybook/react';
|
|
4
|
-
import '@storybook/builder-webpack5';
|
|
5
|
-
import '@storybook/preset-react-webpack';
|
|
6
|
-
|
|
7
|
-
declare const addons: PresetProperty<'addons'>;
|
|
8
|
-
declare const core: PresetProperty<'core'>;
|
|
9
|
-
declare const webpack: StorybookConfig['webpack'];
|
|
10
|
-
|
|
11
|
-
export { addons, core, webpack };
|