@honeybadger-io/vue 3.1.0 → 3.2.0

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.
package/README.md CHANGED
@@ -1,15 +1,15 @@
1
1
  # Honeybadger Vue.js Integration
2
- [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fhoneybadger-io%2Fhoneybadger-vue%2Fbadge&style=flat)](https://actions-badge.atrox.dev/honeybadger-io/honeybadger-vue/goto)
2
+ [![Build Status](https://github.com/honeybadger-io/honeybadger-vue/actions/workflows/nodejs.yml/badge.svg)](https://github.com/honeybadger-io/honeybadger-vue/actions/workflows/nodejs.yml)
3
3
  [![npm version](https://badge.fury.io/js/%40honeybadger-io%2Fvue.svg)](https://badge.fury.io/js/%40honeybadger-io%2Fvue)
4
4
  > [Vue.js integration for Honeybadger.io](https://www.honeybadger.io/for/javascript/?utm_source=github&utm_medium=readme&utm_campaign=vue&utm_content=Vue.js+integration+for+Honeybadger.io)
5
5
 
6
- **Note:** The latest release of this project supports Vue.js v2.x. See the [vue3](https://github.com/honeybadger-io/honeybadger-vue/tree/vue3) branch for v3.x support.
6
+ **Note:** Since v3.2 release of this project, both Vue.js v2.x and v3.x are supported!
7
7
 
8
8
  ## Documentation and Support
9
9
 
10
10
  For comprehensive documentation and support, [check out our documentation site](https://docs.honeybadger.io/lib/javascript/index.html).
11
11
 
12
- The documentation includes a detailed [Vue integration guide](https://docs.honeybadger.io/lib/javascript/integration/vue3.html)
12
+ The documentation includes detailed Vue Integration Guides, both for Vue.js [v2.x](https://docs.honeybadger.io/lib/javascript/integration/vue2.html) and [v3.x](https://docs.honeybadger.io/lib/javascript/integration/vue3.html).
13
13
 
14
14
  ## Project Goals
15
15
 
@@ -69,9 +69,6 @@ npm run build --report
69
69
  # run unit tests
70
70
  npm run unit
71
71
 
72
- # run e2e tests
73
- HONEYBADGER_API_KEY=yourkey npm run e2e
74
-
75
72
  # run all tests
76
73
  HONEYBADGER_API_KEY=yourkey npm run test:all
77
74
  ```
@@ -82,35 +82,14 @@ function logError (app, error, vm, info) {
82
82
  }
83
83
  }
84
84
 
85
- var HoneybadgerVue = {
86
- install: function install (app, options) {
87
- if (app.config.debug) {
88
- console.log(("Honeybadger configured with " + (options.apiKey)));
89
- }
90
- var honeybadger = Honeybadger.configure(options);
91
- app.$honeybadger = honeybadger;
92
- app.config.globalProperties.$honeybadger = honeybadger;
93
- var chainedErrorHandler = app.config.errorHandler;
94
- app.config.errorHandler = function (error, vm, info) {
95
- honeybadger.notify(error, { context: { vm: extractContext(vm), info: info } });
96
- if (typeof chainedErrorHandler === 'function') {
97
- chainedErrorHandler.call(app, error, vm, info);
98
- }
99
-
100
- if (shouldLogError(app)) {
101
- logError(app, error, vm, info);
102
- }
103
- };
104
- }
105
- };
106
-
107
- function shouldLogError (app) {
85
+ function shouldLogError (app, options) {
108
86
  if (app.config.warnHandler) {
109
87
  return true
110
88
  }
111
89
 
112
90
  var hasConsole = typeof console !== 'undefined';
113
- var isDebug = app.config.debug || process.env.NODE_ENV !== 'production';
91
+ var hasProcess = typeof process !== 'undefined';
92
+ var isDebug = options.debug || (hasProcess && process.env.NODE_ENV !== 'production');
114
93
  return hasConsole && isDebug
115
94
  }
116
95
 
@@ -119,14 +98,53 @@ function extractContext (vm) {
119
98
  var name = options.name || options._componentTag;
120
99
  var file = options.__file;
121
100
  var parentName = vm.$parent && vm.$parent.$options ? vm.$parent.$options.name : undefined;
101
+
102
+ // Vue2 - $options.propsData
103
+ // Vue3 - $props
104
+ var props = options.propsData || vm.$props;
105
+
122
106
  return {
123
107
  isRoot: vm.$root === vm,
124
108
  name: name,
125
- props: vm.$props,
109
+ props: props,
126
110
  parentName: parentName,
127
111
  file: file
128
112
  }
129
113
  }
130
114
 
131
- export { HoneybadgerVue as default };
115
+ function install(vue, options) {
116
+ if (options.debug) {
117
+ console.log(("Honeybadger configured with " + (options.apiKey)));
118
+ }
119
+ var honeybadger = Honeybadger.configure(options);
120
+ vue.$honeybadger = honeybadger;
121
+
122
+ // vue 2 support -> make available for all components
123
+ if (vue.prototype) {
124
+ vue.prototype.$honeybadger = honeybadger;
125
+ }
126
+
127
+ if (vue.config && vue.config.globalProperties) {
128
+ // vue 3 support -> make available for all components
129
+ vue.config.globalProperties.$honeybadger = honeybadger;
130
+ }
131
+ var chainedErrorHandler = vue.config.errorHandler;
132
+ vue.config.errorHandler = function (error, vm, info) {
133
+ var metadata = { context: { vm: extractContext(vm), info: info } };
134
+ honeybadger.notify(error, metadata);
135
+ if (typeof chainedErrorHandler === 'function') {
136
+ chainedErrorHandler.call(vue, error, vm, info);
137
+ }
138
+
139
+ if (shouldLogError(vue, options)) {
140
+ logError(vue, error, vm, info);
141
+ }
142
+ };
143
+ }
144
+
145
+ var index = {
146
+ install: install
147
+ };
148
+
149
+ export { index as default };
132
150
  //# sourceMappingURL=honeybadger-vue.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"honeybadger-vue.esm.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\nconst HoneybadgerVue = {\n install (app, options) {\n if (app.config.debug) {\n console.log(`Honeybadger configured with ${options.apiKey}`)\n }\n const honeybadger = Honeybadger.configure(options)\n app.$honeybadger = honeybadger\n app.config.globalProperties.$honeybadger = honeybadger\n const chainedErrorHandler = app.config.errorHandler\n app.config.errorHandler = (error, vm, info) => {\n honeybadger.notify(error, { context: { vm: extractContext(vm), info: info } })\n if (typeof chainedErrorHandler === 'function') {\n chainedErrorHandler.call(app, error, vm, info)\n }\n\n if (shouldLogError(app)) {\n logError(app, error, vm, info)\n }\n }\n }\n}\n\nfunction shouldLogError (app) {\n if (app.config.warnHandler) {\n return true\n }\n\n const hasConsole = typeof console !== 'undefined'\n const isDebug = app.config.debug || 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 return {\n isRoot: vm.$root === vm,\n name: name,\n props: vm.$props,\n parentName: parentName,\n file: file\n }\n}\n\nexport default HoneybadgerVue\n"],"names":["const","let"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACAA,IAAM,UAAU,GAAG,kBAAiB;AACpCA,IAAM,QAAQ,GAAG,UAAA,GAAA,WAAO,GAAG;AAC3B,GAAG,OAAO,CAAC,UAAU,EAAE,UAAA,CAAA,WAAK,CAAC,CAAC,WAAW,EAAA,CAAA,EAAE,CAAC;AAC5C,GAAG,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA,GAAA;AACvB;AACAA,IAAM,mBAAmB,GAAA,UAAI,EAAE,EAAE,WAAW,EAAK;AACjD,EAAE,IAAI,EAAE,CAAC,KAAK,KAAK,EAAE,EAAE;AACvB,IAAI,OAAO,QAAQ;AACnB,GAAG;AACH,EAAEA,IAAM,OAAO,GAAG,OAAO,EAAE,KAAK,UAAU,IAAI,EAAE,CAAC,GAAG,IAAI,IAAI;AAC5D,MAAM,EAAE,CAAC,OAAO;AAChB,MAAM,EAAE,CAAC,MAAM;AACf,QAAQ,EAAE,CAAC,QAAQ,IAAI,EAAE,CAAC,WAAW,CAAC,OAAO;AAC7C,QAAQ,EAAE,IAAI,GAAE;AAChB,EAAEC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,cAAa;AAClD,EAAED,IAAM,IAAI,GAAG,OAAO,CAAC,OAAM;AAC7B,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE;AACrB,IAAIA,IAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAC;AAC/C,IAAI,IAAI,GAAG,KAAK,IAAI,KAAK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AAG;AACH;AACA,EAAEA,IAAM,UAAU,GAAG,OAAO,OAAO,KAAK,YAAW;AACnD,EAAEA,IAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAY;AAC3E,EAAE,OAAO,UAAU,IAAI,OAAO;AAC9B,CAAC;AACD;AACA,SAAS,cAAc,EAAE,EAAE,EAAE;AAC7B,EAAEA,IAAM,OAAO,GAAG,EAAE,CAAC,QAAQ,IAAI,GAAE;AACnC,EAAEA,IAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,cAAa;AACpD,EAAEA,IAAM,IAAI,GAAG,OAAO,CAAC,OAAM;AAC7B,EAAEA,IAAM,UAAU,GAAG,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC,OAAO,CAAC,QAAQ,GAAG,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,GAAG,UAAS;AAC7F,EAAE,OAAO;AACT,IAAI,MAAM,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE;AAC3B,IAAI,IAAI,EAAE,IAAI;AACd,IAAI,KAAK,EAAE,EAAE,CAAC,MAAM;AACpB,IAAI,UAAU,EAAE,UAAU;AAC1B,IAAI,IAAI,EAAE,IAAI;AACd,GAAG;AACH;;;;"}
1
+ {"version":3,"file":"honeybadger-vue.esm.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":["const","let"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACAA,IAAM,UAAU,GAAG,kBAAiB;AACpCA,IAAM,QAAQ,GAAG,UAAA,GAAA,WAAO,GAAG;AAC3B,GAAG,OAAO,CAAC,UAAU,EAAE,UAAA,CAAA,WAAK,CAAC,CAAC,WAAW,EAAA,CAAA,EAAE,CAAC;AAC5C,GAAG,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA,GAAA;AACvB;AACAA,IAAM,mBAAmB,GAAA,UAAI,EAAE,EAAE,WAAW,EAAK;AACjD,EAAE,IAAI,EAAE,CAAC,KAAK,KAAK,EAAE,EAAE;AACvB,IAAI,OAAO,QAAQ;AACnB,GAAG;AACH,EAAEA,IAAM,OAAO,GAAG,OAAO,EAAE,KAAK,UAAU,IAAI,EAAE,CAAC,GAAG,IAAI,IAAI;AA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I,EAAE,IAAI,EAAE,GAAE;AACxE,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAC;AACvC,IAAI,IAAI,OAAO,mBAAmB,KAAK,UAAU,EAAE;AACnD,MAAM,mBAAmB,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAC;AACpD,KAAK;AACL;AACA,IAAI,IAAI,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE;AACtC,MAAM,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAC;AACpC,KAAK;AACL,IAAG;AACH,CAAC;AACD;AACA,YAAe;AACf,EAAA,OAAA,EAAE,OAAO;AACT;;;;"}
@@ -87,35 +87,14 @@ var HoneybadgerVue = (function (exports, Honeybadger) {
87
87
  }
88
88
  }
89
89
 
90
- var HoneybadgerVue = {
91
- install: function install (app, options) {
92
- if (app.config.debug) {
93
- console.log(("Honeybadger configured with " + (options.apiKey)));
94
- }
95
- var honeybadger = Honeybadger__default["default"].configure(options);
96
- app.$honeybadger = honeybadger;
97
- app.config.globalProperties.$honeybadger = honeybadger;
98
- var chainedErrorHandler = app.config.errorHandler;
99
- app.config.errorHandler = function (error, vm, info) {
100
- honeybadger.notify(error, { context: { vm: extractContext(vm), info: info } });
101
- if (typeof chainedErrorHandler === 'function') {
102
- chainedErrorHandler.call(app, error, vm, info);
103
- }
104
-
105
- if (shouldLogError(app)) {
106
- logError(app, error, vm, info);
107
- }
108
- };
109
- }
110
- };
111
-
112
- function shouldLogError (app) {
90
+ function shouldLogError (app, options) {
113
91
  if (app.config.warnHandler) {
114
92
  return true
115
93
  }
116
94
 
117
95
  var hasConsole = typeof console !== 'undefined';
118
- var isDebug = app.config.debug || process.env.NODE_ENV !== 'production';
96
+ var hasProcess = typeof process !== 'undefined';
97
+ var isDebug = options.debug || (hasProcess && process.env.NODE_ENV !== 'production');
119
98
  return hasConsole && isDebug
120
99
  }
121
100
 
@@ -124,16 +103,55 @@ var HoneybadgerVue = (function (exports, Honeybadger) {
124
103
  var name = options.name || options._componentTag;
125
104
  var file = options.__file;
126
105
  var parentName = vm.$parent && vm.$parent.$options ? vm.$parent.$options.name : undefined;
106
+
107
+ // Vue2 - $options.propsData
108
+ // Vue3 - $props
109
+ var props = options.propsData || vm.$props;
110
+
127
111
  return {
128
112
  isRoot: vm.$root === vm,
129
113
  name: name,
130
- props: vm.$props,
114
+ props: props,
131
115
  parentName: parentName,
132
116
  file: file
133
117
  }
134
118
  }
135
119
 
136
- exports["default"] = HoneybadgerVue;
120
+ function install(vue, options) {
121
+ if (options.debug) {
122
+ console.log(("Honeybadger configured with " + (options.apiKey)));
123
+ }
124
+ var honeybadger = Honeybadger__default["default"].configure(options);
125
+ vue.$honeybadger = honeybadger;
126
+
127
+ // vue 2 support -> make available for all components
128
+ if (vue.prototype) {
129
+ vue.prototype.$honeybadger = honeybadger;
130
+ }
131
+
132
+ if (vue.config && vue.config.globalProperties) {
133
+ // vue 3 support -> make available for all components
134
+ vue.config.globalProperties.$honeybadger = honeybadger;
135
+ }
136
+ var chainedErrorHandler = vue.config.errorHandler;
137
+ vue.config.errorHandler = function (error, vm, info) {
138
+ var metadata = { context: { vm: extractContext(vm), info: info } };
139
+ honeybadger.notify(error, metadata);
140
+ if (typeof chainedErrorHandler === 'function') {
141
+ chainedErrorHandler.call(vue, error, vm, info);
142
+ }
143
+
144
+ if (shouldLogError(vue, options)) {
145
+ logError(vue, error, vm, info);
146
+ }
147
+ };
148
+ }
149
+
150
+ var index = {
151
+ install: install
152
+ };
153
+
154
+ exports["default"] = index;
137
155
 
138
156
  Object.defineProperty(exports, '__esModule', { value: true });
139
157
 
@@ -1 +1 @@
1
- {"version":3,"file":"honeybadger-vue.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\nconst HoneybadgerVue = {\n install (app, options) {\n if (app.config.debug) {\n console.log(`Honeybadger configured with ${options.apiKey}`)\n }\n const honeybadger = Honeybadger.configure(options)\n app.$honeybadger = honeybadger\n app.config.globalProperties.$honeybadger = honeybadger\n const chainedErrorHandler = app.config.errorHandler\n app.config.errorHandler = (error, vm, info) => {\n honeybadger.notify(error, { context: { vm: extractContext(vm), info: info } })\n if (typeof chainedErrorHandler === 'function') {\n chainedErrorHandler.call(app, error, vm, info)\n }\n\n if (shouldLogError(app)) {\n logError(app, error, vm, info)\n }\n }\n }\n}\n\nfunction shouldLogError (app) {\n if (app.config.warnHandler) {\n return true\n }\n\n const hasConsole = typeof console !== 'undefined'\n const isDebug = app.config.debug || 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 return {\n isRoot: vm.$root === vm,\n name: name,\n props: vm.$props,\n parentName: parentName,\n file: file\n }\n}\n\nexport default HoneybadgerVue\n"],"names":["const","let","Honeybadger"],"mappings":";;;;;;;EAAA;EACA;EACA;EACA;AACA;EACAA,IAAM,UAAU,GAAG,kBAAiB;EACpCA,IAAM,QAAQ,GAAG,UAAA,GAAA,WAAO,GAAG;EAC3B,GAAG,OAAO,CAAC,UAAU,EAAE,UAAA,CAAA,WAAK,CAAC,CAAC,WAAW,EAAA,CAAA,EAAE,CAAC;EAC5C,GAAG,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA,GAAA;AACvB;EACAA,IAAM,mBAAmB,GAAA,UAAI,EAAE,EAAE,WAAW,EAAK;EACjD,EAAE,IAAI,EAAE,CAAC,KAAK,KAAK,EAAE,EAAE;EACvB,IAAI,OAAO,QAAQ;EACnB,GAAG;EACH,EAAEA,IAAM,OAAO,GAAG,OAAO,EAAE,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,MAAM;EACpB,IAAI,UAAU,EAAE,UAAU;EAC1B,IAAI,IAAI,EAAE,IAAI;EACd,GAAG;EACH;;;;;;;;;;;;"}
1
+ {"version":3,"file":"honeybadger-vue.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":["const","let","Honeybadger"],"mappings":";;;;;;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GAAG,CAAC,SAAS,EAAE;EACrB,IAAI,GAAG,CAAC,SAAS,CAAC,YAAY,GAAG,YAAW;EAC5C,GAAG;AACH;EACA,EAAE,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,gBAAgB,EAAE;EACjD;EACA,IAAI,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,YAAY,GAAG,YAAW;EAC1D,GAAG;EACH,EAAEF,IAAM,mBAAmB,GAAG,GAAG,CAAC,MAAM,CAAC,aAAY;EACrD,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY,GAAA,UAAI,KAAK,EAAE,EAAE,EAAE,IAAI,EAAK;EACjD,IAAIA,IAAM,QAAQ,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE,cAAc,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,GAAE;EACxE,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAC;EACvC,IAAI,IAAI,OAAO,mBAAmB,KAAK,UAAU,EAAE;EACnD,MAAM,mBAAmB,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAC;EACpD,KAAK;AACL;EACA,IAAI,IAAI,cAAc,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE;EACtC,MAAM,QAAQ,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAC;EACpC,KAAK;EACL,IAAG;EACH,CAAC;AACD;AACA,cAAe;EACf,EAAA,OAAA,EAAE,OAAO;EACT;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- var HoneybadgerVue=function(n,r){"use strict";function o(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var e=o(r),t=/(?:^|[-_])(\w)/g,i=function(n,r){if(n.$root===n)return"<Root>";var o="function"==typeof n&&null!=n.cid?n.options:n._isVue?n.$options||n.constructor.options:n||{},e=o.name||o._componentTag,i=o.__file;if(!e&&i){var a=i.match(/([^/\\]+)\.vue$/);e=a&&a[1]}return(e?"<"+(e.replace(t,(function(n){return n.toUpperCase()})).replace(/[-_]/g,"")+">"):"<Anonymous>")+(i&&!1!==r?" at "+i:"")};function a(n,r,o,e){var t="Error in "+e+': "'+(r&&r.toString())+'"',a=o?function(n){if(n._isVue&&n.$parent){for(var r=[],o=0;n;){if(r.length>0){var e=r[r.length-1];if(e.constructor===n.constructor){o++,n=n.$parent;continue}o>0&&(r[r.length-1]=[e,o],o=0)}r.push(n),n=n.$parent}return"\n\nfound in\n\n"+r.map((function(n,r){return""+(0===r?"---\x3e ":function(n,r){for(var o="";r;)r%2==1&&(o+=n),r>1&&(n+=n),r>>=1;return o}(" ",5+2*r))+(Array.isArray(n)?i(n[0])+"... ("+n[1]+" recursive calls)":i(n))})).join("\n")}return"\n\n(found in "+i(n)+")"}(o):"";n.config.warnHandler?n.config.warnHandler.call(null,t,o,a):console.error("[Vue warn]: "+t+a)}var u={install:function(n,r){n.config.debug&&console.log("Honeybadger configured with "+r.apiKey);var o=e.default.configure(r);n.$honeybadger=o,n.config.globalProperties.$honeybadger=o;var t=n.config.errorHandler;n.config.errorHandler=function(r,e,i){o.notify(r,{context:{vm:c(e),info:i}}),"function"==typeof t&&t.call(n,r,e,i),function(n){if(n.config.warnHandler)return!0;var r="undefined"!=typeof console,o=n.config.debug||"production"!==process.env.NODE_ENV;return r&&o}(n)&&a(n,r,e,i)}}};function c(n){var r=n.$options||{},o=r.name||r._componentTag,e=r.__file,t=n.$parent&&n.$parent.$options?n.$parent.$options.name:void 0;return{isRoot:n.$root===n,name:o,props:n.$props,parentName:t,file:e}}return n.default=u,Object.defineProperty(n,"__esModule",{value:!0}),n}({},Honeybadger);
1
+ var HoneybadgerVue=function(n,r){"use strict";function o(n){return n&&"object"==typeof n&&"default"in n?n:{default:n}}var e=o(r),t=/(?:^|[-_])(\w)/g,a=function(n,r){if(n.$root===n)return"<Root>";var o="function"==typeof n&&null!=n.cid?n.options:n._isVue?n.$options||n.constructor.options:n||{},e=o.name||o._componentTag,a=o.__file;if(!e&&a){var i=a.match(/([^/\\]+)\.vue$/);e=i&&i[1]}return(e?"<"+(e.replace(t,(function(n){return n.toUpperCase()})).replace(/[-_]/g,"")+">"):"<Anonymous>")+(a&&!1!==r?" at "+a:"")};function i(n,r,o,e){var t="Error in "+e+': "'+(r&&r.toString())+'"',i=o?function(n){if(n._isVue&&n.$parent){for(var r=[],o=0;n;){if(r.length>0){var e=r[r.length-1];if(e.constructor===n.constructor){o++,n=n.$parent;continue}o>0&&(r[r.length-1]=[e,o],o=0)}r.push(n),n=n.$parent}return"\n\nfound in\n\n"+r.map((function(n,r){return""+(0===r?"---\x3e ":function(n,r){for(var o="";r;)r%2==1&&(o+=n),r>1&&(n+=n),r>>=1;return o}(" ",5+2*r))+(Array.isArray(n)?a(n[0])+"... ("+n[1]+" recursive calls)":a(n))})).join("\n")}return"\n\n(found in "+a(n)+")"}(o):"";n.config.warnHandler?n.config.warnHandler.call(null,t,o,i):console.error("[Vue warn]: "+t+i)}function u(n){var r=n.$options||{},o=r.name||r._componentTag,e=r.__file,t=n.$parent&&n.$parent.$options?n.$parent.$options.name:void 0,a=r.propsData||n.$props;return{isRoot:n.$root===n,name:o,props:a,parentName:t,file:e}}var c={install:function(n,r){r.debug&&console.log("Honeybadger configured with "+r.apiKey);var o=e.default.configure(r);n.$honeybadger=o,n.prototype&&(n.prototype.$honeybadger=o),n.config&&n.config.globalProperties&&(n.config.globalProperties.$honeybadger=o);var t=n.config.errorHandler;n.config.errorHandler=function(e,a,c){var f={context:{vm:u(a),info:c}};o.notify(e,f),"function"==typeof t&&t.call(n,e,a,c),function(n,r){if(n.config.warnHandler)return!0;var o="undefined"!=typeof console,e="undefined"!=typeof process,t=r.debug||e&&"production"!==process.env.NODE_ENV;return o&&t}(n,r)&&i(n,e,a,c)}}};return n.default=c,Object.defineProperty(n,"__esModule",{value:!0}),n}({},Honeybadger);
2
2
  //# sourceMappingURL=honeybadger-vue.min.js.map
@@ -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\nconst HoneybadgerVue = {\n install (app, options) {\n if (app.config.debug) {\n console.log(`Honeybadger configured with ${options.apiKey}`)\n }\n const honeybadger = Honeybadger.configure(options)\n app.$honeybadger = honeybadger\n app.config.globalProperties.$honeybadger = honeybadger\n const chainedErrorHandler = app.config.errorHandler\n app.config.errorHandler = (error, vm, info) => {\n honeybadger.notify(error, { context: { vm: extractContext(vm), info: info } })\n if (typeof chainedErrorHandler === 'function') {\n chainedErrorHandler.call(app, error, vm, info)\n }\n\n if (shouldLogError(app)) {\n logError(app, error, vm, info)\n }\n }\n }\n}\n\nfunction shouldLogError (app) {\n if (app.config.warnHandler) {\n return true\n }\n\n const hasConsole = typeof console !== 'undefined'\n const isDebug = app.config.debug || 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 return {\n isRoot: vm.$root === vm,\n name: name,\n props: vm.$props,\n parentName: parentName,\n file: file\n }\n}\n\nexport default HoneybadgerVue\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","HoneybadgerVue","install","debug","log","honeybadger","Honeybadger","configure","$honeybadger","globalProperties","chainedErrorHandler","errorHandler","notify","context","extractContext","hasConsole","isDebug","process","env","NODE_ENV","should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QjB,SAAWP,EAAGwB,QAAQjB,SAASE,UAAOyD,EAClF,MAAO,CACLC,OAAQnE,EAAGE,QAAUF,EACrBS,KAAMA,EACN2D,MAAOpE,EAAGqE,OACVJ,WAAYA,EACZtD,KAAMA"}
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,GAA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1CkD,EAAIM,aAAeH,EAGfH,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"}
@@ -90,35 +90,14 @@
90
90
  }
91
91
  }
92
92
 
93
- var HoneybadgerVue = {
94
- install: function install (app, options) {
95
- if (app.config.debug) {
96
- console.log(("Honeybadger configured with " + (options.apiKey)));
97
- }
98
- var honeybadger = Honeybadger__default["default"].configure(options);
99
- app.$honeybadger = honeybadger;
100
- app.config.globalProperties.$honeybadger = honeybadger;
101
- var chainedErrorHandler = app.config.errorHandler;
102
- app.config.errorHandler = function (error, vm, info) {
103
- honeybadger.notify(error, { context: { vm: extractContext(vm), info: info } });
104
- if (typeof chainedErrorHandler === 'function') {
105
- chainedErrorHandler.call(app, error, vm, info);
106
- }
107
-
108
- if (shouldLogError(app)) {
109
- logError(app, error, vm, info);
110
- }
111
- };
112
- }
113
- };
114
-
115
- function shouldLogError (app) {
93
+ function shouldLogError (app, options) {
116
94
  if (app.config.warnHandler) {
117
95
  return true
118
96
  }
119
97
 
120
98
  var hasConsole = typeof console !== 'undefined';
121
- var isDebug = app.config.debug || process.env.NODE_ENV !== 'production';
99
+ var hasProcess = typeof process !== 'undefined';
100
+ var isDebug = options.debug || (hasProcess && process.env.NODE_ENV !== 'production');
122
101
  return hasConsole && isDebug
123
102
  }
124
103
 
@@ -127,16 +106,55 @@
127
106
  var name = options.name || options._componentTag;
128
107
  var file = options.__file;
129
108
  var parentName = vm.$parent && vm.$parent.$options ? vm.$parent.$options.name : undefined;
109
+
110
+ // Vue2 - $options.propsData
111
+ // Vue3 - $props
112
+ var props = options.propsData || vm.$props;
113
+
130
114
  return {
131
115
  isRoot: vm.$root === vm,
132
116
  name: name,
133
- props: vm.$props,
117
+ props: props,
134
118
  parentName: parentName,
135
119
  file: file
136
120
  }
137
121
  }
138
122
 
139
- exports["default"] = HoneybadgerVue;
123
+ function install(vue, options) {
124
+ if (options.debug) {
125
+ console.log(("Honeybadger configured with " + (options.apiKey)));
126
+ }
127
+ var honeybadger = Honeybadger__default["default"].configure(options);
128
+ vue.$honeybadger = honeybadger;
129
+
130
+ // vue 2 support -> make available for all components
131
+ if (vue.prototype) {
132
+ vue.prototype.$honeybadger = honeybadger;
133
+ }
134
+
135
+ if (vue.config && vue.config.globalProperties) {
136
+ // vue 3 support -> make available for all components
137
+ vue.config.globalProperties.$honeybadger = honeybadger;
138
+ }
139
+ var chainedErrorHandler = vue.config.errorHandler;
140
+ vue.config.errorHandler = function (error, vm, info) {
141
+ var metadata = { context: { vm: extractContext(vm), info: info } };
142
+ honeybadger.notify(error, metadata);
143
+ if (typeof chainedErrorHandler === 'function') {
144
+ chainedErrorHandler.call(vue, error, vm, info);
145
+ }
146
+
147
+ if (shouldLogError(vue, options)) {
148
+ logError(vue, error, vm, info);
149
+ }
150
+ };
151
+ }
152
+
153
+ var index = {
154
+ install: install
155
+ };
156
+
157
+ exports["default"] = index;
140
158
 
141
159
  Object.defineProperty(exports, '__esModule', { value: true });
142
160
 
@@ -1 +1 @@
1
- {"version":3,"file":"honeybadger-vue.umd.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\nconst HoneybadgerVue = {\n install (app, options) {\n if (app.config.debug) {\n console.log(`Honeybadger configured with ${options.apiKey}`)\n }\n const honeybadger = Honeybadger.configure(options)\n app.$honeybadger = honeybadger\n app.config.globalProperties.$honeybadger = honeybadger\n const chainedErrorHandler = app.config.errorHandler\n app.config.errorHandler = (error, vm, info) => {\n honeybadger.notify(error, { context: { vm: extractContext(vm), info: info } })\n if (typeof chainedErrorHandler === 'function') {\n chainedErrorHandler.call(app, error, vm, info)\n }\n\n if (shouldLogError(app)) {\n logError(app, error, vm, info)\n }\n }\n }\n}\n\nfunction shouldLogError (app) {\n if (app.config.warnHandler) {\n return true\n }\n\n const hasConsole = typeof console !== 'undefined'\n const isDebug = app.config.debug || 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 return {\n isRoot: vm.$root === vm,\n name: name,\n props: vm.$props,\n parentName: parentName,\n file: file\n }\n}\n\nexport default HoneybadgerVue\n"],"names":["const","let","Honeybadger"],"mappings":";;;;;;;;;;EAAA;EACA;EACA;EACA;AACA;EACAA,IAAM,UAAU,GAAG,kBAAiB;EACpCA,IAAM,QAAQ,GAAG,UAAA,GAAA,WAAO,GAAG;EAC3B,GAAG,OAAO,CAAC,UAAU,EAAE,UAAA,CAAA,WAAK,CAAC,CAAC,WAAW,EAAA,CAAA,EAAE,CAAC;EAC5C,GAAG,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA,GAAA;AACvB;EACAA,IAAM,mBAAmB,GAAA,U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,CAAC,IAAI,GAAG,UAAS;EAC7F,EAAE,OAAO;EACT,IAAI,MAAM,EAAE,EAAE,CAAC,KAAK,KAAK,EAAE;EAC3B,IAAI,IAAI,EAAE,IAAI;EACd,IAAI,KAAK,EAAE,EAAE,CAAC,MAAM;EACpB,IAAI,UAAU,EAAE,UAAU;EAC1B,IAAI,IAAI,EAAE,IAAI;EACd,GAAG;EACH;;;;;;;;;;"}
1
+ {"version":3,"file":"honeybadger-vue.umd.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":["const","let","Honeybadger"],"mappings":";;;;;;;;;;EAAA;EACA;EACA;EACA;AACA;EACAA,IAAM,UAAU,GAAG,kBAAiB;EACpCA,IAAM,QAAQ,GAAG,UAAA,GAAA,WAAO,GAAG;EAC3B,GAAG,OAAO,CAAC,UAAU,EAAE,UAAA,CAAA,WAAK,CAAC,CAAC,WAAW,EAAA,CAAA,EAAE,CAAC;EAC5C,GAAG,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAA,GAAA;AACvB;EACAA,IAAM,mBAAmB,GAAA,UAAI,EAAE,EAAE,WAAW,EAAK;EACjD,EAAE,IAAI,EAAE,CAAC,KAAK,KAAK,EAAE,EAAE;EACvB,IAAI,OAAO,QAAQ;EACnB,GAAG;EACH,EAAEA,IAAM,OAAO,GAAG,OAAO,EAAE,KAAK,UAAU,IAAI,EAAE,CAAC,GAAG,IAAI,IAAI;EAC5D,MAAM,EAAE,CAAC,OAAO;EAChB,MAAM,EAAE,CAAC,MAAM;EACf,QAAQ,EAAE,CAAC,QAAQ,IAAI,EAAE,CAAC,WAAW,CAAC,OAAO;EAC7C,QAAQ,EAAE,IAAI,GAAE;EAChB,EAAEC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,cAAa;EAClD,EAAED,IAAM,IAAI,GAAG,OAAO,CAAC,OAAM;EAC7B,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,EAAE;EACrB,IAAIA,IAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,iBAAiB,EAAC;EAC/C,IAAI,IAAI,GAAG,KAAK,IAAI,KAAK,CAAC,CAAC,EAAC;EAC5B,GAAG;AACH;EACA,EAAE;EACF,IAAI,CAAC,IAAI,IAAO,GAAA,IAAA,QAAQ,CAAC,IAAI,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from 'vue';
5
- import * as Honeybadger from '@honeybadger-io/js'
5
+ import Honeybadger from '@honeybadger-io/js/dist/browser/honeybadger'
6
+ import { BrowserConfig } from '@honeybadger-io/js/dist/browser/types/core/types'
6
7
 
7
8
  declare module '@vue/runtime-core' {
8
9
  interface App {
@@ -11,7 +12,7 @@ declare module '@vue/runtime-core' {
11
12
  }
12
13
 
13
14
  declare var HoneybadgerVue: {
14
- install(app: App, options?: any): void
15
+ init(app: App, options?: Partial<BrowserConfig>): void
15
16
  }
16
17
 
17
18
  export default HoneybadgerVue
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@honeybadger-io/vue",
3
- "version": "3.1.0",
3
+ "version": "3.2.0",
4
4
  "license": "MIT",
5
5
  "description": "Honeybadger Vue.js client",
6
6
  "author": "Jason Truesdell <jason@yuzuten.com> (https://github.com/JasonTrue)",
@@ -26,19 +26,17 @@
26
26
  ],
27
27
  "homepage": "https://github.com/honeybadger-io/honeybadger-vue#readme",
28
28
  "scripts": {
29
- "dev": "webpack serve --progress --config build/webpack.dev.conf.js",
30
- "start": "npm run dev",
31
29
  "unit": "jest --config test/unit/jest.conf.js --coverage",
32
30
  "e2e": "node test/e2e/runner.js",
33
31
  "tsd": "npx tsd",
34
32
  "test": "npm run unit",
35
33
  "test:all": "npm run tsd && npm run unit && npm run e2e",
36
- "lint": "eslint --ext .js,.vue src test/unit test/e2e/specs",
37
- "build": "npm run build:umd & npm run build:es & npm run build:unpkg",
38
- "build:umd": "rollup --config build/rollup.config.js --format umd --file dist/honeybadger-vue.umd.js",
39
- "build:es": "rollup --config build/rollup.config.js --format es --file dist/honeybadger-vue.esm.js",
40
- "build:unpkg": "rollup --config build/rollup.config.js --format iife --file dist/honeybadger-vue.js",
41
- "build:unpkg-minify": "rollup MINIFY=true --config build/rollup.config.js --format iife --file dist/honeybadger-vue.min.js",
34
+ "lint": "eslint --ext .js,.vue src examples test/unit",
35
+ "build": "npm run build:umd & npm run build:es & npm run build:unpkg & npm run build:unpkg-minify",
36
+ "build:umd": "rollup --config rollup.config.js --format umd --file dist/honeybadger-vue.umd.js",
37
+ "build:es": "rollup --config rollup.config.js --format es --file dist/honeybadger-vue.esm.js",
38
+ "build:unpkg": "rollup --config rollup.config.js --format iife --file dist/honeybadger-vue.js",
39
+ "build:unpkg-minify": "MINIFY=true rollup --config rollup.config.js --format iife --file dist/honeybadger-vue.min.js",
42
40
  "preversion": "npm test",
43
41
  "version": "scripts/update-versions.sh",
44
42
  "postversion": "git push && git push --tags",
@@ -46,89 +44,34 @@
46
44
  "prepare": "husky install",
47
45
  "release": "shipjs prepare"
48
46
  },
49
- "dependencies": {
50
- "@honeybadger-io/js": "^4.0.1"
51
- },
52
47
  "devDependencies": {
53
- "@babel/core": "^7.17.10",
54
- "@babel/helper-module-imports": "^7.14.5",
55
- "@babel/plugin-syntax-jsx": "^7.16.7",
56
- "@babel/plugin-transform-modules-commonjs": "^7.15.0",
57
- "@babel/plugin-transform-runtime": "^7.17.0",
58
- "@babel/preset-env": "^7.16.11",
59
- "@babel/register": "^7.17.7",
60
- "@babel/runtime": "^7.17.9",
61
- "@commitlint/cli": "^17.0.0",
62
- "@commitlint/config-conventional": "^17.0.0",
63
- "@vue/compiler-sfc": "^3.2.35",
64
- "@vue/runtime-core": "^3.2.6",
65
- "@vue/test-utils": "^2.0.0-rc.21",
66
- "ajv": "^8.6.1",
67
- "autoprefixer": "^10.4.7",
68
- "babel-core": "^7.0.0-bridge.0",
69
- "babel-eslint": "^10.1.0",
70
- "babel-helper-vue-jsx-merge-props": "^2.0.3",
71
- "babel-jest": "^26.0.0",
72
- "babel-loader": "^8.1.0",
73
- "babel-plugin-dynamic-import-node": "^2.3.3",
74
- "babel-plugin-transform-vue-jsx": "^4.0.1",
48
+ "@babel/plugin-transform-runtime": "^7.18.5",
49
+ "@babel/preset-env": "^7.18.2",
50
+ "@commitlint/cli": "^17.0.2",
51
+ "@commitlint/config-conventional": "^17.0.2",
52
+ "@honeybadger-io/js": "^4.0.3",
53
+ "@vue/compiler-sfc": "^3.2.37",
54
+ "@vue/test-utils": "^2.0.0",
55
+ "babel-plugin-syntax-jsx": "^6.18.0",
56
+ "babel-plugin-transform-vue-jsx": "^3.7.0",
75
57
  "browser-resolve": "^2.0.0",
76
- "chalk": "^4.1.2",
77
- "chromedriver": "^92.0.0",
78
- "copy-webpack-plugin": "^10.2.4",
79
- "cross-spawn": "^7.0.2",
80
- "css-loader": "^5.2.7",
81
- "css-minimizer-webpack-plugin": "^3.4.1",
82
- "dotenv": "^16.0.0",
83
- "eslint": "^7.32.0",
84
- "eslint-config-standard": "^16.0.3",
85
- "eslint-friendly-formatter": "^4.0.1",
86
- "eslint-loader": "^4.0.1",
87
- "eslint-plugin-import": "^2.26.0",
88
- "eslint-plugin-node": "^11.1.0",
89
- "eslint-plugin-promise": "^5.1.0",
90
- "eslint-plugin-standard": "^5.0.0",
91
- "eslint-plugin-vue": "^7.16.0",
92
- "file-loader": "^6.0.0",
93
- "html-webpack-plugin": "^5.5.0",
94
- "husky": "^8.0.0",
95
- "interactive": "^0.1.9",
96
- "jest": "^26.0.0",
97
- "jest-serializer-vue": "^2.0.2",
98
- "mini-css-extract-plugin": "^2.0.0",
99
- "nightwatch": "^2.1.4",
100
- "nightwatch-xhr": "^0.4.7",
101
- "node-notifier": "^10.0.1",
102
- "ora": "^5.4.1",
103
- "portfinder": "^1.0.13",
104
- "postcss": "^8.3.6",
105
- "postcss-import": "^14.0.2",
106
- "postcss-loader": "^6.2.1",
107
- "postcss-url": "^10.1.3",
108
- "rimraf": "^3.0.2",
109
- "rollup": "^2.70.2",
110
- "rollup-plugin-buble": "^0.19.4",
58
+ "eslint": "^8.18.0",
59
+ "eslint-plugin-vue": "^9.1.1",
60
+ "husky": "^8.0.1",
61
+ "jest": "^26.6.3",
62
+ "rollup": "^2.75.7",
63
+ "rollup-plugin-buble": "^0.19.8",
111
64
  "rollup-plugin-conditional": "^3.1.2",
112
- "rollup-plugin-terser": "^7.0.0",
65
+ "rollup-plugin-terser": "^7.0.2",
113
66
  "rollup-plugin-vue": "^6.0.0",
114
- "selenium-server": "^3.0.1",
115
- "semver": "^7.3.7",
116
- "shelljs": "^0.8.5",
117
- "shipjs": "0.24.4",
118
- "sinon": "^11.1.1",
119
- "terser-webpack-plugin": "^5.3.1",
120
- "tsd": "^0.17.0",
121
- "url-loader": "^4.1.0",
122
- "vue": "^3.2.33",
123
- "vue-jest": "^5.0.0-alpha.10",
124
- "vue-loader": "^16.3.0",
125
- "vue-style-loader": "^4.1.3",
126
- "webpack": "^5.72.0",
127
- "webpack-bundle-analyzer": "^4.5.0",
128
- "webpack-cli": "^4.9.2",
129
- "webpack-dev-server": "^4.0.0",
130
- "webpack-merge": "^5.8.0",
131
- "winston": "^3.7.2"
67
+ "shipjs": "^0.24.4",
68
+ "sinon": "^14.0.0",
69
+ "vue": "^3.2.37",
70
+ "vue-jest": "^5.0.0-alpha.10"
71
+ },
72
+ "peerDependencies": {
73
+ "@honeybadger-io/js": "3.x || 4.x",
74
+ "vue": "2.x || 3.x"
132
75
  },
133
76
  "engines": {
134
77
  "node": ">= 6.0.0",
@@ -139,17 +82,6 @@
139
82
  "last 2 versions",
140
83
  "not ie <= 8"
141
84
  ],
142
- "directories": {
143
- "test": "test"
144
- },
145
- "resolutions": {
146
- "debug": "^2.2.1",
147
- "growl": "^1.10.5",
148
- "har-validator": "^5.1.3",
149
- "http-proxy-agent": "^2.1.0",
150
- "https-proxy-agent": "^2.2.1",
151
- "socks-proxy-agent": "^4.0.1"
152
- },
153
85
  "types": "./honeybadger-vue.d.ts",
154
86
  "tsd": {
155
87
  "compilerOptions": {
package/src/index.js CHANGED
@@ -1,35 +1,14 @@
1
1
  import Honeybadger from '@honeybadger-io/js'
2
2
  import { logError } from './error-logging'
3
3
 
4
- const HoneybadgerVue = {
5
- install (app, options) {
6
- if (app.config.debug) {
7
- console.log(`Honeybadger configured with ${options.apiKey}`)
8
- }
9
- const honeybadger = Honeybadger.configure(options)
10
- app.$honeybadger = honeybadger
11
- app.config.globalProperties.$honeybadger = honeybadger
12
- const chainedErrorHandler = app.config.errorHandler
13
- app.config.errorHandler = (error, vm, info) => {
14
- honeybadger.notify(error, { context: { vm: extractContext(vm), info: info } })
15
- if (typeof chainedErrorHandler === 'function') {
16
- chainedErrorHandler.call(app, error, vm, info)
17
- }
18
-
19
- if (shouldLogError(app)) {
20
- logError(app, error, vm, info)
21
- }
22
- }
23
- }
24
- }
25
-
26
- function shouldLogError (app) {
4
+ function shouldLogError (app, options) {
27
5
  if (app.config.warnHandler) {
28
6
  return true
29
7
  }
30
8
 
31
9
  const hasConsole = typeof console !== 'undefined'
32
- const isDebug = app.config.debug || process.env.NODE_ENV !== 'production'
10
+ const hasProcess = typeof process !== 'undefined'
11
+ const isDebug = options.debug || (hasProcess && process.env.NODE_ENV !== 'production')
33
12
  return hasConsole && isDebug
34
13
  }
35
14
 
@@ -38,13 +17,50 @@ function extractContext (vm) {
38
17
  const name = options.name || options._componentTag
39
18
  const file = options.__file
40
19
  const parentName = vm.$parent && vm.$parent.$options ? vm.$parent.$options.name : undefined
20
+
21
+ // Vue2 - $options.propsData
22
+ // Vue3 - $props
23
+ const props = options.propsData || vm.$props
24
+
41
25
  return {
42
26
  isRoot: vm.$root === vm,
43
27
  name: name,
44
- props: vm.$props,
28
+ props,
45
29
  parentName: parentName,
46
30
  file: file
47
31
  }
48
32
  }
49
33
 
50
- export default HoneybadgerVue
34
+ function install(vue, options) {
35
+ if (options.debug) {
36
+ console.log(`Honeybadger configured with ${options.apiKey}`)
37
+ }
38
+ const honeybadger = Honeybadger.configure(options)
39
+ vue.$honeybadger = honeybadger
40
+
41
+ // vue 2 support -> make available for all components
42
+ if (vue.prototype) {
43
+ vue.prototype.$honeybadger = honeybadger
44
+ }
45
+
46
+ if (vue.config && vue.config.globalProperties) {
47
+ // vue 3 support -> make available for all components
48
+ vue.config.globalProperties.$honeybadger = honeybadger
49
+ }
50
+ const chainedErrorHandler = vue.config.errorHandler
51
+ vue.config.errorHandler = (error, vm, info) => {
52
+ const metadata = { context: { vm: extractContext(vm), info: info } }
53
+ honeybadger.notify(error, metadata)
54
+ if (typeof chainedErrorHandler === 'function') {
55
+ chainedErrorHandler.call(vue, error, vm, info)
56
+ }
57
+
58
+ if (shouldLogError(vue, options)) {
59
+ logError(vue, error, vm, info)
60
+ }
61
+ }
62
+ }
63
+
64
+ export default {
65
+ install
66
+ }