ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/llms-txt-hub / apps/web/lib/server-utils.ts

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/llms-txt-hub / apps/web/lib/server-utils.ts
DateNot specified in source
RepositoryJanady13/llms-txt-hub
Revisione0f4bf978d4df168369c7601d9c5f5ea89e84377
Branchmain
Path or archive memberapps/web/lib/server-utils.ts
Original SHA-256fafc4cad4073bfb66326bc785e998d26f339abb5935bb02ea9108b3e0e298b1a
Git blob SHAf0cde8ddfa04a586e6b180305a47ff42f9b31694
Reading-copy SHA-256fafc4cad4073bfb66326bc785e998d26f339abb5935bb02ea9108b3e0e298b1a

Original source ↗

Recovered source transcript

import 'server-only' import fs from 'node:fs' import path from 'node:path' /** * Resolves a path relative to the monorepo root * Server-side only utility function * * @param relativePath - Path relative to the monorepo root * @returns Absolute path from the monorepo root */ export function resolveFromRoot(relativePath: string): string { // Special case for data directory which might be at project root if (relativePath === 'data' || relativePath.startsWith('data/')) { // Check multiple possible locations for the data directory const possibleDataPaths = [ // For Vercel environments path.join(process.cwd(), relativePath), // For monorepo root path.join(process.cwd(), '..', '..', relativePath), path.join(process.cwd(), '..', relativePath), // For app-specific locations path.join(process.cwd(), 'apps', 'web', relativePath) ] for (const p of possibleDataPaths) { if (fs.existsSync(p)) { // Development debug: Found file at path return p } } } // Standard path resolution logic if (process.env.VERCEL) { // Try the direct path first (content at root level) const directPath = path.join(process.cwd(), relativePath) if (fs.existsSync(directPath)) { return directPath } // Try the app-relative path next (content inside apps/web) const appPath = path.join(process.cwd(), 'apps', 'web', relativePath) if (fs.existsSync(appPath)) { return appPath } // Default to direct path even if it doesn't exist return directPath } // Local development path return path.join(process.cwd(), '..', '..', relativePath) } /** * Resolve paths from project root (server-only) */ export function resolveFromProjectRoot(...paths: string[]): string { return path.resolve(process.cwd(), ...paths) }

Search equations, builds, manuscript text, and recovered sources.