inital commit

This commit is contained in:
2026-01-01 15:25:19 +05:30
commit f0ae49465a
36361 changed files with 4894111 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
import { handleGlobalErrors } from '../errors/use-error-handler';
handleGlobalErrors();
//# sourceMappingURL=handle-global-errors.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/client/components/globals/handle-global-errors.ts"],"sourcesContent":["import { handleGlobalErrors } from '../errors/use-error-handler'\n\nhandleGlobalErrors()\n"],"names":["handleGlobalErrors"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,8BAA6B;AAEhEA"}

View File

@@ -0,0 +1,41 @@
import isError from '../../../lib/is-error';
import { isNextRouterError } from '../is-next-router-error';
import { handleClientError } from '../errors/use-error-handler';
import { parseConsoleArgs } from '../../lib/console';
export const originConsoleError = globalThis.console.error;
// Patch console.error to collect information about hydration errors
export function patchConsoleError() {
// Ensure it's only patched once
if (typeof window === 'undefined') {
return;
}
window.console.error = function error() {
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
args[_key] = arguments[_key];
}
let maybeError;
if (process.env.NODE_ENV !== 'production') {
const { error: replayedError } = parseConsoleArgs(args);
if (replayedError) {
maybeError = replayedError;
} else if (isError(args[0])) {
maybeError = args[0];
} else {
// See https://github.com/facebook/react/blob/d50323eb845c5fde0d720cae888bf35dedd05506/packages/react-reconciler/src/ReactFiberErrorLogger.js#L78
maybeError = args[1];
}
} else {
maybeError = args[0];
}
if (!isNextRouterError(maybeError)) {
if (process.env.NODE_ENV !== 'production') {
handleClientError(// replayed errors have their own complex format string that should be used,
// but if we pass the error directly, `handleClientError` will ignore it
maybeError, args, true);
}
originConsoleError.apply(window.console, args);
}
};
}
//# sourceMappingURL=intercept-console-error.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/client/components/globals/intercept-console-error.ts"],"sourcesContent":["import isError from '../../../lib/is-error'\nimport { isNextRouterError } from '../is-next-router-error'\nimport { handleClientError } from '../errors/use-error-handler'\nimport { parseConsoleArgs } from '../../lib/console'\n\nexport const originConsoleError = globalThis.console.error\n\n// Patch console.error to collect information about hydration errors\nexport function patchConsoleError() {\n // Ensure it's only patched once\n if (typeof window === 'undefined') {\n return\n }\n window.console.error = function error(...args: any[]) {\n let maybeError: unknown\n if (process.env.NODE_ENV !== 'production') {\n const { error: replayedError } = parseConsoleArgs(args)\n if (replayedError) {\n maybeError = replayedError\n } else if (isError(args[0])) {\n maybeError = args[0]\n } else {\n // See https://github.com/facebook/react/blob/d50323eb845c5fde0d720cae888bf35dedd05506/packages/react-reconciler/src/ReactFiberErrorLogger.js#L78\n maybeError = args[1]\n }\n } else {\n maybeError = args[0]\n }\n\n if (!isNextRouterError(maybeError)) {\n if (process.env.NODE_ENV !== 'production') {\n handleClientError(\n // replayed errors have their own complex format string that should be used,\n // but if we pass the error directly, `handleClientError` will ignore it\n maybeError,\n args,\n true\n )\n }\n\n originConsoleError.apply(window.console, args)\n }\n }\n}\n"],"names":["isError","isNextRouterError","handleClientError","parseConsoleArgs","originConsoleError","globalThis","console","error","patchConsoleError","window","args","maybeError","process","env","NODE_ENV","replayedError","apply"],"mappings":"AAAA,OAAOA,aAAa,wBAAuB;AAC3C,SAASC,iBAAiB,QAAQ,0BAAyB;AAC3D,SAASC,iBAAiB,QAAQ,8BAA6B;AAC/D,SAASC,gBAAgB,QAAQ,oBAAmB;AAEpD,OAAO,MAAMC,qBAAqBC,WAAWC,OAAO,CAACC,KAAK,CAAA;AAE1D,oEAAoE;AACpE,OAAO,SAASC;IACd,gCAAgC;IAChC,IAAI,OAAOC,WAAW,aAAa;QACjC;IACF;IACAA,OAAOH,OAAO,CAACC,KAAK,GAAG,SAASA;QAAM,IAAA,IAAA,OAAA,UAAA,QAAA,AAAGG,OAAH,UAAA,OAAA,OAAA,GAAA,OAAA,MAAA;YAAGA,KAAH,QAAA,SAAA,CAAA,KAAc;;QAClD,IAAIC;QACJ,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;YACzC,MAAM,EAAEP,OAAOQ,aAAa,EAAE,GAAGZ,iBAAiBO;YAClD,IAAIK,eAAe;gBACjBJ,aAAaI;YACf,OAAO,IAAIf,QAAQU,IAAI,CAAC,EAAE,GAAG;gBAC3BC,aAAaD,IAAI,CAAC,EAAE;YACtB,OAAO;gBACL,iJAAiJ;gBACjJC,aAAaD,IAAI,CAAC,EAAE;YACtB;QACF,OAAO;YACLC,aAAaD,IAAI,CAAC,EAAE;QACtB;QAEA,IAAI,CAACT,kBAAkBU,aAAa;YAClC,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACzCZ,kBACE,4EAA4E;gBAC5E,wEAAwE;gBACxES,YACAD,MACA;YAEJ;YAEAN,mBAAmBY,KAAK,CAACP,OAAOH,OAAO,EAAEI;QAC3C;IACF;AACF"}

View File

@@ -0,0 +1,4 @@
import { patchConsoleError } from './intercept-console-error';
patchConsoleError();
//# sourceMappingURL=patch-console.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/client/components/globals/patch-console.ts"],"sourcesContent":["import { patchConsoleError } from './intercept-console-error'\n\npatchConsoleError()\n"],"names":["patchConsoleError"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,4BAA2B;AAE7DA"}