@storybook/react 10.5.6 → 10.5.8

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.
@@ -1 +1,2 @@
1
- export { createPlaywrightTest as createTest } from 'storybook/preview-api';
1
+ import { createPlaywrightTest as createTest } from "storybook/preview-api";
2
+ export { createTest };
package/dist/preset.js CHANGED
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_ltww5gagp4p from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_ltww5gagp4p from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_ltww5gagp4p from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ov3f8v3gowp from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ov3f8v3gowp from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ov3f8v3gowp from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_ltww5gagp4p.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_ltww5gagp4p.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_ltww5gagp4p.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ov3f8v3gowp.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ov3f8v3gowp.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ov3f8v3gowp.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -23,7 +23,7 @@ import {
23
23
  parseWithReactDocgen,
24
24
  path,
25
25
  resolveStoryFileComponents
26
- } from "./_node-chunks/chunk-BXP3UZ6D.js";
26
+ } from "./_node-chunks/chunk-3BHIAQLV.js";
27
27
 
28
28
  // src/preset.ts
29
29
  import path2, { join as join2 } from "node:path";
@@ -211,7 +211,8 @@ var extractArgTypesFromDocgen = ({
211
211
  import { logger as logger2 } from "storybook/internal/node-logger";
212
212
 
213
213
  // src/componentManifest/reactDocgen/utils.ts
214
- import { dirname as dirname2 } from "path";
214
+ import { findTsconfigPathForFile } from "storybook/internal/common";
215
+ import { dirname as dirname2 } from "node:path";
215
216
  var REACT_NODE_TYPES = /* @__PURE__ */ new Set([
216
217
  "JSX.Element",
217
218
  "ComponentType",
@@ -238,10 +239,10 @@ var REACT_NODE_TYPES = /* @__PURE__ */ new Set([
238
239
  "any",
239
240
  "unknown"
240
241
  ]);
241
- var getTsConfig = async () => {
242
+ var getTsConfig = async (componentFilePath) => {
242
243
  try {
243
- let ts = await import("typescript"), tsconfigPath = ts.findConfigFile(process.cwd(), ts.sys.fileExists);
244
- if (console.log({ tsconfigPath }), tsconfigPath === void 0)
244
+ let ts = await import("typescript"), tsconfigPath = componentFilePath ? findTsconfigPathForFile(dirname2(componentFilePath), componentFilePath) : ts.findConfigFile(process.cwd(), ts.sys.fileExists);
245
+ if (tsconfigPath === void 0)
245
246
  return {};
246
247
  let basePath = dirname2(tsconfigPath), { config, error } = ts.readConfigFile(tsconfigPath, ts.sys.readFile);
247
248
  return error ? {} : ts.parseJsonConfigFileContent(config, ts.sys, basePath, {}, tsconfigPath).options;
@@ -263,7 +264,7 @@ var extractArgTypesFromDocgenTypescript = async ({
263
264
  propFilter: (prop) => prop.parent ? !/node_modules/.test(prop.parent.fileName) : !0,
264
265
  // We *need* this set so that RDT returns default values in the same format as react-docgen
265
266
  savePropValueAsString: !0
266
- }, tsConfig = await getTsConfig(), mergedOptions = {
267
+ }, tsConfig = await getTsConfig(componentFilePath), mergedOptions = {
267
268
  ...defaultOptions,
268
269
  ...reactDocgenTypescriptOptions,
269
270
  // Always ensure savePropValueAsString is true for consistency