repo
stringlengths
7
64
file_url
stringlengths
81
338
file_path
stringlengths
5
257
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:25:31
2026-01-05 01:50:38
truncated
bool
2 classes
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/StatusBadge.stories.tsx
code/core/src/component-testing/components/StatusBadge.stories.tsx
import { StatusBadge } from './StatusBadge'; export default { title: 'StatusBadge', component: StatusBadge, parameters: { layout: 'padded' }, }; export const Wait = { args: { status: 'rendering' }, }; export const Runs = { args: { status: 'playing' }, }; export const Pass = { args: { status: 'completed'...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/Toolbar.stories.tsx
code/core/src/component-testing/components/Toolbar.stories.tsx
import React from 'react'; import { action } from 'storybook/actions'; import { Toolbar } from './Toolbar'; export default { title: 'Toolbar', component: Toolbar, parameters: { layout: 'fullscreen', }, args: { controls: { start: action('start'), back: action('back'), goto: action(...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/MethodCall.stories.tsx
code/core/src/component-testing/components/MethodCall.stories.tsx
import React from 'react'; import { styled, typography } from 'storybook/theming'; import type { Call } from '../../instrumenter/types'; import { MethodCall, Node } from './MethodCall'; const StyledWrapper = styled.div(({ theme }) => ({ backgroundColor: theme.background.content, padding: '20px', boxShadow: `0 ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/StatusBadge.tsx
code/core/src/component-testing/components/StatusBadge.tsx
import React from 'react'; import { TooltipNote, WithTooltip } from 'storybook/internal/components'; import { type Color, styled, typography } from 'storybook/theming'; export type PlayStatus = 'rendering' | 'playing' | 'completed' | 'errored' | 'aborted'; export interface StatusBadgeProps { status: PlayStatus; }...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/Panel.test.ts
code/core/src/component-testing/components/Panel.test.ts
// @vitest-environment happy-dom import { describe, expect, it } from 'vitest'; import { type Call, CallStates, type LogItem } from '../../instrumenter/types'; import { INTERNAL_RENDER_CALL_ID } from '../constants'; import { type PanelState, getInteractions, getPanelState } from './Panel'; describe('Panel', () => { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/PanelTitle.tsx
code/core/src/component-testing/components/PanelTitle.tsx
import React from 'react'; import { Badge } from 'storybook/internal/components'; import { useAddonState, useStorybookApi } from 'storybook/manager-api'; import { CallStates } from '../../instrumenter/types'; import { ADDON_ID, PANEL_ID } from '../constants'; import type { PanelState } from './Panel'; import { Statu...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/InteractionsPanel.tsx
code/core/src/component-testing/components/InteractionsPanel.tsx
import * as React from 'react'; import { transparentize } from 'polished'; import type { API } from 'storybook/manager-api'; import { styled } from 'storybook/theming'; import { type Call, type CallStates, type ControlStates } from '../../instrumenter/types'; import { INTERNAL_RENDER_CALL_ID } from '../constants'; im...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/StatusIcon.stories.tsx
code/core/src/component-testing/components/StatusIcon.stories.tsx
import { CallStates } from '../../instrumenter/types'; import { StatusIcon } from './StatusIcon'; export default { title: 'StatusIcon', component: StatusIcon, }; export const Pending = { args: { status: CallStates.WAITING }, }; export const Active = { args: { status: CallStates.ACTIVE }, }; export const Err...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/StatusIcon.tsx
code/core/src/component-testing/components/StatusIcon.tsx
import React from 'react'; import { CheckIcon, CircleIcon, PlayIcon, StopAltIcon } from '@storybook/icons'; import { transparentize } from 'polished'; import { styled, useTheme } from 'storybook/theming'; import { type Call, CallStates } from '../../instrumenter/types'; export interface StatusIconProps { status: ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/TestDiscrepancyMessage.stories.tsx
code/core/src/component-testing/components/TestDiscrepancyMessage.stories.tsx
import React from 'react'; import type { Meta, StoryObj } from '@storybook/react-vite'; import { ManagerContext } from 'storybook/manager-api'; import { fn } from 'storybook/test'; import { CallStates } from '../../instrumenter/types'; import { TestDiscrepancyMessage } from './TestDiscrepancyMessage'; type Story = ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/Toolbar.tsx
code/core/src/component-testing/components/Toolbar.tsx
import type { ComponentProps } from 'react'; import React from 'react'; import { Button, P, Separator, Toolbar as SharedToolbar } from 'storybook/internal/components'; import { FastForwardIcon, PlayBackIcon, PlayNextIcon, RewindIcon, SyncIcon, } from '@storybook/icons'; import { type API } from 'storybook/...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/EmptyState.tsx
code/core/src/component-testing/components/EmptyState.tsx
import React, { useEffect, useState } from 'react'; import { EmptyTabContent, Link } from 'storybook/internal/components'; import { DocumentIcon } from '@storybook/icons'; import { useStorybookApi } from 'storybook/manager-api'; import { styled } from 'storybook/theming'; import { DOCUMENTATION_PLAY_FUNCTION_LINK }...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/MatcherResult.stories.tsx
code/core/src/component-testing/components/MatcherResult.stories.tsx
import React from 'react'; import { styled } from 'storybook/theming'; import { dedent } from 'ts-dedent'; import { MatcherResult } from './MatcherResult'; const StyledWrapper = styled.div(({ theme }) => ({ backgroundColor: theme.background.content, padding: '12px 0', boxShadow: `0 0 0 1px ${theme.appBorderCol...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/Interaction.stories.tsx
code/core/src/component-testing/components/Interaction.stories.tsx
import type { Meta, StoryObj } from '@storybook/react-vite'; import { expect, userEvent, within } from 'storybook/test'; import { CallStates } from '../../instrumenter/types'; import { getCalls } from '../mocks'; import { Interaction } from './Interaction'; import ToolbarStories from './Toolbar.stories'; type Story ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/test-fn.stories.tsx
code/core/src/component-testing/components/test-fn.stories.tsx
import React from 'react'; import type { StoryContext } from '@storybook/react-vite'; import { expect, fn } from 'storybook/test'; import preview from '../../../../.storybook/preview'; const Button = (args: React.ComponentProps<'button'>) => <button {...args} />; const meta = preview.meta({ component: Button, ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/MatcherResult.tsx
code/core/src/component-testing/components/MatcherResult.tsx
import React from 'react'; import { styled, typography } from 'storybook/theming'; import { useAnsiToHtmlFilter } from '../utils'; import { Node } from './MethodCall'; const getParams = (line: string, fromIndex = 0): string => { for (let i = fromIndex, depth = 1; i < line.length; i += 1) { if (line[i] === '(')...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/MethodCall.tsx
code/core/src/component-testing/components/MethodCall.tsx
import type { ReactElement } from 'react'; import React, { Fragment } from 'react'; import { logger } from 'storybook/internal/client-logger'; import { ObjectInspector } from '@devtools-ds/object-inspector'; import { useTheme } from 'storybook/theming'; import type { Call, CallRef, ElementRef } from '../../instrumen...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/component-testing/components/Interaction.tsx
code/core/src/component-testing/components/Interaction.tsx
import * as React from 'react'; import { Button } from 'storybook/internal/components'; import { ChevronDownIcon, ChevronUpIcon } from '@storybook/icons'; import { transparentize } from 'polished'; import { styled, typography } from 'storybook/theming'; import { type Call, CallStates, type ControlStates } from '../...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/router/utils.ts
code/core/src/router/utils.ts
import { once } from 'storybook/internal/client-logger'; import { isEqual as deepEqual, isPlainObject } from 'es-toolkit/predicate'; import memoize from 'memoizerific'; import type { Options as QueryOptions } from 'picoquery'; import { parse, stringify } from 'picoquery'; import { dedent } from 'ts-dedent'; export in...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/router/utils.test.ts
code/core/src/router/utils.test.ts
import { describe, expect, it, vi } from 'vitest'; import { DEEPLY_EQUAL, buildArgsParam, deepDiff, getMatch, parsePath } from './utils'; vi.mock('storybook/internal/client-logger', () => ({ once: { warn: vi.fn() }, })); describe('getMatch', () => { it('gets startsWithTarget match', () => { const output = ge...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/router/router.tsx
code/core/src/router/router.tsx
import React, { useCallback } from 'react'; import type { ComponentProps, ReactElement, ReactNode } from 'react'; import { global } from '@storybook/global'; import * as R from 'react-router-dom'; import type { LinkProps, NavigateOptions, RenderData } from './types'; import { getMatch, parsePath, queryFromLocation }...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/router/types.ts
code/core/src/router/types.ts
import type { ReactNode } from 'react'; import type * as R from 'react-router-dom'; import type { StoryData } from './utils'; export interface Other extends StoryData { path: string; singleStory?: boolean; } export type NavigateOptions = R.NavigateOptions & { plain?: boolean }; export type NavigateFunction = (...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/router/index.ts
code/core/src/router/index.ts
export * from './utils'; export * from './router'; export * from './types';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/eslintPlugin.test.ts
code/core/src/cli/eslintPlugin.test.ts
import { readFile, writeFile } from 'node:fs/promises'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import * as find from 'empathic/find'; import { dedent } from 'ts-dedent'; import type { PackageJsonWithDepsAndDevDeps } from '../common'; import type { JsPackageManager } from '../common/js-package...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/AddonVitestService.test.ts
code/core/src/cli/AddonVitestService.test.ts
import * as fs from 'node:fs/promises'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import type { JsPackageManager } from 'storybook/internal/common'; import { getProjectRoot } from 'storybook/internal/common'; import { logger, prompt } from 'storybook/internal/node-logger'; import * as find from ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/dirs.ts
code/core/src/cli/dirs.ts
import { join } from 'node:path'; import { Readable } from 'node:stream'; import { pipeline } from 'node:stream/promises'; import type { ReadableStream } from 'node:stream/web'; import { createGunzip } from 'node:zlib'; import { frameworkPackages, rendererPackages, temporaryDirectory, versions, } from 'storybo...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/NpmOptions.ts
code/core/src/cli/NpmOptions.ts
import type { JsPackageManager } from '../common/js-package-manager/JsPackageManager'; export type NpmOptions = Parameters<JsPackageManager['addDependencies']>[0];
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/eslintPlugin.ts
code/core/src/cli/eslintPlugin.ts
import { readFile, writeFile } from 'node:fs/promises'; import { type JsPackageManager, getProjectRoot } from 'storybook/internal/common'; import { readConfig, writeConfig } from 'storybook/internal/csf-tools'; import { logger, prompt } from 'storybook/internal/node-logger'; import commentJson from 'comment-json'; im...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/build.ts
code/core/src/cli/build.ts
import { cache } from 'storybook/internal/common'; import { buildStaticStandalone, withTelemetry } from 'storybook/internal/core-server'; export const build = async (cliOptions: any) => { const { default: packageJson } = await import('storybook/package.json', { with: { type: 'json' }, }); const options = { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/projectTypes.ts
code/core/src/cli/projectTypes.ts
export enum ProjectType { ANGULAR = 'angular', EMBER = 'ember', HTML = 'html', NEXTJS = 'nextjs', NUXT = 'nuxt', NX = 'nx', PREACT = 'preact', QWIK = 'qwik', REACT = 'react', REACT_NATIVE = 'react_native', REACT_NATIVE_AND_RNW = 'react_native_and_rnw', REACT_NATIVE_WEB = 'react_native_web', RE...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/dev.ts
code/core/src/cli/dev.ts
import { cache } from 'storybook/internal/common'; import { buildDevStandalone, withTelemetry } from 'storybook/internal/core-server'; import { logger, instance as npmLog } from 'storybook/internal/node-logger'; import type { CLIOptions, PackageJson } from 'storybook/internal/types'; import { dedent } from 'ts-dedent'...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/globalSettings.ts
code/core/src/cli/globalSettings.ts
import fs from 'node:fs/promises'; import { homedir } from 'node:os'; import { dirname, join } from 'node:path'; import { dedent } from 'ts-dedent'; import { z } from 'zod'; import { invariant } from '../common/utils/utils'; const DEFAULT_SETTINGS_PATH = join(homedir(), '.storybook', 'settings.json'); const VERSION...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/AddonVitestService.ts
code/core/src/cli/AddonVitestService.ts
import fs from 'node:fs/promises'; import * as babel from 'storybook/internal/babel'; import type { JsPackageManager } from 'storybook/internal/common'; import { getProjectRoot } from 'storybook/internal/common'; import { CLI_COLORS } from 'storybook/internal/node-logger'; import { logger, prompt } from 'storybook/int...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/detect.ts
code/core/src/cli/detect.ts
import * as find from 'empathic/find'; // TODO: Remove in SB11 export async function detectPnp() { return !!find.any(['.pnp.js', '.pnp.cjs']); }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/globalSettings.test.ts
code/core/src/cli/globalSettings.test.ts
import fs from 'node:fs/promises'; import { dirname } from 'node:path'; import { afterEach } from 'node:test'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { type Settings, _clearGlobalSettings, globalSettings } from './globalSettings'; vi.mock('node:fs'); vi.mock('node:fs/promises'); const...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/AddonVitestService.constants.ts
code/core/src/cli/AddonVitestService.constants.ts
import { SupportedFramework } from '../types'; export const SUPPORTED_FRAMEWORKS: readonly SupportedFramework[] = [ SupportedFramework.HTML_VITE, SupportedFramework.NEXTJS_VITE, SupportedFramework.PREACT_VITE, SupportedFramework.REACT_NATIVE_WEB_VITE, SupportedFramework.REACT_VITE, SupportedFramework.SOLID...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/helpers.ts
code/core/src/cli/helpers.ts
import { cpSync, existsSync, readFileSync, writeFileSync } from 'node:fs'; import { cp, readFile, writeFile } from 'node:fs/promises'; import { join, resolve } from 'node:path'; import { type JsPackageManager, type PackageJson, frameworkToRenderer, } from 'storybook/internal/common'; import { logger } from 'stor...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/index.ts
code/core/src/cli/index.ts
export * from './detect'; export * from './helpers'; export * from './angular/helpers'; export * from './dirs'; export * from './projectTypes'; export * from './NpmOptions'; export * from './eslintPlugin'; export * from './globalSettings'; export * from './AddonVitestService';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/buildIndex.ts
code/core/src/cli/buildIndex.ts
import { cache } from 'storybook/internal/common'; import { buildIndexStandalone, withTelemetry } from 'storybook/internal/core-server'; import type { BuilderOptions, CLIBaseOptions } from 'storybook/internal/types'; export interface CLIIndexOptions extends CLIBaseOptions { configDir?: string; outputFile?: string;...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/helpers.test.ts
code/core/src/cli/helpers.test.ts
import fs from 'node:fs'; import fsp from 'node:fs/promises'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import type { JsPackageManager } from 'storybook/internal/common'; import { Feature, SupportedLanguage, SupportedRenderer } from 'storybook/internal/types'; import { sep } from 'path'; import...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/cli/angular/helpers.ts
code/core/src/cli/angular/helpers.ts
import { existsSync, readFileSync, writeFileSync } from 'node:fs'; import { join } from 'node:path'; import { prompt } from 'storybook/internal/node-logger'; import { MissingAngularJsonError } from 'storybook/internal/server-errors'; export const ANGULAR_JSON_PATH = 'angular.json'; export class AngularJSON { json:...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/core-events/index.test.ts
code/core/src/core-events/index.test.ts
import { describe, expect, it } from 'vitest'; import * as EventsPackageExport from './index'; import EventsDefaultExport, { CHANNEL_CREATED } from './index'; describe('Core Events', () => { it('Should export the module as a namespace', () => { expect(EventsPackageExport.CHANNEL_CREATED).toBe('channelCreated');...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/core-events/index.ts
code/core/src/core-events/index.ts
enum events { CHANNEL_WS_DISCONNECT = 'channelWSDisconnect', CHANNEL_CREATED = 'channelCreated', // There was an error executing the config, likely an bug in the user's preview.js CONFIG_ERROR = 'configError', // The (v7 store) story index has changed, needs to refetch STORY_INDEX_INVALIDATED = 'storyIndexI...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/core-events/data/save-story.ts
code/core/src/core-events/data/save-story.ts
export interface SaveStoryRequestPayload { args: string | undefined; csfId: string; importPath: string; name?: string; } export interface SaveStoryResponsePayload { csfId: string; newStoryId?: string; newStoryName?: string; newStoryExportName?: string; sourceFileContent?: string; sourceFileName?: s...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/core-events/data/create-new-story.ts
code/core/src/core-events/data/create-new-story.ts
export interface CreateNewStoryRequestPayload { // The filepath of the component for which the Story should be generated for (relative to the project root) componentFilePath: string; // The name of the exported component componentExportName: string; // is default export componentIsDefaultExport: boolean; ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/core-events/data/whats-new.ts
code/core/src/core-events/data/whats-new.ts
export interface WhatsNewCache { lastDismissedPost?: string; lastReadPost?: string; } export type WhatsNewData = | { status: 'SUCCESS'; title: string; url: string; blogUrl?: string; publishedAt: string; excerpt: string; postIsRead: boolean; showNotification: boolea...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/core-events/data/argtypes-info.ts
code/core/src/core-events/data/argtypes-info.ts
import type { ArgTypes } from '../../csf'; export interface ArgTypesRequestPayload { storyId: string; } export interface ArgTypesResponsePayload { argTypes: ArgTypes; }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/core-events/data/file-component-search.ts
code/core/src/core-events/data/file-component-search.ts
export interface FileComponentSearchRequestPayload {} export interface FileComponentSearchResponsePayload { files: Array<{ // The filepath relative to the project root filepath: string; // Whether a corresponding story file exists storyFileExists: boolean; // A list of exported components exp...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/core-events/data/phases.ts
code/core/src/core-events/data/phases.ts
import type { Report } from 'storybook/preview-api'; export interface StoryFinishedPayload { storyId: string; status: 'error' | 'success'; reporters: Report[]; }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/core-events/data/open-in-editor.ts
code/core/src/core-events/data/open-in-editor.ts
export type OpenInEditorRequestPayload = { file: string; line?: number; column?: number }; export type OpenInEditorResponsePayload = { file: string; line?: number; column?: number; error: string | null; };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/core-events/data/request-response.ts
code/core/src/core-events/data/request-response.ts
export type RequestData<Payload = void> = { id: string; payload: Payload; }; export type ResponseData<Payload = void, ErrorPayload extends Record<string, any> | void = void> = | { id: string; success: true; error: null; payload: Payload } | { id: string; success: false; error: string; payload?: ErrorPayload };...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/__tests/storybook-error.test.ts
code/core/src/__tests/storybook-error.test.ts
import { describe, expect, it } from 'vitest'; import { StorybookError, appendErrorRef } from '../storybook-error'; describe('StorybookError', () => { class TestError extends StorybookError { constructor(documentation?: StorybookError['documentation']) { super({ name: 'TestError', category...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/__tests/preview-errors.test.ts
code/core/src/__tests/preview-errors.test.ts
import { describe, expect, it } from 'vitest'; import { UnknownArgTypesError } from '../preview-errors'; describe('UnknownFlowArgTypesError', () => { it('should correctly handle error with convertSig', () => { const type = { name: 'signature', raw: "SomeType['someProperty']", }; const typeE...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/__tests/server-errors.test.ts
code/core/src/__tests/server-errors.test.ts
import { describe, expect, it } from 'vitest'; import { WebpackCompilationError } from '../server-errors'; describe('WebpackCompilationError', () => { it('should correctly handle error with stats.compilation.errors', () => { const errors = [ new Error('Error 1 \u001B[4mmessage\u001B[0m'), new Error(...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/addons.ts
code/core/src/preview-api/addons.ts
/// <reference path="../typings.d.ts" /> export * from './modules/addons';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/store.ts
code/core/src/preview-api/store.ts
/// <reference path="../typings.d.ts" /> export * from './modules/store';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/index.ts
code/core/src/preview-api/index.ts
/// <reference path="../typings.d.ts" /> /** HOOKS API */ export { useArgs, useCallback, useChannel, useEffect, useGlobals, useMemo, useParameter, useReducer, useRef, useState, useStoryContext, applyHooks, HooksContext, } from './addons'; /** DECORATORS API */ export { makeDecorator } from '...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/Errors.stories.tsx
code/core/src/preview-api/Errors.stories.tsx
import React from 'react'; import AnsiToHtml from 'ansi-to-html'; import { dedent } from 'ts-dedent'; const ansiConverter = new AnsiToHtml({ escapeXML: true, }); const Component = ({ id, header, detail }: any) => { const element = document.querySelector('.' + id); if (!element) { throw new Error('Element n...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/preview-web.ts
code/core/src/preview-api/preview-web.ts
/// <reference path="../typings.d.ts" /> export * from './modules/preview-web';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/emitTransformCode.ts
code/core/src/preview-api/modules/preview-web/emitTransformCode.ts
import type { Args, StoryContext } from 'storybook/internal/csf'; import { SNIPPET_RENDERED } from '../../../docs-tools'; import { addons } from '../addons'; type ReducedStoryContext = Omit< StoryContext<any, Args>, 'abortSignal' | 'canvasElement' | 'step' | 'context' >; type Transformer = | ((code: string, st...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/Preview.tsx
code/core/src/preview-api/modules/preview-web/Preview.tsx
import type { Channel } from 'storybook/internal/channels'; import { deprecate, logger } from 'storybook/internal/client-logger'; import { ARGTYPES_INFO_REQUEST, ARGTYPES_INFO_RESPONSE, type ArgTypesRequestPayload, type ArgTypesResponsePayload, CONFIG_ERROR, FORCE_REMOUNT, FORCE_RE_RENDER, GLOBALS_UPDAT...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/parseArgsParam.ts
code/core/src/preview-api/modules/preview-web/parseArgsParam.ts
import { once } from 'storybook/internal/client-logger'; import type { Args } from 'storybook/internal/types'; import { isPlainObject } from 'es-toolkit/predicate'; import { type Options, parse } from 'picoquery'; import { dedent } from 'ts-dedent'; // Keep this in sync with validateArgs in router/src/utils.ts const ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/UrlStore.ts
code/core/src/preview-api/modules/preview-web/UrlStore.ts
import type { ViewMode } from 'storybook/internal/types'; import { global } from '@storybook/global'; import { parse, stringify } from 'picoquery'; import type { Selection, SelectionSpecifier, SelectionStore } from './SelectionStore'; import { parseArgsParam } from './parseArgsParam'; const { history, document } = ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/simulate-pageload.ts
code/core/src/preview-api/modules/preview-web/simulate-pageload.ts
import { global } from '@storybook/global'; const { document } = global; // https://html.spec.whatwg.org/multipage/scripting.html const runScriptTypes = [ 'application/javascript', 'application/ecmascript', 'application/x-ecmascript', 'application/x-javascript', 'text/ecmascript', 'text/javascript', 'te...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/SelectionStore.ts
code/core/src/preview-api/modules/preview-web/SelectionStore.ts
import type { Args, StoryId, ViewMode } from 'storybook/internal/types'; import type { StorySpecifier } from '../store/StoryIndexStore'; export interface SelectionSpecifier { storySpecifier: StorySpecifier; viewMode: ViewMode; args?: Args; globals?: Args; } export interface Selection { storyId: StoryId; ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/PreviewWeb.tsx
code/core/src/preview-api/modules/preview-web/PreviewWeb.tsx
import type { ModuleImportFn, ProjectAnnotations } from 'storybook/internal/types'; import type { Renderer } from 'storybook/internal/types'; import { global } from '@storybook/global'; import type { MaybePromise } from './Preview'; import { PreviewWithSelection } from './PreviewWithSelection'; import { UrlStore } fr...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/PreviewWeb.integration.test.ts
code/core/src/preview-api/modules/preview-web/PreviewWeb.integration.test.ts
// @vitest-environment happy-dom import { beforeEach, describe, expect, it, vi } from 'vitest'; import React from 'react'; import type { RenderContext } from 'storybook/internal/types'; import { global } from '@storybook/global'; import { addons } from '../addons'; import { PreviewWeb } from './PreviewWeb'; import ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/View.ts
code/core/src/preview-api/modules/preview-web/View.ts
import type { PreparedStory } from 'storybook/internal/types'; export interface View<TStorybookRoot> { // Get ready to render a story, returning the element to render to prepareForStory(story: PreparedStory<any>): TStorybookRoot; prepareForDocs(): TStorybookRoot; showErrorDisplay(err: { message?: string; sta...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/parseArgsParam.test.ts
code/core/src/preview-api/modules/preview-web/parseArgsParam.test.ts
import { describe, expect, it, vi } from 'vitest'; import { parseArgsParam } from './parseArgsParam'; vi.mock('storybook/internal/client-logger', () => ({ once: { warn: vi.fn() }, })); describe('parseArgsParam', () => { it('parses a simple key-value pair', () => { const args = parseArgsParam('key:val'); ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/PreviewWeb.test.ts
code/core/src/preview-api/modules/preview-web/PreviewWeb.test.ts
// @vitest-environment happy-dom import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { logger } from 'storybook/internal/client-logger'; import { CONFIG_ERROR, CURRENT_STORY_WAS_SET, DOCS_PREPARED, DOCS_RENDERED, FORCE_REMOUNT, FORCE_RE_RENDER, GLOBALS_UPDATED, PLAY_FUNCTIO...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
true
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/WebView.ts
code/core/src/preview-api/modules/preview-web/WebView.ts
import { logger } from 'storybook/internal/client-logger'; import type { PreparedStory } from 'storybook/internal/types'; import { global } from '@storybook/global'; import AnsiToHtml from 'ansi-to-html'; import { parse } from 'picoquery'; import { dedent } from 'ts-dedent'; import type { View } from './View'; cons...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/UrlStore.test.ts
code/core/src/preview-api/modules/preview-web/UrlStore.test.ts
import { describe, expect, it, vi } from 'vitest'; import { global } from '@storybook/global'; import { getSelectionSpecifierFromPath, pathToId, setPath } from './UrlStore'; const { history, document } = global; vi.mock('@storybook/global', () => ({ global: { history: { replaceState: vi.fn() }, document: ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/simulate-pageload.test.ts
code/core/src/preview-api/modules/preview-web/simulate-pageload.test.ts
// @vitest-environment happy-dom import { describe, expect, it } from 'vitest'; import { global } from '@storybook/global'; import { simulatePageLoad } from './simulate-pageload'; const { document } = global; describe('simulatePageLoad', () => { it('should add script with type module to scripts root', () => { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/index.ts
code/core/src/preview-api/modules/preview-web/index.ts
// FIXME: breaks builder-vite, remove this in 7.0 export { composeConfigs } from '../../store'; export type { ProjectAnnotations as WebProjectAnnotations } from 'storybook/internal/types'; export { Preview } from './Preview'; export { PreviewWeb } from './PreviewWeb'; export { PreviewWithSelection } from './PreviewWit...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/PreviewWeb.mockdata.ts
code/core/src/preview-api/modules/preview-web/PreviewWeb.mockdata.ts
import type { Mock, Mocked } from 'vitest'; import { vi } from 'vitest'; import { DOCS_RENDERED, STORY_ERRORED, STORY_FINISHED, STORY_MISSING, STORY_RENDER_PHASE_CHANGED, STORY_THREW_EXCEPTION, } from 'storybook/internal/core-events'; import type { ModuleImportFn, ProjectAnnotations, Renderer, Stor...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/PreviewWithSelection.tsx
code/core/src/preview-api/modules/preview-web/PreviewWithSelection.tsx
import { logger } from 'storybook/internal/client-logger'; import { CURRENT_STORY_WAS_SET, DOCS_PREPARED, GLOBALS_UPDATED, PRELOAD_ENTRIES, PREVIEW_KEYDOWN, SET_CURRENT_STORY, STORY_CHANGED, STORY_ERRORED, STORY_MISSING, STORY_PREPARED, STORY_RENDER_PHASE_CHANGED, STORY_SPECIFIED, STORY_THREW_...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/docs-context/DocsContext.ts
code/core/src/preview-api/modules/preview-web/docs-context/DocsContext.ts
import type { Channel } from 'storybook/internal/channels'; import { isStory } from 'storybook/internal/csf'; import type { CSFFile, ModuleExport, ModuleExports, PreparedStory, Renderer, ResolvedModuleExportFromType, ResolvedModuleExportType, StoryId, StoryName, } from 'storybook/internal/types'; imp...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/docs-context/DocsContextProps.ts
code/core/src/preview-api/modules/preview-web/docs-context/DocsContextProps.ts
export type { DocsContextProps } from 'storybook/internal/types';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/docs-context/test-utils.ts
code/core/src/preview-api/modules/preview-web/docs-context/test-utils.ts
import type { CSFFile, PreparedStory } from 'storybook/internal/types'; export function csfFileParts(storyId = 'meta--story', metaId = 'meta') { // These compose the raw exports of the CSF file const component = {}; const metaExport = { component }; const storyExport = {}; const moduleExports = { default: me...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/docs-context/DocsContext.test.ts
code/core/src/preview-api/modules/preview-web/docs-context/DocsContext.test.ts
import { describe, expect, it, vi } from 'vitest'; import { Channel } from 'storybook/internal/channels'; import type { CSFFile, Renderer } from 'storybook/internal/types'; import type { StoryStore } from '../../store'; import { DocsContext } from './DocsContext'; import { csfFileParts } from './test-utils'; const c...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/docs-context/DocsRenderFunction.ts
code/core/src/preview-api/modules/preview-web/docs-context/DocsRenderFunction.ts
export type { DocsRenderFunction } from 'storybook/internal/types';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/render/CsfDocsRender.ts
code/core/src/preview-api/modules/preview-web/render/CsfDocsRender.ts
import type { Channel } from 'storybook/internal/channels'; import { DOCS_RENDERED } from 'storybook/internal/core-events'; import type { Renderer, StoryId } from 'storybook/internal/types'; import type { CSFFile, PreparedStory } from 'storybook/internal/types'; import type { IndexEntry } from 'storybook/internal/types...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/render/MdxDocsRender.test.ts
code/core/src/preview-api/modules/preview-web/render/MdxDocsRender.test.ts
import { describe, expect, it, vi } from 'vitest'; import { Channel } from 'storybook/internal/channels'; import type { DocsIndexEntry, RenderContextCallbacks, Renderer } from 'storybook/internal/types'; import type { StoryStore } from '../../store'; import { csfFileParts } from '../docs-context/test-utils'; import {...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/render/mount-utils.ts
code/core/src/preview-api/modules/preview-web/render/mount-utils.ts
// Inspired by Vitest fixture implementation: // https://github.com/vitest-dev/vitest/blob/200a4349a2f85686bc7005dce686d9d1b48b84d2/packages/runner/src/fixture.ts export function mountDestructured(playFunction?: (...args: any[]) => any): boolean { return playFunction != null && getUsedProps(playFunction).includes('mo...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/render/Render.ts
code/core/src/preview-api/modules/preview-web/render/Render.ts
import type { Renderer, StoryId } from 'storybook/internal/types'; import type { StoryRenderOptions } from 'storybook/internal/types'; export type RenderType = 'story' | 'docs'; /** * A "Render" represents the rendering of a single entry to a single location * * The implementations of render are used for two key p...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/render/CsfDocsRender.test.ts
code/core/src/preview-api/modules/preview-web/render/CsfDocsRender.test.ts
import { expect, it, vi } from 'vitest'; import { Channel } from 'storybook/internal/channels'; import type { DocsIndexEntry, RenderContextCallbacks, Renderer } from 'storybook/internal/types'; import type { StoryStore } from '../../store'; import { csfFileParts } from '../docs-context/test-utils'; import { CsfDocsRe...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/render/animation-utils.ts
code/core/src/preview-api/modules/preview-web/render/animation-utils.ts
import type { CleanupCallback } from 'storybook/internal/csf'; const ANIMATION_TIMEOUT = 5000; export function isTestEnvironment() { try { return ( // @ts-expect-error This property exists in Vitest browser mode !!globalThis.__vitest_browser__ || !!globalThis.window?.navigator?.userAgent?.matc...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/render/StoryRender.ts
code/core/src/preview-api/modules/preview-web/render/StoryRender.ts
import type { Channel } from 'storybook/internal/channels'; import { PLAY_FUNCTION_THREW_EXCEPTION, STORY_FINISHED, STORY_RENDERED, STORY_RENDER_PHASE_CHANGED, type StoryFinishedPayload, UNHANDLED_ERRORS_WHILE_PLAYING, } from 'storybook/internal/core-events'; import { MountMustBeDestructuredError, NoSto...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/render/MdxDocsRender.ts
code/core/src/preview-api/modules/preview-web/render/MdxDocsRender.ts
import type { Channel } from 'storybook/internal/channels'; import { DOCS_RENDERED } from 'storybook/internal/core-events'; import type { Renderer, StoryId } from 'storybook/internal/types'; import type { CSFFile, ModuleExports } from 'storybook/internal/types'; import type { IndexEntry } from 'storybook/internal/types...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/render/mount-utils.test.ts
code/core/src/preview-api/modules/preview-web/render/mount-utils.test.ts
import { expect, test } from 'vitest'; import { getUsedProps } from './mount-utils'; const StoryWithContext = { play: async (context: any) => { console.log(context); }, }; const StoryWitCanvasElement = { play: async ({ canvasElement }: any) => { console.log(canvasElement); }, }; const MountStory = {...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/preview-web/render/StoryRender.test.ts
code/core/src/preview-api/modules/preview-web/render/StoryRender.test.ts
// @vitest-environment happy-dom import { beforeEach, describe, expect, it, vi } from 'vitest'; import { Channel } from 'storybook/internal/channels'; import { STORY_FINISHED } from 'storybook/internal/core-events'; import type { PreparedStory, Renderer, StoryContext, StoryIndexEntry, } from 'storybook/interna...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/store/GlobalsStore.test.ts
code/core/src/preview-api/modules/store/GlobalsStore.test.ts
import { describe, expect, it, vi } from 'vitest'; import { GlobalsStore } from './GlobalsStore'; vi.mock('storybook/internal/client-logger', () => ({ logger: { warn: vi.fn(), }, })); describe('GlobalsStore', () => { it('is initialized to the value in globals', () => { const store = new GlobalsStore({ ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/store/ArgsStore.test.ts
code/core/src/preview-api/modules/store/ArgsStore.test.ts
import { describe, expect, it, vi } from 'vitest'; import { ArgsStore } from './ArgsStore'; vi.mock('storybook/internal/client-logger'); const stringType = { type: { name: 'string' } }; const booleanType = { type: { name: 'boolean' } }; describe('ArgsStore', () => { describe('setInitial / get', () => { it('re...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/store/storySort.test.ts
code/core/src/preview-api/modules/store/storySort.test.ts
import { describe, expect, it } from 'vitest'; import type { StoryId, StoryIndexEntry } from 'storybook/internal/types'; import { storySort } from './storySort'; describe('preview.storySort', () => { const fixture: Record<StoryId, StoryIndexEntry> = Object.fromEntries( Object.entries({ a: { title: 'a' },...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/store/autoTitle.ts
code/core/src/preview-api/modules/store/autoTitle.ts
import { once } from 'storybook/internal/client-logger'; import type { NormalizedStoriesSpecifier } from 'storybook/internal/types'; // eslint-disable-next-line depend/ban-dependencies import slash from 'slash'; import { dedent } from 'ts-dedent'; // FIXME: types duplicated type from `core-common', to be // removed w...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/store/StoryIndexStore.test.ts
code/core/src/preview-api/modules/store/StoryIndexStore.test.ts
import { describe, expect, it, vi } from 'vitest'; import type { StoryIndex } from 'storybook/internal/types'; import { StoryIndexStore } from './StoryIndexStore'; vi.mock('@storybook/channel-websocket', () => () => ({ on: vi.fn() })); const storyIndex: StoryIndex = { v: 5, entries: { 'component-one--a': { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/store/ArgsStore.ts
code/core/src/preview-api/modules/store/ArgsStore.ts
import type { PreparedStory } from 'storybook/internal/types'; import type { Args, StoryId } from 'storybook/internal/types'; import { DEEPLY_EQUAL, combineArgs, deepDiff, mapArgsToTypes, validateOptions } from './args'; function deleteUndefined(obj: Record<string, any>) { Object.keys(obj).forEach((key) => obj[key]...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/store/args.test.ts
code/core/src/preview-api/modules/store/args.test.ts
import { describe, expect, it, vi } from 'vitest'; import { once } from 'storybook/internal/client-logger'; import type { SBType } from 'storybook/internal/types'; import { UNTARGETED, combineArgs, groupArgsByTarget, mapArgsToTypes, validateOptions, } from './args'; const stringType: SBType = { name: 'stri...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/store/StoryStore.ts
code/core/src/preview-api/modules/store/StoryStore.ts
import type { CleanupCallback } from 'storybook/internal/csf'; import { getCoreAnnotations } from 'storybook/internal/csf'; import { CalledExtractOnStoreError, MissingStoryFromCsfFileError, } from 'storybook/internal/preview-errors'; import type { CSFFile, IndexEntry, ModuleExports, ModuleImportFn, Normal...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/preview-api/modules/store/StoryIndexStore.ts
code/core/src/preview-api/modules/store/StoryIndexStore.ts
import { MissingStoryAfterHmrError } from 'storybook/internal/preview-errors'; import type { ComponentTitle, Path, StoryId, StoryName } from 'storybook/internal/types'; import type { IndexEntry, StoryIndex } from 'storybook/internal/types'; import memoize from 'memoizerific'; export type StorySpecifier = StoryId | { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false