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/scripts/__mocks__/simple-git.ts | scripts/__mocks__/simple-git.ts | import { vi } from 'vitest';
export const __getRemotes = vi
.fn()
.mockReturnValue([{ name: 'origin', refs: { fetch: 'origin', push: 'origin' } }]);
export const __fetch = vi.fn();
export const __revparse = vi.fn().mockResolvedValue('mockedGitCommitHash');
export const simpleGit = () => {
return {
getRemote... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/vitest.config.ts | code/vitest.config.ts | import { coverageConfigDefaults, defineConfig } from 'vitest/config';
/**
* CircleCI reports the wrong number of threads to Node.js, so we need to set it manually. Unit
* tests are running with the xlarge resource class, which has 8 vCPUs.
*
* @see https://jahed.dev/2022/11/20/fixing-node-js-multi-threading-on-cir... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/playwright.config.ts | code/playwright.config.ts | import { defineConfig, devices } from '@playwright/test';
/** Read environment variables from file. https://github.com/motdotla/dotenv */
// require('dotenv').config();
// Comment this out and fill in the values to run E2E tests locally using the Playwright extension easily
// process.env.STORYBOOK_URL = 'http://loca... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/vitest.config.storybook.ts | code/vitest.config.storybook.ts | import { defaultExclude, defineProject } from 'vitest/config';
import { storybookTest } from '@storybook/addon-vitest/vitest-plugin';
import { playwright } from '@vitest/browser-playwright';
import Inspect from 'vite-plugin-inspect';
const extraPlugins: any[] = [];
if (process.env.INSPECT === 'true') {
// this plu... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/vitest.helpers.ts | code/vitest.helpers.ts | import { platform } from 'node:os';
const WINDOWS_PLATFORM = 'win32';
// Implement these whenever needed...
// const MACOS_PLATFORM = 'darwin';
// const LINUX_PLATFORM = 'linux';
let currentPlatform: NodeJS.Platform;
const getPlatform = () => {
if (!currentPlatform) {
currentPlatform = platform();
}
retur... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/vitest-setup.ts | code/vitest-setup.ts | import '@testing-library/jest-dom/vitest';
import { expect, vi } from 'vitest';
import { dedent } from 'ts-dedent';
const ignoreList = [
(error: any) => error.message.includes('":nth-child" is potentially unsafe'),
(error: any) => error.message.includes('":first-child" is potentially unsafe'),
(error: any) =>
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/vitest.shared.ts | code/vitest.shared.ts | import { resolve } from 'node:path';
import { defineConfig } from 'vitest/config';
export const vitestCommonConfig = defineConfig({
test: {
passWithNoTests: true,
clearMocks: true,
setupFiles: [resolve(__dirname, './vitest-setup.ts')],
// Disable globals due to https://github.com/testing-library/use... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/.storybook/isChromatic.ts | code/.storybook/isChromatic.ts | export function isChromatic(windowArg?: any) {
const windowToCheck = windowArg || (typeof window !== 'undefined' && window);
return !!(
windowToCheck &&
(windowToCheck.navigator.userAgent.match(/Chromatic/) ||
windowToCheck.location.href.match(/chromatic=true/))
);
}
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/.storybook/storybook.setup.ts | code/.storybook/storybook.setup.ts | import { vi, expect as vitestExpect } from 'vitest';
import { setProjectAnnotations } from '@storybook/react';
import { userEvent as storybookEvent, expect as storybookExpect } from 'storybook/test';
import preview from './preview';
vi.spyOn(console, 'warn').mockImplementation((...args) => console.log(...args));
s... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/.storybook/preview.tsx | code/.storybook/preview.tsx | import React, { type FC, Fragment, useEffect } from 'react';
import type { Channel } from 'storybook/internal/channels';
import { global } from '@storybook/global';
import type { Decorator, Loader, ReactRenderer } from '@storybook/react-vite';
import { definePreview } from '@storybook/react-vite';
import addonA11y ... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/.storybook/manager.tsx | code/.storybook/manager.tsx | import { startCase } from 'es-toolkit/string';
import { addons } from 'storybook/manager-api';
addons.setConfig({
sidebar: {
renderLabel: ({ name, type }) => (type === 'story' ? name : startCase(name)),
},
});
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/.storybook/main.ts | code/.storybook/main.ts | import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineMain } from '@storybook/react-vite/node';
import react from '@vitejs/plugin-react';
import { BROWSER_TARGETS } from '../core/src/shared/constants/environments-support.ts';
const currentFilePath = fileURLToPath(import... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/.storybook/bench/bench.stories.tsx | code/.storybook/bench/bench.stories.tsx | import React from 'react';
import type { Meta } from '@storybook/react-vite';
import { safeMetafileArg } from '../../../scripts/bench/safe-args';
// @ts-expect-error - TS doesn't know about import.meta.glob from Vite
const allMetafiles = import.meta.glob('../../bench/esbuild-metafiles/**/*.json', {
import: 'defaul... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/.storybook/utils/todo.tsx | code/.storybook/utils/todo.tsx | export function getTodos() {
return ['some todo'];
}
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/vitest.config.ts | code/renderers/html/vitest.config.ts | import { defineConfig, mergeConfig } from 'vitest/config';
import { vitestCommonConfig } from '../../vitest.shared';
export default mergeConfig(
vitestCommonConfig,
defineConfig({
// Add custom config here
})
);
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/build-config.ts | code/renderers/html/build-config.ts | import type { BuildEntries } from '../../../scripts/build/utils/entry-utils';
const config: BuildEntries = {
entries: {
browser: [
{
exportEntries: ['.'],
entryPoint: './src/index.ts',
},
{
exportEntries: ['./entry-preview'],
entryPoint: './src/entry-preview.ts',... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/src/public-types.ts | code/renderers/html/src/public-types.ts | import type {
AnnotatedStoryFn,
Args,
ComponentAnnotations,
DecoratorFunction,
StoryContext as GenericStoryContext,
LoaderFunction,
ProjectAnnotations,
StoryAnnotations,
StrictArgs,
} from 'storybook/internal/types';
import type { HtmlRenderer } from './types';
export type { Args, ArgTypes, Paramete... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/src/render.ts | code/renderers/html/src/render.ts | import type { ArgsStoryFn, RenderContext } from 'storybook/internal/types';
import { global } from '@storybook/global';
import { simulateDOMContentLoaded, simulatePageLoad } from 'storybook/preview-api';
import { dedent } from 'ts-dedent';
import type { HtmlRenderer } from './types';
const { Node } = global;
expor... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/src/entry-preview.ts | code/renderers/html/src/entry-preview.ts | import { enhanceArgTypes } from 'storybook/internal/docs-tools';
import type { ArgTypesEnhancer } from 'storybook/internal/types';
import type { Parameters } from './types';
export const parameters: Parameters = { renderer: 'html' };
export { renderToCanvas, render } from './render';
export const argTypesEnhancers:... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/src/typings.d.ts | code/renderers/html/src/typings.d.ts | declare var STORYBOOK_ENV: 'HTML';
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/src/entry-preview-docs.ts | code/renderers/html/src/entry-preview-docs.ts | import { SourceType } from 'storybook/internal/docs-tools';
import type { DecoratorFunction } from 'storybook/internal/types';
import { sourceDecorator } from './docs/sourceDecorator';
import type { HtmlRenderer } from './types';
export const decorators: DecoratorFunction<HtmlRenderer>[] = [sourceDecorator];
export ... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/src/preset.ts | code/renderers/html/src/preset.ts | import { fileURLToPath } from 'node:url';
import type { PresetProperty } from 'storybook/internal/types';
export const previewAnnotations: PresetProperty<'previewAnnotations'> = async (
input = [],
options
) => {
const docsEnabled = Object.keys(await options.presets.apply('docs', {}, options)).length > 0;
con... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/src/types.ts | code/renderers/html/src/types.ts | import type { SourceType } from 'storybook/internal/docs-tools';
import type {
ArgsStoryFn,
StoryContext as DefaultStoryContext,
WebRenderer,
} from 'storybook/internal/types';
export type { RenderContext } from 'storybook/internal/types';
export type StoryFnHtmlReturnType = string | Node;
export interface Sho... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/src/portable-stories.ts | code/renderers/html/src/portable-stories.ts | import type {
NamedOrDefaultProjectAnnotations,
NormalizedProjectAnnotations,
} from 'storybook/internal/types';
import {
setProjectAnnotations as originalSetProjectAnnotations,
setDefaultProjectAnnotations,
} from 'storybook/preview-api';
import * as INTERNAL_DEFAULT_PROJECT_ANNOTATIONS from './entry-preview... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/src/index.ts | code/renderers/html/src/index.ts | import './globals';
export * from './public-types';
export * from './portable-stories';
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/src/globals.ts | code/renderers/html/src/globals.ts | import { global } from '@storybook/global';
const { window: globalWindow } = global;
globalWindow.STORYBOOK_ENV = 'HTML';
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/src/docs/sourceDecorator.test.ts | code/renderers/html/src/docs/sourceDecorator.test.ts | /** @vitest-environment happy-dom */
import { beforeEach, describe, expect, it, vi } from 'vitest';
import { SNIPPET_RENDERED, SourceType } from 'storybook/internal/docs-tools';
import { addons, emitTransformCode, useEffect, useRef, useState } from 'storybook/preview-api';
import { sourceDecorator } from './sourceDe... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/src/docs/sourceDecorator.ts | code/renderers/html/src/docs/sourceDecorator.ts | import { SourceType } from 'storybook/internal/docs-tools';
import type { DecoratorFunction } from 'storybook/internal/types';
import { emitTransformCode, useEffect, useRef } from 'storybook/preview-api';
import type { StoryFn } from '../public-types';
import type { HtmlRenderer } from '../types';
function skipSourc... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/template/cli/ts/Button.stories.ts | code/renderers/html/template/cli/ts/Button.stories.ts | import type { Meta, StoryObj } from '@storybook/html';
import { fn } from 'storybook/test';
import type { ButtonProps } from './Button';
import { createButton } from './Button';
// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export
const meta = {
title: 'Example/Button',... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/template/cli/ts/Page.stories.ts | code/renderers/html/template/cli/ts/Page.stories.ts | import type { Meta, StoryObj } from '@storybook/html';
import { expect, userEvent, within } from 'storybook/test';
import { createPage } from './Page';
const meta = {
title: 'Example/Page',
render: () => createPage(),
parameters: {
// More on how to position stories at: https://storybook.js.org/docs/config... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/template/cli/ts/Header.ts | code/renderers/html/template/cli/ts/Header.ts | import { createButton } from './Button';
import './header.css';
export interface HeaderProps {
user?: { name: string };
onLogin?: () => void;
onLogout?: () => void;
onCreateAccount?: () => void;
}
export const createHeader = ({ user, onLogout, onLogin, onCreateAccount }: HeaderProps) => {
const header = doc... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/template/cli/ts/Button.ts | code/renderers/html/template/cli/ts/Button.ts | import './button.css';
export interface ButtonProps {
/** Is this the principal call to action on the page? */
primary?: boolean;
/** What background color to use */
backgroundColor?: string;
/** How large should the button be? */
size?: 'small' | 'medium' | 'large';
/** Button contents */
label: strin... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/template/cli/ts/Header.stories.ts | code/renderers/html/template/cli/ts/Header.stories.ts | import type { Meta, StoryObj } from '@storybook/html';
import { fn } from 'storybook/test';
import type { HeaderProps } from './Header';
import { createHeader } from './Header';
const meta = {
title: 'Example/Header',
// This component will have an automatically generated Autodocs entry: https://storybook.js.org... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/html/template/cli/ts/Page.ts | code/renderers/html/template/cli/ts/Page.ts | import { createHeader } from './Header';
import './page.css';
type User = {
name: string;
};
export const createPage = () => {
const article = document.createElement('article');
let user: User | undefined;
let header: HTMLElement | null = null;
const rerenderHeader = () => {
const wrapper = document.ge... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/preact/vitest.config.ts | code/renderers/preact/vitest.config.ts | import { defineConfig, mergeConfig } from 'vitest/config';
import { vitestCommonConfig } from '../../vitest.shared';
export default mergeConfig(
vitestCommonConfig,
defineConfig({
// Add custom config here
})
);
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/preact/build-config.ts | code/renderers/preact/build-config.ts | import type { BuildEntries } from '../../../scripts/build/utils/entry-utils';
const config: BuildEntries = {
entries: {
browser: [
{
exportEntries: ['.'],
entryPoint: './src/index.ts',
},
{
exportEntries: ['./entry-preview'],
entryPoint: './src/entry-preview.ts',... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/preact/src/public-types.ts | code/renderers/preact/src/public-types.ts | import type {
AnnotatedStoryFn,
Args,
ComponentAnnotations,
DecoratorFunction,
StoryContext as GenericStoryContext,
LoaderFunction,
ProjectAnnotations,
StoryAnnotations,
StrictArgs,
} from 'storybook/internal/types';
import type { PreactRenderer } from './types';
export type { Args, ArgTypes, Parame... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/preact/src/entry-preview.ts | code/renderers/preact/src/entry-preview.ts | export { renderToCanvas, render } from './render';
export const parameters = { renderer: 'preact' };
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/preact/src/typings.d.ts | code/renderers/preact/src/typings.d.ts | declare var STORYBOOK_ENV: 'preact';
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/preact/src/entry-preview-docs.ts | code/renderers/preact/src/entry-preview-docs.ts | export const parameters = {
docs: {
story: { inline: true },
},
};
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/preact/src/preset.ts | code/renderers/preact/src/preset.ts | import { fileURLToPath } from 'node:url';
import type { PresetProperty } from 'storybook/internal/types';
export const previewAnnotations: PresetProperty<'previewAnnotations'> = async (
input = [],
options
) => {
const docsEnabled = Object.keys(await options.presets.apply('docs', {}, options)).length > 0;
con... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/preact/src/types.ts | code/renderers/preact/src/types.ts | import type { WebRenderer } from 'storybook/internal/types';
import type { AnyComponent } from 'preact';
export type { RenderContext } from 'storybook/internal/types';
export type StoryFnPreactReturnType = string | Node | preact.JSX.Element;
export interface ShowErrorArgs {
title: string;
description: string;
}... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/preact/src/portable-stories.ts | code/renderers/preact/src/portable-stories.ts | import type {
NamedOrDefaultProjectAnnotations,
NormalizedProjectAnnotations,
} from 'storybook/internal/types';
import {
setProjectAnnotations as originalSetProjectAnnotations,
setDefaultProjectAnnotations,
} from 'storybook/preview-api';
import * as INTERNAL_DEFAULT_PROJECT_ANNOTATIONS from './entry-preview... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/preact/src/index.ts | code/renderers/preact/src/index.ts | import './globals';
export * from './public-types';
export * from './portable-stories';
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/preact/src/globals.ts | code/renderers/preact/src/globals.ts | import { global } from '@storybook/global';
const { window: globalWindow } = global;
if (globalWindow) {
globalWindow.STORYBOOK_ENV = 'preact';
}
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/preact/src/render.tsx | code/renderers/preact/src/render.tsx | /** @jsx h */
import type { ArgsStoryFn, RenderContext } from 'storybook/internal/types';
import * as preact from 'preact';
import { dedent } from 'ts-dedent';
import type { PreactRenderer, StoryFnPreactReturnType } from './types';
const { h } = preact;
export const render: ArgsStoryFn<PreactRenderer> = (args, cont... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/vitest.config.ts | code/renderers/svelte/vitest.config.ts | import { defineConfig, mergeConfig } from 'vitest/config';
import { vitestCommonConfig } from '../../vitest.shared';
export default defineConfig(
mergeConfig(vitestCommonConfig, {
plugins: [
import('@sveltejs/vite-plugin-svelte').then(({ svelte }) => svelte()),
// @ts-expect-error -- types don't mat... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/build-config.ts | code/renderers/svelte/build-config.ts | import type { BuildEntries } from '../../../scripts/build/utils/entry-utils';
const config: BuildEntries = {
entries: {
browser: [
{
exportEntries: ['.'],
entryPoint: './src/index.ts',
},
{
exportEntries: ['./entry-preview'],
entryPoint: './src/entry-preview.ts',... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/public-types.ts | code/renderers/svelte/src/public-types.ts | import type {
AnnotatedStoryFn,
Args,
ArgsFromMeta,
ArgsStoryFn,
ComponentAnnotations,
DecoratorFunction,
StoryContext as GenericStoryContext,
LoaderFunction,
ProjectAnnotations,
StoryAnnotations,
StrictArgs,
} from 'storybook/internal/types';
import type { Component, ComponentProps } from 'svelt... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/mount.ts | code/renderers/svelte/src/mount.ts | import type { BaseAnnotations } from 'storybook/internal/types';
import type { StoryContext, SvelteRenderer } from './public-types';
export const mount: BaseAnnotations<SvelteRenderer>['mount'] = (context: StoryContext) => {
return async (Component, options) => {
if (Component) {
context.originalStoryFn =... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/render.ts | code/renderers/svelte/src/render.ts | import { RESET_STORY_ARGS } from 'storybook/internal/core-events';
import type { ArgsStoryFn, RenderContext } from 'storybook/internal/types';
/*
! DO NOT change these PreviewRender and createSvelte5Props imports to relative paths, it will break them.
! Relative imports will be compiled at build time by the bundler, b... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/entry-preview.ts | code/renderers/svelte/src/entry-preview.ts | import { enhanceArgTypes } from 'storybook/internal/docs-tools';
import type { ArgTypesEnhancer } from 'storybook/internal/types';
import { extractArgTypes } from './extractArgTypes';
import { extractComponentDescription } from './extractComponentDescription';
import type { SvelteRenderer } from './types';
export con... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/extractComponentDescription.ts | code/renderers/svelte/src/extractComponentDescription.ts | // eslint-disable-next-line @typescript-eslint/no-explicit-any
export function extractComponentDescription(component?: any): string {
return component?.__docgen?.description || '';
}
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/typings.d.ts | code/renderers/svelte/src/typings.d.ts | declare var STORYBOOK_ENV: 'svelte';
declare var LOGLEVEL: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'silent' | undefined;
declare module '*.svelte' {
import type { Component } from 'svelte';
const component: Component;
export default component;
}
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/playwright.ts | code/renderers/svelte/src/playwright.ts | export { createPlaywrightTest as createTest } from 'storybook/preview-api';
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/entry-preview-docs.ts | code/renderers/svelte/src/entry-preview-docs.ts | import type { DecoratorFunction } from 'storybook/internal/types';
import { sourceDecorator } from './docs/sourceDecorator';
import type { SvelteRenderer } from './types';
export const decorators: DecoratorFunction<SvelteRenderer>[] = [sourceDecorator];
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/decorators.ts | code/renderers/svelte/src/decorators.ts | import type { DecoratorFunction, LegacyStoryFn, StoryContext } from 'storybook/internal/types';
/*
! DO NOT change this DecoratorHandler import to a relative path, it will break it.
! A relative import will be compiled at build time, and Svelte will be unable to
! render the component together with the user's Svelte c... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/extractArgTypes.test.ts | code/renderers/svelte/src/extractArgTypes.test.ts | import { readFileSync } from 'node:fs';
import { describe, expect, it } from 'vitest';
import svelteDoc from 'sveltedoc-parser';
import { createArgTypes } from './extractArgTypes';
const content = readFileSync(`${__dirname}/sample/MockButton.svelte`, 'utf-8');
describe('Extracting Arguments', () => {
it('should b... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/extractComponentDescription.test.ts | code/renderers/svelte/src/extractComponentDescription.test.ts | import { describe, expect, it } from 'vitest';
import { extractComponentDescription } from './extractComponentDescription';
describe('extractComponentDescription', () => {
it('Extract from docgen', () => {
expect(extractComponentDescription({ __docgen: { description: 'a description' } })).toBe(
'a descrip... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/preset.ts | code/renderers/svelte/src/preset.ts | import { fileURLToPath } from 'node:url';
import type { PresetProperty } from 'storybook/internal/types';
export const previewAnnotations: PresetProperty<'previewAnnotations'> = async (
input = [],
options
) => {
const docsEnabled = Object.keys(await options.presets.apply('docs', {}, options)).length > 0;
con... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/types.ts | code/renderers/svelte/src/types.ts | import type {
Canvas,
StoryContext as StoryContextBase,
WebRenderer,
} from 'storybook/internal/types';
import type { Component, ComponentProps } from 'svelte';
export type StoryContext = StoryContextBase<SvelteRenderer>;
export interface SvelteRenderer<
C extends Component<any, any, any> = Component<any, an... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/portable-stories.ts | code/renderers/svelte/src/portable-stories.ts | import type {
Args,
ComposedStoryFn,
NamedOrDefaultProjectAnnotations,
NormalizedProjectAnnotations,
ProjectAnnotations,
Store_CSFExports,
StoriesWithPartialProps,
StoryAnnotationsOrFn,
} from 'storybook/internal/types';
import PreviewRender from '@storybook/svelte/internal/PreviewRender.svelte';
// @t... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/index.ts | code/renderers/svelte/src/index.ts | import './globals';
export * from './public-types';
export * from './portable-stories';
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/globals.ts | code/renderers/svelte/src/globals.ts | globalThis.STORYBOOK_ENV = 'svelte';
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/extractArgTypes.ts | code/renderers/svelte/src/extractArgTypes.ts | import { logger } from 'storybook/internal/client-logger';
import type { ArgTypesExtractor } from 'storybook/internal/docs-tools';
import type { SBScalarType, StrictArgTypes } from 'storybook/internal/types';
import type {
JSDocKeyword,
JSDocType,
JSDocTypeConst,
SvelteComponentDoc,
} from 'sveltedoc-parser/ty... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/public-types.test.ts | code/renderers/svelte/src/public-types.test.ts | // this file tests Typescript types that's why there are no assertions
import { describe, expectTypeOf, it } from 'vitest';
import { satisfies } from 'storybook/internal/common';
import type {
Args,
Canvas,
ComponentAnnotations,
StoryAnnotations,
} from 'storybook/internal/types';
import type { Component, Com... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/__test__/composeStories/Button.stories.ts | code/renderers/svelte/src/__test__/composeStories/Button.stories.ts | import { expect, fn, userEvent, within } from 'storybook/test';
import type { StoryFn as CSF2Story, Meta, StoryObj } from '../..';
import AddWrapperDecorator from './AddWrapperDecorator.svelte';
import Button from './Button.svelte';
import CustomRenderComponent from './CustomRenderComponent.svelte';
import InputFilled... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/__test__/composeStories/portable-stories.test.ts | code/renderers/svelte/src/__test__/composeStories/portable-stories.test.ts | // @vitest-environment happy-dom
/// <reference types="@testing-library/jest-dom" />;
import { cleanup, render, screen } from '@testing-library/svelte';
import { afterEach, describe, expect, it } from 'vitest';
// import '@testing-library/svelte/vitest';
import { expectTypeOf } from 'expect-type';
import type { Meta ... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/docs/sourceDecorator.test.ts | code/renderers/svelte/src/docs/sourceDecorator.test.ts | import { describe, expect, it } from 'vitest';
import type { Args } from 'storybook/internal/types';
import { generateSvelteSource } from './sourceDecorator';
expect.addSnapshotSerializer({
print: (val: any) => val,
test: (val: unknown) => typeof val === 'string',
});
const loremIpsum = 'Lorem ipsum dolor sit a... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/src/docs/sourceDecorator.ts | code/renderers/svelte/src/docs/sourceDecorator.ts | import { deprecate } from 'storybook/internal/client-logger';
import { SourceType } from 'storybook/internal/docs-tools';
import type {
ArgTypes,
Args,
ArgsStoryFn,
DecoratorFunction,
StoryContext,
} from 'storybook/internal/types';
import { emitTransformCode, useEffect, useRef } from 'storybook/preview-api'... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/template/stories/mount-in-play.stories.ts | code/renderers/svelte/template/stories/mount-in-play.stories.ts | import type { StoryObj } from '@storybook/svelte';
import Button from './Button.svelte';
export default {
component: Button,
};
export const Basic: StoryObj = {
args: {
disabled: true,
},
async play({ mount, args }) {
await mount(Button, { props: { ...args, label: 'set in play' } });
},
};
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/svelte/template/stories/settled.stories.ts | code/renderers/svelte/template/stories/settled.stories.ts | import type { StoryObj } from '@storybook/svelte';
import { expect, fn, waitFor } from 'storybook/test';
import AsyncComponent from './AsyncComponent.svelte';
import SyncComponent from './SyncComponent.svelte';
export default {
title: 'stories/renderers/svelte/settled',
};
export const Sync: StoryObj<typeof SyncC... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/server/vitest.config.ts | code/renderers/server/vitest.config.ts | import { defineConfig, mergeConfig } from 'vitest/config';
import { vitestCommonConfig } from '../../vitest.shared';
export default mergeConfig(
vitestCommonConfig,
defineConfig({
// Add custom config here
})
);
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/server/build-config.ts | code/renderers/server/build-config.ts | import type { BuildEntries } from '../../../scripts/build/utils/entry-utils';
const config: BuildEntries = {
entries: {
browser: [
{
exportEntries: ['.'],
entryPoint: './src/index.ts',
},
{
exportEntries: ['./entry-preview'],
entryPoint: './src/entry-preview.ts',... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/server/src/public-types.ts | code/renderers/server/src/public-types.ts | import type {
AnnotatedStoryFn,
Args,
ComponentAnnotations,
DecoratorFunction,
StoryContext as GenericStoryContext,
LoaderFunction,
ProjectAnnotations,
StoryAnnotations,
StrictArgs,
} from 'storybook/internal/types';
import type { ServerRenderer } from './types';
export type { Args, ArgTypes, Parame... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/server/src/render.ts | code/renderers/server/src/render.ts | import type { RenderContext } from 'storybook/internal/types';
import { global } from '@storybook/global';
import { simulateDOMContentLoaded, simulatePageLoad } from 'storybook/preview-api';
import { dedent } from 'ts-dedent';
import type { ArgTypes, Args, StoryFn } from './public-types';
import type { FetchStoryHtm... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/server/src/entry-preview.ts | code/renderers/server/src/entry-preview.ts | export { render, renderToCanvas } from './render';
export const parameters = { renderer: 'server' as const };
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/server/src/typings.d.ts | code/renderers/server/src/typings.d.ts | declare var STORYBOOK_ENV: 'SERVER';
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/server/src/preset.ts | code/renderers/server/src/preset.ts | import { readFile } from 'node:fs/promises';
import { fileURLToPath } from 'node:url';
import type { ComponentTitle, PresetProperty, StoryName, Tag } from 'storybook/internal/types';
import yaml from 'yaml';
type FileContent = {
title: ComponentTitle;
tags?: Tag[];
stories: { name: StoryName; tags?: Tag[] }[];... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/server/src/types.ts | code/renderers/server/src/types.ts | import type { StoryContext as StoryContextBase, WebRenderer } from 'storybook/internal/types';
export type { RenderContext } from 'storybook/internal/types';
export type StoryFnServerReturnType = any;
export type StoryContext = StoryContextBase<ServerRenderer>;
export interface ServerRenderer extends WebRenderer {
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/server/src/index.ts | code/renderers/server/src/index.ts | import './globals';
export * from './public-types';
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/server/src/globals.ts | code/renderers/server/src/globals.ts | import { global } from '@storybook/global';
const { window: globalWindow } = global;
globalWindow.STORYBOOK_ENV = 'SERVER';
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/vitest.config.ts | code/renderers/vue3/vitest.config.ts | import { defineConfig, mergeConfig } from 'vitest/config';
import vue from '@vitejs/plugin-vue';
import { vitestCommonConfig } from '../../vitest.shared';
export default mergeConfig(
vitestCommonConfig,
// @ts-expect-error seems like there's a type mismatch in the vue plugin
defineConfig({
// @ts-expect-er... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/build-config.ts | code/renderers/vue3/build-config.ts | import type { BuildEntries } from '../../../scripts/build/utils/entry-utils';
const config: BuildEntries = {
entries: {
browser: [
{
exportEntries: ['.'],
entryPoint: './src/index.ts',
},
{
exportEntries: ['./entry-preview'],
entryPoint: './src/entry-preview.ts',... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/public-types.ts | code/renderers/vue3/src/public-types.ts | import type {
AnnotatedStoryFn,
Args,
ArgsFromMeta,
ArgsStoryFn,
ComponentAnnotations,
DecoratorFunction,
StoryContext as GenericStoryContext,
LoaderFunction,
ProjectAnnotations,
StoryAnnotations,
StrictArgs,
} from 'storybook/internal/types';
import type { Constructor, RemoveIndexSignature, SetO... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/mount.ts | code/renderers/vue3/src/mount.ts | import { type BaseAnnotations } from 'storybook/internal/types';
import { h } from 'vue';
import { type StoryContext, type VueRenderer } from './public-types';
export const mount: BaseAnnotations<VueRenderer>['mount'] = (context: StoryContext) => {
return async (Component, options) => {
if (Component) {
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/render.ts | code/renderers/vue3/src/render.ts | /* eslint-disable local-rules/no-uncategorized-errors */
import type { Args, ArgsStoryFn, RenderContext, StoryContext } from 'storybook/internal/types';
import type { PreviewWeb } from 'storybook/preview-api';
import type { App } from 'vue';
import { createApp, h, isReactive, isVNode, reactive } from 'vue';
import ty... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/entry-preview.ts | code/renderers/vue3/src/entry-preview.ts | import { enhanceArgTypes, extractComponentDescription } from 'storybook/internal/docs-tools';
import type { ArgTypesEnhancer } from 'storybook/internal/types';
import { extractArgTypes } from './extractArgTypes';
import type { VueRenderer } from './types';
export { render, renderToCanvas } from './render';
export { d... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/render.test.ts | code/renderers/vue3/src/render.test.ts | import { describe, expect, it } from 'vitest';
import { expectTypeOf } from 'expect-type';
import { reactive } from 'vue';
import { updateArgs } from './render';
describe('Render Story', () => {
it('update reactive Args updateArgs()', () => {
const reactiveArgs = reactive({ argFoo: 'foo', argBar: 'bar' }); // ... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/typings.d.ts | code/renderers/vue3/src/typings.d.ts | declare var STORYBOOK_ENV: 'vue3';
declare var PLUGINS_SETUP_FUNCTIONS: Set<(app, context) => unknown>;
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/playwright.ts | code/renderers/vue3/src/playwright.ts | export { createPlaywrightTest as createTest } from 'storybook/preview-api';
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/entry-preview-docs.ts | code/renderers/vue3/src/entry-preview-docs.ts | import { sourceDecorator } from './docs/sourceDecorator';
export const decorators = [sourceDecorator];
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/extractArgTypes.test.ts | code/renderers/vue3/src/extractArgTypes.test.ts | import type { Mock } from 'vitest';
import { beforeEach, describe, expect, it, vi, vitest } from 'vitest';
import { extractComponentProps, hasDocgen } from 'storybook/internal/docs-tools';
import {
mockExtractComponentEventsReturn,
mockExtractComponentPropsReturn,
mockExtractComponentSlotsReturn,
referenceTyp... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/preset.ts | code/renderers/vue3/src/preset.ts | import { fileURLToPath } from 'node:url';
import type { PresetProperty } from 'storybook/internal/types';
export const previewAnnotations: PresetProperty<'previewAnnotations'> = async (
input = [],
options
) => {
const docsEnabled = Object.keys(await options.presets.apply('docs', {}, options)).length > 0;
con... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/decorateStory.ts | code/renderers/vue3/src/decorateStory.ts | import type { DecoratorFunction, LegacyStoryFn, StoryContext } from 'storybook/internal/types';
import { sanitizeStoryContextUpdate } from 'storybook/preview-api';
import type { Component, ComponentOptions, ConcreteComponent } from 'vue';
import { h } from 'vue';
import type { VueRenderer } from './types';
/*
This... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/types.ts | code/renderers/vue3/src/types.ts | import {
type Canvas,
type StoryContext as StoryContextBase,
type WebRenderer,
} from 'storybook/internal/types';
import type { App, ConcreteComponent } from 'vue';
export type { RenderContext } from 'storybook/internal/types';
export type StoryID = string;
export interface ShowErrorArgs {
title: string;
... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/portable-stories.ts | code/renderers/vue3/src/portable-stories.ts | import type {
Args,
ComposedStoryFn,
NamedOrDefaultProjectAnnotations,
NormalizedProjectAnnotations,
ProjectAnnotations,
Store_CSFExports,
StoriesWithPartialProps,
StoryAnnotationsOrFn,
} from 'storybook/internal/types';
import {
composeStories as originalComposeStories,
composeStory as originalCom... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/index.ts | code/renderers/vue3/src/index.ts | import './globals';
export { setup } from './render';
export * from './public-types';
export * from './portable-stories';
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/globals.ts | code/renderers/vue3/src/globals.ts | import { global } from '@storybook/global';
import type { App } from 'vue';
import type { StoryContext } from './public-types';
const { window: globalWindow } = global;
globalWindow.STORYBOOK_ENV = 'vue3';
globalWindow.PLUGINS_SETUP_FUNCTIONS ||= new Set<
(app: App<any>, context: StoryContext) => unknown
>();
| typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
storybookjs/storybook | https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/renderers/vue3/src/extractArgTypes.ts | code/renderers/vue3/src/extractArgTypes.ts | import type { ExtractedProp } from 'storybook/internal/docs-tools';
import {
type ArgTypesExtractor,
convert,
extractComponentProps,
hasDocgen,
} from 'storybook/internal/docs-tools';
import type { SBType, StrictArgTypes, StrictInputType } from 'storybook/internal/types';
import type { VueDocgenInfo, VueDocgen... | typescript | MIT | 7f193d38eec36246a211339c1f352cca246de779 | 2026-01-04T15:25:31.846427Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.