@honeybadger-io/vue 4.3.0 → 4.3.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"honeybadger-vue.min.js","sources":["../../src/vue-debug.js","../../src/error-logging.js","../../src/index.js"],"sourcesContent":["/**\n * This was taken from https://github.com/vuejs/vue/blob/master/src/core/util/debug.js.\n * The method generateStackTrace is used to log errors the same way as Vue logs them when errorHandler is not set.\n */\n\nconst classifyRE = /(?:^|[-_])(\\w)/g\nconst classify = str => str\n .replace(classifyRE, c => c.toUpperCase())\n .replace(/[-_]/g, '')\n\nconst formatComponentName = (vm, includeFile) => {\n if (vm.$root === vm) {\n return '<Root>'\n }\n const options = typeof vm === 'function' && vm.cid != null\n ? vm.options\n : vm._isVue\n ? vm.$options || vm.constructor.options\n : vm || {}\n let name = options.name || options._componentTag\n const file = options.__file\n if (!name && file) {\n const match = file.match(/([^/\\\\]+)\\.vue$/)\n name = match && match[1]\n }\n\n return (\n (name ? `<${classify(name)}>` : '<Anonymous>') +\n (file && includeFile !== false ? ` at ${file}` : '')\n )\n}\n\nconst repeat = (str, n) => {\n let res = ''\n while (n) {\n if (n % 2 === 1) res += str\n if (n > 1) str += str\n n >>= 1\n }\n return res\n}\n\nexport const generateComponentTrace = vm => {\n if (vm._isVue && vm.$parent) {\n const tree = []\n let currentRecursiveSequence = 0\n while (vm) {\n if (tree.length > 0) {\n const last = tree[tree.length - 1]\n if (last.constructor === vm.constructor) {\n currentRecursiveSequence++\n vm = vm.$parent\n continue\n } else if (currentRecursiveSequence > 0) {\n tree[tree.length - 1] = [last, currentRecursiveSequence]\n currentRecursiveSequence = 0\n }\n }\n tree.push(vm)\n vm = vm.$parent\n }\n return '\\n\\nfound in\\n\\n' + tree\n .map((vm, i) => `${\n i === 0 ? '---> ' : repeat(' ', 5 + i * 2)\n }${\n Array.isArray(vm)\n ? `${formatComponentName(vm[0])}... (${vm[1]} recursive calls)`\n : formatComponentName(vm)\n }`)\n .join('\\n')\n } else {\n return `\\n\\n(found in ${formatComponentName(vm)})`\n }\n}\n","import { generateComponentTrace } from './vue-debug'\n\nexport function logError (app, error, vm, info) {\n const message = `Error in ${info}: \"${error && error.toString()}\"`\n\n const trace = vm ? generateComponentTrace(vm) : ''\n if (app.config.warnHandler) {\n app.config.warnHandler.call(null, message, vm, trace)\n } else {\n console.error(`[Vue warn]: ${message}${trace}`)\n }\n}\n","import Honeybadger from '@honeybadger-io/js'\nimport { logError } from './error-logging'\n\nfunction shouldLogError (app, options) {\n if (app.config.warnHandler) {\n return true\n }\n\n const hasConsole = typeof console !== 'undefined'\n const hasProcess = typeof process !== 'undefined'\n const isDebug = options.debug || (hasProcess && process.env.NODE_ENV !== 'production')\n return hasConsole && isDebug\n}\n\nfunction extractContext (vm) {\n const options = vm.$options || {}\n const name = options.name || options._componentTag\n const file = options.__file\n const parentName = vm.$parent && vm.$parent.$options ? vm.$parent.$options.name : undefined\n\n // Vue2 - $options.propsData\n // Vue3 - $props\n const props = options.propsData || vm.$props\n\n return {\n isRoot: vm.$root === vm,\n name: name,\n props,\n parentName: parentName,\n file: file\n }\n}\n\nfunction install(vue, options) {\n if (options.debug) {\n console.log(`Honeybadger configured with ${options.apiKey}`)\n }\n const honeybadger = Honeybadger.configure(options)\n vue.$honeybadger = honeybadger\n\n // vue 2 support -> make available for all components\n if (vue.prototype) {\n vue.prototype.$honeybadger = honeybadger\n }\n\n if (vue.config && vue.config.globalProperties) {\n // vue 3 support -> make available for all components\n vue.config.globalProperties.$honeybadger = honeybadger\n }\n const chainedErrorHandler = vue.config.errorHandler\n vue.config.errorHandler = (error, vm, info) => {\n const metadata = { context: { vm: extractContext(vm), info: info } }\n honeybadger.notify(error, metadata)\n if (typeof chainedErrorHandler === 'function') {\n chainedErrorHandler.call(vue, error, vm, info)\n }\n\n if (shouldLogError(vue, options)) {\n logError(vue, error, vm, info)\n }\n }\n}\n\nexport default {\n install\n}\n"],"names":["classifyRE","formatComponentName","vm","includeFile","$root","const","options","cid","_isVue","$options","constructor","name","_componentTag","file","__file","match","replace","c","toUpperCase","logError","app","error","info","message","toString","trace","$parent","tree","currentRecursiveSequence","length","last","push","map","i","str","n","let","res","repeat","Array","isArray","join","generateComponentTrace","config","warnHandler","call","console","extractContext","parentName","undefined","props","propsData","$props","isRoot","index","install","vue","debug","log","honeybadger","Honeybadger","configure","$honeybadger","prototype","globalProperties","chainedErrorHandler","errorHandler","metadata","context","notify","hasConsole","hasProcess","process","isDebug","env","NODE_ENV","shouldLogError"],"mappings":"iIAKMA,EAAa,kBAKbC,EAAmB,SAAIC,EAAIC,GAC/B,GAAID,EAAGE,QAAUF,EACf,MAAO,SAETG,IAAMC,EAAwB,mBAAPJ,GAA+B,MAAVA,EAAGK,IAC3CL,EAAGI,QACHJ,EAAGM,OACDN,EAAGO,UAAYP,EAAGQ,YAAYJ,QAC9BJ,GAAM,GACRS,EAAOL,EAAQK,MAAQL,EAAQM,cAC7BC,EAAOP,EAAQQ,OACrB,IAAKH,GAAQE,EAAM,CACjBR,IAAMU,EAAQF,EAAKE,MAAM,mBACzBJ,EAAOI,GAASA,EAAM,GAGxB,OACGJ,EAAW,KAASA,EApBtBK,QAAQhB,GAAY,SAAAiB,UAAKA,EAAEC,iBAC3BF,QAAQ,QAAS,IAmBU,KAAM,gBAC/BH,IAAwB,IAAhBV,EAA+B,OAAAU,EAAS,KC1B9C,SAASM,EAAUC,EAAKC,EAAOnB,EAAIoB,GACxCjB,IAAMkB,EAAU,YAAYD,EAAU,OAAAD,GAASA,EAAMG,YAAa,IAE5DC,EAAQvB,EDqCmB,SAAGA,GACpC,GAAIA,EAAGM,QAAUN,EAAGwB,QAAS,CAG3B,IAFArB,IAAMsB,EAAO,GACTC,EAA2B,EACxB1B,GAAI,CACT,GAAIyB,EAAKE,OAAS,EAAG,CACnBxB,IAAMyB,EAAOH,EAAKA,EAAKE,OAAS,GAChC,GAAIC,EAAKpB,cAAgBR,EAAGQ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,EAAIO,YACNP,EAAIO,UAAUD,aAAeH,GAG3BH,EAAIb,QAAUa,EAAIb,OAAOqB,mBAE3BR,EAAIb,OAAOqB,iBAAiBF,aAAeH,GAE7CtD,IAAM4D,EAAsBT,EAAIb,OAAOuB,aACvCV,EAAIb,OAAOuB,aAAY,SAAI7C,EAAOnB,EAAIoB,GACpCjB,IAAM8D,EAAW,CAAEC,QAAS,CAAElE,GAAI6C,EAAe7C,GAAKoB,KAAMA,IAC5DqC,EAAYU,OAAOhD,EAAO8C,GACS,mBAAxBF,GACTA,EAAoBpB,KAAKW,EAAKnC,EAAOnB,EAAIoB,GAnD/C,SAAyBF,EAAKd,GAC5B,GAAIc,EAAIuB,OAAOC,YACb,OAAO,EAGTvC,IAAMiE,EAAgC,oBAAZxB,QACpByB,EAAgC,oBAAZC,QACpBC,EAAUnE,EAAQmD,OAAUc,GAAuC,eAAzBC,QAAQE,IAAIC,SAC5D,OAAOL,GAAcG,EA8CfG,CAAepB,EAAKlD,IACtBa,EAASqC,EAAKnC,EAAOnB,EAAIoB"}
1
+ {"version":3,"file":"honeybadger-vue.min.js","sources":["../../src/vue-debug.js","../../src/error-logging.js","../../src/index.js"],"sourcesContent":["/**\n * This was taken from https://github.com/vuejs/vue/blob/master/src/core/util/debug.js.\n * The method generateStackTrace is used to log errors the same way as Vue logs them when errorHandler is not set.\n */\n\nconst classifyRE = /(?:^|[-_])(\\w)/g\nconst classify = str => str\n .replace(classifyRE, c => c.toUpperCase())\n .replace(/[-_]/g, '')\n\nconst formatComponentName = (vm, includeFile) => {\n if (vm.$root === vm) {\n return '<Root>'\n }\n const options = typeof vm === 'function' && vm.cid != null\n ? vm.options\n : vm._isVue\n ? vm.$options || vm.constructor.options\n : vm || {}\n let name = options.name || options._componentTag\n const file = options.__file\n if (!name && file) {\n const match = file.match(/([^/\\\\]+)\\.vue$/)\n name = match && match[1]\n }\n\n return (\n (name ? `<${classify(name)}>` : '<Anonymous>') +\n (file && includeFile !== false ? ` at ${file}` : '')\n )\n}\n\nconst repeat = (str, n) => {\n let res = ''\n while (n) {\n if (n % 2 === 1) res += str\n if (n > 1) str += str\n n >>= 1\n }\n return res\n}\n\nexport const generateComponentTrace = vm => {\n if (vm._isVue && vm.$parent) {\n const tree = []\n let currentRecursiveSequence = 0\n while (vm) {\n if (tree.length > 0) {\n const last = tree[tree.length - 1]\n if (last.constructor === vm.constructor) {\n currentRecursiveSequence++\n vm = vm.$parent\n continue\n } else if (currentRecursiveSequence > 0) {\n tree[tree.length - 1] = [last, currentRecursiveSequence]\n currentRecursiveSequence = 0\n }\n }\n tree.push(vm)\n vm = vm.$parent\n }\n return '\\n\\nfound in\\n\\n' + tree\n .map((vm, i) => `${\n i === 0 ? '---> ' : repeat(' ', 5 + i * 2)\n }${\n Array.isArray(vm)\n ? `${formatComponentName(vm[0])}... (${vm[1]} recursive calls)`\n : formatComponentName(vm)\n }`)\n .join('\\n')\n } else {\n return `\\n\\n(found in ${formatComponentName(vm)})`\n }\n}\n","import { generateComponentTrace } from './vue-debug'\n\nexport function logError (app, error, vm, info) {\n const message = `Error in ${info}: \"${error && error.toString()}\"`\n\n const trace = vm ? generateComponentTrace(vm) : ''\n if (app.config.warnHandler) {\n app.config.warnHandler.call(null, message, vm, trace)\n } else {\n console.error(`[Vue warn]: ${message}${trace}`)\n }\n}\n","import Honeybadger from '@honeybadger-io/js'\nimport { logError } from './error-logging'\n\nfunction shouldLogError (app, options) {\n if (app.config.warnHandler) {\n return true\n }\n\n const hasConsole = typeof console !== 'undefined'\n const hasProcess = typeof process !== 'undefined'\n const isDebug = options.debug || (hasProcess && process.env.NODE_ENV !== 'production')\n return hasConsole && isDebug\n}\n\nfunction extractContext (vm) {\n const options = vm.$options || {}\n const name = options.name || options._componentTag\n const file = options.__file\n const parentName = vm.$parent && vm.$parent.$options ? vm.$parent.$options.name : undefined\n\n // Vue2 - $options.propsData\n // Vue3 - $props\n const props = options.propsData || vm.$props\n\n return {\n isRoot: vm.$root === vm,\n name: name,\n props,\n parentName: parentName,\n file: file\n }\n}\n\nfunction install(vue, options) {\n if (options.debug) {\n console.log(`Honeybadger configured with ${options.apiKey}`)\n }\n const honeybadger = Honeybadger.configure(options)\n vue.$honeybadger = honeybadger\n\n // vue 2 support -> make available for all components\n if (vue.prototype) {\n vue.prototype.$honeybadger = honeybadger\n }\n\n if (vue.config && vue.config.globalProperties) {\n // vue 3 support -> make available for all components\n vue.config.globalProperties.$honeybadger = honeybadger\n }\n const chainedErrorHandler = vue.config.errorHandler\n vue.config.errorHandler = (error, vm, info) => {\n const metadata = { context: { vm: extractContext(vm), info: info } }\n honeybadger.notify(error, metadata)\n if (typeof chainedErrorHandler === 'function') {\n chainedErrorHandler.call(vue, error, vm, info)\n }\n\n if (shouldLogError(vue, options)) {\n logError(vue, error, vm, info)\n }\n }\n}\n\nexport default {\n install\n}\n"],"names":["classifyRE","formatComponentName","vm","includeFile","$root","const","options","cid","_isVue","$options","constructor","name","_componentTag","file","__file","match","replace","c","toUpperCase","logError","app","error","info","message","toString","trace","$parent","tree","currentRecursiveSequence","length","last","push","map","i","str","n","let","res","repeat","Array","isArray","join","generateComponentTrace","config","warnHandler","call","console","extractContext","parentName","undefined","props","propsData","$props","isRoot","index","install","vue","debug","log","honeybadger","Honeybadger","configure","$honeybadger","prototype","globalProperties","chainedErrorHandler","errorHandler","metadata","context","notify","hasConsole","hasProcess","process","isDebug","env","NODE_ENV","shouldLogError"],"mappings":"iIAKMA,EAAa,kBAKbC,EAAmB,SAAIC,EAAIC,GAC/B,GAAID,EAAGE,QAAUF,EACf,MAAO,SAETG,IAAMC,EAAwB,mBAAPJ,GAA+B,MAAVA,EAAGK,IAC3CL,EAAGI,QACHJ,EAAGM,OACDN,EAAGO,UAAYP,EAAGQ,YAAYJ,QAC9BJ,GAAM,CAAE,EACVS,EAAOL,EAAQK,MAAQL,EAAQM,cAC7BC,EAAOP,EAAQQ,OACrB,IAAKH,GAAQE,EAAM,CACjBR,IAAMU,EAAQF,EAAKE,MAAM,m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AAKnC,EAAOnB,EAAIoB,EAE5B,CACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@honeybadger-io/vue",
3
- "version": "4.3.0",
3
+ "version": "4.3.1",
4
4
  "license": "MIT",
5
5
  "description": "Honeybadger Vue.js client",
6
6
  "author": "Jason Truesdell <jason@yuzuten.com> (https://github.com/JasonTrue)",
@@ -42,7 +42,7 @@
42
42
  "devDependencies": {
43
43
  "@babel/plugin-transform-runtime": "^7.18.9",
44
44
  "@babel/preset-env": "^7.18.9",
45
- "@honeybadger-io/js": "^4.3.0",
45
+ "@honeybadger-io/js": "^4.3.1",
46
46
  "@vue/compiler-sfc": "^3.2.37",
47
47
  "@vue/test-utils": "^2.0.2",
48
48
  "babel-plugin-syntax-jsx": "^6.18.0",
@@ -82,5 +82,5 @@
82
82
  ]
83
83
  }
84
84
  },
85
- "gitHead": "c5aff95bcaf716d5df122e5225c217b5e3c2620e"
85
+ "gitHead": "c6f0d637498f726673ee749c83d689dc13c7e1b6"
86
86
  }