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
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/routes.ts
packages/server/lib/routes.ts
import httpProxy from 'http-proxy' import Debug from 'debug' import { ErrorRequestHandler, Request, Router } from 'express' import send from 'send' import { getPathToDist } from '@packages/resolve-dist' import { domainPropsToHostname } from '@packages/network-tools' import type { NetworkProxy } from '@packages/proxy' i...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/open_project.ts
packages/server/lib/open_project.ts
import _ from 'lodash' import la from 'lazy-ass' import Debug from 'debug' import Bluebird from 'bluebird' import assert from 'assert' import { ProjectBase } from './project-base' import browsers from './browsers' import * as errors from './errors' import preprocessor from './plugins/preprocessor' import runEvents fro...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/project_utils.ts
packages/server/lib/project_utils.ts
import Debug from 'debug' import path from 'path' import { escapeFilenameInUrl } from './util/escape_filename' const debug = Debug('cypress:server:project_utils') // format is: http://localhost:<port>/__/#/specs/runner?file=<relative_url> export const getSpecUrl = ({ spec, browserUrl, projectRoot, }: { browse...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/remote_states.ts
packages/server/lib/remote_states.ts
import { origin, getDomainNameFromParsedHost, parseUrlIntoHostProtocolDomainTldPort } from '@packages/network-tools' import Debug from 'debug' import _ from 'lodash' import type { DocumentDomainInjection, ParsedHostWithProtocolAndHost } from '@packages/network-tools' export const DEFAULT_DOMAIN_NAME = 'localhost' con...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/cache.ts
packages/server/lib/cache.ts
import _ from 'lodash' import Promise from 'bluebird' import { globalPubSub } from '@packages/data-context' import { fs } from './util/fs' import appData from './util/app_data' import { File as FileUtil } from './util/file' import type { Cache, CachedUser, Preferences, Cohort } from '@packages/types' interface Transac...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/environment.ts
packages/server/lib/environment.ts
import pkg from '@packages/root' import Bluebird from 'bluebird' export const configureLongStackTraces = (env: string | undefined) => { // never cut off stack traces Error.stackTraceLimit = Infinity Bluebird.config({ // uses cancellation for automation timeouts cancellation: true, // enable long sta...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/socket-e2e.ts
packages/server/lib/socket-e2e.ts
import Debug from 'debug' import preprocessor from './plugins/preprocessor' import { SocketBase } from './socket-base' import { fs } from './util/fs' import type { DestroyableHttpServer } from './util/server_destroy' import * as studio from './studio' import type { FoundSpec } from '@packages/types' const debug = Debu...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/socket-ct.ts
packages/server/lib/socket-ct.ts
import Debug from 'debug' import devServer from './plugins/dev-server' import { SocketBase } from './socket-base' import dfd from 'p-defer' import type { Socket } from '@packages/socket' import type { DestroyableHttpServer } from './util/server_destroy' import assert from 'assert' import type { Automation } from './aut...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/cohorts.ts
packages/server/lib/cohorts.ts
import { cache } from './cache' import type { Cohort } from '@packages/types' import debugModule from 'debug' const debug = debugModule('cypress:server:cohorts') export const get = async (): Promise<Record<string, Cohort>> => { debug('Get cohorts') return cache.getCohorts() } export const getByName = async (name...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/screenshots.ts
packages/server/lib/screenshots.ts
import _ from 'lodash' import Debug from 'debug' import mime from 'mime' import Promise from 'bluebird' import dataUriToBuffer from 'data-uri-to-buffer' import Jimp from 'jimp' import sizeOf from 'image-size' import colorString from 'color-string' import * as plugins from './plugins' import { fs, getPath } from './util...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/fixture.ts
packages/server/lib/fixture.ts
import path from 'path' import check from 'syntax-error' import debugModule from 'debug' import coffee from 'coffeescript' import jsonParseBetterErrors from 'json-parse-even-better-errors' import stripAnsi from 'strip-ansi' import * as errors from './errors' import { fs } from './util/fs' import glob from './util/glob'...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/capture.ts
packages/server/lib/capture.ts
const _write = process.stdout.write // @ts-expect-error - process.log is not defined in the type system const _log = process.log export const restore = function () { // restore to the originals process.stdout.write = _write // @ts-expect-error process.log = _log } export const stdout = function () { const l...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/exec.ts
packages/server/lib/exec.ts
import Promise from 'bluebird' import execa from 'execa' import shellEnv from 'shell-env' import _ from 'lodash' import debugModule from 'debug' const log = debugModule('cypress:server:exec') import * as utils from './util/shell' const pickMainProps = (val) => _.pick(val, ['stdout', 'stderr', 'exitCode']) const trimS...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/socket-base.ts
packages/server/lib/socket-base.ts
import Bluebird from 'bluebird' import Debug from 'debug' import EventEmitter from 'events' import _ from 'lodash' import { getCtx } from '@packages/data-context' import { handleGraphQLSocketRequest } from '@packages/data-context/graphql/makeGraphQLServer' import { onNetStubbingEvent } from '@packages/net-stubbing' imp...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/saved_state.ts
packages/server/lib/saved_state.ts
import _ from 'lodash' import path from 'path' import Debug from 'debug' import appData from './util/app_data' import { getCwd } from './cwd' import { File as FileUtil } from './util/file' import fsExtra from 'fs-extra' import { AllowedState, allowedKeys } from '@packages/types' import { globalPubSub } from '@packages/...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/override_require.ts
packages/server/lib/override_require.ts
const Module = require('module') export const overrideRequire = (requireOverride) => { const _load = Module._load Module._load = function (...args: any[]) { const pkg = args if (requireOverride) { const mockedDependency = requireOverride(pkg[0], _load) if (mockedDependency != null) { ...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/server-base.ts
packages/server/lib/server-base.ts
import Bluebird from 'bluebird' import compression from 'compression' import Debug from 'debug' import EventEmitter from 'events' import evilDns from 'evil-dns' import * as ensureUrl from './util/ensure-url' import express, { Express } from 'express' import http from 'http' import httpProxy from 'http-proxy' import _ f...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
true
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/experiments.ts
packages/server/lib/experiments.ts
import { get } from 'lodash' /** * Returns a single string with human-readable experiments. ``` const experimental = getExperimentsFromResolved(config.resolved) const enabledExperiments = _.pickBy(experimental, (experiment) => experiment.enabled) formatExperiments(enabledExperiments) // "componentsTesting=t...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/editors.ts
packages/server/lib/util/editors.ts
import _ from 'lodash' import Bluebird from 'bluebird' import debugModule from 'debug' import type { Editor, EditorsResult } from '@packages/types' import { getEnvEditors } from './env-editors' import * as shell from './shell' import * as savedState from '../saved_state' export const osFileSystemExplorer = { darwin...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/passthru_stream.ts
packages/server/lib/util/passthru_stream.ts
import type { Transform } from 'stream' const through = require('through') export function passthruStream (): Transform { return through(function (this: InternalStream, chunk) { this.queue(chunk) }) }
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/chromium_flags.ts
packages/server/lib/util/chromium_flags.ts
const disabledFeatures = [ // Uncomment to force the deprecation of unload events // 'DeprecateUnloadByUserAndOrigin', // Hide toolbar button that opens dialog for controlling media sessions. 'GlobalMediaControls', // Disables the Interest Feed Content Suggestions, // which is a feature that shows content...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/system.ts
packages/server/lib/util/system.ts
import os from 'os' import si from 'systeminformation' const getOsVersion = async () => { try { const osInfo = await si.osInfo() if (osInfo.distro && osInfo.release) { return `${osInfo.distro} - ${osInfo.release}` } return os.release() } catch (error) { return os.release() } } export...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/resourceTypeAndCredentialManager.ts
packages/server/lib/util/resourceTypeAndCredentialManager.ts
import md5 from 'md5' import Debug from 'debug' import type { RequestCredentialLevel } from '@packages/proxy' import type { ResourceType } from '@packages/net-stubbing' type AppliedCredentialByUrlAndResourceMap = Map<string, Array<{ resourceType: ResourceType credentialStatus: RequestCredentialLevel }>> const deb...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/obj_utils.ts
packages/server/lib/util/obj_utils.ts
import _ from 'lodash' const traverse = (obj, mapObj, parent?, key?) => { if (_.isFunction(mapObj)) { mapObj(parent, key, obj) return } if (_.isObject(mapObj)) { _.each(mapObj, (mapVal, mapKey) => { traverse(obj[mapKey], mapVal, obj, mapKey) }) } } export const remapKeys = (fromObj, to...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/process_profiler.ts
packages/server/lib/util/process_profiler.ts
import Debug from 'debug' import la from 'lazy-ass' import _ from 'lodash' import si from 'systeminformation' import { concatStream } from '@packages/network' const browsers = require('../browsers') const plugins = require('../plugins') type Group = 'browser' | 'cypress' | 'launchpad' | 'plugin' | 'ffmpeg' | 'electro...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/tty.ts
packages/server/lib/util/tty.ts
import tty from 'tty' import { get as getTerminalSize } from './terminal-size' // polyfills node's getWindowSize // by returning an array of columns/rows export function getWindowSize () { const { columns, rows } = getTerminalSize() return [columns, rows] } function patchStream (patched, name) { const stream =...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/ensure-url.ts
packages/server/lib/util/ensure-url.ts
import _ from 'lodash' import Bluebird from 'bluebird' import debugModule from 'debug' import rp from '@cypress/request-promise' import * as url from 'url' import { agent, connect } from '@packages/network' const debug = debugModule('cypress:server:ensure-url') type RetryOptions = { retryIntervals: number[] onRet...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/random.ts
packages/server/lib/util/random.ts
import random from 'randomstring' // return a random id export const id = (length = 5): string => { return random.generate({ length, capitalization: 'lowercase', }) }
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/tests_utils.ts
packages/server/lib/util/tests_utils.ts
import _ from 'lodash' export const flattenSuiteIntoRunnables = (suite, tests = [], hooks = []) => { if (_.isArray(suite)) { return _.map(suite, (s) => flattenSuiteIntoRunnables(s)) .reduce( (arr1, arr2) => [arr1[0].concat(arr2[0]), arr1[1].concat(arr2[1])], [tests, hooks], ) } // if we ...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/cookies.ts
packages/server/lib/util/cookies.ts
import { Cookie, CookieJar as ToughCookieJar } from 'tough-cookie' import type { AutomationCookie } from '../automation/cookies' interface SerializableAutomationCookie extends Omit<AutomationCookie, 'expiry'> { expiry: 'Infinity' | '-Infinity' | number | null maxAge: 'Infinity' | '-Infinity' | number | null } exp...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/async_retry.ts
packages/server/lib/util/async_retry.ts
type RetryOptions = { maxAttempts: number retryDelay?: (attempt: number) => number shouldRetry?: (err?: unknown) => boolean onRetry?: (delay: number, err: unknown) => void } export function asyncRetry< TArgs extends any[], TResult, > (fn: (...args: TArgs) => Promise<TResult>, options: RetryOptions) { ret...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/patch-fs.ts
packages/server/lib/util/patch-fs.ts
import gracefulFs from 'graceful-fs' import type fs from 'fs' export function patchFs (_fs: typeof fs) { // Add gracefulFs for EMFILE queuing. gracefulFs.gracefulify(_fs) }
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/shell.ts
packages/server/lib/util/shell.ts
import _ from 'lodash' import Promise from 'bluebird' import execa from 'execa' import os from 'os' import commandExistsModule from 'command-exists' import debugModule from 'debug' const log = debugModule('cypress:server:util:shell') const isWindows = () => { return os.platform() === 'win32' } const profiles = { ...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/file.ts
packages/server/lib/util/file.ts
import _ from 'lodash' import os from 'os' import md5 from 'md5' import path from 'path' import debugModule from 'debug' import Promise from 'bluebird' import lockFileModule from 'lockfile' import { fs } from './fs' import * as env from './env' import exit from './exit' import pQueue from 'p-queue' const lockFile = Pro...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/terminal.ts
packages/server/lib/util/terminal.ts
import _ from 'lodash' import chalk from 'chalk' import Table from 'cli-table3' import utils from 'cli-table3/src/utils' import widestLine from 'widest-line' import { get as getTerminalSize } from './terminal-size' import type { HorizontalAlignment } from 'cli-table3' const MAXIMUM_SIZE = 100 const EXPECTED_SUM = 100 ...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/env.ts
packages/server/lib/util/env.ts
export const set = (key: string, val: string): string | undefined => { return process.env[key] = val } export const get = (key: string): string | undefined => { return process.env[key] }
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/graceful_crash_handling.ts
packages/server/lib/util/graceful_crash_handling.ts
import type { ProjectBase } from '../project-base' import type { BaseReporterResults, ReporterResults } from '../types/reporter' import * as errors from '../errors' import Debug from 'debug' import pDefer, { DeferredPromise } from 'p-defer' const debug = Debug('cypress:util:crash_handling') const patchRunResultsAfter...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/env-editors.ts
packages/server/lib/util/env-editors.ts
import type { Editor } from '@packages/types' export const linuxEditors = [ { id: 'cursor', binary: 'cursor', name: 'Cursor', }, { id: 'atom', binary: 'atom', name: 'Atom', }, { id: 'brackets', binary: 'brackets', name: 'Brackets', }, { id: 'code', binary: 'code', ...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/escape_filename.ts
packages/server/lib/util/escape_filename.ts
const ampersandRe = /&/g const percentRe = /%/g const questionRe = /\?/g const plusRe = /\+/g export function escapeFilenameInUrl (url: string) { // escape valid file name characters that cannot be used in URL return url .replace(percentRe, '%25') // % .replace(ampersandRe, '%26') // & .replace(questionRe, '...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/proxy.ts
packages/server/lib/util/proxy.ts
import _ from 'lodash' import debugModule from 'debug' import os from 'os' import { getWindowsProxy } from './get-windows-proxy' const debug = debugModule('cypress:server:util:proxy') const falsyEnv = (v) => { return v === 'false' || v === '0' || !v } const copyLowercaseEnvToUppercase = (name: string) => { // up...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/server_destroy.ts
packages/server/lib/util/server_destroy.ts
import Bluebird from 'bluebird' import type http from 'http' import { allowDestroy as allowDestroyNetwork } from '@packages/network' export interface DestroyableHttpServer extends http.Server { /** asynchronously destroys the http server, waiting * for all open socket connections to first close */ destroyAsy...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/settings.ts
packages/server/lib/util/settings.ts
import Debug from 'debug' import _ from 'lodash' import path from 'path' import { fs } from '../util/fs' import type { SettingsOptions } from '@packages/types' import { getCtx } from '@packages/data-context' import * as errors from '../errors' const debug = Debug('cypress:server:settings') function configCode (obj, i...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/terminal-size.ts
packages/server/lib/util/terminal-size.ts
import termSize from 'term-size' import * as env from './env' export const get = (): { columns: number, rows: number } => { const obj = termSize() if (env.get('CI')) { // reset to 100 obj.columns = 100 } return obj }
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/trash.ts
packages/server/lib/util/trash.ts
import { fs } from './fs' import os from 'os' import path from 'path' import trash from 'trash' import Bluebird from 'bluebird' // Moves a folder's contents to the trash (or empties it on Linux) export const folder = async (pathToFolder: string): Promise<void> => { try { await fs.statAsync(pathToFolder) if ...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/class-helpers.ts
packages/server/lib/util/class-helpers.ts
const propertyGetterNameRe = /\.get\s(.+?)\s/ class AnyClass {} export function ensureProp<T> (this: AnyClass, prop: T | undefined, methodSetter): T { if (!prop) { const obj = {} as Error Error.captureStackTrace(obj, ensureProp) const propertyGetterStackLine = obj.stack!.split('\n')[1] const matche...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/resolve.ts
packages/server/lib/util/resolve.ts
import debugModule from 'debug' const debug = debugModule('cypress:server:plugins') /** * Resolves the path to 'typescript' module. * * @param {projectRoot} path to the project root * @returns {string|null} path if typescript exists, otherwise null */ export const typescript = (projectRoot) => { if (process.env...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/print-run.ts
packages/server/lib/util/print-run.ts
/* eslint-disable no-console */ import _ from 'lodash' import logSymbols from 'log-symbols' import chalk from 'chalk' import human from 'human-interval' import prettyBytes from 'pretty-bytes' import pkg from '@packages/root' import humanTime from './human_time' import duration from './duration' import newlines from './...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/stream_buffer.ts
packages/server/lib/util/stream_buffer.ts
import _ from 'lodash' import debugModule from 'debug' import stream from 'stream' const debug = debugModule('cypress:server:stream_buffer') function streamBuffer (initialSize = 2048) { let buffer: Buffer | null = Buffer.allocUnsafe(initialSize) let bytesWritten = 0 let finished = false const onWrite = (chun...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/status_code.ts
packages/server/lib/util/status_code.ts
import http from 'http' const isOkStatusCodeRe = /^[2|3]\d+$/ export const isOk = (code: number | string): boolean => { return !!code && isOkStatusCodeRe.test(code as string) } export const getText = (code: number | string): string => { return http.STATUS_CODES[code] || 'Unknown Status Code' }
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/socket_allowed.ts
packages/server/lib/util/socket_allowed.ts
import _ from 'lodash' import Debug from 'debug' import type net from 'net' import type { Request } from 'express' const debug = Debug('cypress:server:util:socket_allowed') /** * Utility to validate incoming, local socket connections against a list of * expected client TCP ports. */ export class SocketAllowed { ...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/spec_writer.ts
packages/server/lib/util/spec_writer.ts
import { fs } from './fs' import { ASTNode, Visitor, builders as b, namedTypes as n, visit } from 'ast-types' import * as recast from 'recast' import { parse } from '@babel/parser' import path from 'path' const newFileTemplate = (file) => { return `// ${path.basename(file)} created with Cypress // // Start writing y...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/file-opener.ts
packages/server/lib/util/file-opener.ts
import debugModule from 'debug' import launchEditor from 'launch-editor' const debug = debugModule('cypress:server:file-opener') export interface OpenFileDetails { file: string where: { binary: string } line: number column: number } export const openFile = (fileDetails: OpenFileDetails) => { debug('o...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/util/fs.ts
packages/server/lib/util/fs.ts
import Bluebird from 'bluebird' import fsExtra from 'fs-extra' import sanitize from 'sanitize-filename' import path from 'path' import _ from 'lodash' const RUNNABLE_SEPARATOR = ' -- ' const pathSeparatorRe = /[\\\/]/g // many filesystems limit filename length to 255 bytes/characters, so truncate the filename to // t...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/controllers/client.ts
packages/server/lib/controllers/client.ts
import Debug from 'debug' const debug = Debug('cypress:server:controllers:client') const socketIo = require('@packages/socket') // hold onto the client source + version in memory const clientSourcePath = socketIo.getPathToClientSource() const clientVersion = socketIo.getClientVersion() export = { handle (req: any, ...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/controllers/files.ts
packages/server/lib/controllers/files.ts
import _ from 'lodash' import path from 'path' import { getCwd } from '../cwd' import Debug from 'debug' import { escapeFilenameInUrl } from '../util/escape_filename' import { getCtx } from '@packages/data-context' import { DocumentDomainInjection } from '@packages/network-tools' import { privilegedCommandsManager } fr...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/controllers/runner.ts
packages/server/lib/controllers/runner.ts
import type { Request, Response } from 'express' import send from 'send' import { getPathToDist } from '@packages/resolve-dist' export const runner = { handle (req: Request, res: Response) { const pathToFile = getPathToDist('runner', req.params[0]) return send(req, pathToFile).pipe(res) }, }
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/controllers/spec.ts
packages/server/lib/controllers/spec.ts
import Debug from 'debug' import Promise from 'bluebird' import { get as errorsGet } from '../errors' import preprocessor from '../plugins/preprocessor' import type { Cfg } from '../project-base' import type { Request, Response } from 'express' import type { PreprocessorError } from '@packages/types' const debug = Deb...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/controllers/iframes.ts
packages/server/lib/controllers/iframes.ts
import type { Request, Response } from 'express' import type httpProxy from 'http-proxy' import Debug from 'debug' import files from './files' import type { Cfg } from '../project-base' import type { FoundSpec } from '@packages/types' import type { RemoteStates } from '../remote_states' const debug = Debug('cypress:se...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/controllers/xhrs.ts
packages/server/lib/controllers/xhrs.ts
import { parseContentType } from '@packages/net-stubbing/lib/server/util' import _ from 'lodash' import Promise from 'bluebird' import { get as fixtureGet } from '../fixture' const fixturesRe = /^(fx:|fixture:)/ export = { handle (req, res, config, next) { const get = function (val, def?) { return decodeU...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/plugins/run_events.ts
packages/server/lib/plugins/run_events.ts
import Promise from 'bluebird' import * as errors from '../errors' import * as plugins from '../plugins' interface RunEventsAPI { execute: (eventName: string, ...args: unknown[]) => Promise<unknown> } const API: RunEventsAPI = { execute: Promise.method((eventName: string, ...args: unknown[]) => { if (!plugins...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/plugins/dev-server.ts
packages/server/lib/plugins/dev-server.ts
import { EventEmitter } from 'events' import debug from 'debug' import * as plugins from '../plugins' import type { FullConfig, SpecWithRelativeRoot, PluginIpcHandler } from '@packages/types' const debugFn = debug('cypress:ct:dev-server') const baseEmitter = new EventEmitter() interface SpecsChangedOptions { neede...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/plugins/preprocessor.ts
packages/server/lib/plugins/preprocessor.ts
import _ from 'lodash' import { EventEmitter } from 'events' import path from 'path' import debug from 'debug' import Promise from 'bluebird' import appData from '../util/app_data' import * as plugins from '../plugins' import { telemetry } from '@packages/telemetry' import type { PluginIpcHandler, PreprocessorError } f...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/plugins/index.ts
packages/server/lib/plugins/index.ts
import { getCtx, registerServerPluginHandler, } from '@packages/data-context' export const registerEvent = (event, callback) => { getCtx().lifecycleManager.registerEvent(event, callback) } export const getPluginPid = () => { return getCtx().lifecycleManager.eventProcessPid } export const registerHandler = (h...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/types/reporter.ts
packages/server/lib/types/reporter.ts
interface ReporterTestAttempt { state: 'skipped' | 'failed' | 'passed' error: any timings: any failedFromHookId: any wallClockStartedAt: Date wallClockDuration: number videoTimestamp: any } interface ReporterTest { testId: string title: string[] state: 'skipped' | 'passed' | 'failed' body: string ...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/types/studio.ts
packages/server/lib/types/studio.ts
export interface StudioInitOptions { sessionId?: string }
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/modes/smoke_test.ts
packages/server/lib/modes/smoke_test.ts
export = { run (options: any) { // eslint-disable-next-line no-console console.log(options.pong) return options.pong }, }
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/modes/pkg.ts
packages/server/lib/modes/pkg.ts
import Promise from 'bluebird' import pkg from '@packages/root' export = () => { return Promise.resolve(pkg) }
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/modes/run.ts
packages/server/lib/modes/run.ts
/* eslint-disable no-console */ import _ from 'lodash' import pkg from '@packages/root' import path from 'path' import chalk from 'chalk' import Debug from 'debug' import Bluebird from 'bluebird' import assert from 'assert' import recordMode from './record' import * as errors from '../errors' import Reporter from '../...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
true
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/modes/info.ts
packages/server/lib/modes/info.ts
/* eslint-disable no-console */ import Debug from 'debug' import { detect as launcherDetect } from '@packages/launcher' import pluralize from 'pluralize' import { stripIndent } from 'common-tags' import browserUtils from '../browsers/utils' import _ from 'lodash' import chalk from 'chalk' import { fs } from '../util/fs...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/modes/interactive.ts
packages/server/lib/modes/interactive.ts
import _ from 'lodash' import os from 'os' // tslint:disable-next-line no-implicit-dependencies - electron dep needs to be defined import { app, nativeImage as image } from 'electron' import * as cyIcons from '@packages/icons' import * as savedState from '../saved_state' import menu from '../gui/menu' import * as Wind...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/modes/record.ts
packages/server/lib/modes/record.ts
import _ from 'lodash' import path from 'path' import la from 'lazy-ass' import check from 'check-more-types' import Debug from 'debug' import Promise from 'bluebird' import isForkPr from 'is-fork-pr' import commitInfo from '@cypress/commit-info' import { telemetry } from '@packages/telemetry' import { hideKeys } from ...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/modes/results.ts
packages/server/lib/modes/results.ts
import _ from 'lodash' import type { FoundBrowser, SpecWithRelativeRoot } from '@packages/types' import path from 'path' import type { Cfg } from '../project-base' import type { ScreenshotMetadata } from './run' type dateTimeISO = string type ms = number interface TestError { message: string name: string stack...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/modes/index.ts
packages/server/lib/modes/index.ts
import { setCtx } from '@packages/data-context' import _ from 'lodash' import { makeDataContext } from '../makeDataContext' import { id as randomId } from '../util/random' import { telemetry } from '@packages/telemetry' export = (mode, options) => { if (mode === 'smokeTest') { return require('./smoke_test').run...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/cri-client.ts
packages/server/lib/browsers/cri-client.ts
import debugModule from 'debug' import { CDPCommandQueue } from './cdp-command-queue' import { CDPConnection, CDPListener } from './cdp-connection' import type ProtocolMapping from 'devtools-protocol/types/protocol-mapping' import type WebSocket from 'ws' import type { CypressError } from '@packages/errors' import type...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/browser-cri-client.ts
packages/server/lib/browsers/browser-cri-client.ts
import _ from 'lodash' import Bluebird from 'bluebird' import CRI from 'chrome-remote-interface' import Debug from 'debug' import type { Protocol } from 'devtools-protocol' import { _connectAsync, _getDelayMsForRetry } from './protocol' import * as errors from '../errors' import type { CypressError } from '@packages/er...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/cdp_automation.ts
packages/server/lib/browsers/cdp_automation.ts
/// <reference types='chrome'/> import _ from 'lodash' import Bluebird from 'bluebird' import type { Protocol } from 'devtools-protocol' import type ProtocolMapping from 'devtools-protocol/types/protocol-mapping' import { parseDomain, isLocalhost as isLocalhostNetworkTools } from '@packages/network-tools' import debug...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/utils.ts
packages/server/lib/browsers/utils.ts
import Bluebird from 'bluebird' import _ from 'lodash' import type { FoundBrowser } from '@packages/types' import * as errors from '../errors' import * as plugins from '../plugins' import * as launcher from '@packages/launcher' import type { Automation } from '../automation' import type { Browser } from './types' impor...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/chrome.ts
packages/server/lib/browsers/chrome.ts
import Bluebird from 'bluebird' import debugModule from 'debug' import la from 'lazy-ass' import _ from 'lodash' import os from 'os' import path from 'path' import * as extension from '@packages/extension' import mime from 'mime' import { launch } from '@packages/launcher' import appData from '../util/app_data' import...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/cdp-connection.ts
packages/server/lib/browsers/cdp-connection.ts
import type ProtocolMapping from 'devtools-protocol/types/protocol-mapping' import Debug from 'debug' import EventEmitter from 'events' import CDP from 'chrome-remote-interface' import type { CypressError } from '@packages/errors' import { debugCdpConnection, DebuggableCDPClient } from './debug-cdp-connection' import t...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/bidi_automation.ts
packages/server/lib/browsers/bidi_automation.ts
import debugModule from 'debug' import toInteger from 'lodash/toInteger' import isNumber from 'lodash/isNumber' import { isHostOnlyCookie } from './cdp_automation' import { cookieMatches } from '../automation/util' import { bidiKeyPress } from '../automation/commands/key_press' import { AutomationNotImplemented } from ...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/debug-cdp-connection.ts
packages/server/lib/browsers/debug-cdp-connection.ts
import Debug from 'debug' import _ from 'lodash' import type CDP from 'chrome-remote-interface' import type EventEmitter from 'events' import type WebSocket from 'ws' export interface DebuggableCDPClient extends CDP.Client { off: EventEmitter['off'] // ws is defined as optional here, because it is not a declared p...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/webkit-automation.ts
packages/server/lib/browsers/webkit-automation.ts
import Debug from 'debug' import type playwright from 'playwright-webkit' import type { Automation } from '../automation' import { normalizeResourceType } from './cdp_automation' import os from 'os' import type { RunModeVideoApi } from '@packages/types' import path from 'path' import mime from 'mime' import { cookieMat...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/electron.ts
packages/server/lib/browsers/electron.ts
import _ from 'lodash' import EE from 'events' import path from 'path' import Debug from 'debug' import menu from '../gui/menu' import * as Windows from '../gui/windows' import { CdpAutomation, screencastOpts } from './cdp_automation' import * as savedState from '../saved_state' import utils from './utils' import * as ...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/cdp-command-queue.ts
packages/server/lib/browsers/cdp-command-queue.ts
import type ProtocolMapping from 'devtools-protocol/types/protocol-mapping' import pDefer, { DeferredPromise } from 'p-defer' import type { CdpCommand } from './cdp_automation' import Debug from 'debug' const debug = Debug('cypress:server:browsers:cdp-command-queue') const debugVerbose = Debug('cypress:server:browsers...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/cri-errors.ts
packages/server/lib/browsers/cri-errors.ts
const Kinds = Object.freeze({ CDP_CRASHED: 'cdp_crashed', CDP_DISCONNECTED: 'cdp_disconnected', CDP_TERMINATED: 'cdp_terminated', CDP_ALREADY_CONNECTED: 'cdp_already_connected', }) type CdpErrorKind = typeof Kinds[keyof typeof Kinds] type MaybeCdpError = Error & { kind?: CdpErrorKind } export class CDPCrashe...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/types.ts
packages/server/lib/browsers/types.ts
import type { FoundBrowser, BrowserLaunchOpts, BrowserNewTabOpts, ProtocolManagerShape, CyPromptManagerShape, StudioManagerShape } from '@packages/types' import type { EventEmitter } from 'events' import type { Automation } from '../automation' import type { CDPSocketServer } from '@packages/socket' export type Browse...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/index.ts
packages/server/lib/browsers/index.ts
import _ from 'lodash' import Bluebird from 'bluebird' import Debug from 'debug' import utils from './utils' import * as errors from '../errors' import { exec } from 'child_process' import util from 'util' import os from 'os' import { BROWSER_FAMILY, BrowserLaunchOpts, BrowserNewTabOpts, FoundBrowser, ProtocolManagerSh...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/webkit.ts
packages/server/lib/browsers/webkit.ts
import Debug from 'debug' import { EventEmitter } from 'events' import type playwright from 'playwright-webkit' import type { Browser, BrowserInstance } from './types' import type { Automation } from '../automation' import { WebKitAutomation } from './webkit-automation' import * as unhandledExceptions from '../unhandle...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/firefox.ts
packages/server/lib/browsers/firefox.ts
import _ from 'lodash' import EventEmitter from 'events' import fs from 'fs-extra' import Debug from 'debug' import getPort from 'get-port' import path from 'path' import urlUtil from 'url' import { debug as launcherDebug } from '@packages/launcher/lib/browsers' import { doubleEscape } from '@packages/launcher/lib/wind...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/protocol.ts
packages/server/lib/browsers/protocol.ts
import { connect } from '@packages/network' import Bluebird from 'bluebird' import type { Socket } from 'net' import utils from './utils' const errors = require('../errors') export function _getDelayMsForRetry (i, browserName) { let maxRetries = Number.parseInt(process.env.CYPRESS_CONNECT_RETRY_THRESHOLD ? process.e...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/firefox-util.ts
packages/server/lib/browsers/firefox-util.ts
import Debug from 'debug' import { BidiAutomation } from './bidi_automation' import type { Client as WebDriverClient } from 'webdriver' import type { Automation } from '../automation' const debug = Debug('cypress:server:browsers:firefox-util') let webdriverClient: WebDriverClient async function connectToNewSpecBiDi ...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/memory/default.ts
packages/server/lib/browsers/memory/default.ts
import os from 'os' import si from 'systeminformation' /** * Returns the total memory limit in bytes. * @returns total memory limit in bytes */ const getTotalMemoryLimit = async () => { return os.totalmem() } /** * Returns the available memory in bytes. * @param totalMemoryLimit total memory limit in bytes * ...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/memory/cgroup-v1.ts
packages/server/lib/browsers/memory/cgroup-v1.ts
import { exec } from 'child_process' import util from 'util' const execAsync = util.promisify(exec) /** * Returns the total memory limit from the memory cgroup. * @returns total memory limit in bytes */ const getTotalMemoryLimit = async () => { return Number((await execAsync('cat /sys/fs/cgroup/memory/memory.lim...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/memory/index.ts
packages/server/lib/browsers/memory/index.ts
import debugModule from 'debug' import _ from 'lodash' import si from 'systeminformation' import os from 'os' import fs from 'fs-extra' import path from 'path' import pid from 'pidusage' import { groupCyProcesses, Process } from '../../util/process_profiler' import browsers from '..' import { telemetry } from '@package...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/browsers/webdriver/index.ts
packages/server/lib/browsers/webdriver/index.ts
import type WebDriverPackage from 'webdriver' const webDriverPackageName = 'webdriver' export class WebDriver { // We resolve this package in such a way to packherd can discover it. static getWebDriverPackage: () => typeof WebDriverPackage = () => { /** * NOTE: webdriver is an ESM package and does not pl...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/cloud/extract_atomic.ts
packages/server/lib/cloud/extract_atomic.ts
import { createReadStream } from 'fs' import tar from 'tar' import { ensureDir } from 'fs-extra' import path from 'path' import writeFileAtomic from 'write-file-atomic' export const extractAtomic = async (archivePath: string, destinationPath: string) => { const entryPromises: Promise<void>[] = [] const parser = n...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/cloud/routes.ts
packages/server/lib/cloud/routes.ts
import _ from 'lodash' import UrlParse from 'url-parse' const app_config = require('../../config/app.json') export const apiUrl = app_config[process.env.CYPRESS_CONFIG_ENV || process.env.CYPRESS_INTERNAL_ENV || 'development'].api_url const CLOUD_ENDPOINTS = { api: '', auth: 'auth', ping: 'ping', runs: 'runs'...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/cloud/get_cloud_metadata.ts
packages/server/lib/cloud/get_cloud_metadata.ts
import type { CloudDataSource } from '@packages/data-context/src/sources' export const getCloudMetadata = async (cloudDataSource: CloudDataSource) => { const cloudEnv = (process.env.CYPRESS_CONFIG_ENV || process.env.CYPRESS_INTERNAL_ENV || 'production') as 'development' | 'staging' | 'production' const cloudUrl = ...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/cloud/require_script.ts
packages/server/lib/cloud/require_script.ts
import Module from 'module' /** * requireScript, does just that, requires the passed in script as if it was a module. * @param script - string * @returns exports */ export const requireScript = <T>(script: string): T => { const mod = new Module('id', module) mod.filename = '' // _compile is a private method...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false
cypress-io/cypress
https://github.com/cypress-io/cypress/blob/409444f8ea51d8f14dec8d10510f78c4a5f42271/packages/server/lib/cloud/auth.ts
packages/server/lib/cloud/auth.ts
const _ = require('lodash') const debug = require('debug')('cypress:server:cloud:auth') const express = require('express') const os = require('os') const pkg = require('@packages/root') const Promise = require('bluebird') const url = require('url') // tslint:disable-next-line no-implicit-dependencies - electron dep nee...
typescript
MIT
409444f8ea51d8f14dec8d10510f78c4a5f42271
2026-01-04T15:36:58.228650Z
false