Skip to content

Commit

Permalink
feat: Add multiErrorExtractor. Almost complete rewrite of the plugin.
Browse files Browse the repository at this point in the history
* Added tests
* Added multiErrorExtractor for extracting all error messages from a validator object.

BREAKING CHANGE:  template structure changed. Rename messageExtractorMixin to single-error-extractor-mixin.
  • Loading branch information
dobromir-hristov committed Jul 4, 2018
1 parent 2b8ca8b commit 2c041dd
Show file tree
Hide file tree
Showing 36 changed files with 9,178 additions and 4,691 deletions.
5 changes: 1 addition & 4 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@
],
"env": {
"test": {
"plugins": [
"istanbul"
],
"presets": [
"power-assert"
["env", { "targets": { "node": 8 }}]
]
}
}
Expand Down
52 changes: 42 additions & 10 deletions config/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,57 @@ const entries = {
moduleName,
banner
},
mixin: {
messageExtractorMixin: {
entry: 'src/message-extractor-mixin.js',
dest: 'dist/message-extractor-mixin.js',
dest: 'dist/message-extractor-mixin.min.js',
format: 'umd',
env: 'development',
moduleName: moduleName + 'Mixin',
env: 'production',
moduleName: moduleName + 'ExtractorMixin',
banner
},
foundationExtractor: {
entry: 'src/templates/message-extractor/foundation6.vue',
dest: `dist/templates/message-extractor/foundation6.min.js`,
format: 'umd',
env: 'production',
moduleName: moduleName + 'Foundation6Template',
banner
},
bootstrapExtractor: {
entry: 'src/templates/message-extractor/bootstrap3.vue',
dest: `dist/templates/message-extractor/bootstrap3.min.js`,
format: 'umd',
env: 'production',
moduleName: moduleName + 'Bootstrap3Template',
banner
},
multiMessageExtractorMixin: {
entry: 'src/multi-message-extractor-mixin.js',
dest: 'dist/multi-message-extractor-mixin.min.js',
format: 'umd',
env: 'production',
moduleName: moduleName + 'multiMessageExtractorMixin',
banner
},
baseFlatExtractor: {
entry: 'src/templates/multi-message-extractor/baseFlatErrorExtractor.vue',
dest: `dist/templates/multi-message-extractor/baseFlatErrorExtractor.min.js`,
format: 'umd',
env: 'production',
moduleName: moduleName + 'baseFlatErrorExtractor',
banner
},
foundationUmd: {
entry: 'src/templates/foundation6.vue',
dest: `dist/templates/foundation6.min.js`,
foundationFlatExtractor: {
entry: 'src/templates/multi-message-extractor/foundation6.vue',
dest: `dist/templates/multi-message-extractor/foundation6.min.js`,
format: 'umd',
env: 'production',
moduleName: moduleName + 'Foundation6Template',
banner
},
bootstrapUmd: {
entry: 'src/templates/bootstrap3.vue',
dest: `dist/templates/bootstrap3.min.js`,
bootstrapFlatExtractorUmd: {
entry: 'src/templates/multi-message-extractor/bootstrap3.vue',
dest: `dist/templates/multi-message-extractor/bootstrap3.min.js`,
format: 'umd',
env: 'production',
moduleName: moduleName + 'Bootstrap3Template',
Expand Down
21 changes: 10 additions & 11 deletions config/webpack.dev.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ module.exports = {
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},{
test: /\.js$/,
exclude: /node_modules|vue\/dist/,
loader: 'babel-loader'
}]
{
test: /\.vue$/,
loader: 'vue-loader'
}, {
test: /\.js$/,
exclude: /node_modules|vue\/dist/,
loader: 'babel-loader'
}]
},
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'vue$': 'vue/dist/vue.esm.js'
}
},
plugins: [
Expand All @@ -36,6 +36,5 @@ module.exports = {
NODE_ENV: '"development"'
}
})
],
devtool: '#eval-source-map'
]
}
36 changes: 0 additions & 36 deletions config/webpack.test.conf.js

This file was deleted.

Loading

0 comments on commit 2c041dd

Please sign in to comment.