Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

@storybook/core

Package Overview
Dependencies
Maintainers
11
Versions
1217
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/core - npm Package Compare versions

Comparing version 0.0.0-pr-29223-sha-d3f5ad98 to 0.0.0-pr-29230-sha-6c3a0bb1

4

dist/cli/index.d.ts

@@ -86,3 +86,3 @@ import * as _storybook_core_common from '@storybook/core/common';

declare function detectFrameworkPreset(packageJson?: Partial<Pick<_storybook_core_common.PackageJson, "dependencies" | "devDependencies" | "files" | "peerDependencies">>): ProjectType | null;
declare function detectFrameworkPreset(packageJson?: Partial<Pick<_storybook_core_common.PackageJson, "dependencies" | "peerDependencies" | "files" | "devDependencies">>): ProjectType | null;
/**

@@ -137,3 +137,3 @@ * Attempts to detect which builder to use, by searching for a vite config file or webpack

/** @deprecated Please use `frameworkToRenderer` from `@storybook/core-common` instead */
declare const frameworkToRenderer: Record<"react-native" | "react" | "vue3" | "angular" | "html" | "web-components" | "ember" | "svelte" | "preact" | "server" | "qwik" | "solid" | "experimental-nextjs-vite" | "html-vite" | "html-webpack5" | "nextjs" | "preact-vite" | "preact-webpack5" | "react-vite" | "react-webpack5" | "server-webpack5" | "svelte-vite" | "svelte-webpack5" | "sveltekit" | "vue3-vite" | "vue3-webpack5" | "web-components-vite" | "web-components-webpack5" | "react-rsbuild" | "vue3-rsbuild", "vue" | SupportedRenderers$1>;
declare const frameworkToRenderer: Record<"angular" | "ember" | "experimental-nextjs-vite" | "html-vite" | "html-webpack5" | "nextjs" | "preact-vite" | "preact-webpack5" | "react-vite" | "react-webpack5" | "server-webpack5" | "svelte-vite" | "svelte-webpack5" | "sveltekit" | "vue3-vite" | "vue3-webpack5" | "web-components-vite" | "web-components-webpack5" | "qwik" | "solid" | "react-rsbuild" | "vue3-rsbuild" | "react" | "react-native" | "vue3" | "preact" | "svelte" | "html" | "web-components" | "server", SupportedRenderers$1 | "vue">;
declare const frameworkToDefaultBuilder: Record<SupportedFrameworks, CoreBuilder | CommunityBuilder>;

@@ -140,0 +140,0 @@ declare function copyTemplateFiles({ packageManager, renderer, language, destination, commonAssetsDir, }: CopyTemplateFilesOptions): Promise<void>;

import * as _storybook_core_types from '@storybook/core/types';
import { PresetConfig, CoreCommon_ResolvedAddonPreset, CoreCommon_ResolvedAddonVirtual, LoadedPreset, Presets, CLIOptions, LoadOptions, BuilderOptions, StorybookConfigRaw, PackageJson, CoreCommon_AddonInfo, SupportedFrameworks, SupportedRenderers, Options as Options$2, CoreCommon_StorybookInfo, Ref, StorybookConfig, StoriesEntry, NormalizedStoriesSpecifier } from '@storybook/core/types';
import { PresetConfig, CoreCommon_ResolvedAddonPreset, CoreCommon_ResolvedAddonVirtual, LoadedPreset, Presets, CLIOptions, LoadOptions, BuilderOptions, StorybookConfigRaw, PackageJson, CoreCommon_AddonInfo, SupportedFrameworks, SupportedRenderers, Options as Options$1, CoreCommon_StorybookInfo, Ref, StorybookConfig, StoriesEntry, NormalizedStoriesSpecifier } from '@storybook/core/types';
export { PackageJson } from '@storybook/core/types';

@@ -121,47 +121,46 @@ import { WriteStream } from 'node:fs';

type HashAlgorithm = 'RSA-MD5' | 'RSA-RIPEMD160' | 'RSA-SHA1' | 'RSA-SHA1-2' | 'RSA-SHA224' | 'RSA-SHA256' | 'RSA-SHA3-224' | 'RSA-SHA3-256' | 'RSA-SHA3-384' | 'RSA-SHA3-512' | 'RSA-SHA384' | 'RSA-SHA512' | 'RSA-SHA512/224' | 'RSA-SHA512/256' | 'RSA-SM3' | 'blake2b512' | 'blake2s256' | 'id-rsassa-pkcs1-v1_5-with-sha3-224' | 'id-rsassa-pkcs1-v1_5-with-sha3-256' | 'id-rsassa-pkcs1-v1_5-with-sha3-384' | 'id-rsassa-pkcs1-v1_5-with-sha3-512' | 'md5' | 'md5-sha1' | 'md5WithRSAEncryption' | 'ripemd' | 'ripemd160' | 'ripemd160WithRSA' | 'rmd160' | 'sha1' | 'sha1WithRSAEncryption' | 'sha224' | 'sha224WithRSAEncryption' | 'sha256' | 'sha256WithRSAEncryption' | 'sha3-224' | 'sha3-256' | 'sha3-384' | 'sha3-512' | 'sha384' | 'sha384WithRSAEncryption' | 'sha512' | 'sha512-224' | 'sha512-224WithRSAEncryption' | 'sha512-256' | 'sha512-256WithRSAEncryption' | 'sha512WithRSAEncryption' | 'shake128' | 'shake256' | 'sm3' | 'sm3WithRSAEncryption' | 'ssl3-md5' | 'ssl3-sha1';
type FileSystemCacheOptions = {
interface FileSystemCacheOptions {
ns?: string;
prefix?: string;
hash_alg?: string;
basePath?: string;
ns?: any;
ttl?: number;
hash?: HashAlgorithm;
extension?: string;
};
declare class FileSystemCache$1 {
static hashAlgorithms: HashAlgorithm[];
readonly basePath: string;
readonly ns?: any;
readonly extension?: string;
readonly hash: HashAlgorithm;
readonly ttl: number;
basePathExists?: boolean;
}
interface CacheItem {
key: string;
content?: any;
value?: any;
}
interface CacheSetOptions {
ttl?: number;
encoding?: BufferEncoding;
}
declare class FileSystemCache {
private prefix;
private hash_alg;
private cache_dir;
private ttl;
constructor(options?: FileSystemCacheOptions);
path(key: string): string;
fileExists(key: string): Promise<boolean>;
ensureBasePath(): Promise<void>;
get(key: string, defaultValue?: any): Promise<any>;
getSync(key: string, defaultValue?: any): any;
set(key: string, value: any, ttl?: number): Promise<{
path: string;
}>;
setSync(key: string, value: any, ttl?: number): this;
remove(key: string): Promise<void>;
private generateHash;
private isExpired;
private parseCacheData;
private parseSetData;
get<T = any>(name: string, fallback?: T): Promise<T>;
getSync<T>(name: string, fallback?: T): T;
set<T>(name: string, data: T, orgOpts?: CacheSetOptions | number): Promise<void>;
setSync<T>(name: string, data: T, orgOpts?: CacheSetOptions | number): void;
setMany(items: CacheItem[], options?: CacheSetOptions): Promise<void>;
setManySync(items: CacheItem[], options?: CacheSetOptions): void;
remove(name: string): Promise<void>;
removeSync(name: string): void;
clear(): Promise<void>;
save(input: ({
key: string;
value: any;
} | null | undefined)[]): Promise<{
paths: string[];
}>;
clearSync(): void;
getAll(): Promise<CacheItem[]>;
load(): Promise<{
files: {
path: string;
value: any;
}[];
files: CacheItem[];
}>;
}
declare function createFileSystemCache(options: FileSystemCacheOptions): FileSystemCache;
declare const cache: FileSystemCache$1;
declare const cache: FileSystemCache;

@@ -748,3 +747,3 @@ declare global {

interface Options$1 {
interface Options {
before: CoreCommon_AddonInfo;

@@ -755,3 +754,3 @@ after: CoreCommon_AddonInfo;

}
declare const checkAddonOrder: ({ before, after, configFile, getConfig }: Options$1) => Promise<void>;
declare const checkAddonOrder: ({ before, after, configFile, getConfig }: Options) => Promise<void>;

@@ -779,6 +778,6 @@ declare function loadEnvs(options?: {

*/
declare function getBuilderOptions<T extends Record<string, any>>(options: Options$2): Promise<T | Record<string, never>>;
declare function getBuilderOptions<T extends Record<string, any>>(options: Options$1): Promise<T | Record<string, never>>;
/** Framework can be a string or an object. This utility always returns the string name. */
declare function getFrameworkName(options: Options$2): Promise<string>;
declare function getFrameworkName(options: Options$1): Promise<string>;
/**

@@ -801,3 +800,3 @@ * Extracts the proper framework name from the given framework field. The framework field can be the

*/
declare function getRendererName(options: Options$2): Promise<string>;
declare function getRendererName(options: Options$1): Promise<string>;
/**

@@ -833,4 +832,4 @@ * Extracts the proper renderer name from the given framework name.

declare const getAutoRefs: (options: Options$2) => Promise<Record<string, Ref>>;
declare function getRefs(options: Options$2): Promise<Record<string, Ref>>;
declare const getAutoRefs: (options: Options$1) => Promise<Record<string, Ref>>;
declare function getRefs(options: Options$1): Promise<Record<string, Ref>>;

@@ -844,4 +843,2 @@ declare function globToRegexp(glob: string): RegExp;

declare function handlebars(source: string, data: any): string;
/**

@@ -967,3 +964,3 @@ * Return a string corresponding to template filled with bindings using following pattern: For each

};
declare function getStoryId(data: StoryIdData, options: Options$2): Promise<{
declare function getStoryId(data: StoryIdData, options: Options$1): Promise<{
storyId: string;

@@ -977,7 +974,2 @@ kind: string;

declare const Cache: (options?: FileSystemCacheOptions | undefined) => FileSystemCache$1;
type Options = Parameters<typeof Cache>['0'];
type FileSystemCache = ReturnType<typeof Cache>;
declare function createFileSystemCache(options: Options): FileSystemCache;
export { type FileOptions, HandledError, type InstallationMetadata, JsPackageManager, JsPackageManagerFactory, type PackageJsonWithDepsAndDevDeps, type PackageJsonWithMaybeDeps, type PackageManagerName, type PackageMetadata, boost, builderPackages, cache, checkAddonOrder, codeLog, commandLog, commonGlobOptions, createFileSystemCache, createLogStream, extractProperFrameworkName, extractProperRendererNameFromFramework, filterPresetsConfig, findConfigFile, formatFileContent, frameworkPackages, frameworkToRenderer, getAutoRefs, getBuilderOptions, getChars, getCoercedStorybookVersion, getConfigInfo, getDirectoryFromWorkingDir, getEnvConfig, getFrameworkName, getInterpretedFile, getInterpretedFileWithExt, getPackageDetails, getPresets, getPreviewBodyTemplate, getPreviewHeadTemplate, getProjectRoot, getRefs, getRendererName, getStoryId, getStoryTitle, getStorybookConfiguration, getStorybookInfo, globToRegexp, handlebars, interopRequireDefault, interpolate, isCorePackage, isPreservingSymlinks, loadAllPresets, loadCustomPresets, loadEnvs, loadMainConfig, loadManagerOrAddonsFile, loadPreset, loadPreviewOrConfigFile, logConfig, nodePathsToArray, normalizeStories, normalizeStoriesEntry, normalizeStoryPath, paddedLog, parseList, posix, readTemplate, removeAddon, rendererPackages, resolveAddonName, resolvePathInStorybookCache, satisfies, serverRequire, serverResolve, stringifyEnvs, stringifyProcessEnvs, stripAbsNodeModulesPath, temporaryDirectory, temporaryFile, validateConfigurationFiles, validateFrameworkName, _default as versions };
export { type FileOptions, HandledError, type InstallationMetadata, JsPackageManager, JsPackageManagerFactory, type PackageJsonWithDepsAndDevDeps, type PackageJsonWithMaybeDeps, type PackageManagerName, type PackageMetadata, boost, builderPackages, cache, checkAddonOrder, codeLog, commandLog, commonGlobOptions, createFileSystemCache, createLogStream, extractProperFrameworkName, extractProperRendererNameFromFramework, filterPresetsConfig, findConfigFile, formatFileContent, frameworkPackages, frameworkToRenderer, getAutoRefs, getBuilderOptions, getChars, getCoercedStorybookVersion, getConfigInfo, getDirectoryFromWorkingDir, getEnvConfig, getFrameworkName, getInterpretedFile, getInterpretedFileWithExt, getPackageDetails, getPresets, getPreviewBodyTemplate, getPreviewHeadTemplate, getProjectRoot, getRefs, getRendererName, getStoryId, getStoryTitle, getStorybookConfiguration, getStorybookInfo, globToRegexp, interopRequireDefault, interpolate, isCorePackage, isPreservingSymlinks, loadAllPresets, loadCustomPresets, loadEnvs, loadMainConfig, loadManagerOrAddonsFile, loadPreset, loadPreviewOrConfigFile, logConfig, nodePathsToArray, normalizeStories, normalizeStoriesEntry, normalizeStoryPath, paddedLog, parseList, posix, readTemplate, removeAddon, rendererPackages, resolveAddonName, resolvePathInStorybookCache, satisfies, serverRequire, serverResolve, stringifyEnvs, stringifyProcessEnvs, stripAbsNodeModulesPath, temporaryDirectory, temporaryFile, validateConfigurationFiles, validateFrameworkName, _default as versions };

@@ -39,2 +39,3 @@ import { types, GeneratorOptions, generate, RecastOptions } from '@storybook/core/babel';

id: string;
localName?: string;
__stats: IndexInputStats;

@@ -41,0 +42,0 @@ }

@@ -8,7 +8,7 @@ import ESM_COMPAT_Module from "node:module";

var we = Object.create;
var $ = Object.defineProperty;
var U = Object.defineProperty;
var Fe = Object.getOwnPropertyDescriptor;
var Ce = Object.getOwnPropertyNames;
var Te = Object.getPrototypeOf, ke = Object.prototype.hasOwnProperty;
var p = (s, e) => $(s, "name", { value: e, configurable: !0 });
var p = (s, e) => U(s, "name", { value: e, configurable: !0 });
var Ve = (s, e) => () => (e || s((e = { exports: {} }).exports, e), e.exports);

@@ -18,6 +18,6 @@ var Ae = (s, e, i, t) => {

for (let r of Ce(e))
!ke.call(s, r) && r !== i && $(s, r, { get: () => e[r], enumerable: !(t = Fe(e, r)) || t.enumerable });
!ke.call(s, r) && r !== i && U(s, r, { get: () => e[r], enumerable: !(t = Fe(e, r)) || t.enumerable });
return s;
};
var R = (s, e, i) => (i = s != null ? we(Te(s)) : {}, Ae(
var L = (s, e, i) => (i = s != null ? we(Te(s)) : {}, Ae(
// If the importer is in node compatibility mode or this is not an ESM

@@ -27,3 +27,3 @@ // file that has been converted to a CommonJS file using a Babel-

// "default" to the CommonJS "module.exports" for node compatibility.
e || !s || !s.__esModule ? $(i, "default", { value: s, enumerable: !0 }) : i,
e || !s || !s.__esModule ? U(i, "default", { value: s, enumerable: !0 }) : i,
s

@@ -33,7 +33,7 @@ ));

// ../node_modules/ts-dedent/dist/index.js
var w = Ve((N) => {
var F = Ve((w) => {
"use strict";
Object.defineProperty(N, "__esModule", { value: !0 });
N.dedent = void 0;
function Z(s) {
Object.defineProperty(w, "__esModule", { value: !0 });
w.dedent = void 0;
function ee(s) {
for (var e = [], i = 1; i < arguments.length; i++)

@@ -44,4 +44,4 @@ e[i - 1] = arguments[i];

var r = t.reduce(function(l, u) {
var d = u.match(/\n([\t ]+|(?!\s).)/g);
return d ? l.concat(d.map(function(x) {
var f = u.match(/\n([\t ]+|(?!\s).)/g);
return f ? l.concat(f.map(function(x) {
var g, b;

@@ -62,7 +62,7 @@ return (b = (g = x.match(/[\t ]/g)) === null || g === void 0 ? void 0 : g.length) !== null && b !== void 0 ? b : 0;

return e.forEach(function(l, u) {
var d = n.match(/(?:^|\n)( *)$/), x = d ? d[1] : "", g = l;
var f = n.match(/(?:^|\n)( *)$/), x = f ? f[1] : "", g = l;
typeof l == "string" && l.includes(`
`) && (g = String(l).split(`
`).map(function(b, h) {
return h === 0 ? b : "" + x + b;
`).map(function(b, _) {
return _ === 0 ? b : "" + x + b;
}).join(`

@@ -72,26 +72,26 @@ `)), n += g + t[u + 1];

}
p(Z, "dedent");
N.dedent = Z;
N.default = Z;
p(ee, "dedent");
w.dedent = ee;
w.default = ee;
});
// src/csf-tools/CsfFile.ts
var C = R(w(), 1);
var T = L(F(), 1);
import { readFile as Re, writeFile as Le } from "node:fs/promises";
import {
BabelFileClass as Me,
babelParse as oe,
babelParse as ae,
generate as $e,
recast as ae,
recast as le,
types as c,
traverse as Ue
} from "@storybook/core/babel";
import { isExportStory as ee, storyNameFromExport as te, toId as qe } from "@storybook/csf";
import { isExportStory as te, storyNameFromExport as re, toId as qe } from "@storybook/csf";
// src/csf-tools/findVarInitialization.ts
import { types as F } from "@storybook/core/babel";
import { types as C } from "@storybook/core/babel";
var O = /* @__PURE__ */ p((s, e) => {
let i = null, t = null;
return e.body.find((r) => (F.isVariableDeclaration(r) ? t = r.declarations : F.isExportNamedDeclaration(r) && F.isVariableDeclaration(r.declaration) &&
(t = r.declaration.declarations), t && t.find((a) => F.isVariableDeclarator(a) && F.isIdentifier(a.id) && a.id.name === s ? (i = a.init, !0) :
return e.body.find((r) => (C.isVariableDeclaration(r) ? t = r.declarations : C.isExportNamedDeclaration(r) && C.isVariableDeclaration(r.declaration) &&
(t = r.declaration.declarations), t && t.find((a) => C.isVariableDeclarator(a) && C.isIdentifier(a.id) && a.id.name === s ? (i = a.init, !0) :
!1))), i;

@@ -101,3 +101,3 @@ }, "findVarInitialization");

// src/csf-tools/CsfFile.ts
var re = console;
var ie = console;
function Be(s) {

@@ -117,3 +117,3 @@ if (c.isArrayExpression(s))

p(Be, "parseIncludeExclude");
function ie(s) {
function se(s) {
if (!c.isArrayExpression(s))

@@ -127,7 +127,7 @@ throw new Error("CSF: Expected tags array");

}
p(ie, "parseTags");
var U = /* @__PURE__ */ p((s, e) => {
p(se, "parseTags");
var q = /* @__PURE__ */ p((s, e) => {
let { line: i, column: t } = s.loc?.start || {};
return `${e || ""} (line ${i}, col ${t})`.trim();
}, "formatLocation"), We = /* @__PURE__ */ p((s) => Je.test(s), "isModuleMock"), se = /* @__PURE__ */ p((s, e, i) => {
}, "formatLocation"), We = /* @__PURE__ */ p((s) => Je.test(s), "isModuleMock"), ne = /* @__PURE__ */ p((s, e, i) => {
let t = s;

@@ -151,3 +151,3 @@ if (c.isCallExpression(s)) {

throw new Error(`Expected array of string literals: ${s}`);
}, "parseExportsOrder"), ne = /* @__PURE__ */ p((s, e) => e.reduce(
}, "parseExportsOrder"), oe = /* @__PURE__ */ p((s, e) => e.reduce(
(i, t) => {

@@ -171,3 +171,3 @@ let r = s[t];

return !1;
}, "hasMount"), Je = /^[.\/#].*\.mock($|\.[^.]*$)/i, L = class extends Error {
}, "hasMount"), Je = /^[.\/#].*\.mock($|\.[^.]*$)/i, M = class extends Error {
static {

@@ -177,4 +177,4 @@ p(this, "NoMetaError");

constructor(e, i, t) {
super(C.dedent`
CSF: ${e} ${U(i, t)}
super(T.dedent`
CSF: ${e} ${q(i, t)}

@@ -184,3 +184,3 @@ More info: https://storybook.js.org/docs/react/writing-stories#default-export

}
}, q = class {
}, B = class {
constructor(e, i, t) {

@@ -212,4 +212,4 @@ this._stories = {};

return i.expression.value;
throw new Error(C.dedent`
CSF: unexpected dynamic title ${U(i, this._options.fileName)}
throw new Error(T.dedent`
CSF: unexpected dynamic title ${q(i, this._options.fileName)}

@@ -231,14 +231,14 @@ More info: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#string-literal-titles

let l = a.name, u = i.body.find(
(d) => c.isImportDeclaration(d) && d.specifiers.find((x) => x.local.name === l)
(f) => c.isImportDeclaration(f) && f.specifiers.find((x) => x.local.name === l)
);
if (u) {
let { source: d } = u;
c.isStringLiteral(d) && (this._rawComponentPath = d.value);
let { source: f } = u;
c.isStringLiteral(f) && (this._rawComponentPath = f.value);
}
}
let { code: n } = ae.print(r.value, {});
let { code: n } = le.print(r.value, {});
t.component = n;
} else if (r.key.name === "tags") {
let a = r.value;
c.isIdentifier(a) && (a = O(a.name, this._ast.program)), t.tags = ie(a);
c.isIdentifier(a) && (a = O(a.name, this._ast.program)), t.tags = se(a);
} else if (r.key.name === "id")

@@ -271,7 +271,7 @@ if (c.isStringLiteral(r.value))

if (e._options.transformInlineMeta && !n && c.isExpression(r.declaration)) {
let d = t.scope.generateUidIdentifier("meta");
e._metaVariableName = d.name;
let f = t.scope.generateUidIdentifier("meta");
e._metaVariableName = f.name;
let x = [
c.variableDeclaration("const", [c.variableDeclarator(d, r.declaration)]),
c.exportDefaultDeclaration(d)
c.variableDeclaration("const", [c.variableDeclarator(f, r.declaration)]),
c.exportDefaultDeclaration(f)
];

@@ -282,5 +282,5 @@ x.forEach((g) => g.loc = t.node.loc), t.replaceWithMultiple(x);

if (n) {
let d = r.declaration.name;
e._metaVariableName = d;
let x = /* @__PURE__ */ p((g) => c.isIdentifier(g.id) && g.id.name === d, "isVariableDeclarator");
let f = r.declaration.name;
e._metaVariableName = f;
let x = /* @__PURE__ */ p((g) => c.isIdentifier(g.id) && g.id.name === f, "isVariableDeclarator");
e._metaStatement = e._ast.program.body.find(

@@ -297,3 +297,3 @@ (g) => c.isVariableDeclaration(g) && g.declarations.find(x)

), !e._meta && l && c.isProgram(a) && (e._metaNode = l, e._parseMeta(l, a)), e._metaStatement && !e._metaNode)
throw new L(
throw new M(
"default export must be an object",

@@ -317,14 +317,14 @@ e._metaStatement,

e._storyExports[l] = n, e._storyStatements[l] = t;
let u = te(l);
e._storyAnnotations[l] ? re.warn(
let u = re(l);
e._storyAnnotations[l] ? ie.warn(
`Unexpected annotations for "${l}" before story declaration`
) : e._storyAnnotations[l] = {};
let d;
c.isVariableDeclarator(n) ? d = c.isTSAsExpression(n.init) || c.isTSSatisfiesExpression(n.init) ? n.init.expression : n.init :
d = n;
let f;
c.isVariableDeclarator(n) ? f = c.isTSAsExpression(n.init) || c.isTSSatisfiesExpression(n.init) ? n.init.expression : n.init :
f = n;
let x = {};
c.isObjectExpression(d) ? (x.__isArgsStory = !0, d.properties.forEach((g) => {
c.isObjectExpression(f) ? (x.__isArgsStory = !0, f.properties.forEach((g) => {
if (c.isIdentifier(g.key)) {
if (g.key.name === "render")
x.__isArgsStory = se(
x.__isArgsStory = ne(
g.value,

@@ -337,3 +337,3 @@ r,

else if (g.key.name === "storyName" && c.isStringLiteral(g.value))
re.warn(
ie.warn(
`Unexpected usage of "storyName" in "${l}". Please use "name" instead.`

@@ -343,3 +343,3 @@ );

let b = g.value.properties.find(
(h) => c.isObjectProperty(h) && c.isIdentifier(h.key) && h.key.name === "__id"
(_) => c.isObjectProperty(_) && c.isIdentifier(_.key) && _.key.name === "__id"
);

@@ -350,3 +350,3 @@ b && (x.__id = b.value.value);

}
})) : x.__isArgsStory = se(d, r, e), e._stories[l] = {
})) : x.__isArgsStory = ne(f, r, e), e._stories[l] = {
id: "FIXME",

@@ -360,13 +360,14 @@ name: u,

if (c.isExportSpecifier(n) && c.isIdentifier(n.exported)) {
let { name: l } = n.exported, u = c.isProgram(r) ? O(n.local.name, r) : n.local;
let { name: l } = n.exported, { name: u } = n.local, f = c.isProgram(r) ? O(n.local.name, r) : n.local;
if (l === "default") {
let d;
c.isObjectExpression(u) ? d = u : (
let x;
c.isObjectExpression(f) ? x = f : (
// export default { ... } as Meta<...>
c.isTSAsExpression(u) && c.isObjectExpression(u.expression) && (d = u.expression)
), !e._meta && d && c.isProgram(r) && e._parseMeta(d, r);
c.isTSAsExpression(f) && c.isObjectExpression(f.expression) && (x = f.expression)
), !e._meta && x && c.isProgram(r) && e._parseMeta(x, r);
} else
e._storyAnnotations[l] = {}, e._storyStatements[l] = u, e._stories[l] = {
e._storyAnnotations[l] = {}, e._storyStatements[l] = f, e._stories[l] = {
id: "FIXME",
name: l,
localName: u,
parameters: {},

@@ -385,9 +386,9 @@ __stats: {}

let n = a.left.object.name, l = a.left.property.name, u = a.right;
if (e._storyAnnotations[n] && (l === "story" && c.isObjectExpression(u) ? u.properties.forEach((d) => {
c.isIdentifier(d.key) && (e._storyAnnotations[n][d.key.name] = d.value);
if (e._storyAnnotations[n] && (l === "story" && c.isObjectExpression(u) ? u.properties.forEach((f) => {
c.isIdentifier(f.key) && (e._storyAnnotations[n][f.key.name] = f.value);
}) : e._storyAnnotations[n][l] = u), l === "storyName" && c.isStringLiteral(u)) {
let d = u.value, x = e._stories[n];
let f = u.value, x = e._stories[n];
if (!x)
return;
x.name = d;
x.name = f;
}

@@ -401,4 +402,4 @@ }

if (c.isIdentifier(r) && r.name === "storiesOf")
throw new Error(C.dedent`
Unexpected \`storiesOf\` usage: ${U(t, e._options.fileName)}.
throw new Error(T.dedent`
Unexpected \`storiesOf\` usage: ${q(t, e._options.fileName)}.

@@ -419,3 +420,3 @@ SB8 does not support \`storiesOf\`.

}), !e._meta)
throw new L("missing default export", e._ast, e._options.fileName);
throw new M("missing default export", e._ast, e._options.fileName);
let i = Object.entries(e._stories);

@@ -425,11 +426,11 @@ if (e._meta.title = this._options.makeTitle(e._meta?.title), e._metaAnnotations.play && (e._meta.tags = [...e._meta.tags || [], "play-fn"]),

(t, [r, a]) => {
if (!ee(r, e._meta))
if (!te(r, e._meta))
return t;
let n = a.parameters?.__id ?? qe(e._meta?.id || e._meta?.title, te(r)), l = { ...a.parameters, __id: n }, { includeStories: u } = e.
let n = a.parameters?.__id ?? qe(e._meta?.id || e._meta?.title, re(r)), l = { ...a.parameters, __id: n }, { includeStories: u } = e.
_meta || {};
r === "__page" && (i.length === 1 || Array.isArray(u) && u.length === 1) && (l.docsOnly = !0), t[r] = { ...a, id: n, parameters: l };
let d = e._storyAnnotations[r], { tags: x, play: g } = d;
let f = e._storyAnnotations[r], { tags: x, play: g } = f;
if (x) {
let S = c.isIdentifier(x) ? O(x.name, this._ast.program) : x;
t[r].tags = ie(S);
t[r].tags = se(S);
}

@@ -439,6 +440,6 @@ g && (t[r].tags = [...t[r].tags || [], "play-fn"]);

["play", "render", "loaders", "beforeEach", "globals"].forEach((S) => {
b[S] = !!d[S] || !!e._metaAnnotations[S];
b[S] = !!f[S] || !!e._metaAnnotations[S];
});
let h = e.getStoryExport(r);
return b.storyFn = !!(c.isArrowFunctionExpression(h) || c.isFunctionDeclaration(h)), b.mount = Ge(d.play ?? e._metaAnnotations.play),
let _ = e.getStoryExport(r);
return b.storyFn = !!(c.isArrowFunctionExpression(_) || c.isFunctionDeclaration(_)), b.mount = Ge(f.play ?? e._metaAnnotations.play),
b.moduleMock = !!e.imports.find((S) => We(S)), t;

@@ -448,6 +449,6 @@ },

), Object.keys(e._storyExports).forEach((t) => {
ee(t, e._meta) || (delete e._storyExports[t], delete e._storyAnnotations[t], delete e._storyStatements[t]);
te(t, e._meta) || (delete e._storyExports[t], delete e._storyAnnotations[t], delete e._storyStatements[t]);
}), e._namedExportsOrder) {
let t = Object.keys(e._storyExports);
e._storyExports = ne(e._storyExports, e._namedExportsOrder), e._stories = ne(e._stories, e._namedExportsOrder);
e._storyExports = oe(e._storyExports, e._namedExportsOrder), e._stories = oe(e._stories, e._namedExportsOrder);
let r = Object.keys(e._storyExports);

@@ -473,3 +474,3 @@ if (t.length !== r.length)

throw new Error(
C.dedent`Cannot automatically create index inputs with CsfFile.indexInputs because the CsfFile instance was created without a the fileName option.
T.dedent`Cannot automatically create index inputs with CsfFile.indexInputs because the CsfFile instance was created without a the fileName option.
Either add the fileName option when creating the CsfFile instance, or create the index inputs manually.`

@@ -497,11 +498,11 @@ );

ast: i
}) => new Me({ filename: e }, { code: s, ast: i ?? oe(s) }), "babelParseFile"), B = /* @__PURE__ */ p((s, e) => {
let i = oe(s), t = Ke({ code: s, filename: e.fileName, ast: i });
return new q(i, e, t);
}, "loadCsf"), le = /* @__PURE__ */ p((s, e = { sourceMaps: !1 }, i) => {
}) => new Me({ filename: e }, { code: s, ast: i ?? ae(s) }), "babelParseFile"), W = /* @__PURE__ */ p((s, e) => {
let i = ae(s), t = Ke({ code: s, filename: e.fileName, ast: i });
return new B(i, e, t);
}, "loadCsf"), ce = /* @__PURE__ */ p((s, e = { sourceMaps: !1 }, i) => {
let t = $e(s._ast, e, i);
return e.sourceMaps ? t : t.code;
}, "formatCsf"), Xe = /* @__PURE__ */ p((s, e = {}) => ae.print(s._ast, e), "printCsf"), Dt = /* @__PURE__ */ p(async (s, e) => {
}, "formatCsf"), Xe = /* @__PURE__ */ p((s, e = {}) => le.print(s._ast, e), "printCsf"), Dt = /* @__PURE__ */ p(async (s, e) => {
let i = (await Re(s, "utf-8")).toString();
return B(i, { ...e, fileName: s });
return W(i, { ...e, fileName: s });
}, "readCsf"), vt = /* @__PURE__ */ p(async (s, e) => {

@@ -514,12 +515,12 @@ if (!(e || s._options.fileName))

// src/csf-tools/ConfigFile.ts
var de = R(w(), 1);
var ue = L(F(), 1);
import { readFile as Qe, writeFile as He } from "node:fs/promises";
import {
babelParse as fe,
generate as ce,
babelParse as de,
generate as pe,
recast as Ye,
types as o,
traverse as pe
traverse as fe
} from "@storybook/core/babel";
var W = console, z = /* @__PURE__ */ p(({
var z = console, G = /* @__PURE__ */ p(({
expectedType: s,

@@ -535,8 +536,8 @@ foundType: e,

}
return de.dedent`
return ue.dedent`
CSF Parsing error: Expected '${s}' but found '${e}' instead in '${i?.type}'.
${t}
`;
}, "getCsfParsingErrorMessage"), T = /* @__PURE__ */ p((s) => o.isIdentifier(s.key) ? s.key.name : o.isStringLiteral(s.key) ? s.key.value : null,
"propKey"), M = /* @__PURE__ */ p((s) => o.isTSAsExpression(s) || o.isTSSatisfiesExpression(s) ? M(s.expression) : s, "unwrap"), ue = /* @__PURE__ */ p(
}, "getCsfParsingErrorMessage"), k = /* @__PURE__ */ p((s) => o.isIdentifier(s.key) ? s.key.name : o.isStringLiteral(s.key) ? s.key.value : null,
"propKey"), $ = /* @__PURE__ */ p((s) => o.isTSAsExpression(s) || o.isTSSatisfiesExpression(s) ? $(s.expression) : s, "unwrap"), me = /* @__PURE__ */ p(
(s, e) => {

@@ -546,7 +547,7 @@ if (s.length === 0)

if (o.isObjectExpression(e)) {
let [i, ...t] = s, r = e.properties.find((a) => T(a) === i);
let [i, ...t] = s, r = e.properties.find((a) => k(a) === i);
if (r)
return ue(t, r.value);
return me(t, r.value);
}
}, "_getPath"), me = /* @__PURE__ */ p((s, e) => {
}, "_getPath"), ge = /* @__PURE__ */ p((s, e) => {
if (s.length === 0) {

@@ -558,7 +559,7 @@ if (o.isObjectExpression(e))

if (o.isObjectExpression(e)) {
let [i, ...t] = s, r = e.properties.find((a) => T(a) === i);
let [i, ...t] = s, r = e.properties.find((a) => k(a) === i);
if (r)
return t.length === 0 ? e.properties : me(t, r.value);
return t.length === 0 ? e.properties : ge(t, r.value);
}
}, "_getPathProperties"), ge = /* @__PURE__ */ p((s, e) => {
}, "_getPathProperties"), xe = /* @__PURE__ */ p((s, e) => {
let i = null, t = null;

@@ -568,15 +569,15 @@ return e.body.find((r) => (o.isVariableDeclaration(r) ? t = r.declarations : o.isExportNamedDeclaration(r) && o.isVariableDeclaration(r.declaration) &&

i;
}, "_findVarDeclarator"), D = /* @__PURE__ */ p((s, e) => ge(s, e)?.init, "_findVarInitialization"), k = /* @__PURE__ */ p((s, e) => {
}, "_findVarDeclarator"), D = /* @__PURE__ */ p((s, e) => xe(s, e)?.init, "_findVarInitialization"), V = /* @__PURE__ */ p((s, e) => {
if (s.length === 0)
return e;
let [i, ...t] = s, r = k(t, e);
let [i, ...t] = s, r = V(t, e);
return o.objectExpression([o.objectProperty(o.identifier(i), r)]);
}, "_makeObjectExpression"), G = /* @__PURE__ */ p((s, e, i) => {
}, "_makeObjectExpression"), J = /* @__PURE__ */ p((s, e, i) => {
let [t, ...r] = s, a = i.properties.find(
(n) => T(n) === t
(n) => k(n) === t
);
a ? o.isObjectExpression(a.value) && r.length > 0 ? G(r, e, a.value) : a.value = k(r, e) : i.properties.push(
o.objectProperty(o.identifier(t), k(r, e))
a ? o.isObjectExpression(a.value) && r.length > 0 ? J(r, e, a.value) : a.value = V(r, e) : i.properties.push(
o.objectProperty(o.identifier(t), V(r, e))
);
}, "_updateExportNode"), J = class {
}, "_updateExportNode"), K = class {
constructor(e, i, t) {

@@ -596,3 +597,3 @@ this._exports = {};

let e = this;
return pe(this._ast, {
return fe(this._ast, {
ExportDefaultDeclaration: {

@@ -602,4 +603,4 @@ enter({ node: i, parent: t }) {

let r = o.isIdentifier(i.declaration) && o.isProgram(t) ? D(i.declaration.name, t) : i.declaration;
r = M(r), o.isObjectExpression(r) ? (e._exportsObject = r, r.properties.forEach((a) => {
let n = T(a);
r = $(r), o.isObjectExpression(r) ? (e._exportsObject = r, r.properties.forEach((a) => {
let n = k(a);
if (n) {

@@ -609,4 +610,4 @@ let l = a.value;

}
})) : W.warn(
z({
})) : z.warn(
G({
expectedType: "ObjectExpression",

@@ -628,7 +629,7 @@ foundType: r?.type,

if (o.isExportSpecifier(r) && o.isIdentifier(r.local) && o.isIdentifier(r.exported)) {
let { name: a } = r.local, { name: n } = r.exported, l = ge(a, t);
let { name: a } = r.local, { name: n } = r.exported, l = xe(a, t);
e._exports[n] = l.init, e._exportDecls[n] = l;
}
}) : W.warn(
z({
}) : z.warn(
G({
expectedType: "VariableDeclaration",

@@ -648,13 +649,13 @@ foundType: i.declaration?.type,

let n = a;
o.isIdentifier(a) && (n = D(a.name, t)), n = M(n), o.isObjectExpression(n) ? (e._exportsObject = n, n.properties.forEach((l) => {
let u = T(l);
o.isIdentifier(a) && (n = D(a.name, t)), n = $(n), o.isObjectExpression(n) ? (e._exportsObject = n, n.properties.forEach((l) => {
let u = k(l);
if (u) {
let d = l.value;
o.isIdentifier(d) && (d = D(
d.name,
let f = l.value;
o.isIdentifier(f) && (f = D(
f.name,
t
)), e._exports[u] = d;
)), e._exports[u] = f;
}
})) : W.warn(
z({
})) : z.warn(
G({
expectedType: "ObjectExpression",

@@ -674,3 +675,3 @@ foundType: n?.type,

if (r)
return ue(t, r);
return me(t, r);
}

@@ -680,3 +681,3 @@ getFieldProperties(e) {

if (r)
return me(t, r);
return ge(t, r);
}

@@ -686,3 +687,3 @@ getFieldValue(e) {

if (i) {
let { code: t } = ce(i, {});
let { code: t } = pe(i, {});
return (0, eval)(`(() => (${t}))()`);

@@ -700,8 +701,8 @@ }

if (this._exportsObject)
G(e, i, this._exportsObject), this._exports[e[0]] = i;
J(e, i, this._exportsObject), this._exports[e[0]] = i;
else if (a && o.isObjectExpression(a) && r.length > 0)
G(r, i, a);
J(r, i, a);
else if (a && r.length === 0 && this._exportDecls[e[0]]) {
let n = this._exportDecls[e[0]];
n.init = k([], i);
n.init = V([], i);
} else {

@@ -715,3 +716,3 @@ if (this.hasDefaultExport)

{
let n = k(r, i), l = o.exportNamedDeclaration(
let n = V(r, i), l = o.exportNamedDeclaration(
o.variableDeclaration("const", [o.variableDeclarator(o.identifier(t), n)])

@@ -801,3 +802,3 @@ );

let n = a.declaration;
if (o.isIdentifier(n) && (n = D(n.name, this._ast.program)), n = M(n), o.isObjectExpression(n)) {
if (o.isIdentifier(n) && (n = D(n.name, this._ast.program)), n = $(n), o.isObjectExpression(n)) {
let l = n.properties;

@@ -865,4 +866,4 @@ i(l, e[0]), r = !0;

if (i === "single") {
let { code: r } = ce(o.valueToNode(e), { jsescOption: { quotes: i } }), a = fe(`const __x = ${r}`);
pe(a, {
let { code: r } = pe(o.valueToNode(e), { jsescOption: { quotes: i } }), a = de(`const __x = ${r}`);
fe(a, {
VariableDeclaration: {

@@ -968,4 +969,4 @@ enter({ node: n }) {

specifiers.find(
(d) => o.isImportSpecifier(d) && o.isIdentifier(d.imported) && d.imported.name === u
), "hasImportSpecifier"), a = /* @__PURE__ */ p((l, u) => l.specifiers.find((d) => o.isImportDefaultSpecifier(d)), "hasDefaultImportSpec\
(f) => o.isImportSpecifier(f) && o.isIdentifier(f.imported) && f.imported.name === u
), "hasImportSpecifier"), a = /* @__PURE__ */ p((l, u) => l.specifiers.find((f) => o.isImportDefaultSpecifier(f)), "hasDefaultImportSpec\
ifier"), n = this._ast.program.body.find(

@@ -993,4 +994,4 @@ (l) => o.isImportDeclaration(l) && l.source.value === i

}, Ze = /* @__PURE__ */ p((s, e) => {
let i = fe(s);
return new J(i, s, e);
let i = de(s);
return new K(i, s, e);
}, "loadConfig"), et = /* @__PURE__ */ p((s) => tt(s).code, "formatConfig"), tt = /* @__PURE__ */ p((s, e = {}) => Ye.print(s._ast, e), "pri\

@@ -1008,5 +1009,5 @@ ntConfig"), Ct = /* @__PURE__ */ p(async (s) => {

// src/csf-tools/getStorySortParameter.ts
var ye = R(w(), 1);
import { babelParse as rt, generate as xe, types as y, traverse as it } from "@storybook/core/babel";
var st = console, K = /* @__PURE__ */ p((s, e) => {
var be = L(F(), 1);
import { babelParse as rt, generate as ye, types as y, traverse as it } from "@storybook/core/babel";
var st = console, X = /* @__PURE__ */ p((s, e) => {
let i;

@@ -1016,8 +1017,8 @@ return s.properties.forEach((t) => {

}), i;
}, "getValue"), X = /* @__PURE__ */ p((s) => {
let e = V(s);
}, "getValue"), Q = /* @__PURE__ */ p((s) => {
let e = A(s);
if (y.isArrayExpression(e))
return e.elements.map((i) => X(i));
return e.elements.map((i) => Q(i));
if (y.isObjectExpression(e))
return e.properties.reduce((i, t) => (y.isIdentifier(t.key) && (i[t.key.name] = X(t.value)), i), {});
return e.properties.reduce((i, t) => (y.isIdentifier(t.key) && (i[t.key.name] = Q(t.value)), i), {});
if (y.isLiteral(e))

@@ -1029,3 +1030,3 @@ return e.value;

}, "parseValue"), v = /* @__PURE__ */ p((s, e) => {
let i = ye.dedent`
let i = be.dedent`
Unexpected '${s}'. Parameter 'options.storySort' should be defined inline e.g.:

@@ -1044,10 +1045,10 @@

st.info(i);
}, "unsupported"), V = /* @__PURE__ */ p((s) => y.isTSAsExpression(s) || y.isTSSatisfiesExpression(s) ? s.expression : s, "stripTSModifiers"),
be = /* @__PURE__ */ p((s) => {
let e = V(s);
}, "unsupported"), A = /* @__PURE__ */ p((s) => y.isTSAsExpression(s) || y.isTSSatisfiesExpression(s) ? s.expression : s, "stripTSModifiers"),
Ee = /* @__PURE__ */ p((s) => {
let e = A(s);
if (y.isObjectExpression(e)) {
let i = K(e, "options");
let i = X(e, "options");
if (i) {
if (y.isObjectExpression(i))
return K(i, "storySort");
return X(i, "storySort");
v("options", !0);

@@ -1057,7 +1058,7 @@ }

}, "parseParameters"), nt = /* @__PURE__ */ p((s, e) => {
let i = V(s);
let i = A(s);
if (y.isObjectExpression(i)) {
let t = K(i, "parameters");
let t = X(i, "parameters");
if (y.isIdentifier(t) && (t = O(t.name, e)), t)
return be(t);
return Ee(t);
} else

@@ -1076,4 +1077,4 @@ v("default", !0);

if (a === "parameters" && r.init) {
let n = V(r.init);
e = be(n);
let n = A(r.init);
e = Ee(n);
}

@@ -1089,3 +1090,3 @@ }

let r = t.declaration;
y.isIdentifier(r) && (r = O(r.name, i.program)), r = V(r), y.isObjectExpression(r) ? e = nt(r, i.program) : v("default", !1);
y.isIdentifier(r) && (r = O(r.name, i.program)), r = A(r), y.isObjectExpression(r) ? e = nt(r, i.program) : v("default", !1);
}

@@ -1095,7 +1096,7 @@ }

if (y.isArrowFunctionExpression(e)) {
let { code: t } = xe(e, {});
let { code: t } = ye(e, {});
return (0, eval)(t);
}
if (y.isFunctionExpression(e)) {
let { code: t } = xe(e, {}), r = e.id?.name, a = `(a, b) => {
let { code: t } = ye(e, {}), r = e.id?.name, a = `(a, b) => {
${t};

@@ -1106,3 +1107,3 @@ return ${r}(a, b)

}
return y.isLiteral(e) || y.isArrayExpression(e) || y.isObjectExpression(e) ? X(e) : v("storySort", !0);
return y.isLiteral(e) || y.isArrayExpression(e) || y.isObjectExpression(e) ? Q(e) : v("storySort", !0);
}

@@ -1114,6 +1115,6 @@ }, "getStorySortParameter");

var at = /* @__PURE__ */ p((s, e, i, t) => {
let r = e.getStoryExport(i), a = !t?.disableSource && ct(r), n = !t?.disableDescription && he(e._storyStatements[i]), l = [], u = m.memberExpression(
let r = e.getStoryExport(i), a = !t?.disableSource && ct(r), n = !t?.disableDescription && _e(e._storyStatements[i]), l = [], u = m.memberExpression(
m.identifier(i), m.identifier("parameters"));
l.push(m.spreadElement(u));
let d = m.optionalMemberExpression(
let f = m.optionalMemberExpression(
u,

@@ -1126,3 +1127,3 @@ m.identifier("docs"),

let g = m.optionalMemberExpression(
d,
f,
m.identifier("source"),

@@ -1144,3 +1145,3 @@ !1,

let g = m.optionalMemberExpression(
d,
f,
m.identifier("description"),

@@ -1164,3 +1165,3 @@ !1,

m.identifier("docs"),
m.objectExpression([m.spreadElement(d), ...x])
m.objectExpression([m.spreadElement(f), ...x])
)

@@ -1173,3 +1174,3 @@ );

}
}, "enrichCsfStory"), Ee = /* @__PURE__ */ p((s, e, i) => {
}, "enrichCsfStory"), he = /* @__PURE__ */ p((s, e, i) => {
if (!e.length) {

@@ -1184,8 +1185,8 @@ s.properties.find(

), n;
a ? n = a.value : (n = m.objectExpression([]), s.properties.push(m.objectProperty(m.identifier(t), n))), Ee(n, r, i);
a ? n = a.value : (n = m.objectExpression([]), s.properties.push(m.objectProperty(m.identifier(t), n))), he(n, r, i);
}, "addComponentDescription"), lt = /* @__PURE__ */ p((s, e, i) => {
let t = !i?.disableDescription && he(e._metaStatement);
let t = !i?.disableDescription && _e(e._metaStatement);
if (t) {
let r = s._metaNode;
r && m.isObjectExpression(r) && Ee(
r && m.isObjectExpression(r) && he(
r,

@@ -1203,3 +1204,3 @@ ["parameters", "docs", "description"],

return i;
}, "extractSource"), he = /* @__PURE__ */ p((s) => s?.leadingComments ? s.leadingComments.map((i) => i.type === "CommentLine" || !i.value.startsWith(
}, "extractSource"), _e = /* @__PURE__ */ p((s) => s?.leadingComments ? s.leadingComments.map((i) => i.type === "CommentLine" || !i.value.startsWith(
"*") ? null : i.value.split(`

@@ -1214,7 +1215,7 @@ `).map((t) => t.replace(/^(\s+)?(\*+)?(\s)?/, "")).join(`

// src/csf-tools/vitest-plugin/transformer.ts
var Q = R(w(), 1);
import { types as f } from "@storybook/core/babel";
var H = L(F(), 1);
import { types as d } from "@storybook/core/babel";
import { getStoryTitle as pt } from "@storybook/core/common";
import { combineTags as ft } from "@storybook/csf";
var _e = console, dt = /* @__PURE__ */ p((s, e) => {
var Se = console, dt = /* @__PURE__ */ p((s, e) => {
let i = e?.include.length === 0 || e?.include.some((r) => s.includes(r)), t = e?.exclude.every((r) => !s.includes(r));

@@ -1233,3 +1234,3 @@ return i && t;

return s;
let l = B(s, {
let l = W(s, {
fileName: e,

@@ -1244,4 +1245,4 @@ transformInlineMeta: !0,

}) || "unknown";
return j === "unknown" && _e.warn(
Q.dedent`
return j === "unknown" && Se.warn(
H.dedent`
[Storybook]: Could not calculate story title for "${e}".

@@ -1252,6 +1253,6 @@ Please make sure that this file matches the globs included in the "stories" field in your Storybook configuration at "${i}".

}, "makeTitle")
}).parse(), u = l._ast, d = l._metaVariableName, x = l._metaNode, g = x.properties.find(
(E) => f.isObjectProperty(E) && f.isIdentifier(E.key) && E.key.name === "title"
), b = f.stringLiteral(l._meta?.title || "unknown");
if (g ? f.isObjectProperty(g) && (g.value = b) : x.properties.push(f.objectProperty(f.identifier("title"), b)), !x || !l._meta)
}).parse(), u = l._ast, f = l._metaVariableName, x = l._metaNode, g = x.properties.find(
(E) => d.isObjectProperty(E) && d.isIdentifier(E.key) && E.key.name === "title"
), b = d.stringLiteral(l._meta?.title || "unknown");
if (g ? d.isObjectProperty(g) && (g.value = b) : x.properties.push(d.objectProperty(d.identifier("title"), b)), !x || !l._meta)
throw new Error(

@@ -1263,3 +1264,3 @@ `The Storybook vitest plugin could not detect the meta (default export) object in the story file.

);
let h = {};
let _ = {};
Object.keys(l._stories).map((E) => {

@@ -1273,9 +1274,9 @@ let j = ft(

);
dt(j, r) && (h[E] = l._storyStatements[E]);
dt(j, r) && (_[E] = l._storyStatements[E]);
});
let S = l._file.path.scope.generateUidIdentifier("test"), H = l._file.path.scope.generateUidIdentifier("describe");
if (Object.keys(h).length === 0) {
let E = f.expressionStatement(
f.callExpression(f.memberExpression(H, f.identifier("skip")), [
f.stringLiteral("No valid tests found")
let S = l._file.path.scope.generateUidIdentifier("test"), Y = l._file.path.scope.generateUidIdentifier("describe");
if (Object.keys(_).length === 0) {
let E = d.expressionStatement(
d.callExpression(d.memberExpression(Y, d.identifier("skip")), [
d.stringLiteral("No valid tests found")
])

@@ -1285,8 +1286,8 @@ );

let j = [
f.importDeclaration(
d.importDeclaration(
[
f.importSpecifier(S, f.identifier("test")),
f.importSpecifier(H, f.identifier("describe"))
d.importSpecifier(S, d.identifier("test")),
d.importSpecifier(Y, d.identifier("describe"))
],
f.stringLiteral("vitest")
d.stringLiteral("vitest")
)

@@ -1296,10 +1297,10 @@ ];

} else {
let Y = function() {
let _ = l._file.path.scope.generateUidIdentifier("isRunningFromThisFile"), P = f.memberExpression(
f.callExpression(f.memberExpression(E, f.identifier("getState")), []),
f.identifier("testPath")
), I = f.memberExpression(
f.memberExpression(f.identifier("globalThis"), f.identifier("__vitest_worker__")),
f.identifier("filepath")
), A = f.logicalExpression(
let Z = function() {
let h = l._file.path.scope.generateUidIdentifier("isRunningFromThisFile"), P = d.memberExpression(
d.callExpression(d.memberExpression(E, d.identifier("getState")), []),
d.identifier("testPath")
), I = d.memberExpression(
d.memberExpression(d.identifier("globalThis"), d.identifier("__vitest_worker__")),
d.identifier("filepath")
), N = d.logicalExpression(
"??",

@@ -1310,43 +1311,44 @@ // TODO: switch order of testPathProperty and filePathProperty when the bug is fixed

P
), Ne = f.callExpression(
f.memberExpression(
f.memberExpression(
f.memberExpression(f.identifier("import"), f.identifier("meta")),
f.identifier("url")
), R = d.callExpression(
d.memberExpression(
d.memberExpression(
d.memberExpression(d.identifier("import"), d.identifier("meta")),
d.identifier("url")
),
f.identifier("includes")
d.identifier("includes")
),
[A]
[N]
);
return { isRunningFromThisFileDeclaration: f.variableDeclaration("const", [
f.variableDeclarator(_, Ne)
]), isRunningFromThisFileId: _ };
return { isRunningFromThisFileDeclaration: d.variableDeclaration("const", [
d.variableDeclarator(h, R)
]), isRunningFromThisFileId: h };
};
var mt = Y;
p(Y, "getTestGuardDeclaration");
let E = l._file.path.scope.generateUidIdentifier("expect"), j = l._file.path.scope.generateUidIdentifier("testStory"), Se = f.identifier(
JSON.stringify(r.skip)), { isRunningFromThisFileDeclaration: je, isRunningFromThisFileId: Oe } = Y();
u.program.body.push(je);
let Pe = /* @__PURE__ */ p(({
exportName: _,
testTitle: P,
node: I
var mt = Z;
p(Z, "getTestGuardDeclaration");
let E = l._file.path.scope.generateUidIdentifier("expect"), j = l._file.path.scope.generateUidIdentifier("testStory"), je = d.identifier(
JSON.stringify(r.skip)), { isRunningFromThisFileDeclaration: Oe, isRunningFromThisFileId: Pe } = Z();
u.program.body.push(Oe);
let De = /* @__PURE__ */ p(({
localName: h,
exportName: P,
testTitle: I,
node: N
}) => {
let A = f.expressionStatement(
f.callExpression(S, [
f.stringLiteral(P),
f.callExpression(j, [
f.stringLiteral(_),
f.identifier(_),
f.identifier(d),
Se
let R = d.expressionStatement(
d.callExpression(S, [
d.stringLiteral(I),
d.callExpression(j, [
d.stringLiteral(P),
d.identifier(h),
d.identifier(f),
je
])
])
);
return A.loc = I.loc, A;
}, "getTestStatementForStory"), De = Object.entries(h).map(([_, P]) => {
return R.loc = N.loc, R;
}, "getTestStatementForStory"), ve = Object.entries(_).map(([h, P]) => {
if (P === null) {
_e.warn(
Q.dedent`
[Storybook]: Could not transform "${_}" story into test at "${e}".
Se.warn(
H.dedent`
[Storybook]: Could not transform "${h}" story into test at "${e}".
Please make sure to define stories in the same file and not re-export stories coming from other files".

@@ -1357,28 +1359,28 @@ `

}
let I = l._stories[_].name ?? _;
return Pe({ testTitle: I, exportName: _, node: P });
}).filter((_) => !!_), ve = f.ifStatement(Oe, f.blockStatement(De));
u.program.body.push(ve);
let Ie = [
f.importDeclaration(
let I = l._stories[h].localName ?? h, N = l._stories[h].name ?? h;
return De({ testTitle: N, localName: I, exportName: h, node: P });
}).filter((h) => !!h), Ie = d.ifStatement(Pe, d.blockStatement(ve));
u.program.body.push(Ie);
let Ne = [
d.importDeclaration(
[
f.importSpecifier(S, f.identifier("test")),
f.importSpecifier(E, f.identifier("expect"))
d.importSpecifier(S, d.identifier("test")),
d.importSpecifier(E, d.identifier("expect"))
],
f.stringLiteral("vitest")
d.stringLiteral("vitest")
),
f.importDeclaration(
[f.importSpecifier(j, f.identifier("testStory"))],
f.stringLiteral("@storybook/experimental-addon-test/internal/test-utils")
d.importDeclaration(
[d.importSpecifier(j, d.identifier("testStory"))],
d.stringLiteral("@storybook/experimental-addon-test/internal/test-utils")
)
];
u.program.body.unshift(...Ie);
u.program.body.unshift(...Ne);
}
return le(l, { sourceMaps: !0, sourceFileName: e }, s);
return ce(l, { sourceMaps: !0, sourceFileName: e }, s);
}
p(ut, "vitestTransform");
export {
J as ConfigFile,
q as CsfFile,
L as NoMetaError,
K as ConfigFile,
B as CsfFile,
M as NoMetaError,
ir as babelParse,

@@ -1389,10 +1391,10 @@ Ke as babelParseFile,

at as enrichCsfStory,
he as extractDescription,
_e as extractDescription,
ct as extractSource,
et as formatConfig,
le as formatCsf,
ce as formatCsf,
Lt as getStorySortParameter,
We as isModuleMock,
Ze as loadConfig,
B as loadCsf,
W as loadCsf,
tt as printConfig,

@@ -1399,0 +1401,0 @@ Xe as printCsf,

@@ -549,2 +549,3 @@ var De = Object.defineProperty;

switch (n.tag) {
// arg & argument are aliases for param.
case "param":

@@ -551,0 +552,0 @@ case "arg":

@@ -625,3 +625,2 @@ import ESM_COMPAT_Module from "node:module";

"queryFromLocation",
"queryFromString",
"stringifyQuery",

@@ -643,3 +642,2 @@ "useNavigate"

"queryFromLocation",
"queryFromString",
"stringifyQuery",

@@ -661,3 +659,2 @@ "useNavigate"

"queryFromLocation",
"queryFromString",
"stringifyQuery",

@@ -664,0 +661,0 @@ "useNavigate"

/// <reference types="node" />
import { EventEmitter } from 'events';
/**
Levels:
- `0` - All colors disabled.
- `1` - Basic 16 colors support.
- `2` - ANSI 256 colors support.
- `3` - Truecolor 16 million colors support.
*/
type ColorSupportLevel = 0 | 1 | 2 | 3;
// TODO: Make it this when TS suports that.
// import {ModifierName, ForegroundColor, BackgroundColor, ColorName} from '#ansi-styles';
// import {ColorInfo, ColorSupportLevel} from '#supports-color';
// eslint-disable-line @typescript-eslint/naming-convention
interface ChalkInstance {
(...text: unknown[]): string;
/**
The color support for Chalk.
By default, color support is automatically detected based on the environment.
Levels:
- `0` - All colors disabled.
- `1` - Basic 16 colors support.
- `2` - ANSI 256 colors support.
- `3` - Truecolor 16 million colors support.
*/
level: ColorSupportLevel;
/**
Use RGB values to set text color.
@example
```
import chalk from 'chalk';
chalk.rgb(222, 173, 237);
```
*/
rgb: (red: number, green: number, blue: number) => this;
/**
Use HEX value to set text color.
@param color - Hexadecimal value representing the desired color.
@example
```
import chalk from 'chalk';
chalk.hex('#DEADED');
```
*/
hex: (color: string) => this;
/**
Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.
@example
```
import chalk from 'chalk';
chalk.ansi256(201);
```
*/
ansi256: (index: number) => this;
/**
Use RGB values to set background color.
@example
```
import chalk from 'chalk';
chalk.bgRgb(222, 173, 237);
```
*/
bgRgb: (red: number, green: number, blue: number) => this;
/**
Use HEX value to set background color.
@param color - Hexadecimal value representing the desired color.
@example
```
import chalk from 'chalk';
chalk.bgHex('#DEADED');
```
*/
bgHex: (color: string) => this;
/**
Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color.
@example
```
import chalk from 'chalk';
chalk.bgAnsi256(201);
```
*/
bgAnsi256: (index: number) => this;
/**
Modifier: Reset the current style.
*/
readonly reset: this;
/**
Modifier: Make the text bold.
*/
readonly bold: this;
/**
Modifier: Make the text have lower opacity.
*/
readonly dim: this;
/**
Modifier: Make the text italic. *(Not widely supported)*
*/
readonly italic: this;
/**
Modifier: Put a horizontal line below the text. *(Not widely supported)*
*/
readonly underline: this;
/**
Modifier: Put a horizontal line above the text. *(Not widely supported)*
*/
readonly overline: this;
/**
Modifier: Invert background and foreground colors.
*/
readonly inverse: this;
/**
Modifier: Print the text but make it invisible.
*/
readonly hidden: this;
/**
Modifier: Puts a horizontal line through the center of the text. *(Not widely supported)*
*/
readonly strikethrough: this;
/**
Modifier: Print the text only when Chalk has a color level above zero.
Can be useful for things that are purely cosmetic.
*/
readonly visible: this;
readonly black: this;
readonly red: this;
readonly green: this;
readonly yellow: this;
readonly blue: this;
readonly magenta: this;
readonly cyan: this;
readonly white: this;
/*
Alias for `blackBright`.
*/
readonly gray: this;
/*
Alias for `blackBright`.
*/
readonly grey: this;
readonly blackBright: this;
readonly redBright: this;
readonly greenBright: this;
readonly yellowBright: this;
readonly blueBright: this;
readonly magentaBright: this;
readonly cyanBright: this;
readonly whiteBright: this;
readonly bgBlack: this;
readonly bgRed: this;
readonly bgGreen: this;
readonly bgYellow: this;
readonly bgBlue: this;
readonly bgMagenta: this;
readonly bgCyan: this;
readonly bgWhite: this;
/*
Alias for `bgBlackBright`.
*/
readonly bgGray: this;
/*
Alias for `bgBlackBright`.
*/
readonly bgGrey: this;
readonly bgBlackBright: this;
readonly bgRedBright: this;
readonly bgGreenBright: this;
readonly bgYellowBright: this;
readonly bgBlueBright: this;
readonly bgMagentaBright: this;
readonly bgCyanBright: this;
readonly bgWhiteBright: this;
}
declare namespace npmlog {

@@ -300,9 +85,9 @@ // TODO: newStream, newGroup, setGaugeTemplate and setGaugeTemplateSet need to be added

declare const colors: {
pink: ChalkInstance;
purple: ChalkInstance;
orange: ChalkInstance;
green: ChalkInstance;
blue: ChalkInstance;
red: ChalkInstance;
gray: ChalkInstance;
pink: (text: string) => string;
purple: (text: string) => string;
orange: (text: string) => string;
green: (text: string) => string;
blue: (text: string) => string;
red: (text: string) => string;
gray: (text: string) => string;
};

@@ -309,0 +94,0 @@ declare const logger: {

@@ -876,3 +876,3 @@ import { Channel } from '@storybook/core/channels';

setSelection(selection: Selection): void;
setQueryParams(queryParams: qs.ParsedQs): void;
setQueryParams(queryParams: Record<PropertyKey, unknown>): void;
}

@@ -967,56 +967,2 @@

declare namespace QueryString {
type defaultEncoder = (str: any, defaultEncoder?: any, charset?: string) => string;
type defaultDecoder = (str: string, decoder?: any, charset?: string) => string;
interface IStringifyOptions {
delimiter?: string | undefined;
strictNullHandling?: boolean | undefined;
skipNulls?: boolean | undefined;
encode?: boolean | undefined;
encoder?:
| ((str: any, defaultEncoder: defaultEncoder, charset: string, type: "key" | "value") => string)
| undefined;
filter?: Array<string | number> | ((prefix: string, value: any) => any) | undefined;
arrayFormat?: "indices" | "brackets" | "repeat" | "comma" | undefined;
indices?: boolean | undefined;
sort?: ((a: any, b: any) => number) | undefined;
serializeDate?: ((d: Date) => string) | undefined;
format?: "RFC1738" | "RFC3986" | undefined;
encodeValuesOnly?: boolean | undefined;
addQueryPrefix?: boolean | undefined;
allowDots?: boolean | undefined;
charset?: "utf-8" | "iso-8859-1" | undefined;
charsetSentinel?: boolean | undefined;
}
interface IParseOptions {
comma?: boolean | undefined;
delimiter?: string | RegExp | undefined;
depth?: number | false | undefined;
decoder?:
| ((str: string, defaultDecoder: defaultDecoder, charset: string, type: "key" | "value") => any)
| undefined;
arrayLimit?: number | undefined;
parseArrays?: boolean | undefined;
allowDots?: boolean | undefined;
plainObjects?: boolean | undefined;
allowPrototypes?: boolean | undefined;
parameterLimit?: number | undefined;
strictNullHandling?: boolean | undefined;
ignoreQueryPrefix?: boolean | undefined;
charset?: "utf-8" | "iso-8859-1" | undefined;
charsetSentinel?: boolean | undefined;
interpretNumericEntities?: boolean | undefined;
}
interface ParsedQs {
[key: string]: undefined | string | string[] | ParsedQs | ParsedQs[];
}
function stringify(obj: any, options?: IStringifyOptions): string;
function parse(str: string, options?: IParseOptions & { decoder?: never | undefined }): ParsedQs;
function parse(str: string | Record<string, string>, options?: IParseOptions): { [key: string]: unknown };
}
declare class UrlStore implements SelectionStore {

@@ -1027,3 +973,3 @@ selectionSpecifier: SelectionSpecifier | null;

setSelection(selection: Selection): void;
setQueryParams(queryParams: QueryString.ParsedQs): void;
setQueryParams(queryParams: Record<PropertyKey, unknown>): void;
}

@@ -1030,0 +976,0 @@

@@ -19,3 +19,2 @@ import * as React from 'react';

}
declare const queryFromString: (s?: string) => Query;
declare const queryFromLocation: (location: Partial<Location>) => Query;

@@ -387,2 +386,2 @@ declare const stringifyQuery: (query: Query) => string;

export { BaseLocationProvider, DEEPLY_EQUAL, Link, type LinkProps, Location$1 as Location, LocationProvider, Match, type NavigateFunction, type NavigateOptions, type Other, type RenderData, Route, type RouterData, type StoryData, buildArgsParam, deepDiff, getMatch, parsePath, queryFromLocation, queryFromString, stringifyQuery, useNavigate };
export { BaseLocationProvider, DEEPLY_EQUAL, Link, type LinkProps, Location$1 as Location, LocationProvider, Match, type NavigateFunction, type NavigateOptions, type Other, type RenderData, Route, type RouterData, type StoryData, buildArgsParam, deepDiff, getMatch, parsePath, queryFromLocation, stringifyQuery, useNavigate };

@@ -7,16 +7,22 @@ import ESM_COMPAT_Module from "node:module";

const require = ESM_COMPAT_Module.createRequire(import.meta.url);
var Ae = Object.create;
var I = Object.defineProperty;
var ke = Object.getOwnPropertyDescriptor;
var Ce = Object.getOwnPropertyNames;
var Te = Object.getPrototypeOf, xe = Object.prototype.hasOwnProperty;
var n = (t, o) => I(t, "name", { value: o, configurable: !0 });
var _e = (t, o) => () => (o || t((o = { exports: {} }).exports, o), o.exports);
var Me = (t, o, e, r) => {
if (o && typeof o == "object" || typeof o == "function")
for (let s of Ce(o))
!xe.call(t, s) && s !== e && I(t, s, { get: () => o[s], enumerable: !(r = ke(o, s)) || r.enumerable });
var ne = Object.create;
var x = Object.defineProperty;
var ae = Object.getOwnPropertyDescriptor;
var ie = Object.getOwnPropertyNames;
var ce = Object.getPrototypeOf, ue = Object.prototype.hasOwnProperty;
var s = (t, e) => x(t, "name", { value: e, configurable: !0 }), f = /* @__PURE__ */ ((t) => typeof require < "u" ? require : typeof Proxy < "\
u" ? new Proxy(t, {
get: (e, o) => (typeof require < "u" ? require : e)[o]
}) : t)(function(t) {
if (typeof require < "u") return require.apply(this, arguments);
throw Error('Dynamic require of "' + t + '" is not supported');
});
var O = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports);
var le = (t, e, o, n) => {
if (e && typeof e == "object" || typeof e == "function")
for (let c of ie(e))
!ue.call(t, c) && c !== o && x(t, c, { get: () => e[c], enumerable: !(n = ae(e, c)) || n.enumerable });
return t;
};
var Ie = (t, o, e) => (e = t != null ? Ae(Te(t)) : {}, Me(
var A = (t, e, o) => (o = t != null ? ne(ce(t)) : {}, le(
// If the importer is in node compatibility mode or this is not an ESM

@@ -26,415 +32,126 @@ // file that has been converted to a CommonJS file using a Babel-

// "default" to the CommonJS "module.exports" for node compatibility.
o || !t || !t.__esModule ? I(e, "default", { value: t, enumerable: !0 }) : e,
e || !t || !t.__esModule ? x(o, "default", { value: t, enumerable: !0 }) : o,
t
));
// ../node_modules/picocolors/picocolors.js
var w = O((ye, k) => {
var _ = process.argv || [], h = process.env, me = !("NO_COLOR" in h || _.includes("--no-color")) && ("FORCE_COLOR" in h || _.includes("--c\
olor") || process.platform === "win32" || f != null && f("tty").isatty(1) && h.TERM !== "dumb" || "CI" in h), be = /* @__PURE__ */ s((t, e, o = t) => (n) => {
let c = "" + n, u = c.indexOf(e, t.length);
return ~u ? t + ge(c, e, o, u) + e : t + c + e;
}, "formatter"), ge = /* @__PURE__ */ s((t, e, o, n) => {
let c = "", u = 0;
do
c += t.substring(u, n) + o, u = n + e.length, n = t.indexOf(e, u);
while (~n);
return c + t.substring(u);
}, "replaceClose"), C = /* @__PURE__ */ s((t = me) => {
let e = t ? be : () => String;
return {
isColorSupported: t,
reset: e("\x1B[0m", "\x1B[0m"),
bold: e("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
dim: e("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
italic: e("\x1B[3m", "\x1B[23m"),
underline: e("\x1B[4m", "\x1B[24m"),
inverse: e("\x1B[7m", "\x1B[27m"),
hidden: e("\x1B[8m", "\x1B[28m"),
strikethrough: e("\x1B[9m", "\x1B[29m"),
black: e("\x1B[30m", "\x1B[39m"),
red: e("\x1B[31m", "\x1B[39m"),
green: e("\x1B[32m", "\x1B[39m"),
yellow: e("\x1B[33m", "\x1B[39m"),
blue: e("\x1B[34m", "\x1B[39m"),
magenta: e("\x1B[35m", "\x1B[39m"),
cyan: e("\x1B[36m", "\x1B[39m"),
white: e("\x1B[37m", "\x1B[39m"),
gray: e("\x1B[90m", "\x1B[39m"),
bgBlack: e("\x1B[40m", "\x1B[49m"),
bgRed: e("\x1B[41m", "\x1B[49m"),
bgGreen: e("\x1B[42m", "\x1B[49m"),
bgYellow: e("\x1B[43m", "\x1B[49m"),
bgBlue: e("\x1B[44m", "\x1B[49m"),
bgMagenta: e("\x1B[45m", "\x1B[49m"),
bgCyan: e("\x1B[46m", "\x1B[49m"),
bgWhite: e("\x1B[47m", "\x1B[49m"),
blackBright: e("\x1B[90m", "\x1B[39m"),
redBright: e("\x1B[91m", "\x1B[39m"),
greenBright: e("\x1B[92m", "\x1B[39m"),
yellowBright: e("\x1B[93m", "\x1B[39m"),
blueBright: e("\x1B[94m", "\x1B[39m"),
magentaBright: e("\x1B[95m", "\x1B[39m"),
cyanBright: e("\x1B[96m", "\x1B[39m"),
whiteBright: e("\x1B[97m", "\x1B[39m"),
bgBlackBright: e("\x1B[100m", "\x1B[49m"),
bgRedBright: e("\x1B[101m", "\x1B[49m"),
bgGreenBright: e("\x1B[102m", "\x1B[49m"),
bgYellowBright: e("\x1B[103m", "\x1B[49m"),
bgBlueBright: e("\x1B[104m", "\x1B[49m"),
bgMagentaBright: e("\x1B[105m", "\x1B[49m"),
bgCyanBright: e("\x1B[106m", "\x1B[49m"),
bgWhiteBright: e("\x1B[107m", "\x1B[49m")
};
}, "createColors");
k.exports = C();
k.exports.createColors = C;
});
// ../node_modules/ts-dedent/dist/index.js
var Y = _e((C) => {
var I = O((y) => {
"use strict";
Object.defineProperty(C, "__esModule", { value: !0 });
C.dedent = void 0;
function U(t) {
for (var o = [], e = 1; e < arguments.length; e++)
o[e - 1] = arguments[e];
var r = Array.from(typeof t == "string" ? [t] : t);
r[r.length - 1] = r[r.length - 1].replace(/\r?\n([\t ]*)$/, "");
var s = r.reduce(function(g, _) {
var O = _.match(/\n([\t ]+|(?!\s).)/g);
return O ? g.concat(O.map(function(M) {
var y, b;
return (b = (y = M.match(/[\t ]/g)) === null || y === void 0 ? void 0 : y.length) !== null && b !== void 0 ? b : 0;
})) : g;
Object.defineProperty(y, "__esModule", { value: !0 });
y.dedent = void 0;
function M(t) {
for (var e = [], o = 1; o < arguments.length; o++)
e[o - 1] = arguments[o];
var n = Array.from(typeof t == "string" ? [t] : t);
n[n.length - 1] = n[n.length - 1].replace(/\r?\n([\t ]*)$/, "");
var c = n.reduce(function(m, E) {
var p = E.match(/\n([\t ]+|(?!\s).)/g);
return p ? m.concat(p.map(function(R) {
var g, d;
return (d = (g = R.match(/[\t ]/g)) === null || g === void 0 ? void 0 : g.length) !== null && d !== void 0 ? d : 0;
})) : m;
}, []);
if (s.length) {
var c = new RegExp(`
[ ]{` + Math.min.apply(Math, s) + "}", "g");
r = r.map(function(g) {
return g.replace(c, `
if (c.length) {
var u = new RegExp(`
[ ]{` + Math.min.apply(Math, c) + "}", "g");
n = n.map(function(m) {
return m.replace(u, `
`);
});
}
r[0] = r[0].replace(/^\r?\n/, "");
var l = r[0];
return o.forEach(function(g, _) {
var O = l.match(/(?:^|\n)( *)$/), M = O ? O[1] : "", y = g;
typeof g == "string" && g.includes(`
`) && (y = String(g).split(`
`).map(function(b, Oe) {
return Oe === 0 ? b : "" + M + b;
n[0] = n[0].replace(/^\r?\n/, "");
var b = n[0];
return e.forEach(function(m, E) {
var p = b.match(/(?:^|\n)( *)$/), R = p ? p[1] : "", g = m;
typeof m == "string" && m.includes(`
`) && (g = String(m).split(`
`).map(function(d, se) {
return se === 0 ? d : "" + R + d;
}).join(`
`)), l += y + r[_ + 1];
}), l;
`)), b += g + n[E + 1];
}), b;
}
n(U, "dedent");
C.dedent = U;
C.default = U;
s(M, "dedent");
y.dedent = M;
y.default = M;
});
// node_modules/chalk/source/vendor/ansi-styles/index.js
var L = /* @__PURE__ */ n((t = 0) => (o) => `\x1B[${o + t}m`, "wrapAnsi16"), B = /* @__PURE__ */ n((t = 0) => (o) => `\x1B[${38 + t};5;${o}m`,
"wrapAnsi256"), W = /* @__PURE__ */ n((t = 0) => (o, e, r) => `\x1B[${38 + t};2;${o};${e};${r}m`, "wrapAnsi16m"), d = {
modifier: {
reset: [0, 0],
// 21 isn't widely supported and 22 does the same thing
bold: [1, 22],
dim: [2, 22],
italic: [3, 23],
underline: [4, 24],
overline: [53, 55],
inverse: [7, 27],
hidden: [8, 28],
strikethrough: [9, 29]
},
color: {
black: [30, 39],
red: [31, 39],
green: [32, 39],
yellow: [33, 39],
blue: [34, 39],
magenta: [35, 39],
cyan: [36, 39],
white: [37, 39],
// Bright color
blackBright: [90, 39],
gray: [90, 39],
// Alias of `blackBright`
grey: [90, 39],
// Alias of `blackBright`
redBright: [91, 39],
greenBright: [92, 39],
yellowBright: [93, 39],
blueBright: [94, 39],
magentaBright: [95, 39],
cyanBright: [96, 39],
whiteBright: [97, 39]
},
bgColor: {
bgBlack: [40, 49],
bgRed: [41, 49],
bgGreen: [42, 49],
bgYellow: [43, 49],
bgBlue: [44, 49],
bgMagenta: [45, 49],
bgCyan: [46, 49],
bgWhite: [47, 49],
// Bright color
bgBlackBright: [100, 49],
bgGray: [100, 49],
// Alias of `bgBlackBright`
bgGrey: [100, 49],
// Alias of `bgBlackBright`
bgRedBright: [101, 49],
bgGreenBright: [102, 49],
bgYellowBright: [103, 49],
bgBlueBright: [104, 49],
bgMagentaBright: [105, 49],
bgCyanBright: [106, 49],
bgWhiteBright: [107, 49]
}
}, He = Object.keys(d.modifier), Se = Object.keys(d.color), we = Object.keys(d.bgColor), Xe = [...Se, ...we];
function ve() {
let t = /* @__PURE__ */ new Map();
for (let [o, e] of Object.entries(d)) {
for (let [r, s] of Object.entries(e))
d[r] = {
open: `\x1B[${s[0]}m`,
close: `\x1B[${s[1]}m`
}, e[r] = d[r], t.set(s[0], s[1]);
Object.defineProperty(d, o, {
value: e,
enumerable: !1
});
}
return Object.defineProperty(d, "codes", {
value: t,
enumerable: !1
}), d.color.close = "\x1B[39m", d.bgColor.close = "\x1B[49m", d.color.ansi = L(), d.color.ansi256 = B(), d.color.ansi16m = W(), d.bgColor.
ansi = L(10), d.bgColor.ansi256 = B(10), d.bgColor.ansi16m = W(10), Object.defineProperties(d, {
rgbToAnsi256: {
value(o, e, r) {
return o === e && e === r ? o < 8 ? 16 : o > 248 ? 231 : Math.round((o - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(o / 255 * 5) + 6 *
Math.round(e / 255 * 5) + Math.round(r / 255 * 5);
},
enumerable: !1
},
hexToRgb: {
value(o) {
let e = /[a-f\d]{6}|[a-f\d]{3}/i.exec(o.toString(16));
if (!e)
return [0, 0, 0];
let [r] = e;
r.length === 3 && (r = [...r].map((c) => c + c).join(""));
let s = Number.parseInt(r, 16);
return [
/* eslint-disable no-bitwise */
s >> 16 & 255,
s >> 8 & 255,
s & 255
/* eslint-enable no-bitwise */
];
},
enumerable: !1
},
hexToAnsi256: {
value: /* @__PURE__ */ n((o) => d.rgbToAnsi256(...d.hexToRgb(o)), "value"),
enumerable: !1
},
ansi256ToAnsi: {
value(o) {
if (o < 8)
return 30 + o;
if (o < 16)
return 90 + (o - 8);
let e, r, s;
if (o >= 232)
e = ((o - 232) * 10 + 8) / 255, r = e, s = e;
else {
o -= 16;
let g = o % 36;
e = Math.floor(o / 36) / 5, r = Math.floor(g / 6) / 5, s = g % 6 / 5;
}
let c = Math.max(e, r, s) * 2;
if (c === 0)
return 30;
let l = 30 + (Math.round(s) << 2 | Math.round(r) << 1 | Math.round(e));
return c === 2 && (l += 60), l;
},
enumerable: !1
},
rgbToAnsi: {
value: /* @__PURE__ */ n((o, e, r) => d.ansi256ToAnsi(d.rgbToAnsi256(o, e, r)), "value"),
enumerable: !1
},
hexToAnsi: {
value: /* @__PURE__ */ n((o) => d.ansi256ToAnsi(d.hexToAnsi256(o)), "value"),
enumerable: !1
}
}), d;
}
n(ve, "assembleStyles");
var Ne = ve(), h = Ne;
// node_modules/chalk/source/vendor/supports-color/index.js
import S from "node:process";
import Le from "node:os";
import F from "node:tty";
function f(t, o = globalThis.Deno ? globalThis.Deno.args : S.argv) {
let e = t.startsWith("-") ? "" : t.length === 1 ? "-" : "--", r = o.indexOf(e + t), s = o.indexOf("--");
return r !== -1 && (s === -1 || r < s);
}
n(f, "hasFlag");
var { env: p } = S, T;
f("no-color") || f("no-colors") || f("color=false") || f("color=never") ? T = 0 : (f("color") || f("colors") || f("color=true") || f("color=\
always")) && (T = 1);
function Be() {
if ("FORCE_COLOR" in p)
return p.FORCE_COLOR === "true" ? 1 : p.FORCE_COLOR === "false" ? 0 : p.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(p.FORCE_COLOR,
10), 3);
}
n(Be, "envForceColor");
function We(t) {
return t === 0 ? !1 : {
level: t,
hasBasic: !0,
has256: t >= 2,
has16m: t >= 3
};
}
n(We, "translateLevel");
function Fe(t, { streamIsTTY: o, sniffFlags: e = !0 } = {}) {
let r = Be();
r !== void 0 && (T = r);
let s = e ? T : r;
if (s === 0)
return 0;
if (e) {
if (f("color=16m") || f("color=full") || f("color=truecolor"))
return 3;
if (f("color=256"))
return 2;
}
if ("TF_BUILD" in p && "AGENT_NAME" in p)
return 1;
if (t && !o && s === void 0)
return 0;
let c = s || 0;
if (p.TERM === "dumb")
return c;
if (S.platform === "win32") {
let l = Le.release().split(".");
return Number(l[0]) >= 10 && Number(l[2]) >= 10586 ? Number(l[2]) >= 14931 ? 3 : 2 : 1;
}
if ("CI" in p)
return "GITHUB_ACTIONS" in p || "GITEA_ACTIONS" in p ? 3 : ["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((l) => l in
p) || p.CI_NAME === "codeship" ? 1 : c;
if ("TEAMCITY_VERSION" in p)
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(p.TEAMCITY_VERSION) ? 1 : 0;
if (p.COLORTERM === "truecolor" || p.TERM === "xterm-kitty")
return 3;
if ("TERM_PROGRAM" in p) {
let l = Number.parseInt((p.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
switch (p.TERM_PROGRAM) {
case "iTerm.app":
return l >= 3 ? 3 : 2;
case "Apple_Terminal":
return 2;
}
}
return /-256(color)?$/i.test(p.TERM) ? 2 : /^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(p.TERM) || "COLORTERM" in p ?
1 : c;
}
n(Fe, "_supportsColor");
function K(t, o = {}) {
let e = Fe(t, {
streamIsTTY: t && t.isTTY,
...o
});
return We(e);
}
n(K, "createSupportsColor");
var Ke = {
stdout: K({ isTTY: F.isatty(1) }),
stderr: K({ isTTY: F.isatty(2) })
}, P = Ke;
// node_modules/chalk/source/utilities.js
function j(t, o, e) {
let r = t.indexOf(o);
if (r === -1)
return t;
let s = o.length, c = 0, l = "";
do
l += t.slice(c, r) + o + e, c = r + s, r = t.indexOf(o, c);
while (r !== -1);
return l += t.slice(c), l;
}
n(j, "stringReplaceAll");
function V(t, o, e, r) {
let s = 0, c = "";
do {
let l = t[r - 1] === "\r";
c += t.slice(s, l ? r - 1 : r) + o + (l ? `\r
` : `
`) + e, s = r + 1, r = t.indexOf(`
`, s);
} while (r !== -1);
return c += t.slice(s), c;
}
n(V, "stringEncaseCRLFWithFirstIndex");
// node_modules/chalk/source/index.js
var { stdout: $, stderr: D } = P, w = Symbol("GENERATOR"), E = Symbol("STYLER"), A = Symbol("IS_EMPTY"), G = [
"ansi",
"ansi",
"ansi256",
"ansi16m"
], R = /* @__PURE__ */ Object.create(null), Pe = /* @__PURE__ */ n((t, o = {}) => {
if (o.level && !(Number.isInteger(o.level) && o.level >= 0 && o.level <= 3))
throw new Error("The `level` option should be an integer from 0 to 3");
let e = $ ? $.level : 0;
t.level = o.level === void 0 ? e : o.level;
}, "applyOptions");
var je = /* @__PURE__ */ n((t) => {
let o = /* @__PURE__ */ n((...e) => e.join(" "), "chalk");
return Pe(o, t), Object.setPrototypeOf(o, k.prototype), o;
}, "chalkFactory");
function k(t) {
return je(t);
}
n(k, "createChalk");
Object.setPrototypeOf(k.prototype, Function.prototype);
for (let [t, o] of Object.entries(h))
R[t] = {
get() {
let e = x(this, N(o.open, o.close, this[E]), this[A]);
return Object.defineProperty(this, t, { value: e }), e;
}
};
R.visible = {
get() {
let t = x(this, this[E], !0);
return Object.defineProperty(this, "visible", { value: t }), t;
}
};
var v = /* @__PURE__ */ n((t, o, e, ...r) => t === "rgb" ? o === "ansi16m" ? h[e].ansi16m(...r) : o === "ansi256" ? h[e].ansi256(h.rgbToAnsi256(
...r)) : h[e].ansi(h.rgbToAnsi(...r)) : t === "hex" ? v("rgb", o, e, ...h.hexToRgb(...r)) : h[e][t](...r), "getModelAnsi"), Ve = ["rgb", "he\
x", "ansi256"];
for (let t of Ve) {
R[t] = {
get() {
let { level: e } = this;
return function(...r) {
let s = N(v(t, G[e], "color", ...r), h.color.close, this[E]);
return x(this, s, this[A]);
};
}
};
let o = "bg" + t[0].toUpperCase() + t.slice(1);
R[o] = {
get() {
let { level: e } = this;
return function(...r) {
let s = N(v(t, G[e], "bgColor", ...r), h.bgColor.close, this[E]);
return x(this, s, this[A]);
};
}
};
}
var $e = Object.defineProperties(() => {
}, {
...R,
level: {
enumerable: !0,
get() {
return this[w].level;
},
set(t) {
this[w].level = t;
}
}
}), N = /* @__PURE__ */ n((t, o, e) => {
let r, s;
return e === void 0 ? (r = t, s = o) : (r = e.openAll + t, s = o + e.closeAll), {
open: t,
close: o,
openAll: r,
closeAll: s,
parent: e
};
}, "createStyler"), x = /* @__PURE__ */ n((t, o, e) => {
let r = /* @__PURE__ */ n((...s) => De(r, s.length === 1 ? "" + s[0] : s.join(" ")), "builder");
return Object.setPrototypeOf(r, $e), r[w] = t, r[E] = o, r[A] = e, r;
}, "createBuilder"), De = /* @__PURE__ */ n((t, o) => {
if (t.level <= 0 || !o)
return t[A] ? "" : o;
let e = t[E];
if (e === void 0)
return o;
let { openAll: r, closeAll: s } = e;
if (o.includes("\x1B"))
for (; e !== void 0; )
o = j(o, e.close, e.open), e = e.parent;
let c = o.indexOf(`
`);
return c !== -1 && (o = V(o, s, r, c)), r + o + s;
}, "applyStyle");
Object.defineProperties(k.prototype, R);
var Ge = k(), ao = k({ level: D ? D.level : 0 });
var m = Ge;
// src/server-errors.ts
var u = Ie(Y(), 1);
var l = A(w(), 1), i = A(I(), 1);
// src/storybook-error.ts
function H({
function S({
code: t,
category: o
category: e
}) {
let e = String(t).padStart(4, "0");
return `SB_${o}_${e}`;
let o = String(t).padStart(4, "0");
return `SB_${e}_${o}`;
}
n(H, "parseErrorCode");
s(S, "parseErrorCode");
var a = class t extends Error {
constructor(e) {
super(t.getFullMessage(e));
constructor(o) {
super(t.getFullMessage(o));
/**

@@ -447,29 +164,29 @@ * Data associated with the error. Used to provide additional information in the error message or

this.fromStorybook = !0;
this.category = e.category, this.documentation = e.documentation ?? !1, this.code = e.code;
this.category = o.category, this.documentation = o.documentation ?? !1, this.code = o.code;
}
static {
n(this, "StorybookError");
s(this, "StorybookError");
}
get fullErrorCode() {
return H({ code: this.code, category: this.category });
return S({ code: this.code, category: this.category });
}
/** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
get name() {
let e = this.constructor.name;
return `${this.fullErrorCode} (${e})`;
let o = this.constructor.name;
return `${this.fullErrorCode} (${o})`;
}
/** Generates the error message along with additional documentation link (if applicable). */
static getFullMessage({
documentation: e,
code: r,
category: s,
message: c
documentation: o,
code: n,
category: c,
message: u
}) {
let l;
return e === !0 ? l = `https://storybook.js.org/error/${H({ code: r, category: s })}` : typeof e == "string" ? l = e : Array.isArray(e) &&
(l = `
${e.map((g) => ` - ${g}`).join(`
`)}`), `${c}${l != null ? `
let b;
return o === !0 ? b = `https://storybook.js.org/error/${S({ code: n, category: c })}` : typeof o == "string" ? b = o : Array.isArray(o) &&
(b = `
${o.map((m) => ` - ${m}`).join(`
`)}`), `${u}${b != null ? `
More info: ${l}
More info: ${b}
` : ""}`;

@@ -480,16 +197,16 @@ }

// src/server-errors.ts
var Ue = /* @__PURE__ */ ((i) => (i.CLI = "CLI", i.CLI_INIT = "CLI_INIT", i.CLI_AUTOMIGRATE = "CLI_AUTOMIGRATE", i.CLI_UPGRADE = "CLI_UPGRAD\
E", i.CLI_ADD = "CLI_ADD", i.CODEMOD = "CODEMOD", i.CORE_SERVER = "CORE-SERVER", i.CSF_PLUGIN = "CSF-PLUGIN", i.CSF_TOOLS = "CSF-TOOLS", i.CORE_COMMON =
"CORE-COMMON", i.NODE_LOGGER = "NODE-LOGGER", i.TELEMETRY = "TELEMETRY", i.BUILDER_MANAGER = "BUILDER-MANAGER", i.BUILDER_VITE = "BUILDER-VI\
TE", i.BUILDER_WEBPACK5 = "BUILDER-WEBPACK5", i.SOURCE_LOADER = "SOURCE-LOADER", i.POSTINSTALL = "POSTINSTALL", i.DOCS_TOOLS = "DOCS-TOOLS",
i.CORE_WEBPACK = "CORE-WEBPACK", i.FRAMEWORK_ANGULAR = "FRAMEWORK_ANGULAR", i.FRAMEWORK_EMBER = "FRAMEWORK_EMBER", i.FRAMEWORK_HTML_VITE = "\
FRAMEWORK_HTML-VITE", i.FRAMEWORK_HTML_WEBPACK5 = "FRAMEWORK_HTML-WEBPACK5", i.FRAMEWORK_NEXTJS = "FRAMEWORK_NEXTJS", i.FRAMEWORK_PREACT_VITE =
"FRAMEWORK_PREACT-VITE", i.FRAMEWORK_PREACT_WEBPACK5 = "FRAMEWORK_PREACT-WEBPACK5", i.FRAMEWORK_REACT_VITE = "FRAMEWORK_REACT-VITE", i.FRAMEWORK_REACT_WEBPACK5 =
"FRAMEWORK_REACT-WEBPACK5", i.FRAMEWORK_SERVER_WEBPACK5 = "FRAMEWORK_SERVER-WEBPACK5", i.FRAMEWORK_SVELTE_VITE = "FRAMEWORK_SVELTE-VITE", i.
FRAMEWORK_SVELTE_WEBPACK5 = "FRAMEWORK_SVELTE-WEBPACK5", i.FRAMEWORK_SVELTEKIT = "FRAMEWORK_SVELTEKIT", i.FRAMEWORK_VUE_VITE = "FRAMEWORK_VU\
E-VITE", i.FRAMEWORK_VUE_WEBPACK5 = "FRAMEWORK_VUE-WEBPACK5", i.FRAMEWORK_VUE3_VITE = "FRAMEWORK_VUE3-VITE", i.FRAMEWORK_VUE3_WEBPACK5 = "FR\
AMEWORK_VUE3-WEBPACK5", i.FRAMEWORK_WEB_COMPONENTS_VITE = "FRAMEWORK_WEB-COMPONENTS-VITE", i.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_\
WEB-COMPONENTS-WEBPACK5", i))(Ue || {}), X = class extends a {
var de = /* @__PURE__ */ ((r) => (r.CLI = "CLI", r.CLI_INIT = "CLI_INIT", r.CLI_AUTOMIGRATE = "CLI_AUTOMIGRATE", r.CLI_UPGRADE = "CLI_UPGRAD\
E", r.CLI_ADD = "CLI_ADD", r.CODEMOD = "CODEMOD", r.CORE_SERVER = "CORE-SERVER", r.CSF_PLUGIN = "CSF-PLUGIN", r.CSF_TOOLS = "CSF-TOOLS", r.CORE_COMMON =
"CORE-COMMON", r.NODE_LOGGER = "NODE-LOGGER", r.TELEMETRY = "TELEMETRY", r.BUILDER_MANAGER = "BUILDER-MANAGER", r.BUILDER_VITE = "BUILDER-VI\
TE", r.BUILDER_WEBPACK5 = "BUILDER-WEBPACK5", r.SOURCE_LOADER = "SOURCE-LOADER", r.POSTINSTALL = "POSTINSTALL", r.DOCS_TOOLS = "DOCS-TOOLS",
r.CORE_WEBPACK = "CORE-WEBPACK", r.FRAMEWORK_ANGULAR = "FRAMEWORK_ANGULAR", r.FRAMEWORK_EMBER = "FRAMEWORK_EMBER", r.FRAMEWORK_HTML_VITE = "\
FRAMEWORK_HTML-VITE", r.FRAMEWORK_HTML_WEBPACK5 = "FRAMEWORK_HTML-WEBPACK5", r.FRAMEWORK_NEXTJS = "FRAMEWORK_NEXTJS", r.FRAMEWORK_PREACT_VITE =
"FRAMEWORK_PREACT-VITE", r.FRAMEWORK_PREACT_WEBPACK5 = "FRAMEWORK_PREACT-WEBPACK5", r.FRAMEWORK_REACT_VITE = "FRAMEWORK_REACT-VITE", r.FRAMEWORK_REACT_WEBPACK5 =
"FRAMEWORK_REACT-WEBPACK5", r.FRAMEWORK_SERVER_WEBPACK5 = "FRAMEWORK_SERVER-WEBPACK5", r.FRAMEWORK_SVELTE_VITE = "FRAMEWORK_SVELTE-VITE", r.
FRAMEWORK_SVELTE_WEBPACK5 = "FRAMEWORK_SVELTE-WEBPACK5", r.FRAMEWORK_SVELTEKIT = "FRAMEWORK_SVELTEKIT", r.FRAMEWORK_VUE_VITE = "FRAMEWORK_VU\
E-VITE", r.FRAMEWORK_VUE_WEBPACK5 = "FRAMEWORK_VUE-WEBPACK5", r.FRAMEWORK_VUE3_VITE = "FRAMEWORK_VUE3-VITE", r.FRAMEWORK_VUE3_WEBPACK5 = "FR\
AMEWORK_VUE3-WEBPACK5", r.FRAMEWORK_WEB_COMPONENTS_VITE = "FRAMEWORK_WEB-COMPONENTS-VITE", r.FRAMEWORK_WEB_COMPONENTS_WEBPACK5 = "FRAMEWORK_\
WEB-COMPONENTS-WEBPACK5", r))(de || {}), T = class extends a {
static {
n(this, "NxProjectDetectedError");
s(this, "NxProjectDetectedError");
}

@@ -501,3 +218,3 @@ constructor() {

documentation: "https://nx.dev/packages/storybook",
message: u.dedent`
message: i.dedent`
We have detected Nx in your project. Nx has its own Storybook initializer, so please use it instead.

@@ -507,5 +224,5 @@ Run "nx g @nx/storybook:configuration" to add Storybook to your project.`

}
}, z = class extends a {
}, W = class extends a {
static {
n(this, "MissingFrameworkFieldError");
s(this, "MissingFrameworkFieldError");
}

@@ -517,3 +234,3 @@ constructor() {

documentation: "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#new-framework-api",
message: u.dedent`
message: i.dedent`
Could not find a 'framework' field in Storybook config.

@@ -524,4 +241,4 @@

}
}, J = class extends a {
constructor(e) {
}, K = class extends a {
constructor(o) {
super({

@@ -531,4 +248,4 @@ category: "CORE-COMMON",

documentation: "https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#new-framework-api",
message: u.dedent`
Invalid value of '${e.frameworkName}' in the 'framework' field of Storybook config.
message: i.dedent`
Invalid value of '${o.frameworkName}' in the 'framework' field of Storybook config.

@@ -538,9 +255,9 @@ Please run 'npx storybook automigrate' to automatically fix your config.

});
this.data = e;
this.data = o;
}
static {
n(this, "InvalidFrameworkNameError");
s(this, "InvalidFrameworkNameError");
}
}, q = class extends a {
constructor(e) {
}, v = class extends a {
constructor(o) {
super({

@@ -550,15 +267,15 @@ category: "CORE-COMMON",

documentation: "",
message: u.dedent`
Could not evaluate the '${e.frameworkName}' package from the 'framework' field of Storybook config.
message: i.dedent`
Could not evaluate the '${o.frameworkName}' package from the 'framework' field of Storybook config.
Are you sure it's a valid package and is installed?`
});
this.data = e;
this.data = o;
}
static {
n(this, "CouldNotEvaluateFrameworkError");
s(this, "CouldNotEvaluateFrameworkError");
}
}, Q = class extends a {
}, L = class extends a {
static {
n(this, "ConflictingStaticDirConfigError");
s(this, "ConflictingStaticDirConfigError");
}

@@ -570,3 +287,3 @@ constructor() {

documentation: "https://storybook.js.org/docs/react/configure/images-and-assets#serving-static-files-via-storybook-configuration",
message: u.dedent`
message: i.dedent`
Storybook encountered a conflict when trying to serve statics. You have configured both:

@@ -579,5 +296,5 @@ * Storybook's option in the config file: 'staticDirs'

}
}, Z = class extends a {
}, B = class extends a {
static {
n(this, "InvalidStoriesEntryError");
s(this, "InvalidStoriesEntryError");
}

@@ -589,3 +306,3 @@ constructor() {

documentation: "https://storybook.js.org/docs/react/faq#can-i-have-a-storybook-with-no-local-stories",
message: u.dedent`
message: i.dedent`
Storybook could not index your stories.

@@ -597,5 +314,5 @@ Your main configuration somehow does not contain a 'stories' field, or it resolved to an empty array.

}
}, ee = class extends a {
}, P = class extends a {
static {
n(this, "WebpackMissingStatsError");
s(this, "WebpackMissingStatsError");
}

@@ -610,3 +327,3 @@ constructor() {

],
message: u.dedent`
message: i.dedent`
No Webpack stats found. Did you turn off stats reporting in your Webpack config?

@@ -616,26 +333,26 @@ Storybook needs Webpack stats (including errors) in order to build correctly.`

}
}, oe = class extends a {
constructor(e) {
}, N = class extends a {
constructor(o) {
super({
category: "BUILDER-WEBPACK5",
code: 2,
message: e.error.message.trim()
message: o.error.message.trim()
});
this.data = e;
this.data = o;
}
static {
n(this, "WebpackInvocationError");
s(this, "WebpackInvocationError");
}
};
function te(t = "") {
function V(t = "") {
return t.replace(/\u001B\[[0-9;]*m/g, "");
}
n(te, "removeAnsiEscapeCodes");
var re = class extends a {
constructor(e) {
e.errors = e.errors.map((r) => ({
...r,
message: te(r.message),
stack: te(r.stack),
name: r.name
s(V, "removeAnsiEscapeCodes");
var j = class extends a {
constructor(o) {
o.errors = o.errors.map((n) => ({
...n,
message: V(n.message),
stack: V(n.stack),
name: n.name
}));

@@ -646,3 +363,3 @@ super({

// This error message is a followup of errors logged by Webpack to the user
message: u.dedent`
message: i.dedent`
There were problems when compiling your code with Webpack.

@@ -652,9 +369,9 @@ Run Storybook with --debug-webpack for more information.

});
this.data = e;
this.data = o;
}
static {
n(this, "WebpackCompilationError");
s(this, "WebpackCompilationError");
}
}, ne = class extends a {
constructor(e) {
}, F = class extends a {
constructor(o) {
super({

@@ -664,14 +381,14 @@ category: "CLI_INIT",

documentation: "https://storybook.js.org/docs/angular/faq#error-no-angularjson-file-found",
message: u.dedent`
An angular.json file was not found in the current working directory: ${e.path}
message: i.dedent`
An angular.json file was not found in the current working directory: ${o.path}
Storybook needs it to work properly, so please rerun the command at the root of your project, where the angular.json file is located.`
});
this.data = e;
this.data = o;
}
static {
n(this, "MissingAngularJsonError");
s(this, "MissingAngularJsonError");
}
}, se = class extends a {
}, $ = class extends a {
static {
n(this, "AngularLegacyBuildOptionsError");
s(this, "AngularLegacyBuildOptionsError");
}

@@ -686,3 +403,3 @@ constructor() {

],
message: u.dedent`
message: i.dedent`
Your Storybook startup script uses a solution that is not supported anymore.

@@ -694,4 +411,4 @@ You must use Angular builder to have an explicit configuration on the project used in angular.json.

}
}, ie = class extends a {
constructor(e) {
}, D = class extends a {
constructor(o) {
super({

@@ -701,4 +418,4 @@ category: "CORE-SERVER",

documentation: "",
message: u.dedent`
Storybook failed to load the following preset: ${e.presetName}.
message: i.dedent`
Storybook failed to load the following preset: ${o.presetName}.

@@ -709,12 +426,12 @@ Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.

${e.error.stack || e.error.message}`
${o.error.stack || o.error.message}`
});
this.data = e;
this.data = o;
}
static {
n(this, "CriticalPresetLoadError");
s(this, "CriticalPresetLoadError");
}
}, ae = class extends a {
}, U = class extends a {
static {
n(this, "MissingBuilderError");
s(this, "MissingBuilderError");
}

@@ -726,3 +443,3 @@ constructor() {

documentation: "https://github.com/storybookjs/storybook/issues/24071",
message: u.dedent`
message: i.dedent`
Storybook could not find a builder configuration for your project.

@@ -739,4 +456,4 @@ Builders normally come from a framework package e.g. '@storybook/react-vite', or from builder packages e.g. '@storybook/builder-vite'.

}
}, ce = class extends a {
constructor(e) {
}, G = class extends a {
constructor(o) {
super({

@@ -746,12 +463,12 @@ category: "FRAMEWORK_NEXTJS",

documentation: "https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/README.md#nextjs-font-optimization",
message: u.dedent`
Failed to fetch \`${e.fontFamily}\` from Google Fonts with URL: \`${e.url}\``
message: i.dedent`
Failed to fetch \`${o.fontFamily}\` from Google Fonts with URL: \`${o.url}\``
});
this.data = e;
this.data = o;
}
static {
n(this, "GoogleFontsDownloadError");
s(this, "GoogleFontsDownloadError");
}
}, le = class extends a {
constructor(e) {
}, Y = class extends a {
constructor(o) {
super({

@@ -761,14 +478,14 @@ category: "FRAMEWORK_NEXTJS",

documentation: "https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/README.md#nextjs-font-optimization",
message: u.dedent`
An error occurred when trying to load Google Fonts with URL \`${e.url}\`.
message: i.dedent`
An error occurred when trying to load Google Fonts with URL \`${o.url}\`.
${e.error instanceof Error ? e.error.message : ""}`
${o.error instanceof Error ? o.error.message : ""}`
});
this.data = e;
this.data = o;
}
static {
n(this, "GoogleFontsLoadingError");
s(this, "GoogleFontsLoadingError");
}
}, ue = class extends a {
constructor(e) {
}, q = class extends a {
constructor(o) {
super({

@@ -778,3 +495,3 @@ category: "CORE-SERVER",

documentation: "",
message: u.dedent`
message: i.dedent`
There was an exports mismatch error when trying to build Storybook.

@@ -791,30 +508,30 @@ Please check whether the versions of your Storybook packages match whenever possible, as this might be the cause.

});
this.data = e;
this.data = o;
}
static {
n(this, "NoMatchingExportError");
s(this, "NoMatchingExportError");
}
}, de = class extends a {
constructor(e) {
let r = [
`Storybook failed to load ${e.location}`,
}, H = class extends a {
constructor(o) {
let n = [
`Storybook failed to load ${o.location}`,
"",
"It looks like the file tried to load/import an ESM only module.",
`Support for this is currently limited in ${e.location}`,
`Support for this is currently limited in ${o.location}`,
"You can import ESM modules in your main file, but only as dynamic import.",
""
];
e.line && r.push(
m.white(
`In your ${m.yellow(e.location)} file, line ${m.bold.cyan(
e.num
o.line && n.push(
l.default.white(
`In your ${l.default.yellow(o.location)} file, line ${l.default.bold(
l.default.cyan(o.num)
)} threw an error:`
),
m.grey(e.line)
), r.push(
l.default.gray(o.line)
), n.push(
"",
m.white(
`Convert the static import to a dynamic import ${m.underline("where they are used")}.`
l.default.white(
`Convert the static import to a dynamic import ${l.default.underline("where they are used")}.`
),
m.white("Example:") + " " + m.gray("await import(<your ESM only module>);"),
l.default.white("Example:") + " " + l.default.gray("await import(<your ESM only module>);"),
""

@@ -826,13 +543,13 @@ );

documentation: "https://github.com/storybookjs/storybook/issues/23972#issuecomment-1948534058",
message: r.join(`
message: n.join(`
`)
});
this.data = e;
this.data = o;
}
static {
n(this, "MainFileESMOnlyImportError");
s(this, "MainFileESMOnlyImportError");
}
}, pe = class extends a {
constructor(e) {
let r = {
}, X = class extends a {
constructor(o) {
let n = {
storybook: {

@@ -847,22 +564,22 @@ helperMessage: "You can pass a --config-dir flag to tell Storybook, where your main.js file is located at.",

}
}, { documentation: s, helperMessage: c } = r[e.source || "storybook"];
}, { documentation: c, helperMessage: u } = n[o.source || "storybook"];
super({
category: "CORE-SERVER",
code: 6,
documentation: s,
message: u.dedent`
No configuration files have been found in your configDir: ${m.yellow(e.location)}.
documentation: c,
message: i.dedent`
No configuration files have been found in your configDir: ${l.default.yellow(o.location)}.
Storybook needs a "main.js" file, please add it.
${c}`
${u}`
});
this.data = e;
this.data = o;
}
static {
n(this, "MainFileMissingError");
s(this, "MainFileMissingError");
}
}, ge = class extends a {
constructor(e) {
let r = m.white(
(e.error.stack || e.error.message).replaceAll(process.cwd(), "")
}, z = class extends a {
constructor(o) {
let n = l.default.white(
(o.error.stack || o.error.message).replaceAll(process.cwd(), "")
);

@@ -872,15 +589,15 @@ super({

code: 7,
message: u.dedent`
Storybook couldn't evaluate your ${m.yellow(e.location)} file.
message: i.dedent`
Storybook couldn't evaluate your ${l.default.yellow(o.location)} file.
Original error:
${r}`
${n}`
});
this.data = e;
this.data = o;
}
static {
n(this, "MainFileEvaluationError");
s(this, "MainFileEvaluationError");
}
}, fe = class extends a {
constructor(e) {
}, J = class extends a {
constructor(o) {
super({

@@ -890,21 +607,21 @@ category: "CLI_INIT",

documentation: "",
message: u.dedent`
There was an error while using ${e.packageManager} to create a new ${e.projectType} project.
message: i.dedent`
There was an error while using ${o.packageManager} to create a new ${o.projectType} project.
${e.error instanceof Error ? e.error.message : ""}`
${o.error instanceof Error ? o.error.message : ""}`
});
this.data = e;
this.data = o;
}
static {
n(this, "GenerateNewProjectOnInitError");
s(this, "GenerateNewProjectOnInitError");
}
}, me = class extends a {
constructor(e) {
}, Q = class extends a {
constructor(o) {
super({
category: "CLI_UPGRADE",
code: 3,
message: u.dedent`
message: i.dedent`
You are trying to upgrade Storybook to a lower version than the version currently installed. This is not supported.
Storybook version ${e.beforeVersion} was detected in your project, but you are trying to "upgrade" to version ${e.currentVersion}.
Storybook version ${o.beforeVersion} was detected in your project, but you are trying to "upgrade" to version ${o.currentVersion}.

@@ -918,14 +635,14 @@ This usually happens when running the upgrade command without a version specifier, e.g. "npx storybook upgrade".

});
this.data = e;
this.data = o;
}
static {
n(this, "UpgradeStorybookToLowerVersionError");
s(this, "UpgradeStorybookToLowerVersionError");
}
}, he = class extends a {
constructor(e) {
}, Z = class extends a {
constructor(o) {
super({
category: "CLI_UPGRADE",
code: 4,
message: u.dedent`
You are upgrading Storybook to the same version that is currently installed in the project, version ${e.beforeVersion}.
message: i.dedent`
You are upgrading Storybook to the same version that is currently installed in the project, version ${o.beforeVersion}.

@@ -944,10 +661,10 @@ This usually happens when running the upgrade command without a version specifier, e.g. "npx storybook upgrade".

});
this.data = e;
this.data = o;
}
static {
n(this, "UpgradeStorybookToSameVersionError");
s(this, "UpgradeStorybookToSameVersionError");
}
}, ye = class extends a {
}, ee = class extends a {
static {
n(this, "UpgradeStorybookUnknownCurrentVersionError");
s(this, "UpgradeStorybookUnknownCurrentVersionError");
}

@@ -958,3 +675,3 @@ constructor() {

code: 5,
message: u.dedent`
message: i.dedent`
We couldn't determine the current version of Storybook in your project.

@@ -966,5 +683,5 @@

}
}, be = class extends a {
}, oe = class extends a {
static {
n(this, "UpgradeStorybookInWrongWorkingDirectory");
s(this, "UpgradeStorybookInWrongWorkingDirectory");
}

@@ -975,3 +692,3 @@ constructor() {

code: 6,
message: u.dedent`
message: i.dedent`
You are running the upgrade command in a CWD that does not contain Storybook dependencies.

@@ -982,5 +699,5 @@

}
}, Ee = class extends a {
}, te = class extends a {
static {
n(this, "NoStatsForViteDevError");
s(this, "NoStatsForViteDevError");
}

@@ -991,3 +708,3 @@ constructor() {

code: 1,
message: u.dedent`
message: i.dedent`
Unable to write preview stats as the Vite builder does not support stats in dev mode.

@@ -998,45 +715,45 @@

}
}, Re = class extends a {
constructor(e) {
}, re = class extends a {
constructor(o) {
super({
category: "CLI",
code: 1,
message: u.dedent`
Unable to find versions of "${e.packageName}" using ${e.packageManager}
${e.error && `Reason: ${e.error}`}`
message: i.dedent`
Unable to find versions of "${o.packageName}" using ${o.packageManager}
${o.error && `Reason: ${o.error}`}`
});
this.data = e;
this.data = o;
}
static {
n(this, "FindPackageVersionsError");
s(this, "FindPackageVersionsError");
}
};
export {
se as AngularLegacyBuildOptionsError,
Ue as Category,
Q as ConflictingStaticDirConfigError,
q as CouldNotEvaluateFrameworkError,
ie as CriticalPresetLoadError,
Re as FindPackageVersionsError,
fe as GenerateNewProjectOnInitError,
ce as GoogleFontsDownloadError,
le as GoogleFontsLoadingError,
J as InvalidFrameworkNameError,
Z as InvalidStoriesEntryError,
de as MainFileESMOnlyImportError,
ge as MainFileEvaluationError,
pe as MainFileMissingError,
ne as MissingAngularJsonError,
ae as MissingBuilderError,
z as MissingFrameworkFieldError,
ue as NoMatchingExportError,
Ee as NoStatsForViteDevError,
X as NxProjectDetectedError,
be as UpgradeStorybookInWrongWorkingDirectory,
me as UpgradeStorybookToLowerVersionError,
he as UpgradeStorybookToSameVersionError,
ye as UpgradeStorybookUnknownCurrentVersionError,
re as WebpackCompilationError,
oe as WebpackInvocationError,
ee as WebpackMissingStatsError
$ as AngularLegacyBuildOptionsError,
de as Category,
L as ConflictingStaticDirConfigError,
v as CouldNotEvaluateFrameworkError,
D as CriticalPresetLoadError,
re as FindPackageVersionsError,
J as GenerateNewProjectOnInitError,
G as GoogleFontsDownloadError,
Y as GoogleFontsLoadingError,
K as InvalidFrameworkNameError,
B as InvalidStoriesEntryError,
H as MainFileESMOnlyImportError,
z as MainFileEvaluationError,
X as MainFileMissingError,
F as MissingAngularJsonError,
U as MissingBuilderError,
W as MissingFrameworkFieldError,
q as NoMatchingExportError,
te as NoStatsForViteDevError,
T as NxProjectDetectedError,
oe as UpgradeStorybookInWrongWorkingDirectory,
Q as UpgradeStorybookToLowerVersionError,
Z as UpgradeStorybookToSameVersionError,
ee as UpgradeStorybookUnknownCurrentVersionError,
j as WebpackCompilationError,
N as WebpackInvocationError,
P as WebpackMissingStatsError
};
{
"name": "@storybook/core",
"version": "0.0.0-pr-29223-sha-d3f5ad98",
"version": "0.0.0-pr-29230-sha-6c3a0bb1",
"description": "Storybook framework-agnostic API",

@@ -281,8 +281,6 @@ "keywords": [

"@storybook/csf": "^0.1.11",
"@types/express": "^4.17.21",
"better-opn": "^3.0.2",
"browser-assert": "^1.2.1",
"esbuild": "^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0",
"esbuild": "^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 || ^0.24.0",
"esbuild-register": "^3.5.0",
"express": "^4.19.2",
"jsdoc-type-pratt-parser": "^4.0.0",

@@ -311,2 +309,3 @@ "process": "^0.11.10",

"@ndelangen/get-tarball": "^3.0.7",
"@polka/compression": "^1.0.0-next.28",
"@popperjs/core": "^2.6.0",

@@ -321,3 +320,2 @@ "@radix-ui/react-dialog": "^1.0.5",

"@testing-library/react": "^14.0.0",
"@types/compression": "^1.7.0",
"@types/cross-spawn": "^6.0.2",

@@ -335,3 +333,2 @@ "@types/detect-port": "^1.3.0",

"@types/prompts": "^2.0.9",
"@types/qs": "^6",
"@types/react-syntax-highlighter": "11.0.5",

@@ -351,7 +348,5 @@ "@types/react-transition-group": "^4",

"chai": "^4.4.1",
"chalk": "^5.3.0",
"cli-table3": "^0.6.1",
"commander": "^12.1.0",
"comment-parser": "^1.4.1",
"compression": "^1.7.4",
"copy-to-clipboard": "^3.3.1",

@@ -372,6 +367,4 @@ "cross-spawn": "^7.0.3",

"execa": "^8.0.1",
"express": "^4.19.2",
"fd-package-json": "^1.2.0",
"fetch-retry": "^6.0.0",
"file-system-cache": "^2.4.4",
"find-cache-dir": "^5.0.0",

@@ -384,3 +377,2 @@ "find-up": "^7.0.0",

"globby": "^14.0.1",
"handlebars": "^4.7.7",
"jiti": "^1.21.6",

@@ -396,8 +388,10 @@ "js-yaml": "^4.1.0",

"open": "^8.4.0",
"picocolors": "^1.1.0",
"picomatch": "^2.3.0",
"picoquery": "^1.4.0",
"polished": "^4.2.2",
"polka": "^1.0.0-next.28",
"prettier": "^3.2.5",
"pretty-hrtime": "^1.0.3",
"prompts": "^2.4.0",
"qs": "^6.10.0",
"react": "^18.2.0",

@@ -415,2 +409,3 @@ "react-dom": "^18.2.0",

"resolve-from": "^5.0.0",
"sirv": "^2.0.4",
"slash": "^5.0.0",

@@ -417,0 +412,0 @@ "source-map": "^0.7.4",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc