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>
1 line
No EOL
3.2 KiB
Text
1 line
No EOL
3.2 KiB
Text
{"version":3,"sources":["../../../src/server/node-environment-extensions/console-exit.tsx"],"sourcesContent":["/**\n * Patches console methods to exit the workUnitAsyncStorage so that inside the host implementation\n * sync IO can be called. This is relevant for example with runtimes that patch console methods to\n * prepend a timestamp to the log output.\n *\n * Note that this will only exit for already installed patched console methods. If you further patch\n * the console method after this and add any sync IO there it will trigger sync IO warnings while prerendering.\n *\n * This is a pragmatic concession because layering the patches if you install your own log implementation\n * after they are installed is very tricky to do correctly because the order matters\n */\n\nimport { workUnitAsyncStorage } from '../app-render/work-unit-async-storage.external'\n\ntype ConsoleMethodName = keyof Console\n\nfunction patchConsoleMethod(methodName: ConsoleMethodName): void {\n const descriptor = Object.getOwnPropertyDescriptor(console, methodName)\n if (\n descriptor &&\n (descriptor.configurable || descriptor.writable) &&\n typeof descriptor.value === 'function'\n ) {\n const originalMethod = descriptor.value\n const originalName = Object.getOwnPropertyDescriptor(originalMethod, 'name')\n let wrapperMethod = function (...args: any[]) {\n return workUnitAsyncStorage.exit(() =>\n originalMethod.apply(console, args)\n )\n }\n if (originalName) {\n Object.defineProperty(wrapperMethod, 'name', originalName)\n }\n Object.defineProperty(console, methodName, {\n value: wrapperMethod,\n })\n }\n}\n\n// We patch the same methods that React and our dev patch do.\n// We may find other methods that could benefit from patching but if\n// they exist we ought to consider patching them in all three places\npatchConsoleMethod('error')\npatchConsoleMethod('assert')\npatchConsoleMethod('debug')\npatchConsoleMethod('dir')\npatchConsoleMethod('dirxml')\npatchConsoleMethod('group')\npatchConsoleMethod('groupCollapsed')\npatchConsoleMethod('groupEnd')\npatchConsoleMethod('info')\npatchConsoleMethod('log')\npatchConsoleMethod('table')\npatchConsoleMethod('trace')\npatchConsoleMethod('warn')\n"],"names":["workUnitAsyncStorage","patchConsoleMethod","methodName","descriptor","Object","getOwnPropertyDescriptor","console","configurable","writable","value","originalMethod","originalName","wrapperMethod","args","exit","apply","defineProperty"],"mappings":"AAAA;;;;;;;;;;CAUC,GAED,SAASA,oBAAoB,QAAQ,iDAAgD;AAIrF,SAASC,mBAAmBC,UAA6B;IACvD,MAAMC,aAAaC,OAAOC,wBAAwB,CAACC,SAASJ;IAC5D,IACEC,cACCA,CAAAA,WAAWI,YAAY,IAAIJ,WAAWK,QAAQ,AAAD,KAC9C,OAAOL,WAAWM,KAAK,KAAK,YAC5B;QACA,MAAMC,iBAAiBP,WAAWM,KAAK;QACvC,MAAME,eAAeP,OAAOC,wBAAwB,CAACK,gBAAgB;QACrE,IAAIE,gBAAgB,SAAU,GAAGC,IAAW;YAC1C,OAAOb,qBAAqBc,IAAI,CAAC,IAC/BJ,eAAeK,KAAK,CAACT,SAASO;QAElC;QACA,IAAIF,cAAc;YAChBP,OAAOY,cAAc,CAACJ,eAAe,QAAQD;QAC/C;QACAP,OAAOY,cAAc,CAACV,SAASJ,YAAY;YACzCO,OAAOG;QACT;IACF;AACF;AAEA,6DAA6D;AAC7D,oEAAoE;AACpE,oEAAoE;AACpEX,mBAAmB;AACnBA,mBAAmB;AACnBA,mBAAmB;AACnBA,mBAAmB;AACnBA,mBAAmB;AACnBA,mBAAmB;AACnBA,mBAAmB;AACnBA,mBAAmB;AACnBA,mBAAmB;AACnBA,mBAAmB;AACnBA,mBAAmB;AACnBA,mBAAmB;AACnBA,mBAAmB","ignoreList":[0]} |