@ohbug/vue 2.0.6 → 2.0.7

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
@@ -13,6 +13,8 @@ pnpm instal @ohbug/browser @ohbug/vue
13
13
 
14
14
  ## Usage
15
15
 
16
+ Vue3
17
+
16
18
  ```javascript
17
19
  import Vue from 'vue'
18
20
  import Ohbug from '@ohbug/browser'
@@ -24,3 +26,19 @@ Vue.createApp(App)
24
26
  .use(OhbugVue(client))
25
27
  .mount('#app')
26
28
  ```
29
+
30
+ Vue2
31
+
32
+ ```javascript
33
+ import Vue from "vue";
34
+ import App from "./App.vue";
35
+ import Ohbug from "@ohbug/browser";
36
+ import OhbugVue from "@ohbug/vue";
37
+
38
+ const client = Ohbug.setup({ apiKey: "YOUR_API_KEY" });
39
+ OhbugVue(client).install(Vue);
40
+
41
+ new Vue({
42
+ render: (h) => h(App)
43
+ }).$mount("#app");
44
+ ```
package/dist/index.d.ts CHANGED
@@ -1,5 +1,12 @@
1
1
  import { OhbugBaseDetail, OhbugClient } from '@ohbug/types';
2
- import { Plugin } from 'vue';
2
+
3
+ interface Vue {
4
+ config: {
5
+ errorHandler?: any;
6
+ warnHandler?: any;
7
+ silent?: boolean;
8
+ };
9
+ }
3
10
 
4
11
  interface VueErrorDetail extends OhbugBaseDetail {
5
12
  name: string;
@@ -10,6 +17,8 @@ interface VueErrorDetail extends OhbugBaseDetail {
10
17
  props?: Record<string, any>;
11
18
  }
12
19
 
13
- declare function createVueClient(client: OhbugClient): Plugin;
20
+ declare function createVueClient(client: OhbugClient): {
21
+ install: (app: Vue) => void;
22
+ };
14
23
 
15
24
  export { VueErrorDetail, createVueClient as default };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var l=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var h=(o,e)=>{for(var r in e)l(o,r,{get:e[r],enumerable:!0})},C=(o,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of b(e))!d.call(o,t)&&t!==r&&l(o,t,{get:()=>e[t],enumerable:!(n=y(e,t))||n.enumerable});return o};var E=o=>C(l({},"__esModule",{value:!0}),o);var v={};h(v,{default:()=>s});module.exports=E(v);var u=require("@ohbug/core"),D=o=>{if((o==null?void 0:o.$root)===o)return{component:"Root"};let e=o==null?void 0:o.$options,r=e==null?void 0:e.name,n=e==null?void 0:e.__file;return{component:r,file:n}};function f(o,e){let r=e.config.errorHandler,n=(t,p,i)=>{let{component:m,file:a}=D(p),g={name:t.name,message:t.message,stack:t.stack,errorInfo:i,component:m,file:a,props:p?p.$options.propsData:void 0},c=o.createEvent({category:"error",type:u.EventTypes.VUE,detail:g});o.notify(c),typeof console<"u"&&typeof console.error=="function"&&console.error(t),typeof r=="function"&&r(t,p,i)};e.config.errorHandler=n}function s(o){return{install:e=>{f(o,e)}}}0&&(module.exports={});
1
+ "use strict";var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var V=(o,e)=>{for(var r in e)i(o,r,{get:e[r],enumerable:!0})},b=(o,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of d(e))!h.call(o,t)&&t!==r&&i(o,t,{get:()=>e[t],enumerable:!(n=c(e,t))||n.enumerable});return o};var E=o=>b(i({},"__esModule",{value:!0}),o);var C={};V(C,{default:()=>u});module.exports=E(C);var f=require("@ohbug/core"),D=o=>{if((o==null?void 0:o.$root)===o)return{component:"Root"};let e=o==null?void 0:o.$options,r=e==null?void 0:e.name,n=e==null?void 0:e.__file;return{component:r,file:n}};function s(o,e){let r=e.config.errorHandler,n=(t,p,l)=>{let{component:m,file:a}=D(p),g={name:t.name,message:t.message,stack:t.stack,errorInfo:l,component:m,file:a,props:p?p.$options.propsData:void 0},y=o.createEvent({category:"error",type:f.EventTypes.VUE,detail:g});o.notify(y),typeof console<"u"&&typeof console.error=="function"&&console.error(t),typeof r=="function"&&r(t,p,l)};e.config.errorHandler=n}function u(o){return{install:e=>{s(o,e)}}}0&&(module.exports={});
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{EventTypes as a}from"@ohbug/core";var g=e=>{if((e==null?void 0:e.$root)===e)return{component:"Root"};let o=e==null?void 0:e.$options,r=o==null?void 0:o.name,p=o==null?void 0:o.__file;return{component:r,file:p}};function i(e,o){let r=o.config.errorHandler,p=(t,n,l)=>{let{component:u,file:f}=g(n),s={name:t.name,message:t.message,stack:t.stack,errorInfo:l,component:u,file:f,props:n?n.$options.propsData:void 0},m=e.createEvent({category:"error",type:a.VUE,detail:s});e.notify(m),typeof console<"u"&&typeof console.error=="function"&&console.error(t),typeof r=="function"&&r(t,n,l)};o.config.errorHandler=p}function c(e){return{install:o=>{i(e,o)}}}export{c as default};
1
+ import{EventTypes as a}from"@ohbug/core";var g=e=>{if((e==null?void 0:e.$root)===e)return{component:"Root"};let o=e==null?void 0:e.$options,r=o==null?void 0:o.name,p=o==null?void 0:o.__file;return{component:r,file:p}};function l(e,o){let r=o.config.errorHandler,p=(t,n,i)=>{let{component:f,file:s}=g(n),u={name:t.name,message:t.message,stack:t.stack,errorInfo:i,component:f,file:s,props:n?n.$options.propsData:void 0},m=e.createEvent({category:"error",type:a.VUE,detail:u});e.notify(m),typeof console<"u"&&typeof console.error=="function"&&console.error(t),typeof r=="function"&&r(t,n,i)};o.config.errorHandler=p}function y(e){return{install:o=>{l(e,o)}}}export{y as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ohbug/vue",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "description": "Ohbug SDK for Vue",
5
5
  "license": "Apache-2.0",
6
6
  "author": "chenyueban <jasonchan0527@gmail.com>",
@@ -27,21 +27,17 @@
27
27
  ],
28
28
  "sideEffects": false,
29
29
  "peerDependencies": {
30
- "vue": "^3.0.0"
30
+ "vue": "2.x || 3.x"
31
31
  },
32
32
  "dependencies": {
33
33
  "@ohbug/core": "2.1.0",
34
34
  "@ohbug/types": "2.1.0"
35
35
  },
36
- "devDependencies": {
37
- "vue": "^3.2.37"
38
- },
39
36
  "publishConfig": {
40
37
  "access": "public"
41
38
  },
42
39
  "scripts": {
43
40
  "build": "tsup",
44
41
  "dev": "tsup --watch"
45
- },
46
- "readme": "# `@ohbug/vue`\n\n[![npm](https://img.shields.io/npm/v/@ohbug/vue.svg?style=flat-square)](https://www.npmjs.com/package/@ohbug/vue)\n[![npm bundle size](https://img.shields.io/bundlephobia/min/@ohbug/vue?style=flat-square)](https://bundlephobia.com/result?p=@ohbug/vue)\n\nEnglish | [简体中文](./README-zh_CN.md)\n\n## Installation\n\n```\npnpm instal @ohbug/browser @ohbug/vue\n```\n\n## Usage\n\n```javascript\nimport Vue from 'vue'\nimport Ohbug from '@ohbug/browser'\nimport OhbugVue from '@ohbug/vue'\n\nconst client = Ohbug.setup({ apiKey: 'YOUR_API_KEY' })\n\nVue.createApp(App)\n .use(OhbugVue(client))\n .mount('#app')\n```\n"
42
+ }
47
43
  }