Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
fix(compiler): dependencies out of date
Browse files Browse the repository at this point in the history
see #221
  • Loading branch information
MatteoGabriele committed Nov 12, 2019
1 parent 8fcf04e commit 31176cc
Show file tree
Hide file tree
Showing 22 changed files with 3,404 additions and 4,894 deletions.
3 changes: 1 addition & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"presets": ["blue"],
"plugins": ["transform-runtime"]
"presets": ["@babel/preset-env"]
}
43 changes: 0 additions & 43 deletions config/base.config.js

This file was deleted.

69 changes: 0 additions & 69 deletions config/scripts/build.js

This file was deleted.

29 changes: 0 additions & 29 deletions config/scripts/dev.js

This file was deleted.

10 changes: 4 additions & 6 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
const blueJest = require('blue-jest')

module.exports = Object.assign({}, blueJest, {
moduleNameMapper: Object.assign({}, blueJest.moduleNameMapper, {
module.exports = {
moduleNameMapper: {
'^lib/(.*)$': '<rootDir>/src/lib/$1',
'^directives/(.*)$': '<rootDir>/src/directives/$1',
'vue$': 'vue/dist/vue.min.js'
})
})
}
}
43 changes: 17 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
},
"scripts": {
"commit": "git-cz",
"dev": "node ./config/scripts/dev.js",
"build": "node ./config/scripts/build.js",
"prepublish": "node ./config/scripts/build.js",
"test": "jest --config ./jest.config.js",
"test:watch": "jest --config ./jest.config.js --watch --verbose",
"build": "webpack --mode production",
"dev": "webpack --mode development --watch",
"test": "jest",
"prepublish": "webpack --mode production",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"config": {
Expand Down Expand Up @@ -44,25 +43,17 @@
},
"homepage": "https://github.com/MatteoGabriele/vue-analytics#readme",
"devDependencies": {
"babel-core": "^6.24.1",
"babel-loader": "^7.0.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-blue": "^1.0.0-beta.29",
"blue-jest": "^1.5.0",
"commitizen": "^2.9.6",
"compression-webpack-plugin": "^0.4.0",
"cz-conventional-changelog": "2.0.0",
"friendly-errors-webpack-plugin": "^1.6.1",
"jest": "^20.0.0",
"jest-cli": "^21.2.1",
"ora": "^1.2.0",
"semantic-release": "^7.0.1",
"vue": "^2.5.9",
"vue-loader": "^13.5.0",
"vue-router": "^2.7.0",
"vue-template-compiler": "^2.5.9",
"webpack": "^3.4.1",
"webpack-merge": "^4.1.0"
},
"dependencies": {}
"@babel/core": "^7.7.2",
"@babel/preset-env": "^7.7.1",
"babel-loader": "^8.0.6",
"commitizen": "^4.0.3",
"compression-webpack-plugin": "^3.0.0",
"cz-conventional-changelog": "^3.0.2",
"jest": "^24.9.0",
"terser-webpack-plugin": "^2.2.1",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.10"
}
}
2 changes: 1 addition & 1 deletion src/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { promisify, loadScript, shouldGaLoad } from './helpers'
import config, { update } from './config'
import createTrackers from './create-trackers'
import collectors from './collectors'
import { autoTracking } from 'lib/page'
import { autoTracking } from './lib/page'
import untracked from './untracked'
import noga from './no-ga'

Expand Down
8 changes: 4 additions & 4 deletions src/collectors.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import _require from 'lib/require'
import set from 'lib/set'
import _require from './lib/require'
import set from './lib/set'
import config from './config'

export const setters = function () {
config.set.forEach(({ field, value }) => {
if (typeof field === 'undefined' || typeof value === 'undefined') {
throw new Error(
'[vue-analytics] Wrong configuration in the plugin options.\n' +
'[vue-analytics] Wrong configuration in the plugin options.\n' +
'The "set" array requires each item to have a "field" and a "value" property.'
)
}
Expand Down Expand Up @@ -46,5 +46,5 @@ export const requires = function () {

export default function () {
setters()
requires()
requires()
}
4 changes: 2 additions & 2 deletions src/create-trackers.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import set from 'lib/set'
import query from 'lib/query'
import set from './lib/set'
import query from './lib/query'
import config, { getId } from './config'
import { getTracker } from './helpers'

Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import bootstrap from './bootstrap'
import lib from './lib'
import { update } from './config'
import * as helpers from './helpers'
import ga from 'directives/ga'
import { autotracking as expectionAutotracking } from 'lib/exception'
import ga from './directives/ga'
import { autotracking as expectionAutotracking } from './lib/exception'
import vuexMiddleware from './vuex-middleware'

export default function install (Vue, options = {}) {
Expand Down
10 changes: 5 additions & 5 deletions src/lib/ecommerce.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import query from 'lib/query'
import query from './query'
import config from '../config'

const getMethod = function (name) {
return `${config.ecommerce.enhanced ? 'ec' : 'ecommerce'}:${name}`
}

const featuresList = [
'addItem',
'addTransaction',
'addProduct',
'addImpression',
'addItem',
'addTransaction',
'addProduct',
'addImpression',
'setAction',
'addPromo',
'send'
Expand Down
2 changes: 1 addition & 1 deletion src/lib/event.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import query from 'lib/query'
import query from './query'

export default function event (...args) {
query('send', 'event', ...args)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/exception.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import query from 'lib/query'
import query from './query'
import config from '../config'

const exception = (error, fatal = false) => {
Expand Down
20 changes: 10 additions & 10 deletions src/lib/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import event from 'lib/event'
import exception from 'lib/exception'
import page from 'lib/page'
import query from 'lib/query'
import require from 'lib/require'
import set from 'lib/set'
import social from 'lib/social'
import time from 'lib/time'
import ecommerce from 'lib/ecommerce'
import screenview from 'lib/screenview'
import event from './event'
import exception from './exception'
import page from './page'
import query from './query'
import require from './require'
import set from './set'
import social from './social'
import time from './time'
import ecommerce from './ecommerce'
import screenview from './screenview'
import config from '../config'
import noga from '../no-ga'

Expand Down
6 changes: 3 additions & 3 deletions src/lib/page.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import config from '../config'
import set from 'lib/set'
import screenview from 'lib/screenview'
import query from 'lib/query'
import set from './set'
import screenview from './screenview'
import query from './query'
import {
getQueryString,
isRouteIgnored,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/require.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import query from 'lib/query'
import query from './query'

export default function (...args) {
if (args.length == 2) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/screenview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import query from 'lib/query'
import query from './query'

export default function screenview (...args) {
const [screenName] = args
Expand Down
2 changes: 1 addition & 1 deletion src/lib/set.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import query from 'lib/query'
import query from './query'

export default function set (...args) {
if (typeof args[0] === 'object' && args[0].constructor === Object) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/social.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import query from 'lib/query'
import query from './query'

export default function social (...args) {
query('send', 'social', ...args)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/time.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import query from 'lib/query'
import query from './query'

export default function time (...args) {
query('send', 'timing', ...args)
Expand Down
26 changes: 26 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const TerserPlugin = require('terser-webpack-plugin')
const CompressionPlugin = require('compression-webpack-plugin')

module.exports = function (env, argv) {
const isProduction = argv.mode === 'production'

return {
output: {
libraryTarget: 'umd',
filename: 'vue-analytics.js'
},
optimization: {
minimize: isProduction,
minimizer: [
new TerserPlugin({
terserOptions: {
compress: isProduction
}
})
]
},
plugins: [
...(isProduction ? [new CompressionPlugin()] : [])
]
}
}
Loading

0 comments on commit 31176cc

Please sign in to comment.