Rocky_Mountain_Vending/.pnpm-store/v10/files/59/161b65efe59ccaf72bed634114ba1d836f70f3b57ea6014e5b5a6c0e4b3200d0c4636ed3f181cae036ad72072fef63cad0e821143c72e79386b3844c248fdf
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

1 line
No EOL
31 KiB
Text

{"version":3,"sources":["../../../../src/server/dev/browser-logs/receive-logs.ts"],"sourcesContent":["import { cyan, dim, red, yellow } from '../../../lib/picocolors'\nimport type { Project } from '../../../build/swc/types'\nimport util from 'util'\nimport {\n getConsoleLocation,\n getSourceMappedStackFrames,\n withLocation,\n type MappingContext,\n} from './source-map'\nimport {\n type ServerLogEntry,\n type LogMethod,\n type ConsoleEntry,\n UNDEFINED_MARKER,\n} from '../../../next-devtools/shared/forward-logs-shared'\nimport { formatConsoleArgs } from '../../../client/lib/console'\nimport { getFileLogger } from './file-logger'\n\nexport function restoreUndefined(x: any): any {\n if (x === UNDEFINED_MARKER) return undefined\n if (Array.isArray(x)) return x.map(restoreUndefined)\n if (x && typeof x === 'object') {\n for (let k in x) {\n x[k] = restoreUndefined(x[k])\n }\n }\n return x\n}\n\nfunction cleanConsoleArgsForFileLogging(args: any[]): string {\n /**\n * Use formatConsoleArgs to strip out background and color format specifiers\n * and keep only the original string content for file logging\n */\n try {\n return formatConsoleArgs(args)\n } catch {\n // Fallback to simple string conversion if formatting fails\n return args\n .map((arg) =>\n typeof arg === 'string' ? arg : util.inspect(arg, { depth: 2 })\n )\n .join(' ')\n }\n}\n\nconst methods: Array<LogMethod> = [\n 'log',\n 'info',\n 'warn',\n 'debug',\n 'table',\n 'error',\n 'assert',\n 'dir',\n 'dirxml',\n 'group',\n 'groupCollapsed',\n 'groupEnd',\n]\n\nconst methodsToSkipInspect = new Set([\n 'table',\n 'dir',\n 'dirxml',\n 'group',\n 'groupCollapsed',\n 'groupEnd',\n])\n\n// we aren't overriding console, we're just making a (slightly convoluted) helper for replaying user console methods\nconst forwardConsole: typeof console = {\n ...console,\n ...Object.fromEntries(\n methods.map((method) => [\n method,\n (...args: Array<any>) =>\n (console[method] as any)(\n ...args.map((arg) =>\n methodsToSkipInspect.has(method) ||\n typeof arg !== 'object' ||\n arg === null\n ? arg\n : // we hardcode depth:Infinity to allow the true depth to be configured by the serialization done in the browser (which is controlled by user)\n util.inspect(arg, { depth: Infinity, colors: true })\n )\n ),\n ])\n ),\n}\n\nasync function deserializeArgData(arg: any) {\n try {\n // we want undefined to be represented as it would be in the browser from the user's perspective (otherwise it would be stripped away/shown as null)\n if (arg === UNDEFINED_MARKER) {\n return restoreUndefined(arg)\n }\n\n return restoreUndefined(JSON.parse(arg))\n } catch {\n return arg\n }\n}\n\nconst colorError = (\n mapped: Awaited<ReturnType<typeof getSourceMappedStackFrames>>,\n config?: {\n prefix?: string\n applyColor?: boolean\n }\n) => {\n const colorFn =\n config?.applyColor === undefined || config.applyColor ? red : <T>(x: T) => x\n switch (mapped.kind) {\n case 'mapped-stack':\n case 'stack': {\n return (\n (config?.prefix ? colorFn(config?.prefix) : '') +\n `\\n${colorFn(mapped.stack)}`\n )\n }\n case 'with-frame-code': {\n return (\n (config?.prefix ? colorFn(config?.prefix) : '') +\n `\\n${colorFn(mapped.stack)}\\n${mapped.frameCode}`\n )\n }\n // a more sophisticated version of this allows the user to config if they want ignored frames (but we need to be sure to source map them)\n case 'all-ignored': {\n return config?.prefix ? colorFn(config?.prefix) : ''\n }\n default: {\n }\n }\n mapped satisfies never\n}\n\nfunction processConsoleFormatStrings(args: any[]): any[] {\n /**\n * this handles the case formatting is applied to the console log\n * otherwise we will see the format specifier directly in the terminal output\n */\n if (args.length > 0 && typeof args[0] === 'string') {\n const formatString = args[0]\n if (\n formatString.includes('%s') ||\n formatString.includes('%d') ||\n formatString.includes('%i') ||\n formatString.includes('%f') ||\n formatString.includes('%o') ||\n formatString.includes('%O') ||\n formatString.includes('%c')\n ) {\n try {\n const formatted = util.format(...args)\n return [formatted]\n } catch {\n return args\n }\n }\n }\n return args\n}\n\n// in the case of logging errors, we want to strip formatting\n// modifiers since we apply our own custom coloring to error\n// stacks and code blocks, and otherwise it would conflict\n// and cause awful output\nexport function stripFormatSpecifiers(args: any[]): any[] {\n if (args.length === 0 || typeof args[0] !== 'string') return args\n\n const fmtIn = String(args[0])\n const rest = args.slice(1)\n\n if (!fmtIn.includes('%')) return args\n\n let fmtOut = ''\n let argPtr = 0\n\n for (let i = 0; i < fmtIn.length; i++) {\n if (fmtIn[i] !== '%') {\n fmtOut += fmtIn[i]\n continue\n }\n\n if (fmtIn[i + 1] === '%') {\n fmtOut += '%'\n i++\n continue\n }\n\n const token = fmtIn[++i]\n\n if (!token) {\n fmtOut += '%'\n continue\n }\n\n if ('csdifoOj'.includes(token) || token === 'O') {\n if (argPtr < rest.length) {\n if (token === 'c') {\n argPtr++\n } else if (token === 'o' || token === 'O' || token === 'j') {\n const obj = rest[argPtr++]\n fmtOut += util.inspect(obj, { depth: 2, colors: false })\n } else {\n // string(...) is safe for remaining specifiers\n fmtOut += String(rest[argPtr++])\n }\n }\n continue\n }\n\n fmtOut += '%' + token\n }\n\n const result = [fmtOut]\n if (argPtr < rest.length) {\n result.push(...rest.slice(argPtr))\n }\n\n return result\n}\n\nasync function prepareFormattedErrorArgs(\n entry: Extract<ServerLogEntry, { kind: 'formatted-error' }>,\n ctx: MappingContext,\n distDir: string\n) {\n const mapped = await getSourceMappedStackFrames(entry.stack, ctx, distDir)\n return [colorError(mapped, { prefix: entry.prefix })]\n}\n\nasync function prepareConsoleArgs(\n entry: Extract<ServerLogEntry, { kind: 'console' }>,\n ctx: MappingContext,\n distDir: string\n) {\n const deserialized = await Promise.all(\n entry.args.map(async (arg) => {\n if (arg.kind === 'arg') {\n const data = await deserializeArgData(arg.data)\n if (entry.method === 'warn' && typeof data === 'string') {\n return yellow(data)\n }\n return data\n }\n if (!arg.stack) return red(arg.prefix)\n const mapped = await getSourceMappedStackFrames(arg.stack, ctx, distDir)\n return colorError(mapped, { prefix: arg.prefix, applyColor: false })\n })\n )\n\n return processConsoleFormatStrings(deserialized)\n}\n\nasync function prepareConsoleErrorArgs(\n entry: Extract<ServerLogEntry, { kind: 'any-logged-error' }>,\n ctx: MappingContext,\n distDir: string\n) {\n const deserialized = await Promise.all(\n entry.args.map(async (arg) => {\n if (arg.kind === 'arg') {\n if (arg.isRejectionMessage) return red(arg.data)\n return deserializeArgData(arg.data)\n }\n if (!arg.stack) return red(arg.prefix)\n const mapped = await getSourceMappedStackFrames(arg.stack, ctx, distDir)\n return colorError(mapped, { prefix: arg.prefix })\n })\n )\n\n const mappedStack = await getSourceMappedStackFrames(\n entry.consoleErrorStack,\n ctx,\n distDir\n )\n\n /**\n * don't show the stack + codeblock when there are errors present, since:\n * - it will look overwhelming to see 2 stacks and 2 code blocks\n * - the user already knows where the console.error is at because we append the location\n */\n const location = getConsoleLocation(mappedStack)\n if (entry.args.some((a) => a.kind === 'formatted-error-arg')) {\n const result = stripFormatSpecifiers(deserialized)\n if (location) {\n result.push(dim(`(${location})`))\n }\n return result\n }\n const result = [\n ...processConsoleFormatStrings(deserialized),\n colorError(mappedStack),\n ]\n if (location) {\n result.push(dim(`(${location})`))\n }\n return result\n}\n\nasync function handleTable(\n entry: ConsoleEntry<string>,\n browserPrefix: string,\n ctx: MappingContext,\n distDir: string\n) {\n const deserializedArgs = await Promise.all(\n entry.args.map(async (arg: any) => {\n if (arg.kind === 'formatted-error-arg') {\n return { stack: arg.stack }\n }\n return deserializeArgData(arg.data)\n })\n )\n\n const location = await (async () => {\n if (!entry.consoleMethodStack) {\n return\n }\n const frames = await getSourceMappedStackFrames(\n entry.consoleMethodStack,\n ctx,\n distDir\n )\n return getConsoleLocation(frames)\n })()\n\n // we can't inline pass browser prefix, but it looks better multiline for table anyways\n forwardConsole.log(browserPrefix)\n forwardConsole.table(...deserializedArgs)\n if (location) {\n forwardConsole.log(dim(`(${location})`))\n }\n}\n\nasync function handleTrace(\n entry: ConsoleEntry<string>,\n browserPrefix: string,\n ctx: MappingContext,\n distDir: string\n) {\n const deserializedArgs = await Promise.all(\n entry.args.map(async (arg: any) => {\n if (arg.kind === 'formatted-error-arg') {\n if (!arg.stack) return red(arg.prefix)\n const mapped = await getSourceMappedStackFrames(arg.stack, ctx, distDir)\n return colorError(mapped, { prefix: arg.prefix })\n }\n return deserializeArgData(arg.data)\n })\n )\n\n if (!entry.consoleMethodStack) {\n forwardConsole.log(\n browserPrefix,\n ...deserializedArgs,\n '[Trace unavailable]'\n )\n return\n }\n\n // TODO(rob): refactor so we can re-use result and not re-run the entire source map to avoid trivial post processing\n const [mapped, mappedIgnored] = await Promise.all([\n getSourceMappedStackFrames(entry.consoleMethodStack, ctx, distDir, false),\n getSourceMappedStackFrames(entry.consoleMethodStack, ctx, distDir),\n ])\n\n const location = getConsoleLocation(mappedIgnored)\n forwardConsole.log(\n browserPrefix,\n ...deserializedArgs,\n `\\n${mapped.stack}`,\n ...(location ? [`\\n${dim(`(${location})`)}`] : [])\n )\n}\n\nasync function handleDir(\n entry: ConsoleEntry<string>,\n browserPrefix: string,\n ctx: MappingContext,\n distDir: string\n) {\n const loggableEntry = await prepareConsoleArgs(entry, ctx, distDir)\n const consoleMethod =\n (forwardConsole as any)[entry.method] || forwardConsole.log\n\n if (entry.consoleMethodStack) {\n const mapped = await getSourceMappedStackFrames(\n entry.consoleMethodStack,\n ctx,\n distDir\n )\n const location = dim(`(${getConsoleLocation(mapped)})`)\n const originalWrite = process.stdout.write.bind(process.stdout)\n let captured = ''\n process.stdout.write = (chunk) => {\n captured += chunk\n return true\n }\n try {\n consoleMethod(...loggableEntry)\n } finally {\n process.stdout.write = originalWrite\n }\n const preserved = captured.replace(/\\r?\\n$/, '')\n originalWrite(`${browserPrefix}${preserved} ${location}\\n`)\n return\n }\n consoleMethod(browserPrefix, ...loggableEntry)\n}\n\nasync function handleDefaultConsole(\n entry: ConsoleEntry<string>,\n browserPrefix: string,\n ctx: MappingContext,\n distDir: string,\n config: boolean | { logDepth?: number; showSourceLocation?: boolean },\n isServerLog: boolean\n) {\n const consoleArgs = await prepareConsoleArgs(entry, ctx, distDir)\n const withStackEntry = await withLocation(\n {\n original: consoleArgs,\n stack: (entry as any).consoleMethodStack || null,\n },\n ctx,\n distDir,\n config\n )\n const consoleMethod = forwardConsole[entry.method] || forwardConsole.log\n ;(consoleMethod as (...args: any[]) => void)(browserPrefix, ...withStackEntry)\n\n // Process enqueued logs and write to file\n // Log to file with correct source based on context\n const fileLogger = getFileLogger()\n\n // Use cleaned console args to strip out background and color format specifiers\n const message = cleanConsoleArgsForFileLogging(consoleArgs)\n if (isServerLog) {\n fileLogger.logServer(entry.method.toUpperCase(), message)\n } else {\n fileLogger.logBrowser(entry.method.toUpperCase(), message)\n }\n}\n\nexport async function handleLog(\n entries: ServerLogEntry[],\n ctx: MappingContext,\n distDir: string,\n config: boolean | { logDepth?: number; showSourceLocation?: boolean }\n): Promise<void> {\n // Determine the source based on the context\n const isServerLog = ctx.isServer || ctx.isEdgeServer\n const browserPrefix = isServerLog ? cyan('[server]') : cyan('[browser]')\n const fileLogger = getFileLogger()\n\n for (const entry of entries) {\n try {\n switch (entry.kind) {\n case 'console': {\n switch (entry.method) {\n case 'table': {\n // timeout based abort on source mapping result\n await handleTable(entry, browserPrefix, ctx, distDir)\n break\n }\n // ignore frames\n case 'trace': {\n await handleTrace(entry, browserPrefix, ctx, distDir)\n break\n }\n case 'dir': {\n await handleDir(entry, browserPrefix, ctx, distDir)\n break\n }\n case 'dirxml': {\n // xml log thing maybe needs an impl\n // fallthrough\n }\n case 'group':\n case 'groupCollapsed':\n case 'groupEnd': {\n // [browser] undefined (app/page.tsx:8:11) console.group\n // fallthrough\n }\n case 'assert': {\n // check console assert\n // fallthrough\n }\n case 'log':\n case 'info':\n case 'debug':\n case 'error':\n case 'warn': {\n await handleDefaultConsole(\n entry,\n browserPrefix,\n ctx,\n distDir,\n config,\n isServerLog\n )\n break\n }\n default: {\n entry satisfies never\n }\n }\n break\n }\n // any logged errors are anything that are logged as \"red\" in the browser but aren't only an Error (console.error, Promise.reject(100))\n case 'any-logged-error': {\n const consoleArgs = await prepareConsoleErrorArgs(entry, ctx, distDir)\n forwardConsole.error(browserPrefix, ...consoleArgs)\n\n // Process enqueued logs and write to file\n fileLogger.logBrowser(\n 'ERROR',\n cleanConsoleArgsForFileLogging(consoleArgs)\n )\n break\n }\n // formatted error is an explicit error event (rejections, uncaught errors)\n case 'formatted-error': {\n const formattedArgs = await prepareFormattedErrorArgs(\n entry,\n ctx,\n distDir\n )\n forwardConsole.error(browserPrefix, ...formattedArgs)\n\n // Process enqueued logs and write to file\n fileLogger.logBrowser(\n 'ERROR',\n cleanConsoleArgsForFileLogging(formattedArgs)\n )\n break\n }\n default: {\n }\n }\n } catch {\n switch (entry.kind) {\n case 'any-logged-error': {\n const consoleArgs = await prepareConsoleErrorArgs(entry, ctx, distDir)\n forwardConsole.error(browserPrefix, ...consoleArgs)\n // Process enqueued logs and write to file\n fileLogger.logBrowser(\n 'ERROR',\n cleanConsoleArgsForFileLogging(consoleArgs)\n )\n break\n }\n case 'console': {\n const consoleMethod =\n forwardConsole[entry.method] || forwardConsole.log\n const consoleArgs = await prepareConsoleArgs(entry, ctx, distDir)\n ;(consoleMethod as (...args: any[]) => void)(\n browserPrefix,\n ...consoleArgs\n )\n\n // Process enqueued logs and write to file\n fileLogger.logBrowser(\n 'ERROR',\n cleanConsoleArgsForFileLogging(consoleArgs)\n )\n break\n }\n case 'formatted-error': {\n forwardConsole.error(browserPrefix, `${entry.prefix}\\n`, entry.stack)\n\n // Process enqueued logs and write to file\n fileLogger.logBrowser(\n 'ERROR',\n cleanConsoleArgsForFileLogging([`${entry.prefix}\\n${entry.stack}`])\n )\n break\n }\n default: {\n }\n }\n }\n }\n}\n\n// the data is used later when we need to get sourcemaps for error stacks\nexport async function receiveBrowserLogsWebpack(opts: {\n entries: ServerLogEntry[]\n router: 'app' | 'pages'\n sourceType?: 'server' | 'edge-server'\n clientStats: () => any\n serverStats: () => any\n edgeServerStats: () => any\n rootDirectory: string\n distDir: string\n config: boolean | { logDepth?: number; showSourceLocation?: boolean }\n}): Promise<void> {\n const {\n entries,\n router,\n sourceType,\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n distDir,\n } = opts\n\n const isAppDirectory = router === 'app'\n const isServer = sourceType === 'server'\n const isEdgeServer = sourceType === 'edge-server'\n\n const ctx: MappingContext = {\n bundler: 'webpack',\n isServer,\n isEdgeServer,\n isAppDirectory,\n clientStats,\n serverStats,\n edgeServerStats,\n rootDirectory,\n }\n\n await handleLog(entries, ctx, distDir, opts.config)\n}\n\nexport async function receiveBrowserLogsTurbopack(opts: {\n entries: ServerLogEntry[]\n router: 'app' | 'pages'\n sourceType?: 'server' | 'edge-server'\n project: Project\n projectPath: string\n distDir: string\n config: boolean | { logDepth?: number; showSourceLocation?: boolean }\n}): Promise<void> {\n const { entries, router, sourceType, project, projectPath, distDir } = opts\n\n const isAppDirectory = router === 'app'\n const isServer = sourceType === 'server'\n const isEdgeServer = sourceType === 'edge-server'\n\n const ctx: MappingContext = {\n bundler: 'turbopack',\n project,\n projectPath,\n isServer,\n isEdgeServer,\n isAppDirectory,\n }\n\n await handleLog(entries, ctx, distDir, opts.config)\n}\n\n// Handle client file logs (always logged regardless of terminal flag)\nexport async function handleClientFileLogs(\n logs: Array<{ timestamp: string; level: string; message: string }>\n): Promise<void> {\n const fileLogger = getFileLogger()\n\n for (const log of logs) {\n fileLogger.logBrowser(log.level, log.message)\n }\n}\n"],"names":["cyan","dim","red","yellow","util","getConsoleLocation","getSourceMappedStackFrames","withLocation","UNDEFINED_MARKER","formatConsoleArgs","getFileLogger","restoreUndefined","x","undefined","Array","isArray","map","k","cleanConsoleArgsForFileLogging","args","arg","inspect","depth","join","methods","methodsToSkipInspect","Set","forwardConsole","console","Object","fromEntries","method","has","Infinity","colors","deserializeArgData","JSON","parse","colorError","mapped","config","colorFn","applyColor","kind","prefix","stack","frameCode","processConsoleFormatStrings","length","formatString","includes","formatted","format","stripFormatSpecifiers","fmtIn","String","rest","slice","fmtOut","argPtr","i","token","obj","result","push","prepareFormattedErrorArgs","entry","ctx","distDir","prepareConsoleArgs","deserialized","Promise","all","data","prepareConsoleErrorArgs","isRejectionMessage","mappedStack","consoleErrorStack","location","some","a","handleTable","browserPrefix","deserializedArgs","consoleMethodStack","frames","log","table","handleTrace","mappedIgnored","handleDir","loggableEntry","consoleMethod","originalWrite","process","stdout","write","bind","captured","chunk","preserved","replace","handleDefaultConsole","isServerLog","consoleArgs","withStackEntry","original","fileLogger","message","logServer","toUpperCase","logBrowser","handleLog","entries","isServer","isEdgeServer","error","formattedArgs","receiveBrowserLogsWebpack","opts","router","sourceType","clientStats","serverStats","edgeServerStats","rootDirectory","isAppDirectory","bundler","receiveBrowserLogsTurbopack","project","projectPath","handleClientFileLogs","logs","level"],"mappings":"AAAA,SAASA,IAAI,EAAEC,GAAG,EAAEC,GAAG,EAAEC,MAAM,QAAQ,0BAAyB;AAEhE,OAAOC,UAAU,OAAM;AACvB,SACEC,kBAAkB,EAClBC,0BAA0B,EAC1BC,YAAY,QAEP,eAAc;AACrB,SAIEC,gBAAgB,QACX,oDAAmD;AAC1D,SAASC,iBAAiB,QAAQ,8BAA6B;AAC/D,SAASC,aAAa,QAAQ,gBAAe;AAE7C,OAAO,SAASC,iBAAiBC,CAAM;IACrC,IAAIA,MAAMJ,kBAAkB,OAAOK;IACnC,IAAIC,MAAMC,OAAO,CAACH,IAAI,OAAOA,EAAEI,GAAG,CAACL;IACnC,IAAIC,KAAK,OAAOA,MAAM,UAAU;QAC9B,IAAK,IAAIK,KAAKL,EAAG;YACfA,CAAC,CAACK,EAAE,GAAGN,iBAAiBC,CAAC,CAACK,EAAE;QAC9B;IACF;IACA,OAAOL;AACT;AAEA,SAASM,+B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