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/common/utils/load-main-config.ts
code/core/src/common/utils/load-main-config.ts
import { readFile, rm, writeFile } from 'node:fs/promises'; import { join, parse, relative, resolve } from 'node:path'; import { logger } from 'storybook/internal/node-logger'; import { MainFileEvaluationError } from 'storybook/internal/server-errors'; import type { StorybookConfig } 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/common/utils/posix.ts
code/core/src/common/utils/posix.ts
import { posix as posixPath, sep } from 'node:path'; /** Replaces the path separator with forward slashes */ export const posix = (localPath: string, seperator: string = sep) => localPath.split(seperator).filter(Boolean).join(posixPath.sep);
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/interpret-require.ts
code/core/src/common/utils/interpret-require.ts
import { importModule } from '../../shared/utils/module'; import { getInterpretedFile } from './interpret-files'; function getCandidate(paths: string[]) { for (let i = 0; i < paths.length; i += 1) { const candidate = getInterpretedFile(paths[i]); if (candidate) { return candidate; } } return ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/get-addon-names.ts
code/core/src/common/utils/get-addon-names.ts
import type { StorybookConfig } from 'storybook/internal/types'; import { normalizePath } from './normalize-path'; export const getAddonNames = (mainConfig: StorybookConfig): string[] => { const addons = mainConfig.addons || []; const addonList = addons.map((addon) => { let name = ''; if (typeof addon ===...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/setup-addon-in-config.ts
code/core/src/common/utils/setup-addon-in-config.ts
import type { ConfigFile } from 'storybook/internal/csf-tools'; import { writeConfig } from 'storybook/internal/csf-tools'; import { loadMainConfig } from './load-main-config'; import { syncStorybookAddons } from './sync-main-preview-addons'; import { getAbsolutePathWrapperName, wrapValueWithGetAbsolutePathWrapper...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/transform-imports.ts
code/core/src/common/utils/transform-imports.ts
import { readFile, writeFile } from 'node:fs/promises'; function transformImports(source: string, renamedImports: Record<string, string>) { let hasChanges = false; let transformed = source; for (const [from, to] of Object.entries(renamedImports)) { // Match the package name when it's inside either single or...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/scan-and-transform-files.test.ts
code/core/src/common/utils/scan-and-transform-files.test.ts
import { beforeEach, describe, expect, it, vi } from 'vitest'; import * as paths from './paths'; import { scanAndTransformFiles } from './scan-and-transform-files'; // Mock dependencies const mocks = vi.hoisted(() => { return { commonGlobOptions: vi.fn(), promptText: vi.fn(), globby: vi.fn(), logger...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/utils.ts
code/core/src/common/utils/utils.ts
// Object.groupBy polyfill export const groupBy = <K extends PropertyKey, T>( items: T[], keySelector: (item: T, index: number) => K ) => { return items.reduce<Record<K, T[]>>( (acc, item, index) => { const key = keySelector(item, index); acc[key] ??= []; acc[key].push(item); return ac...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/common-glob-options.ts
code/core/src/common/utils/common-glob-options.ts
const NODE_MODULES_RE = /node_modules/; // Exclude node_modules stories everywhere we call `glob` export const commonGlobOptions = (glob: string) => NODE_MODULES_RE.test(glob) ? {} : { ignore: ['**/node_modules/**'] };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/symlinks.ts
code/core/src/common/utils/symlinks.ts
export function isPreservingSymlinks() { const { NODE_OPTIONS, NODE_PRESERVE_SYMLINKS } = process.env; return !!NODE_PRESERVE_SYMLINKS || NODE_OPTIONS?.includes('--preserve-symlinks'); }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/sync-main-preview-addons.ts
code/core/src/common/utils/sync-main-preview-addons.ts
import { types as t } from 'storybook/internal/babel'; import { type ConfigFile, isCsfFactoryPreview, readConfig, writeConfig, } from 'storybook/internal/csf-tools'; import { logger } from 'storybook/internal/node-logger'; import type { StorybookConfig } from 'storybook/internal/types'; import picocolors from ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/get-storybook-refs.ts
code/core/src/common/utils/get-storybook-refs.ts
import { readFile } from 'node:fs/promises'; import { dirname, join } from 'node:path'; import { logger } from 'storybook/internal/node-logger'; import type { Options, Ref } from 'storybook/internal/types'; import * as pkg from 'empathic/package'; import * as resolve from 'empathic/resolve'; import { getProjectRoot ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/normalize-stories.ts
code/core/src/common/utils/normalize-stories.ts
import { lstatSync } from 'node:fs'; import { basename, dirname, relative, resolve } from 'node:path'; import { InvalidStoriesEntryError } from 'storybook/internal/server-errors'; import type { NormalizedStoriesSpecifier, StoriesEntry } from 'storybook/internal/types'; import * as pico from 'picomatch'; // eslint-dis...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/write-file-with-retry.ts
code/core/src/common/utils/write-file-with-retry.ts
import { writeFile } from 'node:fs/promises'; type File = Parameters<typeof writeFile>[0]; type Data = Parameters<typeof writeFile>[1]; type Options = Parameters<typeof writeFile>[2]; export async function writeFileWithRetry(file: File, data: Data, options: Options): Promise<void> { const MAX_ATTEMPTS = 5; for (...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/formatter.ts
code/core/src/common/utils/formatter.ts
// Prettier interface definition // Note: We want to avoid importing prettier directly to prevent bundling its type import // because prettier is an optional peer dependency and might not be available interface Prettier { resolveConfig: (filePath: string, options?: { editorconfig?: boolean }) => Promise<any>; forma...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/validate-config.ts
code/core/src/common/utils/validate-config.ts
import { CouldNotEvaluateFrameworkError, InvalidFrameworkNameError, MissingFrameworkFieldError, } from 'storybook/internal/server-errors'; import { resolveModulePath } from 'exsolve'; import { extractFrameworkPackageName } from '..'; import { frameworkPackages } from './get-storybook-info'; const renderers = [...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/transform-imports.test.ts
code/core/src/common/utils/transform-imports.test.ts
import { readFile, writeFile } from 'node:fs/promises'; import { join } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; import { dedent } from 'ts-dedent'; import { transformImportFiles } from './transform-imports'; const consolidatedPackages = { '@storybook/core-common': 'storybook/internal/...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/command.ts
code/core/src/common/utils/command.ts
import { logger, prompt } from 'storybook/internal/node-logger'; // eslint-disable-next-line depend/ban-dependencies import { type Options, type ResultPromise, type SyncOptions, execa, execaCommandSync, execaNode, } from 'execa'; const COMMON_ENV_VARS = { COREPACK_ENABLE_STRICT: '0', COREPACK_ENABLE_A...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/normalize-path.ts
code/core/src/common/utils/normalize-path.ts
import { posix } from 'node:path'; /** * Normalize a path to use forward slashes and remove .. and . * * @example * * ```ts * normalizePath('path/to/../file'); // => 'path/file' * normalizePath('path/to/./file'); // => 'path/to/file' * normalizePath('path\\to\\file'); // => 'path/to/file' * ``` * * @param p...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/HandledError.ts
code/core/src/common/utils/HandledError.ts
export class HandledError extends Error { public handled = true; constructor(error: unknown) { super(String(error)); if (typeof error !== 'string') { this.cause = error; } } }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/setup-addon-in-config.test.ts
code/core/src/common/utils/setup-addon-in-config.test.ts
import { beforeEach, describe, expect, it, vi } from 'vitest'; import type { ConfigFile } from 'storybook/internal/csf-tools'; import * as csfTools from 'storybook/internal/csf-tools'; import type { StorybookConfigRaw } from 'storybook/internal/types'; import * as loadMainConfigModule from './load-main-config'; impor...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/sync-main-preview-addons.test.ts
code/core/src/common/utils/sync-main-preview-addons.test.ts
import type { Mock } from 'vitest'; import { describe, expect, it, vi } from 'vitest'; import { loadConfig, printConfig } from 'storybook/internal/csf-tools'; import type { StorybookConfigRaw } from 'storybook/internal/types'; import { dedent } from 'ts-dedent'; import { getAddonAnnotations } from './get-addon-annot...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/paths.ts
code/core/src/common/utils/paths.ts
import { join, relative, resolve, sep } from 'node:path'; import * as find from 'empathic/find'; import * as walk from 'empathic/walk'; import { globSync } from 'tinyglobby'; import { LOCK_FILES } from '../js-package-manager/constants'; let projectRoot: string | undefined; export const getProjectRoot = () => { if...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/envs.ts
code/core/src/common/utils/envs.ts
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - Needed for Angular sandbox running without --no-link option. Do NOT convert to @ts-expect-error! import { nodePathsToArray } from './paths'; // Load environment variables starts with STORYBOOK_ to the client side. export async function load...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/load-preview-or-config-file.ts
code/core/src/common/utils/load-preview-or-config-file.ts
import { resolve } from 'node:path'; import { dedent } from 'ts-dedent'; import { getInterpretedFile } from './interpret-files'; export function loadPreviewOrConfigFile({ configDir }: { configDir: string }) { const storybookConfigPath = getInterpretedFile(resolve(configDir, 'config')); const storybookPreviewPath...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/template.ts
code/core/src/common/utils/template.ts
import { existsSync, readFileSync } from 'node:fs'; import { join, resolve } from 'pathe'; import { resolvePackageDir } from '../../shared/utils/module'; const interpolate = (string: string, data: Record<string, string> = {}) => Object.entries(data).reduce((acc, [k, v]) => acc.replace(new RegExp(`%${k}%`, 'g'), v)...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/cli.ts
code/core/src/common/utils/cli.ts
import type { WriteStream } from 'node:fs'; import { createWriteStream, mkdirSync } from 'node:fs'; import { copyFile, readFile, realpath, rm, writeFile } from 'node:fs/promises'; import os from 'node:os'; import { join } from 'node:path'; import { type MergeExclusive } from 'type-fest'; import uniqueString from 'uniq...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/cache.ts
code/core/src/common/utils/cache.ts
import { createFileSystemCache } from './file-cache'; import { resolvePathInStorybookCache } from './resolve-path-in-sb-cache'; export const cache = createFileSystemCache({ basePath: resolvePathInStorybookCache('dev-server'), ns: 'storybook', // Optional. A grouping namespace for items. });
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/file-cache.ts
code/core/src/common/utils/file-cache.ts
/** This file is a modified copy from https://git.nfp.is/TheThing/fs-cache-fast */ import { createHash, randomBytes } from 'node:crypto'; import { mkdirSync, readFileSync, readdirSync, rmSync, writeFileSync } from 'node:fs'; import { mkdir, readFile, readdir, rm } from 'node:fs/promises'; import { tmpdir } from 'node:o...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/remove.ts
code/core/src/common/utils/remove.ts
import { readConfig, writeConfig } from 'storybook/internal/csf-tools'; import { logger } from 'storybook/internal/node-logger'; import { dedent } from 'ts-dedent'; import type { JsPackageManager } from '../js-package-manager'; import { getConfigInfo } from './get-storybook-info'; export type RemoveAddonOptions = { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/formatter.test.ts
code/core/src/common/utils/formatter.test.ts
import { resolve } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; import { formatFileContent } from './formatter'; const mockPrettier = vi.hoisted(() => ({ resolveConfig: vi.fn(), format: vi.fn(), version: vi.fn(), })); vi.mock('prettier', () => ({ resolveConfig: mockPrettier.resolveCo...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/glob-to-regexp.ts
code/core/src/common/utils/glob-to-regexp.ts
import * as pico from 'picomatch'; export function globToRegexp(glob: string) { const regex = pico.makeRe(glob, { fastpaths: false, noglobstar: false, bash: false, }); if (!regex.source.startsWith('^')) { throw new Error(`Invalid glob: >> ${glob} >> ${regex}`); } if (!glob.startsWith('./'))...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/resolve-path-in-sb-cache.ts
code/core/src/common/utils/resolve-path-in-sb-cache.ts
import { join } from 'node:path'; import * as pkg from 'empathic/package'; /** * Get the path of the file or directory with input name inside the Storybook cache directory: * * - `node_modules/.cache/storybook/{directoryName}` in a Node.js project or npm package * - `.cache/storybook/{directoryName}` otherwise *...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/readTemplate.ts
code/core/src/common/utils/readTemplate.ts
import { readFile } from 'node:fs/promises'; export async function readTemplate(filename: string) { return readFile(filename, { encoding: 'utf8', }); }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/get-framework-name.ts
code/core/src/common/utils/get-framework-name.ts
import type { Options } from 'storybook/internal/types'; import { dedent } from 'ts-dedent'; import { frameworkPackages } from './get-storybook-info'; import { normalizePath } from './normalize-path'; /** Framework can be a string or an object. This utility always returns the string name. */ export async function ge...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/get-renderer-name.test.ts
code/core/src/common/utils/get-renderer-name.test.ts
import { describe, expect, test } from 'vitest'; import { extractRenderer } from './get-renderer-name'; describe('get-renderer-name', () => { describe('extractProperRendererNameFromFramework', () => { test('should return the renderer name for a known framework', async () => { const renderer = await extrac...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/get-renderer-name.ts
code/core/src/common/utils/get-renderer-name.ts
import type { Options } from 'storybook/internal/types'; import { frameworkToRenderer } from './framework'; import { extractFrameworkPackageName, getFrameworkName } from './get-framework-name'; import { frameworkPackages } from './get-storybook-info'; /** * Render is set as a string on core. It must be set by the fr...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/validate-config.test.ts
code/core/src/common/utils/validate-config.test.ts
import { afterEach, describe, expect, it, vi } from 'vitest'; import { resolveModulePath } from 'exsolve'; import { validateFrameworkName } from './validate-config'; // mock exsolve to spy vi.mock('exsolve', { spy: true }); describe('validateFrameworkName', () => { afterEach(() => { vi.resetAllMocks(); }); ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/strip-abs-node-modules-path.ts
code/core/src/common/utils/strip-abs-node-modules-path.ts
import { posix, sep } from 'node:path'; // eslint-disable-next-line depend/ban-dependencies import slash from 'slash'; function normalizePath(id: string) { return posix.normalize(slash(id)); } // We need to convert from an absolute path, to a traditional node module import path, // so that vite can correctly pre-b...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/wrap-getAbsolutePath-utils.ts
code/core/src/common/utils/wrap-getAbsolutePath-utils.ts
import { types as t } from 'storybook/internal/babel'; import type { ConfigFile } from 'storybook/internal/csf-tools'; const PREFERRED_GET_ABSOLUTE_PATH_WRAPPER_NAME = 'getAbsolutePath'; const ALTERNATIVE_GET_ABSOLUTE_PATH_WRAPPER_NAME = 'wrapForPnp'; /** * Checks if the following node declarations exists in the mai...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/get-addon-annotations.ts
code/core/src/common/utils/get-addon-annotations.ts
import { createRequire } from 'node:module'; import { isCorePackage } from './cli'; /** * Get the name of the annotations object for a given addon. * * Input: '@storybook/addon-essentials' * * Output: 'addonEssentialsAnnotations' */ export function getAnnotationsName(addonName: string): string { // remove @st...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/interpret-files.ts
code/core/src/common/utils/interpret-files.ts
import { existsSync } from 'node:fs'; import { extname } from 'node:path'; import resolve from 'resolve'; export const supportedExtensions = [ '.js', '.ts', '.jsx', '.tsx', '.mjs', '.mts', '.mtsx', '.cjs', '.cts', '.ctsx', ] as const; export function getInterpretedFile(pathToFile: string) { ret...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/get-framework-name.test.ts
code/core/src/common/utils/get-framework-name.test.ts
import { describe, expect, it } from 'vitest'; import { extractFrameworkPackageName } from './get-framework-name'; describe('get-framework-name', () => { describe('extractProperFrameworkName', () => { it('should extract the proper framework name from the given framework field', () => { expect(extractFrame...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/framework.ts
code/core/src/common/utils/framework.ts
import { SupportedBuilder, SupportedFramework, SupportedRenderer } from 'storybook/internal/types'; export const frameworkToRenderer: Record< SupportedFramework | SupportedRenderer, SupportedRenderer > = { // frameworks [SupportedFramework.ANGULAR]: SupportedRenderer.ANGULAR, [SupportedFramework.EMBER]: Supp...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/get-story-id.ts
code/core/src/common/utils/get-story-id.ts
import { relative } from 'node:path'; import { normalizeStories, normalizeStoryPath } from 'storybook/internal/common'; import { sanitize, storyNameFromExport, toId } from 'storybook/internal/csf'; import type { Options, StoriesEntry } from 'storybook/internal/types'; import { dedent } from 'ts-dedent'; import { use...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/interpolate.ts
code/core/src/common/utils/interpolate.ts
/** * Return a string corresponding to template filled with bindings using following pattern: For each * (key, value) of `bindings` replace, in template, `{{key}}` by escaped version of `value` * * @param template {String} Template with `{{binding}}` * @param bindings {Object} key-value object use to fill the temp...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/validate-configuration-files.ts
code/core/src/common/utils/validate-configuration-files.ts
import { resolve } from 'node:path'; import { once } from 'storybook/internal/node-logger'; import { MainFileMissingError } from 'storybook/internal/server-errors'; // eslint-disable-next-line depend/ban-dependencies import { glob } from 'glob'; // eslint-disable-next-line depend/ban-dependencies import slash from 's...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/posix.test.ts
code/core/src/common/utils/posix.test.ts
import { describe, expect, it } from 'vitest'; import { posix } from './posix'; describe('posix', () => { it('should replace backslashes with forward slashes', () => { expect(posix('src\\components\\Page.tsx', '\\')).toBe('src/components/Page.tsx'); expect(posix('src\\\\components\\\\Page.tsx', '\\\\')).toB...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/get-storybook-configuration.test.ts
code/core/src/common/utils/get-storybook-configuration.test.ts
import { describe, expect, it } from 'vitest'; import { getStorybookConfiguration } from './get-storybook-configuration'; describe('getStorybookConfiguration', () => { it('handles short names', () => { const port = getStorybookConfiguration('start-storybook -p 9001', '-p', '--port'); expect(port).toBe('9001...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/write-file-with-retry.test.ts
code/core/src/common/utils/write-file-with-retry.test.ts
import fs from 'node:fs/promises'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; import { writeFileWithRetry } from './write-file-with-retry'; vi.mock('node:fs/promises'); describe('writeFileWithRetry', () => { const filename: string = 'foo.txt'; beforeEach(async () => { vi.useF...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/scan-and-transform-files.ts
code/core/src/common/utils/scan-and-transform-files.ts
import { logger, prompt } from 'storybook/internal/node-logger'; import { commonGlobOptions } from './common-glob-options'; import { getProjectRoot } from './paths'; /** * Helper function to scan for files matching a glob pattern and transform them * * @param options Configuration options * @param transform Funct...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/check-addon-order.ts
code/core/src/common/utils/check-addon-order.ts
import { logger } from 'storybook/internal/node-logger'; import type { CoreCommon_AddonEntry, CoreCommon_AddonInfo, CoreCommon_OptionsEntry, } from 'storybook/internal/types'; interface Options { before: CoreCommon_AddonInfo; after: CoreCommon_AddonInfo; configFile: string; getConfig: (path: string) => a...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/satisfies.ts
code/core/src/common/utils/satisfies.ts
/** Mimicking the satisfies operator until we can upgrade to TS4.9 */ export function satisfies<A>() { return <T extends A>(x: T) => x; }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/get-storybook-configuration.ts
code/core/src/common/utils/get-storybook-configuration.ts
/* * Lifted from chromatic-cli * * This is not exactly clever but it works most of the time * we receive the full text of the npm script, and we look if we can find the cli flag */ export function getStorybookConfiguration( storybookScript: string, shortName: string, longName: string ) { if (!storybookScri...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/cli.test.ts
code/core/src/common/utils/cli.test.ts
import { describe, expect, it } from 'vitest'; import { isCorePackage } from './cli'; describe('UTILS', () => { describe.each([ ['@storybook/react', true], ['storybook', true], ['@storybook/linter-config', false], ['@storybook/design-system', false], ['@storybook/addon-styling', false], ['@s...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/get-addon-annotations.test.ts
code/core/src/common/utils/get-addon-annotations.test.ts
import { describe, expect, it } from 'vitest'; import { getAnnotationsName } from './get-addon-annotations'; describe('getAnnotationsName', () => { it('should handle @storybook namespace and camel case conversion', () => { expect(getAnnotationsName('@storybook/addon-essentials')).toBe('addonEssentials'); }); ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/__tests__/template.test.ts
code/core/src/common/utils/__tests__/template.test.ts
import { join } from 'node:path'; import { afterEach, describe, expect, it, vi } from 'vitest'; import { vol } from 'memfs'; import { getPreviewBodyTemplate, getPreviewHeadTemplate } from '../template'; vi.mock('fs', async () => { const memfs = await vi.importActual('memfs'); return { default: memfs.fs, ...(me...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/__tests__/paths.test.ts
code/core/src/common/utils/__tests__/paths.test.ts
import { join, sep } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; import * as find from 'empathic/find'; // eslint-disable-next-line depend/ban-dependencies import slash from 'slash'; import { getProjectRoot, normalizeStoryPath } from '../paths'; vi.mock('empathic/find'); describe('paths - ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/__tests__/normalize-stories.test.ts
code/core/src/common/utils/__tests__/normalize-stories.test.ts
/// <reference types="@testing-library/jest-dom" />; import { sep } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; import { InvalidStoriesEntryError } from 'storybook/internal/server-errors'; import { getDirectoryFromWorkingDir, normalizeStories, normalizeStoriesEntry, } from '../normaliz...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/utils/__tests__/interpret-files.test.ts
code/core/src/common/utils/__tests__/interpret-files.test.ts
import { afterEach, describe, expect, it, vi } from 'vitest'; import { vol } from 'memfs'; import { getInterpretedFile } from '../interpret-files'; vi.mock('fs', async () => { const memfs = await vi.importActual('memfs'); return { default: memfs.fs, ...(memfs as any).fs }; }); describe('interpret-files', () =>...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/js-package-manager/NPMProxy.ts
code/core/src/common/js-package-manager/NPMProxy.ts
import { readFileSync } from 'node:fs'; import { platform } from 'node:os'; import { join } from 'node:path'; import { logger, prompt } from 'storybook/internal/node-logger'; import { FindPackageVersionsError } from 'storybook/internal/server-errors'; import * as find from 'empathic/find'; // eslint-disable-next-line...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/js-package-manager/JsPackageManager.ts
code/core/src/common/js-package-manager/JsPackageManager.ts
import { readFileSync, writeFileSync } from 'node:fs'; import { dirname, isAbsolute, join, normalize, resolve } from 'node:path'; import { logger, prompt } from 'storybook/internal/node-logger'; import detectIndent from 'detect-indent'; import * as find from 'empathic/find'; // eslint-disable-next-line depend/ban-dep...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/js-package-manager/Yarn2Proxy.test.ts
code/core/src/common/js-package-manager/Yarn2Proxy.test.ts
import { beforeEach, describe, expect, it, vi } from 'vitest'; import { prompt } from 'storybook/internal/node-logger'; import { executeCommand } from '../utils/command'; import { JsPackageManager } from './JsPackageManager'; import { Yarn2Proxy } from './Yarn2Proxy'; vi.mock('storybook/internal/node-logger', () => ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/js-package-manager/Yarn1Proxy.ts
code/core/src/common/js-package-manager/Yarn1Proxy.ts
import { readFileSync } from 'node:fs'; import { join } from 'node:path'; import process from 'node:process'; import { logger, prompt } from 'storybook/internal/node-logger'; import { FindPackageVersionsError } from 'storybook/internal/server-errors'; import * as find from 'empathic/find'; // eslint-disable-next-line...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/js-package-manager/util.ts
code/core/src/common/js-package-manager/util.ts
// input: @storybook/addon-essentials@npm:7.0.0 // output: { name: '@storybook/addon-essentials', value: { version : '7.0.0', location: '' } } export const parsePackageData = (packageName = '') => { const [first, second, third] = packageName .replace(/[└─├]+/g, '') .trim() .split('@'); const version = (...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/js-package-manager/BUNProxy.ts
code/core/src/common/js-package-manager/BUNProxy.ts
import { readFileSync } from 'node:fs'; import { join } from 'node:path'; import { logger, prompt } from 'storybook/internal/node-logger'; import { FindPackageVersionsError } from 'storybook/internal/server-errors'; import * as find from 'empathic/find'; // eslint-disable-next-line depend/ban-dependencies import type...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/js-package-manager/constants.ts
code/core/src/common/js-package-manager/constants.ts
export const NPM_LOCKFILE = 'package-lock.json'; export const PNPM_LOCKFILE = 'pnpm-lock.yaml'; export const YARN_LOCKFILE = 'yarn.lock'; export const BUN_LOCKFILE = 'bun.lock'; export const BUN_LOCKFILE_BINARY = 'bun.lockb'; export const LOCK_FILES = [ NPM_LOCKFILE, PNPM_LOCKFILE, YARN_LOCKFILE, BUN_LOCKFILE,...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/js-package-manager/NPMProxy.test.ts
code/core/src/common/js-package-manager/NPMProxy.test.ts
import { beforeEach, describe, expect, it, vi } from 'vitest'; import { prompt } from 'storybook/internal/node-logger'; import { executeCommand } from '../utils/command'; import { JsPackageManager } from './JsPackageManager'; import { NPMProxy } from './NPMProxy'; vi.mock('storybook/internal/node-logger', () => ({ ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/js-package-manager/types.ts
code/core/src/common/js-package-manager/types.ts
export type PackageMetadata = { version: string; location?: string; reasons?: string[] }; export type InstallationMetadata = { dependencies: Record<string, PackageMetadata[]>; duplicatedDependencies: Record<string, string[]>; infoCommand: string; dedupeCommand: string; };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/js-package-manager/Yarn2Proxy.ts
code/core/src/common/js-package-manager/Yarn2Proxy.ts
import { readFileSync } from 'node:fs'; import { join } from 'node:path'; import { pathToFileURL } from 'node:url'; import { prompt } from 'storybook/internal/node-logger'; import { FindPackageVersionsError } from 'storybook/internal/server-errors'; import { PosixFS, VirtualFS, ZipOpenFS } from '@yarnpkg/fslib'; impo...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/js-package-manager/index.ts
code/core/src/common/js-package-manager/index.ts
export * from './JsPackageManagerFactory'; export * from './JsPackageManager'; export * from './PackageJson'; 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/common/js-package-manager/JsPackageManager.test.ts
code/core/src/common/js-package-manager/JsPackageManager.test.ts
import { beforeEach, describe, expect, it, vi } from 'vitest'; import { JsPackageManager } from './JsPackageManager'; const mockVersions = vi.hoisted(() => ({ '@storybook/react': '8.3.0', })); vi.mock('../versions', () => ({ default: mockVersions, })); describe('JsPackageManager', () => { let jsPackageManager...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/js-package-manager/JsPackageManagerFactory.test.ts
code/core/src/common/js-package-manager/JsPackageManagerFactory.test.ts
import { join } from 'node:path'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import * as find from 'empathic/find'; import { PackageManagerName } from '.'; import { executeCommandSync } from '../utils/command'; import { BUNProxy } from './BUNProxy'; import { JsPackageManagerFactory } from './JsPa...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/js-package-manager/PNPMProxy.test.ts
code/core/src/common/js-package-manager/PNPMProxy.test.ts
import { beforeEach, describe, expect, it, vi } from 'vitest'; import { prompt } from 'storybook/internal/node-logger'; import { executeCommand } from '../utils/command'; import { JsPackageManager } from './JsPackageManager'; import { PNPMProxy } from './PNPMProxy'; vi.mock('storybook/internal/node-logger', () => ({...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/js-package-manager/Yarn1Proxy.test.ts
code/core/src/common/js-package-manager/Yarn1Proxy.test.ts
import { beforeEach, describe, expect, it, vi } from 'vitest'; import { prompt } from 'storybook/internal/node-logger'; import { dedent } from 'ts-dedent'; import { executeCommand } from '../utils/command'; import { JsPackageManager, PackageManagerName } from './JsPackageManager'; import { Yarn1Proxy } from './Yarn1...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/js-package-manager/PNPMProxy.ts
code/core/src/common/js-package-manager/PNPMProxy.ts
import { existsSync, readFileSync } from 'node:fs'; import { join } from 'node:path'; import { pathToFileURL } from 'node:url'; import { logger, prompt } from 'storybook/internal/node-logger'; import { FindPackageVersionsError } from 'storybook/internal/server-errors'; import * as find from 'empathic/find'; // eslint...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/js-package-manager/PackageJson.ts
code/core/src/common/js-package-manager/PackageJson.ts
import type { PackageJson } from 'storybook/internal/types'; export type PackageJsonWithDepsAndDevDeps = PackageJson & Required<Pick<PackageJson, 'dependencies' | 'devDependencies'>>; export type PackageJsonWithMaybeDeps = Partial< Pick<PackageJson, 'dependencies' | 'devDependencies' | 'peerDependencies' | 'files...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/common/js-package-manager/JsPackageManagerFactory.ts
code/core/src/common/js-package-manager/JsPackageManagerFactory.ts
import { basename, parse, relative } from 'node:path'; import * as find from 'empathic/find'; import { executeCommandSync } from '../utils/command'; import { getProjectRoot } from '../utils/paths'; import { BUNProxy } from './BUNProxy'; import type { JsPackageManager } from './JsPackageManager'; import { PackageManag...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/bin/loader.ts
code/core/src/bin/loader.ts
/** * This is an isolated file that is registered as a loader in Node. It is used to convert TS to ESM * using esbuild. Do _not_ import from other modules in core unless strictly necessary, as it will * cause the dist to get huge. */ import { existsSync } from 'node:fs'; import { readFile } from 'node:fs/promises';...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/bin/dispatcher.ts
code/core/src/bin/dispatcher.ts
#!/usr/bin/env node import { pathToFileURL } from 'node:url'; import { executeCommand, executeNodeCommand } from 'storybook/internal/common'; import { logger } from 'storybook/internal/node-logger'; import { join } from 'pathe'; import { dedent } from 'ts-dedent'; import versions from '../common/versions'; import { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/bin/loader.test.ts
code/core/src/bin/loader.test.ts
import { existsSync } from 'node:fs'; import * as path from 'node:path'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { deprecate } from 'storybook/internal/node-logger'; import { addExtensionsToRelativeImports, resolveWithExtension } from './loader'; // Mock dependencies vi.mock('node:fs')...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/bin/core.ts
code/core/src/bin/core.ts
import { getEnvConfig, optionalEnvToBoolean, parseList } from 'storybook/internal/common'; import { logTracker, logger } from 'storybook/internal/node-logger'; import { addToGlobalContext } from 'storybook/internal/telemetry'; import { program } from 'commander'; import leven from 'leven'; import picocolors from 'pico...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/index.ts
code/core/src/types/index.ts
/// <reference path="../typings.d.ts" /> export * from './modules/csf'; export * from './modules/addons'; export * from './modules/story'; export * from './modules/core-common'; export * from './modules/builder'; export * from './modules/api'; export * from './modules/docs'; export * from './modules/api-stories'; expo...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/universal-store.ts
code/core/src/types/modules/universal-store.ts
import type { UniversalStore } from '../../shared/universal-store'; import type { MockUniversalStore } from '../../shared/universal-store/mock'; import type { Actor, Event, EventInfo, StoreOptions } from '../../shared/universal-store/types'; export type { UniversalStore, MockUniversalStore, Actor, Event, EventInfo, St...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/builder.ts
code/core/src/types/modules/builder.ts
export interface BuilderStats { // toJson: () => any; } export type Builder_WithRequiredProperty<Type, Key extends keyof Type> = Type & { [Property in Key]-?: Type[Property]; }; export type Builder_Unpromise<T extends Promise<any>> = T extends Promise<infer U> ? U : never; export type Builder_EnvsRaw = Record<...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/csf.ts
code/core/src/types/modules/csf.ts
import type { ViewMode as ViewModeBase } from 'storybook/internal/csf'; import type { Addon_OptionsParameterV7 } from './addons'; export type { AfterEach, AnnotatedStoryFn, Args, ArgsEnhancer, ArgsFromMeta, ArgsStoryFn, ArgTypes, ArgTypesEnhancer, BaseAnnotations, BeforeAll, BeforeEach, Canvas...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/addons.ts
code/core/src/types/modules/addons.ts
import type { FC, PropsWithChildren, ReactElement, ReactNode } from 'react'; import type { State } from '../../manager-api'; import type { RenderData as RouterData } from '../../router/types'; import type { ThemeVars } from '../../theming/types'; import type { API_LayoutCustomisations, API_SidebarOptions } from './api...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/story.ts
code/core/src/types/modules/story.ts
import type { ArgsStoryFn, BaseProjectAnnotations, BeforeAll, Canvas, CleanupCallback, ComponentAnnotations, ComponentId, ComponentTitle, DecoratorFunction, Globals, LegacyStoryFn, LoaderFunction, PartialStoryFn, Path, Renderer, StepRunner, StoryAnnotations, StoryContext, StoryCont...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/builders.ts
code/core/src/types/modules/builders.ts
export enum SupportedBuilder { // CORE WEBPACK5 = 'webpack5', VITE = 'vite', // COMMUNITY RSBUILD = 'rsbuild', }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/renderers.ts
code/core/src/types/modules/renderers.ts
export enum SupportedRenderer { REACT = 'react', REACT_NATIVE = 'react-native', VUE3 = 'vue3', ANGULAR = 'angular', EMBER = 'ember', PREACT = 'preact', SVELTE = 'svelte', QWIK = 'qwik', HTML = 'html', WEB_COMPONENTS = 'web-components', SERVER = 'server', SOLID = 'solid', NUXT = 'nuxt', }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/indexer.ts
code/core/src/types/modules/indexer.ts
import type { ComponentTitle, Parameters, Path, StoryId, StoryName, Tag } from './csf'; type ExportName = string; type MetaId = string; export interface StoriesSpecifier { /** When auto-titling, what to prefix all generated titles with (default: '') */ titlePrefix?: string; /** Where to start looking for story ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/composedStory.ts
code/core/src/types/modules/composedStory.ts
import type { Globals, ProjectAnnotations, Renderer, StoryContext, StoryId, StrictArgTypes, Tag, } from 'storybook/internal/csf'; import type { ReporterAPI } from '../../preview-api'; import type { AnnotatedStoryFn, Args, ComponentAnnotations, Parameters, StoryAnnotations, StoryAnnotationsOrF...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/webpack.ts
code/core/src/types/modules/webpack.ts
export enum CoreWebpackCompiler { Babel = 'babel', SWC = 'swc', }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/api.ts
code/core/src/types/modules/api.ts
import type { ReactElement } from 'react'; import type { Channel } from '../../channels'; import type { State } from '../../manager-api'; import type { RenderData } from '../../router/types'; import type { ThemeVars } from '../../theming/types'; import type { Addon_RenderOptions } from './addons'; import type { API_Fi...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/languages.ts
code/core/src/types/modules/languages.ts
export enum SupportedLanguage { JAVASCRIPT = 'javascript', TYPESCRIPT = 'typescript', }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/test-provider.ts
code/core/src/types/modules/test-provider.ts
export type { TestProviderId, TestProviderState, TestProviderStateByProviderId, TestProviderStoreById, UseTestProviderStore, } from '../../shared/test-provider-store';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/frameworks.ts
code/core/src/types/modules/frameworks.ts
// auto generated file, do not edit export enum SupportedFramework { // CORE ANGULAR = 'angular', EMBER = 'ember', HTML_VITE = 'html-vite', NEXTJS = 'nextjs', NEXTJS_VITE = 'nextjs-vite', PREACT_VITE = 'preact-vite', REACT_NATIVE_WEB_VITE = 'react-native-web-vite', REACT_VITE = 'react-vite', REACT_W...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/api-stories.ts
code/core/src/types/modules/api-stories.ts
import type { StatusByTypeId } from '../../../dist/types'; import type { DocsOptions } from './core-common'; import type { ArgTypes, Args, ComponentTitle, Parameters, Path, StoryId, Tag } from './csf'; import type { IndexEntry } from './indexer'; export interface API_BaseEntry { id: StoryId; depth: number; name:...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/channelApi.ts
code/core/src/types/modules/channelApi.ts
import type { API_ViewMode } from './api'; import type { ArgTypes, Args, ComponentId, GlobalTypes, Globals, Parameters, StoryId, StoryKind, } from './csf'; // The data received on the (legacy) `setStories` event export interface SetStoriesStory { id: StoryId; name: string; refId?: string; compo...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/code/core/src/types/modules/status.ts
code/core/src/types/modules/status.ts
export type { Status, StatusValue, StatusTypeId, StatusByTypeId, StatusesByStoryIdAndTypeId, StatusStore, StatusStoreByTypeId, UseStatusStore, } from '../../shared/status-store';
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false