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 |
|---|---|---|---|---|---|---|---|---|
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/next-app-custom-alias/next.config.ts | packages/shadcn/test/fixtures/frameworks/next-app-custom-alias/next.config.ts | /** @type {import('next').NextConfig} */
const nextConfig = {}
module.exports = nextConfig
| typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/next-app-custom-alias/app/layout.tsx | packages/shadcn/test/fixtures/frameworks/next-app-custom-alias/app/layout.tsx | import './globals.css'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
const inter = Inter({ subsets: ['latin'] })
export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
}
export default function RootLayout({
children,
}: {
chi... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/next-app-custom-alias/app/page.tsx | packages/shadcn/test/fixtures/frameworks/next-app-custom-alias/app/page.tsx | import Image from 'next/image'
export default function Home() {
return (
<main className="flex min-h-screen flex-col items-center justify-between p-24">
<div className="z-10 max-w-5xl w-full items-center justify-between font-mono text-sm lg:flex">
<p className="fixed left-0 top-0 flex w-full justif... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/next-pages-src/tailwind.config.ts | packages/shadcn/test/fixtures/frameworks/next-pages-src/tailwind.config.ts | // @ts-nocheck
import type { Config } from 'tailwindcss'
const config: Config = {
content: [
'./src/pages/**/*.{js,ts,jsx,tsx,mdx}',
'./src/components/**/*.{js,ts,jsx,tsx,mdx}',
'./src/app/**/*.{js,ts,jsx,tsx,mdx}'
],
theme: {
extend: {
backgroundImage: {
'gradient-radial': 'radial-... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/next-pages-src/next-env.d.ts | packages/shadcn/test/fixtures/frameworks/next-pages-src/next-env.d.ts | /// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
| typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/next-pages-src/src/pages/_app.tsx | packages/shadcn/test/fixtures/frameworks/next-pages-src/src/pages/_app.tsx | import '@/styles/globals.css'
import type { AppProps } from 'next/app'
export default function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
}
| typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/next-pages-src/src/pages/index.tsx | packages/shadcn/test/fixtures/frameworks/next-pages-src/src/pages/index.tsx | import Image from 'next/image'
import { Inter } from 'next/font/google'
const inter = Inter({ subsets: ['latin'] })
export default function Home() {
return (
<main
className={`flex min-h-screen flex-col items-center justify-between p-24 ${inter.className}`}
>
<div className="z-10 max-w-5xl w-ful... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/next-pages-src/src/pages/_document.tsx | packages/shadcn/test/fixtures/frameworks/next-pages-src/src/pages/_document.tsx | import { Html, Head, Main, NextScript } from 'next/document'
export default function Document() {
return (
<Html lang="en">
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
| typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/next-pages-src/src/pages/api/hello.ts | packages/shadcn/test/fixtures/frameworks/next-pages-src/src/pages/api/hello.ts | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from 'next'
type Data = {
name: string
}
export default function handler(
req: NextApiRequest,
res: NextApiResponse<Data>
) {
res.status(200).json({ name: 'John Doe' })
}
| typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/vitest.config.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/vitest.config.ts | /// <reference types="vitest" />
/// <reference types="vite/client" />
import react from "@vitejs/plugin-react";
import tsconfigPaths from "vite-tsconfig-paths";
import { defineConfig } from "vitest/config";
export default defineConfig({
plugins: [react(), tsconfigPaths()],
test: {
globals: true,
environm... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress.config.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress.config.ts | import { defineConfig } from "cypress";
export default defineConfig({
e2e: {
setupNodeEvents: (on, config) => {
const isDev = config.watchForFileChanges;
const port = process.env.PORT ?? (isDev ? "3000" : "8811");
const configOverrides: Partial<Cypress.PluginConfigOptions> = {
baseUrl: ... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/tailwind.config.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/tailwind.config.ts | import type { Config } from "tailwindcss";
export default {
content: ["./app/**/*.{js,jsx,ts,tsx}"],
theme: {
extend: {},
},
plugins: [],
} satisfies Config;
| typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/remix.env.d.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/remix.env.d.ts | /// <reference types="@remix-run/dev" />
/// <reference types="@remix-run/node" />
| typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/utils.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/utils.ts | import { useMatches } from "@remix-run/react";
import { useMemo } from "react";
import type { User } from "~/models/user.server";
const DEFAULT_REDIRECT = "/";
/**
* This should be used any time the redirect path is user-provided
* (Like the query string on our login/signup pages). This avoids
* open-redirect vul... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/utils.test.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/utils.test.ts | import { validateEmail } from "./utils";
test("validateEmail returns false for non-emails", () => {
expect(validateEmail(undefined)).toBe(false);
expect(validateEmail(null)).toBe(false);
expect(validateEmail("")).toBe(false);
expect(validateEmail("not-an-email")).toBe(false);
expect(validateEmail("n@")).toBe... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/root.tsx | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/root.tsx | import { cssBundleHref } from "@remix-run/css-bundle";
import type { LinksFunction, LoaderFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
import {
Links,
LiveReload,
Meta,
Outlet,
Scripts,
ScrollRestoration,
} from "@remix-run/react";
import { getUser } from "~/session.server... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/entry.server.tsx | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/entry.server.tsx | /**
* By default, Remix will handle generating the HTTP Response for you.
* You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨
* For more information, see https://remix.run/docs/en/main/file-conventions/entry.server
*/
import { PassThrough } ... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/session.server.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/session.server.ts | import { createCookieSessionStorage, redirect } from "@remix-run/node";
import invariant from "tiny-invariant";
import type { User } from "~/models/user.server";
import { getUserById } from "~/models/user.server";
invariant(process.env.SESSION_SECRET, "SESSION_SECRET must be set");
export const sessionStorage = crea... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/db.server.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/db.server.ts | import { PrismaClient } from "@prisma/client";
import { singleton } from "./singleton.server";
// Hard-code a unique key, so we can look up the client when this module gets re-imported
const prisma = singleton("prisma", () => new PrismaClient());
prisma.$connect();
export { prisma };
| typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/singleton.server.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/singleton.server.ts | // Since the dev server re-requires the bundle, do some shenanigans to make
// certain things persist across that 😆
// Borrowed/modified from https://github.com/jenseng/abuse-the-platform/blob/2993a7e846c95ace693ce61626fa072174c8d9c7/app/utils/singleton.ts
export const singleton = <Value>(
name: string,
valueFact... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/entry.client.tsx | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/entry.client.tsx | /**
* By default, Remix will handle hydrating your app on the client for you.
* You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨
* For more information, see https://remix.run/docs/en/main/file-conventions/entry.client
*/
import { RemixBrows... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/notes.$noteId.tsx | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/notes.$noteId.tsx | import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import {
Form,
isRouteErrorResponse,
useLoaderData,
useRouteError,
} from "@remix-run/react";
import invariant from "tiny-invariant";
import { deleteNote, getNote } from "~/models/no... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/notes._index.tsx | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/notes._index.tsx | import { Link } from "@remix-run/react";
export default function NoteIndexPage() {
return (
<p>
No note selected. Select a note on the left, or{" "}
<Link to="new" className="text-blue-500 underline">
create a new note.
</Link>
</p>
);
}
| typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/notes.new.tsx | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/notes.new.tsx | import type { ActionFunctionArgs } from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { Form, useActionData } from "@remix-run/react";
import { useEffect, useRef } from "react";
import { createNote } from "~/models/note.server";
import { requireUserId } from "~/session.server";
export co... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/join.tsx | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/join.tsx | import type {
ActionFunctionArgs,
LoaderFunctionArgs,
MetaFunction,
} from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { Form, Link, useActionData, useSearchParams } from "@remix-run/react";
import { useEffect, useRef } from "react";
import { createUser, getUserByEmail } from "~/m... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/logout.tsx | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/logout.tsx | import type { ActionFunctionArgs } from "@remix-run/node";
import { redirect } from "@remix-run/node";
import { logout } from "~/session.server";
export const action = async ({ request }: ActionFunctionArgs) =>
logout(request);
export const loader = async () => redirect("/");
| typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/_index.tsx | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/_index.tsx | import type { MetaFunction } from "@remix-run/node";
import { Link } from "@remix-run/react";
import { useOptionalUser } from "~/utils";
export const meta: MetaFunction = () => [{ title: "Remix Notes" }];
export default function Index() {
const user = useOptionalUser();
return (
<main className="relative min... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/notes.tsx | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/notes.tsx | import type { LoaderFunctionArgs } from "@remix-run/node";
import { json } from "@remix-run/node";
import { Form, Link, NavLink, Outlet, useLoaderData } from "@remix-run/react";
import { getNoteListItems } from "~/models/note.server";
import { requireUserId } from "~/session.server";
import { useUser } from "~/utils";... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/healthcheck.tsx | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/healthcheck.tsx | // learn more: https://fly.io/docs/reference/configuration/#services-http_checks
import type { LoaderFunctionArgs } from "@remix-run/node";
import { prisma } from "~/db.server";
export const loader = async ({ request }: LoaderFunctionArgs) => {
const host =
request.headers.get("X-Forwarded-Host") ?? request.hea... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/login.tsx | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/routes/login.tsx | import type {
ActionFunctionArgs,
LoaderFunctionArgs,
MetaFunction,
} from "@remix-run/node";
import { json, redirect } from "@remix-run/node";
import { Form, Link, useActionData, useSearchParams } from "@remix-run/react";
import { useEffect, useRef } from "react";
import { verifyLogin } from "~/models/user.serv... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/models/note.server.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/models/note.server.ts | import type { User, Note } from "@prisma/client";
import { prisma } from "~/db.server";
export function getNote({
id,
userId,
}: Pick<Note, "id"> & {
userId: User["id"];
}) {
return prisma.note.findFirst({
select: { id: true, body: true, title: true },
where: { id, userId },
});
}
export function g... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/models/user.server.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/models/user.server.ts | import type { Password, User } from "@prisma/client";
import bcrypt from "bcryptjs";
import { prisma } from "~/db.server";
export type { User } from "@prisma/client";
export async function getUserById(id: User["id"]) {
return prisma.user.findUnique({ where: { id } });
}
export async function getUserByEmail(email:... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/test/setup-test-env.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/test/setup-test-env.ts | import { installGlobals } from "@remix-run/node";
import "@testing-library/jest-dom/vitest";
installGlobals();
| typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress/support/e2e.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress/support/e2e.ts | import "@testing-library/cypress/add-commands";
import { registerCommands } from "./commands";
registerCommands();
Cypress.on("uncaught:exception", (err) => {
// Cypress and React Hydrating the document don't get along
// for some unknown reason. Hopefully we figure out why eventually
// so we can remove this.
... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress/support/commands.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress/support/commands.ts | import { faker } from "@faker-js/faker";
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace Cypress {
interface Chainable {
/**
* Logs in with a random user. Yields the user and adds an alias to the user
*
* @returns {typeof login}
* @member... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress/support/delete-user.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress/support/delete-user.ts | // Use this to delete a user by their email
// Simply call this with:
// npx ts-node -r tsconfig-paths/register ./cypress/support/delete-user.ts username@example.com,
// and that user will get deleted
import { PrismaClientKnownRequestError } from "@prisma/client/runtime/library";
import { installGlobals } from "@remix... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress/support/create-user.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress/support/create-user.ts | // Use this to create a new user and login with that user
// Simply call this with:
// npx ts-node -r tsconfig-paths/register ./cypress/support/create-user.ts username@example.com,
// and it will log out the cookie value you can use to interact with the server
// as that new user.
import { installGlobals } from "@remi... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress/e2e/smoke.cy.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/cypress/e2e/smoke.cy.ts | import { faker } from "@faker-js/faker";
describe("smoke tests", () => {
afterEach(() => {
cy.cleanupUser();
});
it("should allow you to register and login", () => {
const loginForm = {
email: `${faker.internet.userName()}@example.com`,
password: faker.internet.password(),
};
cy.the... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/remix-indie-stack/prisma/seed.ts | packages/shadcn/test/fixtures/frameworks/remix-indie-stack/prisma/seed.ts | import { PrismaClient } from "@prisma/client";
import bcrypt from "bcryptjs";
const prisma = new PrismaClient();
async function seed() {
const email = "rachel@remix.run";
// cleanup the existing database
await prisma.user.delete({ where: { email } }).catch(() => {
// no worries if it doesn't exist yet
})... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/next-pages/tailwind.config.ts | packages/shadcn/test/fixtures/frameworks/next-pages/tailwind.config.ts | // @ts-nocheck
import type { Config } from 'tailwindcss'
const config: Config = {
content: [
'./pages/**/*.{js,ts,jsx,tsx,mdx}',
'./components/**/*.{js,ts,jsx,tsx,mdx}',
'./app/**/*.{js,ts,jsx,tsx,mdx}'
],
theme: {
extend: {
backgroundImage: {
'gradient-radial': 'radial-gradient(var... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/next-pages/pages/_app.tsx | packages/shadcn/test/fixtures/frameworks/next-pages/pages/_app.tsx | import '~/styles/globals.css'
import type { AppProps } from 'next/app'
export default function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
}
| typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/next-pages/pages/index.tsx | packages/shadcn/test/fixtures/frameworks/next-pages/pages/index.tsx | import Image from 'next/image'
import { Inter } from 'next/font/google'
const inter = Inter({ subsets: ['latin'] })
export default function Home() {
return (
<main
className={`flex min-h-screen flex-col items-center justify-between p-24 ${inter.className}`}
>
<div className="z-10 max-w-5xl w-ful... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/next-pages/pages/_document.tsx | packages/shadcn/test/fixtures/frameworks/next-pages/pages/_document.tsx | import { Html, Head, Main, NextScript } from 'next/document'
export default function Document() {
return (
<Html lang="en">
<Head />
<body>
<Main />
<NextScript />
</body>
</Html>
)
}
| typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/fixtures/frameworks/next-pages/pages/api/hello.ts | packages/shadcn/test/fixtures/frameworks/next-pages/pages/api/hello.ts | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction
import type { NextApiRequest, NextApiResponse } from 'next'
type Data = {
name: string
}
export default function handler(
req: NextApiRequest,
res: NextApiResponse<Data>
) {
res.status(200).json({ name: 'John Doe' })
}
| typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/transform-import.test.ts | packages/shadcn/test/utils/transform-import.test.ts | import { expect, test } from "vitest"
import { transform } from "../../src/utils/transformers"
test('transform nested workspace folder for utils, website/src/utils', async () => {
expect(
await transform({
filename: "test.ts",
raw: `import { Button } from "website/src/components/ui/button"
i... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/apply-color-mapping.test.ts | packages/shadcn/test/utils/apply-color-mapping.test.ts | import { describe, expect, test } from "vitest"
import {
applyColorMapping,
splitClassName,
} from "../../src/utils/transformers/transform-css-vars"
import baseColor from "../fixtures/colors/slate.json"
describe("split className", () => {
test.each([
{
input: "bg-popover",
output: [null, "bg-pop... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/resolve-import.test.ts | packages/shadcn/test/utils/resolve-import.test.ts | import path from "path"
import { loadConfig, type ConfigLoaderSuccessResult } from "tsconfig-paths"
import { expect, test } from "vitest"
import { resolveImport } from "../../src/utils/resolve-import"
test("resolve import", async () => {
expect(
await resolveImport("@/foo/bar", {
absoluteBaseUrl: "/Users/... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/get-item-target-path.test.ts | packages/shadcn/test/utils/get-item-target-path.test.ts | import path from "path"
import { expect, test } from "vitest"
import { getItemTargetPath } from "../../src/registry/api"
import { getConfig } from "../../src/utils/get-config"
test("get item target path", async () => {
// Full config.
let appDir = path.resolve(__dirname, "../fixtures/config-full")
expect(
a... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/get-tailwind-css-file.test.ts | packages/shadcn/test/utils/get-tailwind-css-file.test.ts | import path from "path"
import { describe, expect, test } from "vitest"
import { getTailwindCssFile } from "../../src/utils/get-project-info"
describe("get tailwindcss file", async () => {
test.each([
{
name: "next-app",
file: "app/globals.css",
},
{
name: "next-app-src",
file: "... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/transform-rsc.test.ts | packages/shadcn/test/utils/transform-rsc.test.ts | import { expect, test } from "vitest"
import { transform } from "../../src/utils/transformers"
test("transform rsc", async () => {
expect(
await transform({
filename: "test.ts",
raw: `import * as React from "react"
import { Foo } from "bar"
`,
config: {
tsx: true,
rsc: true... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/apply-prefix.test.ts | packages/shadcn/test/utils/apply-prefix.test.ts | import { describe, expect, test } from "vitest"
import { applyPrefix } from "../../src/utils/transformers/transform-tw-prefix"
describe("apply tailwind prefix v3", () => {
test.each([
{
input: "bg-slate-800 text-gray-500",
output: "tw-bg-slate-800 tw-text-gray-500",
},
{
input: "hover:... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/get-ts-config-alias-prefix.test.ts | packages/shadcn/test/utils/get-ts-config-alias-prefix.test.ts | import path from "path"
import { describe, expect, test } from "vitest"
import { getTsConfigAliasPrefix } from "../../src/utils/get-project-info"
describe("get ts config alias prefix", async () => {
test.each([
{
name: "next-app",
prefix: "@",
},
{
name: "next-app-src",
prefix: "... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/get-project-info.test.ts | packages/shadcn/test/utils/get-project-info.test.ts | import path from "path"
import { describe, expect, test } from "vitest"
import { FRAMEWORKS } from "../../src/utils/frameworks"
import {
getFrameworkVersion,
getProjectInfo,
} from "../../src/utils/get-project-info"
describe("get project info", async () => {
test.each([
{
name: "next-app",
type:... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/get-package-manager.test.ts | packages/shadcn/test/utils/get-package-manager.test.ts | import path from "path"
import { expect, test } from "vitest"
import { getPackageManager } from "../../src/utils/get-package-manager"
test("get package manager", async () => {
expect(
await getPackageManager(path.resolve(__dirname, "../fixtures/project-yarn"))
).toBe("yarn")
expect(
await getPackageMan... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/is-typescript-project.test.ts | packages/shadcn/test/utils/is-typescript-project.test.ts | import path from "path"
import { describe, expect, test } from "vitest"
import { isTypeScriptProject } from "../../src/utils/get-project-info"
describe("is TypeScript project", async () => {
test.each([
{
name: "next-app",
result: true,
},
{
name: "next-app-src",
result: true,
... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/transform-tw-prefix.test.ts | packages/shadcn/test/utils/transform-tw-prefix.test.ts | import { expect, test } from "vitest"
import { transform } from "../../src/utils/transformers"
import { applyPrefixesCss } from "../../src/utils/transformers/transform-tw-prefix"
import stone from "../fixtures/colors/stone.json"
test("transform tailwind prefix", async () => {
expect(
await transform({
fil... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/transform-css-vars.test.ts | packages/shadcn/test/utils/transform-css-vars.test.ts | import { expect, test } from "vitest"
import { transform } from "../../src/utils/transformers"
import stone from "../fixtures/colors/stone.json"
test("transform css vars", async () => {
expect(
await transform({
filename: "test.ts",
raw: `import * as React from "react"
export function Foo() {
retur... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/get-config.test.ts | packages/shadcn/test/utils/get-config.test.ts | import path from "path"
import { describe, expect, test } from "vitest"
import {
createConfig,
getConfig,
getRawConfig,
} from "../../src/utils/get-config"
test("get raw config", async () => {
expect(
await getRawConfig(path.resolve(__dirname, "../fixtures/config-none"))
).toEqual(null)
expect(
a... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/registry.test.ts | packages/shadcn/test/utils/registry.test.ts | import { expect, test } from "vitest"
import { z } from "zod"
import { resolveTree } from "../../src/registry/api"
import { registryItemSchema } from "../../src/registry/schema"
test("resolve tree", async () => {
const index = [
{
name: "button",
dependencies: ["@radix-ui/react-slot"],
type: "... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/updaters/update-tailwind-content.test.ts | packages/shadcn/test/utils/updaters/update-tailwind-content.test.ts | import { describe, expect, test } from "vitest"
import { transformTailwindContent } from "../../../src/utils/updaters/update-tailwind-content"
const SHARED_CONFIG = {
$schema: "https://ui.shadcn.com/schema.json",
style: "new-york",
rsc: true,
tsx: true,
tailwind: {
config: "tailwind.config.ts",
css:... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/updaters/update-files.test.ts | packages/shadcn/test/utils/updaters/update-files.test.ts | import { existsSync, promises as fs } from "fs"
import path from "path"
import { afterAll, afterEach, describe, expect, test, vi } from "vitest"
import { getConfig } from "../../../src/utils/get-config"
import {
findCommonRoot,
resolveFilePath,
resolveModuleByProbablePath,
resolveNestedFilePath,
toAliasedImp... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | true |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/updaters/update-css.test.ts | packages/shadcn/test/utils/updaters/update-css.test.ts | import { describe, expect, test } from "vitest"
import { transformCss } from "../../../src/utils/updaters/update-css"
describe("transformCss", () => {
test("should add utility classes", async () => {
const input = `@import "tailwindcss";`
const result = await transformCss(input, {
"@utility content-a... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/updaters/update-css-vars.test.ts | packages/shadcn/test/utils/updaters/update-css-vars.test.ts | import { describe, expect, test } from "vitest"
import {
isColorValue,
isLocalHSLValue,
transformCssVars,
} from "../../../src/utils/updaters/update-css-vars"
describe("transformCssVars", () => {
test("should add light and dark css vars if not present", async () => {
expect(
await transformCssVars(
... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/updaters/update-tailwind-config.test.ts | packages/shadcn/test/utils/updaters/update-tailwind-config.test.ts | import { Project, SyntaxKind } from "ts-morph"
import { beforeEach, describe, expect, test } from "vitest"
import {
buildTailwindThemeColorsFromCssVars, nestSpreadElements,
nestSpreadProperties,
transformTailwindConfig,
unnestSpreadProperties, unsetSpreadElements,
} from "../../../src/utils/updaters/update-tai... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | true |
shadcn-ui/ui | https://github.com/shadcn-ui/ui/blob/ccafdaf7c6f6747a24f54e84436b42ec42f01779/packages/shadcn/test/utils/updaters/update-dependencies.test.ts | packages/shadcn/test/utils/updaters/update-dependencies.test.ts | import path from "path"
import { execa } from "execa"
import prompts from "prompts"
import { afterEach, describe, expect, test, vi } from "vitest"
import { updateDependencies } from "../../../src/utils/updaters/update-dependencies"
vi.mock("execa")
vi.mock("prompts")
describe("updateDependencies", () => {
afterEac... | typescript | MIT | ccafdaf7c6f6747a24f54e84436b42ec42f01779 | 2026-01-04T15:25:31.746168Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/ci/dev/watch.ts | ci/dev/watch.ts | import { spawn, ChildProcess } from "child_process"
import * as path from "path"
import { onLine, OnLineCallback } from "../../src/node/util"
interface DevelopmentCompilers {
[key: string]: ChildProcess | undefined
vscode: ChildProcess
vscodeWebExtensions: ChildProcess
codeServer: ChildProcess
plugins: Child... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/entry.ts | src/node/entry.ts | import { logger } from "@coder/logger"
import { optionDescriptions, parse, readConfigFile, setDefaults, shouldOpenInExistingInstance } from "./cli"
import { getVersionString, getVersionJsonString } from "./constants"
import { openInExistingInstance, runCodeServer, runCodeCli, shouldSpawnCliProcess } from "./main"
impor... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/heart.ts | src/node/heart.ts | import { logger } from "@coder/logger"
import { promises as fs } from "fs"
import { Emitter } from "../common/emitter"
/**
* Provides a heartbeat using a local file to indicate activity.
*/
export class Heart {
private heartbeatTimer?: NodeJS.Timeout
private heartbeatInterval = 60000
public lastHeartbeat = 0
... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/vscodeSocket.ts | src/node/vscodeSocket.ts | import { logger } from "@coder/logger"
import express from "express"
import * as http from "http"
import * as path from "path"
import { HttpCode, HttpError } from "../common/http"
import { listen } from "./app"
import { errorHandler } from "./routes/errors"
import { canConnect } from "./util"
export interface EditorSe... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/wsRouter.ts | src/node/wsRouter.ts | import * as express from "express"
import * as expressCore from "express-serve-static-core"
import * as http from "http"
import * as stream from "stream"
import Websocket from "ws"
export interface WebsocketRequest extends express.Request {
ws: stream.Duplex
head: Buffer
}
interface InternalWebsocketRequest exten... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/util.ts | src/node/util.ts | import * as argon2 from "argon2"
import * as cp from "child_process"
import * as crypto from "crypto"
import envPaths from "env-paths"
import { promises as fs } from "fs"
import * as net from "net"
import * as os from "os"
import * as path from "path"
import safeCompare from "safe-compare"
import * as util from "util"
... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/update.ts | src/node/update.ts | import { field, logger } from "@coder/logger"
import * as http from "http"
import * as https from "https"
import { ProxyAgent } from "proxy-agent"
import * as semver from "semver"
import * as url from "url"
import { httpProxyUri, version } from "./constants"
import { SettingsProvider, UpdateSettings } from "./settings"... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/cli.ts | src/node/cli.ts | import { field, Level, logger } from "@coder/logger"
import { promises as fs } from "fs"
import { load } from "js-yaml"
import * as path from "path"
import { generateCertificate, generatePassword, paths, splitOnFirstEquals } from "./util"
import { EditorSessionManagerClient } from "./vscodeSocket"
export enum Feature ... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/http.ts | src/node/http.ts | import { field, logger } from "@coder/logger"
import * as express from "express"
import * as http from "http"
import * as net from "net"
import qs from "qs"
import { Disposable } from "../common/emitter"
import { HttpCode, HttpError } from "../common/http"
import { normalize } from "../common/util"
import { AuthType, D... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/wrapper.ts | src/node/wrapper.ts | import { field, Logger, logger } from "@coder/logger"
import * as cp from "child_process"
import * as path from "path"
import * as rfs from "rotating-file-stream"
import { Emitter } from "../common/emitter"
import { DefaultedArgs, redactArgs } from "./cli"
import { paths } from "./util"
const timeoutInterval = 10000 /... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/proxy.ts | src/node/proxy.ts | import proxyServer from "http-proxy"
import { HttpCode } from "../common/http"
export const proxy = proxyServer.createProxyServer({})
// The error handler catches when the proxy fails to connect (for example when
// there is nothing running on the target port).
proxy.on("error", (error, _, res) => {
// This could b... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/main.ts | src/node/main.ts | import { field, logger } from "@coder/logger"
import http from "http"
import * as os from "os"
import * as path from "path"
import { Disposable } from "../common/emitter"
import { plural } from "../common/util"
import { createApp, ensureAddress } from "./app"
import { AuthType, DefaultedArgs, Feature, toCodeArgs, UserP... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/settings.ts | src/node/settings.ts | import { logger } from "@coder/logger"
import type { ParsedQs } from "qs"
import { promises as fs } from "fs"
export type Settings = { [key: string]: Settings | string | boolean | number }
/**
* Provides read and write access to settings.
*/
export class SettingsProvider<T> {
public constructor(private readonly s... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/constants.ts | src/node/constants.ts | import { logger } from "@coder/logger"
import type { JSONSchemaForNPMPackageJsonFiles } from "@schemastore/package"
import * as os from "os"
import * as path from "path"
export function getPackageJson(relativePath: string): JSONSchemaForNPMPackageJsonFiles {
let pkg = {}
try {
pkg = require(relativePath)
} c... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/app.ts | src/node/app.ts | import { logger } from "@coder/logger"
import compression from "compression"
import express, { Express } from "express"
import { promises as fs } from "fs"
import http from "http"
import * as httpolyglot from "httpolyglot"
import { Disposable } from "../common/emitter"
import * as util from "../common/util"
import { De... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/socket.ts | src/node/socket.ts | import { promises as fs } from "fs"
import * as net from "net"
import * as path from "path"
import * as stream from "stream"
import * as tls from "tls"
import { Emitter } from "../common/emitter"
import { generateUuid } from "../common/util"
import { canConnect, paths } from "./util"
/**
* Provides a way to proxy a T... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/routes/logout.ts | src/node/routes/logout.ts | import { Router } from "express"
import { getCookieOptions, redirect } from "../http"
import { sanitizeString } from "../util"
export const router = Router()
router.get<{}, undefined, undefined, { base?: string; to?: string }>("/", async (req, res) => {
// Must use the *identical* properties used to set the cookie.... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/routes/errors.ts | src/node/routes/errors.ts | import { logger } from "@coder/logger"
import express from "express"
import { promises as fs } from "fs"
import path from "path"
import { HttpCode } from "../../common/http"
import { rootPath } from "../constants"
import { replaceTemplates } from "../http"
import { escapeHtml, getMediaMime } from "../util"
import type ... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/routes/vscode.ts | src/node/routes/vscode.ts | import { logger } from "@coder/logger"
import * as crypto from "crypto"
import * as express from "express"
import { promises as fs } from "fs"
import * as http from "http"
import * as net from "net"
import * as os from "os"
import * as path from "path"
import { logError } from "../../common/util"
import { CodeArgs, toC... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/routes/health.ts | src/node/routes/health.ts | import { Router } from "express"
import { wss, Router as WsRouter } from "../wsRouter"
export const router = Router()
router.get("/", (req, res) => {
res.json({
status: req.heart.alive() ? "alive" : "expired",
lastHeartbeat: req.heart.lastHeartbeat,
})
})
export const wsRouter = WsRouter()
wsRouter.ws("... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/routes/login.ts | src/node/routes/login.ts | import { Router, Request } from "express"
import { promises as fs } from "fs"
import { RateLimiter as Limiter } from "limiter"
import * as path from "path"
import { rootPath } from "../constants"
import { authenticated, getCookieOptions, redirect, replaceTemplates } from "../http"
import i18n from "../i18n"
import { ge... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/routes/pathProxy.ts | src/node/routes/pathProxy.ts | import { Request, Response } from "express"
import * as path from "path"
import { HttpCode, HttpError } from "../../common/http"
import { ensureProxyEnabled, authenticated, ensureAuthenticated, ensureOrigin, redirect, self } from "../http"
import { proxy as _proxy } from "../proxy"
import type { WebsocketRequest } from... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/routes/update.ts | src/node/routes/update.ts | import { Router } from "express"
import { version } from "../constants"
import { ensureAuthenticated } from "../http"
export const router = Router()
router.get("/check", ensureAuthenticated, async (req, res) => {
const update = await req.updater.getUpdate(req.query.force === "true")
res.json({
checked: update... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/routes/domainProxy.ts | src/node/routes/domainProxy.ts | import { Request, Router } from "express"
import { HttpCode, HttpError } from "../../common/http"
import { getHost, ensureProxyEnabled, authenticated, ensureAuthenticated, ensureOrigin, redirect, self } from "../http"
import { proxy } from "../proxy"
import { Router as WsRouter } from "../wsRouter"
export const router... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/routes/index.ts | src/node/routes/index.ts | import { logger } from "@coder/logger"
import cookieParser from "cookie-parser"
import * as express from "express"
import { promises as fs } from "fs"
import * as path from "path"
import * as tls from "tls"
import { Disposable } from "../../common/emitter"
import { getCookieSessionName, HttpCode, HttpError } from "../.... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/node/i18n/index.ts | src/node/i18n/index.ts | import { promises as fs } from "fs"
import i18next, { init } from "i18next"
import * as en from "./locales/en.json"
import * as ja from "./locales/ja.json"
import * as th from "./locales/th.json"
import * as ur from "./locales/ur.json"
import * as zhCn from "./locales/zh-cn.json"
const defaultResources = {
en: {
... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/common/util.ts | src/common/util.ts | /**
* Appends an 's' to the provided string if count is greater than one;
* otherwise the string is returned
*/
export const plural = (count: number, str: string): string => (count === 1 ? str : `${str}s`)
export const generateUuid = (length = 24): string => {
const possible = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXY... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/common/http.ts | src/common/http.ts | export enum HttpCode {
Ok = 200,
Redirect = 302,
NotFound = 404,
BadRequest = 400,
Unauthorized = 401,
Forbidden = 403,
LargePayload = 413,
ServerError = 500,
}
/**
* Represents an error with a message and an HTTP status code. This code will be
* used in the HTTP response.
*/
export class HttpError ... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/common/emitter.ts | src/common/emitter.ts | import { logger } from "@coder/logger"
/**
* Event emitter callback. Called with the emitted value and a promise that
* resolves when all emitters have finished.
*/
export type Callback<T, R = void | Promise<void>> = (t: T, p: Promise<void>) => R
export interface Disposable {
dispose(): void | Promise<void>
}
e... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/src/browser/serviceWorker.ts | src/browser/serviceWorker.ts | self.addEventListener("install", () => {
console.debug("[Service Worker] installed")
})
self.addEventListener("activate", (event: any) => {
event.waitUntil((self as any).clients.claim())
console.debug("[Service Worker] activated")
})
self.addEventListener("fetch", () => {
// Without this event handler we won'... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/playwright.config.ts | test/playwright.config.ts | import { PlaywrightTestConfig } from "@playwright/test"
import path from "path"
// The default configuration runs all tests in three browsers with workers equal
// to half the available threads. See 'npm run test:e2e --help' to customize
// from the command line. For example:
// npm run test:e2e --workers 1 ... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/integration/help.test.ts | test/integration/help.test.ts | import { runCodeServerCommand } from "../utils/runCodeServerCommand"
// NOTE@jsjoeio
// We have this test to ensure that native modules
// work as expected. If this is called on the wrong
// platform, the test will fail.
describe("--help", () => {
it("should list code-server usage", async () => {
const expectedO... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/integration/installExtension.test.ts | test/integration/installExtension.test.ts | import { clean, tmpdir } from "../utils/helpers"
import { runCodeServerCommand } from "../utils/runCodeServerCommand"
describe("--install-extension", () => {
const testName = "installExtension"
let tempDir: string
let setupFlags: string[]
beforeEach(async () => {
await clean(testName)
tempDir = await ... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/utils/wtfnode.ts | test/utils/wtfnode.ts | import * as util from "util"
import * as wtfnode from "wtfnode"
// Jest seems to hijack console.log in a way that makes the output difficult to
// read. So we'll write directly to process.stderr instead.
const write = (...args: [any, ...any]) => {
if (args.length > 0) {
process.stderr.write(util.format(...args) ... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
coder/code-server | https://github.com/coder/code-server/blob/ac7322ce566a5dc99c60d92180375329f0bbd759/test/utils/globalE2eSetup.ts | test/utils/globalE2eSetup.ts | import { promises as fs } from "fs"
import * as path from "path"
import { workspaceDir } from "./constants"
import { clean, tmpdir } from "./helpers"
import * as wtfnode from "./wtfnode"
/**
* Perform workspace cleanup and authenticate. This should be ran before e2e
* tests execute.
*/
export default async function... | typescript | MIT | ac7322ce566a5dc99c60d92180375329f0bbd759 | 2026-01-04T15:25:48.680392Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.