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
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/lib/dom/ssr/data.ts
packages/react-router/lib/dom/ssr/data.ts
// eslint-disable-next-line @typescript-eslint/no-unused-vars import type * as _ from "../global"; export async function createRequestInit( request: Request, ): Promise<RequestInit> { let init: RequestInit = { signal: request.signal }; if (request.method !== "GET") { init.method = request.method; let c...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/lib/dom/ssr/components.tsx
packages/react-router/lib/dom/ssr/components.tsx
import type { FocusEventHandler, MouseEventHandler, TouchEventHandler, } from "react"; import * as React from "react"; import type { RouterState } from "../../router/router"; import type { AgnosticDataRouteMatch } from "../../router/utils"; import { matchRoutes } from "../../router/utils"; import type { Framewo...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/lib/router/instrumentation.ts
packages/react-router/lib/router/instrumentation.ts
import type { AppLoadContext } from "../server-runtime/data"; import type { RequestHandler } from "../server-runtime/server"; import type { MiddlewareEnabled } from "../types/future"; import { createPath, invariant } from "./history"; import type { Router } from "./router"; import type { ActionFunctionArgs, Agnosti...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/lib/router/router.ts
packages/react-router/lib/router/router.ts
import type { DataRouteMatch, RouteObject } from "../context"; import type { History, Location, Path, To } from "./history"; import { Action as NavigationType, createLocation, createPath, createBrowserURLImpl, invariant, parsePath, warning, } from "./history"; import type { unstable_ClientInstrumentatio...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
true
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/lib/router/utils.ts
packages/react-router/lib/router/utils.ts
import type { MiddlewareEnabled } from "../types/future"; import type { Equal, Expect } from "../types/utils"; import type { Location, Path, To } from "./history"; import { invariant, parsePath, warning } from "./history"; export type MaybePromise<T> = T | Promise<T>; /** * Map of routeId -> data returned from a loa...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
true
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/lib/router/history.ts
packages/react-router/lib/router/history.ts
//////////////////////////////////////////////////////////////////////////////// //#region Types and Constants //////////////////////////////////////////////////////////////////////////////// /** * Actions represent the type of change to a location value. */ export enum Action { /** * A POP indicates a change t...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/lib/router/links.ts
packages/react-router/lib/router/links.ts
type Primitive = null | undefined | string | number | boolean | symbol | bigint; type LiteralUnion<LiteralType, BaseType extends Primitive> = | LiteralType | (BaseType & Record<never, never>); interface HtmlLinkProps { /** * Address of the hyperlink */ href?: string; /** * How the element handles ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/lib/rsc/server.rsc.ts
packages/react-router/lib/rsc/server.rsc.ts
// eslint-disable-next-line import/no-nodejs-modules import { AsyncLocalStorage } from "node:async_hooks"; import * as React from "react"; import type { ClientActionFunction, ClientLoaderFunction, HeadersFunction, LinksFunction, MetaFunction, } from "../dom/ssr/routeModules"; import { type Location } from "....
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
true
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/lib/rsc/errorBoundaries.tsx
packages/react-router/lib/rsc/errorBoundaries.tsx
import React from "react"; import { useRouteError } from "../hooks"; import type { Location } from "../router/history"; import { isRouteErrorResponse } from "../router/utils"; import { ENABLE_DEV_WARNINGS } from "../context"; type RSCRouterGlobalErrorBoundaryProps = React.PropsWithChildren<{ location: Location; }>; ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/lib/rsc/browser.tsx
packages/react-router/lib/rsc/browser.tsx
import * as React from "react"; import * as ReactDOM from "react-dom"; import { RouterProvider } from "../components"; import { RSCRouterContext, type DataRouteMatch, type DataRouteObject, } from "../context"; import { FrameworkContext, setIsHydrated } from "../dom/ssr/components"; import type { FrameworkContext...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
true
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/lib/rsc/route-modules.ts
packages/react-router/lib/rsc/route-modules.ts
import type { RouteModules } from "../dom/ssr/routeModules"; import type { RSCRenderPayload, RSCRouteManifest } from "./server.rsc"; export function createRSCRouteModules(payload: RSCRenderPayload): RouteModules { const routeModules: RouteModules = {}; for (const match of payload.matches) { populateRSCRouteMod...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/lib/rsc/server.ssr.tsx
packages/react-router/lib/rsc/server.ssr.tsx
import * as React from "react"; import { RSCRouterContext, type DataRouteObject } from "../context"; import { FrameworkContext } from "../dom/ssr/components"; import type { FrameworkContextObject } from "../dom/ssr/entry"; import { SINGLE_FETCH_REDIRECT_STATUS } from "../dom/ssr/single-fetch"; import { createStaticRout...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/lib/rsc/html-stream/browser.ts
packages/react-router/lib/rsc/html-stream/browser.ts
// https://github.com/devongovett/rsc-html-stream/blob/main/client.js declare global { interface Window { __FLIGHT_DATA: any[]; } } /** * Get the prerendered [RSC](https://react.dev/reference/rsc/server-components) * stream for hydration. Usually passed directly to your * `react-server-dom-xyz/client`'s `c...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router/lib/rsc/html-stream/server.ts
packages/react-router/lib/rsc/html-stream/server.ts
// https://github.com/devongovett/rsc-html-stream/blob/main/server.js const encoder = new TextEncoder(); const trailer = "</body></html>"; export function injectRSCPayload(rscStream: ReadableStream<Uint8Array>) { let decoder = new TextDecoder(); let resolveFlightDataPromise: (value: void) => void; let flightDat...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-node/stream.ts
packages/react-router-node/stream.ts
import type { Readable, Writable } from "node:stream"; import { Stream } from "node:stream"; export async function writeReadableStreamToWritable( stream: ReadableStream, writable: Writable, ) { let reader = stream.getReader(); let flushable = writable as { flush?: Function }; try { while (true) { ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-node/server.ts
packages/react-router-node/server.ts
import type { RequestListener } from "node:http"; import type { AppLoadContext, ServerBuild, UNSAFE_MiddlewareEnabled, RouterContextProvider, } from "react-router"; import { createRequestHandler } from "react-router"; import type { ClientAddress } from "@mjackson/node-fetch-server"; import { createRequestListe...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-node/tsup.config.ts
packages/react-router-node/tsup.config.ts
import { defineConfig } from "tsup"; // @ts-ignore - out of scope import { createBanner } from "../../build.utils.js"; import pkg from "./package.json"; const entry = ["index.ts"]; export default defineConfig([ { clean: true, entry, format: ["cjs", "esm"], outDir: "dist", dts: true, banner...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-node/index.ts
packages/react-router-node/index.ts
export { type RequestListenerOptions, createRequestListener } from "./server"; export { createFileSessionStorage } from "./sessions/fileStorage"; export { createReadableStreamFromReadable, readableStreamToString, writeAsyncIterableToWritable, writeReadableStreamToWritable, } from "./stream";
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-node/__tests__/sessions-test.ts
packages/react-router-node/__tests__/sessions-test.ts
/** * @jest-environment node */ import path from "node:path"; import { promises as fsp } from "node:fs"; import os from "node:os"; import { createFileSessionStorage, getFile } from "../sessions/fileStorage"; function getCookieFromSetCookie(setCookie: string): string { return setCookie.split(/;\s*/)[0]; } descri...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-node/sessions/fileStorage.ts
packages/react-router-node/sessions/fileStorage.ts
import { promises as fsp } from "node:fs"; import * as path from "node:path"; import type { SessionStorage, SessionIdStorageStrategy, SessionData, } from "react-router"; import { createSessionStorage } from "react-router"; interface FileSessionStorageOptions { /** * The Cookie used to store the session id o...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-cloudflare/tsup.config.ts
packages/react-router-cloudflare/tsup.config.ts
import { defineConfig } from "tsup"; // @ts-ignore - out of scope import { createBanner } from "../../build.utils.js"; import pkg from "./package.json"; const entry = ["index.ts"]; export default defineConfig([ { clean: true, entry, format: ["cjs", "esm"], outDir: "dist", dts: true, banner...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-cloudflare/index.ts
packages/react-router-cloudflare/index.ts
export { createWorkersKVSessionStorage } from "./sessions/workersKVStorage"; export type { createPagesFunctionHandlerParams, GetLoadContextFunction, RequestHandler, } from "./worker"; export { createPagesFunctionHandler, createRequestHandler } from "./worker";
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-cloudflare/worker.ts
packages/react-router-cloudflare/worker.ts
import type { AppLoadContext, UNSAFE_MiddlewareEnabled as MiddlewareEnabled, ServerBuild, RouterContextProvider, } from "react-router"; import { createRequestHandler as createReactRouterRequestHandler } from "react-router"; import { type CacheStorage } from "@cloudflare/workers-types"; type MaybePromise<T> = T...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-cloudflare/sessions/workersKVStorage.ts
packages/react-router-cloudflare/sessions/workersKVStorage.ts
import type { SessionStorage, SessionIdStorageStrategy, SessionData, } from "react-router"; import { createSessionStorage } from "react-router"; interface WorkersKVSessionStorageOptions { /** * The Cookie used to store the session id on the client, or options used * to automatically create one. */ c...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/config.ts
packages/react-router-dev/config.ts
export type { ReactRouterConfig as Config, BuildManifest, Preset, ServerBundlesFunction, } from "./config/config";
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/routes.ts
packages/react-router-dev/routes.ts
export type { RouteConfig, RouteConfigEntry } from "./config/routes"; export { route, index, layout, prefix, relative, getAppDirectory, } from "./config/routes";
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/invariant.ts
packages/react-router-dev/invariant.ts
export default function invariant( value: boolean, message?: string, ): asserts value; export default function invariant<T>( value: T | null | undefined, message?: string, ): asserts value is T; export default function invariant(value: any, message?: string) { if (value === false || value === null || typeof...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/rsc-types.d.ts
packages/react-router-dev/rsc-types.d.ts
declare module "virtual:react-router/unstable_rsc/routes" { import type { unstable_RSCRouteConfig as RSCRouteConfig } from "react-router"; const routes: RSCRouteConfig; export default routes; } declare module "virtual:react-router/unstable_rsc/basename" { const basename: string; export default basename; } ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite.ts
packages/react-router-dev/vite.ts
export { reactRouterVitePlugin as reactRouter } from "./vite/plugin"; export { reactRouterRSCVitePlugin as unstable_reactRouterRSC } from "./vite/rsc/plugin";
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/tsup.config.ts
packages/react-router-dev/tsup.config.ts
import * as fsp from "fs/promises"; import { defineConfig } from "tsup"; // @ts-ignore - out of scope import { createBanner } from "../../build.utils.js"; import pkg from "./package.json"; const entry = [ "cli/index.ts", "config.ts", "internal.ts", "routes.ts", "vite.ts", "vite/cloudflare.ts", ]; const...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/manifest.ts
packages/react-router-dev/manifest.ts
export type ManifestRoute = { id: string; parentId?: string; path?: string; index?: boolean; caseSensitive?: boolean; module: string; clientLoaderModule: string | undefined; clientActionModule: string | undefined; clientMiddlewareModule: string | undefined; hydrateFallbackModule: string | undefined;...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/has-dependency.ts
packages/react-router-dev/vite/has-dependency.ts
export function hasDependency({ name, rootDirectory, }: { name: string; rootDirectory: string; }) { try { return Boolean(require.resolve(name, { paths: [rootDirectory] })); } catch (err) { return false; } }
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/has-rsc-plugin.ts
packages/react-router-dev/vite/has-rsc-plugin.ts
import type * as Vite from "vite"; export async function hasReactRouterRscPlugin({ root, viteBuildOptions: { config, logLevel, mode }, }: { root: string; viteBuildOptions: { config?: string; logLevel?: Vite.LogLevel; mode?: string; }; }): Promise<boolean> { const vite = await import("vite"); ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/resolve-relative-route-file-path.ts
packages/react-router-dev/vite/resolve-relative-route-file-path.ts
import path from "pathe"; import type { ResolvedReactRouterConfig } from "../config/config"; import type { RouteManifestEntry } from "../config/routes"; import { getVite } from "./vite"; export function resolveRelativeRouteFilePath( route: RouteManifestEntry, reactRouterConfig: ResolvedReactRouterConfig, ) { let...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/profiler.ts
packages/react-router-dev/vite/profiler.ts
// Adapted from: // - https://github.com/vitejs/vite/blob/9fc5d9cb3a1b9df067e00959faa9da43ae03f776/packages/vite/bin/vite.js // - https://github.com/vitejs/vite/blob/9fc5d9cb3a1b9df067e00959faa9da43ae03f776/packages/vite/src/node/cli.ts import fs from "node:fs"; import type { Session } from "node:inspector"; import pa...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/combine-urls.ts
packages/react-router-dev/vite/combine-urls.ts
// Borrowed from axios: https://github.com/axios/axios/blob/0e4f9fa29077ebee4499facea6be1492b42e8a26/lib/helpers/combineURLs.js#L11-L15 export function combineURLs(baseURL: string, relativeURL: string) { return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; }
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/with-props.ts
packages/react-router-dev/vite/with-props.ts
import type { Babel, NodePath, ParseResult } from "./babel"; import { traverse, t } from "./babel"; const namedComponentExports = ["HydrateFallback", "ErrorBoundary"] as const; type NamedComponentExport = (typeof namedComponentExports)[number]; function isNamedComponentExport(name: string): name is NamedComponentExpor...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/route-chunks.ts
packages/react-router-dev/vite/route-chunks.ts
import type { GeneratorOptions, GeneratorResult } from "@babel/generator"; import invariant from "../invariant"; import { type Cache, getOrSetFromCache } from "./cache"; import { type Babel, type NodePath, parse, traverse, generate, t, } from "./babel"; type ExportDeclaration = Babel.ExportDeclaration; typ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
true
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/build.ts
packages/react-router-dev/vite/build.ts
import type * as Vite from "vite"; import colors from "picocolors"; import { loadConfig } from "../config/config"; import { type EnvironmentName, type EnvironmentBuildContext, resolveViteConfig, extractPluginContext, cleanBuildDirectory, cleanViteManifests, getEnvironmentOptionsResolvers, resolveEnviro...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/dev.ts
packages/react-router-dev/vite/dev.ts
import type * as Vite from "vite"; import colors from "picocolors"; import { preloadVite, getVite } from "./vite"; import * as profiler from "./profiler"; export interface ViteDevOptions { clearScreen?: boolean; config?: string; cors?: boolean; force?: boolean; host?: boolean | string; logLevel?: Vite.Log...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/cloudflare.ts
packages/react-router-dev/vite/cloudflare.ts
export { cloudflareDevProxyVitePlugin as cloudflareDevProxy } from "./cloudflare-dev-proxy";
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/vite-node.ts
packages/react-router-dev/vite/vite-node.ts
// We can only import types from vite-node at the top level since we're in a CJS // context but want to use vite-node's ESM build since Vite 7+ is ESM only import type { ViteNodeServer as ViteNodeServerType } from "vite-node/server"; import type { ViteNodeRunner as ViteNodeRunnerType } from "vite-node/client"; import t...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/remove-exports.ts
packages/react-router-dev/vite/remove-exports.ts
import { findReferencedIdentifiers, deadCodeElimination, } from "babel-dead-code-elimination"; import type { Babel, NodePath, ParseResult } from "./babel"; import { traverse } from "./babel"; export const removeExports = ( ast: ParseResult<Babel.File>, exportsToRemove: readonly string[], ) => { let previous...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/node-adapter.ts
packages/react-router-dev/vite/node-adapter.ts
import type { ServerResponse } from "node:http"; import { createRequest } from "@remix-run/node-fetch-server"; import type * as Vite from "vite"; import invariant from "../invariant"; export type NodeRequestHandler = ( req: Vite.Connect.IncomingMessage, res: ServerResponse, ) => Promise<void>; export function f...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/cache.ts
packages/react-router-dev/vite/cache.ts
type CacheEntry<T> = { value: T; version: string }; export type Cache = Map<string, CacheEntry<any>>; export function getOrSetFromCache<T>( cache: Cache, key: string, version: string, getValue: () => T, ): T { if (!cache) { return getValue(); } let entry = cache.get(key) as CacheEntry<T> | undefine...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/virtual-module.ts
packages/react-router-dev/vite/virtual-module.ts
export function create(name: string) { let id = `virtual:react-router/${name}`; return { id, resolvedId: `\0${id}`, url: `/@id/__x00__${id}`, }; }
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/resolve-file-url.ts
packages/react-router-dev/vite/resolve-file-url.ts
import * as path from "node:path"; import { getVite } from "./vite"; export const resolveFileUrl = ( { rootDirectory }: { rootDirectory: string }, filePath: string, ) => { let vite = getVite(); let relativePath = path.relative(rootDirectory, filePath); let isWithinRoot = !relativePath.startsWith("..") &...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/remove-exports-test.ts
packages/react-router-dev/vite/remove-exports-test.ts
import { generate, parse } from "./babel"; import { removeExports } from "./remove-exports"; function transform(code: string, exportsToRemove: string[]) { let ast = parse(code, { sourceType: "module" }); removeExports(ast, exportsToRemove); return generate(ast); } describe("transform", () => { test("arrow fun...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/vite.ts
packages/react-router-dev/vite/vite.ts
import path from "pathe"; import invariant from "../invariant"; import { isReactRouterRepo } from "../config/is-react-router-repo"; // eslint-disable-next-line @typescript-eslint/consistent-type-imports type Vite = typeof import("vite"); let vite: Vite | undefined; const viteImportSpecifier = isReactRouterRepo() ?...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/combine-urls-test.ts
packages/react-router-dev/vite/combine-urls-test.ts
import { combineURLs } from "./combine-urls"; describe("combineURLs", () => { test("URLs without slashes", () => { expect(combineURLs("http://example.com", "path")).toBe( "http://example.com/path", ); }); test("URLs with slashes", () => { expect(combineURLs("http://example.com/", "/path")).toB...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/styles.ts
packages/react-router-dev/vite/styles.ts
import * as path from "node:path"; import { matchRoutes } from "react-router"; import type { ModuleNode, ViteDevServer } from "vite"; import type { ResolvedReactRouterConfig } from "../config/config"; import type { RouteManifest, RouteManifestEntry } from "../config/routes"; import type { LoadCssContents } from "./plu...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/cloudflare-dev-proxy.ts
packages/react-router-dev/vite/cloudflare-dev-proxy.ts
import { sendResponse } from "@remix-run/node-fetch-server"; import { createRequestHandler } from "react-router"; import { type AppLoadContext, type ServerBuild, type UNSAFE_MiddlewareEnabled, type RouterContextProvider, } from "react-router"; import { type Plugin } from "vite"; import { type GetPlatformProxyOp...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/optimize-deps-entries.ts
packages/react-router-dev/vite/optimize-deps-entries.ts
import { escapePath as escapePathAsGlob } from "tinyglobby"; import type { ResolvedReactRouterConfig } from "../config/config"; import { resolveRelativeRouteFilePath } from "./resolve-relative-route-file-path"; import { getVite } from "./vite"; export function getOptimizeDepsEntries({ entryClientFilePath, reactRou...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/plugin.ts
packages/react-router-dev/vite/plugin.ts
// We can only import types from Vite at the top level since we're in a CJS // context but want to use Vite's ESM build since Vite 7+ is ESM only import type * as Vite from "vite"; import { type BinaryLike, createHash } from "node:crypto"; import { existsSync, readFileSync, readdirSync, rmSync } from "node:fs"; import ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
true
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/route-chunks-test.ts
packages/react-router-dev/vite/route-chunks-test.ts
import dedent from "dedent"; import type { Cache } from "./cache"; import { hasChunkableExport, getChunkedExport, omitChunkedExports, } from "./route-chunks"; let cache: [Cache, string] = [new Map(), "cacheKey"]; describe("route chunks", () => { describe("chunkable", () => { test("functions with no ident...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
true
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/babel.ts
packages/react-router-dev/vite/babel.ts
/* eslint-disable @typescript-eslint/consistent-type-imports */ import type { NodePath } from "@babel/traverse"; import type { types as Babel } from "@babel/core"; import { parse, type ParseResult } from "@babel/parser"; import * as t from "@babel/types"; // These `require`s were needed to support building within vite...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/load-dotenv.ts
packages/react-router-dev/vite/load-dotenv.ts
import type * as Vite from "vite"; export async function loadDotenv({ rootDirectory, viteUserConfig, mode, }: { rootDirectory: string; viteUserConfig: Vite.UserConfig; mode: string; }) { const vite = await import("vite"); Object.assign( process.env, vite.loadEnv( mode, viteUserConfi...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/ssr-externals.ts
packages/react-router-dev/vite/ssr-externals.ts
import { isReactRouterRepo } from "../config/is-react-router-repo"; export const ssrExternals = isReactRouterRepo() ? [ // This is only needed within this repo because these packages // are linked to a directory outside of node_modules so Vite // treats them as internal code by default. "reac...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/plugins/validate-plugin-order.ts
packages/react-router-dev/vite/plugins/validate-plugin-order.ts
import type * as Vite from "vite"; export function validatePluginOrder(): Vite.Plugin { return { name: "react-router:validate-plugin-order", configResolved(viteConfig) { let pluginIndex = (pluginName: string | string[]) => { pluginName = Array.isArray(pluginName) ? pluginName : [pluginName]; ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/plugins/warn-on-client-source-maps.ts
packages/react-router-dev/vite/plugins/warn-on-client-source-maps.ts
import type * as Vite from "vite"; import colors from "picocolors"; import invariant from "../../invariant"; export function warnOnClientSourceMaps(): Vite.Plugin { let viteConfig: Vite.ResolvedConfig; let viteCommand: Vite.ConfigEnv["command"]; let logged = false; return { name: "react-router:warn-on-cli...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/rsc/virtual-route-config.ts
packages/react-router-dev/vite/rsc/virtual-route-config.ts
import path from "pathe"; import type { RouteConfigEntry } from "../../routes"; export function createVirtualRouteConfig({ appDirectory, routeConfig, }: { appDirectory: string; routeConfig: RouteConfigEntry[]; }): { code: string; routeIdByFile: Map<string, string> } { let routeIdByFile = new Map<string, stri...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/rsc/plugin.ts
packages/react-router-dev/vite/rsc/plugin.ts
import type * as Vite from "vite"; import { init as initEsModuleLexer } from "es-module-lexer"; import * as Path from "pathe"; import * as babel from "@babel/core"; import colors from "picocolors"; import { create } from "../virtual-module"; import * as Typegen from "../../typegen"; import { readFile } from "fs/promis...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/vite/rsc/virtual-route-modules.ts
packages/react-router-dev/vite/rsc/virtual-route-modules.ts
import type * as Vite from "vite"; import * as babel from "../babel"; import { parse as esModuleLexer } from "es-module-lexer"; import { removeExports } from "../remove-exports"; const SERVER_ONLY_COMPONENT_EXPORTS = ["ServerComponent"] as const; const SERVER_ONLY_ROUTE_EXPORTS = [ ...SERVER_ONLY_COMPONENT_EXPORTS,...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/__tests__/setupAfterEnv.ts
packages/react-router-dev/__tests__/setupAfterEnv.ts
export let jestTimeout = process.platform === "win32" ? 20_000 : 10_000; jest.setTimeout(jestTimeout);
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/__tests__/route-config-test.ts
packages/react-router-dev/__tests__/route-config-test.ts
import path from "node:path"; import { normalize as normalizePath } from "pathe"; import { validateRouteConfig, route, layout, index, prefix, relative, } from "../config/routes"; const cleanPathsForSnapshot = (obj: any): any => JSON.parse( JSON.stringify(obj, (_key, value) => typeof value === ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/__tests__/styles-test.ts
packages/react-router-dev/__tests__/styles-test.ts
import { isCssUrlWithoutSideEffects } from "../vite/styles"; describe("isCssUrlWithoutSideEffects", () => { it("returns true for query parameters that result in an exported value with no side effects", () => { let urls = [ "my/file.css?inline", "my/file.css?inline-css", "my/file.css?inline&raw"...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/__tests__/fixtures/basic/app/routes.ts
packages/react-router-dev/__tests__/fixtures/basic/app/routes.ts
// Note that since this is used in a unit test context, we don't have access to // the `dev` build yet, so we can't import from `@react-router/dev/routes`. const routes = [{ file: "routes/_index.tsx", index: true }]; export default routes;
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/__tests__/fixtures/basic/app/root.tsx
packages/react-router-dev/__tests__/fixtures/basic/app/root.tsx
import { Links, Meta, Outlet, Scripts, ScrollRestoration } from "react-router"; export default function App() { return ( <html lang="en"> <head> <meta charSet="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <Meta /> <Links /> </head> ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/__tests__/fixtures/basic/app/routes/_index.tsx
packages/react-router-dev/__tests__/fixtures/basic/app/routes/_index.tsx
import type { MetaFunction } from "react-router"; export const meta: MetaFunction = () => { return [ { title: "New React Router App" }, { name: "description", content: "Welcome to React Router!" }, ]; }; export default function Index() { return ( <div style={{ fontFamily: "system-ui, sans-serif", li...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/__tests__/utils/eol.ts
packages/react-router-dev/__tests__/utils/eol.ts
export const normalize = (text: string, normalized = "\n") => text.replace(/\r?\n/g, normalized);
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/__tests__/utils/git.ts
packages/react-router-dev/__tests__/utils/git.ts
import execa from "execa"; export const initialCommit = async (projectDir: string) => { let run = (cmd: string, args: string[]) => execa(cmd, args, { cwd: projectDir }); let commands = [ ["init"], ["config", "user.name", '"github-actions[bot]"'], ["config", "user.email", '"github-actions[bot]@user...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/__tests__/utils/cli.ts
packages/react-router-dev/__tests__/utils/cli.ts
import type { Stats } from "node:fs"; import { statSync } from "node:fs"; import path from "node:path"; import execa from "execa"; import glob from "fast-glob"; import captureError from "./captureError"; export const isExecaError = (error: unknown): error is execa.ExecaError => { if (!(error instanceof Error)) retu...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/__tests__/utils/captureError.ts
packages/react-router-dev/__tests__/utils/captureError.ts
class NoErrorThrownError extends Error {} export default async function captureError( erroring: Promise<unknown> | (() => Promise<unknown>), ) { try { let promise = typeof erroring === "function" ? erroring() : erroring; await promise; throw new NoErrorThrownError(); } catch (error: unknown) { if...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/__tests__/utils/withApp.ts
packages/react-router-dev/__tests__/utils/withApp.ts
import { cpSync, realpathSync } from "node:fs"; import { mkdir, rm } from "node:fs/promises"; import os from "node:os"; import path from "node:path"; const retry = async ( callback: () => Promise<void>, times: number, delayMs: number = 0, ) => { try { await callback(); } catch (error: unknown) { if (...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/config/is-react-router-repo.ts
packages/react-router-dev/config/is-react-router-repo.ts
import path from "pathe"; export function isReactRouterRepo() { // We use '@react-router/node' for this check since it's a // dependency of this package and guaranteed to be in node_modules let serverRuntimePath = path.dirname( require.resolve("@react-router/node/package.json"), ); let serverRuntimeParen...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/config/config.ts
packages/react-router-dev/config/config.ts
import fs from "node:fs"; import { execSync } from "node:child_process"; import * as ViteNode from "../vite/vite-node"; import type * as Vite from "vite"; import Path from "pathe"; import chokidar, { type FSWatcher, type EmitArgs as ChokidarEmitArgs, } from "chokidar"; import colors from "picocolors"; import pick f...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/config/routes.ts
packages/react-router-dev/config/routes.ts
import * as Path from "pathe"; import * as v from "valibot"; import pick from "lodash/pick"; import invariant from "../invariant"; declare global { var __reactRouterAppDirectory: string; } export function setAppDirectory(directory: string) { globalThis.__reactRouterAppDirectory = directory; } /** * Provides th...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/config/format.ts
packages/react-router-dev/config/format.ts
import type { RouteManifest } from "./routes"; export type RoutesFormat = "json" | "jsx"; export function formatRoutes( routeManifest: RouteManifest, format: RoutesFormat, ) { switch (format) { case "json": return formatRoutesAsJson(routeManifest); case "jsx": return formatRoutesAsJsx(routeM...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/config/defaults/entry.server.node.tsx
packages/react-router-dev/config/defaults/entry.server.node.tsx
import { PassThrough } from "node:stream"; import type { AppLoadContext, EntryContext } from "react-router"; import { createReadableStreamFromReadable } from "@react-router/node"; import { ServerRouter } from "react-router"; import { isbot } from "isbot"; import type { RenderToPipeableStreamOptions } from "react-dom/s...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/config/defaults/entry.client.tsx
packages/react-router-dev/config/defaults/entry.client.tsx
import { startTransition, StrictMode } from "react"; import { hydrateRoot } from "react-dom/client"; import { HydratedRouter } from "react-router/dom"; startTransition(() => { hydrateRoot( document, <StrictMode> <HydratedRouter /> </StrictMode>, ); });
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/config/default-rsc-entries/entry.ssr.tsx
packages/react-router-dev/config/default-rsc-entries/entry.ssr.tsx
import { createFromReadableStream } from "@vitejs/plugin-rsc/ssr"; // @ts-expect-error - no types for this, can import from root once on latest 19 import { renderToReadableStream } from "react-dom/server.edge"; import { unstable_routeRSCServerRequest as routeRSCServerRequest, unstable_RSCStaticRouter as RSCStaticRo...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/config/default-rsc-entries/entry.rsc.tsx
packages/react-router-dev/config/default-rsc-entries/entry.rsc.tsx
import { createTemporaryReferenceSet, decodeAction, decodeFormState, decodeReply, loadServerAction, renderToReadableStream, } from "@vitejs/plugin-rsc/rsc"; import { RouterContextProvider, unstable_matchRSCServerRequest as matchRSCServerRequest, } from "react-router"; // Import the routes generated by ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/config/default-rsc-entries/entry.client.tsx
packages/react-router-dev/config/default-rsc-entries/entry.client.tsx
import "virtual:react-router/unstable_rsc/inject-hmr-runtime"; import { startTransition, StrictMode } from "react"; import { hydrateRoot } from "react-dom/client"; import { createFromReadableStream, createTemporaryReferenceSet, encodeReply, setServerCallback, } from "@vitejs/plugin-rsc/browser"; import { uns...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/cli/useJavascript.ts
packages/react-router-dev/cli/useJavascript.ts
import * as babel from "@babel/core"; // @ts-expect-error These modules don't have types import babelPluginSyntaxJSX from "@babel/plugin-syntax-jsx"; // @ts-expect-error These modules don't have types import babelPresetTypeScript from "@babel/preset-typescript"; import prettier from "prettier"; export async function t...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/cli/commands.ts
packages/react-router-dev/cli/commands.ts
import { existsSync } from "node:fs"; import { readFile, writeFile } from "node:fs/promises"; import * as path from "node:path"; import exitHook from "exit-hook"; import colors from "picocolors"; // Workaround for "ERR_REQUIRE_CYCLE_MODULE" in Node 22.10.0+ import "react-router"; import type { ViteDevOptions } from "....
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/cli/run.ts
packages/react-router-dev/cli/run.ts
import arg from "arg"; import semver from "semver"; import colors from "picocolors"; import * as commands from "./commands"; const helpText = ` ${colors.blueBright("react-router")} ${colors.underline("Usage")}: $ react-router build [${colors.yellowBright("projectDir")}] $ react-router dev [${colors.yellowB...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/cli/detectPackageManager.ts
packages/react-router-dev/cli/detectPackageManager.ts
type PackageManager = "npm" | "pnpm" | "yarn" | "bun"; /** * Determine which package manager the user prefers. * * npm, pnpm and Yarn set the user agent environment variable * that can be used to determine which package manager ran * the command. */ export const detectPackageManager = (): PackageManager | undefi...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/cli/index.ts
packages/react-router-dev/cli/index.ts
#!/usr/bin/env node import { run } from "./run"; run().then( () => { process.exit(0); }, (error: unknown) => { if (error) console.error(error); process.exit(1); }, );
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/typegen/params.ts
packages/react-router-dev/typegen/params.ts
export function parse(fullpath: string) { const result: Record<string, boolean> = {}; let segments = fullpath.split("/"); segments.forEach((segment) => { const match = segment.match(/^:([\w-]+)(\?)?/); if (!match) return; const param = match[1]; const isRequired = match[2] === undefined; res...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/typegen/route.ts
packages/react-router-dev/typegen/route.ts
import type { RouteManifest, RouteManifestEntry } from "../config/routes"; export function lineage( routes: RouteManifest, route: RouteManifestEntry, ): RouteManifestEntry[] { const result: RouteManifestEntry[] = []; while (route) { result.push(route); if (!route.parentId) break; route = routes[rou...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/typegen/context.ts
packages/react-router-dev/typegen/context.ts
import { createConfigLoader, type ConfigLoader, type ResolvedReactRouterConfig, } from "../config/config"; export type Context = { rootDirectory: string; configLoader: ConfigLoader; config: ResolvedReactRouterConfig; rsc: boolean; }; export async function createContext({ rootDirectory, watch, mode...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/typegen/index.ts
packages/react-router-dev/typegen/index.ts
import fs from "node:fs/promises"; import * as Path from "pathe"; import { green, red } from "picocolors"; import type vite from "vite"; import { type Context, createContext } from "./context"; import { type VirtualFile, typesDirectory, generateFuture, generateRoutes, generateServerBuild, } from "./generate...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dev/typegen/generate.ts
packages/react-router-dev/typegen/generate.ts
import ts from "dedent"; import * as Path from "pathe"; import * as Pathe from "pathe/utils"; import * as Babel from "../vite/babel"; import type { Context } from "./context"; import * as Params from "./params"; import * as Route from "./route"; import type { RouteManifestEntry } from "../config/routes"; export type ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dom/tsup.config.ts
packages/react-router-dom/tsup.config.ts
import { defineConfig } from "tsup"; // @ts-ignore - out of scope import { createBanner } from "../../build.utils.js"; import pkg from "./package.json"; const entry = ["index.ts"]; export default defineConfig([ { clean: true, entry, format: ["cjs", "esm"], outDir: "dist", dts: true, banner...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-dom/index.ts
packages/react-router-dom/index.ts
import type { RouterProviderProps } from "react-router/dom"; import { HydratedRouter, RouterProvider } from "react-router/dom"; // TODO: Confirm if this causes tree-shaking issues and if so, convert to named exports export type * from "react-router"; export * from "react-router"; export type { RouterProviderProps }; ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-remix-routes-option-adapter/normalizeSlashes.ts
packages/react-router-remix-routes-option-adapter/normalizeSlashes.ts
import path from "node:path"; export function normalizeSlashes(file: string) { return file.replaceAll(path.win32.sep, "/"); }
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-remix-routes-option-adapter/defineRoutes.ts
packages/react-router-remix-routes-option-adapter/defineRoutes.ts
import type { RouteManifest, RouteManifestEntry } from "./manifest"; import { normalizeSlashes } from "./normalizeSlashes"; export type DefineRoutesFunction = ( callback: (defineRoute: DefineRouteFunction) => void, ) => RouteManifest; interface DefineRouteOptions { /** * Should be `true` if the route `path` is...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-remix-routes-option-adapter/tsup.config.ts
packages/react-router-remix-routes-option-adapter/tsup.config.ts
import { defineConfig } from "tsup"; // @ts-ignore - out of scope import { createBanner } from "../../build.utils.js"; import pkg from "./package.json"; const entry = ["index.ts"]; export default defineConfig([ { clean: true, entry, format: ["cjs"], outDir: "dist", dts: true, banner: { ...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-remix-routes-option-adapter/index.ts
packages/react-router-remix-routes-option-adapter/index.ts
import { type RouteConfigEntry } from "@react-router/dev/routes"; import { routeManifestToRouteConfig } from "./manifest"; import { defineRoutes, type DefineRoutesFunction, type DefineRouteFunction, } from "./defineRoutes"; export type { DefineRoutesFunction, DefineRouteFunction }; /** * Adapts routes defined...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false
remix-run/react-router
https://github.com/remix-run/react-router/blob/aaa150616e619efc8d26c092e8625962c2fb4246/packages/react-router-remix-routes-option-adapter/manifest.ts
packages/react-router-remix-routes-option-adapter/manifest.ts
import type { RouteConfigEntry } from "@react-router/dev/routes"; export interface RouteManifestEntry { path?: string; index?: boolean; caseSensitive?: boolean; id: string; parentId?: string; file: string; } export interface RouteManifest { [routeId: string]: RouteManifestEntry; } export function route...
typescript
MIT
aaa150616e619efc8d26c092e8625962c2fb4246
2026-01-04T15:29:26.871957Z
false