storybook 9.1.0-alpha.8 → 9.1.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.
Files changed (39) hide show
  1. package/dist/bin/index.cjs +66 -66
  2. package/dist/bin/index.js +65 -65
  3. package/dist/cli/bin/index.cjs +69 -69
  4. package/dist/cli/bin/index.js +61 -61
  5. package/dist/common/index.cjs +2097 -2097
  6. package/dist/common/index.js +3192 -3192
  7. package/dist/components/index.cjs +289 -290
  8. package/dist/components/index.js +2 -3
  9. package/dist/core-server/index.cjs +4 -1
  10. package/dist/core-server/index.js +4 -1
  11. package/dist/core-server/presets/common-manager.js +2243 -2228
  12. package/dist/core-server/presets/common-preset.cjs +85033 -5227
  13. package/dist/core-server/presets/common-preset.js +85104 -5288
  14. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.cjs +28728 -0
  15. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +28729 -0
  16. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.cjs +29339 -0
  17. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +29340 -0
  18. package/dist/csf/index.cjs +40 -41
  19. package/dist/csf/index.js +2 -3
  20. package/dist/instrumenter/index.cjs +370 -352
  21. package/dist/instrumenter/index.d.ts +24 -3
  22. package/dist/instrumenter/index.js +268 -250
  23. package/dist/manager/globals-module-info.cjs +1 -0
  24. package/dist/manager/globals-module-info.js +1 -0
  25. package/dist/manager/globals-runtime.js +836 -815
  26. package/dist/manager-api/index.cjs +1 -1
  27. package/dist/manager-api/index.js +1 -1
  28. package/dist/preview/runtime.js +4295 -4267
  29. package/dist/preview-api/index.cjs +43 -37
  30. package/dist/preview-api/index.d.ts +3 -1
  31. package/dist/preview-api/index.js +234 -227
  32. package/dist/telemetry/index.cjs +1748 -1658
  33. package/dist/telemetry/index.d.ts +2 -1
  34. package/dist/telemetry/index.js +1783 -1694
  35. package/dist/test/index.cjs +284 -280
  36. package/dist/test/index.d.ts +8 -1
  37. package/dist/test/index.js +5 -1
  38. package/package.json +14 -1
  39. package/templates/mocker-runtime.template.js +89 -0
@@ -11818,9 +11818,8 @@ import { lighten as I3, styled as z3 } from "storybook/theming";
11818
11818
  function Sf() {
11819
11819
  try {
11820
11820
  return (
11821
- // @ts-expect-error this property exists in certain environments
11822
- !!globalThis.__vitest_browser__ || // @ts-expect-error this property exists in certain environments
11823
- !!globalThis.__playwright__binding__
11821
+ // @ts-expect-error This property exists in Vitest browser mode
11822
+ !!globalThis.__vitest_browser__ || !!globalThis.window?.navigator?.userAgent?.match(/StorybookTestRunner/)
11824
11823
  );
11825
11824
  } catch {
11826
11825
  return !1;
@@ -37841,7 +37841,8 @@ var UG = /* @__PURE__ */ s(async (e, t) => {
37841
37841
  ...c
37842
37842
  }).filter(
37843
37843
  ([g]) => Fl.versions[g] || yT[g]
37844
- ).map(([g, b]) => b).find((g) => g && $o.default.validRange(g) && !$o.default.satisfies(r, g)), f = Fl.versions[u], d, m;
37844
+ ).map(([g, b]) => b).find((g) => g && // We can't check compatibility for 0.x packages, so we skip them
37845
+ !/^[~^]?0\./.test(g) && $o.default.validRange(g) && !$o.default.satisfies(r, g)), f = Fl.versions[u], d, m;
37845
37846
  return f && a && $o.default.gt(r, a) && (d = r), f && a && $o.default.gt(a, r) && (m = a), {
37846
37847
  packageName: u,
37847
37848
  packageVersion: a,
@@ -37858,6 +37859,8 @@ var UG = /* @__PURE__ */ s(async (e, t) => {
37858
37859
  ), { packageName: e };
37859
37860
  }
37860
37861
  }, "checkPackageCompatibility"), ET = /* @__PURE__ */ s(async (e) => {
37862
+ if (e.currentStorybookVersion.includes("0.0.0"))
37863
+ return [];
37861
37864
  let t = e.packageManager.getAllDependencies(), r = Object.keys(t).filter((i) => i.includes("storybook"));
37862
37865
  if (r.length === 0 && !e.skipErrors)
37863
37866
  throw new Error("No Storybook dependencies found in the package.json");
@@ -37899,7 +37899,8 @@ var cX = /* @__PURE__ */ s(async (e, t) => {
37899
37899
  ...c
37900
37900
  }).filter(
37901
37901
  ([g]) => eg[g] || mk[g]
37902
- ).map(([g, b]) => b).find((g) => g && Yu.validRange(g) && !Yu.satisfies(r, g)), f = eg[u], d, m;
37902
+ ).map(([g, b]) => b).find((g) => g && // We can't check compatibility for 0.x packages, so we skip them
37903
+ !/^[~^]?0\./.test(g) && Yu.validRange(g) && !Yu.satisfies(r, g)), f = eg[u], d, m;
37903
37904
  return f && a && Yu.gt(r, a) && (d = r), f && a && Yu.gt(a, r) && (m = a), {
37904
37905
  packageName: u,
37905
37906
  packageVersion: a,
@@ -37916,6 +37917,8 @@ var cX = /* @__PURE__ */ s(async (e, t) => {
37916
37917
  ), { packageName: e };
37917
37918
  }
37918
37919
  }, "checkPackageCompatibility"), gk = /* @__PURE__ */ s(async (e) => {
37920
+ if (e.currentStorybookVersion.includes("0.0.0"))
37921
+ return [];
37919
37922
  let t = e.packageManager.getAllDependencies(), r = Object.keys(t).filter((i) => i.includes("storybook"));
37920
37923
  if (r.length === 0 && !e.skipErrors)
37921
37924
  throw new Error("No Storybook dependencies found in the package.json");