create-storybook 11.0.0-beta.4 → 11.0.0-beta.5

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,4 +1,4 @@
1
- import { createRequire as CJS_COMPAT_CREATE_REQUIRE_4p8n808syhn } from "node:module";var require = CJS_COMPAT_CREATE_REQUIRE_4p8n808syhn(import.meta.url);
1
+ import { createRequire as CJS_COMPAT_CREATE_REQUIRE_hash7n2uwp } from "node:module";var require = CJS_COMPAT_CREATE_REQUIRE_hash7n2uwp(import.meta.url);
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -2424,7 +2424,6 @@ var TypeScriptDependencyCommand = class {
2424
2424
 
2425
2425
  // src/generators/baseGenerator.ts
2426
2426
  import { mkdir } from "node:fs/promises";
2427
- import { dirname as dirname3, join as join4 } from "node:path";
2428
2427
  import { fileURLToPath } from "node:url";
2429
2428
  import {
2430
2429
  cliStoriesTargetPath,
@@ -2442,6 +2441,114 @@ import {
2442
2441
  import { prompt as prompt6 } from "storybook/internal/node-logger";
2443
2442
  import { SupportedFramework as SupportedFramework3, SupportedLanguage as SupportedLanguage3 } from "storybook/internal/types";
2444
2443
 
2444
+ // ../../../node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
2445
+ var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
2446
+ function normalizeWindowsPath(input = "") {
2447
+ return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
2448
+ }
2449
+ var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/, _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/, _EXTNAME_RE = /.(\.[^./]+|\.)$/, _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
2450
+ var normalize = function(path4) {
2451
+ if (path4.length === 0)
2452
+ return ".";
2453
+ path4 = normalizeWindowsPath(path4);
2454
+ let isUNCPath = path4.match(_UNC_REGEX), isPathAbsolute = isAbsolute2(path4), trailingSeparator = path4[path4.length - 1] === "/";
2455
+ return path4 = normalizeString(path4, !isPathAbsolute), path4.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path4 += "/"), _DRIVE_LETTER_RE.test(path4) && (path4 += "/"), isUNCPath ? isPathAbsolute ? `//${path4}` : `//./${path4}` : isPathAbsolute && !isAbsolute2(path4) ? `/${path4}` : path4);
2456
+ }, join3 = function(...segments) {
2457
+ let path4 = "";
2458
+ for (let seg of segments)
2459
+ if (seg)
2460
+ if (path4.length > 0) {
2461
+ let pathTrailing = path4[path4.length - 1] === "/", segLeading = seg[0] === "/";
2462
+ pathTrailing && segLeading ? path4 += seg.slice(1) : path4 += pathTrailing || segLeading ? seg : `/${seg}`;
2463
+ } else
2464
+ path4 += seg;
2465
+ return normalize(path4);
2466
+ };
2467
+ function cwd() {
2468
+ return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
2469
+ }
2470
+ var resolve4 = function(...arguments_) {
2471
+ arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
2472
+ let resolvedPath = "", resolvedAbsolute = !1;
2473
+ for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
2474
+ let path4 = index >= 0 ? arguments_[index] : cwd();
2475
+ !path4 || path4.length === 0 || (resolvedPath = `${path4}/${resolvedPath}`, resolvedAbsolute = isAbsolute2(path4));
2476
+ }
2477
+ return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute2(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
2478
+ };
2479
+ function normalizeString(path4, allowAboveRoot) {
2480
+ let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
2481
+ for (let index = 0; index <= path4.length; ++index) {
2482
+ if (index < path4.length)
2483
+ char = path4[index];
2484
+ else {
2485
+ if (char === "/")
2486
+ break;
2487
+ char = "/";
2488
+ }
2489
+ if (char === "/") {
2490
+ if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
2491
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
2492
+ if (res.length > 2) {
2493
+ let lastSlashIndex = res.lastIndexOf("/");
2494
+ lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
2495
+ continue;
2496
+ } else if (res.length > 0) {
2497
+ res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
2498
+ continue;
2499
+ }
2500
+ }
2501
+ allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
2502
+ } else
2503
+ res.length > 0 ? res += `/${path4.slice(lastSlash + 1, index)}` : res = path4.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
2504
+ lastSlash = index, dots = 0;
2505
+ } else char === "." && dots !== -1 ? ++dots : dots = -1;
2506
+ }
2507
+ return res;
2508
+ }
2509
+ var isAbsolute2 = function(p) {
2510
+ return _IS_ABSOLUTE_RE.test(p);
2511
+ };
2512
+ var extname = function(p) {
2513
+ if (p === "..") return "";
2514
+ let match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
2515
+ return match && match[1] || "";
2516
+ }, relative2 = function(from, to) {
2517
+ let _from = resolve4(from).replace(_ROOT_FOLDER_RE, "$1").split("/"), _to = resolve4(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
2518
+ if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0])
2519
+ return _to.join("/");
2520
+ let _fromCopy = [..._from];
2521
+ for (let segment of _fromCopy) {
2522
+ if (_to[0] !== segment)
2523
+ break;
2524
+ _from.shift(), _to.shift();
2525
+ }
2526
+ return [..._from.map(() => ".."), ..._to].join("/");
2527
+ }, dirname2 = function(p) {
2528
+ let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
2529
+ return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute2(p) ? "/" : ".");
2530
+ };
2531
+ var basename = function(p, extension) {
2532
+ let segments = normalizeWindowsPath(p).split("/"), lastSegment = "";
2533
+ for (let i = segments.length - 1; i >= 0; i--) {
2534
+ let val = segments[i];
2535
+ if (val) {
2536
+ lastSegment = val;
2537
+ break;
2538
+ }
2539
+ }
2540
+ return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
2541
+ }, parse = function(p) {
2542
+ let root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "", base = basename(p), extension = extname(base);
2543
+ return {
2544
+ root,
2545
+ dir: dirname2(p),
2546
+ base,
2547
+ ext: extension,
2548
+ name: base.slice(0, base.length - extension.length)
2549
+ };
2550
+ };
2551
+
2445
2552
  // ../../../node_modules/tiny-invariant/dist/esm/tiny-invariant.js
2446
2553
  var isProduction = process.env.NODE_ENV === "production", prefix = "Invariant failed";
2447
2554
  function invariant(condition, message) {
@@ -2496,7 +2603,7 @@ async function communityPackageSpecifier(packageManager, pkg, storybookVersion =
2496
2603
  // src/generators/configure.ts
2497
2604
  var import_ts_dedent6 = __toESM(require_dist(), 1);
2498
2605
  import { stat, writeFile } from "node:fs/promises";
2499
- import { resolve as resolve4 } from "node:path";
2606
+ import { resolve as resolve5 } from "node:path";
2500
2607
  import { logger as logger10 } from "storybook/internal/node-logger";
2501
2608
  import { Feature as Feature4, SupportedLanguage as SupportedLanguage2, SupportedRenderer as SupportedRenderer2 } from "storybook/internal/types";
2502
2609
  var pathExists = async (path4) => stat(path4).then(() => !0).catch(() => !1);
@@ -2512,7 +2619,7 @@ async function configureMain({
2512
2619
  csfFactories = !1,
2513
2620
  ...custom
2514
2621
  }) {
2515
- let srcPath = resolve4(storybookConfigFolder, "../src"), prefix2 = await pathExists(srcPath) ? "../src" : "../stories", stories = features.has(Feature4.DOCS) ? [`${prefix2}/**/*.mdx`] : [];
2622
+ let srcPath = resolve5(storybookConfigFolder, "../src"), prefix2 = await pathExists(srcPath) ? "../src" : "../stories", stories = features.has(Feature4.DOCS) ? [`${prefix2}/**/*.mdx`] : [];
2516
2623
  stories.push(`${prefix2}/**/*.stories.@(${extensions.join("|")})`);
2517
2624
  let config = {
2518
2625
  stories,
@@ -2588,116 +2695,6 @@ async function configurePreview(options) {
2588
2695
  // src/generators/csf-factories.ts
2589
2696
  import { readdir, readFile, writeFile as writeFile2 } from "node:fs/promises";
2590
2697
  import { SupportedFramework as SupportedFramework2 } from "storybook/internal/types";
2591
-
2592
- // ../../../node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
2593
- var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
2594
- function normalizeWindowsPath(input = "") {
2595
- return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
2596
- }
2597
- var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/, _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/, _EXTNAME_RE = /.(\.[^./]+|\.)$/, _PATH_ROOT_RE = /^[/\\]|^[a-zA-Z]:[/\\]/;
2598
- var normalize = function(path4) {
2599
- if (path4.length === 0)
2600
- return ".";
2601
- path4 = normalizeWindowsPath(path4);
2602
- let isUNCPath = path4.match(_UNC_REGEX), isPathAbsolute = isAbsolute2(path4), trailingSeparator = path4[path4.length - 1] === "/";
2603
- return path4 = normalizeString(path4, !isPathAbsolute), path4.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path4 += "/"), _DRIVE_LETTER_RE.test(path4) && (path4 += "/"), isUNCPath ? isPathAbsolute ? `//${path4}` : `//./${path4}` : isPathAbsolute && !isAbsolute2(path4) ? `/${path4}` : path4);
2604
- }, join3 = function(...segments) {
2605
- let path4 = "";
2606
- for (let seg of segments)
2607
- if (seg)
2608
- if (path4.length > 0) {
2609
- let pathTrailing = path4[path4.length - 1] === "/", segLeading = seg[0] === "/";
2610
- pathTrailing && segLeading ? path4 += seg.slice(1) : path4 += pathTrailing || segLeading ? seg : `/${seg}`;
2611
- } else
2612
- path4 += seg;
2613
- return normalize(path4);
2614
- };
2615
- function cwd() {
2616
- return typeof process < "u" && typeof process.cwd == "function" ? process.cwd().replace(/\\/g, "/") : "/";
2617
- }
2618
- var resolve5 = function(...arguments_) {
2619
- arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
2620
- let resolvedPath = "", resolvedAbsolute = !1;
2621
- for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
2622
- let path4 = index >= 0 ? arguments_[index] : cwd();
2623
- !path4 || path4.length === 0 || (resolvedPath = `${path4}/${resolvedPath}`, resolvedAbsolute = isAbsolute2(path4));
2624
- }
2625
- return resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute), resolvedAbsolute && !isAbsolute2(resolvedPath) ? `/${resolvedPath}` : resolvedPath.length > 0 ? resolvedPath : ".";
2626
- };
2627
- function normalizeString(path4, allowAboveRoot) {
2628
- let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
2629
- for (let index = 0; index <= path4.length; ++index) {
2630
- if (index < path4.length)
2631
- char = path4[index];
2632
- else {
2633
- if (char === "/")
2634
- break;
2635
- char = "/";
2636
- }
2637
- if (char === "/") {
2638
- if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
2639
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
2640
- if (res.length > 2) {
2641
- let lastSlashIndex = res.lastIndexOf("/");
2642
- lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
2643
- continue;
2644
- } else if (res.length > 0) {
2645
- res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
2646
- continue;
2647
- }
2648
- }
2649
- allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
2650
- } else
2651
- res.length > 0 ? res += `/${path4.slice(lastSlash + 1, index)}` : res = path4.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
2652
- lastSlash = index, dots = 0;
2653
- } else char === "." && dots !== -1 ? ++dots : dots = -1;
2654
- }
2655
- return res;
2656
- }
2657
- var isAbsolute2 = function(p) {
2658
- return _IS_ABSOLUTE_RE.test(p);
2659
- };
2660
- var extname = function(p) {
2661
- if (p === "..") return "";
2662
- let match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
2663
- return match && match[1] || "";
2664
- }, relative2 = function(from, to) {
2665
- let _from = resolve5(from).replace(_ROOT_FOLDER_RE, "$1").split("/"), _to = resolve5(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
2666
- if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0])
2667
- return _to.join("/");
2668
- let _fromCopy = [..._from];
2669
- for (let segment of _fromCopy) {
2670
- if (_to[0] !== segment)
2671
- break;
2672
- _from.shift(), _to.shift();
2673
- }
2674
- return [..._from.map(() => ".."), ..._to].join("/");
2675
- }, dirname2 = function(p) {
2676
- let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
2677
- return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute2(p) ? "/" : ".");
2678
- };
2679
- var basename = function(p, extension) {
2680
- let segments = normalizeWindowsPath(p).split("/"), lastSegment = "";
2681
- for (let i = segments.length - 1; i >= 0; i--) {
2682
- let val = segments[i];
2683
- if (val) {
2684
- lastSegment = val;
2685
- break;
2686
- }
2687
- }
2688
- return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
2689
- }, parse = function(p) {
2690
- let root = _PATH_ROOT_RE.exec(p)?.[0]?.replace(/\\/g, "/") || "", base = basename(p), extension = extname(base);
2691
- return {
2692
- root,
2693
- dir: dirname2(p),
2694
- base,
2695
- ext: extension,
2696
- name: base.slice(0, base.length - extension.length)
2697
- };
2698
- };
2699
-
2700
- // src/generators/csf-factories.ts
2701
2698
  var CLI_STORY_FILE = /\.(stories|story)\.(js|jsx|ts|tsx|mjs|mts|mjsx|mtsx|svelte)$/, PREVIEW_IMPORT = /from (['"])[^'"]*\.storybook\/preview\1/g;
2702
2699
  function supportsCsfFactories(framework) {
2703
2700
  switch (framework) {
@@ -2754,14 +2751,14 @@ async function collectStoryFiles(directory) {
2754
2751
  return collected;
2755
2752
  }
2756
2753
  function previewImportFromStory(storyPath, previewConfigPath) {
2757
- let relativePath = relative2(dirname2(resolve5(storyPath)), resolve5(previewConfigPath)), { dir, name } = parse(relativePath), previewPath = dir ? `${dir}/${name}` : name;
2754
+ let relativePath = relative2(dirname2(resolve4(storyPath)), resolve4(previewConfigPath)), { dir, name } = parse(relativePath), previewPath = dir ? `${dir}/${name}` : name;
2758
2755
  return previewPath.startsWith(".") ? previewPath : `./${previewPath}`;
2759
2756
  }
2760
2757
  async function rewriteCopiedStoryPreviewImports({
2761
2758
  destination,
2762
2759
  previewConfigPath
2763
2760
  }) {
2764
- let absolutePreviewConfigPath = resolve5(previewConfigPath), storyFiles = await collectStoryFiles(destination);
2761
+ let absolutePreviewConfigPath = resolve4(previewConfigPath), storyFiles = await collectStoryFiles(destination);
2765
2762
  await Promise.all(
2766
2763
  storyFiles.map(async (filePath) => {
2767
2764
  let source = await readFile(filePath, "utf8"), importPath = previewImportFromStory(filePath, absolutePreviewConfigPath), rewritten = source.replace(PREVIEW_IMPORT, `from '${importPath}'`);
@@ -2928,7 +2925,7 @@ async function baseGenerator(packageManager, npmOptions, {
2928
2925
  extensions,
2929
2926
  language,
2930
2927
  csfFactories,
2931
- ...staticDir ? { staticDirs: [join4("..", staticDir)] } : null,
2928
+ ...staticDir ? { staticDirs: [join3("..", staticDir)] } : null,
2932
2929
  ...extraMain
2933
2930
  }), taskLog.message(`- Configuring preview.${configurationFileExtension}`);
2934
2931
  let { previewConfigPath } = await configurePreview({
@@ -2950,8 +2947,8 @@ async function baseGenerator(packageManager, npmOptions, {
2950
2947
  packageManager,
2951
2948
  language,
2952
2949
  destination,
2953
- commonAssetsDir: join4(
2954
- dirname3(fileURLToPath(import.meta.resolve("create-storybook/package.json"))),
2950
+ commonAssetsDir: join3(
2951
+ dirname2(fileURLToPath(import.meta.resolve("create-storybook/package.json"))),
2955
2952
  "rendererAssets",
2956
2953
  "common"
2957
2954
  ),
@@ -3169,7 +3166,7 @@ var relative3 = function(from, to) {
3169
3166
  _from.shift(), _to.shift();
3170
3167
  }
3171
3168
  return [..._from.map(() => ".."), ..._to].join("/");
3172
- }, dirname4 = function(p) {
3169
+ }, dirname3 = function(p) {
3173
3170
  let segments = normalizeWindowsPath2(p).replace(/\/$/, "").split("/").slice(0, -1);
3174
3171
  return segments.length === 1 && _DRIVE_LETTER_RE2.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute3(p) ? "/" : ".");
3175
3172
  };
@@ -3505,7 +3502,7 @@ var loadTemplate = async (name, replacements) => {
3505
3502
  };
3506
3503
 
3507
3504
  // ../../addons/vitest/src/postinstall.ts
3508
- var ADDON_NAME = "@storybook/addon-vitest", EXTENSIONS = [".ts", ".tsx", ".js", ".jsx", ".cts", ".mts", ".cjs", ".mjs"], STORYBOOK_TEST_PLUGIN_SOURCE2 = `${ADDON_NAME}/vitest-plugin`, getTemplateConfigDir = (configFilePath, configDir) => relative3(dirname4(configFilePath), configDir);
3505
+ var ADDON_NAME = "@storybook/addon-vitest", EXTENSIONS = [".ts", ".tsx", ".js", ".jsx", ".cts", ".mts", ".cjs", ".mjs"], STORYBOOK_TEST_PLUGIN_SOURCE2 = `${ADDON_NAME}/vitest-plugin`, getTemplateConfigDir = (configFilePath, configDir) => relative3(dirname3(configFilePath), configDir);
3509
3506
  async function postInstall(options) {
3510
3507
  let errors = [], { logger: logger20, prompt: prompt13 } = options, packageManager = JsPackageManagerFactory2.getPackageManager({
3511
3508
  force: options.packageManager
@@ -3629,7 +3626,7 @@ async function postInstall(options) {
3629
3626
  https://storybook.js.org/docs/writing-tests/integrations/vitest-addon#manual-setup-advanced
3630
3627
  `), errors.push(new AddonVitestPostinstallConfigUpdateError({ filePath: rootConfig }));
3631
3628
  } else {
3632
- let parentDir = dirname4(options.configDir), newConfigFile = resolve6(parentDir, `vitest.config.${fileExtension}`), configTemplate = await loadTemplate("vitest.config.4.template", {
3629
+ let parentDir = dirname3(options.configDir), newConfigFile = resolve6(parentDir, `vitest.config.${fileExtension}`), configTemplate = await loadTemplate("vitest.config.4.template", {
3633
3630
  CONFIG_DIR: getTemplateConfigDir(newConfigFile, options.configDir)
3634
3631
  });
3635
3632
  logger20.step("Creating a Vitest config file:"), logger20.log(`${newConfigFile}`);
@@ -4032,7 +4029,7 @@ var DependencyCollector = class {
4032
4029
  // src/generators/ANGULAR/index.ts
4033
4030
  var import_semver5 = __toESM(require_semver2(), 1), import_ts_dedent11 = __toESM(require_dist(), 1);
4034
4031
  import { rmSync } from "node:fs";
4035
- import { dirname as dirname5, join as join6 } from "node:path";
4032
+ import { dirname as dirname4, join as join5 } from "node:path";
4036
4033
  import { fileURLToPath as fileURLToPath2 } from "node:url";
4037
4034
  import {
4038
4035
  ANALOG_VITE_PLUGIN_ANGULAR_VERSION,
@@ -4098,13 +4095,13 @@ var ANGULAR_default = {
4098
4095
  });
4099
4096
  let projectTypeValue = projectType || "application";
4100
4097
  projectTypeValue !== "application" && projectTypeValue !== "library" && (projectTypeValue = "application");
4101
- let templateDir = join6(
4102
- dirname5(fileURLToPath2(import.meta.resolve("create-storybook/package.json"))),
4098
+ let templateDir = join5(
4099
+ dirname4(fileURLToPath2(import.meta.resolve("create-storybook/package.json"))),
4103
4100
  "templates",
4104
4101
  "angular",
4105
4102
  projectTypeValue
4106
4103
  );
4107
- templateDir && copyTemplate(templateDir, root || void 0), useCompodoc || rmSync(join6(storybookFolder, "tsconfig.doc.json"), { force: !0 });
4104
+ templateDir && copyTemplate(templateDir, root || void 0), useCompodoc || rmSync(join5(storybookFolder, "tsconfig.doc.json"), { force: !0 });
4108
4105
  let devkitVersion = toDevkitVersion(angularVersion), extraAngularDeps = [
4109
4106
  angularVersion ? `@angular-devkit/build-angular@${angularVersion}` : "@angular-devkit/build-angular",
4110
4107
  devkitVersion ? `@angular-devkit/architect@${devkitVersion}` : "@angular-devkit/architect",
@@ -4204,7 +4201,7 @@ var HTML_default = {
4204
4201
  var import_ts_dedent12 = __toESM(require_dist(), 1);
4205
4202
  import { existsSync as existsSync3 } from "node:fs";
4206
4203
  import { readFile as readFile3 } from "node:fs/promises";
4207
- import { join as join7 } from "node:path";
4204
+ import { join as join6 } from "node:path";
4208
4205
  import { ProjectType as ProjectType8 } from "storybook/internal/cli";
4209
4206
  import { findFilesUp } from "storybook/internal/common";
4210
4207
  import { logger as logger15, prompt as prompt10 } from "storybook/internal/node-logger";
@@ -4259,7 +4256,7 @@ var NEXT_CONFIG_FILES = [
4259
4256
  },
4260
4257
  configure: async (packageManager, context) => {
4261
4258
  let staticDir;
4262
- existsSync3(join7(process.cwd(), "public")) && (staticDir = "public");
4259
+ existsSync3(join6(process.cwd(), "public")) && (staticDir = "public");
4263
4260
  let extraPackages = [];
4264
4261
  return context.builder === SupportedBuilder6.VITE && extraPackages.push("vite"), {
4265
4262
  staticDir,
@@ -4340,7 +4337,7 @@ var REACT_default = {
4340
4337
  };
4341
4338
 
4342
4339
  // src/generators/REACT_NATIVE/index.ts
4343
- import { join as join10 } from "node:path";
4340
+ import { join as join9 } from "node:path";
4344
4341
  import { ProjectType as ProjectType13, copyTemplateFiles as copyTemplateFiles2 } from "storybook/internal/cli";
4345
4342
  import { executeCommand as executeCommand2, versions as versions5 } from "storybook/internal/common";
4346
4343
  import { CLI_COLORS as CLI_COLORS5, logger as logger18, prompt as prompt12 } from "storybook/internal/node-logger";
@@ -4366,14 +4363,14 @@ var import_ts_dedent13 = __toESM(require_dist(), 1);
4366
4363
 
4367
4364
  // src/generators/REACT_NATIVE/generateEntrypoint.ts
4368
4365
  import { mkdir as mkdir2, readFile as readFile4, writeFile as writeFile4 } from "node:fs/promises";
4369
- import path2, { dirname as dirname7, join as join9 } from "node:path";
4366
+ import path2, { dirname as dirname6, join as join8 } from "node:path";
4370
4367
  import { fileURLToPath as fileURLToPath3 } from "node:url";
4371
4368
  import { SupportedLanguage as SupportedLanguage4 } from "storybook/internal/types";
4372
- var ENTRYPOINT_TEMPLATE_DIR = join9(
4373
- dirname7(fileURLToPath3(import.meta.resolve("create-storybook/package.json"))),
4369
+ var ENTRYPOINT_TEMPLATE_DIR = join8(
4370
+ dirname6(fileURLToPath3(import.meta.resolve("create-storybook/package.json"))),
4374
4371
  "templates",
4375
4372
  "react-native"
4376
- ), getEntrypointExtension = (language) => language === SupportedLanguage4.TYPESCRIPT ? "ts" : "js", getEntrypointTemplatePath = (templateVariant = "default") => join9(ENTRYPOINT_TEMPLATE_DIR, templateVariant === "expo" ? "index.expo.js" : "index.js"), generateReactNativeEntrypoint = async ({
4373
+ ), getEntrypointExtension = (language) => language === SupportedLanguage4.TYPESCRIPT ? "ts" : "js", getEntrypointTemplatePath = (templateVariant = "default") => join8(ENTRYPOINT_TEMPLATE_DIR, templateVariant === "expo" ? "index.expo.js" : "index.js"), generateReactNativeEntrypoint = async ({
4377
4374
  language,
4378
4375
  templateVariant = "default",
4379
4376
  cwd: cwd3 = process.cwd()
@@ -4544,7 +4541,7 @@ ${source}`, transformMetroConfigSource = (source, filePath) => {
4544
4541
  if (candidates.length > 1) {
4545
4542
  if (yes)
4546
4543
  return logger17.warn(
4547
- `Multiple Metro config files detected. Non-interactive mode selected ${path3.relative(
4544
+ `Multiple Metro config files detected. Non-interactive mode selected ${relative2(
4548
4545
  process.cwd(),
4549
4546
  candidates[0]
4550
4547
  )}.`
@@ -4552,7 +4549,7 @@ ${source}`, transformMetroConfigSource = (source, filePath) => {
4552
4549
  let selected = await prompt11.select({
4553
4550
  message: "Multiple Metro config files found. Which one should Storybook update?",
4554
4551
  options: candidates.map((candidate) => ({
4555
- label: path3.relative(process.cwd(), candidate),
4552
+ label: relative2(process.cwd(), candidate),
4556
4553
  value: candidate
4557
4554
  }))
4558
4555
  });
@@ -4717,7 +4714,7 @@ var lastMetroCodemodResult, lastScriptDerivationResult, detectReactNativeEntrypo
4717
4714
  ...scriptDerivationResult.scriptsToAdd
4718
4715
  }), context.framework == null) {
4719
4716
  let { packageJson, operationDir } = packageManager.primaryPackageJson;
4720
- applyPreviewImportsMap(packageJson, join10(RN_STORYBOOK_DIR, "preview.tsx"), operationDir) && packageManager.writePackageJson(packageJson, operationDir);
4717
+ applyPreviewImportsMap(packageJson, join9(RN_STORYBOOK_DIR, "preview.tsx"), operationDir) && packageManager.writePackageJson(packageJson, operationDir);
4721
4718
  }
4722
4719
  await copyTemplateFiles2({
4723
4720
  packageManager,
@@ -4783,7 +4780,7 @@ var lastMetroCodemodResult, lastScriptDerivationResult, detectReactNativeEntrypo
4783
4780
  };
4784
4781
 
4785
4782
  // src/generators/REACT_NATIVE_AND_RNW/index.ts
4786
- import { join as join12 } from "node:path";
4783
+ import { join as join11 } from "node:path";
4787
4784
  import { ProjectType as ProjectType15 } from "storybook/internal/cli";
4788
4785
  import {
4789
4786
  SupportedBuilder as SupportedBuilder12,
@@ -4794,7 +4791,7 @@ import {
4794
4791
 
4795
4792
  // src/generators/REACT_NATIVE_WEB/index.ts
4796
4793
  import { readdir as readdir2, rm as rm2 } from "node:fs/promises";
4797
- import { join as join11 } from "node:path";
4794
+ import { join as join10 } from "node:path";
4798
4795
  import { ProjectType as ProjectType14, cliStoriesTargetPath as cliStoriesTargetPath2 } from "storybook/internal/cli";
4799
4796
  import { SupportedBuilder as SupportedBuilder11, SupportedFramework as SupportedFramework11, SupportedRenderer as SupportedRenderer13 } from "storybook/internal/types";
4800
4797
  var REACT_NATIVE_WEB_default = {
@@ -4810,7 +4807,7 @@ var REACT_NATIVE_WEB_default = {
4810
4807
  postConfigure: async () => {
4811
4808
  try {
4812
4809
  let targetPath = await cliStoriesTargetPath2(), cssFiles = (await readdir2(targetPath)).filter((f) => f.endsWith(".css"));
4813
- await Promise.all(cssFiles.map((f) => rm2(join11(targetPath, f))));
4810
+ await Promise.all(cssFiles.map((f) => rm2(join10(targetPath, f))));
4814
4811
  } catch {
4815
4812
  }
4816
4813
  }
@@ -4829,7 +4826,7 @@ var REACT_NATIVE_AND_RNW_default = {
4829
4826
  let configurationResult = await REACT_NATIVE_WEB_default.configure(), previewExtension = context.language === SupportedLanguage6.JAVASCRIPT ? "jsx" : "tsx", { packageJson, operationDir } = packageManager.primaryPackageJson;
4830
4827
  return applyPreviewImportsMap(
4831
4828
  packageJson,
4832
- join12(".storybook", `preview.${previewExtension}`),
4829
+ join11(".storybook", `preview.${previewExtension}`),
4833
4830
  operationDir
4834
4831
  ) && packageManager.writePackageJson(packageJson, operationDir), {
4835
4832
  ...configurationResult,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  initiate
3
- } from "./chunk-FDXHL2R5.js";
3
+ } from "./chunk-FSXKTB5R.js";
4
4
  import "./chunk-KA3D3PZF.js";
5
5
  import {
6
6
  __commonJS,
@@ -2609,7 +2609,7 @@ var import_index = __toESM(require_commander(), 1), {
2609
2609
  } = import_index.default;
2610
2610
 
2611
2611
  // package.json
2612
- var version = "11.0.0-beta.4";
2612
+ var version = "11.0.0-beta.5";
2613
2613
 
2614
2614
  // ../../../node_modules/std-env/dist/index.mjs
2615
2615
  var E = globalThis.process?.env || /* @__PURE__ */ Object.create(null), I = globalThis.process || { env: E }, O = I !== void 0 && I.env && I.env.NODE_ENV || void 0, n = [["claude", ["CLAUDECODE", "CLAUDE_CODE"]], ["replit", ["REPL_ID"]], ["gemini", ["GEMINI_CLI"]], ["codex", ["CODEX_SANDBOX", "CODEX_THREAD_ID"]], ["opencode", ["OPENCODE"]], ["pi", [/* @__PURE__ */ _("PATH", /\.pi[\\/]agent/)]], ["auggie", ["AUGMENT_AGENT"]], ["goose", ["GOOSE_PROVIDER"]], ["junie", ["JUNIE_DATA", "JUNIE_SHIM_PATH"]], ["copilot", ["COPILOT_AGENT", "COPILOT_CLI"]], ["devin", [/* @__PURE__ */ _("EDITOR", /devin/)]], ["cursor", ["CURSOR_AGENT"]], ["kiro", [/* @__PURE__ */ _("TERM_PROGRAM", /kiro/, { noTTY: !0 })]]];
package/dist/bin/index.js CHANGED
@@ -9,4 +9,4 @@ if (!isNodeVersionSupported(process.versions.node)) {
9
9
  You are currently running Node.js ${process.version}.`
10
10
  ), logger.outro(""), process.exit(1);
11
11
  }
12
- await import("../_node-chunks/run-MZ72W7YV.js");
12
+ await import("../_node-chunks/run-I2YA6AGV.js");
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  doInitiate
3
- } from "./_node-chunks/chunk-FDXHL2R5.js";
3
+ } from "./_node-chunks/chunk-FSXKTB5R.js";
4
4
  import "./_node-chunks/chunk-KA3D3PZF.js";
5
5
  import "./_node-chunks/chunk-CFINOCOZ.js";
6
6
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-storybook",
3
- "version": "11.0.0-beta.4",
3
+ "version": "11.0.0-beta.5",
4
4
  "description": "Storybook installer: Develop, document, and test UI components in isolation",
5
5
  "keywords": [
6
6
  "storybook",
@@ -38,7 +38,7 @@
38
38
  "!src/**/*"
39
39
  ],
40
40
  "dependencies": {
41
- "storybook": "11.0.0-beta.4"
41
+ "storybook": "11.0.0-beta.5"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/prompts": "^2.0.9",