Skip to content

Commit

Permalink
fix: update sentry to latest version without bug & etc.
Browse files Browse the repository at this point in the history
 - release sentry with source map
  • Loading branch information
cnwangjie committed Jul 25, 2019
1 parent f8863ff commit 7d84ce5
Show file tree
Hide file tree
Showing 10 changed files with 1,647 additions and 1,435 deletions.
1 change: 1 addition & 0 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[
"@babel/preset-env",
{
"modules": false,
"targets": "last 1 years"
}
]
Expand Down
32 changes: 28 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
install_dependencies:
docker:
- image: circleci/node:8.11.3-jessie
- image: circleci/node:10.10-jessie
working_directory: ~/ext
steps:
- checkout
Expand All @@ -19,7 +19,7 @@ jobs:

build:
docker:
- image: circleci/node:8.11.3-jessie
- image: circleci/node:10.10-jessie
working_directory: ~/ext
steps:
- restore_cache:
Expand All @@ -29,9 +29,23 @@ jobs:
key: build-{{ .Environment.CIRCLE_SHA1 }}
paths: ~/ext

release_sentry:
docker:
- image: getsentry/sentry-cli
working_directory: ~/ext
steps:
- restore_cache:
key: build-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: release sentry
command: |
sentry-cli releases new ${CIRCLE_TAG}
sentry-cli releases files ${CIRCLE_TAG} upload-sourcemaps dist
sentry-cli releases finalize ${CIRCLE_TAG}
publish_chrome:
docker:
- image: circleci/node:8.11.3-jessie
- image: circleci/node:10.10-jessie
working_directory: ~/ext
steps:
- restore_cache:
Expand All @@ -45,7 +59,7 @@ jobs:
publish_firefox:
docker:
- image: circleci/node:8.11.3-jessie
- image: circleci/node:10.10-jessie
working_directory: ~/ext
steps:
- restore_cache:
Expand Down Expand Up @@ -91,7 +105,16 @@ workflows:
filters:
tags:
only: /^v.*/
- release_sentry:
requires:
- build
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
- publish_chrome:
type: approval
requires:
- build
filters:
Expand All @@ -100,6 +123,7 @@ workflows:
branches:
ignore: /.*/
- publish_firefox:
type: approval
requires:
- build
filters:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ dist.zip
.sonar*
.scanner*
stats.json
.DS_Store
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
"author": "cnwangjie",
"license": "MIT",
"scripts": {
"dev": "cross-env NODE_ENV=development webpack --watch",
"dev": "cross-env NODE_ENV=development webpack --config webpack.dev.js --watch",
"dev:moz": "cross-env MOZ=1 yarn dev",
"build": "cross-env NODE_ENV=production webpack",
"build": "cross-env NODE_ENV=production webpack --config webpack.prod.js",
"postbuild": "yarn run package",
"package": "rm -f dist.zip && cd dist && zip -r ../dist.zip ./*",
"lint": "eslint src --ext js,vue",
"prebuild": "yarn lint"
},
"dependencies": {
"@sentry/browser": "^4.5.3",
"@sentry/browser": "^5.5.0",
"@sentry/integrations": "^5.5.0",
"downloadjs": "^1.4.7",
"lodash": "^4.17.10",
"material-design-icons-iconfont": "^3.0.3",
Expand Down Expand Up @@ -61,7 +62,8 @@
"vue-template-compiler": "^2.5.16",
"vuetify-loader": "^1.2.1",
"webpack": "^4.6.0",
"webpack-cli": "^3.1.2"
"webpack-cli": "^3.1.2",
"webpack-merge": "^4.2.1"
},
"sideEffects": [
"**/index.js",
Expand Down
1 change: 0 additions & 1 deletion src/app/page/main/DetailList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ export default {
this.expandList([true, item.listIndex])
this.currentHighlightItem = this.$refs[`list-${item.listIndex}-tab`][item.tabIndex]
}
console.log(this.currentHighlightItem)
this.currentHighlightItem.$el.classList.add('elevation-20')
this.$vuetify.goTo(this.currentHighlightItem, opt)
},
Expand Down
5 changes: 3 additions & 2 deletions src/common/logger.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as Sentry from '@sentry/browser'
import * as Integrations from '@sentry/integrations'
import {SENTRY_DSN} from './constants'
import {isBackground} from './utils'
import manifest from '../manifest.json'
Expand Down Expand Up @@ -27,10 +28,10 @@ logger.init = (opts = {}) => {

const {Vue} = opts
const integrations = Sentry.defaultIntegrations
if (Vue) integrations.push(new Sentry.Integrations.Vue({Vue}))
if (Vue) integrations.push(new Integrations.Vue({Vue}))
Sentry.init({
environment: DEBUG ? 'dev' : 'production',
release: manifest.version,
release: 'v' + manifest.version,
dsn: SENTRY_DSN,
debug: DEBUG,
integrations,
Expand Down
28 changes: 15 additions & 13 deletions webpack.config.js → webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,33 @@ const CleanWebpackPlugin = require('clean-webpack-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const { VueLoaderPlugin } = require('vue-loader')
const VuetifyLoaderPlugin = require('vuetify-loader/lib/plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const path = require('path')

const config = require('./config')
const config = {
development: {
__CLIENT_ID__: '530831729511-eq8apt6dhjimbmdli90jp2ple0lfmn3l.apps.googleusercontent.com',
__DEV_CSP__: process.env.MOZ ? '' : ' http://localhost:8098 chrome-extension://nhdogjmejiglipccpnnnanhbledajbpd',
__EXT_NAME__: 'better-onetab (dev)',
__CONTENT_SCRIPTS_MATCHES__: process.env.MOZ ? '*://*/*' : 'http://127.0.0.1:3000/*',
},
production: {
__CLIENT_ID__: '530831729511-dclgvblhv7var13mvpjochb5f295a6vc.apps.googleusercontent.com',
__DEV_CSP__: '',
__EXT_NAME__: '__MSG_ext_name__',
__CONTENT_SCRIPTS_MATCHES__: 'https://boss.cnwangjie.com/*',
}
}

const resolve = (...paths) => path.join(__dirname, ...paths)
const mode = process.env.NODE_ENV || 'development'
const moz = process.env.MOZ
const opts = module.exports = {
mode,
module.exports = {
entry: {
app: ['./src/app/index.js'],
background: ['./src/background/index.js'],
content: './src/content.js',
exchanger: './src/exchanger.js',
},
devtool: 'source-map',
output: {
path: resolve('dist'),
filename : '[name].js',
Expand Down Expand Up @@ -133,11 +143,3 @@ const opts = module.exports = {
}
}

if (opts.mode === 'production') {
opts.optimization.minimizer.push(new UglifyJsPlugin({
uglifyOptions: {
parallel: true,
cache: true,
}
}))
}
8 changes: 8 additions & 0 deletions webpack.dev.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-disable */
const merge = require('webpack-merge')
const common = require('./webpack.common.js')

module.exports = merge(common, {
mode: 'development',
devtool: 'inline-source-map',
})
23 changes: 23 additions & 0 deletions webpack.prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* eslint-disable */
const merge = require('webpack-merge')
const common = require('./webpack.common.js')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')

module.exports = merge(common, {
mode: 'production',
devtool: 'source-map',
optimization: {
minimizer: [
new UglifyJsPlugin({
sourceMap: true,
parallel: true,
cache: true,
uglifyOptions: {
compress: {
drop_debugger: false,
},
},
}),
],
},
})
Loading

0 comments on commit 7d84ce5

Please sign in to comment.