@bigbinary/neeto-commons-frontend 4.13.103 → 4.13.105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,8 +41,11 @@ const BABEL_CONFIG = {
41
41
 
42
42
  const DEFAULT_VISUALIZER_TEMPLATE = "treemap";
43
43
 
44
+ const NODE_MODULES_PKG_REGEX = /node_modules\/(@bigbinary\/[^/]+)\/(.*)/;
45
+
44
46
  module.exports = {
45
47
  BABEL_CONFIG,
46
48
  VITE_BABEL_CONFIG,
47
49
  DEFAULT_VISUALIZER_TEMPLATE,
50
+ NODE_MODULES_PKG_REGEX,
48
51
  };
@@ -20,6 +20,7 @@ const {
20
20
  } = require("./plugins/packageTranslations.js");
21
21
  const { prevalPlugin } = require("./plugins/preval.js");
22
22
  const { reactGiphyPlugin } = require("./plugins/reactGiphy.js");
23
+ const { stripSourcemapsPlugin } = require("./plugins/stripSourcemaps.js");
23
24
  const { virtualizedPlugin } = require("./plugins/virtualized.js");
24
25
  const { createDefinitions, entryPoint, build, watch } = require("./utils.js");
25
26
 
@@ -50,6 +51,7 @@ const config = {
50
51
  assetNames: "assets/[name]-[hash].digested",
51
52
  chunkNames: "chunks/[name]-[hash].digested",
52
53
  plugins: [
54
+ stripSourcemapsPlugin(),
53
55
  rails(),
54
56
  entrypointPlugin(isWatchMode),
55
57
  packageTranslationsPlugin(),
@@ -9,6 +9,8 @@ const PREVAL_IMPORT_TRANSLATION_IMPORTS =
9
9
  const PREVAL_IMPORT_ENGLISH_TRANSLATIONS =
10
10
  'preval.require("../../configs/scripts/getEnglishTranslation.js")';
11
11
 
12
+ const SOURCEMAP_URL_RE = /\/\/[#@] sourceMappingURL=[^\n]+/gm;
13
+
12
14
  const prevalPlugin = () => ({
13
15
  name: "preval-plugin",
14
16
  setup(build) {
@@ -22,6 +24,7 @@ const prevalPlugin = () => ({
22
24
  const contents = await fs.readFile(args.path, "utf8");
23
25
 
24
26
  const transformedContent = contents
27
+ .replace(SOURCEMAP_URL_RE, "")
25
28
  .replace(PREVAL_IMPORT_TRANSLATION_IMPORTS, getTranslationImports())
26
29
  .replace(
27
30
  PREVAL_IMPORT_ENGLISH_TRANSLATIONS,
@@ -0,0 +1,46 @@
1
+ // esbuild has a bug in its sourcemap chaining logic. When it bundles the host
2
+ // app and encounters @bigbinary packages built with Rollup (which code-splits
3
+ // shared code into chunks like lodash-CAzW54WT.js, slicedToArray-BcL7fKuL.js),
4
+ // esbuild tries to chain through the upstream .map files. During this chaining,
5
+ // it corrupts source indices in the mappings — causing code from one package
6
+ // file (e.g. FinderModal/Body.jsx) to be attributed to a completely unrelated
7
+ // host app file (e.g. apis/s3.js). The line/column numbers are correct, but
8
+ // they point to the wrong file. This is a known class of esbuild issues
9
+ // (evanw/esbuild#3553, evanw/esbuild#3460).
10
+ //
11
+ // To work around this, we strip `//# sourceMappingURL=...` comments from
12
+ // @bigbinary package files before esbuild sees them, preventing it from
13
+ // attempting the broken chaining. After the build, `fixSourcemaps` in utils.js
14
+ // correctly re-composes sourcemaps using @ampproject/remapping.
15
+ //
16
+ // Files handled by other onLoad plugins (e.g. preval handles i18n.js) are
17
+ // skipped since esbuild only allows one onLoad handler per file — those plugins
18
+ // strip the comment themselves.
19
+
20
+ /* eslint-disable @bigbinary/neeto/no-dangling-constants */
21
+ const fs = require("fs").promises;
22
+
23
+ const SKIP_RE = /initializers\/i18n\.js$/;
24
+ const SOURCEMAP_URL_RE = /\/\/[#@] sourceMappingURL=[^\n]+/gm;
25
+
26
+ const stripSourcemapsPlugin = () => ({
27
+ name: "strip-node-modules-sourcemaps",
28
+ setup(build) {
29
+ build.onLoad(
30
+ { filter: /node_modules\/@bigbinary\/.*\.js$/ },
31
+ async args => {
32
+ if (SKIP_RE.test(args.path)) return null;
33
+
34
+ const contents = await fs.readFile(args.path, "utf8");
35
+ if (!SOURCEMAP_URL_RE.test(contents)) return null;
36
+
37
+ return {
38
+ contents: contents.replace(SOURCEMAP_URL_RE, ""),
39
+ loader: "js",
40
+ };
41
+ }
42
+ );
43
+ },
44
+ });
45
+
46
+ module.exports = { stripSourcemapsPlugin };
@@ -3,7 +3,12 @@ const path = require("path");
3
3
  const fs = require("fs");
4
4
  const { execSync, spawn } = require("child_process");
5
5
  const { pick } = require("ramda");
6
- const { DEFAULT_VISUALIZER_TEMPLATE } = require("./constants");
6
+ const { globSync } = require("glob");
7
+ const remapping = require("@ampproject/remapping");
8
+ const {
9
+ DEFAULT_VISUALIZER_TEMPLATE,
10
+ NODE_MODULES_PKG_REGEX,
11
+ } = require("./constants");
7
12
 
8
13
  // colors for console output
9
14
  const consoleColors = {
@@ -60,6 +65,73 @@ const generateBundleReport = async ({ metaFilePath, outdir, template }) => {
60
65
  }
61
66
  };
62
67
 
68
+ const loadUpstreamMap = jsAbsPath => {
69
+ const mapPath = jsAbsPath + ".map";
70
+ if (!fs.existsSync(mapPath)) return null;
71
+
72
+ try {
73
+ const map = JSON.parse(fs.readFileSync(mapPath, "utf-8"));
74
+ if (!map.sources?.length || map.sources.every(s => !s)) return null;
75
+
76
+ return map;
77
+ } catch {
78
+ return null;
79
+ }
80
+ };
81
+
82
+ const normalizeSourcePath = source => {
83
+ const match = source.match(NODE_MODULES_PKG_REGEX);
84
+ if (match) return `${match[1]}:${match[2]}`;
85
+
86
+ return source;
87
+ };
88
+
89
+ const fixSourcemaps = outdir => {
90
+ const mapFiles = globSync("**/*.map", {
91
+ cwd: outdir,
92
+ absolute: true,
93
+ nodir: true,
94
+ });
95
+
96
+ if (!mapFiles.length) return;
97
+
98
+ for (const mapFile of mapFiles) {
99
+ let parsed;
100
+
101
+ try {
102
+ const raw = fs.readFileSync(mapFile, "utf-8");
103
+ parsed = JSON.parse(raw);
104
+ } catch {
105
+ continue;
106
+ }
107
+
108
+ if (!parsed.sources?.length) continue;
109
+
110
+ try {
111
+ const mapDir = path.dirname(mapFile);
112
+
113
+ const result = remapping(parsed, (sourcePath, ctx) => {
114
+ if (!sourcePath) return null;
115
+
116
+ const baseDir = ctx.importer
117
+ ? path.dirname(path.resolve(mapDir, ctx.importer))
118
+ : mapDir;
119
+ const absPath = path.resolve(baseDir, sourcePath);
120
+ if (!absPath.includes("node_modules/@bigbinary")) return null;
121
+
122
+ return loadUpstreamMap(absPath);
123
+ });
124
+
125
+ result.sources = result.sources.map(normalizeSourcePath);
126
+
127
+ fs.writeFileSync(mapFile, JSON.stringify(result));
128
+ } catch {
129
+ parsed.sources = parsed.sources.map(normalizeSourcePath);
130
+ fs.writeFileSync(mapFile, JSON.stringify(parsed));
131
+ }
132
+ }
133
+ };
134
+
63
135
  const build = async config => {
64
136
  try {
65
137
  console.info(
@@ -80,6 +152,8 @@ const build = async config => {
80
152
 
81
153
  const result = await esbuild.build(buildConfig);
82
154
 
155
+ fixSourcemaps(buildConfig.outdir);
156
+
83
157
  if (result.metafile) {
84
158
  const metaFilePath = writeMetafile(result.metafile, buildConfig.outdir);
85
159
  await generateBundleReport({
@@ -50,7 +50,7 @@ var HoneybadgerErrorBoundary = function HoneybadgerErrorBoundary(_ref) {
50
50
  enableUncaught: true,
51
51
  async: true,
52
52
  breadcrumbsEnabled: true,
53
- projectRoot: "webpack:///./",
53
+ projectRoot: "",
54
54
  enableUnhandledRejection: false
55
55
  }, config));
56
56
  return /*#__PURE__*/jsxRuntime.jsx(react.HoneybadgerErrorBoundary, {
@@ -1 +1 @@
1
- {"version":3,"file":"HoneybadgerErrorBoundary.js","sources":["../../../../src/react-utils/HoneybadgerErrorBoundary/HoneybadgerErrorBoundary.jsx"],"sourcesContent":["import {\n Honeybadger,\n HoneybadgerErrorBoundary as ErrorBoundary,\n} from \"@honeybadger-io/react\";\n\nimport {\n IGNORABLE_ERROR_NAMES_REGEX,\n IGNORABLE_ERRORS_REGEX,\n IGNORABLE_STACKS_REGEX,\n} from \"./constants\";\nimport FallbackComponent from \"./FallbackComponent\";\nimport {\n attachContext,\n getSessionReplayUrl,\n isNeetoReplaySecurityError,\n} from \"./utils\";\n\n/** @type {import(\"neetocommons/react-utils\").HoneybadgerErrorBoundary} */\nconst HoneybadgerErrorBoundary = ({\n children,\n ErrorComponent = FallbackComponent,\n filterErrors = undefined,\n config,\n}) => {\n Honeybadger.beforeNotify(notice => {\n if (!notice) return false;\n\n const isIgnorable =\n IGNORABLE_ERRORS_REGEX.test(notice.message) ||\n IGNORABLE_ERROR_NAMES_REGEX.test(notice.name) ||\n IGNORABLE_STACKS_REGEX.test(notice.stack) ||\n isNeetoReplaySecurityError(notice) ||\n filterErrors?.(notice) === false;\n\n if (isIgnorable) return false;\n\n const context = { errorClass: notice.name };\n\n if (notice.name === \"ChunkLoadError\") {\n context.IGNORABLE_ERROR_NAMES_REGEX = IGNORABLE_ERROR_NAMES_REGEX;\n context.isChunkLoadError = IGNORABLE_ERROR_NAMES_REGEX.test(notice.name);\n }\n\n const user = globalProps.user?.email;\n if (user) context.user = user;\n\n const sessionReplay = getSessionReplayUrl();\n if (sessionReplay) context.sessionReplay = sessionReplay;\n\n attachContext(notice, context);\n\n return true;\n });\n\n const honeybadger = Honeybadger.configure({\n apiKey: globalProps.honeybadgerApiKey,\n environment: globalProps.railsEnv,\n revision: globalProps.honeybadgerRevision,\n developmentEnvironments: [\"development\", \"test\"],\n enableUncaught: true,\n async: true,\n breadcrumbsEnabled: true,\n projectRoot: \"webpack:///./\",\n enableUnhandledRejection: false,\n ...config,\n });\n\n return (\n <ErrorBoundary {...{ ErrorComponent, honeybadger }}>\n {children}\n </ErrorBoundary>\n );\n};\n\nexport default HoneybadgerErrorBoundary;\n"],"names":["HoneybadgerErrorBoundary","_ref","children","_ref$ErrorComponent","ErrorComponent","FallbackComponent","_ref$filterErrors","filterErrors","undefined","config","Honeybadger","beforeNotify","notice","_globalProps$user","isIgnorable","IGNORABLE_ERRORS_REGEX","test","message","IGNORABLE_ERROR_NAMES_REGEX","name","IGNORABLE_STACKS_REGEX","stack","isNeetoReplaySecurityError","context","errorClass","isChunkLoadError","user","globalProps","email","sessionReplay","getSessionReplayUrl","attachContext","honeybadger","configure","_objectSpread","apiKey","honeybadgerApiKey","environment","railsEnv","revision","honeybadgerRevision","developmentEnvironments","enableUncaught","async","breadcrumbsEnabled","projectRoot","enableUnhandledRejection","_jsx","ErrorBoundary"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,IAAMA,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAAC,IAAA,EAKxB;AAAA,EAAA,IAJJC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAAC,mBAAA,GAAAF,IAAA,CACRG,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAAA,KAAGE,MAAAA,GAAAA,qDAAiB,GAAAF,mBAAA;IAAAG,iBAAA,GAAAL,IAAA,CAClCM,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAGE,MAAAA,GAAAA,SAAS,GAAAF,iBAAA;IACxBG,MAAM,GAAAR,IAAA,CAANQ,MAAM;AAENC,EAAAA,iBAAW,CAACC,YAAY,CAAC,UAAAC,MAAM,EAAI;AAAA,IAAA,IAAAC,iBAAA;AACjC,IAAA,IAAI,CAACD,MAAM,EAAE,OAAO,KAAK;IAEzB,IAAME,WAAW,GACfC,oEAAsB,CAACC,IAAI,CAACJ,MAAM,CAACK,OAAO,CAAC,IAC3CC,yEAA2B,CAACF,IAAI,CAACJ,MAAM,CAACO,IAAI,CAAC,IAC7CC,oEAAsB,CAACJ,IAAI,CAACJ,MAAM,CAACS,KAAK,CAAC,IACzCC,oEAA0B,CAACV,MAAM,CAAC,IAClC,CAAAL,YAAY,KAAA,IAAA,IAAZA,YAAY,KAAZA,MAAAA,GAAAA,MAAAA,GAAAA,YAAY,CAAGK,MAAM,CAAC,MAAK,KAAK;IAElC,IAAIE,WAAW,EAAE,OAAO,KAAK;AAE7B,IAAA,IAAMS,OAAO,GAAG;MAAEC,UAAU,EAAEZ,MAAM,CAACO;KAAM;AAE3C,IAAA,IAAIP,MAAM,CAACO,IAAI,KAAK,gBAAgB,EAAE;MACpCI,OAAO,CAAC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Boundary/HoneybadgerErrorBoundary.jsx"],"sourcesContent":["import {\n Honeybadger,\n HoneybadgerErrorBoundary as ErrorBoundary,\n} from \"@honeybadger-io/react\";\n\nimport {\n IGNORABLE_ERROR_NAMES_REGEX,\n IGNORABLE_ERRORS_REGEX,\n IGNORABLE_STACKS_REGEX,\n} from \"./constants\";\nimport FallbackComponent from \"./FallbackComponent\";\nimport {\n attachContext,\n getSessionReplayUrl,\n isNeetoReplaySecurityError,\n} from \"./utils\";\n\n/** @type {import(\"neetocommons/react-utils\").HoneybadgerErrorBoundary} */\nconst HoneybadgerErrorBoundary = ({\n children,\n ErrorComponent = FallbackComponent,\n filterErrors = undefined,\n config,\n}) => {\n Honeybadger.beforeNotify(notice => {\n if (!notice) return false;\n\n const isIgnorable =\n IGNORABLE_ERRORS_REGEX.test(notice.message) ||\n IGNORABLE_ERROR_NAMES_REGEX.test(notice.name) ||\n IGNORABLE_STACKS_REGEX.test(notice.stack) ||\n isNeetoReplaySecurityError(notice) ||\n filterErrors?.(notice) === false;\n\n if (isIgnorable) return false;\n\n const context = { errorClass: notice.name };\n\n if (notice.name === \"ChunkLoadError\") {\n context.IGNORABLE_ERROR_NAMES_REGEX = IGNORABLE_ERROR_NAMES_REGEX;\n context.isChunkLoadError = IGNORABLE_ERROR_NAMES_REGEX.test(notice.name);\n }\n\n const user = globalProps.user?.email;\n if (user) context.user = user;\n\n const sessionReplay = getSessionReplayUrl();\n if (sessionReplay) context.sessionReplay = sessionReplay;\n\n attachContext(notice, context);\n\n return true;\n });\n\n const honeybadger = Honeybadger.configure({\n apiKey: globalProps.honeybadgerApiKey,\n environment: globalProps.railsEnv,\n revision: globalProps.honeybadgerRevision,\n developmentEnvironments: [\"development\", \"test\"],\n enableUncaught: true,\n async: true,\n breadcrumbsEnabled: true,\n projectRoot: \"\",\n enableUnhandledRejection: false,\n ...config,\n });\n\n return (\n <ErrorBoundary {...{ ErrorComponent, honeybadger }}>\n {children}\n </ErrorBoundary>\n );\n};\n\nexport default HoneybadgerErrorBoundary;\n"],"names":["HoneybadgerErrorBoundary","_ref","children","_ref$ErrorComponent","ErrorComponent","FallbackComponent","_ref$filterErrors","filterErrors","undefined","config","Honeybadger","beforeNotify","notice","_globalProps$user","isIgnorable","IGNORABLE_ERRORS_REGEX","test","message","IGNORABLE_ERROR_NAMES_REGEX","name","IGNORABLE_STACKS_REGEX","stack","isNeetoReplaySecurityError","context","errorClass","isChunkLoadError","user","globalProps","email","sessionReplay","getSessionReplayUrl","attachContext","honeybadger","configure","_objectSpread","apiKey","honeybadgerApiKey","environment","railsEnv","revision","honeybadgerRevision","developmentEnvironments","enableUncaught","async","breadcrumbsEnabled","projectRoot","enableUnhandledRejection","_jsx","ErrorBoundary"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,IAAMA,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAAC,IAAA,EAKxB;AAAA,EAAA,IAJJC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAAC,mBAAA,GAAAF,IAAA,CACRG,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAAA,KAAGE,MAAAA,GAAAA,qDAAiB,GAAAF,mBAAA;IAAAG,iBAAA,GAAAL,IAAA,CAClCM,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAGE,MAAAA,GAAAA,SAAS,GAAAF,iBAAA;IACxBG,MAAM,GAAAR,IAAA,CAANQ,MAAM;AAENC,EAAAA,iBAAW,CAACC,YAAY,CAAC,UAAAC,MAAM,EAAI;AAAA,IAAA,IAAAC,iBAAA;AACjC,IAAA,IAAI,CAACD,MAAM,EAAE,OAAO,KAAK;IAEzB,IAAME,WAAW,GACfC,oEAAsB,CAACC,IAAI,CAACJ,MAAM,CAACK,OAAO,CAAC,IAC3CC,yEAA2B,CAACF,IAAI,CAACJ,MAAM,CAACO,IAAI,CAAC,IAC7CC,oEAAsB,CAACJ,IAAI,CAACJ,MAAM,CAACS,KAAK,CAAC,IACzCC,oEAA0B,CAACV,MAAM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E,EAAE;AACfC,IAAAA,wBAAwB,EAAE;GACvBrC,EAAAA,MAAM,CACV,CAAC;EAEF,oBACEsC,cAAA,CAACC,8BAAa,EAAA;AAAO5C,IAAAA,cAAc,EAAdA,cAAc;AAAE4B,IAAAA,WAAW,EAAXA,WAAW;AAAA9B,IAAAA,QAAA,EAC7CA;AAAQ,GACI,CAAC;AAEpB;;;;"}
@@ -48,7 +48,7 @@ var HoneybadgerErrorBoundary = function HoneybadgerErrorBoundary(_ref) {
48
48
  enableUncaught: true,
49
49
  async: true,
50
50
  breadcrumbsEnabled: true,
51
- projectRoot: "webpack:///./",
51
+ projectRoot: "",
52
52
  enableUnhandledRejection: false
53
53
  }, config));
54
54
  return /*#__PURE__*/jsx(HoneybadgerErrorBoundary$1, {
@@ -1 +1 @@
1
- {"version":3,"file":"HoneybadgerErrorBoundary.js","sources":["../../../src/react-utils/HoneybadgerErrorBoundary/HoneybadgerErrorBoundary.jsx"],"sourcesContent":["import {\n Honeybadger,\n HoneybadgerErrorBoundary as ErrorBoundary,\n} from \"@honeybadger-io/react\";\n\nimport {\n IGNORABLE_ERROR_NAMES_REGEX,\n IGNORABLE_ERRORS_REGEX,\n IGNORABLE_STACKS_REGEX,\n} from \"./constants\";\nimport FallbackComponent from \"./FallbackComponent\";\nimport {\n attachContext,\n getSessionReplayUrl,\n isNeetoReplaySecurityError,\n} from \"./utils\";\n\n/** @type {import(\"neetocommons/react-utils\").HoneybadgerErrorBoundary} */\nconst HoneybadgerErrorBoundary = ({\n children,\n ErrorComponent = FallbackComponent,\n filterErrors = undefined,\n config,\n}) => {\n Honeybadger.beforeNotify(notice => {\n if (!notice) return false;\n\n const isIgnorable =\n IGNORABLE_ERRORS_REGEX.test(notice.message) ||\n IGNORABLE_ERROR_NAMES_REGEX.test(notice.name) ||\n IGNORABLE_STACKS_REGEX.test(notice.stack) ||\n isNeetoReplaySecurityError(notice) ||\n filterErrors?.(notice) === false;\n\n if (isIgnorable) return false;\n\n const context = { errorClass: notice.name };\n\n if (notice.name === \"ChunkLoadError\") {\n context.IGNORABLE_ERROR_NAMES_REGEX = IGNORABLE_ERROR_NAMES_REGEX;\n context.isChunkLoadError = IGNORABLE_ERROR_NAMES_REGEX.test(notice.name);\n }\n\n const user = globalProps.user?.email;\n if (user) context.user = user;\n\n const sessionReplay = getSessionReplayUrl();\n if (sessionReplay) context.sessionReplay = sessionReplay;\n\n attachContext(notice, context);\n\n return true;\n });\n\n const honeybadger = Honeybadger.configure({\n apiKey: globalProps.honeybadgerApiKey,\n environment: globalProps.railsEnv,\n revision: globalProps.honeybadgerRevision,\n developmentEnvironments: [\"development\", \"test\"],\n enableUncaught: true,\n async: true,\n breadcrumbsEnabled: true,\n projectRoot: \"webpack:///./\",\n enableUnhandledRejection: false,\n ...config,\n });\n\n return (\n <ErrorBoundary {...{ ErrorComponent, honeybadger }}>\n {children}\n </ErrorBoundary>\n );\n};\n\nexport default HoneybadgerErrorBoundary;\n"],"names":["HoneybadgerErrorBoundary","_ref","children","_ref$ErrorComponent","ErrorComponent","FallbackComponent","_ref$filterErrors","filterErrors","undefined","config","Honeybadger","beforeNotify","notice","_globalProps$user","isIgnorable","IGNORABLE_ERRORS_REGEX","test","message","IGNORABLE_ERROR_NAMES_REGEX","name","IGNORABLE_STACKS_REGEX","stack","isNeetoReplaySecurityError","context","errorClass","isChunkLoadError","user","globalProps","email","sessionReplay","getSessionReplayUrl","attachContext","honeybadger","configure","_objectSpread","apiKey","honeybadgerApiKey","environment","railsEnv","revision","honeybadgerRevision","developmentEnvironments","enableUncaught","async","breadcrumbsEnabled","projectRoot","enableUnhandledRejection","_jsx","ErrorBoundary"],"mappings":";;;;;;;;;;;;;;;;AAkBA,IAAMA,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAAC,IAAA,EAKxB;AAAA,EAAA,IAJJC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAAC,mBAAA,GAAAF,IAAA,CACRG,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAA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,GAAGC,mBAAmB,EAAE;AAC3C,IAAA,IAAID,aAAa,EAAEN,OAAO,CAACM,aAAa,GAAGA,aAAa;AAExDE,IAAAA,aAAa,CAACnB,MAAM,EAAEW,OAAO,CAAC;AAE9B,IAAA,OAAO,IAAI;AACb,GAAC,CAAC;AAEF,EAAA,IAAMS,WAAW,GAAGtB,WAAW,CAACuB,SAAS,CAAAC,aAAA,CAAA;IACvCC,MAAM,EAAER,WAAW,CAACS,iBAAiB;IACrCC,WAAW,EAAEV,WAAW,CAACW,QAAQ;IACjCC,QAAQ,EAAEZ,WAAW,CAACa,mBAAmB;AACzCC,IAAAA,uBAAuB,EAAE,CAAC,aAAa,EAAE,MAAM,CAAC;AAChDC,IAAAA,cAAc,EAAE,IAAI;AACpBC,IAAAA,KAAK,EAAE,IAAI;AACXC,IAAAA,kBAAkB,EAAE,IAAI;AACxBC,IAAAA,WAAW,EAAE,eAAe;AAC5BC,IAAAA,wBAAwB,EAAE;GACvBrC,EAAAA,MAAM,CACV,CAAC;EAEF,oBACEsC,GAAA,CAACC,0BAAa,EAAA;AAAO5C,IAAAA,cAAc,EAAdA,cAAc;AAAE4B,IAAAA,WAAW,EAAXA,WAAW;AAAA9B,IAAAA,QAAA,EAC7CA;AAAQ,GACI,CAAC;AAEpB;;;;"}
1
+ {"version":3,"file":"HoneybadgerErrorBoundary.js","sources":["../../../src/react-utils/HoneybadgerErrorBoundary/HoneybadgerErrorBoundary.jsx"],"sourcesContent":["import {\n Honeybadger,\n HoneybadgerErrorBoundary as ErrorBoundary,\n} from \"@honeybadger-io/react\";\n\nimport {\n IGNORABLE_ERROR_NAMES_REGEX,\n IGNORABLE_ERRORS_REGEX,\n IGNORABLE_STACKS_REGEX,\n} from \"./constants\";\nimport FallbackComponent from \"./FallbackComponent\";\nimport {\n attachContext,\n getSessionReplayUrl,\n isNeetoReplaySecurityError,\n} from \"./utils\";\n\n/** @type {import(\"neetocommons/react-utils\").HoneybadgerErrorBoundary} */\nconst HoneybadgerErrorBoundary = ({\n children,\n ErrorComponent = FallbackComponent,\n filterErrors = undefined,\n config,\n}) => {\n Honeybadger.beforeNotify(notice => {\n if (!notice) return false;\n\n const isIgnorable =\n IGNORABLE_ERRORS_REGEX.test(notice.message) ||\n IGNORABLE_ERROR_NAMES_REGEX.test(notice.name) ||\n IGNORABLE_STACKS_REGEX.test(notice.stack) ||\n isNeetoReplaySecurityError(notice) ||\n filterErrors?.(notice) === false;\n\n if (isIgnorable) return false;\n\n const context = { errorClass: notice.name };\n\n if (notice.name === \"ChunkLoadError\") {\n context.IGNORABLE_ERROR_NAMES_REGEX = IGNORABLE_ERROR_NAMES_REGEX;\n context.isChunkLoadError = IGNORABLE_ERROR_NAMES_REGEX.test(notice.name);\n }\n\n const user = globalProps.user?.email;\n if (user) context.user = user;\n\n const sessionReplay = getSessionReplayUrl();\n if (sessionReplay) context.sessionReplay = sessionReplay;\n\n attachContext(notice, context);\n\n return true;\n });\n\n const honeybadger = Honeybadger.configure({\n apiKey: globalProps.honeybadgerApiKey,\n environment: globalProps.railsEnv,\n revision: globalProps.honeybadgerRevision,\n developmentEnvironments: [\"development\", \"test\"],\n enableUncaught: true,\n async: true,\n breadcrumbsEnabled: true,\n projectRoot: \"\",\n enableUnhandledRejection: false,\n ...config,\n });\n\n return (\n <ErrorBoundary {...{ ErrorComponent, honeybadger }}>\n {children}\n </ErrorBoundary>\n );\n};\n\nexport default HoneybadgerErrorBoundary;\n"],"names":["HoneybadgerErrorBoundary","_ref","children","_ref$ErrorComponent","ErrorComponent","FallbackComponent","_ref$filterErrors","filterErrors","undefined","config","Honeybadger","beforeNotify","notice","_globalProps$user","isIgnorable","IGNORABLE_ERRORS_REGEX","test","message","IGNORABLE_ERROR_NAMES_REGEX","name","IGNORABLE_STACKS_REGEX","stack","isNeetoReplaySecurityError","context","errorClass","isChunkLoadError","user","globalProps","email","sessionReplay","getSessionReplayUrl","attachContext","honeybadger","configure","_objectSpread","apiKey","honeybadgerApiKey","environment","railsEnv","revision","honeybadgerRevision","developmentEnvironments","enableUncaught","async","breadcrumbsEnabled","projectRoot","enableUnhandledRejection","_jsx","ErrorBoundary"],"mappings":";;;;;;;;;;;;;;;;AAkBA,IAAMA,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAAC,IAAA,EAKxB;AAAA,EAAA,IAJJC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAAC,mBAAA,GAAAF,IAAA,CACRG,cAAc;AAAdA,IAAAA,cAAc,GAAAD,mBAAA,KAAGE,MAAAA,GAAAA,iBAAiB,GAAAF,mBAAA;IAAAG,iBAAA,GAAAL,IAAA,CAClCM,YAAY;AAAZA,IAAAA,YAAY,GAAAD,iBAAA,KAAGE,MAAAA,GAAAA,SAAS,GAAAF,iBAAA;IACxBG,MAAM,GAAAR,IAAA,CAANQ,MAAM;AAENC,EAAAA,WAAW,CAACC,YAAY,CAAC,UAAAC,MAAM,EAAI;AAAA,IAAA,IAAAC,iBAAA;AACjC,IAAA,IAAI,CAACD,MAAM,EAAE,OAAO,KAAK;IAEzB,IAAME,WAAW,GACfC,sBAAsB,CAACC,IAAI,CAACJ,MAAM,CAACK,OAAO,CAAC,IAC3CC,2BAA2B,CAACF,IAAI,CAACJ,MAAM,CAACO,IAAI,CAAC,IAC7CC,sBAAsB,CAACJ,IAAI,CAACJ,MAAM,CAACS,KAAK,CAAC,IACzCC,0BAA0B,CAACV,MAAM,CAAC,IAClC,CAAAL,YAAY,KAAA,IAAA,IAAZA,YAAY,KAAZA,MAAAA,GAAAA,MAAAA,GAAAA,YAAY,CAAGK,MAAM,CAAC,MAAK,KAAK;IAElC,IAAIE,WAAW,EAAE,OAAO,KAAK;AAE7B,IAAA,IAAMS,OAAO,GAAG;MAAEC,UAAU,EAAEZ,MAAM,CAACO;KAAM;AAE3C,IAAA,IAAIP,MAAM,CAACO,IAAI,KAAK,gBAAgB,EAAE;MACpCI,OAAO,CAACL,2BAA2B,GAAGA,2BAA2B;MACjEK,OAAO,CAACE,gBAAgB,GAAGP,2BAA2B,CAACF,IAAI,CAACJ,MAAM,CAACO,IAAI,CAAC;AAC1E;AAEA,IAAA,IAAMO,IAAI,GAAA,CAAAb,iBAAA,GAAGc,WAAW,CAACD,IAAI,MAAA,IAAA,IAAAb,iBAAA,KAAA,MAAA,GAAA,MAAA,GAAhBA,iBAAA,CAAkBe,KAAK;AACpC,IAAA,IAAIF,IAAI,EAAEH,OAAO,CAACG,IAAI,GAAGA,IAAI;AAE7B,IAAA,IAAMG,aAAa,GAAGC,mBAAmB,EAAE;AAC3C,IAAA,IAAID,aAAa,EAAEN,OAAO,CAACM,aAAa,GAAGA,aAAa;AAExDE,IAAAA,aAAa,CAACnB,MAAM,EAAEW,OAAO,CAAC;AAE9B,IAAA,OAAO,IAAI;AACb,GAAC,CAAC;AAEF,EAAA,IAAMS,WAAW,GAAGtB,WAAW,CAACuB,SAAS,CAAAC,aAAA,CAAA;IACvCC,MAAM,EAAER,WAAW,CAACS,iBAAiB;IACrCC,WAAW,EAAEV,WAAW,CAACW,QAAQ;IACjCC,QAAQ,EAAEZ,WAAW,CAACa,mBAAmB;AACzCC,IAAAA,uBAAuB,EAAE,CAAC,aAAa,EAAE,MAAM,CAAC;AAChDC,IAAAA,cAAc,EAAE,IAAI;AACpBC,IAAAA,KAAK,EAAE,IAAI;AACXC,IAAAA,kBAAkB,EAAE,IAAI;AACxBC,IAAAA,WAAW,EAAE,EAAE;AACfC,IAAAA,wBAAwB,EAAE;GACvBrC,EAAAA,MAAM,CACV,CAAC;EAEF,oBACEsC,GAAA,CAACC,0BAAa,EAAA;AAAO5C,IAAAA,cAAc,EAAdA,cAAc;AAAE4B,IAAAA,WAAW,EAAXA,WAAW;AAAA9B,IAAAA,QAAA,EAC7CA;AAAQ,GACI,CAAC;AAEpB;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-commons-frontend",
3
- "version": "4.13.103",
3
+ "version": "4.13.105",
4
4
  "description": "A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.",
5
5
  "repository": "git@github.com:bigbinary/neeto-commons-frontend.git",
6
6
  "author": "Amaljith K <amaljith.k@bigbinary.com>",
@@ -71,6 +71,7 @@
71
71
  "src/translations"
72
72
  ],
73
73
  "devDependencies": {
74
+ "@ampproject/remapping": "^2.3.0",
74
75
  "@babel/cli": "^7.23.0",
75
76
  "@babel/core": "7.26.0",
76
77
  "@babel/eslint-parser": "7.25.9",