Skip to content

Commit 61e6f92

Browse files
authored
Merge pull request #9 from websmurf/webpack-2-jest
Webpack 2 + Jest tests
2 parents dee039c + bf9be80 commit 61e6f92

27 files changed

+542
-412
lines changed

.babelrc

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
{
22
"presets": [
3-
["env", { "modules": false }]
4-
]
3+
["env", {
4+
"modules": false,
5+
"targets": {
6+
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
7+
}
8+
}],
9+
"stage-2"
10+
],
11+
"plugins": ["transform-vue-jsx", "transform-runtime"],
12+
"env": {
13+
"test": {
14+
"presets": ["env", "stage-2"],
15+
"plugins": ["transform-vue-jsx", "transform-es2015-modules-commonjs", "dynamic-import-node"]
16+
}
17+
}
518
}

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ indent_style = space
66
indent_size = 2
77
end_of_line = lf
88
insert_final_newline = true
9-
trim_trailing_whitespace = true
9+
trim_trailing_whitespace = true

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
build/*.js
2-
dist/*.js

.eslintrc.js

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,30 @@
1-
// http://eslint.org/docs/user-guide/configuring
1+
// https://eslint.org/docs/user-guide/configuring
2+
23
module.exports = {
34
root: true,
4-
parser: 'babel-eslint',
55
parserOptions: {
6-
sourceType: 'module'
6+
parser: 'babel-eslint'
77
},
88
env: {
99
browser: true,
1010
},
11-
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
12-
extends: 'standard',
11+
extends: [
12+
// https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
13+
// consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
14+
'plugin:vue/recommended',
15+
// https://github.com/standard/standard/blob/master/docs/RULES-en.md
16+
'standard'
17+
],
1318
// required to lint *.vue files
1419
plugins: [
15-
'html'
20+
'vue'
1621
],
1722
// add your custom rules here
18-
'rules': {
19-
// allow paren-less arrow functions
20-
'arrow-parens': 0,
23+
rules: {
2124
// allow async-await
22-
'generator-star-spacing': 0,
25+
'generator-star-spacing': 'off',
26+
'vue/max-attributes-per-line': 'off',
2327
// allow debugger during development
24-
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0
28+
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
2529
}
2630
}

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
node_modules
2-
.idea
3-
test/coverage/
2+
test/unit/coverage/

.postcssrc.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// https://github.com/michael-ciniawsky/postcss-load-config
2+
3+
module.exports = {
4+
"plugins": {
5+
// to edit target browsers: use "browserslist" field in package.json
6+
"autoprefixer": {}
7+
}
8+
}

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Optional packages:
1414
## Install
1515

1616
```
17-
$ npm install vue2-notify --save
17+
$ yarn add vue2-notify
1818
```
1919

2020
Then in your main.js:
@@ -123,7 +123,6 @@ const types = {
123123
error: { itemClass: 'is-danger' },
124124
warning: { itemClass: 'is-warning' },
125125
success: { itemClass: 'is-success', iconClass: 'fa fa-lg fa-check-circle' }
126-
127126
}
128127

129128
Vue.$notify.setTypes(types);

build/dev.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Vue from 'vue'
2-
import Notify from '../src/install'
2+
import Notify from '../src/index.js'
33

44
// Use Notify
55
Vue.use(Notify)
@@ -13,6 +13,9 @@ new Vue({
1313
'<button class="btn btn-danger mr-1" @click="error">Error</button>' +
1414
'<button class="btn btn-secondary mr-1" @click="advanced">Advanced</button>' +
1515
'</div>',
16+
components: {
17+
Notify
18+
},
1619
methods: {
1720
error () {
1821
this.$notify('This is an error message', 'error')
@@ -27,7 +30,7 @@ new Vue({
2730
this.$notify('This is a success message', 'success')
2831
},
2932
advanced () {
30-
this.$notify('This is an advanced message', 'info', { visibility: 10000, iconClass: 'fa fa-lg fa-handshake-o' })
33+
this.$notify('This is an advanced message', 'info', { visibility: 10000, iconClass: 'fa fa-lg fa-handshake-o', closeButtonClass: 'btn btn-default pull-right' })
3134
}
3235
}
3336
}).$mount('#app')

build/prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
module.exports = require('../src/install.js')
1+
module.exports = require('../src/index.js')

dist/build.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)