storybook 10.1.0-alpha.12 → 10.1.0-alpha.13
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-74YHFU5B.js → chunk-2XZMBGTA.js} +1 -1
- package/dist/_browser-chunks/{chunk-EBHB6RPS.js → chunk-FQ7SLVLR.js} +6 -1
- package/dist/_browser-chunks/{chunk-X3DUQ5RA.js → chunk-GFY5R5EY.js} +1 -1
- package/dist/_node-chunks/{builder-manager-YUOHSIUB.js → builder-manager-DWDUVXZM.js} +27 -22
- package/dist/_node-chunks/{chunk-B6JWY6PC.js → camelcase-EETCRTJX.js} +8 -8
- package/dist/_node-chunks/{chunk-CZ5GHJCC.js → chunk-2W4GZCLE.js} +7 -7
- package/dist/_node-chunks/{chunk-E5FJS66Z.js → chunk-447655DM.js} +6 -6
- package/dist/_node-chunks/{chunk-WFLWJO24.js → chunk-4EJUC2SD.js} +4998 -1685
- package/dist/_node-chunks/chunk-4ZJOH2UN.js +61 -0
- package/dist/_node-chunks/chunk-654SJIMS.js +23 -0
- package/dist/_node-chunks/{chunk-2DMESZFJ.js → chunk-7IAVT2FU.js} +7 -7
- package/dist/_node-chunks/{chunk-5KLIDWFN.js → chunk-7KFHRNOT.js} +7 -7
- package/dist/_node-chunks/{chunk-XXPJ7XR3.js → chunk-AZIPBEBK.js} +6 -6
- package/dist/_node-chunks/{chunk-WUXQMQCB.js → chunk-B76FDKVB.js} +6 -6
- package/dist/_node-chunks/chunk-B7PGKETD.js +3781 -0
- package/dist/_node-chunks/{chunk-EZWWR7AR.js → chunk-CLUBH2LP.js} +55 -36
- package/dist/_node-chunks/{chunk-DUXPWBOK.js → chunk-CMYD2JNN.js} +7 -7
- package/dist/_node-chunks/{chunk-QCO2ZM7F.js → chunk-DIPKXLEP.js} +55 -32
- package/dist/_node-chunks/{chunk-DWXTZT3D.js → chunk-DPFYWXEA.js} +6 -6
- package/dist/_node-chunks/{chunk-FZLRAH4N.js → chunk-FCVNHU2F.js} +7 -7
- package/dist/_node-chunks/{chunk-QYQIZBS6.js → chunk-JQ7RQS5Q.js} +6 -6
- package/dist/_node-chunks/chunk-LEL5OSY3.js +18 -0
- package/dist/_node-chunks/{chunk-WA6KZQZ2.js → chunk-LPKSBF62.js} +6 -6
- package/dist/_node-chunks/chunk-LYEZOJ43.js +78 -0
- package/dist/_node-chunks/{chunk-JARUEMEP.js → chunk-MIA5324I.js} +7 -7
- package/dist/_node-chunks/{chunk-A4APXFQ2.js → chunk-MJM4TEMP.js} +14 -8
- package/dist/_node-chunks/{chunk-NAOYEL54.js → chunk-OVVZIUHS.js} +7 -7
- package/dist/_node-chunks/{chunk-5HV3B5OP.js → chunk-RUUNVQ6W.js} +1104 -13
- package/dist/_node-chunks/{chunk-2D2IODUU.js → chunk-URLNGLC2.js} +51 -71
- package/dist/_node-chunks/{chunk-OP3INKUD.js → chunk-WC2YEQHJ.js} +6 -6
- package/dist/_node-chunks/{chunk-4FT2DHGE.js → chunk-XKRVQL2G.js} +8 -8
- package/dist/_node-chunks/{chunk-SEMIAAWG.js → chunk-Z2OWEMX3.js} +8 -8
- package/dist/_node-chunks/{dist-DS2B5A3J.js → dist-22CLJ4BC.js} +9 -9
- package/dist/_node-chunks/{globby-6THB7HVX.js → globby-GR24TGSK.js} +9 -9
- package/dist/_node-chunks/{lib-5NKX4YGG.js → lib-G2LGVRPC.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-ZLT3QOFF.js → mdx-N42X6CFJ-W6P6IDDW.js} +8 -8
- package/dist/_node-chunks/{p-limit-PDMWNG7W.js → p-limit-K4FZHG2F.js} +7 -7
- package/dist/babel/index.js +10 -11
- package/dist/bin/core.js +32 -26
- package/dist/bin/dispatcher.js +31 -20
- package/dist/bin/loader.js +10 -13
- package/dist/cli/index.d.ts +692 -133
- package/dist/cli/index.js +1005 -177
- package/dist/common/index.d.ts +139 -62
- package/dist/common/index.js +63 -49
- package/dist/core-server/index.d.ts +3 -2
- package/dist/core-server/index.js +96 -1413
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +25 -65
- package/dist/csf-tools/index.js +9 -9
- package/dist/manager/globals-runtime.js +32 -3
- package/dist/manager/runtime.js +1 -1
- package/dist/manager-api/index.d.ts +1 -1
- package/dist/manager-api/index.js +4 -4
- package/dist/manager-errors.d.ts +6 -0
- package/dist/manager-errors.js +2 -2
- package/dist/mocking-utils/index.d.ts +1126 -0
- package/dist/{_node-chunks/chunk-ZXSD6L3S.js → mocking-utils/index.js} +441 -16
- package/dist/node-logger/index.d.ts +192 -24
- package/dist/node-logger/index.js +23 -3148
- package/dist/preview/runtime.js +31 -2
- package/dist/preview-api/index.d.ts +69 -68
- package/dist/preview-errors.d.ts +6 -0
- package/dist/preview-errors.js +2 -2
- package/dist/server-errors.d.ts +31 -1
- package/dist/server-errors.js +17 -10
- package/dist/telemetry/index.d.ts +23 -2
- package/dist/telemetry/index.js +25 -24
- package/dist/types/index.d.ts +71 -8
- package/dist/types/index.js +25 -1
- package/package.json +7 -9
- package/dist/_node-chunks/camelcase-JREIL7NV.js +0 -18
- package/dist/_node-chunks/chunk-FDXFVHIL.js +0 -1114
- package/dist/_node-chunks/chunk-HZG65SU3.js +0 -34
- package/dist/_node-chunks/chunk-IXVYNBMD.js +0 -18
- package/dist/_node-chunks/chunk-LIH7MTP7.js +0 -3214
- package/dist/_node-chunks/chunk-N5GIRUP5.js +0 -1047
- package/dist/_node-chunks/chunk-O5DA7YLO.js +0 -3171
- package/dist/_node-chunks/chunk-TS2UUH2J.js +0 -301
- package/dist/_node-chunks/chunk-Y4E6IGQF.js +0 -61
- package/dist/_node-chunks/chunk-ZL3AFKRX.js +0 -1029
- package/dist/_node-chunks/plugin-6XMWOGPO.js +0 -123
- package/dist/_node-chunks/plugin-LTOXVT6A.js +0 -109
- package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-2SFE5LQS.js +0 -46582
- package/dist/_node-chunks/webpack-mock-plugin-CX5J2U56.js +0 -92
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +0 -32
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +0 -28
|
@@ -26,7 +26,12 @@ var StorybookError = class _StorybookError extends Error {
|
|
|
26
26
|
this.data = {};
|
|
27
27
|
/** Flag used to easily determine if the error originates from Storybook. */
|
|
28
28
|
this.fromStorybook = !0;
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Flag used to determine if the error is handled by us and should therefore not be shown to the
|
|
31
|
+
* user.
|
|
32
|
+
*/
|
|
33
|
+
this.isHandledError = !1;
|
|
34
|
+
this.category = props.category, this.documentation = props.documentation ?? !1, this.code = props.code, this.isHandledError = props.isHandledError ?? !1, this.name = props.name;
|
|
30
35
|
}
|
|
31
36
|
get fullErrorCode() {
|
|
32
37
|
return parseErrorCode({ code: this.code, category: this.category });
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorybookError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FQ7SLVLR.js";
|
|
4
4
|
|
|
5
5
|
// src/manager-errors.ts
|
|
6
6
|
var Category = /* @__PURE__ */ ((Category2) => (Category2.MANAGER_UNCAUGHT = "MANAGER_UNCAUGHT", Category2.MANAGER_UI = "MANAGER_UI", Category2.MANAGER_API = "MANAGER_API", Category2.MANAGER_CLIENT_LOGGER = "MANAGER_CLIENT-LOGGER", Category2.MANAGER_CHANNELS = "MANAGER_CHANNELS", Category2.MANAGER_CORE_EVENTS = "MANAGER_CORE-EVENTS", Category2.MANAGER_ROUTER = "MANAGER_ROUTER", Category2.MANAGER_THEMING = "MANAGER_THEMING", Category2))(Category || {}), ProviderDoesNotExtendBaseProviderError = class extends StorybookError {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h0pwn2pcb57 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h0pwn2pcb57 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h0pwn2pcb57 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h0pwn2pcb57.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h0pwn2pcb57.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h0pwn2pcb57.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -13,21 +13,21 @@ import {
|
|
|
13
13
|
BROWSER_TARGETS,
|
|
14
14
|
NODE_TARGET,
|
|
15
15
|
SUPPORTED_FEATURES
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AZIPBEBK.js";
|
|
17
17
|
import {
|
|
18
18
|
require_build
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-2W4GZCLE.js";
|
|
20
20
|
import {
|
|
21
21
|
resolveModulePath,
|
|
22
22
|
resolvePackageDir
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-MJM4TEMP.js";
|
|
24
24
|
import {
|
|
25
25
|
join,
|
|
26
26
|
parse
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-LPKSBF62.js";
|
|
28
28
|
import {
|
|
29
29
|
slash
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-447655DM.js";
|
|
31
31
|
import {
|
|
32
32
|
__commonJS,
|
|
33
33
|
__esm,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
__require,
|
|
36
36
|
__toCommonJS,
|
|
37
37
|
__toESM
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-WC2YEQHJ.js";
|
|
39
39
|
|
|
40
40
|
// ../node_modules/tslib/tslib.es6.mjs
|
|
41
41
|
var tslib_es6_exports = {};
|
|
@@ -1781,7 +1781,15 @@ var exports_default = {
|
|
|
1781
1781
|
"stringifyQuery",
|
|
1782
1782
|
"useNavigate"
|
|
1783
1783
|
],
|
|
1784
|
-
"storybook/internal/types": [
|
|
1784
|
+
"storybook/internal/types": [
|
|
1785
|
+
"Addon_TypesEnum",
|
|
1786
|
+
"CoreWebpackCompiler",
|
|
1787
|
+
"Feature",
|
|
1788
|
+
"SupportedBuilder",
|
|
1789
|
+
"SupportedFramework",
|
|
1790
|
+
"SupportedLanguage",
|
|
1791
|
+
"SupportedRenderer"
|
|
1792
|
+
]
|
|
1785
1793
|
};
|
|
1786
1794
|
|
|
1787
1795
|
// src/manager/globals/globals.ts
|
|
@@ -1911,16 +1919,13 @@ function sanitizePath(file, addonsDir) {
|
|
|
1911
1919
|
|
|
1912
1920
|
// src/builder-manager/utils/framework.ts
|
|
1913
1921
|
import { sep } from "node:path";
|
|
1914
|
-
import {
|
|
1915
|
-
extractProperRendererNameFromFramework,
|
|
1916
|
-
getFrameworkName
|
|
1917
|
-
} from "storybook/internal/common";
|
|
1922
|
+
import { extractRenderer, getFrameworkName } from "storybook/internal/common";
|
|
1918
1923
|
var pluckNameFromConfigProperty = (property) => {
|
|
1919
1924
|
if (property)
|
|
1920
1925
|
return typeof property == "string" ? property : property.name;
|
|
1921
1926
|
}, normalizePath = (packagePath) => packagePath.replaceAll(sep, "/"), pluckStorybookPackageFromPath = (packagePath) => normalizePath(packagePath).match(/(@storybook\/.*)$/)?.[1], pluckThirdPartyPackageFromPath = (packagePath) => normalizePath(packagePath).split("node_modules/")[1] ?? packagePath, buildFrameworkGlobalsFromOptions = async (options) => {
|
|
1922
|
-
let globals = {}, { builder: builder2 } = await options.presets.apply("core"), frameworkName = await getFrameworkName(options);
|
|
1923
|
-
|
|
1927
|
+
let globals = {}, { builder: builder2 } = await options.presets.apply("core"), frameworkName = await getFrameworkName(options), rendererName = await extractRenderer(frameworkName);
|
|
1928
|
+
rendererName && (globals.STORYBOOK_RENDERER = rendererName ?? void 0);
|
|
1924
1929
|
let resolvedPreviewBuilder = pluckNameFromConfigProperty(builder2);
|
|
1925
1930
|
resolvedPreviewBuilder && (globals.STORYBOOK_BUILDER = pluckStorybookPackageFromPath(resolvedPreviewBuilder) ?? pluckThirdPartyPackageFromPath(resolvedPreviewBuilder));
|
|
1926
1931
|
let framework = pluckNameFromConfigProperty(await options.presets.apply("framework"));
|
|
@@ -2038,7 +2043,7 @@ var CORE_DIR_ORIGIN = join(resolvePackageDir("storybook"), "dist/manager"), isRo
|
|
|
2038
2043
|
options,
|
|
2039
2044
|
router
|
|
2040
2045
|
}) {
|
|
2041
|
-
options.quiet || logger.info("
|
|
2046
|
+
options.quiet || logger.info("Starting...");
|
|
2042
2047
|
let {
|
|
2043
2048
|
config,
|
|
2044
2049
|
favicon,
|
|
@@ -2107,7 +2112,7 @@ var CORE_DIR_ORIGIN = join(resolvePackageDir("storybook"), "dist/manager"), isRo
|
|
|
2107
2112
|
}, builder = async function* ({ startTime, options }) {
|
|
2108
2113
|
if (!options.outputDir)
|
|
2109
2114
|
throw new Error("outputDir is required");
|
|
2110
|
-
logger.
|
|
2115
|
+
logger.step("Building manager..");
|
|
2111
2116
|
let {
|
|
2112
2117
|
config,
|
|
2113
2118
|
customHead,
|
|
@@ -2150,7 +2155,7 @@ var CORE_DIR_ORIGIN = join(resolvePackageDir("storybook"), "dist/manager"), isRo
|
|
|
2150
2155
|
options,
|
|
2151
2156
|
globals
|
|
2152
2157
|
);
|
|
2153
|
-
return await Promise.all([writeFile3(join(options.outputDir, "index.html"), html), managerFiles]), logger.trace({ message: "
|
|
2158
|
+
return await Promise.all([writeFile3(join(options.outputDir, "index.html"), html), managerFiles]), logger.trace({ message: "Manager built", time: process.hrtime(startTime) }), {
|
|
2154
2159
|
toJson: () => ({})
|
|
2155
2160
|
};
|
|
2156
2161
|
}, bail = async () => {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h0pwn2pcb57 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h0pwn2pcb57 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h0pwn2pcb57 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h0pwn2pcb57.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h0pwn2pcb57.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h0pwn2pcb57.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 "./chunk-WC2YEQHJ.js";
|
|
12
13
|
|
|
13
14
|
// ../node_modules/camelcase/index.js
|
|
14
15
|
var UPPERCASE = /[\p{Lu}]/u, LOWERCASE = /[\p{Ll}]/u, LEADING_CAPITAL = /^[\p{Lu}](?![\p{Lu}])/gu, IDENTIFIER = /([\p{Alpha}\p{N}_]|$)/u, SEPARATORS = /[_.\- ]+/, LEADING_SEPARATORS = new RegExp("^" + SEPARATORS.source), SEPARATORS_AND_IDENTIFIER = new RegExp(SEPARATORS.source + IDENTIFIER.source, "gu"), NUMBERS_AND_IDENTIFIER = new RegExp("\\d+" + IDENTIFIER.source, "gu"), preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUppercase2) => {
|
|
@@ -31,7 +32,6 @@ function camelCase(input, options) {
|
|
|
31
32
|
let toLowerCase = options.locale === !1 ? (string) => string.toLowerCase() : (string) => string.toLocaleLowerCase(options.locale), toUpperCase = options.locale === !1 ? (string) => string.toUpperCase() : (string) => string.toLocaleUpperCase(options.locale);
|
|
32
33
|
return input.length === 1 ? SEPARATORS.test(input) ? "" : options.pascalCase ? toUpperCase(input) : toLowerCase(input) : (input !== toLowerCase(input) && (input = preserveCamelCase(input, toLowerCase, toUpperCase, options.preserveConsecutiveUppercase)), input = input.replace(LEADING_SEPARATORS, ""), input = options.preserveConsecutiveUppercase ? preserveConsecutiveUppercase(input, toLowerCase) : toLowerCase(input), options.pascalCase && (input = toUpperCase(input.charAt(0)) + input.slice(1)), postProcess(input, toUpperCase));
|
|
33
34
|
}
|
|
34
|
-
|
|
35
35
|
export {
|
|
36
|
-
camelCase
|
|
36
|
+
camelCase as default
|
|
37
37
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h0pwn2pcb57 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h0pwn2pcb57 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h0pwn2pcb57 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h0pwn2pcb57.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h0pwn2pcb57.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h0pwn2pcb57.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,7 +12,7 @@ var require = CJS_COMPAT_NODE_MODULE_57ru1wfqqjv.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
__commonJS,
|
|
14
14
|
__require
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-WC2YEQHJ.js";
|
|
16
16
|
|
|
17
17
|
// ../node_modules/totalist/sync/index.js
|
|
18
18
|
var require_sync = __commonJS({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_h0pwn2pcb57 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_h0pwn2pcb57 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_h0pwn2pcb57 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_h0pwn2pcb57.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_h0pwn2pcb57.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_h0pwn2pcb57.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|