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/check-package.ts
scripts/check-package.ts
// This script makes sure that we can support type checking, // without having to build dts files for all packages in the monorepo. // It is not implemented yet for angular, svelte and vue. import { readFile } from 'node:fs/promises'; import { program } from 'commander'; // eslint-disable-next-line depend/ban-dependen...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/get-sandbox-dir.ts
scripts/get-sandbox-dir.ts
import { join } from 'node:path'; import { program } from 'commander'; import { SANDBOX_DIRECTORY } from './utils/constants'; import { esMain } from './utils/esmain'; type RunOptions = { template?: string; }; // Get sandbox directory from template name // replace '/' by a '-' async function run({ template }: RunO...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/get-template.ts
scripts/get-template.ts
import { readFile, writeFile } from 'node:fs/promises'; import { program } from 'commander'; import picocolors from 'picocolors'; import { dedent } from 'ts-dedent'; import yaml from 'yaml'; import { type Cadence, type SkippableTask, type Template as TTemplate, allTemplates, templatesByCadence, } from '../c...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/strict-ts.ts
scripts/strict-ts.ts
import { existsSync, readFileSync } from 'node:fs'; import { dirname, join } from 'node:path'; // eslint-disable-next-line depend/ban-dependencies import glob from 'fast-glob'; import JSON5 from 'json5'; const files = glob.sync('**/*/tsconfig.json', { absolute: true, cwd: '..', }); (async function main() { con...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/get-report-message.ts
scripts/get-report-message.ts
import { readFile } from 'node:fs/promises'; // eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; import { join } from 'path'; import { CODE_DIRECTORY } from './utils/constants'; import { esMain } from './utils/esmain'; type Branch = 'main' | 'next' | 'alpha' | 'next-release' | '...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/npm-auth.ts
scripts/npm-auth.ts
import { writeFileSync } from 'node:fs'; import process from 'node:process'; // @ts-expect-error no types! import npmpkg from 'npm-registry-client'; type AuthOptions = { username: string; password: string; email: string; registry: string; }; /** * Authenticates to the npm registry and writes a .npmrc to the...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/sync-docs.ts
scripts/tasks/sync-docs.ts
import { closeSync, copyFile, cpSync, existsSync, mkdirSync, openSync, rmSync, unlinkSync, watch, } from 'node:fs'; import { join } from 'node:path'; import type { Task } from '../task'; import { ask } from '../utils/ask'; const logger = console; export const syncDocs: Task = { description: 'Sync...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/chromatic.ts
scripts/tasks/chromatic.ts
import type { Task } from '../task'; import { exec } from '../utils/exec'; export const chromatic: Task = { description: 'Run Chromatic against the sandbox', dependsOn: ['build'], junit: true, async ready() { return false; }, async run({ key, sandboxDir, builtSandboxDir, junitFilename }, { dryRun, debu...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/e2e-tests-build.ts
scripts/tasks/e2e-tests-build.ts
import { dedent } from 'ts-dedent'; import waitOn from 'wait-on'; import { getPort } from '../sandbox/utils/getPort'; import type { Task } from '../task'; import { exec } from '../utils/exec'; import { PORT } from './serve'; const testFileRegex = /(test|spec)\.(js|ts|mjs)$/; export const e2eTestsBuild: Task & { port...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/run-registry.ts
scripts/tasks/run-registry.ts
import waitOn from 'wait-on'; import type { Task } from '../task'; import { CODE_DIRECTORY } from '../utils/constants'; import { exec } from '../utils/exec'; import { isPortUsed } from '../utils/port'; const REGISTRY_PORT = 6001; const VERDACCIO_PORT = 6002; export async function runRegistry({ dryRun, debug }: { dry...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/publish.ts
scripts/tasks/publish.ts
import { access } from 'node:fs/promises'; import { resolve } from 'path'; import type { Task } from '../task'; import { exec } from '../utils/exec'; const verdaccioCacheDir = resolve(__dirname, '../../.verdaccio-cache'); const pathExists = async (path: string) => { try { await access(path); return true; ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/bench.ts
scripts/tasks/bench.ts
import prettyBytes from 'pretty-bytes'; import prettyTime from 'pretty-ms'; import type { Task } from '../task'; import { dev, PORT as devPort } from './dev'; import { serve, PORT as servePort } from './serve'; const logger = console; export const bench: Task = { description: 'Run benchmarks against a sandbox in d...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/install.ts
scripts/tasks/install.ts
import { access } from 'node:fs/promises'; import { join } from 'path'; import type { Task } from '../task'; import { checkDependencies } from '../utils/cli-utils'; import { ROOT_DIRECTORY } from '../utils/constants'; const pathExists = async (path: string) => { try { await access(path); return true; } c...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/test-runner-dev.ts
scripts/tasks/test-runner-dev.ts
import { PORT } from './dev'; import { testRunnerBuild as testRunnerProd } from './test-runner-build'; export const testRunnerDev: typeof testRunnerProd = { ...testRunnerProd, port: PORT, description: 'Run the test runner against a sandbox in dev mode', dependsOn: ['dev'], };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/build.ts
scripts/tasks/build.ts
import { access, cp, rm } from 'node:fs/promises'; import { join } from 'node:path'; import { promisify } from 'node:util'; import dirSize from 'fast-folder-size'; import { now, saveBench } from '../bench/utils'; import type { Task } from '../task'; import { ROOT_DIRECTORY } from '../utils/constants'; import { exec }...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/sandbox-parts.ts
scripts/tasks/sandbox-parts.ts
// This file requires many imports from `../code`, which requires both an install and bootstrap of // the repo to work properly. So we load it async in the task runner *after* those steps. import { existsSync } from 'node:fs'; import { access, cp, lstat, mkdir, readFile, symlink, writeFile } from 'node:fs/promises'; im...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
true
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/dev.ts
scripts/tasks/dev.ts
import detectFreePort from 'detect-port'; import waitOn from 'wait-on'; import { now, saveBench } from '../bench/utils'; import type { TemplateKey } from '../get-template'; import { getPort } from '../sandbox/utils/getPort'; import type { Task } from '../task'; import { exec } from '../utils/exec'; export const PORT ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/e2e-tests-dev.ts
scripts/tasks/e2e-tests-dev.ts
import { PORT } from './dev'; import { e2eTestsBuild } from './e2e-tests-build'; export const e2eTestsDev: typeof e2eTestsBuild = { ...e2eTestsBuild, description: 'Run e2e tests against a sandbox in dev mode', dependsOn: ['dev'], port: PORT, type: 'dev', };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/test-runner-build.ts
scripts/tasks/test-runner-build.ts
import waitOn from 'wait-on'; import { getPort } from '../sandbox/utils/getPort'; import type { Task } from '../task'; import { exec } from '../utils/exec'; import { PORT } from './serve'; export const testRunnerBuild: Task & { port: number } = { description: 'Run the test runner against a built sandbox', junit: ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/compile.ts
scripts/tasks/compile.ts
import { readFile, rm } from 'node:fs/promises'; import { join, resolve } from 'node:path'; import type { Task } from '../task'; import { ROOT_DIRECTORY } from '../utils/constants'; import { exec } from '../utils/exec'; import { maxConcurrentTasks } from '../utils/maxConcurrentTasks'; // The amount of VCPUs for the c...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/check-sandbox.ts
scripts/tasks/check-sandbox.ts
import type { Task } from '../task'; import { exec } from '../utils/exec'; export const checkSandbox: Task = { description: 'Typecheck a sandbox', dependsOn: ['sandbox'], async ready() { return false; }, async run({ sandboxDir }, { dryRun, debug }) { await exec(`yarn typecheck`, { cwd: sandboxDir }, ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/vitest-test.ts
scripts/tasks/vitest-test.ts
import type { Task } from '../task'; import { exec } from '../utils/exec'; export const vitestTests: Task = { description: 'Run the Vitest tests of a sandbox', dependsOn: ['sandbox'], async ready() { return false; }, async run({ sandboxDir }, { dryRun, debug }) { console.log(`running Vitest tests in ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/smoke-test.ts
scripts/tasks/smoke-test.ts
import type { Task } from '../task'; import { exec } from '../utils/exec'; export const smokeTest: Task = { description: 'Run the smoke tests of a sandbox', dependsOn: ['sandbox'], async ready() { return false; }, async run({ sandboxDir }, { dryRun, debug }) { console.log(`smoke testing in ${sandboxD...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/generate.ts
scripts/tasks/generate.ts
import { access, rm } from 'node:fs/promises'; import { join } from 'path'; import type { Task } from '../task'; import { REPROS_DIRECTORY } from '../utils/constants'; const logger = console; const pathExists = async (path: string) => { try { await access(path); return true; } catch { return false; ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/check.ts
scripts/tasks/check.ts
import type { Task } from '../task'; import { ROOT_DIRECTORY } from '../utils/constants'; import { exec } from '../utils/exec'; import { maxConcurrentTasks } from '../utils/maxConcurrentTasks'; // The amount of VCPUs for the check task on CI is 4 (large resource) const amountOfVCPUs = 4; const parallel = `--parallel=...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/serve.ts
scripts/tasks/serve.ts
import detectFreePort from 'detect-port'; import waitOn from 'wait-on'; import type { TemplateKey } from '../get-template'; import { getPort } from '../sandbox/utils/getPort'; import { type Task } from '../task'; import { ROOT_DIRECTORY } from '../utils/constants'; import { exec } from '../utils/exec'; export const P...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/tasks/sandbox.ts
scripts/tasks/sandbox.ts
import { access, cp, rm } from 'node:fs/promises'; import path, { join } from 'node:path'; import { promisify } from 'node:util'; import dirSize from 'fast-folder-size'; import { now, saveBench } from '../bench/utils'; import type { Task, TaskKey } from '../task'; import { ROOT_DIRECTORY } from '../utils/constants'; ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/get-changelog-from-file.ts
scripts/release/get-changelog-from-file.ts
import { readFile } from 'node:fs/promises'; import { join } from 'node:path'; import { setOutput } from '@actions/core'; import { program } from 'commander'; import picocolors from 'picocolors'; import semver from 'semver'; import { dedent } from 'ts-dedent'; import { esMain } from '../utils/esmain'; import { getCur...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/get-current-version.ts
scripts/release/get-current-version.ts
import { readFile } from 'node:fs/promises'; import { join } from 'node:path'; import { setOutput } from '@actions/core'; import picocolors from 'picocolors'; import { esMain } from '../utils/esmain'; const CODE_DIR_PATH = join(__dirname, '..', '..', 'code'); const CODE_PACKAGE_JSON_PATH = join(CODE_DIR_PATH, 'packa...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/pick-patches.ts
scripts/release/pick-patches.ts
import { setOutput } from '@actions/core'; import { program } from 'commander'; // eslint-disable-next-line depend/ban-dependencies import ora from 'ora'; import picocolors from 'picocolors'; import invariant from 'tiny-invariant'; import { esMain } from '../utils/esmain'; import { git } from './utils/git-client'; imp...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/get-version-changelog.ts
scripts/release/get-version-changelog.ts
import { setOutput } from '@actions/core'; import { program } from 'commander'; import picocolors from 'picocolors'; import { esMain } from '../utils/esmain'; import { getCurrentVersion } from './get-current-version'; import { getChanges } from './utils/get-changes'; program .name('get-version-changelog') .descri...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/cancel-preparation-runs.ts
scripts/release/cancel-preparation-runs.ts
/** * This script cancels all running preparation workflows in GitHub. It will fetch all active runs * for the preparation workflows, and cancel them. */ import { program } from 'commander'; import picocolors from 'picocolors'; import { dedent } from 'ts-dedent'; import { esMain } from '../utils/esmain'; import { g...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/unreleased-changes-exists.ts
scripts/release/unreleased-changes-exists.ts
import { setOutput } from '@actions/core'; import { program } from 'commander'; import { intersection } from 'es-toolkit/array'; import picocolors from 'picocolors'; import { z } from 'zod'; import { esMain } from '../utils/esmain'; import { getCurrentVersion } from './get-current-version'; import type { Change } from...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/publish.ts
scripts/release/publish.ts
import { readFile } from 'node:fs/promises'; import { join } from 'node:path'; import { program } from 'commander'; // eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; import pRetry from 'p-retry'; import picocolors from 'picocolors'; import semver from 'semver'; import { dedent }...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/is-pr-frozen.ts
scripts/release/is-pr-frozen.ts
import { readFile } from 'node:fs/promises'; import { join } from 'node:path'; import { setOutput } from '@actions/core'; import { program } from 'commander'; import picocolors from 'picocolors'; import { esMain } from '../utils/esmain'; import { getPullInfoFromCommit } from './utils/get-github-info'; import { git } ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/is-version-published.ts
scripts/release/is-version-published.ts
import { setOutput } from '@actions/core'; import { program } from 'commander'; import picocolors from 'picocolors'; import { esMain } from '../utils/esmain'; import { getCurrentVersion } from './get-current-version'; program .name('is-prerelease [version]') .description('returns true if the current version is a ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/version.ts
scripts/release/version.ts
import { readFile, writeFile } from 'node:fs/promises'; import { join } from 'node:path'; import { setOutput } from '@actions/core'; import { program } from 'commander'; // eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; import picocolors from 'picocolors'; import semver from 'se...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/write-changelog.ts
scripts/release/write-changelog.ts
import { readFile, writeFile } from 'node:fs/promises'; import { join } from 'node:path'; import { program } from 'commander'; import picocolors from 'picocolors'; import semver from 'semver'; import { z } from 'zod'; import { esMain } from '../utils/esmain'; import { getChanges } from './utils/get-changes'; program...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/is-prerelease.ts
scripts/release/is-prerelease.ts
import { setOutput } from '@actions/core'; import { program } from 'commander'; import picocolors from 'picocolors'; import semver from 'semver'; import { esMain } from '../utils/esmain'; import { getCurrentVersion } from './get-current-version'; program .name('is-prerelease') .description( 'returns true if t...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/generate-pr-description.ts
scripts/release/generate-pr-description.ts
import { setOutput } from '@actions/core'; import { program } from 'commander'; import picocolors from 'picocolors'; import semver from 'semver'; import { dedent } from 'ts-dedent'; import { z } from 'zod'; import { esMain } from '../utils/esmain'; import { getCurrentVersion } from './get-current-version'; import type...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/label-patches.ts
scripts/release/label-patches.ts
import { program } from 'commander'; // eslint-disable-next-line depend/ban-dependencies import ora from 'ora'; import { v4 as uuidv4 } from 'uuid'; import { esMain } from '../utils/esmain'; import { getPullInfoFromCommits, getRepo } from './utils/get-changes'; import { getLatestTag, git } from './utils/git-client'; i...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/utils/git-client.ts
scripts/release/utils/git-client.ts
import { simpleGit } from 'simple-git'; export const git = simpleGit({ config: [ /** * Ensures that prereleases are listed as earlier than stable releases. WITHOUT the config, this * is the list of tags: v7.1.0-rc.2 v7.1.0-rc.1 v7.1.0-rc.0 v7.1.0-beta.3 ... v7.1.0 v7.0.2 * * WITH the config, ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/utils/get-changes.ts
scripts/release/utils/get-changes.ts
import picocolors from 'picocolors'; import semver from 'semver'; import type { PullRequestInfo } from './get-github-info'; import { getPullInfoFromCommit } from './get-github-info'; import { getLatestTag, git } from './git-client'; import { getUnpickedPRs } from './github-client'; export const RELEASED_LABELS = { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/utils/github-client.ts
scripts/release/utils/github-client.ts
import type { GraphQlQueryResponseData } from '@octokit/graphql'; import { graphql } from '@octokit/graphql'; import { request } from '@octokit/request'; export interface PullRequest { number: number; id: string; branch: string; title: string; mergeCommit: string; } export const githubGraphQlClient = graphq...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/utils/get-github-info.ts
scripts/release/utils/get-github-info.ts
/** * This file is soft-forked from @changesets/get-github-info * https://github.com/changesets/changesets/tree/main/packages/get-github-info * * The only modification is that it also returns the PR title and labels */ import DataLoader from 'dataloader'; const validRepoNameRegex = /^[\w.-]+\/[\w.-]+$/; type Req...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/utils/__mocks__/get-github-info.ts
scripts/release/utils/__mocks__/get-github-info.ts
import { vi } from 'vitest'; export const getPullInfoFromCommit = vi.fn(); export const getPullInfoFromPullRequest = vi.fn();
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/__tests__/version.test.ts
scripts/release/__tests__/version.test.ts
import * as fspImp from 'node:fs/promises'; import { join } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; // eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; import type * as MockedFSPToExtra from '../../../code/__mocks__/fs/promises'; import { run as vers...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/__tests__/write-changelog.test.ts
scripts/release/__tests__/write-changelog.test.ts
import * as fspImp from 'node:fs/promises'; import { join } from 'node:path'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { dedent } from 'ts-dedent'; import type * as MockedFSPToExtra from '../../../code/__mocks__/fs/promises'; import * as changesUtils_ from '../utils/get-changes'; import ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/__tests__/is-pr-frozen.test.ts
scripts/release/__tests__/is-pr-frozen.test.ts
import * as fspImp from 'node:fs/promises'; import { join } from 'node:path'; import { describe, expect, it, vi } from 'vitest'; import * as simpleGitImp from 'simple-git'; import type * as MockedFSPExtra from '../../../code/__mocks__/fs/promises'; import type * as MockedSimpleGit from '../../__mocks__/simple-git'; ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/__tests__/generate-pr-description.test.ts
scripts/release/__tests__/generate-pr-description.test.ts
import { describe, expect, it } from 'vitest'; import { generateNonReleaseDescription, generateReleaseDescription, mapCherryPicksToTodo, mapToChangelist, } from '../generate-pr-description'; import type { Change } from '../utils/get-changes'; describe('Generate PR Description', () => { const changes: Change...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/__tests__/cancel-preparation-runs.test.ts
scripts/release/__tests__/cancel-preparation-runs.test.ts
import { beforeEach, describe, expect, it, vi } from 'vitest'; import { PREPARE_NON_PATCH_WORKFLOW_PATH, PREPARE_PATCH_WORKFLOW_PATH, run as cancelPreparationWorkflows, } from '../cancel-preparation-runs'; import * as github_ from '../utils/github-client'; vi.mock('../utils/github-client'); const github = vi.m...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/release/__tests__/label-patches.test.ts
scripts/release/__tests__/label-patches.test.ts
import { beforeEach, expect, it, vi } from 'vitest'; import ansiRegex from 'ansi-regex'; import type { LogResult } from 'simple-git'; import { run } from '../label-patches'; import * as githubInfo_ from '../utils/get-github-info'; import * as gitClient_ from '../utils/git-client'; import * as github_ from '../utils/g...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/bench/safe-args.ts
scripts/bench/safe-args.ts
const METAFILES_DIR = 'bench/esbuild-metafiles'; // allows the metafile path to be used in the URL hash export const safeMetafileArg = (path: string) => path .replace(new RegExp(`.*${METAFILES_DIR}/`), '') .replaceAll('/', '__') .replace(/(\w*).json/, '$1');
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/bench/browse.ts
scripts/bench/browse.ts
import { chromium } from 'playwright'; import { getPreviewPage, now } from './utils'; interface Result { managerHeaderVisible?: number; managerIndexVisible?: number; storyVisible?: number; storyVisibleUncached?: number; autodocsVisible?: number; mdxVisible?: number; } export const browse = async (url: st...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/bench/utils.ts
scripts/bench/utils.ts
/// <reference lib="dom" /> import { mkdir, readFile, readdir, writeFile } from 'node:fs/promises'; import { join } from 'path'; import type { Page } from 'playwright-core'; import type { BenchResults } from './types'; export const now = () => new Date().getTime(); export interface SaveBenchOptions { rootDir?: st...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/bench/types.ts
scripts/bench/types.ts
// NOTE: this must be kept in sync with ./bench.schema, which defines // the table schema in BigQuery export interface BenchResults { branch: string; commit: string; timestamp: string; label: string; /** The time it takes to create the base sandbox without storybook */ createTime: number; /** The time it...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/bench/bench-packages.ts
scripts/bench/bench-packages.ts
import path from 'node:path'; import { BigQuery } from '@google-cloud/bigquery'; import { InvalidArgumentError, program } from 'commander'; import detectFreePort from 'detect-port'; import { mkdir, readdir, rm, stat, writeFile } from 'fs/promises'; import pLimit from 'p-limit'; import picocolors from 'picocolors'; imp...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/snippets/codemod.ts
scripts/snippets/codemod.ts
/** * DISCLAIMER: * * This file exists with the sole purpose of assisting the documentation snippets during * introduction of new features. This will probably used only once or twice, but it's REALLY useful * to test codemods as it helps detect many bugs very quickly. It also will be used once we decide * to add ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/maxConcurrentTasks.ts
scripts/utils/maxConcurrentTasks.ts
import { cpus } from 'node:os'; /** * The maximum number of concurrent tasks we want to have on some CLI and CI tasks. The amount of * CPUS minus one, arbitrary limited to 15 to not overload CI executors. * * @type {number} */ export const maxConcurrentTasks = Math.min(Math.max(1, cpus().length - 1), 15);
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/yarn.ts
scripts/utils/yarn.ts
import { access, mkdir, readFile, rm, writeFile } from 'node:fs/promises'; import { join } from 'node:path'; // TODO -- should we generate this file a second time outside of CLI? import storybookVersions from '../../code/core/src/common/versions'; import type { TemplateKey } from '../get-template'; import { exec } fro...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/filterExistsInCodeDir.ts
scripts/utils/filterExistsInCodeDir.ts
import { access } from 'node:fs/promises'; import { join, resolve } from 'node:path'; import { CODE_DIRECTORY } from './constants'; const pathExists = async (path: string) => { try { await access(path); return true; } catch { return false; } }; // packageDirs of the form `lib/preview-api` // paths ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/cli-step.ts
scripts/utils/cli-step.ts
import { createRequire } from 'module'; import { exec } from './exec'; import type { OptionSpecifier, OptionValues } from './options'; import { createOptions, getCommand } from './options'; const require = createRequire(import.meta.url); const cliExecutable = require.resolve('../../code/core/dist/bin/dispatcher.js');...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/touch.ts
scripts/utils/touch.ts
const isWin = process.platform === 'win32'; export default function touch(filePath: string) { if (isWin) { return `echo. > ${filePath}`; } return `touch ${filePath}`; }
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/concurrency.ts
scripts/utils/concurrency.ts
import os from 'node:os'; /** * The maximum number of concurrent tasks we want to have on some CLI and CI tasks. The amount of * CPUS minus one, arbitrary limited to 5 to not overload CI executors. */ export const maxConcurrentTasks = Math.min( Math.max(1, os.cpus().length - 1), process.env.CI ? 5 : 15 );
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/tools-esm.ts
scripts/utils/tools-esm.ts
import * as prettier from 'prettier'; export { prettier };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/tools.ts
scripts/utils/tools.ts
import { access, readFile, writeFile } from 'node:fs/promises'; import { dirname, join } from 'node:path'; import * as process from 'node:process'; import { globalExternals } from '@fal-works/esbuild-plugin-global-externals'; import { spawn } from 'cross-spawn'; import * as esbuild from 'esbuild'; // eslint-disable-ne...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/ask.ts
scripts/utils/ask.ts
import readline from 'readline'; export const ask = (query: string) => { const rl = readline.createInterface({ input: process.stdin, output: process.stdout, }); return new Promise<string>((resolve) => rl.question(`${query}\n`, (ans) => { rl.close(); resolve(ans); }) ); };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/command.ts
scripts/utils/command.ts
import { sync as spawnSync } from 'cross-spawn'; type ExecOptions = Parameters<typeof spawnSync>[2]; export const exec = async (command: string, options: ExecOptions = {}) => new Promise((resolve, reject) => { const x = spawnSync(command, options); if (x.status === 0) { resolve(undefined); } else ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/diff.ts
scripts/utils/diff.ts
import { diff } from 'diff-match-patch-es'; function matchTextScore(text: string, pattern: string) { const result = diff(text, pattern); if (!result.length) { return 0; } return result.reduce((pre, cur) => { const [matchIndex, matchText] = cur; if (matchIndex === 0) { return pre + matchTex...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/options.ts
scripts/utils/options.ts
/** Use commander and prompts to gather a list of options for a script */ import { type Command, type Option as CommanderOption, program } from 'commander'; import { kebabCase } from 'es-toolkit/string'; import picocolors from 'picocolors'; import prompts from 'prompts'; import type { Falsy, PrevCaller, PromptObject, P...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/cli-utils.ts
scripts/utils/cli-utils.ts
import { spawn } from 'child_process'; import { existsSync } from 'fs'; import { join } from 'path'; import { ROOT_DIRECTORY } from './constants'; const logger = console; export const checkDependencies = async () => { if (!existsSync(join(ROOT_DIRECTORY, 'node_modules'))) { logger.log('installing dependencies'...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/paths.ts
scripts/utils/paths.ts
import { access } from 'node:fs/promises'; import { join } from 'path'; const pathExists = async (path: string) => { try { await access(path); return true; } catch { return false; } }; export async function findFirstPath(paths: string[], { cwd }: { cwd: string }) { for (const filePath of paths) {...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/githubClient.ts
scripts/utils/githubClient.ts
const GITHUB_API = 'https://api.github.com/graphql'; export const githubClient = (apiKey: string) => { return async (query: string, variables?: { [key: string]: any }) => { const res = await fetch(GITHUB_API, { method: 'POST', headers: { authorization: `token ${apiKey}`, }, body: ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/main-js.ts
scripts/utils/main-js.ts
import { existsSync } from 'fs'; import { join, resolve } from 'path'; // eslint-disable-next-line depend/ban-dependencies import slash from 'slash'; import { getInterpretedFile } from '../../code/core/src/common/utils/interpret-files'; import type { ConfigFile } from '../../code/core/src/csf-tools'; import { readConf...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/workspace.ts
scripts/utils/workspace.ts
// eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; import memoize from 'memoizerific'; import { ROOT_DIRECTORY } from './constants'; export type Workspace = { name: string; location: string }; /** * Get the list of workspaces in the monorepo, excluding the scripts and code pac...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/constants.ts
scripts/utils/constants.ts
import path from 'node:path'; import { join } from 'path'; export const AFTER_DIR_NAME = 'after-storybook'; export const BEFORE_DIR_NAME = 'before-storybook'; export const ROOT_DIRECTORY = join(__dirname, '..', '..'); export const CODE_DIRECTORY = join(ROOT_DIRECTORY, 'code'); export const SNIPPETS_DIRECTORY = join(...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/port.ts
scripts/utils/port.ts
import detectFreePort from 'detect-port'; import killProcessOnPort from 'kill-port'; export const isPortUsed = async (port: number) => (await detectFreePort(port)) !== port; export const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); export const killPort = async (port: number) => { if (...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/options.test.ts
scripts/utils/options.test.ts
import { describe, expect, it } from 'vitest'; import { createCommand } from 'commander'; import { areOptionsSatisfied, createOptions, getCommand, getOptions } from './options'; const allOptions = createOptions({ first: { type: 'boolean', description: 'first', }, second: { type: 'boolean', desc...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/esmain.ts
scripts/utils/esmain.ts
import { createRequire } from 'node:module'; import { extname } from 'node:path'; import process from 'node:process'; import { fileURLToPath } from 'node:url'; /** * Strip the extension from a filename if it has one. * * @param {string} name A filename. * @returns {string} The filename without a path. */ export f...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/exec.ts
scripts/utils/exec.ts
// eslint-disable-next-line depend/ban-dependencies import { type Options, type ResultPromise, execa } from 'execa'; import picocolors from 'picocolors'; const logger = console; type StepOptions = { startMessage?: string; errorMessage?: string; dryRun?: boolean; debug?: boolean; signal?: AbortSignal; }; ex...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/utils/package-json.ts
scripts/utils/package-json.ts
import { readFile, writeFile } from 'node:fs/promises'; import { join } from 'path'; export async function updatePackageScripts({ cwd, prefix }: { cwd: string; prefix: string }) { const packageJsonPath = join(cwd, 'package.json'); const content = await readFile(packageJsonPath, 'utf-8'); const packageJson = JSO...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/build/entry-configs.ts
scripts/build/entry-configs.ts
// @ts-ignore import a11yConfig from '../../../code/addons/a11y/build-config'; // @ts-ignore import docsConfig from '../../../code/addons/docs/build-config'; // @ts-ignore import linksConfig from '../../../code/addons/links/build-config'; // @ts-ignore import onboardingConfig from '../../../code/addons/onboarding/build...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/build/build-package.ts
scripts/build/build-package.ts
/** * This is the entrypoint to compile a singular package: * * This is not run directly, but rather through the `nr task compile` or `nr build <package-name>` * commands. * * It is used to compile a package, and generate the dist files, type mappers, and types files. * * The `process.cwd()` is the root of the ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/build/utils/generate-bundle.ts
scripts/build/utils/generate-bundle.ts
/* eslint-disable local-rules/no-uncategorized-errors */ import { existsSync, watch } from 'node:fs'; import { mkdir, rm, writeFile } from 'node:fs/promises'; import { globalExternals } from '@fal-works/esbuild-plugin-global-externals'; import * as esbuild from 'esbuild'; import { basename, join, relative } from 'path...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/build/utils/dts-process.ts
scripts/build/utils/dts-process.ts
import { writeFile } from 'node:fs/promises'; import { dirname, join, sep } from 'node:path'; import { rollup } from 'rollup'; import { dts } from 'rollup-plugin-dts'; import { JsxEmit, ScriptTarget } from 'typescript'; import { getExternal } from './entry-utils'; async function run() { const [entryPoint] = proces...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/build/utils/generate-types.ts
scripts/build/utils/generate-types.ts
import { spawn } from 'child_process'; import limit from 'p-limit'; import { join, relative } from 'pathe'; import picocolors from 'picocolors'; import { ROOT_DIRECTORY } from '../../utils/constants'; import type { BuildEntries } from './entry-utils'; const DIR_CODE = join(import.meta.dirname, '..', '..', '..', 'code...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/build/utils/generate-package-json.ts
scripts/build/utils/generate-package-json.ts
import { readFile, writeFile } from 'node:fs/promises'; import { join } from 'pathe'; import sortPackageJson from 'sort-package-json'; import type { BuildEntries } from './entry-utils'; export async function generatePackageJsonFile(cwd: string, data: BuildEntries) { const location = join(cwd, 'package.json'); co...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/build/utils/generate-type-mappers.ts
scripts/build/utils/generate-type-mappers.ts
import { existsSync } from 'node:fs'; import { mkdir, writeFile } from 'node:fs/promises'; import { dirname, join, relative, sep } from 'node:path'; import { dedent } from 'ts-dedent'; import type { BuildEntries } from './entry-utils'; async function generateTypesMapperContent(filePath: string, cwd: string) { cons...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/build/utils/entry-utils.ts
scripts/build/utils/entry-utils.ts
import { builtinModules } from 'node:module'; import { join } from 'node:path'; import { pathToFileURL } from 'node:url'; import * as esbuild from 'esbuild'; export type EntryType = 'node' | 'browser' | 'runtime' | 'globalizedRuntime'; export type BuildEntry = { exportEntries?: ('.' | `./${string}`)[]; // the keys...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/check/check-package.ts
scripts/check/check-package.ts
import { isAbsolute } from 'node:path'; import { parseArgs } from 'node:util'; import { join } from 'pathe'; import { ROOT_DIRECTORY } from '../utils/constants'; import { getTSDiagnostics, getTSFilesAndConfig, getTSProgramAndHost } from './utils/typescript'; const { values: { cwd }, } = parseArgs({ options: { ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/check/utils/typescript.ts
scripts/check/utils/typescript.ts
import { join } from 'node:path'; import typescript from 'typescript'; export function getTSDiagnostics( program: typescript.Program, cwd: string, host: typescript.CompilerHost ): any { return typescript.formatDiagnosticsWithColorAndContext( typescript.getPreEmitDiagnostics(program).filter((d) => d.file?....
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/ecosystem-ci/existing-resolutions.test.ts
scripts/ecosystem-ci/existing-resolutions.test.ts
import { describe, expect, it } from 'vitest'; import rootPkgJson from '../../package.json'; import { EXISTING_RESOLUTIONS } from './existing-resolutions'; /* If this test is failing for you, it means that you have changed the list of resolutions in the root package.json, but you have not updated the EXISTING_RESOLUT...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/sandbox/publish.ts
scripts/sandbox/publish.ts
import { cp, mkdir, readdir, rm, writeFile } from 'node:fs/promises'; import { program } from 'commander'; // eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; import { existsSync } from 'fs'; // eslint-disable-next-line depend/ban-dependencies import { glob } from 'glob'; import {...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/sandbox/generate.ts
scripts/sandbox/generate.ts
import { cp, mkdir, readdir, rename, rm, writeFile } from 'node:fs/promises'; import { readFile } from 'node:fs/promises'; import { join, relative } from 'node:path'; import * as ghActions from '@actions/core'; import { program } from 'commander'; // eslint-disable-next-line depend/ban-dependencies import type { Optio...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/sandbox/utils/yarn.ts
scripts/sandbox/utils/yarn.ts
import { rename, rm, writeFile } from 'node:fs/promises'; import { join } from 'path'; import { runCommand } from '../generate'; interface SetupYarnOptions { cwd: string; // TODO: Evaluate if this is correct after removing pnp compatibility code in SB11 pnp?: boolean; version?: 'berry' | 'classic'; } export...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/sandbox/utils/git.ts
scripts/sandbox/utils/git.ts
// eslint-disable-next-line depend/ban-dependencies import { execaCommand } from 'execa'; import invariant from 'tiny-invariant'; import { version as storybookVersion } from '../../../code/package.json'; import { logger } from '../publish'; const getTheLastCommitHashThatUpdatedTheSandboxRepo = async (branch: string) ...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/sandbox/utils/getPort.ts
scripts/sandbox/utils/getPort.ts
import { allTemplates } from '../../../code/lib/cli-storybook/src/sandbox-templates'; import { type TemplateDetails, tasks } from '../../task'; export function getPort(template: Pick<TemplateDetails, 'key' | 'selectedTask'>) { const templateIndex = Object.values(allTemplates).indexOf(allTemplates[template.key]); c...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/sandbox/utils/template.ts
scripts/sandbox/utils/template.ts
import { readFile } from 'node:fs/promises'; import { render } from 'ejs'; import prettier from 'prettier'; import { allTemplates as sandboxTemplates } from '../../../code/lib/cli-storybook/src/sandbox-templates'; import type { GeneratorConfig } from './types'; export async function renderTemplate(templatePath: stri...
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/sandbox/utils/types.ts
scripts/sandbox/utils/types.ts
export type GeneratorConfig = { name: string; script: string; expected: { framework: string; renderer: string; builder: string; }; env?: Record<string, unknown>; };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false
storybookjs/storybook
https://github.com/storybookjs/storybook/blob/7f193d38eec36246a211339c1f352cca246de779/scripts/__mocks__/uuid.ts
scripts/__mocks__/uuid.ts
import { v5 } from 'uuid'; let seed = 0; export const v4 = () => { seed += 1; return v5(seed.toString(), '6c7fda6d-f92f-4bd2-9d4d-da26a59196a6'); };
typescript
MIT
7f193d38eec36246a211339c1f352cca246de779
2026-01-04T15:25:31.846427Z
false