Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
se-panfilov committed Sep 15, 2017
1 parent b5a72a5 commit 0477a6b
Show file tree
Hide file tree
Showing 10 changed files with 989 additions and 603 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v7.5.0
v8.4.0
4 changes: 2 additions & 2 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
### TODOs
| Filename | line # | TODO
|:------|:------:|:------
| main.js | 71 | @S.Panfilov fix 'vueApp' in param
| main.js | 81 | @S.Panfilov not sure - throw error here or just warn
| main.js | 69 | @S.Panfilov fix 'vueApp' in param
| main.js | 79 | @S.Panfilov not sure - throw error here or just warn
| main.js | 176 | @S.Panfilov add ability to access this.notifications.someError.message
| main.js | 177 | @S.Panfilov add "noCall:true" property
| unit/main.spec.js | 278 | @S.Panfilov fix this test
15 changes: 8 additions & 7 deletions dist/vue-notifications.es5.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ var TYPE = {
success: 'success'
};

var VUE_VERSION = {
eva: 1,
ghost: 2
};
var EVANGELION = 1;
var GHOST_IN_THE_SHELL = 2;

var MESSAGES = {
alreadyInstalled: PLUGIN_NAME + ': plugin already installed',
Expand All @@ -38,7 +36,7 @@ function getMajorVersion(Vue) {
}

function showInConsole(msg, type, types) {
if (type === types.error) console.error(msg);else if (type === types.warn) console.warn(msg);else if (type === types.success) console.info(msg);else console.log(msg);
if (type === types.error) console.error(msg);else if (type === types.warn) console.warn(msg);else console.log(msg);
}

function showDefaultMessage(_ref) {
Expand All @@ -53,6 +51,7 @@ function showDefaultMessage(_ref) {

return msg;
}

function getValues(vueApp, config) {
var result = {};
var keepFnFields = ['cb'];
Expand Down Expand Up @@ -110,6 +109,7 @@ function makeMethod(vueApp, configName, options, pluginOptions) {
return showMessage(newConfig, pluginOptions, vueApp);
};
}

function initVueNotificationPlugin(vueApp, notifications, pluginOptions) {
if (!notifications) return;
Object.keys(notifications).forEach(function (name) {
Expand All @@ -118,6 +118,7 @@ function initVueNotificationPlugin(vueApp, notifications, pluginOptions) {

vueApp.$emit(PACKAGE_NAME + '-initiated');
}

function unlinkVueNotificationPlugin(vueApp, notifications) {
if (!notifications) return;
var attachedMethods = vueApp.$options.methods;
Expand All @@ -140,11 +141,11 @@ function makeMixin(Vue, pluginOptions) {
mounted: ''
};

if (getMajorVersion(Vue) === VUE_VERSION.eva) {
if (getMajorVersion(Vue) === EVANGELION) {
hooks.init = 'init';
hooks.mounted = 'compiled';
}
if (getMajorVersion(Vue) === VUE_VERSION.ghost) {
if (getMajorVersion(Vue) === GHOST_IN_THE_SHELL) {
hooks.init = 'beforeCreate';
hooks.mounted = 'mounted';
}
Expand Down
2 changes: 1 addition & 1 deletion dist/vue-notifications.es5.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/vue-notifications.es5.min.js.map

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions dist/vue-notifications.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ const TYPE = {
success: 'success'
}

const VUE_VERSION = {
eva: 1,
ghost: 2
}
const EVANGELION = 1
const GHOST_IN_THE_SHELL = 2

const MESSAGES = {
alreadyInstalled: `${PLUGIN_NAME}: plugin already installed`,
Expand All @@ -27,7 +25,6 @@ function getMajorVersion (Vue) {
function showInConsole (msg, type, types) {
if (type === types.error) console.error(msg)
else if (type === types.warn) console.warn(msg)
else if (type === types.success) console.info(msg)
else console.log(msg)
}

Expand All @@ -38,6 +35,7 @@ function showDefaultMessage ({type, message, title, debugMsg}) {

return msg
}

function getValues (vueApp, config) {
const result = {}
const keepFnFields = ['cb']
Expand Down Expand Up @@ -95,6 +93,7 @@ function makeMethod (vueApp, configName, options, pluginOptions) {
return showMessage(newConfig, pluginOptions, vueApp)
}
}

function initVueNotificationPlugin (vueApp, notifications, pluginOptions) {
if (!notifications) return
Object.keys(notifications).forEach(name => {
Expand All @@ -103,6 +102,7 @@ function initVueNotificationPlugin (vueApp, notifications, pluginOptions) {

vueApp.$emit(`${PACKAGE_NAME}-initiated`)
}

function unlinkVueNotificationPlugin (vueApp, notifications) {
if (!notifications) return
const attachedMethods = vueApp.$options.methods
Expand All @@ -123,11 +123,11 @@ function makeMixin (Vue, pluginOptions) {
mounted: ''
}

if (getMajorVersion(Vue) === VUE_VERSION.eva) {
if (getMajorVersion(Vue) === EVANGELION) {
hooks.init = 'init'
hooks.mounted = 'compiled'
}
if (getMajorVersion(Vue) === VUE_VERSION.ghost) {
if (getMajorVersion(Vue) === GHOST_IN_THE_SHELL) {
hooks.init = 'beforeCreate'
hooks.mounted = 'mounted'
}
Expand Down
2 changes: 1 addition & 1 deletion dist/vue-notifications.es6.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,46 +35,46 @@
"homepage": "https://github.com/se-panfilov/vue-notifications#readme",
"devDependencies": {
"babel": "^6.23.0",
"babel-cli": "^6.24.1",
"babel-core": "^6.24.1",
"babel-loader": "^6.4.1",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-plugin-transform-es3-member-expression-literals": "^6.22.0",
"babel-plugin-transform-es3-property-literals": "^6.22.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-latest": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"babel-runtime": "^6.23.0",
"babel-runtime": "^6.26.0",
"babelify": "^7.3.0",
"babili": "0.0.12",
"browserify": "^14.3.0",
"chai": "^3.5.0",
"eslint": "^3.19.0",
"eslint-config-standard": "^10.2.0",
"eslint-friendly-formatter": "^2.0.7",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-node": "^4.2.2",
"babili": "0.1.4",
"browserify": "^14.4.0",
"chai": "^4.1.2",
"eslint": "^4.6.1",
"eslint-config-standard": "^10.2.1",
"eslint-friendly-formatter": "^3.0.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-node": "^5.1.1",
"eslint-plugin-promise": "^3.5.0",
"eslint-plugin-standard": "^3.0.1",
"gulp": "^3.9.1",
"gulp-babel": "^6.1.2",
"gulp-babel": "^7.0.0",
"gulp-concat": "^2.6.1",
"gulp-eslint": "^3.0.1",
"gulp-eslint": "^4.0.0",
"gulp-notify": "^3.0.0",
"gulp-plumber": "^1.1.0",
"gulp-rename": "^1.2.2",
"gulp-size": "^2.1.0",
"gulp-sourcemaps": "^2.6.0",
"gulp-sourcemaps": "^2.6.1",
"gulp-strip-code": "^0.1.4",
"gulp-todo": "^5.3.0",
"gulp-uglify": "^2.1.2",
"gulp-todo": "^5.4.0",
"gulp-uglify": "^3.0.0",
"gulp-umd": "^0.2.1",
"gulp-watch": "^4.3.11",
"mocha": "^3.2.0",
"require-dir": "^0.3.1",
"run-sequence": "^1.2.2",
"sinon": "^2.1.0",
"sinon-chai": "^2.9.0",
"mocha": "^3.5.3",
"require-dir": "^0.3.2",
"run-sequence": "^2.1.0",
"sinon": "^3.2.1",
"sinon-chai": "^2.13.0",
"source": "0.0.3",
"through2": "^2.0.3",
"to-case": "^2.0.0",
Expand Down
14 changes: 7 additions & 7 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ const TYPE = {
success: 'success'
}

const VUE_VERSION = {
eva: 1,
ghost: 2
}
const EVANGELION = 1
const GHOST_IN_THE_SHELL = 2

const MESSAGES = {
alreadyInstalled: `${PLUGIN_NAME}: plugin already installed`,
Expand All @@ -27,7 +25,6 @@ function getMajorVersion (Vue) {
function showInConsole (msg, type, types) {
if (type === types.error) console.error(msg)
else if (type === types.warn) console.warn(msg)
else if (type === types.success) console.info(msg)
else console.log(msg)
}

Expand All @@ -38,6 +35,7 @@ function showDefaultMessage ({type, message, title, debugMsg}) {

return msg
}

function getValues (vueApp, config) {
const result = {}
const keepFnFields = ['cb']
Expand Down Expand Up @@ -95,6 +93,7 @@ function makeMethod (vueApp, configName, options, pluginOptions) {
return showMessage(newConfig, pluginOptions, vueApp)
}
}

function initVueNotificationPlugin (vueApp, notifications, pluginOptions) {
if (!notifications) return
Object.keys(notifications).forEach(name => {
Expand All @@ -103,6 +102,7 @@ function initVueNotificationPlugin (vueApp, notifications, pluginOptions) {

vueApp.$emit(`${PACKAGE_NAME}-initiated`)
}

function unlinkVueNotificationPlugin (vueApp, notifications) {
if (!notifications) return
const attachedMethods = vueApp.$options.methods
Expand All @@ -123,11 +123,11 @@ function makeMixin (Vue, pluginOptions) {
mounted: ''
}

if (getMajorVersion(Vue) === VUE_VERSION.eva) {
if (getMajorVersion(Vue) === EVANGELION) {
hooks.init = 'init'
hooks.mounted = 'compiled'
}
if (getMajorVersion(Vue) === VUE_VERSION.ghost) {
if (getMajorVersion(Vue) === GHOST_IN_THE_SHELL) {
hooks.init = 'beforeCreate'
hooks.mounted = 'mounted'
}
Expand Down
Loading

0 comments on commit 0477a6b

Please sign in to comment.