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 |
|---|---|---|---|---|---|---|---|---|
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/utils/integration.ts | test/utils/integration.ts | import { promises as fs } from "fs"
import * as path from "path"
import { parse, parseConfigFile, setDefaults } from "../../src/node/cli"
import { runCodeServer } from "../../src/node/main"
import { workspaceDir } from "./constants"
import { tmpdir } from "./helpers"
import * as httpserver from "./httpserver"
export a... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/utils/helpers.ts | test/utils/helpers.ts | import { logger } from "@coder/logger"
import { promises as fs } from "fs"
import * as net from "net"
import * as os from "os"
import * as path from "path"
import { CodeServer, CodeServerPage } from "../e2e/models/CodeServer"
import { REVERSE_PROXY_PORT, REVERSE_PROXY_BASE_PATH } from "./constants"
/**
* Spy on the l... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/utils/constants.ts | test/utils/constants.ts | export const PASSWORD = "e45432jklfdsab"
export const workspaceDir = "workspaces"
export const REVERSE_PROXY_BASE_PATH = process.env.CS_TEST_REVERSE_PROXY_BASE_PATH || "ide"
export const REVERSE_PROXY_PORT = process.env.CS_TEST_REVERSE_PROXY_PORT || "8000"
| typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/utils/httpserver.ts | test/utils/httpserver.ts | import { logger } from "@coder/logger"
import * as express from "express"
import * as http from "http"
import nodeFetch, { RequestInit, Response } from "node-fetch"
import Websocket from "ws"
import { Disposable } from "../../src/common/emitter"
import * as util from "../../src/common/util"
import { ensureAddress } fro... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/utils/cssStub.ts | test/utils/cssStub.ts | // Note: this is needed for the register.test.ts
// This is because inside src/browser/register.ts
// we import CSS files, which Jest can't handle unless we tell it how to
// See: https://stackoverflow.com/a/39434579/3015595
module.exports = {}
| typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/utils/runCodeServerCommand.ts | test/utils/runCodeServerCommand.ts | import { exec } from "child_process"
import path from "path"
import { promisify } from "util"
/**
*
* A helper function for integration tests to run code-server commands.
*/
export async function runCodeServerCommand(
argv: string[],
env?: NodeJS.ProcessEnv,
): Promise<{ stdout: string; stderr: string }> {
co... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/utils/globalUnitSetup.ts | test/utils/globalUnitSetup.ts | import { workspaceDir } from "./constants"
import { clean } from "./helpers"
/**
* Perform workspace cleanup. This should be ran before unit tests execute.
*/
export default async function () {
await clean(workspaceDir)
}
| typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/e2e/openHelpAbout.test.ts | test/e2e/openHelpAbout.test.ts | import { version } from "../../src/node/constants"
import { describe, test, expect } from "./baseFixture"
describe("Open Help > About", ["--disable-workspace-trust"], {}, () => {
test("should see code-server version in about dialog", async ({ codeServerPage }) => {
// Open using the menu.
await codeServerPag... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/e2e/webview.test.ts | test/e2e/webview.test.ts | import { promises as fs } from "fs"
import * as path from "path"
import { describe, test, expect } from "./baseFixture"
describe("Webviews", ["--disable-workspace-trust"], {}, () => {
test("should preview a Markdown file", async ({ codeServerPage }) => {
// Create Markdown file
const heading = "Hello world"
... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/e2e/logout.test.ts | test/e2e/logout.test.ts | // NOTE@jsjoeio commenting out until we can figure out what's wrong
// import { describe, test, expect } from "./baseFixture"
// describe("logout", true, ["--disable-workspace-trust"], {}, () => {
// test("should be able logout", async ({ codeServerPage }) => {
// // Recommended by Playwright for async navigatio... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/e2e/codeServer.test.ts | test/e2e/codeServer.test.ts | import { promises as fs } from "fs"
import * as path from "path"
import { getMaybeProxiedCodeServer } from "../utils/helpers"
import { describe, test, expect } from "./baseFixture"
import { CodeServer } from "./models/CodeServer"
describe("code-server", ["--disable-workspace-trust"], {}, () => {
// TODO@asher: Gener... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/e2e/uploads.test.ts | test/e2e/uploads.test.ts | import { promises as fs } from "fs"
import * as path from "path"
import { clean } from "../utils/helpers"
import { describe, test, expect } from "./baseFixture"
describe("Uploads (enabled)", ["--disable-workspace-trust"], {}, () => {
const testName = "uploads-enabled"
test.beforeAll(async () => {
await clean(t... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/e2e/terminal.test.ts | test/e2e/terminal.test.ts | import * as cp from "child_process"
import { promises as fs } from "fs"
import * as path from "path"
import util from "util"
import { clean, getMaybeProxiedCodeServer, tmpdir } from "../utils/helpers"
import { describe, expect, test } from "./baseFixture"
describe("Integrated Terminal", ["--disable-workspace-trust"], ... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/e2e/baseFixture.ts | test/e2e/baseFixture.ts | import { test as base } from "@playwright/test"
import { CodeServer, CodeServerPage } from "./models/CodeServer"
/**
* Wraps `test.describe` to create and manage an instance of code-server. If you
* don't use this you will need to create your own code-server instance and pass
* it to `test.use`.
*
* If `includeCr... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/e2e/downloads.test.ts | test/e2e/downloads.test.ts | import { promises as fs } from "fs"
import * as path from "path"
import { clean } from "../utils/helpers"
import { describe, test, expect } from "./baseFixture"
describe("Downloads (enabled)", ["--disable-workspace-trust"], {}, async () => {
const testName = "downloads-enabled"
test.beforeAll(async () => {
awa... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/e2e/github.test.ts | test/e2e/github.test.ts | import { test as base } from "@playwright/test"
import { describe, expect, test } from "./baseFixture"
if (process.env.GITHUB_TOKEN) {
describe("GitHub token", ["--disable-workspace-trust"], {}, () => {
test("should be logged in to pull requests extension", async ({ codeServerPage }) => {
await codeServerP... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/e2e/extensions.test.ts | test/e2e/extensions.test.ts | import { test as base } from "@playwright/test"
import * as path from "path"
import { getMaybeProxiedCodeServer } from "../utils/helpers"
import { describe, test, expect } from "./baseFixture"
function runTestExtensionTests() {
// This will only work if the test extension is loaded into code-server.
test("should h... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/e2e/login.test.ts | test/e2e/login.test.ts | import { PASSWORD } from "../utils/constants"
import { describe, test, expect } from "./baseFixture"
describe("login", ["--disable-workspace-trust", "--auth", "password"], {}, () => {
test("should see the login page", async ({ codeServerPage }) => {
// It should send us to the login page
expect(await codeSer... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/e2e/routes.test.ts | test/e2e/routes.test.ts | import { clean, getMaybeProxiedPathname } from "../utils/helpers"
import { describe, test, expect } from "./baseFixture"
const routes = {
"/": [
/\.\/manifest.json/,
/\.\/_static\//,
/[a-z]+-[0-9a-z]+\/static\//,
/http:\/\/localhost:[0-9]+\/[a-z]+-[0-9a-z]+\/static\//,
],
"/vscode": [
/\.\/vs... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/e2e/extensions/test-extension/extension.ts | test/e2e/extensions/test-extension/extension.ts | import * as vscode from "vscode"
export function activate(context: vscode.ExtensionContext) {
vscode.window.showInformationMessage("test extension loaded")
// Test extension
context.subscriptions.push(
vscode.commands.registerCommand("codeServerTest.proxyUri", () => {
if (process.env.VSCODE_PROXY_URI) ... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/e2e/models/CodeServer.ts | test/e2e/models/CodeServer.ts | import { field, Logger, logger } from "@coder/logger"
import * as cp from "child_process"
import { promises as fs } from "fs"
import * as path from "path"
import { Page } from "playwright"
import * as util from "util"
import { logError, normalize, plural } from "../../../src/common/util"
import { onLine } from "../../.... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/helpers.test.ts | test/unit/helpers.test.ts | import { promises as fs } from "fs"
import { clean, getAvailablePort, getMaybeProxiedPathname, tmpdir, useEnv } from "../../test/utils/helpers"
import { REVERSE_PROXY_BASE_PATH } from "../utils/constants"
/**
* This file is for testing test helpers (not core code).
*/
describe("test helpers", () => {
const testNam... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/update.test.ts | test/unit/node/update.test.ts | import { logger } from "@coder/logger"
import * as http from "http"
import * as path from "path"
import { ensureAddress } from "../../../src/node/app"
import { SettingsProvider, UpdateSettings } from "../../../src/node/settings"
import { LatestResponse, UpdateProvider } from "../../../src/node/update"
import { clean, m... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/settings.test.ts | test/unit/node/settings.test.ts | import { logger } from "@coder/logger"
import { promises as fs } from "fs"
import path from "path"
import { SettingsProvider, CoderSettings } from "../../../src/node/settings"
import { clean, mockLogger, tmpdir } from "../../utils/helpers"
describe("settings", () => {
const testName = "settingsTests"
let testDir =... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/i18n.test.ts | test/unit/node/i18n.test.ts | import { promises as fs } from "fs"
import * as os from "os"
import * as path from "path"
import { loadCustomStrings } from "../../../src/node/i18n"
describe("i18n", () => {
let tempDir: string
let validJsonFile: string
let invalidJsonFile: string
let nonExistentFile: string
beforeEach(async () => {
// ... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/main.test.ts | test/unit/node/main.test.ts | import { promises as fs } from "fs"
import * as path from "path"
import { setDefaults, parse } from "../../../src/node/cli"
import { loadCustomStrings } from "../../../src/node/i18n"
import { tmpdir } from "../../utils/helpers"
// Mock the i18n module
jest.mock("../../../src/node/i18n", () => ({
loadCustomStrings: j... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/constants.test.ts | test/unit/node/constants.test.ts | import { logger } from "@coder/logger"
import path from "path"
import * as semver from "semver"
import { mockLogger } from "../../utils/helpers"
describe("constants", () => {
let constants: typeof import("../../../src/node/constants")
describe("with package.json defined", () => {
const mockPackageJson = {
... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/app.test.ts | test/unit/node/app.test.ts | import { logger } from "@coder/logger"
import { promises } from "fs"
import * as http from "http"
import * as https from "https"
import * as path from "path"
import { createApp, ensureAddress, handleArgsSocketCatchError, listen } from "../../../src/node/app"
import { OptionalString, setDefaults } from "../../../src/nod... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/heart.test.ts | test/unit/node/heart.test.ts | import { logger } from "@coder/logger"
import { readFile, writeFile, stat, utimes } from "fs/promises"
import { Heart } from "../../../src/node/heart"
import { clean, mockLogger, tmpdir } from "../../utils/helpers"
const mockIsActive = (resolveTo: boolean) => jest.fn().mockResolvedValue(resolveTo)
describe("Heart", (... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/http.test.ts | test/unit/node/http.test.ts | import { getMockReq } from "@jest-mock/express"
import * as http from "../../../src/node/http"
import { mockLogger } from "../../utils/helpers"
describe("http", () => {
beforeEach(() => {
mockLogger()
})
afterEach(() => {
jest.clearAllMocks()
})
it("should construct a relative path to the root", ()... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/wrapper.test.ts | test/unit/node/wrapper.test.ts | import { ChildProcess, ParentProcess, isChild } from "../../../src/node/wrapper"
describe("wrapper", () => {
describe("isChild", () => {
it("should return false for parent process", () => {
const p = new ParentProcess("1")
expect(isChild(p)).toBe(false)
})
})
it("should return false for paren... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/proxy.test.ts | test/unit/node/proxy.test.ts | import * as express from "express"
import * as http from "http"
import nodeFetch from "node-fetch"
import { HttpCode } from "../../../src/common/http"
import { proxy } from "../../../src/node/proxy"
import { wss, Router as WsRouter } from "../../../src/node/wsRouter"
import { getAvailablePort, mockLogger } from "../../... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/socket.test.ts | test/unit/node/socket.test.ts | import { field, logger } from "@coder/logger"
import { promises as fs } from "fs"
import * as net from "net"
import * as path from "path"
import * as tls from "tls"
import { Emitter } from "../../../src/common/emitter"
import { tmpdir } from "../../../src/node/constants"
import { SocketProxyProvider } from "../../../sr... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/vscodeSocket.test.ts | test/unit/node/vscodeSocket.test.ts | import { logger } from "@coder/logger"
import * as app from "../../../src/node/app"
import { EditorSessionManager, makeEditorSessionManagerServer } from "../../../src/node/vscodeSocket"
import { clean, tmpdir, listenOn, mockLogger } from "../../utils/helpers"
describe("makeEditorSessionManagerServer", () => {
let tm... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/util.test.ts | test/unit/node/util.test.ts | import * as cp from "child_process"
import { promises as fs } from "fs"
import * as path from "path"
import { generateUuid } from "../../../src/common/util"
import { tmpdir } from "../../../src/node/constants"
import * as util from "../../../src/node/util"
import { clean, tmpdir as tempDirHelper } from "../../utils/hel... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/cli.test.ts | test/unit/node/cli.test.ts | import { Level, logger } from "@coder/logger"
import { promises as fs } from "fs"
import * as path from "path"
import {
UserProvidedArgs,
bindAddrFromArgs,
defaultConfigFile,
parse,
parseConfigFile,
setDefaults,
shouldOpenInExistingInstance,
toCodeArgs,
optionDescriptions,
options,
Options,
Auth... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/routes/errors.test.ts | test/unit/node/routes/errors.test.ts | import express from "express"
import { errorHandler } from "../../../../src/node/routes/errors"
describe("error page is rendered for text/html requests", () => {
it("escapes any html in the error messages", async () => {
const next = jest.fn()
const err = {
code: "ENOENT",
statusCode: 404,
... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/routes/vscode.test.ts | test/unit/node/routes/vscode.test.ts | import { mockLogger } from "../../../utils/helpers"
import * as httpserver from "../../../utils/httpserver"
import * as integration from "../../../utils/integration"
describe("vscode", () => {
let codeServer: httpserver.HttpServer | undefined
beforeEach(() => {
mockLogger()
})
afterEach(async () => {
... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/routes/health.test.ts | test/unit/node/routes/health.test.ts | import * as httpserver from "../../../utils/httpserver"
import * as integration from "../../../utils/integration"
describe("health", () => {
let codeServer: httpserver.HttpServer | undefined
afterEach(async () => {
if (codeServer) {
await codeServer.dispose()
codeServer = undefined
}
})
i... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/routes/static.test.ts | test/unit/node/routes/static.test.ts | import { promises as fs } from "fs"
import * as path from "path"
import { rootPath } from "../../../../src/node/constants"
import { clean, tmpdir } from "../../../utils/helpers"
import * as httpserver from "../../../utils/httpserver"
import * as integration from "../../../utils/integration"
const NOT_FOUND = {
code:... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/node/routes/login.test.ts | test/unit/node/routes/login.test.ts | import { RateLimiter } from "../../../../src/node/routes/login"
import { mockLogger } from "../../../utils/helpers"
import * as httpserver from "../../../utils/httpserver"
import * as integration from "../../../utils/integration"
describe("login", () => {
beforeAll(() => {
mockLogger()
})
describe("RateLimi... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/common/emitter.test.ts | test/unit/common/emitter.test.ts | import { logger } from "@coder/logger"
import { Emitter } from "../../../src/common/emitter"
import { mockLogger } from "../../utils/helpers"
describe("emitter", () => {
beforeEach(() => {
mockLogger()
})
afterEach(() => {
jest.clearAllMocks()
})
it("should run the correct callbacks", async () => {... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/common/http.test.ts | test/unit/common/http.test.ts | import { HttpCode, HttpError } from "../../../src/common/http"
describe("http", () => {
describe("HttpCode", () => {
it("should return the correct HTTP codes", () => {
expect(HttpCode.Ok).toBe(200)
expect(HttpCode.Redirect).toBe(302)
expect(HttpCode.NotFound).toBe(404)
expect(HttpCode.Bad... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/unit/common/util.test.ts | test/unit/common/util.test.ts | import { logger } from "@coder/logger"
import { JSDOM } from "jsdom"
import * as util from "../../../src/common/util"
import { mockLogger } from "../../utils/helpers"
const dom = new JSDOM()
global.document = dom.window.document
export type LocationLike = Pick<Location, "pathname" | "origin">
describe("util", () => ... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/typings/httpolyglot/index.d.ts | typings/httpolyglot/index.d.ts | declare module "httpolyglot" {
import * as http from "http"
import * as https from "https"
function createServer(requestListener?: (req: http.IncomingMessage, res: http.ServerResponse) => void): http.Server
function createServer(
options: https.ServerOptions,
requestListener?: (req: http.IncomingMessag... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/setupTests.ts | setupTests.ts | import fs from "fs";
// vitest.setup.ts
import "vitest-canvas-mock";
import "@testing-library/jest-dom";
import { vi } from "vitest";
import polyfill from "./packages/excalidraw/polyfill";
import { yellow } from "./packages/excalidraw/tests/helpers/colorize";
import { testPolyfills } from "./packages/excalidraw/tests... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/App.tsx | excalidraw-app/App.tsx | import {
Excalidraw,
LiveCollaborationTrigger,
TTDDialogTrigger,
CaptureUpdateAction,
reconcileElements,
useEditorInterface,
} from "@excalidraw/excalidraw";
import { trackEvent } from "@excalidraw/excalidraw/analytics";
import { getDefaultAppState } from "@excalidraw/excalidraw/appState";
import {
Comman... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | true |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/useHandleAppTheme.ts | excalidraw-app/useHandleAppTheme.ts | import { THEME } from "@excalidraw/excalidraw";
import { EVENT, CODES, KEYS } from "@excalidraw/common";
import { useEffect, useLayoutEffect, useState } from "react";
import type { Theme } from "@excalidraw/element/types";
import { STORAGE_KEYS } from "./app_constants";
const getDarkThemeMediaQuery = (): MediaQueryL... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/CustomStats.tsx | excalidraw-app/CustomStats.tsx | import { Stats } from "@excalidraw/excalidraw";
import { copyTextToSystemClipboard } from "@excalidraw/excalidraw/clipboard";
import {
DEFAULT_VERSION,
debounce,
getVersion,
nFormatter,
} from "@excalidraw/common";
import { t } from "@excalidraw/excalidraw/i18n";
import { useEffect, useState } from "react";
im... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/app-jotai.ts | excalidraw-app/app-jotai.ts | // eslint-disable-next-line no-restricted-imports
import {
atom,
Provider,
useAtom,
useAtomValue,
useSetAtom,
createStore,
type PrimitiveAtom,
} from "jotai";
import { useLayoutEffect } from "react";
export const appJotaiStore = createStore();
export { atom, Provider, useAtom, useAtomValue, useSetAtom }... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/debug.ts | excalidraw-app/debug.ts | declare global {
interface Window {
debug: typeof Debug;
}
}
const lessPrecise = (num: number, precision = 5) =>
parseFloat(num.toPrecision(precision));
const getAvgFrameTime = (times: number[]) =>
lessPrecise(times.reduce((a, b) => a + b) / times.length);
const getFps = (frametime: number) => lessPrecis... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/sentry.ts | excalidraw-app/sentry.ts | import { getFeatureFlag } from "@excalidraw/common";
import * as Sentry from "@sentry/browser";
import callsites from "callsites";
const SentryEnvHostnameMap: { [key: string]: string } = {
"excalidraw.com": "production",
"staging.excalidraw.com": "staging",
"vercel.app": "staging",
};
const SENTRY_DISABLED = im... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/global.d.ts | excalidraw-app/global.d.ts | import "@excalidraw/excalidraw/global";
import "@excalidraw/excalidraw/css";
interface Window {
__EXCALIDRAW_SHA__: string | undefined;
}
| typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/index.tsx | excalidraw-app/index.tsx | import { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import { registerSW } from "virtual:pwa-register";
import "../excalidraw-app/sentry";
import ExcalidrawApp from "./App";
window.__EXCALIDRAW_SHA__ = import.meta.env.VITE_APP_GIT_SHA;
const rootElement = document.getElementById("root")... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/app_constants.ts | excalidraw-app/app_constants.ts | // time constants (ms)
export const SAVE_TO_LOCAL_STORAGE_TIMEOUT = 300;
export const INITIAL_SCENE_UPDATE_TIMEOUT = 5000;
export const FILE_UPLOAD_TIMEOUT = 300;
export const LOAD_IMAGES_TIMEOUT = 500;
export const SYNC_FULL_SCENE_INTERVAL_MS = 20000;
export const SYNC_BROWSER_TABS_TIMEOUT = 50;
export const CURSOR_SY... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/ExcalidrawPlusIframeExport.tsx | excalidraw-app/ExcalidrawPlusIframeExport.tsx | import { base64urlToString } from "@excalidraw/excalidraw/data/encode";
import { ExcalidrawError } from "@excalidraw/excalidraw/errors";
import { useLayoutEffect, useRef } from "react";
import type {
FileId,
OrderedExcalidrawElement,
} from "@excalidraw/element/types";
import type { AppState, BinaryFileData } from... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/vite-env.d.ts | excalidraw-app/vite-env.d.ts | /// <reference types="vite-plugin-pwa/vanillajs" />
/// <reference types="vite-plugin-pwa/info" />
/// <reference types="vite-plugin-svgr/client" />
interface ImportMetaEnv {
// The port to run the dev server
VITE_APP_PORT: string;
VITE_APP_BACKEND_V2_GET_URL: string;
VITE_APP_BACKEND_V2_POST_URL: string;
/... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/share/qrcode.chunk.ts | excalidraw-app/share/qrcode.chunk.ts | import { renderSVG } from "uqr";
export const generateQRCodeSVG = (text: string): string => {
return renderSVG(text);
};
| typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/share/QRCode.tsx | excalidraw-app/share/QRCode.tsx | import { useEffect, useState } from "react";
import Spinner from "@excalidraw/excalidraw/components/Spinner";
interface QRCodeProps {
value: string;
}
export const QRCode = ({ value }: QRCodeProps) => {
const [svgData, setSvgData] = useState<string | null>(null);
const [error, setError] = useState<boolean>(fals... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/share/ShareDialog.tsx | excalidraw-app/share/ShareDialog.tsx | import { trackEvent } from "@excalidraw/excalidraw/analytics";
import { copyTextToSystemClipboard } from "@excalidraw/excalidraw/clipboard";
import { Dialog } from "@excalidraw/excalidraw/components/Dialog";
import { FilledButton } from "@excalidraw/excalidraw/components/FilledButton";
import { TextField } from "@excal... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/tests/collab.test.tsx | excalidraw-app/tests/collab.test.tsx | import { CaptureUpdateAction, newElementWith } from "@excalidraw/excalidraw";
import {
createRedoAction,
createUndoAction,
} from "@excalidraw/excalidraw/actions/actionHistory";
import { syncInvalidIndices } from "@excalidraw/element";
import { API } from "@excalidraw/excalidraw/tests/helpers/api";
import { act, re... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/tests/MobileMenu.test.tsx | excalidraw-app/tests/MobileMenu.test.tsx | import { UI } from "@excalidraw/excalidraw/tests/helpers/ui";
import {
mockBoundingClientRect,
render,
restoreOriginalGetBoundingClientRect,
} from "@excalidraw/excalidraw/tests/test-utils";
import ExcalidrawApp from "../App";
describe("Test MobileMenu", () => {
const { h } = window;
const dimensions = { he... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/tests/LanguageList.test.tsx | excalidraw-app/tests/LanguageList.test.tsx | import { defaultLang } from "@excalidraw/excalidraw/i18n";
import { UI } from "@excalidraw/excalidraw/tests/helpers/ui";
import {
screen,
fireEvent,
waitFor,
render,
} from "@excalidraw/excalidraw/tests/test-utils";
import ExcalidrawApp from "../App";
describe("Test LanguageList", () => {
it("rerenders UI o... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/components/ExcalidrawPlusPromoBanner.tsx | excalidraw-app/components/ExcalidrawPlusPromoBanner.tsx | export const ExcalidrawPlusPromoBanner = ({
isSignedIn,
}: {
isSignedIn: boolean;
}) => {
return (
<a
href={
isSignedIn
? import.meta.env.VITE_APP_PLUS_APP
: `${
import.meta.env.VITE_APP_PLUS_LP
}/plus?utm_source=excalidraw&utm_medium=app&utm_content... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/components/ExportToExcalidrawPlus.tsx | excalidraw-app/components/ExportToExcalidrawPlus.tsx | import React from "react";
import { uploadBytes, ref } from "firebase/storage";
import { nanoid } from "nanoid";
import { trackEvent } from "@excalidraw/excalidraw/analytics";
import { Card } from "@excalidraw/excalidraw/components/Card";
import { ExcalidrawLogo } from "@excalidraw/excalidraw/components/ExcalidrawLogo... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/components/EncryptedIcon.tsx | excalidraw-app/components/EncryptedIcon.tsx | import { Tooltip } from "@excalidraw/excalidraw/components/Tooltip";
import { shield } from "@excalidraw/excalidraw/components/icons";
import { useI18n } from "@excalidraw/excalidraw/i18n";
export const EncryptedIcon = () => {
const { t } = useI18n();
return (
<a
className="encrypted-icon tooltip"
... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/components/AppWelcomeScreen.tsx | excalidraw-app/components/AppWelcomeScreen.tsx | import { loginIcon } from "@excalidraw/excalidraw/components/icons";
import { POINTER_EVENTS } from "@excalidraw/common";
import { useI18n } from "@excalidraw/excalidraw/i18n";
import { WelcomeScreen } from "@excalidraw/excalidraw/index";
import React from "react";
import { isExcalidrawPlusSignedUser } from "../app_co... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/components/AppMainMenu.tsx | excalidraw-app/components/AppMainMenu.tsx | import {
loginIcon,
ExcalLogo,
eyeIcon,
} from "@excalidraw/excalidraw/components/icons";
import { MainMenu } from "@excalidraw/excalidraw/index";
import React from "react";
import { isDevEnv } from "@excalidraw/common";
import type { Theme } from "@excalidraw/element/types";
import { LanguageList } from "../a... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/components/GitHubCorner.tsx | excalidraw-app/components/GitHubCorner.tsx | import { THEME } from "@excalidraw/common";
import oc from "open-color";
import React from "react";
import type { Theme } from "@excalidraw/element/types";
// https://github.com/tholman/github-corners
export const GitHubCorner = React.memo(
({ theme, dir }: { theme: Theme; dir: string }) => (
<svg
xmlns="... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/components/AppSidebar.tsx | excalidraw-app/components/AppSidebar.tsx | import { DefaultSidebar, Sidebar, THEME } from "@excalidraw/excalidraw";
import {
messageCircleIcon,
presentationIcon,
} from "@excalidraw/excalidraw/components/icons";
import { LinkButton } from "@excalidraw/excalidraw/components/LinkButton";
import { useUIAppState } from "@excalidraw/excalidraw/context/ui-appStat... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/components/AppFooter.tsx | excalidraw-app/components/AppFooter.tsx | import { Footer } from "@excalidraw/excalidraw/index";
import React from "react";
import { isExcalidrawPlusSignedUser } from "../app_constants";
import { DebugFooter, isVisualDebuggerEnabled } from "./DebugCanvas";
import { EncryptedIcon } from "./EncryptedIcon";
export const AppFooter = React.memo(
({ onChange }:... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/components/AI.tsx | excalidraw-app/components/AI.tsx | import {
DiagramToCodePlugin,
exportToBlob,
getTextFromElements,
MIME_TYPES,
TTDDialog,
} from "@excalidraw/excalidraw";
import { getDataURL } from "@excalidraw/excalidraw/data/blob";
import { safelyParseJSON } from "@excalidraw/common";
import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/ty... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/components/TopErrorBoundary.tsx | excalidraw-app/components/TopErrorBoundary.tsx | import Trans from "@excalidraw/excalidraw/components/Trans";
import { t } from "@excalidraw/excalidraw/i18n";
import * as Sentry from "@sentry/browser";
import React from "react";
interface TopErrorBoundaryState {
hasError: boolean;
sentryEventId: string;
localStorage: string;
}
export class TopErrorBoundary ex... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/components/DebugCanvas.tsx | excalidraw-app/components/DebugCanvas.tsx | import {
ArrowheadArrowIcon,
CloseIcon,
TrashIcon,
} from "@excalidraw/excalidraw/components/icons";
import {
bootstrapCanvas,
getNormalizedCanvasDimensions,
} from "@excalidraw/excalidraw/renderer/helpers";
import { type AppState } from "@excalidraw/excalidraw/types";
import { arrayToMap, throttleRAF } from ... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/collab/Portal.tsx | excalidraw-app/collab/Portal.tsx | import { CaptureUpdateAction } from "@excalidraw/excalidraw";
import { trackEvent } from "@excalidraw/excalidraw/analytics";
import { encryptData } from "@excalidraw/excalidraw/data/encryption";
import { newElementWith } from "@excalidraw/element";
import throttle from "lodash.throttle";
import type { UserIdleState } ... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/collab/Collab.tsx | excalidraw-app/collab/Collab.tsx | import {
CaptureUpdateAction,
getSceneVersion,
restoreElements,
zoomToFitBounds,
reconcileElements,
} from "@excalidraw/excalidraw";
import { ErrorDialog } from "@excalidraw/excalidraw/components/ErrorDialog";
import { APP_NAME, cloneJSON, EVENT, toBrandedType } from "@excalidraw/common";
import {
IDLE_THRE... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/collab/CollabError.tsx | excalidraw-app/collab/CollabError.tsx | import { Tooltip } from "@excalidraw/excalidraw/components/Tooltip";
import { warning } from "@excalidraw/excalidraw/components/icons";
import clsx from "clsx";
import { useEffect, useRef, useState } from "react";
import { atom } from "../app-jotai";
import "./CollabError.scss";
type ErrorIndicator = {
message: st... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/data/firebase.ts | excalidraw-app/data/firebase.ts | import { reconcileElements } from "@excalidraw/excalidraw";
import { MIME_TYPES, toBrandedType } from "@excalidraw/common";
import { decompressData } from "@excalidraw/excalidraw/data/encode";
import {
encryptData,
decryptData,
} from "@excalidraw/excalidraw/data/encryption";
import { restoreElements } from "@excal... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/data/tabSync.ts | excalidraw-app/data/tabSync.ts | import { STORAGE_KEYS } from "../app_constants";
// in-memory state (this tab's current state) versions. Currently just
// timestamps of the last time the state was saved to browser storage.
const LOCAL_STATE_VERSIONS = {
[STORAGE_KEYS.VERSION_DATA_STATE]: -1,
[STORAGE_KEYS.VERSION_FILES]: -1,
};
type BrowserStat... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/data/FileManager.ts | excalidraw-app/data/FileManager.ts | import { CaptureUpdateAction } from "@excalidraw/excalidraw";
import { compressData } from "@excalidraw/excalidraw/data/encode";
import { newElementWith } from "@excalidraw/element";
import { isInitializedImageElement } from "@excalidraw/element";
import { t } from "@excalidraw/excalidraw/i18n";
import type {
Excali... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/data/LocalData.ts | excalidraw-app/data/LocalData.ts | /**
* This file deals with saving data state (appState, elements, images, ...)
* locally to the browser.
*
* Notes:
*
* - DataState refers to full state of the app: appState, elements, images,
* though some state is saved separately (collab username, library) for one
* reason or another. We also save differ... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/data/localStorage.ts | excalidraw-app/data/localStorage.ts | import {
clearAppStateForLocalStorage,
getDefaultAppState,
} from "@excalidraw/excalidraw/appState";
import type { ExcalidrawElement } from "@excalidraw/element/types";
import type { AppState } from "@excalidraw/excalidraw/types";
import { STORAGE_KEYS } from "../app_constants";
export const saveUsernameToLocalS... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/data/index.ts | excalidraw-app/data/index.ts | import {
compressData,
decompressData,
} from "@excalidraw/excalidraw/data/encode";
import {
decryptData,
generateEncryptionKey,
IV_LENGTH_BYTES,
} from "@excalidraw/excalidraw/data/encryption";
import { serializeAsJSON } from "@excalidraw/excalidraw/data/json";
import { isInvisiblySmallElement } from "@excal... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/data/Locker.ts | excalidraw-app/data/Locker.ts | export class Locker<T extends string> {
private locks = new Map<T, true>();
lock = (lockType: T) => {
this.locks.set(lockType, true);
};
/** @returns whether no locks remaining */
unlock = (lockType: T) => {
this.locks.delete(lockType);
return !this.isLocked();
};
/** @returns whether some ... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/app-language/LanguageList.tsx | excalidraw-app/app-language/LanguageList.tsx | import { useI18n, languages } from "@excalidraw/excalidraw/i18n";
import React from "react";
import { useSetAtom } from "../app-jotai";
import { appLangCodeAtom } from "./language-state";
export const LanguageList = ({ style }: { style?: React.CSSProperties }) => {
const { t, langCode } = useI18n();
const setLan... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/app-language/language-detector.ts | excalidraw-app/app-language/language-detector.ts | import { defaultLang, languages } from "@excalidraw/excalidraw";
import LanguageDetector from "i18next-browser-languagedetector";
export const languageDetector = new LanguageDetector();
languageDetector.init({
languageUtils: {},
});
export const getPreferredLanguage = () => {
const detectedLanguages = languageDe... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/excalidraw-app/app-language/language-state.ts | excalidraw-app/app-language/language-state.ts | import { useEffect } from "react";
import { atom, useAtom } from "../app-jotai";
import { getPreferredLanguage, languageDetector } from "./language-detector";
export const appLangCodeAtom = atom(getPreferredLanguage());
export const useAppLangCode = () => {
const [langCode, setLangCode] = useAtom(appLangCodeAtom)... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/examples/with-script-in-browser/initialData.tsx | examples/with-script-in-browser/initialData.tsx | import type { ExcalidrawElementSkeleton } from "@excalidraw/excalidraw/data/transform";
import type { FileId } from "@excalidraw/excalidraw/element/types";
const elements: ExcalidrawElementSkeleton[] = [
{
type: "rectangle",
x: 10,
y: 10,
strokeWidth: 2,
id: "1",
},
{
type: "diamond",
... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/examples/with-script-in-browser/utils.ts | examples/with-script-in-browser/utils.ts | import { MIME_TYPES } from "@excalidraw/excalidraw";
import { fileOpen as _fileOpen } from "browser-fs-access";
import { unstable_batchedUpdates } from "react-dom";
type FILE_EXTENSION = Exclude<keyof typeof MIME_TYPES, "binary">;
const INPUT_CHANGE_INTERVAL_MS = 500;
export type ResolvablePromise<T> = Promise<T> & ... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/examples/with-script-in-browser/index.tsx | examples/with-script-in-browser/index.tsx | import React, { StrictMode } from "react";
import { createRoot } from "react-dom/client";
import "@excalidraw/excalidraw/index.css";
import type * as TExcalidraw from "@excalidraw/excalidraw";
import App from "./components/ExampleApp";
declare global {
interface Window {
ExcalidrawLib: typeof TExcalidraw;
}... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/examples/with-script-in-browser/components/CustomFooter.tsx | examples/with-script-in-browser/components/CustomFooter.tsx | import React from "react";
import type * as TExcalidraw from "@excalidraw/excalidraw";
import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/types";
const COMMENT_SVG = (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="cur... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/examples/with-script-in-browser/components/MobileFooter.tsx | examples/with-script-in-browser/components/MobileFooter.tsx | import React from "react";
import type * as TExcalidraw from "@excalidraw/excalidraw";
import type { ExcalidrawImperativeAPI } from "@excalidraw/excalidraw/types";
import CustomFooter from "./CustomFooter";
const MobileFooter = ({
excalidrawAPI,
excalidrawLib,
}: {
excalidrawAPI: ExcalidrawImperativeAPI;
exc... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/examples/with-script-in-browser/components/ExampleApp.tsx | examples/with-script-in-browser/components/ExampleApp.tsx | import { nanoid } from "nanoid";
import React, {
useEffect,
useState,
useRef,
useCallback,
Children,
cloneElement,
} from "react";
import type * as TExcalidraw from "@excalidraw/excalidraw";
import type { ImportedLibraryData } from "@excalidraw/excalidraw/data/types";
import type {
NonDeletedExcalidrawEl... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/examples/with-script-in-browser/components/sidebar/ExampleSidebar.tsx | examples/with-script-in-browser/components/sidebar/ExampleSidebar.tsx | import React, { useState } from "react";
import "./ExampleSidebar.scss";
export default function Sidebar({ children }: { children: React.ReactNode }) {
const [open, setOpen] = useState(false);
return (
<>
<div id="mySidebar" className={`sidebar ${open ? "open" : ""}`}>
<button className="closeb... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/examples/with-nextjs/src/excalidrawWrapper.tsx | examples/with-nextjs/src/excalidrawWrapper.tsx | "use client";
import * as excalidrawLib from "@excalidraw/excalidraw";
import { Excalidraw } from "@excalidraw/excalidraw";
import "@excalidraw/excalidraw/index.css";
import App from "../../with-script-in-browser/components/ExampleApp";
const ExcalidrawWrapper: React.FC = () => {
return (
<>
<App
... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/examples/with-nextjs/src/app/layout.tsx | examples/with-nextjs/src/app/layout.tsx | export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>{children}</body>
</html>
);
}
| typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/examples/with-nextjs/src/app/page.tsx | examples/with-nextjs/src/app/page.tsx | import dynamic from "next/dynamic";
import Script from "next/script";
import "../common.scss";
// Since client components get prerenderd on server as well hence importing the excalidraw stuff dynamically
// with ssr false
const ExcalidrawWithClientOnly = dynamic(
async () => (await import("../excalidrawWrapper")).d... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/examples/with-nextjs/src/pages/excalidraw-in-pages.tsx | examples/with-nextjs/src/pages/excalidraw-in-pages.tsx | import dynamic from "next/dynamic";
import "../common.scss";
// Since client components get prerenderd on server as well hence importing the excalidraw stuff dynamically
// with ssr false
const Excalidraw = dynamic(
async () => (await import("../excalidrawWrapper")).default,
{
ssr: false,
},
);
export defa... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/dev-docs/src/pages/index.tsx | dev-docs/src/pages/index.tsx | import Link from "@docusaurus/Link";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import HomepageFeatures from "@site/src/components/Homepage";
import Layout from "@theme/Layout";
import clsx from "clsx";
import React from "react";
import styles from "./index.module.css";
function HomepageHead... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
excalidraw/excalidraw | https://github.com/excalidraw/excalidraw/blob/63e1148280163a36326b7efb5fdfeefebabdb3e4/dev-docs/src/components/Homepage/index.tsx | dev-docs/src/components/Homepage/index.tsx | import clsx from "clsx";
import React from "react";
import styles from "./styles.module.css";
type FeatureItem = {
title: string;
Svg: React.ComponentType<React.ComponentProps<"svg">>;
description: JSX.Element;
};
const FeatureList: FeatureItem[] = [
{
title: "Easy to Use",
Svg: require("@site/static... | typescript | MIT | 63e1148280163a36326b7efb5fdfeefebabdb3e4 | 2026-01-04T15:25:31.673879Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.