├── .gitignore ├── LICENSE ├── README.md ├── index.js ├── package-lock.json ├── package.json └── tests ├── .env.default ├── index.html ├── src ├── App.vue ├── assets │ └── logo.png └── main.js └── webpack.config.js /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | 6 | # Runtime data 7 | pids 8 | *.pid 9 | *.seed 10 | 11 | # Directory for instrumented libs generated by jscoverage/JSCover 12 | lib-cov 13 | 14 | # Coverage directory used by tools like istanbul 15 | coverage 16 | 17 | # nyc test coverage 18 | .nyc_output 19 | 20 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 21 | .grunt 22 | 23 | # node-waf configuration 24 | .lock-wscript 25 | 26 | # Compiled binary addons (http://nodejs.org/api/addons.html) 27 | build/Release 28 | 29 | # Dependency directories 30 | node_modules 31 | jspm_packages 32 | 33 | # Optional npm cache directory 34 | .npm 35 | 36 | # Optional REPL history 37 | .node_repl_history 38 | 39 | # Local env file 40 | .env 41 | 42 | # dist folder 43 | tests/dist 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Gaël Reyrol 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vue-rollbar 2 | 3 | [![npm (scoped with tag)](https://img.shields.io/npm/v/vue-rollbar/latest.svg?style=flat-square)](https://npmjs.com/package/vue-rollbar) 4 | [![npm](https://img.shields.io/npm/dt/vue-rollbar.svg?style=flat-square)](https://npmjs.com/package/vue-rollbar) 5 | [![Dependencies](https://david-dm.org/Zevran/vue-rollbar/status.svg?style=flat-square)](https://david-dm.org/Zevran/vue-rollbar) 6 | [![js-standard-style](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com) 7 | 8 | > Rollbar plugin for Vue.js 9 | 10 | ## Installation 11 | 12 | ```bash 13 | npm install vue-rollbar --save 14 | ``` 15 | 16 | ### Usage 17 | 18 | ```javascript 19 | var Vue = require('vue'); 20 | var Rollbar = require('vue-rollbar'); 21 | 22 | Vue.use(Rollbar, { 23 | accessToken: 'YOUR_ROLLBAR_FRONT_TOKEN', 24 | ...options 25 | }); 26 | ``` 27 | 28 | You can now use Rollbar anywhere in your Vue app. 29 | 30 | ```javascript 31 | Vue.rollbar.debug('Yohyo!'); 32 | // or in a vue component 33 | this.$rollbar.debug('Yohyo!') 34 | ``` 35 | 36 | See [Rollbar javascript documentation](https://rollbar.com/docs/notifier/rollbar.js/) for options 37 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var Rollbar = require('rollbar'); 2 | 3 | module.exports = { 4 | install: function(Vue, options) { 5 | Vue.rollbar = new Rollbar(options); 6 | Vue.prototype.$rollbar = Vue.rollbar; 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vue-rollbar", 3 | "version": "1.0.0", 4 | "description": "Rollbar plugin for Vue.js", 5 | "main": "index.js", 6 | "scripts": { 7 | "dev": "cd tests && cross-env NODE_ENV=development webpack-dev-server --open --hot", 8 | "build": "cd tests && cross-env NODE_ENV=production webpack --progress --hide-modules" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/Zevran/vue-rollbar.git" 13 | }, 14 | "keywords": [ 15 | "vuejs", 16 | "vue", 17 | "vue-plugin", 18 | "rollbar" 19 | ], 20 | "author": "Gaël Reyrol ", 21 | "license": "(MIT)", 22 | "bugs": { 23 | "url": "https://github.com/Zevran/vue-rollbar/issues" 24 | }, 25 | "homepage": "https://github.com/Zevran/vue-rollbar#readme", 26 | "dependencies": { 27 | "rollbar": "^2.5.2" 28 | }, 29 | "devDependencies": { 30 | "@babel/core": "^7.3.4", 31 | "@babel/preset-env": "^7.3.4", 32 | "babel-loader": "^8.0.5", 33 | "cross-env": "^5.2.0", 34 | "css-loader": "^2.1.0", 35 | "dotenv": "^6.2.0", 36 | "file-loader": "^3.0.1", 37 | "style-loader": "^0.23.1", 38 | "vue": "^2.6.7", 39 | "vue-loader": "^15.7.0", 40 | "vue-template-compiler": "^2.6.7", 41 | "webpack": "^4.29.6", 42 | "webpack-cli": "^3.2.3", 43 | "webpack-dev-server": "^3.2.1" 44 | }, 45 | "peerDependencies": { 46 | "vue": "^2.6.7" 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /tests/.env.default: -------------------------------------------------------------------------------- 1 | ROLLBAR_CLIENT_TOKEN= 2 | -------------------------------------------------------------------------------- /tests/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | tests 6 | 7 | 8 |
9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/src/App.vue: -------------------------------------------------------------------------------- 1 | 37 | 38 | 51 | 52 | 81 | -------------------------------------------------------------------------------- /tests/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gaelreyrol/vue-rollbar/7fa9b9863c020036ceadfc1ec95822e51b0646ab/tests/src/assets/logo.png -------------------------------------------------------------------------------- /tests/src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import Rollbar from '../../index.js' 4 | 5 | Vue.use(Rollbar, { 6 | accessToken: ROLLBAR_CLIENT_TOKEN, 7 | captureUncaught: true, 8 | captureUnhandledRejections: true, 9 | }) 10 | 11 | new Vue({ 12 | el: '#app', 13 | render: h => h(App) 14 | }) 15 | 16 | Vue.rollbar.debug('Heyhey!') 17 | -------------------------------------------------------------------------------- /tests/webpack.config.js: -------------------------------------------------------------------------------- 1 | var path = require('path') 2 | var webpack = require('webpack') 3 | var dotenv = require('dotenv') 4 | var VueLoaderPlugin = require('vue-loader/lib/plugin') 5 | 6 | dotenv.config() 7 | 8 | module.exports = { 9 | entry: './src/main.js', 10 | output: { 11 | path: path.resolve(__dirname, './dist'), 12 | publicPath: '/dist/', 13 | filename: 'build.js' 14 | }, 15 | module: { 16 | rules: [ 17 | { 18 | test: /\.vue$/, 19 | loader: 'vue-loader' 20 | }, 21 | { 22 | test: /\.js$/, 23 | loader: 'babel-loader', 24 | exclude: /node_modules/, 25 | options: { 26 | presets: [ 27 | '@babel/preset-env' 28 | ] 29 | } 30 | }, 31 | { 32 | test: /\.(png|jpg|gif|svg)$/, 33 | loader: 'file-loader', 34 | options: { 35 | name: '[name].[ext]?[hash]' 36 | } 37 | }, 38 | { 39 | test: /\.css$/, 40 | use: [ 'style-loader', 'css-loader' ] 41 | } 42 | ] 43 | }, 44 | resolve: { 45 | alias: { 46 | 'vue$': 'vue/dist/vue.esm.js' 47 | } 48 | }, 49 | devServer: { 50 | historyApiFallback: true, 51 | noInfo: true 52 | }, 53 | performance: { 54 | hints: false 55 | }, 56 | devtool: '#eval-source-map', 57 | plugins: [ 58 | new VueLoaderPlugin(), 59 | new webpack.DefinePlugin({ 60 | 'ROLLBAR_CLIENT_TOKEN': JSON.stringify(process.env.ROLLBAR_CLIENT_TOKEN) 61 | }) 62 | ] 63 | } 64 | --------------------------------------------------------------------------------